From d30e06b268d9d7d6ec33b315b6b2d1808a98ed6d Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 12 Sep 2026 16:19:03 +0200 Subject: [PATCH] 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:" },