Rename Ctl's usage of "control" to "ctl" (#1039)

Ctl ended up calling its main class for "Control" for historical
reasons, along with its config file and plugin entrypoint.

The plugin entrypoint was renamed to ctl in 808eda0513.  This
finishes that renaming by also renaming the main class, default config
file, config-control command, and main entrypoint.

The config-control command is renamed to config to be consistent with
the host and controller's config commands.

The term "control" is still kept in the config and message locations as
a common specifier for both ctl and web_ui.
This commit is contained in:
Hornwitser authored and GitHub committed 2026-09-14 20:18:41 +02:00
1 parent 1d1d9bb1c4
commit 5df5af7ca8
35 files changed
+383 -383

No files matched your search

@@ -8,7 +8,7 @@ testPluginCommands.add(new Command({
definition: ["echo <message>", "Print the message given to it", (yargs) => {
yargs.positional("message", { describe: "message to print", type: "string" });
}],
handler: async function(args, control) {
handler: async function(args, ctl) {
// eslint-disable-next-line no-console
console.log(args.message);
},
+1 -1
View File
@@ -11,7 +11,7 @@ export const plugin = {
controllerEntrypoint: "controller.js",
hostEntrypoint: "host.js",
instanceEntrypoint: "instance.js",
ctlEntrypoint: "control.js",
ctlEntrypoint: "ctl.js",
messages: [
ControllerEcho,
+5 -5
View File
@@ -200,7 +200,7 @@ export let factorioDir = getFactorioDir(baseHostConfig);
let pluginListPath = path.join("temp", "test", "plugin-list.json");
export let controllerConfigPath = path.join("temp", "test", "config-controller.json");
export let hostConfigPath = path.join("temp", "test", "config-host.json");
export let controlConfigPath = path.join("temp", "test", "config-control.json");
export let ctlConfigPath = path.join("temp", "test", "config-ctl.json");
function childOptions(options) {
return {
@@ -241,7 +241,7 @@ export async function execCtl(command) {
return;
}
control.config = initArgs.controlConfig;
control.config = initArgs.ctlConfig;
const targetCommand = selectTargetCommand(initArgs.args, initArgs.rootCommands);
await targetCommand.run(initArgs.args, control);
} finally {
@@ -340,7 +340,7 @@ before(async function() {
await fs.rm(pluginListPath, { force: true });
await fs.rm(controllerConfigPath, { force: true });
await fs.rm(hostConfigPath, { force: true });
await fs.rm(controlConfigPath, { force: true });
await fs.rm(ctlConfigPath, { force: true });
await fs.mkdir(path.join("temp", "test"), { recursive: true });
@@ -394,8 +394,8 @@ before(async function() {
control = new TestControl(controlConnector);
await controlConnector.connect();
const initArgs = await initializeCtl(`--plugin-list ${pluginListPath} control-config list`, undefined, true);
control.config = initArgs.controlConfig;
const initArgs = await initializeCtl(`--plugin-list ${pluginListPath} config list`, undefined, true);
control.config = initArgs.ctlConfig;
control.hooks = initArgs.ctlHooks;
const testPack = lib.ModPack.fromJSON({});
+1 -1
View File
@@ -42,7 +42,7 @@ describe("lib/config/definitions/migrations", function() {
assert.equal(configFalse.get("factorio.sync_banlist"), "disabled", "sync_adminlist contains wrong value");
});
});
describe("Control Config", function() {
describe("Ctl Config", function() {
});
});
+2 -2
View File
@@ -1,7 +1,7 @@
import assert from "node:assert/strict";
import * as lib from "@clusterio/lib";
const validators = lib.Config.validators;
import { ControllerConfig, HostConfig, InstanceConfig, ControlConfig } from "@clusterio/lib";
import { ControllerConfig, HostConfig, InstanceConfig, CtlConfig } from "@clusterio/lib";
describe("lib/config/validators", function() {
describe("all", function() {
@@ -366,7 +366,7 @@ describe("lib/config/definitions/validators", function() {
});
});
describe("Control Config", function() {
describe("Ctl Config", function() {
});
});
+1 -1
View File
@@ -18,7 +18,7 @@ describe("lib/plugin", function() {
name: "foo", title: "Foo", controllerEntrypoint: "controller.js",
}), true);
for (const field of [
"controllerConfigFields", "hostConfigFields", "instanceConfigFields", "controlConfigFields",
"controllerConfigFields", "hostConfigFields", "instanceConfigFields", "ctlConfigFields",
]) {
assert.equal(lib.pluginNeedsWebBuild({ name: "foo", title: "Foo", [field]: {} }), true, field);
}