Skip to content

Commit 91728e7

Browse files
Merge pull request #16 from BootNodeDev/feat/canton-stack
feat: retarget the canton stack and split stack config into modules
2 parents a6ed048 + f39c398 commit 91728e7

50 files changed

Lines changed: 1871 additions & 1887 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ jobs:
4747
- uses: ./.github/actions/setup
4848
- run: pnpm test
4949

50-
test-node-22:
51-
name: 3 - test (node 22)
50+
test-node-floor:
51+
name: 3 - test (node 24.15.0)
5252
runs-on: ubuntu-latest
5353
if: ${{ github.event.action != 'edited' || github.event.changes.base != null }}
54-
# engines.node says >=22, so the floor gets the same test run as .nvmrc does.
54+
# engines.node says >=24.15.0, so the floor gets the same test run as .nvmrc does.
5555
steps:
5656
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5757
- uses: ./.github/actions/setup
5858
with:
59-
node-version: 22
59+
node-version: 24.15.0
6060
- run: pnpm test
6161
- run: pnpm build
6262

CLAUDE.md

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
A CLI installer tool for dAppBooster projects. It supports two **stacks** and two **modes**:
1212

13-
- **Stacks:** `evm` (the original dAppBooster for EVM chains) and `canton` (dAppBooster for Canton: Daml ledger, Carpincho wallet, off-chain services). Each stack declares its own source repository, ref strategy (tag-latest vs branch), package manager, env files, optional `removeAfterClone` paths, and features.
14-
- **Interactive** (default): React + Ink TUI that prompts for the project name first, then the stack, then the installation mode (Canton offers **default** / full / custom; EVM offers full / custom) → optional packages → install → cleanup → post-install. The stack prompt is skipped when `--canton`, `--evm`, or `--stack` is supplied.
15-
- **Non-interactive**: Flag-driven (`--ni` or auto-detected when not a TTY) for AI agents and CI. Outputs JSON to stdout. Run `--info` for stack + feature discovery, then `--canton`/`--evm` (or `--stack`) + `--name` + `--mode` [+ `--features`]. Canton supports `--mode default` (the recommended set: keeps `carpincho` + `llm`, removes `github` + `precommit`); `default` is rejected for EVM. Omitting a stack flag in non-interactive mode defaults to `evm` for backward compatibility.
13+
- **Stacks:** `evm` (the original dAppBooster for EVM chains) and `canton` (dAppBooster for Canton: Daml ledger, off-chain services). Each stack declares its own source repository, an optional `ref` to clone (without it the newest tag wins), package manager, env files, an optional `prepare` step, and features. Only EVM has features; Canton has none, so it takes neither `--mode` nor `--features`, and the wizard asks it nothing but the project name.
14+
- **Interactive** (default): React + Ink TUI that prompts for the project name first, then the stack, then — for a stack that has features — the installation mode, the optional packages and a review step, then clone → cleanup → install → post-install. The stack prompt is skipped when `--canton`, `--evm`, or `--stack` is supplied.
15+
- **Non-interactive**: Flag-driven (`--ni` or auto-detected when not a TTY) for AI agents and CI. Outputs JSON to stdout. Run `--info` for stack + feature discovery, then `--canton`/`--evm` (or `--stack`) + `--name`, plus `--mode` [+ `--features`] when the stack's `modes` list is not empty. Omitting a stack flag in non-interactive mode defaults to `evm` for backward compatibility.
1616

1717
## Stack & Conventions
1818

@@ -27,7 +27,7 @@ A CLI installer tool for dAppBooster projects. It supports two **stacks** and tw
2727
| Dead code | knip | `pnpm knip` fails on unused files, exports, and dependencies |
2828
| Secret scanning | gitleaks | Pinned in `.gitleaks-version`; the hooks install it into `bin/` |
2929
| Git hooks | husky + lint-staged + commitlint | Installed by `pnpm i`; see [Git hooks](#git-hooks) |
30-
| Node | v22+ | `engines.node` is the published floor; `.nvmrc` (24) is what CI and development use |
30+
| Node | v24.15.0+ | `engines.node` is the published floor, matched to what the scaffolded stacks need; `.nvmrc` (24) is what CI and development use |
3131
| Naming | camelCase vars/functions, PascalCase components/types | Biome enforces the same two cases for filenames |
3232

3333
## Code Style
@@ -41,10 +41,11 @@ A CLI installer tool for dAppBooster projects. It supports two **stacks** and tw
4141

4242
## Working Rules
4343

44-
- Use **pnpm** only for this installer (never npm or yarn). The Canton stack scaffolds an npm project; that's a property of the generated project, not this installer.
44+
- Use **pnpm** only (never npm or yarn), for this installer and for both scaffolded projects
4545
- Treat `dist/` as build output — never edit directly
4646
- User input (`projectName`) must never be interpolated into shell command strings — use `execFile` (args array) instead
47-
- `source/constants/config.ts` is the single source of truth for stack and feature metadata — all programmatic consumers read it through `getStackConfig(stack)`. CLI `--help` text maintains its own copy.
47+
- `source/stacks/` is the single source of truth for stack and feature metadata: one module per stack, with `source/stacks/index.ts` holding the record and the accessors. All programmatic consumers read it through `getStackConfig(stack)`. CLI `--help` text maintains its own copy.
48+
- No file outside `source/stacks/` and `source/cli.tsx` may test a stack by name. Add a `StackConfig` field instead.
4849
- Stack overrides come from env vars `DAPPBOOSTER_<STACK>_REPO_URL` and `DAPPBOOSTER_<STACK>_REF` (read inside `getStackConfig`) — useful for forks and pre-release testing.
4950
- Components are presentation-only — business logic lives in `source/operations/`. Every operation that varies per stack takes `stack` as its first argument.
5051

@@ -64,6 +65,52 @@ Key directories:
6465
- `source/components/` — reusable UI components (Ask, Divider, MainTitle, Multiselect)
6566
- `source/__tests__/` — vitest test suite
6667

68+
## Commands
69+
70+
| Command | Purpose |
71+
|---------|---------|
72+
| `pnpm build` | Compile `source/` to `dist/` |
73+
| `pnpm dev` | The same, in watch mode |
74+
| `pnpm typecheck` | Types only, no output. Two passes: `source/` for the build, then the tests |
75+
| `pnpm test` | Run the vitest suite |
76+
| `pnpm test:coverage` | The same, with a coverage report |
77+
| `pnpm lint` | Biome check, warnings included |
78+
| `pnpm lint:fix` | Biome check with `--write` |
79+
| `pnpm knip` | Report unused files, exports, and dependencies |
80+
81+
Run the built CLI from a scratch directory. It scaffolds the new project into the folder it is
82+
started from, so `node dist/cli.js` in this repo would write into the repo itself.
83+
84+
## Demo recording
85+
86+
`demo.svg` in the readme is an animated SVG of a real wizard run. Regenerate it after any change to
87+
the terminal UI:
88+
89+
```shell
90+
pnpm build
91+
./scripts/record-demo.py
92+
```
93+
94+
The script scaffolds a real EVM project into a temporary directory, so it needs network and takes a
95+
few minutes. It cleans up after itself and overwrites `demo.svg`.
96+
97+
Things worth knowing before touching it:
98+
99+
- The conversion is [svg-term-cli](https://github.com/marionebl/svg-term-cli), run through
100+
`pnpm dlx`. It is not a dependency. The flags `--window --width 92 --height 23 --padding 10`
101+
produce the committed geometry; change them and the readme's `<img>` size needs to change too.
102+
- `asciinema` cannot be scripted here. It ignores piped stdin, `script` refuses to start unless its
103+
own stdin is a tty, and `node-pty` has no prebuilt binary for this machine. The script uses
104+
Python's standard-library `pty` instead, which needs nothing installed.
105+
- It waits for each prompt to appear in the output rather than sleeping a fixed time, so it does not
106+
break when a step gets slower.
107+
- A `pnpm` shim on `PATH` makes `pnpm dlx dappbooster` run `dist/cli.js`. The recorded command line
108+
is the real one while the code being demoed is the working tree.
109+
- The recording is trimmed to 15 seconds so the loop stays short. Beyond that it is the package
110+
install, which is a long stretch of near-static output and reads as a frozen image.
111+
- Output within 150ms is merged into one frame. That cuts the file roughly five-fold, because the
112+
spinner redraws every 80ms. It changes when bytes are flushed, never which bytes.
113+
67114
## Testing
68115

69116
- **Framework:** Vitest + V8 coverage
@@ -97,7 +144,7 @@ the history by hand:
97144
## Continuous integration
98145

99146
`.github/workflows/pr.yml` runs on every pull request: Biome, then typecheck and build and knip,
100-
then the test suite on `.nvmrc` and again on the Node 22 floor, then commitlint over both the commit
147+
then the test suite on `.nvmrc` and again on the Node 24.15.0 floor, then commitlint over both the commit
101148
range and the PR title, then gitleaks over the full history. A retitle only re-runs commitlint.
102149

103150
`pr-assign.yml` assigns the author to their own pull request. `add-to-project.yml` adds new issues

0 commit comments

Comments
 (0)