Skip to content

feat: add Canton stack support#4

Merged
fernandomg merged 11 commits into
mainfrom
feat/canton-stack
Jun 1, 2026
Merged

feat: add Canton stack support#4
fernandomg merged 11 commits into
mainfrom
feat/canton-stack

Conversation

@fernandomg
Copy link
Copy Markdown
Member

Adds the Canton stack alongside EVM via a config-driven stack abstraction.

  • Stack selection: --canton / --evm / --stack, plus the interactive wizard; --info exposes stacks, features, and dependencies.
  • Canton features (counter, e2e, carpincho, llm), all default-on, data-driven cleanup; e2e requires counter (auto-resolved, both paths).
  • Hygiene: always strip CI + husky/commitlint; Canton keeps agent docs under the llm feature (EVM unchanged).
  • Interactive flow gathers all answers before any disk work (+ confirmation), and a partial scaffold is removed on Ctrl+C.
  • architecture.md split into a lean index + docs/architecture/.

Testing

  • build + lint + 186 tests green (Node 22).
  • Live-verified against BootNodeDev/cn-dappbooster: full + all 16 custom combos, plus a real interrupt (partial dir removed).

Closes #3

🤖 Generated with Claude Code

fernandomg added 11 commits June 1, 2026 20:20
pnpm 11 (the version that runs on Node 24) deprecates the package.json
"pnpm" field in favor of pnpm-workspace.yaml, and replaces
onlyBuiltDependencies with allowBuilds (supported since pnpm 10.26).

- .nvmrc: 20 -> 24
- move the @biomejs/biome build allowance into pnpm-workspace.yaml as
  allowBuilds; drop the now-empty "pnpm" field from package.json
The installer now scaffolds from two stacks. EVM (the existing
dAppBooster) stays the default; Canton clones BootNodeDev/cn-dappbooster
and drops the Carpincho wallet, which ships separately as an extension.

- A `Stack` config (source/constants/config.ts) holds each stack's repo,
  ref strategy (latest tag or branch), package manager, env files,
  clone-time removals, and features. DAPPBOOSTER_<STACK>_REPO_URL / _REF
  env vars override repo and ref for forks and feature-branch testing.
- Operations take the stack as their first argument: cloneRepo handles
  both tag and branch refs, installPackages uses the stack's package
  manager, createEnvFile copies each stack's env files, and cleanupFiles
  dispatches per stack. Canton script cleanup strips scripts by the
  directory they target, so it tracks removals instead of script names.
- CLI gains --canton / --evm / --stack (non-interactive defaults to evm).
  The TUI adds a stack selection step; completed selection steps collapse
  to a static summary so only the active step shows a live menu; and the
  project-name step rejects an already-existing directory (parity with
  the non-interactive guard) instead of failing later during clone.
Add data-driven `paths` to each Canton feature and a single cleanup loop that
removes a deselected feature's paths and strips its package.json scripts. Adds
two new optional features (both default-on, so a full install is unchanged):

- carpincho: the Carpincho browser-extension wallet (no longer force-removed at
  clone time; its env file and build/load post-install steps are feature-gated)
- llm: agent/LLM artifacts (.claude, AGENTS.md, CLAUDE.md, architecture.md, …)

Repository hygiene is now split: both stacks always drop .github + husky/
commitlint automation, EVM additionally always drops its own agent metadata,
and Canton keeps that metadata under the `llm` feature.
Rewrite readme.md around the two stacks (Choose your stack, per-stack sections
with feature tables and sample JSON, Agents & CI). Update architecture.md to
describe the split repository hygiene (CI + automation always; EVM metadata
always; Canton metadata under the `llm` feature) and the data-driven Canton
feature cleanup via `paths`.
Add a one-directional, transitively-resolved `requires` field to
FeatureDefinition; `e2e` declares `requires: ['counter']` because the suite
drives the counter dapp. Resolution lives in pure helpers in utils.ts:

- resolveSelectedFeatures expands a selection with its transitive requirements
  (non-interactive: --features e2e yields [counter, e2e])
- applyFeatureToggle keeps the interactive multiselect consistent — selecting
  pulls requirements in, deselecting cascades dependents out

--info surfaces each feature's `requires` so agents can resolve dependencies
themselves, and --help documents the auto-resolution.
architecture.md becomes a short index (intro, tech stack, project structure, a
'read this when…' link table) so agents load only the sub-doc they need:

- docs/architecture/abstractions.md — Stack/config, FeatureDefinition, operations, shell, security
- docs/architecture/data-flow.md   — non-interactive + interactive flows
- docs/architecture/extending.md   — add a stack / feature / operation

Design specs at docs/ root stay local-only; these reference docs are committed.
Reorder the interactive flow so every question (stack, project name, mode,
features) is answered before any operation runs — clone/install/cleanup now
happen only at the end, mirroring the non-interactive path. Abandoning the
wizard while answering therefore leaves nothing on disk.

Add a Confirmation step that shows a one-line plan summary (describeInstallPlan)
as the last side-effect-free moment. Choosing 'No' loops back to re-answer the
questions from the top; 'Yes' starts the operations.
Add installGuard: beginInstall records the project directory the moment disk
work starts and registers SIGINT/SIGTERM handlers; completeInstall clears it
once the scaffold is done (so Ctrl+C on the finished project is safe). On
interrupt while a scaffold is in progress, the partial directory is removed.

It only ever removes a directory the installer created this run — both paths
reject a pre-existing directory up front — so user data is never touched. Wired
into the interactive path (CloneRepo begin, FileCleanup complete) and the
non-interactive path (around its operation block).
Update docs/architecture/data-flow.md for the questions-before-operations order
and the Confirmation step, document installGuard under abstractions, and list it
in the architecture index's project structure.
@fernandomg fernandomg merged commit fbefb5e into main Jun 1, 2026
@fernandomg fernandomg deleted the feat/canton-stack branch June 1, 2026 19:58
@fernandomg fernandomg mentioned this pull request Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Canton stack support to the installer

1 participant