mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 16:13:12 +09:00
Bug Fixes
This commit is contained in:
10 files changed
+25
-9
No files matched your search
@@ -81,7 +81,7 @@ async function removeExecutionArtifacts() {
|
|||||||
* Main function for this script
|
* Main function for this script
|
||||||
*/
|
*/
|
||||||
async function main() {
|
async function main() {
|
||||||
await yargs
|
await yargs(process.argv.slice(2))
|
||||||
.scriptName("clean")
|
.scriptName("clean")
|
||||||
.usage("$0 <command> [options]")
|
.usage("$0 <command> [options]")
|
||||||
.option("dry", {
|
.option("dry", {
|
||||||
|
|||||||
@@ -494,6 +494,7 @@ export default defineConfig([{
|
|||||||
"rules": {
|
"rules": {
|
||||||
"node/no-missing-require": "off",
|
"node/no-missing-require": "off",
|
||||||
"node/no-missing-import": "off",
|
"node/no-missing-import": "off",
|
||||||
|
"@stylistic/indent": "off",
|
||||||
"spaced-comment": "off",
|
"spaced-comment": "off",
|
||||||
"comma-spacing": "off",
|
"comma-spacing": "off",
|
||||||
"max-len": "off",
|
"max-len": "off",
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ async function copyPluginTemplates(pluginName, templates) {
|
|||||||
prepare.push("tsc --build");
|
prepare.push("tsc --build");
|
||||||
files.set("tsconfig.json", path.join(templatePath, "tsconfig.json"));
|
files.set("tsconfig.json", path.join(templatePath, "tsconfig.json"));
|
||||||
files.set("tsconfig.node.json", path.join(templatePath, "tsconfig.node.json"));
|
files.set("tsconfig.node.json", path.join(templatePath, "tsconfig.node.json"));
|
||||||
|
files.set("tsconfig.base.json", path.join(templatePath, "tsconfig.base.json"));
|
||||||
if (webpack) {
|
if (webpack) {
|
||||||
files.set("tsconfig.browser.json", path.join(templatePath, "tsconfig.browser.json"));
|
files.set("tsconfig.browser.json", path.join(templatePath, "tsconfig.browser.json"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ class ControllerPlugin extends BaseControllerPlugin {
|
|||||||
//%endif
|
//%endif
|
||||||
//%if controller & web // Subscribing requires web content and the controller
|
//%if controller & web // Subscribing requires web content and the controller
|
||||||
this.controller.subscriptions.handle(ExampleSubscribableUpdate, this.handleExampleSubscription.bind(this));
|
this.controller.subscriptions.handle(ExampleSubscribableUpdate, this.handleExampleSubscription.bind(this));
|
||||||
this.exampleDatabase = new Map(); // If needed, replace with loading from database file
|
// If needed, replace with loading from database file such as lib.Datastore
|
||||||
|
this.exampleDatabase = new Map([["foo", new ExampleSubscribableValue("foo", 0, false)]]);
|
||||||
//%endif
|
//%endif
|
||||||
//%if multi_context // Subscribing requires multi context
|
//%if multi_context // Subscribing requires multi context
|
||||||
}
|
}
|
||||||
@@ -70,6 +71,7 @@ class ControllerPlugin extends BaseControllerPlugin {
|
|||||||
//%if controller & web // Subscribing requires web content and the controller
|
//%if controller & web // Subscribing requires web content and the controller
|
||||||
|
|
||||||
async handleExampleSubscription(request) {
|
async handleExampleSubscription(request) {
|
||||||
|
this.logger.info(JSON.stringify(request));
|
||||||
const values = [...this.exampleDatabase.values()].filter(
|
const values = [...this.exampleDatabase.values()].filter(
|
||||||
value => value.updatedAtMs > request.lastRequestTimeMs,
|
value => value.updatedAtMs > request.lastRequestTimeMs,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,12 +7,14 @@ lib.definePermission({
|
|||||||
name: "__plugin_name__.example.permission.event",
|
name: "__plugin_name__.example.permission.event",
|
||||||
title: "Example permission event",
|
title: "Example permission event",
|
||||||
description: "Example Description. Event. Change me in index.js",
|
description: "Example Description. Event. Change me in index.js",
|
||||||
|
grantByDefault: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
lib.definePermission({
|
lib.definePermission({
|
||||||
name: "__plugin_name__.example.permission.request",
|
name: "__plugin_name__.example.permission.request",
|
||||||
title: "Example permission request",
|
title: "Example permission request",
|
||||||
description: "Example Description. Request. Change me in index.js",
|
description: "Example Description. Request. Change me in index.js",
|
||||||
|
grantByDefault: true,
|
||||||
});
|
});
|
||||||
//%endif
|
//%endif
|
||||||
//%if controller & web // Subscribing requires web content and the controller
|
//%if controller & web // Subscribing requires web content and the controller
|
||||||
@@ -21,6 +23,7 @@ lib.definePermission({
|
|||||||
name: "__plugin_name__.example.permission.subscribe",
|
name: "__plugin_name__.example.permission.subscribe",
|
||||||
title: "Example permission subscribe",
|
title: "Example permission subscribe",
|
||||||
description: "Example Description. Subscribe. Change me in index.js",
|
description: "Example Description. Subscribe. Change me in index.js",
|
||||||
|
grantByDefault: true,
|
||||||
});
|
});
|
||||||
//%endif
|
//%endif
|
||||||
//%if web
|
//%if web
|
||||||
@@ -29,6 +32,7 @@ lib.definePermission({
|
|||||||
name: "__plugin_name__.page.view",
|
name: "__plugin_name__.page.view",
|
||||||
title: "Example page view permission",
|
title: "Example page view permission",
|
||||||
description: "Example Description. View. Change me in index.js",
|
description: "Example Description. View. Change me in index.js",
|
||||||
|
grantByDefault: true,
|
||||||
});
|
});
|
||||||
//%endif
|
//%endif
|
||||||
|
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ function MyTemplatePage() {
|
|||||||
|
|
||||||
return <PageLayout nav={[{ name: "__plugin_name__" }]}>
|
return <PageLayout nav={[{ name: "__plugin_name__" }]}>
|
||||||
<PageHeader title="__plugin_name__" />
|
<PageHeader title="__plugin_name__" />
|
||||||
//%if controller // Subscribing requires web content and the controller
|
//%if controller // Subscribing requires web content and the controller
|
||||||
Synced: {String(synced)} Data: {JSON.stringify([...subscribableData.values()])}
|
Synced: {String(synced)} Data: {JSON.stringify([...subscribableData.values()])}
|
||||||
//%endif
|
//%endif
|
||||||
</PageLayout>;
|
</PageLayout>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ export class WebPlugin extends BaseWebPlugin {
|
|||||||
permission: "__plugin_name__.example.permission.subscribe",
|
permission: "__plugin_name__.example.permission.subscribe",
|
||||||
//%endif
|
//%endif
|
||||||
//%if !controller
|
//%if !controller
|
||||||
permission: undefined, // "__plugin_name__.example.permission.request",
|
permission: "__plugin_name__.example.permission.view",
|
||||||
//%endif
|
//%endif
|
||||||
content: <MyTemplatePage/>,
|
content: <MyTemplatePage/>,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ export class ControllerPlugin extends BaseControllerPlugin {
|
|||||||
//%endif
|
//%endif
|
||||||
//%if controller & web // Subscribing requires web content and the controller
|
//%if controller & web // Subscribing requires web content and the controller
|
||||||
this.controller.subscriptions.handle(ExampleSubscribableUpdate, this.handleExampleSubscription.bind(this));
|
this.controller.subscriptions.handle(ExampleSubscribableUpdate, this.handleExampleSubscription.bind(this));
|
||||||
this.exampleDatabase = new Map(); // If needed, replace with loading from database file such as lib.Datastore
|
// If needed, replace with loading from database file such as lib.Datastore
|
||||||
|
this.exampleDatabase = new Map([["foo", new ExampleSubscribableValue("foo", 0, false)]]);
|
||||||
//%endif
|
//%endif
|
||||||
//%if multi_context // Subscribing requires multi context
|
//%if multi_context // Subscribing requires multi context
|
||||||
}
|
}
|
||||||
@@ -69,6 +70,7 @@ export class ControllerPlugin extends BaseControllerPlugin {
|
|||||||
//%if controller & web // Subscribing requires web content and the controller
|
//%if controller & web // Subscribing requires web content and the controller
|
||||||
|
|
||||||
async handleExampleSubscription(request: lib.SubscriptionRequest) {
|
async handleExampleSubscription(request: lib.SubscriptionRequest) {
|
||||||
|
this.logger.info(JSON.stringify(request));
|
||||||
const values = [...this.exampleDatabase.values()].filter(
|
const values = [...this.exampleDatabase.values()].filter(
|
||||||
value => value.updatedAtMs > request.lastRequestTimeMs,
|
value => value.updatedAtMs > request.lastRequestTimeMs,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ lib.definePermission({
|
|||||||
name: "__plugin_name__.example.permission.event",
|
name: "__plugin_name__.example.permission.event",
|
||||||
title: "Example permission event",
|
title: "Example permission event",
|
||||||
description: "Example Description. Event. Change me in index.ts",
|
description: "Example Description. Event. Change me in index.ts",
|
||||||
|
grantByDefault: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
lib.definePermission({
|
lib.definePermission({
|
||||||
name: "__plugin_name__.example.permission.request",
|
name: "__plugin_name__.example.permission.request",
|
||||||
title: "Example permission request",
|
title: "Example permission request",
|
||||||
description: "Example Description. Request. Change me in index.ts",
|
description: "Example Description. Request. Change me in index.ts",
|
||||||
|
grantByDefault: true,
|
||||||
});
|
});
|
||||||
//%endif
|
//%endif
|
||||||
//%if controller & web // Subscribing requires web content and the controller
|
//%if controller & web // Subscribing requires web content and the controller
|
||||||
@@ -20,6 +22,7 @@ lib.definePermission({
|
|||||||
name: "__plugin_name__.example.permission.subscribe",
|
name: "__plugin_name__.example.permission.subscribe",
|
||||||
title: "Example permission subscribe",
|
title: "Example permission subscribe",
|
||||||
description: "Example Description. Subscribe. Change me in index.ts",
|
description: "Example Description. Subscribe. Change me in index.ts",
|
||||||
|
grantByDefault: true,
|
||||||
});
|
});
|
||||||
//%endif
|
//%endif
|
||||||
//%if web
|
//%if web
|
||||||
@@ -28,6 +31,7 @@ lib.definePermission({
|
|||||||
name: "__plugin_name__.page.view",
|
name: "__plugin_name__.page.view",
|
||||||
title: "Example page view permission",
|
title: "Example page view permission",
|
||||||
description: "Example Description. View. Change me in index.ts",
|
description: "Example Description. View. Change me in index.ts",
|
||||||
|
grantByDefault: true,
|
||||||
});
|
});
|
||||||
//%endif
|
//%endif
|
||||||
//%if config
|
//%if config
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ function MyTemplatePage() {
|
|||||||
|
|
||||||
return <PageLayout nav={[{ name: "__plugin_name__" }]}>
|
return <PageLayout nav={[{ name: "__plugin_name__" }]}>
|
||||||
<PageHeader title="__plugin_name__" />
|
<PageHeader title="__plugin_name__" />
|
||||||
//%if controller // Subscribing requires web content and the controller
|
//%if controller // Subscribing requires web content and the controller
|
||||||
Synced: {String(synced)} Data: {JSON.stringify([...subscribableData.values()])}
|
Synced: {String(synced)} Data: {JSON.stringify([...subscribableData.values()])}
|
||||||
//%endif
|
//%endif
|
||||||
</PageLayout>;
|
</PageLayout>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ export class WebPlugin extends BaseWebPlugin {
|
|||||||
permission: "__plugin_name__.example.permission.subscribe",
|
permission: "__plugin_name__.example.permission.subscribe",
|
||||||
//%endif
|
//%endif
|
||||||
//%if !controller
|
//%if !controller
|
||||||
permission: undefined, // "__plugin_name__.example.permission.request",
|
permission: "__plugin_name__.example.permission.view",
|
||||||
//%endif
|
//%endif
|
||||||
content: <MyTemplatePage/>,
|
content: <MyTemplatePage/>,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,3 +4,5 @@ packages:
|
|||||||
- "external_plugins/*"
|
- "external_plugins/*"
|
||||||
- "external_plugins/*/*"
|
- "external_plugins/*/*"
|
||||||
- "test/"
|
- "test/"
|
||||||
|
|
||||||
|
linkWorkspacePackages: true
|
||||||
Reference in new issue
Block a user