dappbooster 3.1.4 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/app.d.ts +6 -1
  2. package/dist/app.js +54 -14
  3. package/dist/cli.js +82 -19
  4. package/dist/components/Multiselect/MultiSelect.d.ts +2 -1
  5. package/dist/components/Multiselect/MultiSelect.js +12 -7
  6. package/dist/components/steps/CloneRepo/CloneRepo.d.ts +2 -0
  7. package/dist/components/steps/CloneRepo/CloneRepo.js +8 -5
  8. package/dist/components/steps/Confirmation.d.ts +8 -0
  9. package/dist/components/steps/Confirmation.js +26 -0
  10. package/dist/components/steps/FileCleanup.d.ts +2 -0
  11. package/dist/components/steps/FileCleanup.js +7 -4
  12. package/dist/components/steps/Install/Install.d.ts +2 -0
  13. package/dist/components/steps/Install/Install.js +6 -6
  14. package/dist/components/steps/InstallationMode.js +4 -4
  15. package/dist/components/steps/OptionalPackages.d.ts +2 -0
  16. package/dist/components/steps/OptionalPackages.js +29 -11
  17. package/dist/components/steps/PostInstall.d.ts +2 -0
  18. package/dist/components/steps/PostInstall.js +12 -4
  19. package/dist/components/steps/ProjectName.d.ts +0 -7
  20. package/dist/components/steps/ProjectName.js +43 -17
  21. package/dist/components/steps/StackSelection.d.ts +8 -0
  22. package/dist/components/steps/StackSelection.js +21 -0
  23. package/dist/constants/config.d.ts +28 -4
  24. package/dist/constants/config.js +151 -46
  25. package/dist/info.d.ts +4 -1
  26. package/dist/info.js +36 -11
  27. package/dist/nonInteractive.d.ts +1 -0
  28. package/dist/nonInteractive.js +29 -14
  29. package/dist/operations/cleanupFiles.d.ts +2 -2
  30. package/dist/operations/cleanupFiles.js +159 -19
  31. package/dist/operations/cloneRepo.d.ts +2 -1
  32. package/dist/operations/cloneRepo.js +35 -11
  33. package/dist/operations/createEnvFile.d.ts +2 -1
  34. package/dist/operations/createEnvFile.js +9 -2
  35. package/dist/operations/installGuard.d.ts +8 -0
  36. package/dist/operations/installGuard.js +35 -0
  37. package/dist/operations/installPackages.d.ts +2 -2
  38. package/dist/operations/installPackages.js +14 -6
  39. package/dist/utils/utils.d.ts +7 -3
  40. package/dist/utils/utils.js +62 -6
  41. package/package.json +21 -6
  42. package/readme.md +141 -70
package/readme.md CHANGED
@@ -1,13 +1,31 @@
1
1
  # dAppBooster installer
2
2
 
3
- An easy way to install and customize [dAppBooster](https://dappbooster.dev/)
3
+ Agent-friendly installer that scaffolds a Web3 dApp. It supports **two stacks** — pick one per
4
+ run, either through the interactive wizard or with a single flag (`--evm` / `--canton`). It works
5
+ interactively (a React + Ink TUI) and non-interactively (flag-driven, JSON output) for CI and AI
6
+ agents.
7
+
8
+ - **EVM** — the original [dAppBooster](https://dappbooster.dev/) for Ethereum, Polygon, Base, and
9
+ other EVM chains.
10
+ - **Canton** — [dAppBooster for Canton](https://dappbooster-canton-landing.vercel.app/): Daml
11
+ ledger, Carpincho wallet, off-chain services.
12
+
13
+ ## Choose your stack
14
+
15
+ ```shell
16
+ pnpm dlx dappbooster --evm # EVM stack
17
+ pnpm dlx dappbooster --canton # Canton stack
18
+ ```
19
+
20
+ Omit the flag to be prompted for the stack in the wizard. Jump to the [EVM stack](#evm-stack) or
21
+ [Canton stack](#canton-stack) section for the details of each.
4
22
 
5
23
  ## Requirements
6
24
 
7
25
  - Node >= 20
8
- - pnpm
26
+ - pnpm (used by the installer itself; the scaffolded project uses pnpm or npm depending on the stack)
9
27
 
10
- ## Usage
28
+ ## Quick start (interactive)
11
29
 
12
30
  <img src="./demo.svg" width="600">
13
31
 
@@ -15,85 +33,87 @@ An easy way to install and customize [dAppBooster](https://dappbooster.dev/)
15
33
  pnpm dlx dappbooster
16
34
  ```
17
35
 
36
+ The wizard prompts for stack → project name → mode (full / custom) → features, then clones,
37
+ installs, cleans up, and prints next steps. Pass `--evm` or `--canton` to skip the stack prompt.
38
+
18
39
  dAppBooster documentation: https://docs.dappbooster.dev/
19
40
 
20
- ## Non-interactive / CI mode
41
+ ## Agents & CI (non-interactive)
21
42
 
22
- The installer supports a non-interactive mode for CI pipelines and AI agents. It activates automatically when stdout is not a TTY, or explicitly with the `--ni` flag.
43
+ Non-interactive mode activates automatically when stdout is not a TTY, or explicitly with `--ni`.
44
+ It returns JSON on stdout and a non-zero exit code on error.
23
45
 
24
- ### Discover available features
46
+ Discover stacks and features first, then install:
25
47
 
26
48
  ```shell
27
- pnpm dlx dappbooster --info
49
+ pnpm dlx dappbooster --info # all stacks + features as JSON
50
+ pnpm dlx dappbooster --info --stack canton # filter to one stack (or --info --canton)
28
51
  ```
29
52
 
53
+ | Flag | Purpose |
54
+ |---|---|
55
+ | `--canton` / `--evm` | Pick the stack (mutually exclusive shortcuts) |
56
+ | `--stack <evm\|canton>` | Pick the stack by name (useful when scripting) |
57
+ | `--name <name>` | Project directory name (`/^[a-zA-Z0-9_]+$/`) |
58
+ | `--mode <full\|custom>` | `full` installs every feature; `custom` needs `--features` |
59
+ | `--features <a,b,c>` | Comma-separated feature keys (custom mode only) |
60
+ | `--ni` | Force non-interactive mode |
61
+
62
+ Mixing flags that disagree (`--canton --evm`, or `--canton --stack evm`) is an error. Each stack
63
+ accepts only its own feature keys, and validation errors name the stack:
64
+
30
65
  ```json
31
66
  {
32
- "features": {
33
- "demo": {
34
- "description": "Component demos and example pages",
35
- "default": true
36
- },
37
- "subgraph": {
38
- "description": "TheGraph subgraph integration",
39
- "default": true,
40
- "postInstall": [
41
- "Provide your own API key for PUBLIC_SUBGRAPHS_API_KEY in .env.local",
42
- "Run pnpm subgraph-codegen from the project folder"
43
- ]
44
- },
45
- "typedoc": {
46
- "description": "TypeDoc API documentation generation",
47
- "default": true
48
- },
49
- "vocs": {
50
- "description": "Vocs documentation site",
51
- "default": true
52
- },
53
- "husky": {
54
- "description": "Git hooks with Husky, lint-staged, and commitlint",
55
- "default": true
56
- }
57
- },
58
- "modes": {
59
- "full": "Install all features",
60
- "custom": "Choose features individually"
61
- }
67
+ "success": false,
68
+ "error": "Unknown features for stack 'canton': subgraph. Valid features: counter, e2e, carpincho, llm"
62
69
  }
63
70
  ```
64
71
 
65
- ### Full install
72
+ Any failure returns `{ "success": false, "error": "..." }` with exit code 1 (e.g. a missing
73
+ `--name`).
66
74
 
67
- ```shell
68
- pnpm dlx dappbooster --ni --name my_dapp --mode full
69
- ```
75
+ A successful install prints:
70
76
 
71
77
  ```json
72
78
  {
73
79
  "success": true,
74
- "projectName": "my_dapp",
75
- "mode": "full",
76
- "features": ["demo", "subgraph", "typedoc", "vocs", "husky"],
77
- "path": "/absolute/path/to/my_dapp",
78
- "postInstall": [
79
- "Provide your own API key for PUBLIC_SUBGRAPHS_API_KEY in .env.local",
80
- "Run pnpm subgraph-codegen from the project folder"
81
- ]
80
+ "stack": "evm|canton",
81
+ "projectName": "...",
82
+ "mode": "full|custom",
83
+ "features": ["..."],
84
+ "path": "/absolute/path",
85
+ "postInstall": ["..."]
82
86
  }
83
87
  ```
84
88
 
85
- ### Custom install with selected features
89
+ ## EVM stack
90
+
91
+ ```shell
92
+ pnpm dlx dappbooster --evm
93
+ ```
94
+
95
+ Interactive (skips the stack prompt) or non-interactive:
86
96
 
87
97
  ```shell
88
- pnpm dlx dappbooster --ni --name my_dapp --mode custom --features demo,subgraph
98
+ pnpm dlx dappbooster --evm --ni --name my_dapp --mode full
99
+ pnpm dlx dappbooster --evm --ni --name my_dapp --mode custom --features demo,subgraph
89
100
  ```
90
101
 
102
+ | Feature | Key | Default | Description |
103
+ |---|---|---|---|
104
+ | Component Demos | `demo` | ✓ | Component demos and example pages |
105
+ | Subgraph support | `subgraph` | ✓ | TheGraph subgraph integration |
106
+ | Typedoc | `typedoc` | ✓ | TypeDoc API documentation generation |
107
+ | Vocs | `vocs` | ✓ | Vocs documentation site |
108
+ | Husky | `husky` | ✓ | Git hooks with Husky, lint-staged, and commitlint |
109
+
91
110
  ```json
92
111
  {
93
112
  "success": true,
113
+ "stack": "evm",
94
114
  "projectName": "my_dapp",
95
- "mode": "custom",
96
- "features": ["demo", "subgraph"],
115
+ "mode": "full",
116
+ "features": ["demo", "subgraph", "typedoc", "vocs", "husky"],
97
117
  "path": "/absolute/path/to/my_dapp",
98
118
  "postInstall": [
99
119
  "Provide your own API key for PUBLIC_SUBGRAPHS_API_KEY in .env.local",
@@ -102,43 +122,94 @@ pnpm dlx dappbooster --ni --name my_dapp --mode custom --features demo,subgraph
102
122
  }
103
123
  ```
104
124
 
105
- ### Error handling
125
+ ## Canton stack
126
+
127
+ ```shell
128
+ pnpm dlx dappbooster --canton
129
+ ```
106
130
 
107
- Errors return structured JSON with a non-zero exit code:
131
+ Interactive (skips the stack prompt) or non-interactive:
108
132
 
109
133
  ```shell
110
- pnpm dlx dappbooster --ni --mode full
134
+ pnpm dlx dappbooster --canton --ni --name my_canton_dapp --mode full
135
+ pnpm dlx dappbooster --canton --ni --name my_canton --mode custom --features counter,carpincho
111
136
  ```
112
137
 
138
+ | Feature | Key | Default | Description |
139
+ |---|---|---|---|
140
+ | Counter demo | `counter` | ✓ | Counter demo dapp (frontend + Daml + wallet-service) |
141
+ | E2E tests | `e2e` | ✓ | Playwright end-to-end test suite (**requires `counter`**) |
142
+ | Carpincho wallet | `carpincho` | ✓ | Carpincho browser-extension wallet (frontend + build tooling) |
143
+ | LLM & agent artifacts | `llm` | ✓ | `.claude`, `AGENTS.md`, `CLAUDE.md`, `architecture.md`, `llms.txt`, … |
144
+
145
+ `e2e` drives the counter dapp, so it **requires** `counter`: requesting `--features e2e` auto-pulls
146
+ `counter` in (the success JSON reports `["counter", "e2e"]`), and in the wizard, deselecting
147
+ `counter` also unchecks `e2e`.
148
+
149
+ The Canton scaffold uses **npm** (a property of the generated project, not this installer). After
150
+ install: review `canton-barebones/.env`, run `npm run canton:up` to start the local Canton stack,
151
+ and `npm run app:dev` to run the counter dapp frontend. When `carpincho` is included, build the
152
+ extension with `npm run carpincho:build:extension` and load `carpincho-wallet/dist-extension` as an
153
+ unpacked browser extension.
154
+
155
+ **What gets stripped:**
156
+
157
+ - **Always** (every stack and mode): CI config (`.github`) and the husky/commitlint automation
158
+ (`.husky`, `.lintstagedrc.mjs`, `commitlint.config.js`), plus their entries in the root
159
+ `package.json`.
160
+ - **Per feature** (custom mode): deselecting a feature removes its files and any `package.json`
161
+ scripts that target them — deselecting `carpincho` removes `carpincho-wallet/` and its scripts
162
+ (`wallet:dev`, `carpincho:build:extension`); deselecting `llm` removes the agent docs.
163
+ - A **full** install keeps all four features — including `carpincho-wallet/` and the agent docs.
164
+
113
165
  ```json
114
166
  {
115
- "success": false,
116
- "error": "Missing required flag: --name"
167
+ "success": true,
168
+ "stack": "canton",
169
+ "projectName": "my_canton_dapp",
170
+ "mode": "full",
171
+ "features": ["counter", "e2e", "carpincho", "llm"],
172
+ "path": "/absolute/path/to/my_canton_dapp",
173
+ "postInstall": [
174
+ "Review canton-barebones/.env (created from the example)",
175
+ "Run npm run canton:up to start the local Canton stack",
176
+ "Run npm run app:dev to start the counter dapp frontend",
177
+ "Build the Carpincho extension with npm run carpincho:build:extension",
178
+ "Load carpincho-wallet/dist-extension as an unpacked browser extension"
179
+ ]
117
180
  }
118
181
  ```
119
182
 
120
- ## Development
183
+ ## Repo / ref overrides (env vars)
184
+
185
+ Each stack's source repository and ref can be overridden — useful for forks, or for testing a
186
+ feature branch before it lands on `main`.
121
187
 
122
- Clone the repo
188
+ | Variable | Effect |
189
+ |---|---|
190
+ | `DAPPBOOSTER_EVM_REPO_URL` | Override the EVM stack git URL |
191
+ | `DAPPBOOSTER_EVM_REF` | Override the EVM stack ref (still checks out the latest tag if unset) |
192
+ | `DAPPBOOSTER_CANTON_REPO_URL` | Override the Canton stack git URL |
193
+ | `DAPPBOOSTER_CANTON_REF` | Override the Canton stack branch |
123
194
 
124
195
  ```shell
125
- git clone git@github.com:BootNodeDev/dAppBoosterInstallScript.git
196
+ DAPPBOOSTER_CANTON_REF=some-feature-branch \
197
+ pnpm dlx dappbooster --canton --ni --name my_canton --mode full
126
198
  ```
127
199
 
128
- Move into the folder you just created and install the dependencies
200
+ The Canton stack defaults to `BootNodeDev/cn-dappbooster` on the `main` branch. The repo has no
201
+ release tags yet, so it tracks `main`; once a release is tagged, switch the default to
202
+ `refType: 'tag-latest'` (or pin a `ref`) in `source/constants/config.ts`.
203
+
204
+ ## Development
129
205
 
130
206
  ```shell
207
+ git clone git@github.com:BootNodeDev/dAppBoosterInstallScript.git
131
208
  cd dAppBoosterInstallScript
132
-
133
209
  pnpm i
134
- ```
135
-
136
- You can run the script by doing
137
-
138
- ```shell
139
- node cli.js
210
+ node dist/cli.js
140
211
  ```
141
212
 
142
213
  ## Releasing new versions to NPM
143
214
 
144
- New releases are automatically uploaded to NPM using GitHub actions.
215
+ New releases are automatically uploaded to NPM via GitHub Actions.