@donotdev/cli 0.0.16 → 0.0.18
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 +38 -26
- package/dist/bin/commands/bump.js +9 -2
- package/dist/bin/commands/create-app.js +185 -81
- package/dist/bin/commands/create-project.js +186 -85
- package/dist/bin/commands/deploy.js +51 -20
- package/dist/bin/commands/doctor.js +249 -56
- package/dist/bin/commands/emu.js +18 -20
- package/dist/bin/commands/make-admin.js +30 -10
- package/dist/bin/commands/setup.js +512 -122
- package/dist/bin/commands/type-check.d.ts.map +1 -1
- package/dist/bin/commands/type-check.js +7 -3
- package/dist/bin/commands/type-check.js.map +1 -1
- package/dist/bin/dndev.js +9 -6
- package/dist/bin/donotdev.js +35 -20
- package/dist/index.js +262 -129
- package/package.json +1 -1
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +15 -1
- package/templates/root-consumer/.claude/commands/build.md.example +24 -2
- package/templates/root-consumer/.claude/commands/design.md.example +17 -0
- package/templates/root-consumer/.claude/commands/polish.md.example +17 -0
- package/templates/root-consumer/AI.md.example +50 -18
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +6 -6
- package/templates/root-consumer/guides/dndev/INDEX.md.example +2 -2
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +13 -6
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +149 -1086
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +68 -16
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +6 -111
- package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +64 -0
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +123 -32
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +108 -91
- package/templates/root-consumer/guides/dndev/advanced/EMULATORS.md.example +2 -2
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +1 -1
- package/dist/bin/commands/firebase-setup.d.ts +0 -6
- package/dist/bin/commands/firebase-setup.d.ts.map +0 -1
- package/dist/bin/commands/firebase-setup.js +0 -7
- package/dist/bin/commands/firebase-setup.js.map +0 -1
- package/dist/bin/commands/supabase-setup.d.ts +0 -6
- package/dist/bin/commands/supabase-setup.d.ts.map +0 -1
- package/dist/bin/commands/supabase-setup.js +0 -7
- package/dist/bin/commands/supabase-setup.js.map +0 -1
- package/templates/functions-firebase/functions-firebase/README.md.example +0 -123
- package/templates/functions-firebase/functions-firebase/build.mjs.example +0 -5
- package/templates/functions-firebase/functions-firebase/src/auth/getCustomClaims.ts.example +0 -19
- package/templates/functions-firebase/functions-firebase/src/auth/getUserAuthStatus.ts.example +0 -21
- package/templates/functions-firebase/functions-firebase/src/auth/index.ts.example +0 -11
- package/templates/functions-firebase/functions-firebase/src/auth/removeCustomClaims.ts.example +0 -21
- package/templates/functions-firebase/functions-firebase/src/auth/setCustomClaims.ts.example +0 -21
- package/templates/functions-firebase/functions-firebase/src/billing/handleStripeWebhook.ts.example +0 -24
- package/templates/functions-firebase/functions-firebase/src/billing/index.ts.example +0 -10
- package/templates/functions-firebase/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/index.ts.example +0 -39
- package/templates/functions-firebase/functions-firebase/src/oauth/checkGitHubAccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/disconnect.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/exchangeToken.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/getConnections.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/grantGitHubAccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/index.ts.example +0 -17
- package/templates/functions-firebase/functions-firebase/src/oauth/refreshToken.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/revokeGitHubAccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/tsconfig.json.example +0 -21
- package/templates/functions-vercel/functions-vercel/README.md.example +0 -116
- package/templates/functions-vercel/functions-vercel/build.mjs.example +0 -52
- package/templates/functions-vercel/functions-vercel/src/api/auth/getCustomClaims.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/auth/getUserAuthStatus.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/auth/removeCustomClaims.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/auth/setCustomClaims.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/createEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/deleteEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/getEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/listEntities.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/updateEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/disconnect.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/exchangeToken.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/getConnections.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/refreshToken.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/revokeGitHubAccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/tsconfig.json.example +0 -21
- package/templates/functions-vercel/functions-vercel/vercel.json.example +0 -14
- package/templates/github/github/workflows/firebase-deploy.yml.example +0 -79
- /package/templates/functions-firebase/{functions-firebase/.env.example.example → .env.example} +0 -0
- /package/templates/functions-vercel/{functions-vercel/.env.example.example → .env.example} +0 -0
package/package.json
CHANGED
|
@@ -41,6 +41,14 @@ description: Extract requirements and generate complete HLD through conversation
|
|
|
41
41
|
|
|
42
42
|
## Process
|
|
43
43
|
|
|
44
|
+
### Step 0: Start Phase (MANDATORY — DO THIS FIRST)
|
|
45
|
+
|
|
46
|
+
**BEFORE asking any questions or doing any work**, call:
|
|
47
|
+
```
|
|
48
|
+
start_phase(0)
|
|
49
|
+
```
|
|
50
|
+
This activates Phase 0: BRAINSTORM and loads the blueprint, persona, context, and lessons learned from previous sessions. **Do NOT proceed without this call.**
|
|
51
|
+
|
|
44
52
|
### Step 1: Activate EXTRACTOR Agent
|
|
45
53
|
|
|
46
54
|
**Deploy:** `/agents extractor` (BMAD EXTRACTOR persona)
|
|
@@ -87,7 +95,7 @@ EXTRACTOR generates `HLD.md` with:
|
|
|
87
95
|
|
|
88
96
|
---
|
|
89
97
|
|
|
90
|
-
## Validation Gate
|
|
98
|
+
## Validation Gate & Phase Completion (MANDATORY)
|
|
91
99
|
|
|
92
100
|
**Before proceeding to `/design`:**
|
|
93
101
|
- [ ] HLD is complete (no empty sections or TBDs)
|
|
@@ -97,6 +105,12 @@ EXTRACTOR generates `HLD.md` with:
|
|
|
97
105
|
- [ ] Native vs custom analysis complete
|
|
98
106
|
- [ ] User has validated HLD
|
|
99
107
|
|
|
108
|
+
**When HLD is complete**, write the filled-out spec to `docs/HLD.md` (the template at `guides/wai-way/spec_template.md` stays untouched as reference). Then call:
|
|
109
|
+
```
|
|
110
|
+
complete_phase({ files: ["docs/HLD.md"], summary: "HLD complete — N entities, N pages, N features" })
|
|
111
|
+
```
|
|
112
|
+
Then wait for the user to call `approve_phase()` before moving to `/design`.
|
|
113
|
+
|
|
100
114
|
**Quality Over Speed:** Take as long as needed. A complete HLD that takes 4 hours is better than an incomplete one that takes 20 minutes.
|
|
101
115
|
|
|
102
116
|
---
|
|
@@ -36,6 +36,14 @@ description: Two-agent workflow: Prompt Engineer → Coder (AFTER /design)
|
|
|
36
36
|
|
|
37
37
|
## Process
|
|
38
38
|
|
|
39
|
+
### Step 0: Start Phase (MANDATORY — DO THIS FIRST)
|
|
40
|
+
|
|
41
|
+
**BEFORE writing any code**, call:
|
|
42
|
+
```
|
|
43
|
+
start_phase(3)
|
|
44
|
+
```
|
|
45
|
+
This activates Phase 3: COMPOSE and loads the blueprint, persona, context, and lessons. **Do NOT write code without this call.**
|
|
46
|
+
|
|
39
47
|
### Step 1: Activate FORGER Agent
|
|
40
48
|
|
|
41
49
|
**Deploy:** `/agents builder` (BMAD FORGER persona)
|
|
@@ -54,10 +62,19 @@ description: Two-agent workflow: Prompt Engineer → Coder (AFTER /design)
|
|
|
54
62
|
- Phase 6: Integration (wire everything together)
|
|
55
63
|
4. Use framework defaults ONLY (no styling, no customization)
|
|
56
64
|
5. Hardcode all strings (no i18n yet)
|
|
57
|
-
6.
|
|
65
|
+
6. Run `dndev tc` after every file change — type errors must be fixed immediately
|
|
66
|
+
7. Validate each phase before proceeding
|
|
58
67
|
|
|
59
68
|
**Output:** Working app (functional MVP, no styling)
|
|
60
69
|
|
|
70
|
+
### Phase Completion (MANDATORY)
|
|
71
|
+
|
|
72
|
+
When all pages are built and `dndev tc` passes, call:
|
|
73
|
+
```
|
|
74
|
+
complete_phase({ files: ["src/pages/...all page files..."], summary: "N pages composed, all type-checking" })
|
|
75
|
+
```
|
|
76
|
+
Wait for user to call `approve_phase()` before moving to `/polish`.
|
|
77
|
+
|
|
61
78
|
---
|
|
62
79
|
|
|
63
80
|
## Alternative: Two-Agent Workflow
|
|
@@ -79,10 +96,15 @@ For complex builds, you can use:
|
|
|
79
96
|
- **Builder (FORGER):** Implements exactly what's in LLD, uses framework defaults only
|
|
80
97
|
- **Framework defaults ONLY:** No styling, no customization (deferred to /polish)
|
|
81
98
|
- **Hardcode strings:** No i18n yet (deferred to /polish)
|
|
82
|
-
- **MCP required:** Use lookup_symbol for ALL components
|
|
83
99
|
- **Phase by phase:** Complete each phase before proceeding
|
|
84
100
|
- **User:** Reviews output, proceeds to /polish when functional
|
|
85
101
|
|
|
102
|
+
## STOP — lookup_symbol Before Every Component (Repeated Here On Purpose)
|
|
103
|
+
|
|
104
|
+
**STOP before writing ANY `@donotdev` import.** Call `lookup_symbol({ symbol: "Name" })` first. Do NOT guess props, hooks, or APIs. Do NOT proceed without verification. `complete_phase` will reject un-looked-up symbols.
|
|
105
|
+
|
|
106
|
+
**Import convention:** Always `@donotdev/<package>` — never sub-paths. No `@donotdev/ui/routing`, no `@donotdev/components/card`. The only exceptions are `@donotdev/core/server`, `@donotdev/core/vite`, `@donotdev/core/next`, `@donotdev/core/functions`.
|
|
107
|
+
|
|
86
108
|
## Mode Detection
|
|
87
109
|
|
|
88
110
|
**CRITICAL:** Check working mode first.
|
|
@@ -36,6 +36,21 @@ description: Design workflow: Architect → Design Document (BEFORE /build)
|
|
|
36
36
|
|
|
37
37
|
## Process
|
|
38
38
|
|
|
39
|
+
### Step 0: Start Phase (MANDATORY — DO THIS FIRST)
|
|
40
|
+
|
|
41
|
+
**BEFORE doing any design work**, call the appropriate phase:
|
|
42
|
+
```
|
|
43
|
+
start_phase(1) # for SCAFFOLD (routes, page stubs)
|
|
44
|
+
start_phase(2) # for ENTITIES (data models, fields, access)
|
|
45
|
+
```
|
|
46
|
+
This loads the blueprint, persona, context, and lessons. **Do NOT proceed without this call.**
|
|
47
|
+
|
|
48
|
+
When design work is complete, call:
|
|
49
|
+
```
|
|
50
|
+
complete_phase({ files: ["...affected files..."], summary: "Description of what was designed" })
|
|
51
|
+
```
|
|
52
|
+
Wait for user to call `approve_phase()` before moving on.
|
|
53
|
+
|
|
39
54
|
### Step 1: Architect Phase
|
|
40
55
|
|
|
41
56
|
**Deploy:** `/agents architect` (WAI-WAY architect role)
|
|
@@ -102,6 +117,8 @@ UNRESOLVED:
|
|
|
102
117
|
- **ALWAYS reference framework architecture** - stay aligned
|
|
103
118
|
- **ALWAYS identify impacts** - what breaks if we change this?
|
|
104
119
|
- **ALWAYS prepare for /build** - design should be actionable
|
|
120
|
+
- **ALWAYS use `lookup_symbol`** when referencing @donotdev components in your design — verify the API exists before putting it in the plan
|
|
121
|
+
- **Import convention:** Always `@donotdev/<package>` top-level, never sub-paths. The only exceptions are `@donotdev/core/server`, `@donotdev/core/vite`, `@donotdev/core/next`, `@donotdev/core/functions`
|
|
105
122
|
|
|
106
123
|
## Integration with WAI-WAY & BMAD
|
|
107
124
|
|
|
@@ -42,6 +42,14 @@ description: Generate tests, firestore rules, CI/CD, config, fix bugs, i18n (Pha
|
|
|
42
42
|
|
|
43
43
|
## Process
|
|
44
44
|
|
|
45
|
+
### Step 0: Start Phase (MANDATORY — DO THIS FIRST)
|
|
46
|
+
|
|
47
|
+
**BEFORE any polish work**, call:
|
|
48
|
+
```
|
|
49
|
+
start_phase(4)
|
|
50
|
+
```
|
|
51
|
+
This activates Phase 4: CONFIGURE and loads the blueprint, persona, context, and lessons. **Do NOT proceed without this call.**
|
|
52
|
+
|
|
45
53
|
### Step 1: Activate Polisher Agent
|
|
46
54
|
|
|
47
55
|
**Deploy:** `/agents polisher` (Phase 4 Polisher persona)
|
|
@@ -112,6 +120,7 @@ Extract strings to `src/locales/`, replace with `useTranslation()`.
|
|
|
112
120
|
## Ship Readiness
|
|
113
121
|
|
|
114
122
|
App is ready to ship when:
|
|
123
|
+
- ✅ `dndev tc` passes
|
|
115
124
|
- ✅ `bun test` passes
|
|
116
125
|
- ✅ `firestore.rules` generated
|
|
117
126
|
- ✅ `.github/workflows/ci.yml` created
|
|
@@ -121,6 +130,14 @@ App is ready to ship when:
|
|
|
121
130
|
- ✅ Configuration complete
|
|
122
131
|
- ✅ (Optional) i18n added
|
|
123
132
|
|
|
133
|
+
## Phase Completion (MANDATORY)
|
|
134
|
+
|
|
135
|
+
When all ship readiness checks pass, call:
|
|
136
|
+
```
|
|
137
|
+
complete_phase({ files: ["...all test/config files..."], summary: "Tests passing, config complete, ready to ship" })
|
|
138
|
+
```
|
|
139
|
+
Wait for user to call `approve_phase()`.
|
|
140
|
+
|
|
124
141
|
---
|
|
125
142
|
|
|
126
143
|
## Next Step
|
|
@@ -2,39 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
> **You are building a DoNotDev app.** Read this file completely before doing anything else.
|
|
4
4
|
|
|
5
|
+
## Welcome
|
|
6
|
+
|
|
7
|
+
We'll build your app together in **5 structured phases**: brainstorm requirements, scaffold pages, define data, wire everything up, and polish for production. Each phase has a clear deliverable and validation gate. This isn't freeform coding — there's a proven methodology that produces solid, production-ready apps.
|
|
8
|
+
|
|
5
9
|
## What To Do Right Now
|
|
6
10
|
|
|
7
11
|
1. **Verify MCP is working.** Call `list_features()`. If it fails, run `get_guide("AGENT_START_HERE")` for IDE-specific setup.
|
|
8
12
|
2. Call `start_phase(0)` — begin **Phase 0: BRAINSTORM**
|
|
9
|
-
3. Follow each phase in order. Do not skip phases.
|
|
13
|
+
3. Follow each phase in order. **Do not skip phases. Do not work outside a phase.**
|
|
14
|
+
|
|
15
|
+
## The 5 Phases — MANDATORY
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
**ALL work MUST happen inside an active phase.** Call `start_phase(N)` BEFORE writing any code or documents. Call `complete_phase({ files })` BEFORE moving to the next phase. Working outside a phase is a violation — no exceptions.
|
|
12
18
|
|
|
13
|
-
| Phase | Name | What Happens |
|
|
14
|
-
|
|
15
|
-
| 0 | **BRAINSTORM** | Ask questions, understand requirements, produce validated spec |
|
|
16
|
-
| 1 | **SCAFFOLD** | Create all routes and page stubs from spec |
|
|
17
|
-
| 2 | **ENTITIES** | Define all data models (fields, access, visibility) |
|
|
18
|
-
| 3 | **COMPOSE** | Build pages with framework components (hardcode strings) |
|
|
19
|
-
| 4 | **CONFIGURE** | Config, test, polish, i18n. Run `/grill` and `/techdebt` before shipping |
|
|
19
|
+
| Phase | Name | Slash Command | What Happens |
|
|
20
|
+
|-------|------|---------------|-------------|
|
|
21
|
+
| 0 | **BRAINSTORM** | `/brainstorm` | Ask questions, understand requirements, produce validated spec |
|
|
22
|
+
| 1 | **SCAFFOLD** | `/design` | Create all routes and page stubs from spec |
|
|
23
|
+
| 2 | **ENTITIES** | `/design` | Define all data models (fields, access, visibility) |
|
|
24
|
+
| 3 | **COMPOSE** | `/build` | Build pages with framework components (hardcode strings) |
|
|
25
|
+
| 4 | **CONFIGURE** | `/polish` | Config, test, polish, i18n. Run `/grill` and `/techdebt` before shipping |
|
|
20
26
|
|
|
21
|
-
## Workflow Per Phase
|
|
27
|
+
## Workflow Per Phase — NON-NEGOTIABLE
|
|
22
28
|
|
|
23
29
|
```
|
|
24
30
|
start_phase(N) → get blueprint + persona + context + lessons
|
|
25
31
|
↓
|
|
26
32
|
work → follow blueprint, lookup_symbol for every component
|
|
27
33
|
↓
|
|
34
|
+
dndev tc → type-check MUST pass before completing phase
|
|
35
|
+
↓
|
|
28
36
|
complete_phase(files) → validate conventions + symbol usage → submit for review
|
|
29
37
|
↓
|
|
30
|
-
approve_phase() →
|
|
38
|
+
approve_phase() → user approves, move to next phase
|
|
31
39
|
```
|
|
32
40
|
|
|
33
|
-
|
|
41
|
+
**You MUST call `start_phase(N)` before ANY work in that phase.**
|
|
42
|
+
**You MUST call `complete_phase({ files })` when the phase is done.**
|
|
43
|
+
**You MUST run `dndev tc` after every code change and before every `complete_phase`.**
|
|
44
|
+
Skipping these steps means the work is untracked, unvalidated, and unacceptable.
|
|
45
|
+
|
|
46
|
+
## STOP — lookup_symbol Before ANY @donotdev Code
|
|
34
47
|
|
|
35
|
-
**
|
|
48
|
+
**STOP. Before writing ANY `@donotdev` import, call `lookup_symbol({ symbol: "Name" })`.** Do NOT guess. Do NOT proceed without it. `complete_phase` rejects un-looked-up symbols.
|
|
36
49
|
|
|
37
|
-
|
|
50
|
+
**Always import from `@donotdev/<package>` top-level** — never sub-paths. See `get_guide("SETUP_PAGES")` for conventions and patterns.
|
|
38
51
|
|
|
39
52
|
## CLI Commands
|
|
40
53
|
|
|
@@ -42,12 +55,30 @@ Without MCP: read `.d.ts` files directly from `node_modules/@donotdev/*/dist/`.
|
|
|
42
55
|
|
|
43
56
|
| Command | What it does |
|
|
44
57
|
|---------|-------------|
|
|
45
|
-
| `dndev create-app` | Interactive wizard — creates a new app in the monorepo |
|
|
46
58
|
| `dndev dev` | Start the dev server (Vite/Next.js via Turbo) |
|
|
47
|
-
| `dndev
|
|
59
|
+
| `dndev dev:myapp` | Start dev server for a specific app |
|
|
60
|
+
| `dndev build` | Build for production |
|
|
61
|
+
| `dndev preview` | Preview production build |
|
|
62
|
+
| `dndev emu` | Start dev with Firebase emulators |
|
|
63
|
+
| `dndev tc` | **Type-check all packages — run after every code change** |
|
|
64
|
+
| `dndev tc:myapp` | Type-check a specific app |
|
|
65
|
+
| `dndev format` | Format code with Prettier |
|
|
48
66
|
| `dndev deploy` | Deploy to production |
|
|
67
|
+
| `dndev staging` | Deploy to staging/UAT |
|
|
49
68
|
| `dndev setup firebase` | Configure Firebase project + .env |
|
|
50
69
|
| `dndev setup supabase` | Configure Supabase project + .env |
|
|
70
|
+
| `dndev doctor` | Check project health (providers, .env) |
|
|
71
|
+
| `dndev bump` | Update @donotdev packages to latest |
|
|
72
|
+
| `dndev cacheout` | Clear build caches |
|
|
73
|
+
| `dndev sync-secrets` | Sync env vars to Firebase/Vercel/GitHub |
|
|
74
|
+
| `dndev make-admin` | Set a user as admin |
|
|
75
|
+
| `dndev agent` | Configure MCP server for AI agents |
|
|
76
|
+
| `dndev wai` | Output WAI-WAY activation prompt |
|
|
77
|
+
| `dndev create-app` | Interactive wizard — creates a new app in the monorepo |
|
|
78
|
+
|
|
79
|
+
Most commands support `:<app>` syntax: `dndev dev:web`, `dndev tc:admin`, `dndev build:public`.
|
|
80
|
+
|
|
81
|
+
Run `dndev --help` for the full command list.
|
|
51
82
|
|
|
52
83
|
`dndev create-app` is **interactive** — it prompts for builder (Vite/Next.js/Expo), backend (Firebase/Supabase/none), and features. There is no `--preset` flag.
|
|
53
84
|
|
|
@@ -56,6 +87,7 @@ Without MCP: read `.d.ts` files directly from `node_modules/@donotdev/*/dist/`.
|
|
|
56
87
|
- **ESM only** — never `require()`
|
|
57
88
|
- **RTL safe** — use `start`/`end`, never `left`/`right`
|
|
58
89
|
- **Import order** — React → vendors → @donotdev → relative
|
|
90
|
+
- **Import convention** — always `@donotdev/<pkg>` top-level, never sub-paths
|
|
59
91
|
- **Framework-first** — if something's missing, say what and stop
|
|
60
92
|
- **No .md file creation** — never create documentation/analysis/summary .md files unless explicitly asked. Session notes go in `.dndev/`
|
|
61
93
|
- **Follow existing patterns** — the scaffolded files ARE your documentation
|
|
@@ -64,8 +96,8 @@ Without MCP: read `.d.ts` files directly from `node_modules/@donotdev/*/dist/`.
|
|
|
64
96
|
|
|
65
97
|
Call `get_guide("AGENT_START_HERE")` for the full tool reference, IDE setup, env var guide, and fallback instructions.
|
|
66
98
|
|
|
67
|
-
Key tools: `start_phase` · `complete_phase` · `approve_phase` · `lookup_symbol` · `get_guide` · `get_guideline` · `search_framework` · `list_features` · `record_lesson`
|
|
99
|
+
Key tools: `start_phase` · `complete_phase` · `approve_phase` · `lookup_symbol` · `get_guide` · `get_guideline` · `search_framework` · `list_features` · `record_lesson` · `run_typecheck`
|
|
68
100
|
|
|
69
101
|
## Security Gate
|
|
70
102
|
|
|
71
|
-
Before production: run `
|
|
103
|
+
Before production: run `dndev doctor` and `/grill`. See `get_guide("SOC2")` for details.
|
|
@@ -9,8 +9,8 @@ If you haven’t run `dndev init` yet, see [AGENT_START_HERE.md](./AGENT_START_H
|
|
|
9
9
|
## The Flow
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
bun install
|
|
13
|
-
|
|
12
|
+
bun install → install dependencies
|
|
13
|
+
dndev dev -> start app, read the homepage setup guide
|
|
14
14
|
dndev setup firebase -> configure Firebase project + .env
|
|
15
15
|
-- or --
|
|
16
16
|
dndev setup supabase -> configure Supabase project + .env
|
|
@@ -24,7 +24,7 @@ dndev deploy -> deploy to production
|
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
bun install
|
|
27
|
-
|
|
27
|
+
dndev dev
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
Open the app. The homepage shows every setup step with instructions.
|
|
@@ -73,7 +73,7 @@ Asks for your **public** project URL and anon key (both safe to share -- shipped
|
|
|
73
73
|
|
|
74
74
|
Get them from: https://supabase.com/dashboard -> your project -> Settings -> API
|
|
75
75
|
|
|
76
|
-
See [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) for full details (tables, RLS, `
|
|
76
|
+
See [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) for full details (tables, RLS, `dndev generate sql`). See [Secrets Philosophy](#secrets-philosophy) for how we handle secret keys.
|
|
77
77
|
|
|
78
78
|
---
|
|
79
79
|
|
|
@@ -186,7 +186,7 @@ my-project/
|
|
|
186
186
|
|
|
187
187
|
| Command | What It Does |
|
|
188
188
|
|---------|-------------|
|
|
189
|
-
| `
|
|
189
|
+
| `dndev dev` | Start dev server |
|
|
190
190
|
| `dndev emu start` | Start Firebase emulators |
|
|
191
191
|
| `dndev setup firebase` | Configure Firebase project + .env |
|
|
192
192
|
| `dndev setup supabase` | Configure Supabase project + .env |
|
|
@@ -215,4 +215,4 @@ my-project/
|
|
|
215
215
|
|
|
216
216
|
---
|
|
217
217
|
|
|
218
|
-
**Start here: `bun install &&
|
|
218
|
+
**Start here: `bun install && dndev dev`. The homepage tells you everything else.**
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
- [ENV_SETUP.md](./ENV_SETUP.md) — After `dndev init`: env, Firebase/Supabase, deploy
|
|
13
13
|
- [GOTCHAS.md](./GOTCHAS.md) - **Common mistakes & pitfalls** (phase-tagged, read before coding)
|
|
14
14
|
- [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) - Firebase project setup (`dndev setup firebase`)
|
|
15
|
-
- [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) - Supabase project setup (`dndev setup supabase`, `
|
|
15
|
+
- [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) - Supabase project setup (`dndev setup supabase`, `dndev generate sql`)
|
|
16
16
|
- [SETUP_TESTING.md](./SETUP_TESTING.md) - Test generation (Phase 4)
|
|
17
17
|
|
|
18
18
|
---
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
- [SETUP_BILLING.md](./SETUP_BILLING.md) - Stripe subscriptions (pre-configured)
|
|
37
37
|
- [SETUP_BLOG.md](./SETUP_BLOG.md) - Convention-based markdown blog with i18n
|
|
38
38
|
- [SETUP_PWA.md](./SETUP_PWA.md) - Progressive Web App setup
|
|
39
|
-
- [SETUP_FUNCTIONS.md](./SETUP_FUNCTIONS.md) -
|
|
39
|
+
- [SETUP_FUNCTIONS.md](./SETUP_FUNCTIONS.md) - Functions overview (redirects to provider guides)
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Setup: Authentication
|
|
1
|
+
# Setup: Authentication
|
|
2
2
|
|
|
3
|
-
**Most is pre-configured.** Firebase Auth
|
|
3
|
+
**Most is pre-configured.** Works with Firebase Auth or Supabase Auth. Add env vars and config. Framework handles providers, callbacks, sessions.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -24,7 +24,8 @@ export const appConfig: AppConfig = {
|
|
|
24
24
|
};
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
**Firebase
|
|
27
|
+
**Firebase:** Enable providers in Firebase Console → Authentication → Sign-in method
|
|
28
|
+
**Supabase:** Enable providers in Supabase Dashboard → Authentication → Providers
|
|
28
29
|
|
|
29
30
|
---
|
|
30
31
|
|
|
@@ -80,10 +81,10 @@ const signOut = useAuth('signOut');
|
|
|
80
81
|
|
|
81
82
|
**Default:** All authenticated users are `'user'` role.
|
|
82
83
|
|
|
83
|
-
**Setting admin/super roles:**
|
|
84
|
+
**Setting admin/super roles:**
|
|
84
85
|
|
|
86
|
+
**Firebase** — Set customClaims:
|
|
85
87
|
```typescript
|
|
86
|
-
// Using Firebase Admin SDK
|
|
87
88
|
import { getFirebaseAdminAuth } from '@donotdev/firebase/server';
|
|
88
89
|
|
|
89
90
|
const auth = getFirebaseAdminAuth();
|
|
@@ -93,12 +94,18 @@ await auth.setCustomUserClaims(userId, {
|
|
|
93
94
|
});
|
|
94
95
|
```
|
|
95
96
|
|
|
97
|
+
**Supabase** — Set user metadata:
|
|
98
|
+
```sql
|
|
99
|
+
-- In Supabase Dashboard → SQL Editor
|
|
100
|
+
UPDATE auth.users SET raw_app_meta_data = raw_app_meta_data || '{"role": "admin"}' WHERE id = '<user-id>';
|
|
101
|
+
```
|
|
102
|
+
|
|
96
103
|
**Using CLI:**
|
|
97
104
|
```bash
|
|
98
105
|
dndev make-admin <userId>
|
|
99
106
|
```
|
|
100
107
|
|
|
101
|
-
**Note:** User must sign out and sign in again for role changes to take effect
|
|
108
|
+
**Note:** User must sign out and sign in again for role changes to take effect.
|
|
102
109
|
|
|
103
110
|
**Used by:** CRUD access control, protected routes, field visibility filtering.
|
|
104
111
|
|