From 4ac3d2c868198709e4850db4924724adbe9e54e5 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 12 Sep 2026 15:46:16 +0200 Subject: [PATCH 1/2] Remove @clusterio/web_ui from peer dependencies The web_ui package is only used when building the web interface. This only happens during development and is thus adequatly covered by the existing entry of web_ui in the devDependencies specification. Removing web_ui from peer dependencies prevents it from being pulled in by npm during a regular installation. Since it's never used in a regular installation this removed a whole lot of bloat. --- packages/create/templates/common/package.json | 3 --- plugins/global_chat/package.json | 3 +-- plugins/inventory_sync/package.json | 3 +-- plugins/player_auth/package.json | 3 +-- plugins/research_sync/package.json | 3 +-- plugins/statistics_exporter/package.json | 3 +-- plugins/subspace_storage/package.json | 3 +-- 7 files changed, 6 insertions(+), 15 deletions(-) diff --git a/packages/create/templates/common/package.json b/packages/create/templates/common/package.json index 7169e2aa..053c52e3 100644 --- a/packages/create/templates/common/package.json +++ b/packages/create/templates/common/package.json @@ -19,9 +19,6 @@ //%if controller "@clusterio/controller": "^__clusterio_version__", //%endif -//%if webpack - "@clusterio/web_ui": "^__clusterio_version__", -//%endif //%if host "@clusterio/host": "^__clusterio_version__", //%endif diff --git a/plugins/global_chat/package.json b/plugins/global_chat/package.json index 1b259dbb..ddd07282 100644 --- a/plugins/global_chat/package.json +++ b/plugins/global_chat/package.json @@ -36,8 +36,7 @@ "peerDependencies": { "@clusterio/ctl": "workspace:^", "@clusterio/host": "workspace:^", - "@clusterio/lib": "workspace:^", - "@clusterio/web_ui": "workspace:^" + "@clusterio/lib": "workspace:^" }, "dependencies": { "@sinclair/typebox": "catalog:" diff --git a/plugins/inventory_sync/package.json b/plugins/inventory_sync/package.json index 035df1ac..8df3e88b 100644 --- a/plugins/inventory_sync/package.json +++ b/plugins/inventory_sync/package.json @@ -36,8 +36,7 @@ "peerDependencies": { "@clusterio/controller": "workspace:^", "@clusterio/host": "workspace:^", - "@clusterio/lib": "workspace:^", - "@clusterio/web_ui": "workspace:^" + "@clusterio/lib": "workspace:^" }, "dependencies": { "@sinclair/typebox": "catalog:" diff --git a/plugins/player_auth/package.json b/plugins/player_auth/package.json index 20b174a5..1aadb56d 100644 --- a/plugins/player_auth/package.json +++ b/plugins/player_auth/package.json @@ -36,8 +36,7 @@ "peerDependencies": { "@clusterio/controller": "workspace:^", "@clusterio/host": "workspace:^", - "@clusterio/lib": "workspace:^", - "@clusterio/web_ui": "workspace:^" + "@clusterio/lib": "workspace:^" }, "dependencies": { "@sinclair/typebox": "catalog:", diff --git a/plugins/research_sync/package.json b/plugins/research_sync/package.json index 2f3ef9ea..fa7e36b8 100644 --- a/plugins/research_sync/package.json +++ b/plugins/research_sync/package.json @@ -36,8 +36,7 @@ "peerDependencies": { "@clusterio/controller": "workspace:^", "@clusterio/host": "workspace:^", - "@clusterio/lib": "workspace:^", - "@clusterio/web_ui": "workspace:^" + "@clusterio/lib": "workspace:^" }, "dependencies": { "@sinclair/typebox": "catalog:" diff --git a/plugins/statistics_exporter/package.json b/plugins/statistics_exporter/package.json index 5ca2bb5a..c522983f 100644 --- a/plugins/statistics_exporter/package.json +++ b/plugins/statistics_exporter/package.json @@ -35,8 +35,7 @@ "peerDependencies": { "@clusterio/host": "workspace:^", - "@clusterio/lib": "workspace:^", - "@clusterio/web_ui": "workspace:^" + "@clusterio/lib": "workspace:^" }, "devDependencies": { "@clusterio/web_ui": "workspace:^", diff --git a/plugins/subspace_storage/package.json b/plugins/subspace_storage/package.json index 7a7c2582..5ff1bc61 100644 --- a/plugins/subspace_storage/package.json +++ b/plugins/subspace_storage/package.json @@ -36,8 +36,7 @@ "peerDependencies": { "@clusterio/controller": "workspace:^", "@clusterio/host": "workspace:^", - "@clusterio/lib": "workspace:^", - "@clusterio/web_ui": "workspace:^" + "@clusterio/lib": "workspace:^" }, "dependencies": { "@sinclair/typebox": "catalog:" From d30e06b268d9d7d6ec33b315b6b2d1808a98ed6d Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 12 Sep 2026 16:19:03 +0200 Subject: [PATCH 2/2] Set controller, host and ctl as optional peers Configure the controller, host and ctl packages as optional peer dependencies to prevent them being pulled in and installed by plugins in environments that don't have them. This means that a host only install with a plugin that uses both host and controller will not cause the controller package to be installed as well. --- packages/create/templates/common/package.json | 25 +++++++++++++++++++ plugins/global_chat/package.json | 8 ++++++ plugins/inventory_sync/package.json | 8 ++++++ plugins/player_auth/package.json | 8 ++++++ plugins/research_sync/package.json | 8 ++++++ plugins/statistics_exporter/package.json | 8 ++++++ plugins/subspace_storage/package.json | 8 ++++++ 7 files changed, 73 insertions(+) diff --git a/packages/create/templates/common/package.json b/packages/create/templates/common/package.json index 053c52e3..dd7b657d 100644 --- a/packages/create/templates/common/package.json +++ b/packages/create/templates/common/package.json @@ -27,6 +27,31 @@ //%endif "@clusterio/lib": "^__clusterio_version__" }, +//%if controller | host | ctl + "peerDependenciesMeta": { +//%endif +//%if controller + "@clusterio/controller": { + "optional": true +//%endif +//%if controller & host | controller & ctl + }, +//%endif +//%if host + "@clusterio/host": { + "optional": true +//%endif +//%if host & ctl + }, +//%endif +//%if ctl + "@clusterio/ctl": { + "optional": true +//%endif +//%if controller | host | ctl + } + }, +//%endif "devDependencies": { //%// Typescript and type declarations //%if typescript diff --git a/plugins/global_chat/package.json b/plugins/global_chat/package.json index ddd07282..6947e542 100644 --- a/plugins/global_chat/package.json +++ b/plugins/global_chat/package.json @@ -38,6 +38,14 @@ "@clusterio/host": "workspace:^", "@clusterio/lib": "workspace:^" }, + "peerDependenciesMeta": { + "@clusterio/ctl": { + "optional": true + }, + "@clusterio/host": { + "optional": true + } + }, "dependencies": { "@sinclair/typebox": "catalog:" }, diff --git a/plugins/inventory_sync/package.json b/plugins/inventory_sync/package.json index 8df3e88b..61476bf4 100644 --- a/plugins/inventory_sync/package.json +++ b/plugins/inventory_sync/package.json @@ -38,6 +38,14 @@ "@clusterio/host": "workspace:^", "@clusterio/lib": "workspace:^" }, + "peerDependenciesMeta": { + "@clusterio/controller": { + "optional": true + }, + "@clusterio/host": { + "optional": true + } + }, "dependencies": { "@sinclair/typebox": "catalog:" }, diff --git a/plugins/player_auth/package.json b/plugins/player_auth/package.json index 1aadb56d..a2535d16 100644 --- a/plugins/player_auth/package.json +++ b/plugins/player_auth/package.json @@ -38,6 +38,14 @@ "@clusterio/host": "workspace:^", "@clusterio/lib": "workspace:^" }, + "peerDependenciesMeta": { + "@clusterio/controller": { + "optional": true + }, + "@clusterio/host": { + "optional": true + } + }, "dependencies": { "@sinclair/typebox": "catalog:", "jsonwebtoken": "catalog:", diff --git a/plugins/research_sync/package.json b/plugins/research_sync/package.json index fa7e36b8..e491db89 100644 --- a/plugins/research_sync/package.json +++ b/plugins/research_sync/package.json @@ -38,6 +38,14 @@ "@clusterio/host": "workspace:^", "@clusterio/lib": "workspace:^" }, + "peerDependenciesMeta": { + "@clusterio/controller": { + "optional": true + }, + "@clusterio/host": { + "optional": true + } + }, "dependencies": { "@sinclair/typebox": "catalog:" }, diff --git a/plugins/statistics_exporter/package.json b/plugins/statistics_exporter/package.json index c522983f..05276508 100644 --- a/plugins/statistics_exporter/package.json +++ b/plugins/statistics_exporter/package.json @@ -37,6 +37,14 @@ "@clusterio/host": "workspace:^", "@clusterio/lib": "workspace:^" }, + "peerDependenciesMeta": { + "@clusterio/controller": { + "optional": true + }, + "@clusterio/host": { + "optional": true + } + }, "devDependencies": { "@clusterio/web_ui": "workspace:^", "@clusterio/host": "workspace:^", diff --git a/plugins/subspace_storage/package.json b/plugins/subspace_storage/package.json index 5ff1bc61..2ddaa3f9 100644 --- a/plugins/subspace_storage/package.json +++ b/plugins/subspace_storage/package.json @@ -38,6 +38,14 @@ "@clusterio/host": "workspace:^", "@clusterio/lib": "workspace:^" }, + "peerDependenciesMeta": { + "@clusterio/controller": { + "optional": true + }, + "@clusterio/host": { + "optional": true + } + }, "dependencies": { "@sinclair/typebox": "catalog:" },