beaver-build 1.0.7 → 1.0.8
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 +198 -52
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
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
6
|
|
|
7
|
+
**Current Version:** 1.0.7
|
|
8
|
+
|
|
7
9
|
## Getting Started
|
|
8
10
|
|
|
9
11
|
### Prerequisites
|
|
10
12
|
|
|
11
|
-
- Node.js
|
|
13
|
+
- Node.js >= 20.0.0
|
|
12
14
|
- npm
|
|
13
15
|
|
|
14
16
|
### Installation
|
|
@@ -23,7 +25,23 @@ beaver
|
|
|
23
25
|
**Option 2: Use directly with npx** (no installation needed)
|
|
24
26
|
|
|
25
27
|
```bash
|
|
26
|
-
npx beaver
|
|
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
|
|
27
45
|
```
|
|
28
46
|
|
|
29
47
|
### Usage
|
|
@@ -36,9 +54,9 @@ beaver
|
|
|
36
54
|
|
|
37
55
|
The CLI will guide you through:
|
|
38
56
|
|
|
39
|
-
1. **Project Type** — Choose React + Vite or
|
|
57
|
+
1. **Project Type** — Choose React + Vite, Chrome Extension, or Next.js (upcoming)
|
|
40
58
|
2. **Project Name** — Enter your project directory name
|
|
41
|
-
3. **Configuration** — Select your preferred stack (layout, router, state management, styling, linter)
|
|
59
|
+
3. **Configuration** — Select your preferred stack (layout, router, state management, styling, linter, AI setup, testing)
|
|
42
60
|
|
|
43
61
|
After answering all prompts, your production-ready project will be generated in the specified directory with:
|
|
44
62
|
|
|
@@ -54,20 +72,36 @@ To contribute or develop locally:
|
|
|
54
72
|
|
|
55
73
|
```bash
|
|
56
74
|
npm install
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
npm run docs:index # Regenerate docs/INDEX.md
|
|
83
|
+
npm run docs:lint # 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)
|
|
59
93
|
```
|
|
60
94
|
|
|
61
95
|
---
|
|
62
96
|
|
|
63
97
|
## Project Types
|
|
64
98
|
|
|
65
|
-
| Type | Status |
|
|
66
|
-
|
|
67
|
-
| React + Vite | Available |
|
|
68
|
-
| Chrome Extension | Available |
|
|
69
|
-
| Next.js | Upcoming |
|
|
70
|
-
| Nuxt | Upcoming |
|
|
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
|
+
| Next.js | Next 15 with app router and modern features | 🔄 Upcoming |
|
|
104
|
+
| Nuxt | Nuxt 4 with Vue 3 composition API | 🔄 Upcoming |
|
|
71
105
|
|
|
72
106
|
---
|
|
73
107
|
|
|
@@ -83,8 +117,8 @@ Validated to allow only letters, numbers, hyphens, and underscores (`[a-zA-Z0-9_
|
|
|
83
117
|
|
|
84
118
|
| Option | Description |
|
|
85
119
|
|---|---|
|
|
86
|
-
| FSD | Feature Slice Design |
|
|
87
|
-
| BPR | Bulletproof React |
|
|
120
|
+
| FSD | Feature Slice Design — modular file structure |
|
|
121
|
+
| BPR | Bulletproof React — scalable architecture |
|
|
88
122
|
|
|
89
123
|
### 3. Router
|
|
90
124
|
|
|
@@ -114,7 +148,67 @@ Validated to allow only letters, numbers, hyphens, and underscores (`[a-zA-Z0-9_
|
|
|
114
148
|
| Not Using | — |
|
|
115
149
|
| Tailwind CSS | v4.1.3 |
|
|
116
150
|
|
|
117
|
-
### 7.
|
|
151
|
+
### 7. AI Setup
|
|
152
|
+
|
|
153
|
+
| Option | Description |
|
|
154
|
+
|---|---|
|
|
155
|
+
| Not Using | — |
|
|
156
|
+
| Claude (Claude Code) | CLAUDE.md + .claude/ agents + feature docs |
|
|
157
|
+
|
|
158
|
+
### 8. Testing
|
|
159
|
+
|
|
160
|
+
| Option | Description |
|
|
161
|
+
|---|---|
|
|
162
|
+
| Not Using | — |
|
|
163
|
+
| Setup Testing Base | Vitest + React Testing Library configuration |
|
|
164
|
+
|
|
165
|
+
### 9. Linter / Formatter
|
|
166
|
+
|
|
167
|
+
| Option | Version | Notes |
|
|
168
|
+
|---|---|---|
|
|
169
|
+
| Not Using | — | — |
|
|
170
|
+
| Biome | v1.9.4 | All-in-one lint + format |
|
|
171
|
+
| ESLint | v9.39.4 | Flat config + typescript-eslint |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Chrome Extension
|
|
176
|
+
|
|
177
|
+
Build Chrome Manifest v3 extensions with React 19 and Vite. The CLI guides you through:
|
|
178
|
+
|
|
179
|
+
### 1. Project Name
|
|
180
|
+
|
|
181
|
+
Validated to allow only letters, numbers, hyphens, and underscores (`[a-zA-Z0-9_-]`).
|
|
182
|
+
|
|
183
|
+
### 2. State Management
|
|
184
|
+
|
|
185
|
+
| Option | Version |
|
|
186
|
+
|---|---|
|
|
187
|
+
| Not Using | — |
|
|
188
|
+
| Zustand | v5.0.5 |
|
|
189
|
+
|
|
190
|
+
### 3. Data Fetching
|
|
191
|
+
|
|
192
|
+
| Option | Version |
|
|
193
|
+
|---|---|
|
|
194
|
+
| Not Using | — |
|
|
195
|
+
| TanStack Query | v5.74.4 |
|
|
196
|
+
|
|
197
|
+
### 4. CSS / Styling
|
|
198
|
+
|
|
199
|
+
| Option | Version |
|
|
200
|
+
|---|---|
|
|
201
|
+
| Not Using | — |
|
|
202
|
+
| Tailwind CSS | v4.1.3 |
|
|
203
|
+
|
|
204
|
+
### 5. AI Setup
|
|
205
|
+
|
|
206
|
+
| Option | Description |
|
|
207
|
+
|---|---|
|
|
208
|
+
| Not Using | — |
|
|
209
|
+
| Claude (Claude Code) | CLAUDE.md + .claude/ agents + feature docs |
|
|
210
|
+
|
|
211
|
+
### 6. Linter / Formatter
|
|
118
212
|
|
|
119
213
|
| Option | Version | Notes |
|
|
120
214
|
|---|---|---|
|
|
@@ -170,6 +264,9 @@ The format follows GitHub's [path-specific custom instructions](https://docs.git
|
|
|
170
264
|
| eslint-plugin-react-hooks | 5.2.0 |
|
|
171
265
|
| eslint-plugin-react-refresh | 0.4.19 |
|
|
172
266
|
| globals | 15.15.0 |
|
|
267
|
+
| vitest | Latest (when testing enabled) |
|
|
268
|
+
| @testing-library/react | Latest (when testing enabled) |
|
|
269
|
+
| @testing-library/jest-dom | Latest (when testing enabled) |
|
|
173
270
|
|
|
174
271
|
---
|
|
175
272
|
|
|
@@ -177,61 +274,110 @@ The format follows GitHub's [path-specific custom instructions](https://docs.git
|
|
|
177
274
|
|
|
178
275
|
```
|
|
179
276
|
src/
|
|
180
|
-
index.ts
|
|
181
|
-
types/index.ts
|
|
182
|
-
constants/index.ts
|
|
277
|
+
index.ts Entry point — greeting, menu, error handling
|
|
278
|
+
types/index.ts Cart, ProjectType, ReactViteCore, ChromeExtensionCore, NextJSCore
|
|
279
|
+
constants/index.ts Top-level menu options (React+Vite, Chrome Extension, Next.js, Nuxt)
|
|
280
|
+
commands/
|
|
281
|
+
update.ts runUpdate() — check and install latest version from npm
|
|
183
282
|
options/
|
|
184
|
-
index.ts
|
|
283
|
+
index.ts Top-level project type selection
|
|
185
284
|
react-vite/
|
|
186
|
-
index.ts
|
|
187
|
-
constants/index.ts
|
|
188
|
-
types/index.ts
|
|
285
|
+
index.ts React + Vite menu flow
|
|
286
|
+
constants/index.ts Menu option definitions (layout, router, state, query, CSS, AI, testing, linter)
|
|
287
|
+
types/index.ts MenuOptions type
|
|
288
|
+
chrome-extension/
|
|
289
|
+
index.ts Chrome Extension menu flow
|
|
290
|
+
constants/index.ts Menu option definitions (state, query, CSS, AI, linter)
|
|
189
291
|
scaffold/
|
|
190
|
-
errors.ts
|
|
191
|
-
utils.ts
|
|
292
|
+
errors.ts ScaffoldError, isNodeError
|
|
293
|
+
utils.ts FileMap, dirExists(), writeProjectFile()
|
|
294
|
+
shared/
|
|
295
|
+
claude-setup.ts Shared Claude Code setup templates
|
|
192
296
|
react-vite/
|
|
193
|
-
index.ts
|
|
297
|
+
index.ts Scaffold orchestrator
|
|
194
298
|
templates/
|
|
195
|
-
package-json.ts
|
|
196
|
-
vite-config.ts
|
|
197
|
-
tsconfig.ts
|
|
198
|
-
index-html.ts
|
|
199
|
-
main-tsx.ts
|
|
200
|
-
app-tsx.ts
|
|
201
|
-
router.ts
|
|
202
|
-
zustand.ts
|
|
203
|
-
query.ts
|
|
204
|
-
linter.ts
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
+
copilot-instructions.ts getCopilotInstructionFiles(cart)
|
|
316
|
+
fsd-layout.ts getFsdFileMap(cart)
|
|
317
|
+
bpr-layout.ts getBprFileMap(cart)
|
|
318
|
+
chrome-extension/
|
|
319
|
+
index.ts Scaffold orchestrator for Chrome extensions
|
|
320
|
+
templates/
|
|
321
|
+
package-json.ts packageJsonTemplate(cart)
|
|
322
|
+
vite-config.ts viteConfigTemplate(cart)
|
|
323
|
+
manifest-json.ts manifestJsonTemplate(cart)
|
|
324
|
+
tsconfig.ts tsconfigTemplate()
|
|
325
|
+
main-tsx.ts mainTsxTemplate()
|
|
326
|
+
app-tsx.ts appTsxTemplate()
|
|
327
|
+
layout.ts layoutTemplate()
|
|
328
|
+
linter.ts biomeConfigTemplate(), eslintConfigTemplate()
|
|
329
|
+
query.ts queryProviderTemplate()
|
|
330
|
+
gitignore.ts gitignoreTemplate()
|
|
331
|
+
claude-setup.ts claudeSetupTemplate()
|
|
332
|
+
build-extension-script.ts buildExtensionScriptTemplate()
|
|
209
333
|
utils/
|
|
210
|
-
animation.ts
|
|
211
|
-
user.ts
|
|
212
|
-
|
|
334
|
+
animation.ts typeWriter effect
|
|
335
|
+
user.ts getUserName() from git config
|
|
336
|
+
check-node-version.ts checkNodeVersion() — verify Node.js >= 20.0.0
|
|
337
|
+
index.ts sleep()
|
|
213
338
|
```
|
|
214
339
|
|
|
215
340
|
---
|
|
216
341
|
|
|
217
342
|
## Adding a New Project Type
|
|
218
343
|
|
|
344
|
+
To enable a new project type (e.g., enable Next.js):
|
|
345
|
+
|
|
219
346
|
1. Set `disabled: false` in `src/constants/index.ts`
|
|
220
|
-
2. Create `src/options/<project-name>/` with
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
347
|
+
2. Create `src/options/<project-name>/` directory with:
|
|
348
|
+
- `index.ts` — menu flow function (e.g. `flowNextJS()`)
|
|
349
|
+
- `constants/index.ts` — menu option definitions
|
|
350
|
+
3. Handle the new type in `src/options/index.ts` — import and call the flow function
|
|
351
|
+
4. Add the interface to `src/types/index.ts` and include it in the `Cart` union (e.g. `NextJSCore`)
|
|
352
|
+
5. Create `src/scaffold/<project-name>/` with:
|
|
353
|
+
- `index.ts` — scaffold orchestrator (spinner, file writing, cleanup on error)
|
|
354
|
+
- `templates/` — all template functions (package.json, config files, source templates)
|
|
355
|
+
6. Register Copilot instruction templates if AI setup is available
|
|
224
356
|
|
|
225
357
|
## Adding a New Option to React + Vite
|
|
226
358
|
|
|
359
|
+
To add a new menu option (e.g., a new UI library):
|
|
360
|
+
|
|
227
361
|
1. Add the constant to `src/options/react-vite/constants/index.ts`
|
|
362
|
+
- Define `REACT_MENU_<OPTION_NAME>` with display, value, description, disabled fields
|
|
228
363
|
2. Export the value type from `src/types/index.ts` and add the field to `ReactViteCore`
|
|
229
|
-
3. Add a `menu<OptionName>` function in `src/options/react-vite/index.ts`
|
|
230
|
-
4. Call it in `flowReactVite`
|
|
231
|
-
5. Update `getFsdFileMap` and `getBprFileMap` to handle the new option
|
|
364
|
+
3. Add a `menu<OptionName>` function in `src/options/react-vite/index.ts` using `selectFromMenu`
|
|
365
|
+
4. Call it in `flowReactVite` in the right order (before scaffold step)
|
|
366
|
+
5. Update `getFsdFileMap` and `getBprFileMap` in `src/scaffold/react-vite/templates/` to handle the new option
|
|
232
367
|
6. **Add a Copilot instruction template** in `src/scaffold/react-vite/templates/copilot-instructions.ts`:
|
|
233
|
-
- Write a new template function (e.g. `
|
|
368
|
+
- Write a new template function (e.g. `uiLibraryTemplate(cart)`) returning markdown with `applyTo` frontmatter scoped to both FSD and BPR paths
|
|
234
369
|
- Register it inside `getCopilotInstructionFiles` under a conditional block keyed by the new cart field
|
|
235
|
-
- If the new option introduces
|
|
370
|
+
- If the new option introduces new file paths, extend `Paths` type and both `FSD_PATHS` / `BPR_PATHS` maps
|
|
371
|
+
|
|
372
|
+
**This step is mandatory** — every scaffolded project with the new option must receive its matching Copilot instruction file.
|
|
373
|
+
|
|
374
|
+
## Adding a New Option to Chrome Extension
|
|
375
|
+
|
|
376
|
+
Same process as React + Vite:
|
|
236
377
|
|
|
237
|
-
|
|
378
|
+
1. Add the constant to `src/options/chrome-extension/constants/index.ts`
|
|
379
|
+
2. Export the value type from `src/types/index.ts` and add the field to `ChromeExtensionCore`
|
|
380
|
+
3. Add a `menu<OptionName>` function in `src/options/chrome-extension/index.ts`
|
|
381
|
+
4. Call it in `flowChromeExtension`
|
|
382
|
+
5. Update templates in `src/scaffold/chrome-extension/templates/` to handle the new option
|
|
383
|
+
6. Add a Copilot instruction template if applicable (Chrome extensions also use AI setup)
|