Skip to content

feat: retarget the canton stack and split stack config into modules - #16

Open
gabitoesmiapodo wants to merge 17 commits into
mainfrom
feat/canton-stack
Open

feat: retarget the canton stack and split stack config into modules#16
gabitoesmiapodo wants to merge 17 commits into
mainfrom
feat/canton-stack

Conversation

@gabitoesmiapodo

@gabitoesmiapodo gabitoesmiapodo commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #15

canton-dappbooster moved to a new repository and publishes its three libraries to npm. The installer still pointed at the old repo and described a tree that no longer exists.

Changes

  • Canton clones the new canton-dappbooster at its newest tag and installs with pnpm
  • Canton has no optional features, so it asks only for a project name
  • A prepare step deletes the in-tree libraries and repo-only tooling before the install
  • Stack metadata moved from one config file to a module per stack
  • Project names may contain dashes, but not as the first character
  • The review screen lists each setting on its own line, values highlighted
  • Running steps show a spinner, and the title shows a badge for the chosen stack
  • Canton has its own post-install screen; the EVM one points at the dAppBooster repo

Deviations

  • EVM prompts and output did change: review layout, step titles, spinner, badge, post-install links. Cosmetic only, no flag or feature behaviour moved
  • refType removed entirely rather than set to tag-latest. With both stacks on tags it had nothing left to decide, so ref alone drives the clone
  • npm dropped from the package manager union. No stack used it and the project rule is pnpm only
  • Dashes in project names, four dependency patch bumps, the re-recorded demo and the docs merge all rode along

Acceptance criteria

  • pnpm dlx dappbooster --canton --name testproj --ni scaffolds a working project from the latest canton-dappbooster tag
  • The scaffolded tree contains none of the deleted paths listed in Part 3
  • The scaffolded package.json has neither the seven scripts nor typedoc and postcss
  • pnpm install in the scaffolded project resolves the three @bootnodedev/* libraries from npm, with no path pointing into a workspace library folder
  • pnpm lint, pnpm typecheck, pnpm test and pnpm knip all pass in the scaffolded project (knip printing configuration hints is fine, as long as it exits 0)
  • The scaffolded project is a git repository with one commit, authored by the user's own git identity
  • The wizard asks a Canton user for a project name and nothing else
  • --mode or --features with --canton fails with a message naming the reason
  • The EVM path is unchanged: same prompts, same features, same output
  • No file in source/ outside stacks/ and cli.tsx tests a stack by name

Test plan

Automated tests

  1. Run pnpm install
  2. Run pnpm lint && pnpm typecheck && pnpm build && pnpm test && pnpm knip
  3. Expect 200 passing tests and every check green

Manual verification

  1. Check out this branch and run pnpm build
  2. From an empty directory, run node <repo>/dist/cli.js
  3. Enter a project name, pick Canton, and expect no further questions
  4. Start Docker, then run ./scripts/dev-stack.sh up in the new project and choose Stack Up
  5. Open http://localhost:3012 and expect the Canton Vesting page

Optional: EVM

  1. Run the wizard again, pick EVM, choose Custom, and tick a few features
  2. Expect the review screen to list Stack, Project, Mode and Features on separate lines, each value in green
  3. Confirm, then run pnpm subgraph-codegen and pnpm dev, and open the printed URL

Non-interactive, driven by an agent verification

Give a coding agent only the goal, never the flags, and watch what it does.

  1. Point the agent at the built CLI and ask it to scaffold a Canton project in an empty directory
  2. Expect it to run --info first, and to read modes before choosing anything
  3. Expect it to send --canton --ni --name <name> and no --mode or --features
  4. Expect JSON with "success": true and an empty features list
  5. Ask it to scaffold an EVM project with only the demos and subgraph
  6. Expect --evm --ni --mode custom --features demo,subgraph, and the same features echoed back

To check the failure paths by hand:

  1. Run the CLI with --canton --ni --name x --mode full and expect a refusal naming Canton
  2. Run it with --evm --ni --name x --mode custom --features nope and expect the valid feature names listed
  3. Run it with --canton --evm and expect a conflicting-flags error

Breaking changes

None.

Checklist

  • Self-reviewed my own diff
  • Tests added or updated
  • Docs updated (if applicable)
  • No unrelated changes bundled in

The initial commit was made as "dAppBooster <no-reply@dappbooster.dev>",
so the first entry in every new project's history belonged to the
installer instead of the person who ran it.

Drop the hardcoded name and email and let git fall back to the user's own
configuration. Signing stays off, and --no-verify stays, so the project's
own hooks do not lint a tree nobody has touched yet.
Canton now points at canton-dappbooster and installs with pnpm. It is
cloned at its newest tag, copies one root .env file, and offers no
optional features, so the wizard asks only for a project name and the CLI
rejects --mode and --features for it.

Stack metadata leaves source/constants/config.ts for one module per stack
under source/stacks/, with source/stacks/index.ts holding the record and
the accessors. Every type moves to source/types/types.ts.

New fields in StackConfig:

- prepare: the paths, scripts and devDependencies every scaffold drops.
  It runs before the install, so the package manager resolves the pruned
  manifest once. Replaces removeAfterClone and hygiene.
- minNodeVersion: checked at the top of cloneRepo, so a Node that is too
  old fails with a plain message instead of a confusing install error.
- postInstallComponent: a richer closing screen for the wizard, imported
  on demand so --info and the non-interactive path never load Ink.

A stack is cloned at its newest tag unless ref names one, which today
only DAPPBOOSTER_<STACK>_REF does. That leaves refType with nothing to
decide, so it is gone, along with npm as a package manager. No stack used
either.
Update the architecture guide, the readme and the agent instructions for
the new layout. source/stacks/ is the single source of truth for stack
and feature metadata, and every type lives in source/types/types.ts.

Also covers:

- the prepare step, and what it replaced
- the Canton stack, and why it takes neither --mode nor --features
- the rule that no file outside source/stacks/ and source/cli.tsx may
  test a stack by name
The review step printed everything on one long line, separating the
settings with a middle dot. Each setting now gets its own line, and the
value after the colon is bold green, the same style the stack and
installation type answers already use.

The installation mode is named from one shared table, so the review
spells it the same way the selector did.

- describeInstallPlan returns a label and a value per setting instead of
  a finished string, so the step decides how a line looks
- MODE_LABELS moves to utils.ts, where both the selector and the review
  read it
- the confirmation answers now read "Yes." and "No, start over."
- planSummary is memoised, because the step list is built from it
The divider read "Full installation" or "Custom installation", built
from the mode name. Stacks with no modes have nothing to put there, so
the title is now fixed and works for any stack.
The divider read "Post-install instructions — EVM". The stack is already
settled by the time this step runs, so the title is now fixed.
Canton fell back to a plain list of lines while EVM had a proper screen.
It now has one too, laid out the same way: the steps to start, then a
warning, then where to read more.

Canton:

- highlights dev-stack, the cd command, the script path and Stack Up
- warns in bold that the first run pulls about 10 GB
- links the README, the components documentation and the issue tracker

EVM:

- drops the line about the installer's own issue tracker
- reports issues against the dAppBooster repo instead
- adds a link to the components documentation
- rewords the documentation line to match Canton's

The postInstall lines in the stack config stay as they are. They are what
--ni prints as JSON.
The running step showed a static circle and the word "Working...". It now
shows a spinner, so a long clone or install looks alive instead of stuck.

Adds ink-spinner, which resolves to the same ink 5.2.1 the other ink
packages use, so there is still one renderer. Clone, cleanup and install
all render through StepProgress, so all three get it.
Project names took letters, numbers and underscores only, so the common
my-dapp spelling was rejected.

Dashes are now allowed, but not as the first character: the name is the
last argument of git clone, and git reads a leading dash as an option.
--upload-pack= runs a command, so the name has to start with a letter,
a number or an underscore.

The wizard tip, the --ni error and the --help text all say so. Ask takes
its tip as a node now, so the tip can put "non-initial" in bold.
Once a stack is picked, the title shows which one, so the stack stays
visible for the rest of the run instead of scrolling away with the
selection step.

MainTitle takes the stack and reads its label from the config, so a third
stack needs no change here. Nothing shows before a stack is chosen.

The badge sits on the last line of the logo. ink-big-text pads its block
with two blank lines top and bottom, which is what the bottom margin
cancels out.
Patch and minor bumps only. No API changes, so nothing in the source had
to move.

- @biomejs/biome 2.5.12 -> 2.5.13
- knip 6.33.0 -> 6.35.1
- @types/node 24.13.3 -> 24.13.4
- lint-staged 17.5.0 -> 17.5.1

biome.json points at the matching schema, which biome migrate wrote.

The major bumps are left alone: ink 7 wants react 19, and ink-divider
depends on ink 5 outright rather than as a peer, so taking it would load
two renderers. TypeScript 7 is its own decision.
The readme dropped its development section. Everything in it was already
here except two things, which move over:

- the full command table. Only the five validation commands were listed,
  so build, dev, test:coverage and lint:fix were missing, as was the fact
  that typecheck runs two passes
- the warning to run the built CLI from a scratch directory, since it
  scaffolds into the folder it starts from
architecture.md was an index pointing at three files under
docs/architecture/. The split existed so a reader could open one part
instead of all of it, but the whole guide is only 280 lines, so it bought
nothing and cost an index table to keep in sync and links between files
that break when a section moves.

It is one file now, with the sub-docs as sections: Key Abstractions, Data
Flow, Extending the Installer. The docs folder is gone.

The prose is unchanged. Only the heading levels moved, and the two links
between sub-docs became in-page anchors.
Most of the readme repeated what CLAUDE.md and architecture.md already
say, at more length and with less accuracy.

The flag table was also incomplete. It now lists --info, --help,
--version and the --non-interactive long form, checked against cli.tsx
and the --help output, and the --name row shows the real pattern now that
dashes are allowed.
demo.svg still showed an older wizard. It now shows the current one: the
stack prompt, the badge, the stacked review screen and the spinner.

It is cut at 15 seconds, ending as the clone starts. Past that point it is
the package install, a long stretch of near-static output that reads as a
frozen image rather than a loop. The file is 28 KB, down from 90 KB.

scripts/record-demo.py regenerates it in one command. It scaffolds a real
EVM project in a temporary directory, drives the wizard, and runs
svg-term-cli.

CLAUDE.md records what was expensive to work out: the exact svg-term
flags that match the committed geometry, why asciinema cannot be scripted
here, and why the script uses a pty from the Python standard library.
Claims that this branch made wrong:

- stacks were said to declare a "ref strategy (tag-latest vs branch)".
  refType is gone; a stack declares an optional ref and is cloned at its
  newest tag without one
- the interactive step order read "install then cleanup". It is clone,
  cleanup, install, post-install
- installPackages was said to use pnpm or npm. It is pnpm only
- Confirmation was said to show a one-line summary. It shows one line per
  setting

Also adds ink-spinner to the styling row, CantonPostInstall.tsx to the
structure tree, and the stack badge to the MainTitle description.
The installer accepted Node 22 while the Canton stack needs 24.15.0, so a
Canton user on Node 22 got as far as the clone before being turned away.
Everything now asks for the same version.

- engines.node is >=24.15.0
- the CI floor job runs 24.15.0 instead of 22
- the readme, CLAUDE.md and architecture.md say the same

.nvmrc stays at 24. It already resolves to the newest 24.x, and pinning
development to the floor is worse than following the latest patch. CI
still covers both.

dAppBooster declares no Node version at all, which is
BootNodeDev/dAppBooster#484. The EVM stack gets no minNodeVersion until
that lands, since the number should come from the template.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It is a large, multi-file refactor that retargets a stack, changes CLI/UX behavior, and touches CI and dependency floors, so final human verification is warranted.

Pull request overview

This PR retargets the Canton stack at the new canton-dappbooster repository (whose three libraries now ship on npm) and refactors stack/feature metadata out of a single source/constants/config.ts into a per-stack module layout under source/stacks/. Scaffolding Canton is now essentially deletion: a prepare phase removes the in-tree library folders (canton-connect, canton-dappbooster, canton-theme, kit/) and repo-only tooling before a single pnpm install, so the same package.json resolves the libraries from the registry. Canton declares no features, so the wizard asks only for a project name and the non-interactive path rejects --mode/--features for it. The EVM path keeps its features and behavior, with cosmetic UI updates (per-line review screen, running spinner, stack badge, dedicated post-install screens).

Changes:

  • Split constants/config.ts into source/stacks/{index,evm,canton}.ts + shared source/types/types.ts; all consumers read via getStackConfig, and getInstallationModes returns [] for featureless stacks to drive step-skipping and CLI rejection.
  • Retarget Canton (new repoUrl, pnpm, minNodeVersion 24.15.0, initialCommit, latest-tag clone, prepare paths/scripts/devDependencies, single .env.example → .env), drop the Canton feature system, and generalize removeAfterClone into a config-driven prepare phase applied before install.
  • Allow dashes (not leading) in project names, add spinner/badge/per-line review UI, dedicated EvmPostInstall/CantonPostInstall, drop npm/refType, bump four dev deps, raise engines.node floor, and update docs/demo/CI.
File summaries
File Description
source/stacks/index.ts New accessors (getStackConfig with env overrides, getInstallationModes) that centralize stack metadata.
source/stacks/evm.ts EVM StackConfig with prepare/staging and the five features unchanged.
source/stacks/canton.ts Retargeted Canton config: new repo, pnpm, prepare deletions, no features, dedicated post-install.
source/types/types.ts Home for shared types (Stack, FeatureName, StackConfig, PrepareStep, PlanSummaryItem, …).
source/operations/cleanupFiles.ts Config-driven prepare phase: delete paths, strip scripts referencing removed dirs, prune devDependencies pre-install.
source/operations/installPackages.ts Simplified to pnpm-only (remove) install/post-install flow.
source/operations/cloneRepo.ts Uses ref (env override) or latest tag; enforces minNodeVersion before disk work.
source/nonInteractive.ts Rejects --mode/--features for featureless stacks with a named reason.
source/app.tsx Skips mode/feature/confirmation steps when a stack has no features.
source/utils/utils.ts Adds meetsNodeVersion, MODE_LABELS, per-item describeInstallPlan, dash-aware isValidName.
source/components/steps/* New spinner (StepProgress), stack badge (MainTitle), and Evm/Canton post-install screens.
source/info.ts --info reports empty modes/features for Canton.
tests, docs, demo, CI, package.json Comprehensive test updates, doc merge, re-recorded demo, dep bumps, and Node-floor CI rename.
Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 48/50 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Canton stack: retarget at the new canton-dappbooster, drop the feature system, split the stacks

2 participants