Move export for plugin declaration (#555)

Change the expected exported name of plugin declarations to be "plugin"
at the main entrypoint instead of the default export.  This makes the
plugin's code organisation more flexible especially when using CommonJS
JavaScript modules as they can export additional symbols from the
plugin declaration file.
This commit is contained in:
Hornwitser authored and GitHub committed 2024-01-18 20:31:52 +01:00
1 parent 8884116ee9
commit b0f6c95fca
33 files changed
+71 -62

No files matched your search

@@ -2,7 +2,7 @@ import type * as lib from "@clusterio/lib";
import * as messages from "./messages";
export default {
export const plugin: lib.PluginDeclaration = {
name: "research_sync",
title: "Research Sync",
description: "Synchronises technology research progress between instances.",
@@ -15,4 +15,4 @@ export default {
messages.FinishedEvent,
messages.SyncTechnologiesRequest,
],
} satisfies lib.PluginDeclaration;
};
+1 -1
View File
@@ -6,7 +6,7 @@
"homepage": "https://github.com/clusterio/clusterio#readme",
"license": "MIT",
"repository": "clusterio/clusterio",
"main": "dist/plugin/info.js",
"main": "dist/plugin/index.js",
"scripts": {
"prepare": "tsc --build && webpack-cli --env production",
"test": "echo \"Error: run tests from root\" && exit 1"
+1 -1
View File
@@ -16,7 +16,7 @@ module.exports = (env = {}) => merge(common(env), {
name: "research_sync",
library: { type: "var", name: "plugin_research_sync" },
exposes: {
"./info": "./info.ts",
"./": "./index.ts",
"./package.json": "./package.json",
},
shared: {