@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.
Files changed (87) hide show
  1. package/dependencies-matrix.json +38 -26
  2. package/dist/bin/commands/bump.js +9 -2
  3. package/dist/bin/commands/create-app.js +185 -81
  4. package/dist/bin/commands/create-project.js +186 -85
  5. package/dist/bin/commands/deploy.js +51 -20
  6. package/dist/bin/commands/doctor.js +249 -56
  7. package/dist/bin/commands/emu.js +18 -20
  8. package/dist/bin/commands/make-admin.js +30 -10
  9. package/dist/bin/commands/setup.js +512 -122
  10. package/dist/bin/commands/type-check.d.ts.map +1 -1
  11. package/dist/bin/commands/type-check.js +7 -3
  12. package/dist/bin/commands/type-check.js.map +1 -1
  13. package/dist/bin/dndev.js +9 -6
  14. package/dist/bin/donotdev.js +35 -20
  15. package/dist/index.js +262 -129
  16. package/package.json +1 -1
  17. package/templates/root-consumer/.claude/commands/brainstorm.md.example +15 -1
  18. package/templates/root-consumer/.claude/commands/build.md.example +24 -2
  19. package/templates/root-consumer/.claude/commands/design.md.example +17 -0
  20. package/templates/root-consumer/.claude/commands/polish.md.example +17 -0
  21. package/templates/root-consumer/AI.md.example +50 -18
  22. package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +6 -6
  23. package/templates/root-consumer/guides/dndev/INDEX.md.example +2 -2
  24. package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +13 -6
  25. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +149 -1086
  26. package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +68 -16
  27. package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +6 -111
  28. package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +64 -0
  29. package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +123 -32
  30. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +108 -91
  31. package/templates/root-consumer/guides/dndev/advanced/EMULATORS.md.example +2 -2
  32. package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +1 -1
  33. package/dist/bin/commands/firebase-setup.d.ts +0 -6
  34. package/dist/bin/commands/firebase-setup.d.ts.map +0 -1
  35. package/dist/bin/commands/firebase-setup.js +0 -7
  36. package/dist/bin/commands/firebase-setup.js.map +0 -1
  37. package/dist/bin/commands/supabase-setup.d.ts +0 -6
  38. package/dist/bin/commands/supabase-setup.d.ts.map +0 -1
  39. package/dist/bin/commands/supabase-setup.js +0 -7
  40. package/dist/bin/commands/supabase-setup.js.map +0 -1
  41. package/templates/functions-firebase/functions-firebase/README.md.example +0 -123
  42. package/templates/functions-firebase/functions-firebase/build.mjs.example +0 -5
  43. package/templates/functions-firebase/functions-firebase/src/auth/getCustomClaims.ts.example +0 -19
  44. package/templates/functions-firebase/functions-firebase/src/auth/getUserAuthStatus.ts.example +0 -21
  45. package/templates/functions-firebase/functions-firebase/src/auth/index.ts.example +0 -11
  46. package/templates/functions-firebase/functions-firebase/src/auth/removeCustomClaims.ts.example +0 -21
  47. package/templates/functions-firebase/functions-firebase/src/auth/setCustomClaims.ts.example +0 -21
  48. package/templates/functions-firebase/functions-firebase/src/billing/handleStripeWebhook.ts.example +0 -24
  49. package/templates/functions-firebase/functions-firebase/src/billing/index.ts.example +0 -10
  50. package/templates/functions-firebase/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
  51. package/templates/functions-firebase/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +0 -14
  52. package/templates/functions-firebase/functions-firebase/src/index.ts.example +0 -39
  53. package/templates/functions-firebase/functions-firebase/src/oauth/checkGitHubAccess.ts.example +0 -14
  54. package/templates/functions-firebase/functions-firebase/src/oauth/disconnect.ts.example +0 -14
  55. package/templates/functions-firebase/functions-firebase/src/oauth/exchangeToken.ts.example +0 -14
  56. package/templates/functions-firebase/functions-firebase/src/oauth/getConnections.ts.example +0 -14
  57. package/templates/functions-firebase/functions-firebase/src/oauth/grantGitHubAccess.ts.example +0 -14
  58. package/templates/functions-firebase/functions-firebase/src/oauth/index.ts.example +0 -17
  59. package/templates/functions-firebase/functions-firebase/src/oauth/refreshToken.ts.example +0 -14
  60. package/templates/functions-firebase/functions-firebase/src/oauth/revokeGitHubAccess.ts.example +0 -14
  61. package/templates/functions-firebase/functions-firebase/tsconfig.json.example +0 -21
  62. package/templates/functions-vercel/functions-vercel/README.md.example +0 -116
  63. package/templates/functions-vercel/functions-vercel/build.mjs.example +0 -52
  64. package/templates/functions-vercel/functions-vercel/src/api/auth/getCustomClaims.ts.example +0 -20
  65. package/templates/functions-vercel/functions-vercel/src/api/auth/getUserAuthStatus.ts.example +0 -20
  66. package/templates/functions-vercel/functions-vercel/src/api/auth/removeCustomClaims.ts.example +0 -20
  67. package/templates/functions-vercel/functions-vercel/src/api/auth/setCustomClaims.ts.example +0 -20
  68. package/templates/functions-vercel/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +0 -20
  69. package/templates/functions-vercel/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
  70. package/templates/functions-vercel/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +0 -20
  71. package/templates/functions-vercel/functions-vercel/src/api/crud/createEntity.ts.example +0 -20
  72. package/templates/functions-vercel/functions-vercel/src/api/crud/deleteEntity.ts.example +0 -20
  73. package/templates/functions-vercel/functions-vercel/src/api/crud/getEntity.ts.example +0 -20
  74. package/templates/functions-vercel/functions-vercel/src/api/crud/listEntities.ts.example +0 -20
  75. package/templates/functions-vercel/functions-vercel/src/api/crud/updateEntity.ts.example +0 -20
  76. package/templates/functions-vercel/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +0 -20
  77. package/templates/functions-vercel/functions-vercel/src/api/oauth/disconnect.ts.example +0 -20
  78. package/templates/functions-vercel/functions-vercel/src/api/oauth/exchangeToken.ts.example +0 -20
  79. package/templates/functions-vercel/functions-vercel/src/api/oauth/getConnections.ts.example +0 -20
  80. package/templates/functions-vercel/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +0 -20
  81. package/templates/functions-vercel/functions-vercel/src/api/oauth/refreshToken.ts.example +0 -20
  82. package/templates/functions-vercel/functions-vercel/src/api/oauth/revokeGitHubAccess.ts.example +0 -20
  83. package/templates/functions-vercel/functions-vercel/tsconfig.json.example +0 -21
  84. package/templates/functions-vercel/functions-vercel/vercel.json.example +0 -14
  85. package/templates/github/github/workflows/firebase-deploy.yml.example +0 -79
  86. /package/templates/functions-firebase/{functions-firebase/.env.example.example → .env.example} +0 -0
  87. /package/templates/functions-vercel/{functions-vercel/.env.example.example → .env.example} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donotdev/cli",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "Command-line interface for DoNotDev Framework",
5
5
  "type": "module",
6
6
  "private": false,
@@ -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. Validate each phase before proceeding
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
- ## The 5 Phases
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() → phase done, move to next
38
+ approve_phase() → user approves, move to next phase
31
39
  ```
32
40
 
33
- ## Component Usage Non-Negotiable
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
- **Never guess component props.** Call `lookup_symbol({ symbol: "ComponentName" })` before writing ANY `@donotdev` component. Every call is tracked `complete_phase` flags components used without lookup.
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
- Without MCP: read `.d.ts` files directly from `node_modules/@donotdev/*/dist/`.
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 emu start` | Start Firebase emulators |
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 `dn soc2`. See `get_guide("SOC2")` for details.
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 -> install dependencies
13
- bun dev -> start app, read the homepage setup guide
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
- bun dev
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, `dn generate sql`). See [Secrets Philosophy](#secrets-philosophy) for how we handle secret keys.
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
- | `bun dev` | Start dev server |
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 && bun dev`. The homepage tells you everything else.**
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`, `dn generate sql`)
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) - Firebase Functions (pre-configured)
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 (Firebase Auth)
1
+ # Setup: Authentication
2
2
 
3
- **Most is pre-configured.** Firebase Auth for user sign-in/sign-up. Add env vars and config. Framework handles providers, callbacks, sessions.
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 Console:** Enable providers in Authentication > Sign-in method
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:** Set Firebase Auth customClaims:
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 (customClaims are in the ID token).
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