Move base plugins to their respective packages

Move BaseControllerPlugin to controller/src/BaseControllerPlugin.ts
Move BaseInstancePlugin to host/src/BaseInstancePlugin.ts
Move BaseControlPlugin to ctl/src/BaseCtlPlugin.ts
Move BaseWebPlugin to web_ui/src/BaseWebPlugin.ts

This solves the circular package dependency problem of the base plugins
needing types that are available only in the dependencies to lib.
This commit is contained in:
Hornwitser committed 2023-11-25 18:41:43 +01:00
1 parent 63dc370ea0
commit 808eda0513
51 files changed
+1073 -1060

No files matched your search

+3 -2
View File
@@ -1,4 +1,5 @@
import { BaseControlPlugin, CommandTree, Command } from "@clusterio/lib";
import { CommandTree, Command } from "@clusterio/lib";
import { BaseCtlPlugin } from "@clusterio/ctl";
import { ChatEvent } from "./messages";
const globalChatCommands = new CommandTree({
@@ -13,7 +14,7 @@ globalChatCommands.add(new Command({
},
}));
export class ControlPlugin extends BaseControlPlugin {
export class CtlPlugin extends BaseCtlPlugin {
async addCommands(rootCommand: CommandTree) {
rootCommand.add(globalChatCommands);
}
+1 -1
View File
@@ -7,7 +7,7 @@ const info: lib.PluginDeclaration = {
title: "Global Chat",
description: "Forwards chat between instances.",
instanceEntrypoint: "dist/plugin/instance",
controlEntrypoint: "dist/plugin/control",
ctlEntrypoint: "dist/plugin/control",
messages: [
ChatEvent,
+2 -1
View File
@@ -1,4 +1,5 @@
import * as lib from "@clusterio/lib";
import { BaseInstancePlugin } from "@clusterio/host";
import { ChatEvent } from "./messages";
/**
@@ -11,7 +12,7 @@ function removeTags(content: string): string {
return content.replace(/(\[gps=-?\d+,-?\d+\]|\[train=\d+\])/g, "");
}
export class InstancePlugin extends lib.BaseInstancePlugin {
export class InstancePlugin extends BaseInstancePlugin {
messageQueue: string[] = [];
async init() {