@donotdev/cli 0.0.11 → 0.0.13
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/dependencies-matrix.json +30 -116
- package/dist/bin/commands/bump.js +137 -104
- package/dist/bin/commands/create-app.js +20 -0
- package/dist/bin/commands/create-project.js +63 -7
- package/dist/bin/commands/deploy.js +7606 -17
- package/dist/bin/commands/firebase-setup.d.ts +6 -0
- package/dist/bin/commands/firebase-setup.d.ts.map +1 -0
- package/dist/bin/commands/firebase-setup.js +7 -0
- package/dist/bin/commands/firebase-setup.js.map +1 -0
- package/dist/bin/commands/staging.d.ts +11 -0
- package/dist/bin/commands/staging.d.ts.map +1 -0
- package/dist/bin/commands/staging.js +12 -0
- package/dist/bin/commands/staging.js.map +1 -0
- package/dist/bin/dndev.js +28 -3
- package/dist/bin/donotdev.js +28 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7714 -62
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/app-demo/src/pages/DetailPage.tsx.example +1 -1
- package/templates/app-demo/src/pages/FullPage.tsx.example +3 -3
- package/templates/app-demo/src/pages/HomePage.tsx.example +1 -1
- package/templates/app-demo/src/pages/components/ComponentRenderer.tsx.example +5 -5
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +3 -3
- package/templates/app-next/.env.example +2 -0
- package/templates/app-next/src/pages/HomePage.tsx.example +2 -2
- package/templates/app-vite/.env.example +2 -0
- package/templates/app-vite/src/pages/HomePage.tsx.example +163 -73
- package/templates/functions-firebase/build.mjs.example +26 -10
- package/templates/functions-firebase/functions-firebase/build.mjs.example +26 -10
- package/templates/functions-firebase/functions.config.js.example +11 -15
- package/templates/github-consumer/.github/workflows/ci.yml.example +36 -0
- package/templates/root-consumer/.claude/agents/architect.md.example +2 -2
- package/templates/root-consumer/.claude/agents/builder.md.example +2 -2
- package/templates/root-consumer/.claude/agents/coder.md.example +2 -2
- package/templates/root-consumer/.claude/agents/extractor.md.example +2 -3
- package/templates/root-consumer/.claude/agents/polisher.md.example +67 -291
- package/templates/root-consumer/.claude/agents/prompt-engineer.md.example +4 -4
- package/templates/root-consumer/.claude/commands/build.md.example +2 -2
- package/templates/root-consumer/.claude/commands/polish.md.example +65 -81
- package/templates/root-consumer/.env.example +13 -13
- package/templates/root-consumer/.gemini/settings.json.example +9 -0
- package/templates/root-consumer/.gitignore.example +3 -1
- package/templates/root-consumer/AI.md.example +139 -0
- package/templates/root-consumer/CLAUDE.md.example +13 -104
- package/templates/root-consumer/README.md.example +81 -255
- package/templates/root-consumer/entities/Contact.ts.example +126 -0
- package/templates/root-consumer/entities/index.ts.example +6 -3
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +41 -342
- package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +2 -1
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +144 -9
- package/templates/root-consumer/guides/dndev/INDEX.md.example +9 -0
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +13 -16
- package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +263 -0
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +1 -1
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +168 -0
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +5 -12
- package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +184 -0
- package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +134 -69
- package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +66 -44
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +18 -1
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +1 -0
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +2 -1
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +2 -1
- package/templates/root-consumer/guides/wai-way/blueprints/4_configure.md.example +180 -108
- package/templates/root-consumer/guides/wai-way/context_map.json.example +8 -7
- package/templates/root-consumer/guides/wai-way/page_patterns.md.example +4 -4
|
@@ -1,165 +1,237 @@
|
|
|
1
|
-
# BLUEPRINT: 4_CONFIGURE +
|
|
1
|
+
# BLUEPRINT: 4_CONFIGURE + TEST
|
|
2
2
|
|
|
3
|
-
**Goal:**
|
|
3
|
+
**Goal:** Generate test files, configure the app, verify everything works.
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**MCP:** `start_phase(4)` to begin. `complete_phase({ files: [...], lesson: "..." })` when done.
|
|
6
|
+
**Done when:** Tests pass, config complete, firestore rules generated.
|
|
6
7
|
|
|
7
|
-
**Prerequisite:** Phase 0-3 complete. App is functional.
|
|
8
|
+
**Prerequisite:** Phase 0-3 complete. App is functional with hardcoded strings.
|
|
8
9
|
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
## Step 1:
|
|
12
|
+
## Step 1: Generate Test Setup
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
Create these files:
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
### vitest.config.ts
|
|
17
|
+
```ts
|
|
18
|
+
import { defineConfig } from 'vitest/config';
|
|
19
|
+
import react from '@vitejs/plugin-react';
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
export default defineConfig({
|
|
22
|
+
plugins: [react()],
|
|
23
|
+
test: {
|
|
24
|
+
environment: 'jsdom',
|
|
25
|
+
setupFiles: ['./tests/setup.ts'],
|
|
26
|
+
globals: true,
|
|
27
|
+
include: ['tests/**/*.test.ts', 'tests/**/*.test.tsx'],
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
```
|
|
21
31
|
|
|
22
|
-
###
|
|
32
|
+
### tests/setup.ts
|
|
33
|
+
```ts
|
|
34
|
+
import '@testing-library/jest-dom';
|
|
35
|
+
```
|
|
23
36
|
|
|
24
|
-
**READ
|
|
37
|
+
**READ** `get_guide("TESTING")` for full testing patterns.
|
|
25
38
|
|
|
26
|
-
|
|
27
|
-
- [ ] Contact emails
|
|
28
|
-
- [ ] Hosting provider info
|
|
29
|
-
- [ ] Jurisdiction
|
|
39
|
+
---
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
## Step 2: Generate Entity Tests
|
|
42
|
+
|
|
43
|
+
**READ:** `entities/index.ts` — get the list of all entities.
|
|
44
|
+
**READ:** `guides/wai-way/spec_template.md` — get the permissions matrix and business rules.
|
|
32
45
|
|
|
33
|
-
|
|
34
|
-
- [ ] `VITE_FIREBASE_*` - Firebase config
|
|
35
|
-
- [ ] `VITE_DONOTDEV_LICENSE_KEY` - License key
|
|
46
|
+
For **each entity** in `entities/`, create `tests/entities/[EntityName].test.ts`:
|
|
36
47
|
|
|
37
|
-
|
|
38
|
-
- [ ]
|
|
39
|
-
- [ ]
|
|
48
|
+
- [ ] All required fields are defined
|
|
49
|
+
- [ ] Field types match spec
|
|
50
|
+
- [ ] Access rules match spec (create/read/update/delete per role)
|
|
51
|
+
- [ ] State transitions are valid (if entity has states)
|
|
52
|
+
- [ ] Default values set correctly
|
|
40
53
|
|
|
41
54
|
---
|
|
42
55
|
|
|
43
|
-
## Step
|
|
56
|
+
## Step 3: Generate Page Tests
|
|
57
|
+
|
|
58
|
+
**READ:** Every `src/pages/*Page.tsx` file.
|
|
44
59
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- [ ] etc.
|
|
51
|
-
3. Create Firestore Database
|
|
52
|
-
4. Deploy rules: `firebase deploy --only firestore:rules`
|
|
60
|
+
For **each page**, create `tests/pages/[PageName].test.tsx`:
|
|
61
|
+
|
|
62
|
+
- [ ] Page renders without error
|
|
63
|
+
- [ ] PageMeta is defined (title, auth, admin)
|
|
64
|
+
- [ ] Route protection matches spec (public pages have `auth: false`, protected have `auth: true`, admin have `admin: true`)
|
|
53
65
|
|
|
54
66
|
---
|
|
55
67
|
|
|
56
|
-
## Step
|
|
68
|
+
## Step 4: Generate Access Control Tests
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
```
|
|
70
|
+
**READ:** The spec's permissions section.
|
|
71
|
+
|
|
72
|
+
Create `tests/access/access-rules.test.ts`:
|
|
62
73
|
|
|
63
|
-
|
|
64
|
-
- [ ]
|
|
65
|
-
- [ ]
|
|
66
|
-
- [ ]
|
|
67
|
-
- [ ] Protected pages redirect to login
|
|
68
|
-
- [ ] Admin pages require admin role
|
|
69
|
-
|
|
70
|
-
### CRUD Tests
|
|
71
|
-
- [ ] Can create entities
|
|
72
|
-
- [ ] Can read/list entities
|
|
73
|
-
- [ ] Can update entities
|
|
74
|
-
- [ ] Can delete entities
|
|
75
|
-
- [ ] Data persists
|
|
76
|
-
|
|
77
|
-
### Access Control Tests
|
|
78
|
-
- [ ] Guest can only see guest-visible fields
|
|
79
|
-
- [ ] User can only edit own data (if owner access)
|
|
80
|
-
- [ ] Admin can edit all data
|
|
74
|
+
- [ ] Admin-only entities require admin access
|
|
75
|
+
- [ ] User-owned entities have owner access on update/delete
|
|
76
|
+
- [ ] Public entities allow guest read
|
|
77
|
+
- [ ] No entity allows unauthenticated write
|
|
81
78
|
|
|
82
79
|
---
|
|
83
80
|
|
|
84
|
-
## Step
|
|
81
|
+
## Step 5: Generate Firestore Rules
|
|
82
|
+
|
|
83
|
+
**READ:** All entities' access definitions.
|
|
85
84
|
|
|
86
|
-
|
|
85
|
+
Create `firestore.rules` from entity access rules:
|
|
87
86
|
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
87
|
+
- Each entity's collection maps to a Firestore match rule
|
|
88
|
+
- `create` access → `allow create` condition
|
|
89
|
+
- `read` access → `allow read` condition
|
|
90
|
+
- `update` access → `allow update` condition
|
|
91
|
+
- `delete` access → `allow delete` condition
|
|
92
|
+
- `owner` → `resource.data.userId == request.auth.uid`
|
|
93
|
+
- `admin` → `request.auth.token.admin == true`
|
|
94
|
+
- `authenticated` → `request.auth != null`
|
|
94
95
|
|
|
95
96
|
---
|
|
96
97
|
|
|
97
|
-
## Step
|
|
98
|
+
## Step 6: Update Configuration
|
|
99
|
+
|
|
100
|
+
### app.ts
|
|
101
|
+
**READ:** `src/config/app.ts`
|
|
102
|
+
- [ ] `APP_NAME` from spec
|
|
103
|
+
- [ ] `APP_SHORT_NAME` abbreviation
|
|
104
|
+
- [ ] `preset` from spec (landing/admin/moolti/docs/blog/game/plain)
|
|
105
|
+
- [ ] Footer legal links
|
|
98
106
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
### legal.ts
|
|
108
|
+
**READ:** `src/config/legal.ts`
|
|
109
|
+
- [ ] Company name and registration
|
|
110
|
+
- [ ] Contact emails
|
|
111
|
+
- [ ] Hosting provider
|
|
112
|
+
- [ ] Jurisdiction
|
|
102
113
|
|
|
103
|
-
|
|
104
|
-
- [ ]
|
|
105
|
-
- [ ]
|
|
106
|
-
- [ ]
|
|
107
|
-
- [ ] Buttons are tappable (44px min)
|
|
108
|
-
- [ ] No horizontal scroll
|
|
114
|
+
### .env
|
|
115
|
+
- [ ] `VITE_FIREBASE_*` — Firebase config values
|
|
116
|
+
- [ ] `VITE_DONOTDEV_LICENSE_KEY` — License key
|
|
117
|
+
- [ ] Optional: `VITE_STRIPE_*`, `VITE_SENTRY_DSN`
|
|
109
118
|
|
|
110
119
|
---
|
|
111
120
|
|
|
112
|
-
## Step
|
|
121
|
+
## Step 7: Generate CI/CD
|
|
122
|
+
|
|
123
|
+
Create `.github/workflows/ci.yml`:
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
name: CI/CD
|
|
127
|
+
|
|
128
|
+
on:
|
|
129
|
+
push:
|
|
130
|
+
branches: [main]
|
|
131
|
+
pull_request:
|
|
132
|
+
branches: [main]
|
|
133
|
+
|
|
134
|
+
env:
|
|
135
|
+
NODE_VERSION: '20'
|
|
136
|
+
|
|
137
|
+
jobs:
|
|
138
|
+
quality:
|
|
139
|
+
runs-on: ubuntu-latest
|
|
140
|
+
steps:
|
|
141
|
+
- uses: actions/checkout@v4
|
|
142
|
+
- uses: oven-sh/setup-bun@v2
|
|
143
|
+
- run: bun install --frozen-lockfile
|
|
144
|
+
- run: bun run type-check
|
|
145
|
+
- run: bun test
|
|
146
|
+
|
|
147
|
+
deploy:
|
|
148
|
+
needs: quality
|
|
149
|
+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
150
|
+
runs-on: ubuntu-latest
|
|
151
|
+
steps:
|
|
152
|
+
- uses: actions/checkout@v4
|
|
153
|
+
- uses: oven-sh/setup-bun@v2
|
|
154
|
+
- run: bun install --frozen-lockfile
|
|
155
|
+
- run: bun run build
|
|
156
|
+
- uses: FirebaseExtended/action-hosting-deploy@v0
|
|
157
|
+
with:
|
|
158
|
+
repoToken: ${{ secrets.GITHUB_TOKEN }}
|
|
159
|
+
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
|
|
160
|
+
channelId: live
|
|
161
|
+
```
|
|
113
162
|
|
|
114
|
-
|
|
163
|
+
Adapt based on spec:
|
|
164
|
+
- If **functions** enabled → add `firebase deploy --only functions` step
|
|
165
|
+
- If **staging** environment → add staging job with `dndev staging`
|
|
166
|
+
- If **no Firebase** (Vercel) → replace deploy job with Vercel action
|
|
167
|
+
|
|
168
|
+
---
|
|
115
169
|
|
|
116
|
-
|
|
170
|
+
## Step 8: Run Tests
|
|
117
171
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
{
|
|
121
|
-
"hero": {
|
|
122
|
-
"title": "Your App Name",
|
|
123
|
-
"subtitle": "Your tagline"
|
|
124
|
-
}
|
|
125
|
-
}
|
|
172
|
+
```bash
|
|
173
|
+
bun test
|
|
126
174
|
```
|
|
127
175
|
|
|
128
|
-
|
|
176
|
+
Fix any failures. All tests must pass.
|
|
129
177
|
|
|
130
|
-
|
|
131
|
-
const { t } = useTranslation('home');
|
|
178
|
+
---
|
|
132
179
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
180
|
+
## Step 9: Mobile Check
|
|
181
|
+
|
|
182
|
+
1. Open DevTools (F12) → device toolbar (Ctrl+Shift+M) → 375px
|
|
183
|
+
2. Check:
|
|
184
|
+
- [ ] Navigation works (mobile menu)
|
|
185
|
+
- [ ] Forms are usable
|
|
186
|
+
- [ ] Text is readable
|
|
187
|
+
- [ ] Buttons tappable (44px min)
|
|
188
|
+
- [ ] No horizontal scroll
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Step 10: i18n (Optional)
|
|
138
193
|
|
|
139
|
-
|
|
194
|
+
**Only after Steps 1-9 pass!**
|
|
140
195
|
|
|
141
|
-
|
|
196
|
+
Extract hardcoded strings to `src/locales/[namespace]_en.json`, replace with `useTranslation()`.
|
|
142
197
|
|
|
143
198
|
---
|
|
144
199
|
|
|
145
200
|
## Final Checklist
|
|
146
201
|
|
|
147
|
-
- [ ]
|
|
148
|
-
- [ ]
|
|
149
|
-
- [ ]
|
|
150
|
-
- [ ]
|
|
151
|
-
- [ ]
|
|
152
|
-
- [ ]
|
|
153
|
-
- [ ]
|
|
154
|
-
- [ ]
|
|
202
|
+
- [ ] `vitest.config.ts` created
|
|
203
|
+
- [ ] Entity tests generated (one per entity)
|
|
204
|
+
- [ ] Page tests generated (one per page)
|
|
205
|
+
- [ ] Access control tests generated
|
|
206
|
+
- [ ] `firestore.rules` generated from entities
|
|
207
|
+
- [ ] `.github/workflows/ci.yml` generated
|
|
208
|
+
- [ ] `app.ts` configured
|
|
209
|
+
- [ ] `legal.ts` configured
|
|
210
|
+
- [ ] `.env` configured
|
|
211
|
+
- [ ] `bun test` passes
|
|
212
|
+
- [ ] Mobile responsive at 375px
|
|
155
213
|
- [ ] (Optional) i18n added
|
|
156
214
|
|
|
157
215
|
---
|
|
158
216
|
|
|
159
217
|
## Output
|
|
160
218
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
219
|
+
Call `complete_phase` with ALL generated test files + config files:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
complete_phase({
|
|
223
|
+
files: [
|
|
224
|
+
"vitest.config.ts",
|
|
225
|
+
"tests/setup.ts",
|
|
226
|
+
"tests/entities/Task.test.ts",
|
|
227
|
+
"tests/entities/User.test.ts",
|
|
228
|
+
"tests/pages/DashboardPage.test.tsx",
|
|
229
|
+
"tests/access/access-rules.test.ts",
|
|
230
|
+
"firestore.rules",
|
|
231
|
+
".github/workflows/ci.yml",
|
|
232
|
+
"src/config/app.ts",
|
|
233
|
+
"src/config/legal.ts"
|
|
234
|
+
],
|
|
235
|
+
lesson: "..."
|
|
236
|
+
})
|
|
237
|
+
```
|
|
@@ -49,17 +49,18 @@
|
|
|
49
49
|
],
|
|
50
50
|
"output": "All pages functional with hardcoded content"
|
|
51
51
|
},
|
|
52
|
-
"
|
|
52
|
+
"4_configure_test": {
|
|
53
53
|
"agent": "polisher",
|
|
54
|
-
"goal": "
|
|
55
|
-
"done_when": "
|
|
54
|
+
"goal": "Generate tests from spec, firestore rules from entities, finalize config",
|
|
55
|
+
"done_when": "Tests pass, firestore.rules generated, config complete, mobile responsive",
|
|
56
56
|
"read_files": [
|
|
57
|
+
"guides/wai-way/spec_template.md",
|
|
58
|
+
"entities/index.ts",
|
|
57
59
|
"src/config/app.ts",
|
|
58
60
|
"src/config/legal.ts",
|
|
59
|
-
"
|
|
60
|
-
".env"
|
|
61
|
+
"guides/dndev/SETUP_TESTING.md"
|
|
61
62
|
],
|
|
62
|
-
"output": "
|
|
63
|
+
"output": "Test files, firestore.rules, configured app"
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
66
|
"key_files": {
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
}
|
|
90
91
|
},
|
|
91
92
|
"workflow": {
|
|
92
|
-
"summary": "BRAINSTORM →
|
|
93
|
+
"summary": "BRAINSTORM (→ spec) → SCAFFOLD → ENTITIES → COMPOSE → CONFIGURE + TEST",
|
|
93
94
|
"critical_rule": "Spec is OUTPUT of brainstorming. User validates before coding. Validated spec = mechanical build."
|
|
94
95
|
}
|
|
95
96
|
}
|
|
@@ -291,7 +291,7 @@ export default function HomePage() {
|
|
|
291
291
|
</Section>
|
|
292
292
|
|
|
293
293
|
<Section title="How It Works">
|
|
294
|
-
<Grid cols={[1, 1, 3, 3]}
|
|
294
|
+
<Grid cols={[1, 1, 3, 3]}>
|
|
295
295
|
<Card title="1. Sign Up" content="Create your account in seconds." />
|
|
296
296
|
<Card title="2. Configure" content="Set up your preferences." />
|
|
297
297
|
<Card title="3. Launch" content="Start using immediately." />
|
|
@@ -415,7 +415,7 @@ export default function SettingsPage() {
|
|
|
415
415
|
|
|
416
416
|
<Section title="Notifications">
|
|
417
417
|
<Card>
|
|
418
|
-
<Stack direction="column"
|
|
418
|
+
<Stack direction="column">
|
|
419
419
|
<Stack direction="row" justify="between" align="center">
|
|
420
420
|
<Text>Email notifications</Text>
|
|
421
421
|
<Switch defaultChecked />
|
|
@@ -485,7 +485,7 @@ export default function ProfilePage() {
|
|
|
485
485
|
|
|
486
486
|
<Section title="Account Details">
|
|
487
487
|
<Card>
|
|
488
|
-
<Stack direction="column"
|
|
488
|
+
<Stack direction="column">
|
|
489
489
|
<Stack direction="row" justify="between">
|
|
490
490
|
<Text variant="muted">Email</Text>
|
|
491
491
|
<Text>{user?.email}</Text>
|
|
@@ -559,7 +559,7 @@ export default function ProductDetailPage() {
|
|
|
559
559
|
</Card>
|
|
560
560
|
|
|
561
561
|
{/* Details */}
|
|
562
|
-
<Stack direction="column"
|
|
562
|
+
<Stack direction="column">
|
|
563
563
|
<Text level="h1">{product.name}</Text>
|
|
564
564
|
<Badge>{product.category}</Badge>
|
|
565
565
|
<Text level="h2">${product.price}</Text>
|