Reference exp_roles and exp_groups from the exp_scenario build - #473
Merged
Cooldude2606 merged 2 commits intoSep 9, 2026
Merged
Conversation
exp_scenario imports types from @expcluster/roles and @expcluster/permission-groups through their dist folders, so building it on its own before those packages are built fails with TS2307. A plain pnpm install runs the prepare scripts in dependency order, but a filtered install or running tsc --build in exp_scenario on a fresh clone does not. Referencing the node projects of both packages makes tsc build them first. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
exp_scenario reached into @expcluster/roles/dist/node/* for the message classes and the controller plugin type. The package index now re-exports messages and the ControllerPlugin type, so consumers import from the package name like they do with @clusterio/lib. The controller export is type only, which keeps node code out of the web bundle. The test still requires the controller classes from dist since they cannot be re-exported at runtime. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cooldude2606
requested changes
Sep 9, 2026
Cooldude2606
left a comment
Member
There was a problem hiding this comment.
We cannot export the plugins from the index file as this prevents it being loaded into other contexts which are not "standalone".
Cooldude2606
approved these changes
Sep 9, 2026
Cooldude2606
left a comment
Member
There was a problem hiding this comment.
Nvm I failed to see that it was type export only. LGTM.
Cooldude2606
pushed a commit
that referenced
this pull request
Sep 11, 2026
The packages use workspace:^ and catalog: versions, so they only resolve inside a clusterio checkout with this repository under external_plugins. The workflow clones clusterio master, checks this repository out into external_plugins/ExpCluster, runs pnpm install (which runs every prepare script), then runs the tap suites. A last step wipes dist and runs tsc --build in each package on its own. pnpm install builds packages in dependency order, which is why the missing project references fixed in #473 went unnoticed. On the tree before #473 this step fails with the same five TS2307 errors. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #457 exp_scenario imports types from
@expcluster/rolesand@expcluster/permission-groups. Their declaration files only exist once the two packages have been built, so building exp_scenario before them fails withTS2307: Cannot find module '@expcluster/roles/dist/node/controller'and four more like it. A plainpnpm installgets away with it because pnpm runs the prepare scripts in dependency order, but a filtered install, ortsc --buildinside exp_scenario on a fresh clone, hits the error.Two commits:
packages/lib.tsc --buildnow builds those two first when they are out of date.ControllerPlugintype from the package index, so exp_scenario importsfrom "@expcluster/roles"instead offrom "@expcluster/roles/dist/node/messages". The controller export is type only, so nothing from@clusterio/controllerends up in the web bundle (checked the emitted index chunk). The test keeps the deep require for the controller classes since those cannot be re-exported at runtime.Verified by deleting every
distfolder and runningtsc --buildin exp_scenario alone, then at the repo root, plus webpack for all three packages and the roles and scenario tap suites.🤖 Generated with Claude Code