@donotdev/cli 0.0.6 → 0.0.7
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 +25 -7
- package/dist/bin/commands/build.js +156 -158
- package/dist/bin/commands/bump.js +153 -153
- package/dist/bin/commands/cacheout.js +154 -154
- package/dist/bin/commands/create-app.js +184 -156
- package/dist/bin/commands/create-project.js +154 -154
- package/dist/bin/commands/deploy.js +470 -470
- package/dist/bin/commands/dev.js +155 -155
- package/dist/bin/commands/emu.js +155 -155
- package/dist/bin/commands/format.js +154 -154
- package/dist/bin/commands/lint.js +157 -154
- package/dist/bin/commands/preview.js +155 -155
- package/dist/bin/commands/sync-secrets.js +155 -155
- package/dist/bin/commands/wai.d.ts +11 -0
- package/dist/bin/commands/wai.d.ts.map +1 -0
- package/dist/bin/commands/wai.js +12 -0
- package/dist/bin/commands/wai.js.map +1 -0
- package/dist/bin/dndev.js +24 -8
- package/dist/bin/donotdev.js +24 -8
- package/dist/index.js +524 -497
- package/package.json +1 -1
- package/templates/app-demo/src/config/app.ts.example +12 -0
- package/templates/app-next/src/config/app.ts.example +75 -48
- package/templates/app-vite/index.html.example +71 -37
- package/templates/app-vite/src/config/app.ts.example +75 -47
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +152 -0
- package/templates/app-vite/src/pages/HomePage.tsx.example +81 -134
- package/templates/app-vite/src/pages/ListPageExample.tsx.example +88 -0
- package/templates/functions-firebase/build.mjs.example +8 -1
- package/templates/functions-firebase/functions-firebase/build.mjs.example +8 -1
- package/templates/functions-firebase/functions-firebase/src/index.ts.example +19 -25
- package/templates/functions-firebase/functions.config.js.example +35 -0
- package/templates/root-consumer/entities/ExampleEntity.ts.example +223 -0
- package/templates/root-consumer/entities/demo.ts.example +562 -0
- package/templates/root-consumer/entities/index.ts.example +15 -0
- package/templates/root-consumer/guides/{AGENT_START_HERE.md.example → dndev/AGENT_START_HERE.md.example} +22 -0
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +231 -0
- package/templates/root-consumer/guides/{SETUP_AUTH.md.example → dndev/SETUP_AUTH.md.example} +30 -0
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +473 -0
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +116 -0
- package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +404 -0
- package/templates/root-consumer/guides/wai-way/agents/architect.md.example +78 -0
- package/templates/root-consumer/guides/wai-way/agents/builder.md.example +87 -0
- package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +325 -0
- package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +100 -0
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +281 -0
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +77 -0
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +104 -0
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +124 -0
- package/templates/root-consumer/guides/wai-way/blueprints/4_configure.md.example +165 -0
- package/templates/root-consumer/guides/wai-way/context_map.json.example +95 -0
- package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +840 -0
- package/templates/root-consumer/guides/wai-way/page_patterns.md.example +686 -0
- package/templates/root-consumer/guides/wai-way/presets_guide.md.example +217 -0
- package/templates/root-consumer/guides/wai-way/spec_template.md.example +312 -0
- package/templates/functions-firebase/functions-firebase/src/crud/createEntity.ts.example +0 -19
- package/templates/functions-firebase/functions-firebase/src/crud/deleteEntity.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/crud/getEntity.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/crud/index.ts.example +0 -12
- package/templates/functions-firebase/functions-firebase/src/crud/listEntities.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/crud/updateEntity.ts.example +0 -14
- package/templates/root-consumer/guides/COMPONENTS_CRUD.md.example +0 -70
- package/templates/root-consumer/guides/SETUP_CRUD.md.example +0 -1244
- package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +0 -114
- /package/templates/root-consumer/guides/{COMPONENTS_ADV.md.example → dndev/COMPONENTS_ADV.md.example} +0 -0
- /package/templates/root-consumer/guides/{COMPONENTS_ATOMIC.md.example → dndev/COMPONENTS_ATOMIC.md.example} +0 -0
- /package/templates/root-consumer/guides/{COMPONENTS_UI.md.example → dndev/COMPONENTS_UI.md.example} +0 -0
- /package/templates/root-consumer/guides/{ENV_SETUP.md.example → dndev/ENV_SETUP.md.example} +0 -0
- /package/templates/root-consumer/guides/{INDEX.md.example → dndev/INDEX.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_APP_CONFIG.md.example → dndev/SETUP_APP_CONFIG.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_BILLING.md.example → dndev/SETUP_BILLING.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_I18N.md.example → dndev/SETUP_I18N.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_LAYOUTS.md.example → dndev/SETUP_LAYOUTS.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_OAUTH.md.example → dndev/SETUP_OAUTH.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_PAGES.md.example → dndev/SETUP_PAGES.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_PWA.md.example → dndev/SETUP_PWA.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_THEMES.md.example → dndev/SETUP_THEMES.md.example} +0 -0
- /package/templates/root-consumer/guides/{USE_ROUTING.md.example → dndev/USE_ROUTING.md.example} +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/APP_CHECK.md.example +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/COOKIE_REFERENCE.md.example +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/EMULATORS.md.example +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/VERSION_CONTROL.md.example +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# BLUEPRINT: 1_SCAFFOLD + SITEMAP
|
|
2
|
+
|
|
3
|
+
**Goal:** Running app with all routes defined.
|
|
4
|
+
|
|
5
|
+
**Done when:** All routes listed, all *Page.tsx files created with correct PageMeta.
|
|
6
|
+
|
|
7
|
+
**Prerequisite:** Phase 0 (spec) must be complete.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Step 1: Create App
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
dndev create-app my-app --preset [from spec]
|
|
15
|
+
cd my-app && bun install
|
|
16
|
+
dndev emu start
|
|
17
|
+
bun dev
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Preset comes from your completed spec (Phase 0).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Step 2: Review Spec Pages
|
|
25
|
+
|
|
26
|
+
From your spec, you have a list of pages. Now create them.
|
|
27
|
+
|
|
28
|
+
**READ:** `guides/wai-way/page_patterns.md` for page structure patterns.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Step 3: Create Page Files
|
|
33
|
+
|
|
34
|
+
For each page in spec:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
touch src/pages/AboutPage.tsx
|
|
38
|
+
touch src/pages/DashboardPage.tsx
|
|
39
|
+
touch src/pages/ProductsListPage.tsx
|
|
40
|
+
touch src/pages/ProductPage.tsx
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 4: Add PageMeta
|
|
46
|
+
|
|
47
|
+
**READ:** `src/pages/HomePage.tsx` for PageMeta pattern.
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import type { PageMeta } from '@donotdev/core';
|
|
51
|
+
import { PageContainer } from '@donotdev/ui';
|
|
52
|
+
import { Info } from 'lucide-react';
|
|
53
|
+
|
|
54
|
+
export const NAMESPACE = 'about';
|
|
55
|
+
|
|
56
|
+
export const meta: PageMeta = {
|
|
57
|
+
namespace: NAMESPACE,
|
|
58
|
+
icon: <Info />,
|
|
59
|
+
// From spec:
|
|
60
|
+
// auth: true, // Protected
|
|
61
|
+
// auth: { required: true, role: 'admin' }, // Admin
|
|
62
|
+
// hideFromMenu: true, // Form pages
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default function AboutPage() {
|
|
66
|
+
return <PageContainer>About Page</PageContainer>;
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Output
|
|
73
|
+
|
|
74
|
+
- [ ] App runs with `bun dev`
|
|
75
|
+
- [ ] All route files created (from spec)
|
|
76
|
+
- [ ] PageMeta set with correct auth levels (from spec)
|
|
77
|
+
- [ ] Navigation auto-generated
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# BLUEPRINT: 2_ENTITIES
|
|
2
|
+
|
|
3
|
+
**Goal:** Define all data models from spec.
|
|
4
|
+
|
|
5
|
+
**Done when:** All entities defined with fields, access rules, visibility. Exported from index.ts.
|
|
6
|
+
|
|
7
|
+
**Prerequisite:** Phase 0 (spec) and Phase 1 (scaffold) complete.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Step 1: Review Spec Entities
|
|
12
|
+
|
|
13
|
+
From your spec, you have a list of entities with fields and access rules.
|
|
14
|
+
|
|
15
|
+
**READ:** `guides/wai-way/entity_patterns.md` for common schemas:
|
|
16
|
+
- UserProfile, Post, Product, Order, Review, Comment
|
|
17
|
+
- Category, Settings, Workspace, Invitation, Media, ActivityLog
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Step 2: Create Entity Files
|
|
22
|
+
|
|
23
|
+
For each entity in spec:
|
|
24
|
+
|
|
25
|
+
1. Find matching pattern in `entity_patterns.md`
|
|
26
|
+
2. Copy pattern → `entities/[Entity].ts`
|
|
27
|
+
3. Customize fields from spec
|
|
28
|
+
4. Set access rules from spec
|
|
29
|
+
|
|
30
|
+
**READ:** `entities/ExampleEntity.ts` for the base pattern.
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
// entities/Product.ts
|
|
34
|
+
import { defineEntity } from '@donotdev/core';
|
|
35
|
+
|
|
36
|
+
export const productEntity = defineEntity({
|
|
37
|
+
name: 'Product',
|
|
38
|
+
collection: 'products',
|
|
39
|
+
fields: {
|
|
40
|
+
// Fields from spec...
|
|
41
|
+
},
|
|
42
|
+
access: {
|
|
43
|
+
// Access rules from spec...
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Step 3: Export Entities
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
// entities/index.ts
|
|
54
|
+
export { productEntity } from './Product';
|
|
55
|
+
export { customerEntity } from './Customer';
|
|
56
|
+
export { orderEntity } from './Order';
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Field Type Quick Reference
|
|
62
|
+
|
|
63
|
+
| Type | Use for |
|
|
64
|
+
|------|---------|
|
|
65
|
+
| `text` | Single-line text |
|
|
66
|
+
| `textarea` | Multi-line text |
|
|
67
|
+
| `richtext` | Rich text editor |
|
|
68
|
+
| `number` | Numbers |
|
|
69
|
+
| `email` | Email addresses |
|
|
70
|
+
| `tel` | Phone numbers |
|
|
71
|
+
| `url` | URLs |
|
|
72
|
+
| `select` | Dropdown with options |
|
|
73
|
+
| `combobox` | Searchable dropdown |
|
|
74
|
+
| `multiselect` | Multiple selection |
|
|
75
|
+
| `switch` | On/off toggle |
|
|
76
|
+
| `date` | Date picker |
|
|
77
|
+
| `timestamp` | Date + time |
|
|
78
|
+
| `image` | Single image |
|
|
79
|
+
| `images` | Multiple images |
|
|
80
|
+
| `file` | Single file |
|
|
81
|
+
| `files` | Multiple files |
|
|
82
|
+
| `address` | Address autocomplete |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Access Levels
|
|
87
|
+
|
|
88
|
+
| Level | Who |
|
|
89
|
+
|-------|-----|
|
|
90
|
+
| `guest` | Anyone |
|
|
91
|
+
| `user` | Authenticated |
|
|
92
|
+
| `owner` | Creator only |
|
|
93
|
+
| `admin` | Admins |
|
|
94
|
+
| `super` | Super admins |
|
|
95
|
+
| `never` | No one |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Output
|
|
100
|
+
|
|
101
|
+
- [ ] All entities from spec defined in `entities/`
|
|
102
|
+
- [ ] Fields match spec
|
|
103
|
+
- [ ] Access rules match spec
|
|
104
|
+
- [ ] Exported from `entities/index.ts`
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# BLUEPRINT: 3_COMPOSE
|
|
2
|
+
|
|
3
|
+
**Goal:** Build pages with components. HARDCODE ALL STRINGS.
|
|
4
|
+
|
|
5
|
+
**Done when:** All pages functional with content. CRUD pages use EntityList/EntityFormRenderer. All strings hardcoded.
|
|
6
|
+
|
|
7
|
+
**Prerequisite:** Phase 0-2 complete. Spec validated, entities defined.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Step 1: Read Page Patterns
|
|
12
|
+
|
|
13
|
+
**READ:** `guides/wai-way/page_patterns.md` for all patterns:
|
|
14
|
+
- Dashboard, List Page, Form Page
|
|
15
|
+
- Landing/Home, Pricing, Settings
|
|
16
|
+
- Profile, Detail Page, Analytics
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Step 2: CRUD Pages
|
|
21
|
+
|
|
22
|
+
For each entity in spec:
|
|
23
|
+
|
|
24
|
+
### List Page
|
|
25
|
+
|
|
26
|
+
**READ:** `src/pages/ListPageExample.tsx`
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { EntityList } from '@donotdev/crud';
|
|
30
|
+
import { useAuth } from '@donotdev/auth';
|
|
31
|
+
import { PageContainer } from '@donotdev/ui';
|
|
32
|
+
import { productEntity } from 'entities';
|
|
33
|
+
|
|
34
|
+
export default function ProductsListPage() {
|
|
35
|
+
const user = useAuth('user');
|
|
36
|
+
return (
|
|
37
|
+
<PageContainer>
|
|
38
|
+
<EntityList entity={productEntity} userRole={user?.role} />
|
|
39
|
+
</PageContainer>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Form Page
|
|
45
|
+
|
|
46
|
+
**READ:** `src/pages/FormPageExample.tsx`
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import { EntityFormRenderer, useCrud } from '@donotdev/crud';
|
|
50
|
+
import { productEntity } from 'entities';
|
|
51
|
+
|
|
52
|
+
export default function ProductPage() {
|
|
53
|
+
const { id } = useParams();
|
|
54
|
+
const { get, add, update } = useCrud(productEntity);
|
|
55
|
+
const isNew = id === 'new';
|
|
56
|
+
// ... see page_patterns.md for full pattern
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Step 3: Dashboard Page
|
|
63
|
+
|
|
64
|
+
Copy Dashboard pattern from `page_patterns.md`:
|
|
65
|
+
- Quick actions (cards with onClick)
|
|
66
|
+
- KPI cards in grid
|
|
67
|
+
- Alert/attention sections
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Step 4: Landing Pages
|
|
72
|
+
|
|
73
|
+
Copy Landing pattern from `page_patterns.md`:
|
|
74
|
+
- HeroSection with CTAs
|
|
75
|
+
- Feature grid with Cards
|
|
76
|
+
- Final CTA section
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Component Quick Reference
|
|
81
|
+
|
|
82
|
+
| Component | Use for |
|
|
83
|
+
|-----------|---------|
|
|
84
|
+
| `PageContainer` | Page wrapper (required) |
|
|
85
|
+
| `HeroSection` | Full-width hero banner |
|
|
86
|
+
| `Section` | Content block with title |
|
|
87
|
+
| `Card` | Content card |
|
|
88
|
+
| `Grid` | Responsive grid ([1,2,3,3] = mobile 1, tablet 2, desktop 3) |
|
|
89
|
+
| `Stack` | Flex container |
|
|
90
|
+
| `Button` | Buttons |
|
|
91
|
+
| `Text` | Typography |
|
|
92
|
+
| `Badge` | Status badges |
|
|
93
|
+
| `Alert` | Notifications |
|
|
94
|
+
| `Loader` | Loading spinner |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## CRITICAL: HARDCODE FIRST
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
// ✅ GOOD - Start with hardcoded strings
|
|
102
|
+
<HeroSection
|
|
103
|
+
title="Welcome to My App"
|
|
104
|
+
subtitle="The best app ever"
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
// ❌ BAD - Don't start with i18n
|
|
108
|
+
<HeroSection
|
|
109
|
+
title={t('hero.title')}
|
|
110
|
+
subtitle={t('hero.subtitle')}
|
|
111
|
+
/>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Validate UX in one language. Add i18n in Phase 5.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Output
|
|
119
|
+
|
|
120
|
+
- [ ] All CRUD pages use EntityList/EntityFormRenderer
|
|
121
|
+
- [ ] Dashboard uses pattern from page_patterns.md
|
|
122
|
+
- [ ] Landing pages use framework components
|
|
123
|
+
- [ ] All strings are HARDCODED (not i18n)
|
|
124
|
+
- [ ] App is fully functional
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# BLUEPRINT: 4_CONFIGURE + POLISH
|
|
2
|
+
|
|
3
|
+
**Goal:** Finalize configuration, test, and optionally add i18n.
|
|
4
|
+
|
|
5
|
+
**Done when:** Config complete, tests pass, mobile responsive.
|
|
6
|
+
|
|
7
|
+
**Prerequisite:** Phase 0-3 complete. App is functional.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Step 1: Update Configuration
|
|
12
|
+
|
|
13
|
+
### app.ts
|
|
14
|
+
|
|
15
|
+
**READ:** `src/config/app.ts`
|
|
16
|
+
|
|
17
|
+
- [ ] `APP_NAME` - Your app name (from spec)
|
|
18
|
+
- [ ] `APP_SHORT_NAME` - Abbreviation
|
|
19
|
+
- [ ] `preset` - From spec (landing/admin/moolti/docs/blog/game/plain)
|
|
20
|
+
- [ ] Footer legal links
|
|
21
|
+
|
|
22
|
+
### legal.ts
|
|
23
|
+
|
|
24
|
+
**READ:** `src/config/legal.ts`
|
|
25
|
+
|
|
26
|
+
- [ ] Company name and registration
|
|
27
|
+
- [ ] Contact emails
|
|
28
|
+
- [ ] Hosting provider info
|
|
29
|
+
- [ ] Jurisdiction
|
|
30
|
+
|
|
31
|
+
### .env
|
|
32
|
+
|
|
33
|
+
Required:
|
|
34
|
+
- [ ] `VITE_FIREBASE_*` - Firebase config
|
|
35
|
+
- [ ] `VITE_DONOTDEV_LICENSE_KEY` - License key
|
|
36
|
+
|
|
37
|
+
Optional (from spec features):
|
|
38
|
+
- [ ] `VITE_STRIPE_*` - If billing enabled
|
|
39
|
+
- [ ] `VITE_SENTRY_DSN` - If error tracking
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step 2: Firebase Setup
|
|
44
|
+
|
|
45
|
+
1. Go to [Firebase Console](https://console.firebase.google.com)
|
|
46
|
+
2. Enable auth providers (from spec):
|
|
47
|
+
- [ ] Email/Password
|
|
48
|
+
- [ ] Google
|
|
49
|
+
- [ ] GitHub
|
|
50
|
+
- [ ] etc.
|
|
51
|
+
3. Create Firestore Database
|
|
52
|
+
4. Deploy rules: `firebase deploy --only firestore:rules`
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Step 3: Test with Emulators
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
dndev emu start
|
|
60
|
+
bun dev
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Auth Tests
|
|
64
|
+
- [ ] Can create user account
|
|
65
|
+
- [ ] Can login/logout
|
|
66
|
+
- [ ] Public pages work without auth
|
|
67
|
+
- [ ] Protected pages redirect to login
|
|
68
|
+
- [ ] Admin pages require admin role
|
|
69
|
+
|
|
70
|
+
### CRUD Tests
|
|
71
|
+
- [ ] Can create entities
|
|
72
|
+
- [ ] Can read/list entities
|
|
73
|
+
- [ ] Can update entities
|
|
74
|
+
- [ ] Can delete entities
|
|
75
|
+
- [ ] Data persists
|
|
76
|
+
|
|
77
|
+
### Access Control Tests
|
|
78
|
+
- [ ] Guest can only see guest-visible fields
|
|
79
|
+
- [ ] User can only edit own data (if owner access)
|
|
80
|
+
- [ ] Admin can edit all data
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Step 4: Theme Customization
|
|
85
|
+
|
|
86
|
+
**READ:** `src/themes.css`
|
|
87
|
+
|
|
88
|
+
Key variables:
|
|
89
|
+
- `--primary` - Brand color
|
|
90
|
+
- `--accent` - Accent color
|
|
91
|
+
- `--background` - Page background
|
|
92
|
+
- `--foreground` - Text color
|
|
93
|
+
- `--radius` - Border radius
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Step 5: Mobile Check
|
|
98
|
+
|
|
99
|
+
1. Open DevTools (F12)
|
|
100
|
+
2. Toggle device toolbar (Ctrl+Shift+M)
|
|
101
|
+
3. Test at 375px width
|
|
102
|
+
|
|
103
|
+
Check:
|
|
104
|
+
- [ ] Navigation works (mobile menu)
|
|
105
|
+
- [ ] Forms are usable
|
|
106
|
+
- [ ] Text is readable
|
|
107
|
+
- [ ] Buttons are tappable (44px min)
|
|
108
|
+
- [ ] No horizontal scroll
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Step 6: i18n (Optional)
|
|
113
|
+
|
|
114
|
+
**Only after Steps 1-5 are validated!**
|
|
115
|
+
|
|
116
|
+
### Extract Strings
|
|
117
|
+
|
|
118
|
+
Create `src/locales/[namespace]_en.json`:
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"hero": {
|
|
122
|
+
"title": "Your App Name",
|
|
123
|
+
"subtitle": "Your tagline"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Replace Hardcoded Strings
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
const { t } = useTranslation('home');
|
|
132
|
+
|
|
133
|
+
<HeroSection
|
|
134
|
+
title={t('hero.title')}
|
|
135
|
+
subtitle={t('hero.subtitle')}
|
|
136
|
+
/>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Add Languages
|
|
140
|
+
|
|
141
|
+
Copy `home_en.json` → `home_fr.json`, translate values.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Final Checklist
|
|
146
|
+
|
|
147
|
+
- [ ] app.ts configured
|
|
148
|
+
- [ ] legal.ts configured
|
|
149
|
+
- [ ] .env configured
|
|
150
|
+
- [ ] Firebase connected
|
|
151
|
+
- [ ] Auth working
|
|
152
|
+
- [ ] CRUD working
|
|
153
|
+
- [ ] Access control working
|
|
154
|
+
- [ ] Mobile responsive
|
|
155
|
+
- [ ] (Optional) i18n added
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Output
|
|
160
|
+
|
|
161
|
+
Production-ready app with:
|
|
162
|
+
- Complete configuration
|
|
163
|
+
- Working auth & CRUD
|
|
164
|
+
- Mobile responsive
|
|
165
|
+
- (Optional) Multi-language support
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "WAI-WAY context map - maps phases to required files. READ the scaffolded files, they contain inline documentation.",
|
|
3
|
+
"golden_rule": "THE SCAFFOLDED FILES ARE YOUR DOCUMENTATION. Read the file. Follow the pattern. Extend.",
|
|
4
|
+
"phases": {
|
|
5
|
+
"0_brainstorm_spec": {
|
|
6
|
+
"agent": "extractor",
|
|
7
|
+
"goal": "Gather requirements through conversation and produce validated spec",
|
|
8
|
+
"flow": "User idea → Agent questions → Agent fills spec → User validates",
|
|
9
|
+
"done_when": "spec_template.md filled and validated by user",
|
|
10
|
+
"read_files": [
|
|
11
|
+
"guides/wai-way/spec_template.md",
|
|
12
|
+
"guides/wai-way/presets_guide.md",
|
|
13
|
+
"guides/wai-way/entity_patterns.md",
|
|
14
|
+
"guides/wai-way/page_patterns.md"
|
|
15
|
+
],
|
|
16
|
+
"output": "Validated spec with preset, entities, pages, auth/billing requirements"
|
|
17
|
+
},
|
|
18
|
+
"1_scaffold_sitemap": {
|
|
19
|
+
"agent": "extractor",
|
|
20
|
+
"goal": "Running app with all routes defined",
|
|
21
|
+
"done_when": "All routes listed, all *Page.tsx files created with correct PageMeta",
|
|
22
|
+
"read_files": [
|
|
23
|
+
"src/pages/HomePage.tsx",
|
|
24
|
+
"src/config/app.ts",
|
|
25
|
+
"guides/wai-way/page_patterns.md"
|
|
26
|
+
],
|
|
27
|
+
"output": "All *Page.tsx files created with correct PageMeta"
|
|
28
|
+
},
|
|
29
|
+
"2_entities": {
|
|
30
|
+
"agent": "architect",
|
|
31
|
+
"goal": "Define all data models",
|
|
32
|
+
"done_when": "All entities defined with fields, access, visibility. Exported from index.ts",
|
|
33
|
+
"read_files": [
|
|
34
|
+
"entities/ExampleEntity.ts",
|
|
35
|
+
"entities/index.ts",
|
|
36
|
+
"guides/wai-way/entity_patterns.md"
|
|
37
|
+
],
|
|
38
|
+
"output": "All entities defined in entities/"
|
|
39
|
+
},
|
|
40
|
+
"3_compose": {
|
|
41
|
+
"agent": "builder",
|
|
42
|
+
"goal": "Build pages with components (hardcoded strings)",
|
|
43
|
+
"done_when": "All pages functional, CRUD uses EntityList/EntityFormRenderer, strings hardcoded",
|
|
44
|
+
"read_files": [
|
|
45
|
+
"src/pages/ListPageExample.tsx",
|
|
46
|
+
"src/pages/FormPageExample.tsx",
|
|
47
|
+
"src/pages/HomePage.tsx",
|
|
48
|
+
"guides/wai-way/page_patterns.md"
|
|
49
|
+
],
|
|
50
|
+
"output": "All pages functional with hardcoded content"
|
|
51
|
+
},
|
|
52
|
+
"4_configure_polish": {
|
|
53
|
+
"agent": "polisher",
|
|
54
|
+
"goal": "Finalize config, test, optional i18n",
|
|
55
|
+
"done_when": "Config complete, tests pass, mobile responsive",
|
|
56
|
+
"read_files": [
|
|
57
|
+
"src/config/app.ts",
|
|
58
|
+
"src/config/legal.ts",
|
|
59
|
+
"src/themes.css",
|
|
60
|
+
".env"
|
|
61
|
+
],
|
|
62
|
+
"output": "Working app with auth, CRUD, and config complete"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"key_files": {
|
|
66
|
+
"spec": {
|
|
67
|
+
"guides/wai-way/spec_template.md": "App specification template - fill before coding",
|
|
68
|
+
"guides/wai-way/presets_guide.md": "Preset decision matrix - landing/admin/moolti/docs/blog/game/plain",
|
|
69
|
+
"guides/wai-way/entity_patterns.md": "Common entity schemas - UserProfile, Post, Product, Order, etc.",
|
|
70
|
+
"guides/wai-way/page_patterns.md": "Common page structures - Dashboard, List, Form, Landing, Settings, etc."
|
|
71
|
+
},
|
|
72
|
+
"config": {
|
|
73
|
+
"src/config/app.ts": "App name, preset, features, auth routes",
|
|
74
|
+
"src/config/legal.ts": "Company info, legal compliance",
|
|
75
|
+
".env": "Firebase config, API keys"
|
|
76
|
+
},
|
|
77
|
+
"pages": {
|
|
78
|
+
"src/pages/HomePage.tsx": "PageMeta pattern, basic page structure",
|
|
79
|
+
"src/pages/ListPageExample.tsx": "EntityList CRUD pattern",
|
|
80
|
+
"src/pages/FormPageExample.tsx": "EntityFormRenderer pattern"
|
|
81
|
+
},
|
|
82
|
+
"entities": {
|
|
83
|
+
"entities/ExampleEntity.ts": "defineEntity pattern, field types, access rules",
|
|
84
|
+
"entities/index.ts": "Entity exports"
|
|
85
|
+
},
|
|
86
|
+
"styling": {
|
|
87
|
+
"src/themes.css": "CSS variables, light/dark themes",
|
|
88
|
+
"src/globals.css": "Font overrides"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"workflow": {
|
|
92
|
+
"summary": "BRAINSTORM → SPEC → SCAFFOLD → ENTITIES → COMPOSE → CONFIGURE",
|
|
93
|
+
"critical_rule": "Spec is OUTPUT of brainstorming. User validates before coding. Validated spec = mechanical build."
|
|
94
|
+
}
|
|
95
|
+
}
|