@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
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# Setup: Firebase Functions
|
|
2
|
-
|
|
3
|
-
**Most is pre-configured.** Functions scaffolded. Just add config and deploy.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## ⚠️ CRITICAL: Import Rules for Functions
|
|
8
|
-
|
|
9
|
-
**Functions run on Node.js - you MUST use `/server` imports or your function will crash on deploy.**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
// ✅ CORRECT - Functions MUST use /server imports
|
|
13
|
-
import { getFirebaseAdminAuth } from '@donotdev/firebase/server';
|
|
14
|
-
import { getFirebaseAdminFirestore } from '@donotdev/firebase/server';
|
|
15
|
-
import { handleError } from '@donotdev/core/server';
|
|
16
|
-
|
|
17
|
-
// ❌ WRONG - This will crash on deploy (pulls in React/client code)
|
|
18
|
-
import { getAuth } from '@donotdev/firebase';
|
|
19
|
-
import { getFirestore } from '@donotdev/firebase';
|
|
20
|
-
import { handleError } from '@donotdev/core';
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
**Why?** Functions run in Node.js, not the browser. Client imports (`@donotdev/firebase`) include React and browser-only code that will crash your function.
|
|
24
|
-
|
|
25
|
-
**Rule:** Always use `/server` suffix for:
|
|
26
|
-
- `@donotdev/firebase/server` (not `@donotdev/firebase`)
|
|
27
|
-
- `@donotdev/core/server` (not `@donotdev/core`)
|
|
28
|
-
- `@donotdev/utils/server` (not `@donotdev/utils`)
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Standard Use
|
|
33
|
-
|
|
34
|
-
**Structure:**
|
|
35
|
-
```
|
|
36
|
-
functions/
|
|
37
|
-
├── src/
|
|
38
|
-
│ ├── billing/
|
|
39
|
-
│ └── index.ts
|
|
40
|
-
├── functions.yaml # Manually maintained
|
|
41
|
-
└── .env.local # Local secrets
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
**Environment:**
|
|
45
|
-
```bash
|
|
46
|
-
# .env.local (local)
|
|
47
|
-
STRIPE_SECRET_KEY=sk_test_...
|
|
48
|
-
|
|
49
|
-
# .env (production, synced via dndev sync-secrets)
|
|
50
|
-
STRIPE_SECRET_KEY=sk_live_...
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Advanced: Adding Functions
|
|
56
|
-
|
|
57
|
-
1. **Create:** `src/billing/myFunction.ts`
|
|
58
|
-
2. **Export:** `export * from './billing/myFunction.js';` in `src/index.ts`
|
|
59
|
-
3. **Add to functions.yaml:**
|
|
60
|
-
```yaml
|
|
61
|
-
endpoints:
|
|
62
|
-
myFunction:
|
|
63
|
-
region: [europe-west1]
|
|
64
|
-
platform: gcfv2
|
|
65
|
-
httpsTrigger: {}
|
|
66
|
-
entryPoint: myFunction
|
|
67
|
-
labels: {}
|
|
68
|
-
```
|
|
69
|
-
4. **Deploy:** `dndev deploy`
|
|
70
|
-
|
|
71
|
-
**Critical:** Every exported function must be in `functions.yaml` or it won't deploy.
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Advanced: Framework Integration
|
|
76
|
-
|
|
77
|
-
```typescript
|
|
78
|
-
// Your function = framework + your config
|
|
79
|
-
import { createCheckoutSession as generic } from '@donotdev/functions/firebase';
|
|
80
|
-
import { stripeBackConfig } from '../config/stripeBackConfig';
|
|
81
|
-
|
|
82
|
-
export const createCheckoutSession = generic(stripeBackConfig);
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## Advanced: Custom Functions with Firebase
|
|
88
|
-
|
|
89
|
-
**When writing custom functions that access Firestore/Auth, use `/server` imports:**
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
import { onCall } from 'firebase-functions/v2/https';
|
|
93
|
-
import { FUNCTION_CONFIG } from '@donotdev/functions/firebase';
|
|
94
|
-
// ✅ MUST use /server imports in functions
|
|
95
|
-
import { getFirebaseAdminFirestore } from '@donotdev/firebase/server';
|
|
96
|
-
import { getFirebaseAdminAuth } from '@donotdev/firebase/server';
|
|
97
|
-
import { handleError } from '@donotdev/core/server';
|
|
98
|
-
|
|
99
|
-
export const myCustomFunction = onCall(FUNCTION_CONFIG, async (request) => {
|
|
100
|
-
const firestore = getFirebaseAdminFirestore();
|
|
101
|
-
const auth = getFirebaseAdminAuth();
|
|
102
|
-
|
|
103
|
-
// Your custom logic here
|
|
104
|
-
const doc = await firestore.collection('users').doc(request.auth.uid).get();
|
|
105
|
-
|
|
106
|
-
return { data: doc.data() };
|
|
107
|
-
});
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
**Remember:** All Firebase imports in functions MUST use `@donotdev/firebase/server`, never `@donotdev/firebase`.
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
**Add functions, get backend. Framework handles the rest.**
|
|
File without changes
|
|
File without changes
|
/package/templates/root-consumer/guides/{COMPONENTS_UI.md.example → dndev/COMPONENTS_UI.md.example}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/root-consumer/guides/{SETUP_BILLING.md.example → dndev/SETUP_BILLING.md.example}
RENAMED
|
File without changes
|
/package/templates/root-consumer/guides/{SETUP_I18N.md.example → dndev/SETUP_I18N.md.example}
RENAMED
|
File without changes
|
/package/templates/root-consumer/guides/{SETUP_LAYOUTS.md.example → dndev/SETUP_LAYOUTS.md.example}
RENAMED
|
File without changes
|
/package/templates/root-consumer/guides/{SETUP_OAUTH.md.example → dndev/SETUP_OAUTH.md.example}
RENAMED
|
File without changes
|
/package/templates/root-consumer/guides/{SETUP_PAGES.md.example → dndev/SETUP_PAGES.md.example}
RENAMED
|
File without changes
|
|
File without changes
|
/package/templates/root-consumer/guides/{SETUP_THEMES.md.example → dndev/SETUP_THEMES.md.example}
RENAMED
|
File without changes
|
/package/templates/root-consumer/guides/{USE_ROUTING.md.example → dndev/USE_ROUTING.md.example}
RENAMED
|
File without changes
|
|
File without changes
|
/package/templates/root-consumer/guides/{advanced → dndev/advanced}/COOKIE_REFERENCE.md.example
RENAMED
|
File without changes
|
|
File without changes
|
/package/templates/root-consumer/guides/{advanced → dndev/advanced}/VERSION_CONTROL.md.example
RENAMED
|
File without changes
|