beaver-build 1.0.7 → 2.0.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.
- package/README.md +389 -237
- package/dist/index.js +1354 -63
- package/package.json +55 -57
package/README.md
CHANGED
|
@@ -1,237 +1,389 @@
|
|
|
1
|
-
<div align="center"><img width="400" height="225" alt="Beaver CLI" src="https://raw.githubusercontent.com/hd1008-lang/beaver/main/media/beaver.gif" /></div>
|
|
2
|
-
|
|
3
|
-
# Beaver
|
|
4
|
-
|
|
5
|
-
An interactive CLI tool for scaffolding modern web projects. Select your project type, configure your stack through a guided menu, and get a production-ready project generated on disk with pinned library versions.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
###
|
|
118
|
-
|
|
119
|
-
| Option |
|
|
120
|
-
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
|
134
|
-
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
|
155
|
-
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
|
162
|
-
|
|
163
|
-
|
|
|
164
|
-
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
|
169
|
-
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
##
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
1
|
+
<div align="center"><img width="400" height="225" alt="Beaver CLI" src="https://raw.githubusercontent.com/hd1008-lang/beaver/main/media/beaver.gif" /></div>
|
|
2
|
+
|
|
3
|
+
# Beaver
|
|
4
|
+
|
|
5
|
+
An interactive CLI tool for scaffolding modern web projects and applying AI development harness. Select your project type, configure your stack through a guided menu, and get a production-ready project generated on disk with pinned library versions.
|
|
6
|
+
|
|
7
|
+
**Current Version:** 2.0.0
|
|
8
|
+
|
|
9
|
+
## Getting Started
|
|
10
|
+
|
|
11
|
+
### Prerequisites
|
|
12
|
+
|
|
13
|
+
- Node.js >= 20.0.0
|
|
14
|
+
- npm
|
|
15
|
+
|
|
16
|
+
### Installation
|
|
17
|
+
|
|
18
|
+
**Option 1: Install globally** (recommended for frequent use)
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g beaver-build
|
|
22
|
+
beaver
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Option 2: Use directly with npx** (no installation needed)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx beaver-build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Commands & Options
|
|
32
|
+
|
|
33
|
+
**Main command:**
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
beaver # Interactive project scaffolding
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Options:**
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
beaver -v, --version # Show current version
|
|
43
|
+
beaver -h, --help # Show help and available commands
|
|
44
|
+
beaver update # Update beaver to the latest version from npm
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Usage
|
|
48
|
+
|
|
49
|
+
Simply run the command and follow the interactive prompts:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
beaver
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The CLI will guide you through:
|
|
56
|
+
|
|
57
|
+
1. **Project Type** — Choose React + Vite, Chrome Extension, or Next.js (upcoming)
|
|
58
|
+
2. **Project Name** — Enter your project directory name
|
|
59
|
+
3. **Configuration** — Select your preferred stack (layout, router, state management, styling, linter, AI setup, testing)
|
|
60
|
+
|
|
61
|
+
After answering all prompts, your production-ready project will be generated in the specified directory with:
|
|
62
|
+
|
|
63
|
+
- All dependencies pinned to stable versions
|
|
64
|
+
- Claude Code harness (CLAUDE.md, agents, docs) when Claude AI setup is selected
|
|
65
|
+
- Ready to run with `npm install && npm run dev`
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Development (Contributing)
|
|
70
|
+
|
|
71
|
+
To contribute or develop locally:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm install
|
|
75
|
+
|
|
76
|
+
# Development & Building
|
|
77
|
+
npm run dev # Run CLI directly in development mode (using tsx)
|
|
78
|
+
npm run dev:build # Compile TypeScript, resolve aliases, then run
|
|
79
|
+
npm run build # Compile TypeScript for distribution (outputs to dist/)
|
|
80
|
+
|
|
81
|
+
# Documentation
|
|
82
|
+
node .claude/scripts/build-docs-index.mjs # Regenerate docs/INDEX.md
|
|
83
|
+
node .claude/scripts/lint-docs-frontmatter.mjs # Validate frontmatter in docs/
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Publishing:**
|
|
87
|
+
|
|
88
|
+
When ready to publish a new version:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npm version patch|minor|major # Update version in package.json
|
|
92
|
+
npm publish # Publishes to npm (runs build automatically)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Project Types
|
|
98
|
+
|
|
99
|
+
| Type | Description | Status |
|
|
100
|
+
|---|---|---|
|
|
101
|
+
| React + Vite | React 19 + Vite with comprehensive tooling options | ✅ Available |
|
|
102
|
+
| Chrome Extension | React 19 + Vite for Chrome Manifest v3 extensions | ✅ Available |
|
|
103
|
+
| Apply AI Harness | Add Claude Code harness to an existing project | ✅ Available |
|
|
104
|
+
| Next.js | Next 15 with app router and modern features | 🔄 Upcoming |
|
|
105
|
+
| Nuxt | Nuxt 4 with Vue 3 composition API | 🔄 Upcoming |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## React + Vite
|
|
110
|
+
|
|
111
|
+
The CLI walks you through the following choices:
|
|
112
|
+
|
|
113
|
+
### 1. Project Name
|
|
114
|
+
|
|
115
|
+
Validated to allow only letters, numbers, hyphens, and underscores (`[a-zA-Z0-9_-]`).
|
|
116
|
+
|
|
117
|
+
### 2. Layout
|
|
118
|
+
|
|
119
|
+
| Option | Description |
|
|
120
|
+
|---|---|
|
|
121
|
+
| FSD | Feature Slice Design — modular file structure |
|
|
122
|
+
| BPR | Bulletproof React — scalable architecture |
|
|
123
|
+
|
|
124
|
+
### 3. Router
|
|
125
|
+
|
|
126
|
+
| Option | Version |
|
|
127
|
+
|---|---|
|
|
128
|
+
| Not Using | — |
|
|
129
|
+
| TanStack Router | v1.144.0 |
|
|
130
|
+
|
|
131
|
+
### 4. State Management
|
|
132
|
+
|
|
133
|
+
| Option | Version |
|
|
134
|
+
|---|---|
|
|
135
|
+
| Not Using | — |
|
|
136
|
+
| Zustand | v5.0.5 |
|
|
137
|
+
|
|
138
|
+
### 5. Data Fetching
|
|
139
|
+
|
|
140
|
+
| Option | Version |
|
|
141
|
+
|---|---|
|
|
142
|
+
| Not Using | — |
|
|
143
|
+
| TanStack Query | v5.74.4 |
|
|
144
|
+
|
|
145
|
+
### 6. CSS / Styling
|
|
146
|
+
|
|
147
|
+
| Option | Version |
|
|
148
|
+
|---|---|
|
|
149
|
+
| Not Using | — |
|
|
150
|
+
| Tailwind CSS | v4.1.3 |
|
|
151
|
+
|
|
152
|
+
### 7. AI Setup
|
|
153
|
+
|
|
154
|
+
| Option | Description |
|
|
155
|
+
|---|---|
|
|
156
|
+
| Not Using | — |
|
|
157
|
+
| Claude (Claude Code) | CLAUDE.md + .claude/ agents + feature docs |
|
|
158
|
+
|
|
159
|
+
### 8. Testing
|
|
160
|
+
|
|
161
|
+
| Option | Description |
|
|
162
|
+
|---|---|
|
|
163
|
+
| Not Using | — |
|
|
164
|
+
| Setup Testing Base | Vitest + React Testing Library configuration |
|
|
165
|
+
|
|
166
|
+
### 9. Linter / Formatter
|
|
167
|
+
|
|
168
|
+
| Option | Version | Notes |
|
|
169
|
+
|---|---|---|
|
|
170
|
+
| Not Using | — | — |
|
|
171
|
+
| Biome | v1.9.4 | All-in-one lint + format |
|
|
172
|
+
| ESLint | v9.39.4 | Flat config + typescript-eslint |
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Chrome Extension
|
|
177
|
+
|
|
178
|
+
Build Chrome Manifest v3 extensions with React 19 and Vite. The CLI guides you through:
|
|
179
|
+
|
|
180
|
+
### 1. Project Name
|
|
181
|
+
|
|
182
|
+
Validated to allow only letters, numbers, hyphens, and underscores (`[a-zA-Z0-9_-]`).
|
|
183
|
+
|
|
184
|
+
### 2. State Management
|
|
185
|
+
|
|
186
|
+
| Option | Version |
|
|
187
|
+
|---|---|
|
|
188
|
+
| Not Using | — |
|
|
189
|
+
| Zustand | v5.0.5 |
|
|
190
|
+
|
|
191
|
+
### 3. Data Fetching
|
|
192
|
+
|
|
193
|
+
| Option | Version |
|
|
194
|
+
|---|---|
|
|
195
|
+
| Not Using | — |
|
|
196
|
+
| TanStack Query | v5.74.4 |
|
|
197
|
+
|
|
198
|
+
### 4. CSS / Styling
|
|
199
|
+
|
|
200
|
+
| Option | Version |
|
|
201
|
+
|---|---|
|
|
202
|
+
| Not Using | — |
|
|
203
|
+
| Tailwind CSS | v4.1.3 |
|
|
204
|
+
|
|
205
|
+
### 5. AI Setup
|
|
206
|
+
|
|
207
|
+
| Option | Description |
|
|
208
|
+
|---|---|
|
|
209
|
+
| Not Using | — |
|
|
210
|
+
| Claude (Claude Code) | CLAUDE.md + .claude/ agents + feature docs |
|
|
211
|
+
|
|
212
|
+
### 6. Linter / Formatter
|
|
213
|
+
|
|
214
|
+
| Option | Version | Notes |
|
|
215
|
+
|---|---|---|
|
|
216
|
+
| Not Using | — | — |
|
|
217
|
+
| Biome | v1.9.4 | All-in-one lint + format |
|
|
218
|
+
| ESLint | v9.39.4 | Flat config + typescript-eslint |
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Apply AI Harness
|
|
223
|
+
|
|
224
|
+
Add Claude Code harness setup to an existing project. This creates CLAUDE.md, .claude/ agents, and feature documentation for AI-assisted development.
|
|
225
|
+
|
|
226
|
+
The CLI guides you through:
|
|
227
|
+
|
|
228
|
+
### 1. Project Type
|
|
229
|
+
|
|
230
|
+
| Option | Description |
|
|
231
|
+
|---|---|
|
|
232
|
+
| React + Vite | For React + Vite projects |
|
|
233
|
+
| Chrome Extension | For Chrome Manifest v3 extensions |
|
|
234
|
+
| Generic Project | For any other project type |
|
|
235
|
+
|
|
236
|
+
This generates appropriate skeleton files and agent setup based on your project type.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Generated Project — Pinned Dependencies
|
|
241
|
+
|
|
242
|
+
| Package | Version |
|
|
243
|
+
|---|---|
|
|
244
|
+
| react | 19.1.0 |
|
|
245
|
+
| react-dom | 19.1.0 |
|
|
246
|
+
| vite | 6.4.3 |
|
|
247
|
+
| @vitejs/plugin-react | 4.4.1 |
|
|
248
|
+
| typescript | 5.8.3 |
|
|
249
|
+
| @types/react | 19.1.1 |
|
|
250
|
+
| @types/react-dom | 19.1.1 |
|
|
251
|
+
| @tanstack/react-router | 1.144.0 |
|
|
252
|
+
| @tanstack/router-devtools | 1.144.0 |
|
|
253
|
+
| @tanstack/router-vite-plugin | 1.144.0 |
|
|
254
|
+
| zustand | 5.0.5 |
|
|
255
|
+
| @tanstack/react-query | 5.74.4 |
|
|
256
|
+
| @tanstack/react-query-devtools | 5.74.4 |
|
|
257
|
+
| @biomejs/biome | 1.9.4 |
|
|
258
|
+
| eslint | 9.39.4 |
|
|
259
|
+
| @eslint/js | 9.39.4 |
|
|
260
|
+
| typescript-eslint | 8.26.0 |
|
|
261
|
+
| eslint-plugin-react-hooks | 5.2.0 |
|
|
262
|
+
| eslint-plugin-react-refresh | 0.4.19 |
|
|
263
|
+
| globals | 15.15.0 |
|
|
264
|
+
| vitest | Latest (when testing enabled) |
|
|
265
|
+
| @testing-library/react | Latest (when testing enabled) |
|
|
266
|
+
| @testing-library/jest-dom | Latest (when testing enabled) |
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Project Structure
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
src/
|
|
274
|
+
index.ts Entry point — greeting, menu, error handling
|
|
275
|
+
types/index.ts Cart, ProjectType, ReactViteCore, ChromeExtensionCore, HarnessOnlyCore
|
|
276
|
+
constants/index.ts Top-level menu options (React+Vite, Chrome Extension, Apply AI Harness, Next.js, Nuxt)
|
|
277
|
+
commands/
|
|
278
|
+
update.ts runUpdate() — check and install latest version from npm
|
|
279
|
+
options/
|
|
280
|
+
index.ts Top-level project type selection
|
|
281
|
+
react-vite/
|
|
282
|
+
index.ts React + Vite menu flow
|
|
283
|
+
constants/index.ts Menu option definitions (layout, router, state, query, CSS, AI, testing, linter)
|
|
284
|
+
types/index.ts MenuOptions type
|
|
285
|
+
chrome-extension/
|
|
286
|
+
index.ts Chrome Extension menu flow
|
|
287
|
+
constants/index.ts Menu option definitions (state, query, CSS, AI, linter)
|
|
288
|
+
harness-only/
|
|
289
|
+
index.ts Apply AI Harness menu flow
|
|
290
|
+
constants/index.ts Menu option definitions (project type selection)
|
|
291
|
+
scaffold/
|
|
292
|
+
errors.ts ScaffoldError, isNodeError
|
|
293
|
+
utils.ts FileMap, dirExists(), writeProjectFile()
|
|
294
|
+
shared/
|
|
295
|
+
claude-setup.ts Shared Claude Code setup templates
|
|
296
|
+
react-vite/
|
|
297
|
+
index.ts Scaffold orchestrator
|
|
298
|
+
templates/
|
|
299
|
+
package-json.ts packageJsonTemplate(cart)
|
|
300
|
+
vite-config.ts viteConfigTemplate(cart)
|
|
301
|
+
tsconfig.ts tsconfigTemplate(), tsconfigNodeTemplate()
|
|
302
|
+
index-html.ts indexHtmlTemplate(projectName)
|
|
303
|
+
main-tsx.ts mainTsxTemplate(layout)
|
|
304
|
+
app-tsx.ts appTsxFsdTemplate(), appTsxBprTemplate()
|
|
305
|
+
router.ts rootRouteTemplate(), indexRouteTemplate()
|
|
306
|
+
zustand.ts zustandStoreTemplate()
|
|
307
|
+
query.ts queryProviderBprTemplate()
|
|
308
|
+
linter.ts biomeConfigTemplate(), eslintConfigTemplate()
|
|
309
|
+
testing-setup.ts vitestConfigTemplate(), testingSetupTemplate()
|
|
310
|
+
styles.ts stylesCssTemplate()
|
|
311
|
+
gitignore.ts gitignoreTemplate()
|
|
312
|
+
claude-setup.ts claudeSetupTemplate()
|
|
313
|
+
home-page.ts homePageTemplate()
|
|
314
|
+
vite-env-d-ts.ts viteEnvDtsTemplate()
|
|
315
|
+
fsd-layout.ts getFsdFileMap(cart)
|
|
316
|
+
bpr-layout.ts getBprFileMap(cart)
|
|
317
|
+
chrome-extension/
|
|
318
|
+
index.ts Scaffold orchestrator for Chrome extensions
|
|
319
|
+
templates/
|
|
320
|
+
package-json.ts packageJsonTemplate(cart)
|
|
321
|
+
vite-config.ts viteConfigTemplate(cart)
|
|
322
|
+
manifest-json.ts manifestJsonTemplate(cart)
|
|
323
|
+
tsconfig.ts tsconfigTemplate()
|
|
324
|
+
main-tsx.ts mainTsxTemplate()
|
|
325
|
+
app-tsx.ts appTsxTemplate()
|
|
326
|
+
layout.ts layoutTemplate()
|
|
327
|
+
linter.ts biomeConfigTemplate(), eslintConfigTemplate()
|
|
328
|
+
query.ts queryProviderTemplate()
|
|
329
|
+
gitignore.ts gitignoreTemplate()
|
|
330
|
+
claude-setup.ts claudeSetupTemplate()
|
|
331
|
+
build-extension-script.ts buildExtensionScriptTemplate()
|
|
332
|
+
harness-only/
|
|
333
|
+
index.ts Scaffold orchestrator for AI harness setup
|
|
334
|
+
templates/
|
|
335
|
+
generic-skeleton.ts Generic project skeleton
|
|
336
|
+
react-vite-skeleton.ts React + Vite skeleton
|
|
337
|
+
chrome-extension-skeleton.ts Chrome Extension skeleton
|
|
338
|
+
utils/
|
|
339
|
+
animation.ts typeWriter effect
|
|
340
|
+
user.ts getUserName() from git config
|
|
341
|
+
check-node-version.ts checkNodeVersion() — verify Node.js >= 20.0.0
|
|
342
|
+
index.ts sleep()
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## Adding a New Project Type
|
|
348
|
+
|
|
349
|
+
To enable a new project type (e.g., enable Next.js):
|
|
350
|
+
|
|
351
|
+
1. Set `disabled: false` in `src/constants/index.ts`
|
|
352
|
+
2. Create `src/options/<project-name>/` directory with:
|
|
353
|
+
- `index.ts` — menu flow function (e.g. `flowNextJS()`)
|
|
354
|
+
- `constants/index.ts` — menu option definitions
|
|
355
|
+
3. Handle the new type in `src/options/index.ts` — import and call the flow function
|
|
356
|
+
4. Add the interface to `src/types/index.ts` and include it in the `Cart` union (e.g. `NextJSCore`)
|
|
357
|
+
5. Create `src/scaffold/<project-name>/` with:
|
|
358
|
+
- `index.ts` — scaffold orchestrator (spinner, file writing, cleanup on error)
|
|
359
|
+
- `templates/` — all template functions (package.json, config files, source templates)
|
|
360
|
+
|
|
361
|
+
## Adding a New Option to React + Vite
|
|
362
|
+
|
|
363
|
+
To add a new menu option (e.g., a new UI library):
|
|
364
|
+
|
|
365
|
+
1. Add the constant to `src/options/react-vite/constants/index.ts`
|
|
366
|
+
- Define `REACT_MENU_<OPTION_NAME>` with display, value, description, disabled fields
|
|
367
|
+
2. Export the value type from `src/types/index.ts` and add the field to `ReactViteCore`
|
|
368
|
+
3. Add a `menu<OptionName>` function in `src/options/react-vite/index.ts` using `selectFromMenu`
|
|
369
|
+
4. Call it in `flowReactVite` in the right order (before scaffold step)
|
|
370
|
+
5. Update `getFsdFileMap` and `getBprFileMap` in `src/scaffold/react-vite/templates/` to handle the new option
|
|
371
|
+
|
|
372
|
+
## Adding a New Option to Chrome Extension
|
|
373
|
+
|
|
374
|
+
Same process as React + Vite:
|
|
375
|
+
|
|
376
|
+
1. Add the constant to `src/options/chrome-extension/constants/index.ts`
|
|
377
|
+
2. Export the value type from `src/types/index.ts` and add the field to `ChromeExtensionCore`
|
|
378
|
+
3. Add a `menu<OptionName>` function in `src/options/chrome-extension/index.ts`
|
|
379
|
+
4. Call it in `flowChromeExtension`
|
|
380
|
+
5. Update templates in `src/scaffold/chrome-extension/templates/` to handle the new option
|
|
381
|
+
|
|
382
|
+
## Adding Support for New Project Types in Apply AI Harness
|
|
383
|
+
|
|
384
|
+
To add support for a new project type in Apply AI Harness:
|
|
385
|
+
|
|
386
|
+
1. Create a new skeleton template in `src/scaffold/harness-only/templates/<project-type>-skeleton.ts`
|
|
387
|
+
2. Update `src/options/harness-only/constants/index.ts` to include the new project type
|
|
388
|
+
3. Update `src/options/harness-only/index.ts` to handle the new type in the menu flow
|
|
389
|
+
4. Add the skeleton template to the harness scaffold orchestrator
|