@donotdev/cli 0.0.12 → 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 +33 -7
- package/dist/bin/commands/create-project.js +43 -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 +7671 -39
- 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 +1 -1
- 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,367 +1,66 @@
|
|
|
1
1
|
# DoNotDev Framework - Agent Quick Start
|
|
2
2
|
|
|
3
|
-
**Persona:** Lead Developer
|
|
3
|
+
**Persona:** Lead Developer | UX Designer | Expert Adviser.
|
|
4
|
+
**Intelligence Engine:** This project is pre-configured with the **`dndev` MCP Server** in `.mcp.json`.
|
|
4
5
|
|
|
5
|
-
**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
3. Trust framework defaults
|
|
9
|
-
4. Ask user for clarification
|
|
10
|
-
|
|
11
|
-
**Never guess. Always verify.**
|
|
6
|
+
**Critical Rule:**
|
|
7
|
+
> **DO NOT GUESS. DO NOT HALLUCINATE.**
|
|
8
|
+
> Use `lookup_symbol("ComponentName")` to get actual TypeScript types. Every symbol has JSDoc and Types. Every setup has a Guide. Use them.
|
|
12
9
|
|
|
13
10
|
---
|
|
14
11
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
**Step 1: Install dependencies**
|
|
18
|
-
- Run `bun install` in project root
|
|
19
|
-
- Wait for completion - framework components will load correctly
|
|
20
|
-
- TypeScript imports will resolve properly
|
|
21
|
-
|
|
22
|
-
**Step 2: Create pages correctly**
|
|
23
|
-
- Name files ending in `Page.tsx` (e.g., `HomePage.tsx`)
|
|
24
|
-
- Place them in `src/pages/` folder
|
|
25
|
-
- Framework will auto-discover and route them
|
|
26
|
-
- Navigation will show them automatically
|
|
27
|
-
|
|
28
|
-
**Step 3: Configure app**
|
|
29
|
-
- Edit `src/config/app.ts` with your preset and app name
|
|
30
|
-
- Framework will use your configuration
|
|
31
|
-
- Footer and legal links will be included automatically
|
|
32
|
-
|
|
33
|
-
**Step 4: Customize via config files**
|
|
34
|
-
- Override defaults in `src/config/app.ts`
|
|
35
|
-
- Override themes in `src/themes.css`
|
|
36
|
-
- Framework preserves your changes on updates
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
** dndev ** is our custom CLI, dndev --help for info.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
**🧠 PHILOSOPHY & MINDSET (READ THIS):**
|
|
43
|
-
|
|
44
|
-
**CRITICAL: ALL YOU NEED TO DO IS FOLLOW OUR NAMING CONVENTIONS + FILE STRUCTURE CONVENTIONS AND FOCUS ON THE INSIDE OF YOUR PAGES, WITH OUR COMPONENTS. EVERYTHING ELSE IS HANDLED. JUST TRUST THE FRAMEWORK AND CODE AS FEW AS POSSIBLE.**
|
|
45
|
-
|
|
46
|
-
* **Speed > Polish:** Your goal is to reach UAT (User Acceptance Testing) fast. The app should look "good enough" (80%) using standard components.
|
|
47
|
-
* **Composition > Customization:** Do not waste time writing CSS to make it "perfect" pixel-wise. Drop components, use props, move on.
|
|
48
|
-
* **Standardize:** If it looks like a standard DoNotDev app, you succeeded. If you are writing custom CSS to fight the framework, you failed.
|
|
49
|
-
* **Polishing:** Deep styling is for *after* the core functionality is approved and the User asks you to polish, with their preferred method.
|
|
50
|
-
* **Trust the Framework:** Navigation, routing, layouts, auth, themes, i18n - all handled automatically. Focus on page content only.
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
**✅ STYLING STANDARDS (ALWAYS FOLLOW):**
|
|
55
|
-
|
|
56
|
-
1. **Layout Strategy:** Use `<Stack>`, `<Grid>`, and `<Section>` components to organize content. These handle spacing and alignment automatically.
|
|
57
|
-
2. **Component Props:** Leverage component-specific props and trust their defaults, only add what you really need.
|
|
58
|
-
3. **Interactions:** Prefer native component interactions. E.g., Use `<Card onClick={...}>` instead of nesting a Button inside if the whole item is actionable.
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Import Rules
|
|
63
|
-
|
|
64
|
-
**Root imports only:**
|
|
65
|
-
```tsx
|
|
66
|
-
import { Button } from '@donotdev/components';
|
|
67
|
-
import { PageContainer } from '@donotdev/ui';
|
|
68
|
-
import { useAuth } from '@donotdev/auth';
|
|
69
|
-
```
|
|
12
|
+
## First Thing to Call: list_features()
|
|
70
13
|
|
|
71
|
-
|
|
72
|
-
```tsx
|
|
73
|
-
import type { ButtonProps } from '@donotdev/components';
|
|
74
|
-
import type { PageMeta } from '@donotdev/core';
|
|
75
|
-
```
|
|
14
|
+
Call **`list_features()`** before designing or coding. It lists all framework packages with a one-line summary from each README (templates, core, ui, auth, billing, etc.). Use it so you don't reinvent what the framework already provides (blog, CRUD, billing, legal pages, etc.).
|
|
76
15
|
|
|
77
16
|
---
|
|
78
17
|
|
|
79
|
-
##
|
|
18
|
+
## The WAI-WAY Workflow (5 Phases)
|
|
80
19
|
|
|
81
|
-
|
|
20
|
+
Call `start_phase(N)` to begin each phase. It returns the blueprint, agent persona, and files to read.
|
|
82
21
|
|
|
83
|
-
|
|
84
|
-
|
|
22
|
+
### Phase 0: BRAINSTORM (Extractor)
|
|
23
|
+
- **MCP:** `start_phase(0)`
|
|
24
|
+
- **Goal:** Validated spec. Use BMAD probing questions to turn a vague idea into a complete `spec_template.md`.
|
|
25
|
+
- **Discovery:** `search_framework('topic')` to see what's possible.
|
|
85
26
|
|
|
86
|
-
###
|
|
87
|
-
|
|
88
|
-
dndev
|
|
89
|
-
# OR if adding to existing project:
|
|
90
|
-
cd existing-project
|
|
91
|
-
dndev create-app my-app-name
|
|
92
|
-
```
|
|
27
|
+
### Phase 1: SCAFFOLD (Extractor)
|
|
28
|
+
- **MCP:** `start_phase(1)`
|
|
29
|
+
- **Goal:** Running skeleton. Use `dndev create-app` and create `*Page.tsx` stubs.
|
|
93
30
|
|
|
94
|
-
###
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
**✅ CRITICAL:** Run `bun install` as the first step. This installs all framework dependencies and enables framework components to work correctly.
|
|
31
|
+
### Phase 2: ENTITIES (Architect)
|
|
32
|
+
- **MCP:** `start_phase(2)`
|
|
33
|
+
- **Goal:** Single Source of Truth. Define entities in `entities/` using `defineEntity()`.
|
|
34
|
+
- **Types:** `lookup_symbol('defineEntity')` for exact props and @examples.
|
|
100
35
|
|
|
101
|
-
###
|
|
102
|
-
**
|
|
36
|
+
### Phase 3: COMPOSE (Builder)
|
|
37
|
+
- **MCP:** `start_phase(3)`
|
|
38
|
+
- **Goal:** Functional pages. Hardcode all strings. No i18n yet.
|
|
39
|
+
- **Types:** `lookup_symbol('Button')`, `lookup_symbol('EntityList')`, etc.
|
|
103
40
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
41
|
+
### Phase 4: CONFIGURE (Polisher)
|
|
42
|
+
- **MCP:** `start_phase(4)`
|
|
43
|
+
- **Goal:** QA & Polish. Update `app.ts`, `.env`, verify mobile (375px).
|
|
44
|
+
- **Lessons:** `record_lesson('Project quirk found')`.
|
|
107
45
|
|
|
108
|
-
|
|
109
|
-
preset: 'landing', // Update: Choose your preset (landing | admin | moolti | docs | blog | game | plain)
|
|
110
|
-
app: {
|
|
111
|
-
name: 'My App', // Update: Your app name
|
|
112
|
-
url: 'https://myapp.com', // Update: Your app URL
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
**File: `src/config/legal.ts`** (scaffolded - update with your legal pages):
|
|
118
|
-
```typescript
|
|
119
|
-
export const legalConfig = {
|
|
120
|
-
// Update: Add your legal pages (privacy, terms, etc.)
|
|
121
|
-
};
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
**File: `vite.config.ts`** (scaffolded - already configured correctly):
|
|
125
|
-
```typescript
|
|
126
|
-
import { defineViteConfig } from '@donotdev/core/vite';
|
|
127
|
-
import { appConfig } from './src/config/app';
|
|
128
|
-
|
|
129
|
-
export default defineViteConfig({
|
|
130
|
-
appConfig, // Already configured - framework imports your appConfig
|
|
131
|
-
});
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
**✅ UPDATE STRATEGY:**
|
|
135
|
-
- Scaffolded files are already correctly structured
|
|
136
|
-
- Update values (app name, preset, URLs) to match your needs
|
|
137
|
-
- Keep the file structure and imports as-is
|
|
138
|
-
- Framework expects these exact file paths and exports
|
|
139
|
-
|
|
140
|
-
**✅ CORRECT FILE PATHS:**
|
|
141
|
-
- `src/config/app.ts` - Place in `src/config/` folder
|
|
142
|
-
- `src/config/legal.ts` - Place in `src/config/` folder
|
|
143
|
-
- `vite.config.ts` - Place at project root (same level as `package.json`)
|
|
144
|
-
- `src/pages/*Page.tsx` - Place in `src/pages/` folder
|
|
145
|
-
|
|
146
|
-
### Step 4: Add Logo (Optional but recommended)
|
|
147
|
-
Drop `logo.svg` in `public/` folder. Framework auto-generates favicon, icons, PWA assets.
|
|
148
|
-
|
|
149
|
-
### Step 5: Create or Update Pages
|
|
150
|
-
**Scaffolding creates `src/pages/HomePage.tsx` with a working example. UPDATE it with your content:**
|
|
151
|
-
|
|
152
|
-
```tsx
|
|
153
|
-
import { PageContainer } from '@donotdev/ui';
|
|
154
|
-
|
|
155
|
-
export default function HomePage() {
|
|
156
|
-
return <PageContainer><h1>Hello</h1></PageContainer>;
|
|
157
|
-
}
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
**✅ UPDATE STRATEGY:**
|
|
161
|
-
- Scaffolded `HomePage.tsx` is already correctly structured
|
|
162
|
-
- Update the content inside `PageContainer` with your components
|
|
163
|
-
- Keep the imports and export structure as-is
|
|
164
|
-
- Add more pages by creating new `*Page.tsx` files in `src/pages/`
|
|
165
|
-
|
|
166
|
-
### Step 6: Verify Setup (BEFORE running dev)
|
|
167
|
-
**Check these files exist:**
|
|
168
|
-
- ✅ `src/config/app.ts` exists
|
|
169
|
-
- ✅ `vite.config.ts` exists and imports `appConfig` from `src/config/app.ts`
|
|
170
|
-
- ✅ `src/pages/HomePage.tsx` exists (or at least one `*Page.tsx` file)
|
|
171
|
-
- ✅ `package.json` exists with `@donotdev/*` dependencies
|
|
172
|
-
- ✅ `bun install` completed successfully
|
|
173
|
-
|
|
174
|
-
### Step 7: Run Development Server
|
|
175
|
-
```bash
|
|
176
|
-
bun run dev
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
**Expected output:**
|
|
180
|
-
- Server starts on `http://localhost:5173` (or configured port)
|
|
181
|
-
- No "Cannot find module" errors
|
|
182
|
-
- Browser shows your app (may show watermark if no license key)
|
|
183
|
-
|
|
184
|
-
**If you see errors:**
|
|
185
|
-
1. **"Cannot find module '@donotdev/...'"** → Run `bun install` again
|
|
186
|
-
2. **"Cannot find module './src/config/app'"** → Check `vite.config.ts` path is correct
|
|
187
|
-
3. **"No routes found"** → Check you have `*Page.tsx` files in `src/pages/`
|
|
188
|
-
4. **TypeScript errors** → Run `bun run type-check` to see details
|
|
189
|
-
|
|
190
|
-
**✅ ALWAYS DO:**
|
|
191
|
-
- Run `bun install` first - required for dependencies
|
|
192
|
-
- Create pages in `src/pages/` folder - framework discovers them automatically
|
|
193
|
-
- Name files ending in `Page.tsx` - framework routes them automatically
|
|
194
|
-
- Trust framework defaults - routing, navigation, layouts are automatic
|
|
195
|
-
- Use preset components - LanguageSelector, ThemeToggle, AuthMenu are included automatically
|
|
46
|
+
Call `complete_phase()` after each phase. It records progress and tells you what's next.
|
|
196
47
|
|
|
197
48
|
---
|
|
198
49
|
|
|
199
|
-
##
|
|
200
|
-
|
|
201
|
-
**File Routing Rule: Only files ending in `Page.tsx` inside `src/pages` become routes.**
|
|
202
|
-
|
|
203
|
-
**✅ ROUTING RULES:**
|
|
204
|
-
- Name files with `Page.tsx` suffix (e.g., `HomePage.tsx`, `AboutPage.tsx`)
|
|
205
|
-
- Place files inside `src/pages/` directory (or subdirectories)
|
|
206
|
-
- Framework auto-discovers routes from `src/pages/*Page.tsx` files
|
|
207
|
-
- Framework automatically generates navigation from discovered routes
|
|
208
|
-
|
|
209
|
-
**Routing:** Drop `*Page.tsx` files in `src/pages/**` → auto-discovered. Use `PageMeta` for routes, auth, icons.
|
|
50
|
+
## Mindset & Standards
|
|
210
51
|
|
|
211
|
-
**
|
|
52
|
+
* **SSOT Pattern:** The Entity is the brain. Change fields in `entities/*.ts` first. UI and DB follow.
|
|
53
|
+
* **Composition > Customization:** Do not write custom CSS. Use `<Stack>`, `<Grid>`, and component props.
|
|
54
|
+
* **Hardcode First:** In Phase 3, never use i18n. Validate the UI with real strings first.
|
|
55
|
+
* **Zero Drift:** Your documentation is the **compiled code**. `lookup_symbol` shows the current reality.
|
|
212
56
|
|
|
213
|
-
|
|
57
|
+
## Before You Start Coding
|
|
214
58
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
**✅ Follow these to ensure success:**
|
|
220
|
-
|
|
221
|
-
1. **✅ Always name pages with `Page.tsx` suffix** - Example: `HomePage.tsx`, `AboutPage.tsx`
|
|
222
|
-
2. **✅ Always run `bun install` first** - Required before any other commands
|
|
223
|
-
3. **✅ Trust framework routing** - Framework auto-discovers routes from `src/pages/*Page.tsx`
|
|
224
|
-
4. **✅ Use preset components** - LanguageSelector, ThemeToggle, AuthMenu are included automatically
|
|
225
|
-
5. **✅ Configure via config files** - Edit `src/config/app.ts`, never modify `node_modules`
|
|
226
|
-
6. **✅ Create pages in `src/pages/` folder** - Framework discovers them automatically
|
|
227
|
-
7. **✅ Configure `src/config/app.ts`** - Set your preset and app name
|
|
228
|
-
8. **✅ Run `bun install` before `bun run dev`** - Dependencies must be installed first
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
## 🤖 WAI-WAY: The "With AI Way" Protocol (BMAD-Based)
|
|
233
|
-
|
|
234
|
-
**WAI-WAY** is a rigorous, agent-driven protocol based on the **BMAD Method**. It separates concerns into 4 distinct phases.
|
|
235
|
-
|
|
236
|
-
**Entry Point:** Use commands in `.claude/commands/` (synced via `dndev bump`)
|
|
237
|
-
|
|
238
|
-
**The 4 Phases:**
|
|
239
|
-
1. **`/brainstorm`** → BMAD EXTRACTOR extracts requirements, generates HLD
|
|
240
|
-
2. **`/design`** → BMAD PRINTER (Architect) creates technical plan (LLD)
|
|
241
|
-
3. **`/build`** → BMAD FORGER (Builder) implements code using framework defaults
|
|
242
|
-
4. **`/polish`** → BMAD FINISHER (Polisher) adds styling, customization, i18n
|
|
243
|
-
|
|
244
|
-
**How It Works:**
|
|
245
|
-
- Commands are in `.claude/commands/` (synced from framework)
|
|
246
|
-
- Agents are in `.claude/agents/` (BMAD personas, synced from framework)
|
|
247
|
-
- Run commands in Cursor: `/brainstorm [app idea]`, `/design [HLD]`, `/build [LLD]`, `/polish [app]`
|
|
248
|
-
- Documentation syncs automatically via `dndev bump`
|
|
249
|
-
|
|
250
|
-
**Why use it?**
|
|
251
|
-
WAI-WAY forces your AI to "Think before it Codes". By separating Architecture from Build, we ensure **only valid DoNotDev primitives are used**, preventing custom CSS bloat and "hallucinated" patterns.
|
|
252
|
-
|
|
253
|
-
**See:** `.claude/commands/` for command details | `guides/wai-way/WAI_WAY_CLI.md` for methodology
|
|
254
|
-
|
|
255
|
-
---
|
|
256
|
-
|
|
257
|
-
## Landing Page Example
|
|
258
|
-
|
|
259
|
-
```tsx
|
|
260
|
-
import { PageContainer } from '@donotdev/ui';
|
|
261
|
-
import { HeroSection, Section, Card, CallToAction, Button, Grid, Stack } from '@donotdev/components';
|
|
262
|
-
|
|
263
|
-
export default function HomePage() {
|
|
264
|
-
return (
|
|
265
|
-
<PageContainer>
|
|
266
|
-
<HeroSection
|
|
267
|
-
title="Welcome"
|
|
268
|
-
subtitle="Build fast with DoNotDev"
|
|
269
|
-
variant="primary"
|
|
270
|
-
/>
|
|
271
|
-
|
|
272
|
-
<Section title="Features" gridCols={3}>
|
|
273
|
-
<Card title="Fast" content="Lightning fast development" />
|
|
274
|
-
<Card title="Simple" content="Zero configuration needed" />
|
|
275
|
-
<Card title="Powerful" content="Enterprise-grade features" />
|
|
276
|
-
</Section>
|
|
277
|
-
|
|
278
|
-
<Section title="Layout Examples">
|
|
279
|
-
<Grid cols={[1, 1, 2, 2]} gap="medium">
|
|
280
|
-
<Card title="Left Column" />
|
|
281
|
-
<Card title="Right Column" />
|
|
282
|
-
</Grid>
|
|
283
|
-
|
|
284
|
-
<Stack direction="row" gap="medium">
|
|
285
|
-
<Button variant="primary">Primary</Button>
|
|
286
|
-
<Button variant="outline">Secondary</Button>
|
|
287
|
-
</Stack>
|
|
288
|
-
</Section>
|
|
289
|
-
|
|
290
|
-
<CallToAction
|
|
291
|
-
title="Get Started"
|
|
292
|
-
subtitle="Ready to build?"
|
|
293
|
-
primaryAction={<Button variant="primary">Sign Up</Button>}
|
|
294
|
-
secondaryAction={<Button variant="outline">Learn More</Button>}
|
|
295
|
-
/>
|
|
296
|
-
</PageContainer>
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
---
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
## Required File Structure
|
|
306
|
-
|
|
307
|
-
**CRITICAL:** Your project MUST have this exact structure:
|
|
308
|
-
|
|
309
|
-
```
|
|
310
|
-
my-project/
|
|
311
|
-
├── package.json # At root - contains dependencies
|
|
312
|
-
├── vite.config.ts # At root - imports appConfig
|
|
313
|
-
├── src/
|
|
314
|
-
│ ├── config/
|
|
315
|
-
│ │ ├── app.ts # REQUIRED - app configuration
|
|
316
|
-
│ │ └── legal.ts # REQUIRED - legal pages config
|
|
317
|
-
│ ├── pages/
|
|
318
|
-
│ │ └── HomePage.tsx # Your pages (must end in Page.tsx)
|
|
319
|
-
│ ├── App.tsx # App entry point
|
|
320
|
-
│ └── main.tsx # Vite entry point
|
|
321
|
-
└── public/
|
|
322
|
-
└── logo.svg # Optional - framework generates assets
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
**✅ CORRECT FILE PATHS EXAMPLES:**
|
|
326
|
-
- ✅ `src/config/app.ts` (correct location)
|
|
327
|
-
- ✅ `src/pages/HomePage.tsx` (correct location)
|
|
328
|
-
- ✅ `src/pages/AboutPage.tsx` (correct - in pages subfolder)
|
|
329
|
-
- ✅ `src/pages/blog/BlogPostPage.tsx` (correct - nested pages work)
|
|
330
|
-
|
|
331
|
-
---
|
|
332
|
-
|
|
333
|
-
## Troubleshooting
|
|
334
|
-
|
|
335
|
-
### "Cannot find module '@donotdev/...'"
|
|
336
|
-
**Solution:** Run `bun install` in the project root. Dependencies must be installed before running the app.
|
|
337
|
-
|
|
338
|
-
### "No routes found"
|
|
339
|
-
**Solution:**
|
|
340
|
-
1. Check files are in `src/pages/` folder
|
|
341
|
-
2. Check files end in `Page.tsx` (not `.tsx` or `.ts`)
|
|
342
|
-
3. Check files are exported as default: `export default function HomePage()`
|
|
343
|
-
|
|
344
|
-
### "Cannot find module './src/config/app'"
|
|
345
|
-
**Solution:**
|
|
346
|
-
1. Check `vite.config.ts` is at project root (same level as `package.json`)
|
|
347
|
-
2. Check `src/config/app.ts` exists
|
|
348
|
-
3. Check import path in `vite.config.ts`: `import { appConfig } from './src/config/app';`
|
|
349
|
-
|
|
350
|
-
### App shows blank page
|
|
351
|
-
**Solution:**
|
|
352
|
-
1. Check browser console for errors
|
|
353
|
-
2. Verify at least one `*Page.tsx` file exists in `src/pages/`
|
|
354
|
-
3. Verify `vite.config.ts` imports `appConfig` correctly
|
|
355
|
-
4. Check `src/App.tsx` uses `ViteAppProviders` with `config={appConfig}`
|
|
356
|
-
|
|
357
|
-
### TypeScript errors
|
|
358
|
-
**Solution:**
|
|
359
|
-
1. Run `bun run type-check` to see all errors
|
|
360
|
-
2. Ensure all `@donotdev/*` packages are installed
|
|
361
|
-
3. Check imports use root package names: `@donotdev/components`, not deep paths
|
|
362
|
-
|
|
363
|
-
---
|
|
59
|
+
Check that the user has completed environment setup:
|
|
60
|
+
1. Firebase configured? (`.env` has `VITE_FIREBASE_API_KEY` filled in)
|
|
61
|
+
2. Service account key exists? (`service-account-key.json` in app root)
|
|
62
|
+
3. Emulators work? (`dndev emu start` runs without errors)
|
|
364
63
|
|
|
365
|
-
|
|
64
|
+
If not, coach them: "Run `dndev firebase:setup` first, then follow the prompts." See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md).
|
|
366
65
|
|
|
367
|
-
**
|
|
66
|
+
**Starting:** Call `list_features()` first, then `get_phase_status()` to see where you are, then `start_phase(0)` to begin.
|
|
@@ -133,7 +133,7 @@ import { Reveal } from '@donotdev/adv-comps';
|
|
|
133
133
|
|
|
134
134
|
### InspectorGadget
|
|
135
135
|
|
|
136
|
-
Floating code inspector component. Displays a floating
|
|
136
|
+
Floating code inspector component. Displays a floating button with Code icon and label that opens a dialog showing the page's source code.
|
|
137
137
|
|
|
138
138
|
```tsx
|
|
139
139
|
import { InspectorGadget } from '@donotdev/adv-comps';
|
|
@@ -164,6 +164,7 @@ import type { BreathingExerciseDnDevLayoutProps } from '@donotdev/adv-comps';
|
|
|
164
164
|
onSkip?: () => void
|
|
165
165
|
statusValue?: string
|
|
166
166
|
onRestart?: () => void
|
|
167
|
+
onResume?: () => void
|
|
167
168
|
isPaused?: boolean
|
|
168
169
|
isComplete?: boolean
|
|
169
170
|
/>
|
|
@@ -1,14 +1,149 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Getting Started
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**The complete onboarding flow — from `dndev init` to deployed app.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
2. **Create app:** `dndev create-app` - choose Vite (SPA) or Next.js (SSR), with optional backend
|
|
9
|
-
3. **Build:** Use auto-routing, auth, and translations
|
|
7
|
+
## The Flow
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
```
|
|
10
|
+
bun install → install dependencies
|
|
11
|
+
bun dev → start app, read the homepage setup guide
|
|
12
|
+
dndev firebase:setup → configure Firebase project + .env
|
|
13
|
+
dndev emu start → test locally with emulators
|
|
14
|
+
dndev deploy → deploy to production
|
|
15
|
+
```
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Step 1: Install & Run
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
bun install
|
|
23
|
+
bun dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Open the app. The homepage shows every setup step with instructions.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Step 2: Git
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git init
|
|
34
|
+
git add . && git commit -m "Initial scaffold"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Create a repo on GitHub, then:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git remote add origin <your-repo-url>
|
|
41
|
+
git push -u origin main
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Step 3: Firebase
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
dndev firebase:setup
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Automates: project selection/creation, web app, SDK config → `.env`, `.firebaserc`.
|
|
53
|
+
|
|
54
|
+
Then 2 manual steps (CLI gives you direct links):
|
|
55
|
+
1. Download service account key → save as `service-account-key.json`
|
|
56
|
+
2. Enable Auth + Firestore in Firebase Console
|
|
57
|
+
|
|
58
|
+
See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) for full details.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Step 4: Test Locally
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
dndev emu start
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Select Auth + Firestore + Functions. Develops against local emulators.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Step 5: Build With AI
|
|
73
|
+
|
|
74
|
+
Open the project in **Cursor**, **Claude Code**, **Windsurf**, or **AntiGravity**.
|
|
75
|
+
|
|
76
|
+
The AI reads `AI.md` and follows the WAI-WAY protocol:
|
|
77
|
+
- Phase 0: Brainstorm → produce a spec
|
|
78
|
+
- Phase 1: Scaffold → create pages
|
|
79
|
+
- Phase 2: Entities → define data models
|
|
80
|
+
- Phase 3: Compose → build pages with components
|
|
81
|
+
- Phase 4: Configure → generate tests, firestore rules, CI/CD
|
|
82
|
+
|
|
83
|
+
Read `guides/wai-way/WAI_WAY_CLI.md` for the full workflow.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Step 6: Deploy
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
dndev deploy
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Deploys hosting + functions + rules. Cloud Run IAM handled automatically.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Environment Variables
|
|
98
|
+
|
|
99
|
+
**Each app has its own `.env`.** Vite loads from the app directory only.
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
my-project/
|
|
103
|
+
├── .env.example ← NOT loaded by Vite (reference only)
|
|
104
|
+
├── apps/
|
|
105
|
+
│ └── my-app/
|
|
106
|
+
│ ├── .env ← Vite reads THIS
|
|
107
|
+
│ ├── .env.local ← Overrides .env (gitignored)
|
|
108
|
+
│ ├── .env.staging ← Used by dndev staging
|
|
109
|
+
│ └── .env.production ← Production overrides
|
|
110
|
+
└── functions/
|
|
111
|
+
└── .env ← Server secrets (Stripe, OAuth)
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Rule:** `VITE_*` vars go in `apps/<app>/.env`. Server secrets go in `functions/.env`.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## CLI Commands
|
|
119
|
+
|
|
120
|
+
| Command | What It Does |
|
|
121
|
+
|---------|-------------|
|
|
122
|
+
| `bun dev` | Start dev server |
|
|
123
|
+
| `dndev emu start` | Start Firebase emulators |
|
|
124
|
+
| `dndev firebase:setup` | Configure Firebase project + .env |
|
|
125
|
+
| `dndev deploy` | Deploy to Firebase (hosting + functions + rules) |
|
|
126
|
+
| `dndev staging` | Deploy to staging environment |
|
|
127
|
+
| `dndev sync-secrets` | Push functions/.env to Firebase Secret Manager |
|
|
128
|
+
| `bun test` | Run tests (after Phase 4) |
|
|
129
|
+
| `bun run type-check` | TypeScript validation |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## What's Optional
|
|
134
|
+
|
|
135
|
+
| Feature | Required? | When to Set Up |
|
|
136
|
+
|---------|-----------|---------------|
|
|
137
|
+
| Git + GitHub | Recommended | Before starting development |
|
|
138
|
+
| Firebase (Auth + Firestore) | Yes | Before building any features |
|
|
139
|
+
| Cloud Functions | If using backend | Before deploying functions |
|
|
140
|
+
| Stripe | If using billing | When adding payment features |
|
|
141
|
+
| GitHub Actions CI/CD | Optional | Phase 4 generates the workflow |
|
|
142
|
+
| Staging environment | Optional | When you want a test environment |
|
|
143
|
+
| Custom domain | Optional | After first deploy |
|
|
144
|
+
| Sentry | Optional | When you want error tracking |
|
|
145
|
+
| i18n | Optional | Phase 4 or after launch |
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
**Start here: `bun install && bun dev`. The homepage tells you everything else.**
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## Getting Started
|
|
10
|
+
|
|
11
|
+
- [ENV_SETUP.md](./ENV_SETUP.md) - **START HERE** — Full onboarding flow (install → firebase → deploy)
|
|
12
|
+
- [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) - Firebase project setup (`dndev firebase:setup`)
|
|
13
|
+
- [SETUP_TESTING.md](./SETUP_TESTING.md) - Test generation (Phase 4)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
9
17
|
## Core Setup
|
|
10
18
|
|
|
11
19
|
- [SETUP_PAGES.md](./SETUP_PAGES.md) - Pages & routing (pre-configured)
|
|
@@ -23,6 +31,7 @@
|
|
|
23
31
|
- [SETUP_AUTH.md](./SETUP_AUTH.md) - Authentication (pre-configured)
|
|
24
32
|
- [SETUP_OAUTH.md](./SETUP_OAUTH.md) - OAuth connections (pre-configured)
|
|
25
33
|
- [SETUP_BILLING.md](./SETUP_BILLING.md) - Stripe subscriptions (pre-configured)
|
|
34
|
+
- [SETUP_BLOG.md](./SETUP_BLOG.md) - Convention-based markdown blog with i18n
|
|
26
35
|
- [SETUP_PWA.md](./SETUP_PWA.md) - Progressive Web App setup
|
|
27
36
|
- [SETUP_FUNCTIONS.md](./SETUP_FUNCTIONS.md) - Firebase Functions (pre-configured)
|
|
28
37
|
|
|
@@ -107,29 +107,26 @@ export default defineViteConfig({
|
|
|
107
107
|
|
|
108
108
|
## 4. Environment Variables
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
# .env
|
|
112
|
-
VITE_APP_NAME="My App"
|
|
113
|
-
VITE_APP_URL=http://localhost:5173
|
|
110
|
+
**Vite loads `.env` from the app directory only.** Not the repo root.
|
|
114
111
|
|
|
115
|
-
|
|
116
|
-
VITE_FIREBASE_API_KEY=your-api-key
|
|
117
|
-
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
|
|
118
|
-
VITE_FIREBASE_PROJECT_ID=your-project-id
|
|
119
|
-
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
|
|
120
|
-
VITE_FIREBASE_MESSAGING_SENDER_ID=123456789
|
|
121
|
-
VITE_FIREBASE_APP_ID=1:123456789:web:abcdef
|
|
112
|
+
Run `dndev firebase:setup` to auto-populate Firebase config. See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md).
|
|
122
113
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
114
|
+
```bash
|
|
115
|
+
# apps/<your-app>/.env — client-side variables (exposed to browser)
|
|
116
|
+
VITE_APP_URL=http://localhost:5173
|
|
117
|
+
VITE_DONOTDEV_LICENSE_KEY=dndev_your_key_here
|
|
118
|
+
VITE_FIREBASE_API_KEY=... # Written by dndev firebase:setup
|
|
119
|
+
VITE_FIREBASE_PROJECT_ID=... # Written by dndev firebase:setup
|
|
120
|
+
VITE_AUTH_PARTNERS=github,google
|
|
127
121
|
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_...
|
|
122
|
+
|
|
123
|
+
# functions/.env — server-side secrets (never exposed to browser)
|
|
128
124
|
STRIPE_SECRET_KEY=sk_test_...
|
|
129
125
|
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
130
|
-
STRIPE_API_VERSION=2025-08-27.basil
|
|
131
126
|
```
|
|
132
127
|
|
|
128
|
+
Push server secrets to Firebase: `dndev sync-secrets`
|
|
129
|
+
|
|
133
130
|
---
|
|
134
131
|
|
|
135
132
|
**Zero config. Override when needed.**
|