@donotdev/cli 0.0.12 → 0.0.14
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 +32 -118
- package/dist/bin/commands/agent-setup.d.ts +6 -0
- package/dist/bin/commands/agent-setup.d.ts.map +1 -0
- package/dist/bin/commands/agent-setup.js +623 -0
- package/dist/bin/commands/agent-setup.js.map +1 -0
- package/dist/bin/commands/build.js +13 -12
- package/dist/bin/commands/bump.js +103 -35
- package/dist/bin/commands/cacheout.js +13 -12
- package/dist/bin/commands/create-app.js +53 -151
- package/dist/bin/commands/create-project.js +109 -167
- package/dist/bin/commands/deploy.js +7620 -30
- package/dist/bin/commands/dev.js +13 -12
- package/dist/bin/commands/emu.js +13 -12
- 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/format.js +13 -12
- package/dist/bin/commands/lint.js +13 -12
- package/dist/bin/commands/preview.js +13 -12
- 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/commands/sync-secrets.js +13 -12
- package/dist/bin/commands/wai.js +7397 -11
- 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 +7760 -109
- 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/brainstorm.md.example +1 -1
- package/templates/root-consumer/.claude/commands/build.md.example +3 -3
- package/templates/root-consumer/.claude/commands/design.md.example +1 -1
- package/templates/root-consumer/.claude/commands/polish.md.example +66 -82
- package/templates/root-consumer/.dndev/args.json.example +6 -0
- 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 +150 -0
- package/templates/root-consumer/CLAUDE.md.example +19 -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 +59 -326
- 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/GOTCHAS.md.example +186 -0
- package/templates/root-consumer/guides/dndev/INDEX.md.example +10 -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 +17 -19
- 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,100 @@
|
|
|
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.**
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## ✅ Success Path: Follow These Steps
|
|
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.
|
|
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.
|
|
59
9
|
|
|
60
10
|
---
|
|
61
11
|
|
|
62
|
-
##
|
|
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
|
-
##
|
|
80
|
-
|
|
81
|
-
**CRITICAL: Follow these steps IN ORDER. Complete each step before moving to the next.**
|
|
82
|
-
|
|
83
|
-
**✅ SCAFFOLDING PHILOSOPHY:**
|
|
84
|
-
The `dndev init` or `dndev create-app` commands create files with working defaults. Your job is to UPDATE these scaffolded files with your specific needs - update values, add content, customize configuration. The scaffolded files are correctly structured and framework-ready. Preserve the structure and imports, update the values and content.
|
|
85
|
-
|
|
86
|
-
### Step 1: Create Project (if starting from scratch)
|
|
87
|
-
```bash
|
|
88
|
-
dndev init my-project-name
|
|
89
|
-
# OR if adding to existing project:
|
|
90
|
-
cd existing-project
|
|
91
|
-
dndev create-app my-app-name
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Step 2: Install Dependencies (REQUIRED - FIRST STEP)
|
|
95
|
-
```bash
|
|
96
|
-
cd my-project-name # or cd apps/my-app-name
|
|
97
|
-
bun install
|
|
98
|
-
```
|
|
99
|
-
**✅ CRITICAL:** Run `bun install` as the first step. This installs all framework dependencies and enables framework components to work correctly.
|
|
100
|
-
|
|
101
|
-
### Step 3: Configure App (REQUIRED)
|
|
102
|
-
**CRITICAL:** The scaffolding process creates these files with working defaults. UPDATE them with your specific needs - do not replace them entirely.
|
|
103
|
-
|
|
104
|
-
**File: `src/config/app.ts`** (scaffolded - update with your values):
|
|
105
|
-
```typescript
|
|
106
|
-
import type { AppConfig } from '@donotdev/core';
|
|
107
|
-
|
|
108
|
-
export const appConfig: AppConfig = {
|
|
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.
|
|
18
|
+
## The WAI-WAY Workflow (5 Phases)
|
|
148
19
|
|
|
149
|
-
|
|
150
|
-
**Scaffolding creates `src/pages/HomePage.tsx` with a working example. UPDATE it with your content:**
|
|
20
|
+
Call `start_phase(N)` to begin each phase. It returns the blueprint, agent persona, and files to read.
|
|
151
21
|
|
|
152
|
-
|
|
153
|
-
|
|
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.
|
|
154
26
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
```
|
|
27
|
+
### Phase 1: SCAFFOLD (Extractor)
|
|
28
|
+
- **MCP:** `start_phase(1)`
|
|
29
|
+
- **Goal:** Running skeleton. Use `dndev create-app` and create `*Page.tsx` stubs.
|
|
159
30
|
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
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
|
-
```
|
|
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.
|
|
178
35
|
|
|
179
|
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
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.
|
|
183
40
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
4. **TypeScript errors** → Run `bun run type-check` to see details
|
|
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')`.
|
|
189
45
|
|
|
190
|
-
|
|
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.**
|
|
50
|
+
## Mindset & Standards
|
|
202
51
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
- Framework automatically generates navigation from discovered routes
|
|
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.
|
|
208
56
|
|
|
209
|
-
|
|
57
|
+
## Before You Start Coding
|
|
210
58
|
|
|
211
|
-
|
|
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)
|
|
212
63
|
|
|
213
|
-
|
|
64
|
+
If not, coach them: "Run `dndev firebase:setup` first, then follow the prompts." See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md).
|
|
214
65
|
|
|
215
66
|
---
|
|
216
67
|
|
|
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
|
|
68
|
+
## Project Args (`.dndev/args.json`)
|
|
243
69
|
|
|
244
|
-
|
|
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`
|
|
70
|
+
Generated by `dndev init`. All features ON by default — Phase 0 narrows down based on what the user actually needs.
|
|
249
71
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
);
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"platform": "firebase",
|
|
75
|
+
"strictness": "enforced",
|
|
76
|
+
"features": ["crud", "auth", "i18n", "billing", "oauth", "functions"],
|
|
77
|
+
"region": "europe-west1"
|
|
298
78
|
}
|
|
299
79
|
```
|
|
300
80
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
81
|
+
| Field | Values | Effect |
|
|
82
|
+
|-------|--------|--------|
|
|
83
|
+
| `platform` | `firebase`, `vercel` | Derived from builder choice |
|
|
84
|
+
| `strictness` | `enforced`, `warnings`, `permissive` | `enforced` = blocks `complete_phase` on convention violations. `warnings` = reports but allows. `permissive` = skips checks. |
|
|
85
|
+
| `features` | `crud`, `auth`, `i18n`, `billing`, `oauth`, `functions` | Filters gotchas — remove features the project doesn't use to reduce noise |
|
|
86
|
+
| `region` | any GCP region | Informational, shown in `start_phase` context |
|
|
306
87
|
|
|
307
|
-
|
|
88
|
+
`start_phase()` returns project args + phase-relevant gotchas automatically. `complete_phase()` respects `strictness`.
|
|
308
89
|
|
|
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)
|
|
90
|
+
**Without MCP:** `args.json` and `GOTCHAS.md` are plain files. Any agent can read them directly.
|
|
330
91
|
|
|
331
92
|
---
|
|
332
93
|
|
|
333
|
-
##
|
|
334
|
-
|
|
335
|
-
### "Cannot find module '@donotdev/...'"
|
|
336
|
-
**Solution:** Run `bun install` in the project root. Dependencies must be installed before running the app.
|
|
94
|
+
## Gotchas (`guides/dndev/GOTCHAS.md`)
|
|
337
95
|
|
|
338
|
-
|
|
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
|
|
96
|
+
Common mistakes, phase-tagged. `start_phase(N)` automatically filters and returns only the gotchas relevant to phase N and your enabled features. Read the full file for reference: [GOTCHAS.md](../guides/dndev/GOTCHAS.md).
|
|
362
97
|
|
|
363
98
|
---
|
|
364
99
|
|
|
365
|
-
**
|
|
366
|
-
|
|
367
|
-
**Full guides:** [INDEX.md](./INDEX.md) - 50-100 LOC per topic (SETUP_*.md, advanced/*.md)
|
|
100
|
+
**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.**
|