mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 08:23:12 +09:00
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:
1 parent
8884116ee9
commit
b0f6c95fca
33 files changed
+71
-62
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import * as lib from "@clusterio/lib";
|
||||
|
||||
declare module "@clusterio/lib" {
|
||||
export interface InstanceConfigFields {
|
||||
"statistics_exporter.command_timeout": number;
|
||||
}
|
||||
}
|
||||
|
||||
export const plugin: lib.PluginDeclaration = {
|
||||
name: "statistics_exporter",
|
||||
title: "Statistics Exporter",
|
||||
description:
|
||||
"Provides in-game item/fluid production, builds, kills, and pollution "+
|
||||
"statistics to the cluster's Prometheus endpoint.",
|
||||
instanceEntrypoint: "dist/plugin/instance",
|
||||
instanceConfigFields: {
|
||||
"statistics_exporter.command_timeout": {
|
||||
title: "Command Timeout",
|
||||
description:
|
||||
"Timeout in seconds of the metrics command before returning results from the previous invocation.",
|
||||
type: "number",
|
||||
initialValue: 1,
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user