build/manifest: print whole manifest variable as it is (#73)
while generating manifest files for both JS and Go sources. fixes #72.
This commit is contained in:
parent
8f6268d813
commit
8cf303c943
6 changed files with 117 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
|||
import {id as pluginId} from './manifest';
|
||||
import manifest from './manifest';
|
||||
|
||||
export default class Plugin {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
@ -7,4 +7,4 @@ export default class Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
window.registerPlugin(pluginId, new Plugin());
|
||||
window.registerPlugin(manifest.id, new Plugin());
|
||||
|
|
31
webapp/src/manifest.js
generated
31
webapp/src/manifest.js
generated
|
@ -1,4 +1,31 @@
|
|||
// This file is automatically generated. Do not modify it manually.
|
||||
|
||||
export const id = 'com.mattermost.plugin-starter-template';
|
||||
export const version = '0.1.0';
|
||||
const manifest = JSON.parse(`
|
||||
{
|
||||
"id": "com.mattermost.plugin-starter-template",
|
||||
"name": "Plugin Starter Template",
|
||||
"description": "This plugin serves as a starting point for writing a Mattermost plugin.",
|
||||
"version": "0.1.0",
|
||||
"min_server_version": "5.12.0",
|
||||
"server": {
|
||||
"executables": {
|
||||
"linux-amd64": "server/dist/plugin-linux-amd64",
|
||||
"darwin-amd64": "server/dist/plugin-darwin-amd64",
|
||||
"windows-amd64": "server/dist/plugin-windows-amd64.exe"
|
||||
},
|
||||
"executable": ""
|
||||
},
|
||||
"webapp": {
|
||||
"bundle_path": "webapp/dist/main.js"
|
||||
},
|
||||
"settings_schema": {
|
||||
"header": "",
|
||||
"footer": "",
|
||||
"settings": []
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
export default manifest;
|
||||
export const id = manifest.id;
|
||||
export const version = manifest.version;
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
import {id, version} from './manifest';
|
||||
import manifest, {id, version} from './manifest';
|
||||
|
||||
test('Plugin manifest, id and version are defined', () => {
|
||||
expect(manifest).toBeDefined();
|
||||
expect(manifest.id).toBeDefined();
|
||||
expect(manifest.version).toBeDefined();
|
||||
});
|
||||
|
||||
// To ease migration, verify separate export of id and version.
|
||||
test('Plugin id and version are defined', () => {
|
||||
expect(id).toBeDefined();
|
||||
expect(version).toBeDefined();
|
||||
|
|
Reference in a new issue