diff --git a/packages/create/templates/common/webpack.config.js b/packages/create/templates/common/webpack.config.js index bda4c382..bf153d04 100644 --- a/packages/create/templates/common/webpack.config.js +++ b/packages/create/templates/common/webpack.config.js @@ -14,7 +14,7 @@ module.exports = (env = {}) => merge(common(env), { plugins: [ new webpack.container.ModuleFederationPlugin({ name: "__plugin_name__", - library: { type: "var", name: "plugin___plugin_name__" }, + library: { type: "window", name: "plugin___plugin_name__" }, exposes: { "./": "./index.__ext__", "./package.json": "./package.json", diff --git a/packages/create/templates/plugin-js/index.js b/packages/create/templates/plugin-js/index.js index 53392577..ff4710df 100644 --- a/packages/create/templates/plugin-js/index.js +++ b/packages/create/templates/plugin-js/index.js @@ -31,12 +31,12 @@ lib.definePermission({ //%endif const plugin = { - name: "// plugin_name //", - title: "// plugin_name //", + name: "__plugin_name__", + title: "__plugin_name__", description: "Example Description. Plugin. Change me in index.js", //%if controller - controllerEntrypoint: "./dist/node/controller", + controllerEntrypoint: "./controller", controllerConfigFields: { "__plugin_name__.myControllerField": { title: "My Controller Field", @@ -48,7 +48,7 @@ const plugin = { //%endif //%if host - hostEntrypoint: "./dist/node/host", + hostEntrypoint: "./host", hostConfigFields: { "__plugin_name__.myHostField": { title: "My Host Field", @@ -60,7 +60,7 @@ const plugin = { //%endif //%if instance - instanceEntrypoint: "./dist/node/instance", + instanceEntrypoint: "./instance", instanceConfigFields: { "__plugin_name__.myInstanceField": { title: "My Instance Field", @@ -72,7 +72,7 @@ const plugin = { //%endif //%if ctl - ctlEntrypoint: "./dist/node/ctl", + ctlEntrypoint: "./ctl", controlConfigFields: { "__plugin_name__.myControlField": { title: "My Control Field", diff --git a/packages/create/templates/plugin-js/messages.js b/packages/create/templates/plugin-js/messages.js index ac982267..aaffd9f6 100644 --- a/packages/create/templates/plugin-js/messages.js +++ b/packages/create/templates/plugin-js/messages.js @@ -19,7 +19,7 @@ class PluginExampleEvent { "myNumberArray": Type.Array(Type.Number()), }); - static fromJson(json) { + static fromJSON(json) { return new PluginExampleEvent(json.myString, json.myNumberArray); } } @@ -41,8 +41,8 @@ class PluginExampleRequest { "myNumberArray": Type.Array(Type.Number()), }); - static fromJson(json) { - return new PluginExampleEvent(json.myString, json.myNumberArray); + static fromJSON(json) { + return new PluginExampleRequest(json.myString, json.myNumberArray); } static Response = plainJson(Type.Object({ diff --git a/packages/create/templates/plugin-js/web/plugin.jsx b/packages/create/templates/plugin-js/web/plugin.jsx index db095219..9cc5942e 100644 --- a/packages/create/templates/plugin-js/web/plugin.jsx +++ b/packages/create/templates/plugin-js/web/plugin.jsx @@ -37,7 +37,7 @@ function MyTemplatePage() { ; } -class WebPlugin extends BaseWebPlugin { +export class WebPlugin extends BaseWebPlugin { //%if controller & web // Subscribing requires web content and the controller subscribableData = new lib.EventSubscriber(ExampleSubscribableUpdate, this.control); @@ -76,7 +76,3 @@ class WebPlugin extends BaseWebPlugin { }; } } - -module.exports = { - WebPlugin, -}; diff --git a/packages/create/templates/plugin-ts/messages.ts b/packages/create/templates/plugin-ts/messages.ts index f7efef57..c0514e33 100644 --- a/packages/create/templates/plugin-ts/messages.ts +++ b/packages/create/templates/plugin-ts/messages.ts @@ -20,7 +20,7 @@ export class PluginExampleEvent { "myNumberArray": Type.Array(Type.Number()), }); - static fromJson(json: Static) { + static fromJSON(json: Static) { return new PluginExampleEvent(json.myString, json.myNumberArray); } } @@ -44,8 +44,8 @@ export class PluginExampleRequest { "myNumberArray": Type.Array(Type.Number()), }); - static fromJson(json: Static) { - return new PluginExampleEvent(json.myString, json.myNumberArray); + static fromJSON(json: Static) { + return new PluginExampleRequest(json.myString, json.myNumberArray); } static Response = plainJson(Type.Object({