mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 00:13:12 +09:00
Apply suggestions from code review
- Copy paste errors. - Incorrect capitalisation. - Incorrect exports. - Missed find and replace. Co-authored-by: Hornwitser <github@hornwitser.no>
This commit is contained in:
1 parent
8fbdb5dfab
commit
3423e0a30c
5 files changed
+14
-18
No files matched your search
@@ -14,7 +14,7 @@ module.exports = (env = {}) => merge(common(env), {
|
|||||||
plugins: [
|
plugins: [
|
||||||
new webpack.container.ModuleFederationPlugin({
|
new webpack.container.ModuleFederationPlugin({
|
||||||
name: "__plugin_name__",
|
name: "__plugin_name__",
|
||||||
library: { type: "var", name: "plugin___plugin_name__" },
|
library: { type: "window", name: "plugin___plugin_name__" },
|
||||||
exposes: {
|
exposes: {
|
||||||
"./": "./index.__ext__",
|
"./": "./index.__ext__",
|
||||||
"./package.json": "./package.json",
|
"./package.json": "./package.json",
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ lib.definePermission({
|
|||||||
//%endif
|
//%endif
|
||||||
|
|
||||||
const plugin = {
|
const plugin = {
|
||||||
name: "// plugin_name //",
|
name: "__plugin_name__",
|
||||||
title: "// plugin_name //",
|
title: "__plugin_name__",
|
||||||
description: "Example Description. Plugin. Change me in index.js",
|
description: "Example Description. Plugin. Change me in index.js",
|
||||||
//%if controller
|
//%if controller
|
||||||
|
|
||||||
controllerEntrypoint: "./dist/node/controller",
|
controllerEntrypoint: "./controller",
|
||||||
controllerConfigFields: {
|
controllerConfigFields: {
|
||||||
"__plugin_name__.myControllerField": {
|
"__plugin_name__.myControllerField": {
|
||||||
title: "My Controller Field",
|
title: "My Controller Field",
|
||||||
@@ -48,7 +48,7 @@ const plugin = {
|
|||||||
//%endif
|
//%endif
|
||||||
//%if host
|
//%if host
|
||||||
|
|
||||||
hostEntrypoint: "./dist/node/host",
|
hostEntrypoint: "./host",
|
||||||
hostConfigFields: {
|
hostConfigFields: {
|
||||||
"__plugin_name__.myHostField": {
|
"__plugin_name__.myHostField": {
|
||||||
title: "My Host Field",
|
title: "My Host Field",
|
||||||
@@ -60,7 +60,7 @@ const plugin = {
|
|||||||
//%endif
|
//%endif
|
||||||
//%if instance
|
//%if instance
|
||||||
|
|
||||||
instanceEntrypoint: "./dist/node/instance",
|
instanceEntrypoint: "./instance",
|
||||||
instanceConfigFields: {
|
instanceConfigFields: {
|
||||||
"__plugin_name__.myInstanceField": {
|
"__plugin_name__.myInstanceField": {
|
||||||
title: "My Instance Field",
|
title: "My Instance Field",
|
||||||
@@ -72,7 +72,7 @@ const plugin = {
|
|||||||
//%endif
|
//%endif
|
||||||
//%if ctl
|
//%if ctl
|
||||||
|
|
||||||
ctlEntrypoint: "./dist/node/ctl",
|
ctlEntrypoint: "./ctl",
|
||||||
controlConfigFields: {
|
controlConfigFields: {
|
||||||
"__plugin_name__.myControlField": {
|
"__plugin_name__.myControlField": {
|
||||||
title: "My Control Field",
|
title: "My Control Field",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class PluginExampleEvent {
|
|||||||
"myNumberArray": Type.Array(Type.Number()),
|
"myNumberArray": Type.Array(Type.Number()),
|
||||||
});
|
});
|
||||||
|
|
||||||
static fromJson(json) {
|
static fromJSON(json) {
|
||||||
return new PluginExampleEvent(json.myString, json.myNumberArray);
|
return new PluginExampleEvent(json.myString, json.myNumberArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,8 +41,8 @@ class PluginExampleRequest {
|
|||||||
"myNumberArray": Type.Array(Type.Number()),
|
"myNumberArray": Type.Array(Type.Number()),
|
||||||
});
|
});
|
||||||
|
|
||||||
static fromJson(json) {
|
static fromJSON(json) {
|
||||||
return new PluginExampleEvent(json.myString, json.myNumberArray);
|
return new PluginExampleRequest(json.myString, json.myNumberArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Response = plainJson(Type.Object({
|
static Response = plainJson(Type.Object({
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ function MyTemplatePage() {
|
|||||||
</PageLayout>;
|
</PageLayout>;
|
||||||
}
|
}
|
||||||
|
|
||||||
class WebPlugin extends BaseWebPlugin {
|
export class WebPlugin extends BaseWebPlugin {
|
||||||
//%if controller & web // Subscribing requires web content and the controller
|
//%if controller & web // Subscribing requires web content and the controller
|
||||||
subscribableData = new lib.EventSubscriber(ExampleSubscribableUpdate, this.control);
|
subscribableData = new lib.EventSubscriber(ExampleSubscribableUpdate, this.control);
|
||||||
|
|
||||||
@@ -76,7 +76,3 @@ class WebPlugin extends BaseWebPlugin {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
WebPlugin,
|
|
||||||
};
|
|
||||||
@@ -20,7 +20,7 @@ export class PluginExampleEvent {
|
|||||||
"myNumberArray": Type.Array(Type.Number()),
|
"myNumberArray": Type.Array(Type.Number()),
|
||||||
});
|
});
|
||||||
|
|
||||||
static fromJson(json: Static<typeof PluginExampleEvent.jsonSchema>) {
|
static fromJSON(json: Static<typeof PluginExampleEvent.jsonSchema>) {
|
||||||
return new PluginExampleEvent(json.myString, json.myNumberArray);
|
return new PluginExampleEvent(json.myString, json.myNumberArray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,8 +44,8 @@ export class PluginExampleRequest {
|
|||||||
"myNumberArray": Type.Array(Type.Number()),
|
"myNumberArray": Type.Array(Type.Number()),
|
||||||
});
|
});
|
||||||
|
|
||||||
static fromJson(json: Static<typeof PluginExampleEvent.jsonSchema>) {
|
static fromJSON(json: Static<typeof PluginExampleRequest.jsonSchema>) {
|
||||||
return new PluginExampleEvent(json.myString, json.myNumberArray);
|
return new PluginExampleRequest(json.myString, json.myNumberArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Response = plainJson(Type.Object({
|
static Response = plainJson(Type.Object({
|
||||||
|
|||||||
Reference in new issue
Block a user