Summary
When the Canton stack is scaffolded in custom mode and a feature whose paths point at an npm workspace directory is deselected, cleanup removes the directory and strips its package.json scripts but does NOT prune the matching entry from the cloned project's root package.json workspaces array. Today this affects the carpincho feature only (paths: ['carpincho-wallet']), which is a workspace in the cn-dappbooster template's root package.json.
Reproduction
npx dappbooster --canton --ni --name test_drop --mode custom --features llm
Expected
The generated project's root package.json workspaces array contains no entry for the removed carpincho-wallet directory.
Actual
In the generated project:
carpincho-wallet/ removed (correct)
- Root
package.json scripts wallet:dev and carpincho:build:extension stripped (correct)
- Root
package.json workspaces array still lists "carpincho-wallet" (bug)
Impact
- Inert on npm >=7 / Node >=24 (template pins engines >=24):
npm install tolerates a listed-but-missing explicit workspace and exits 0 (verified end to end).
- Still an incorrect manifest: misleading to readers and tooling, and would error on npm <7.
Suggested fix
In source/operations/cleanupFiles.ts (cleanupCantonFiles / patchPackageJsonCanton), when removedDirs is non-empty also remove any matching entries from package.json workspaces, supporting both the string[] form and the { packages: string[] } form, keyed off the same removedDirs the script-stripping already uses.
Out of scope
The related scripts/dev-stack.sh breakage is filed separately against the cn-dappbooster template repo.
Summary
When the Canton stack is scaffolded in
custommode and a feature whosepathspoint at an npm workspace directory is deselected, cleanup removes the directory and strips itspackage.jsonscripts but does NOT prune the matching entry from the cloned project's rootpackage.jsonworkspacesarray. Today this affects thecarpinchofeature only (paths: ['carpincho-wallet']), which is a workspace in the cn-dappbooster template's rootpackage.json.Reproduction
Expected
The generated project's root
package.jsonworkspacesarray contains no entry for the removedcarpincho-walletdirectory.Actual
In the generated project:
carpincho-wallet/removed (correct)package.jsonscriptswallet:devandcarpincho:build:extensionstripped (correct)package.jsonworkspacesarray still lists"carpincho-wallet"(bug)Impact
npm installtolerates a listed-but-missing explicit workspace and exits 0 (verified end to end).Suggested fix
In
source/operations/cleanupFiles.ts(cleanupCantonFiles/patchPackageJsonCanton), whenremovedDirsis non-empty also remove any matching entries frompackage.jsonworkspaces, supporting both thestring[]form and the{ packages: string[] }form, keyed off the sameremovedDirsthe script-stripping already uses.Out of scope
The related
scripts/dev-stack.shbreakage is filed separately against the cn-dappbooster template repo.