Skip to content

Canton custom mode leaves a dangling workspace entry when a workspace-backed feature is deselected #8

@gabitoesmiapodo

Description

@gabitoesmiapodo

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:

  1. carpincho-wallet/ removed (correct)
  2. Root package.json scripts wallet:dev and carpincho:build:extension stripped (correct)
  3. Root package.json workspaces array still lists "carpincho-wallet" (bug)

Impact

  1. 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).
  2. 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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority: lowLow priority

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions