mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-09-21 17:04:00 +00:00
Clusterio #984 converted its packages to ESM, so a CommonJS plugin can no longer import @clusterio/lib and plugin entrypoints must name the full file. Every package gets "type": "module", entrypoints and relative imports carry the .js extension, and the webpack configs become .cjs as webpack-cli loads them with require. tsconfig.node.json moves from node16 to nodenext to match clusterio, which needs it for the JSON import attributes in its sources. The tap tests and the shared test helpers use import and import.meta.dirname. The test scripts pass --type-strip-only so tap leaves lib's .ts subpath imports to Node's own type stripping, as its TypeScript loader compiled them without a default export. The lua runner resolves fengari from the test file it is given, since a bare import from the shared test directory does not reach the plugin's devDependencies. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
31 lines
857 B
TypeScript
31 lines
857 B
TypeScript
import * as lib from "@clusterio/lib";
|
|
|
|
declare module "@clusterio/lib" {
|
|
export interface InstanceConfigFields {
|
|
"exp_server_ups.update_interval": number;
|
|
"exp_server_ups.average_interval": number;
|
|
}
|
|
}
|
|
|
|
export const plugin: lib.PluginDeclaration = {
|
|
name: "exp_server_ups",
|
|
title: "ExpGaming - Server UPS",
|
|
description: "Clusterio plugin providing in game server ups counter",
|
|
|
|
instanceEntrypoint: "./dist/node/instance.js",
|
|
instanceConfigFields: {
|
|
"exp_server_ups.update_interval": {
|
|
title: "Update Interval",
|
|
description: "Frequency at which updates are exchanged with factorio (ms)",
|
|
type: "number",
|
|
initialValue: 1000,
|
|
},
|
|
"exp_server_ups.average_interval": {
|
|
title: "Average Interval",
|
|
description: "Number of update intervals to average updates per second across",
|
|
type: "number",
|
|
initialValue: 60
|
|
},
|
|
},
|
|
};
|