@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.
Files changed (82) hide show
  1. package/dependencies-matrix.json +25 -7
  2. package/dist/bin/commands/build.js +156 -158
  3. package/dist/bin/commands/bump.js +153 -153
  4. package/dist/bin/commands/cacheout.js +154 -154
  5. package/dist/bin/commands/create-app.js +184 -156
  6. package/dist/bin/commands/create-project.js +154 -154
  7. package/dist/bin/commands/deploy.js +470 -470
  8. package/dist/bin/commands/dev.js +155 -155
  9. package/dist/bin/commands/emu.js +155 -155
  10. package/dist/bin/commands/format.js +154 -154
  11. package/dist/bin/commands/lint.js +157 -154
  12. package/dist/bin/commands/preview.js +155 -155
  13. package/dist/bin/commands/sync-secrets.js +155 -155
  14. package/dist/bin/commands/wai.d.ts +11 -0
  15. package/dist/bin/commands/wai.d.ts.map +1 -0
  16. package/dist/bin/commands/wai.js +12 -0
  17. package/dist/bin/commands/wai.js.map +1 -0
  18. package/dist/bin/dndev.js +24 -8
  19. package/dist/bin/donotdev.js +24 -8
  20. package/dist/index.js +524 -497
  21. package/package.json +1 -1
  22. package/templates/app-demo/src/config/app.ts.example +12 -0
  23. package/templates/app-next/src/config/app.ts.example +75 -48
  24. package/templates/app-vite/index.html.example +71 -37
  25. package/templates/app-vite/src/config/app.ts.example +75 -47
  26. package/templates/app-vite/src/pages/FormPageExample.tsx.example +152 -0
  27. package/templates/app-vite/src/pages/HomePage.tsx.example +81 -134
  28. package/templates/app-vite/src/pages/ListPageExample.tsx.example +88 -0
  29. package/templates/functions-firebase/build.mjs.example +8 -1
  30. package/templates/functions-firebase/functions-firebase/build.mjs.example +8 -1
  31. package/templates/functions-firebase/functions-firebase/src/index.ts.example +19 -25
  32. package/templates/functions-firebase/functions.config.js.example +35 -0
  33. package/templates/root-consumer/entities/ExampleEntity.ts.example +223 -0
  34. package/templates/root-consumer/entities/demo.ts.example +562 -0
  35. package/templates/root-consumer/entities/index.ts.example +15 -0
  36. package/templates/root-consumer/guides/{AGENT_START_HERE.md.example → dndev/AGENT_START_HERE.md.example} +22 -0
  37. package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +231 -0
  38. package/templates/root-consumer/guides/{SETUP_AUTH.md.example → dndev/SETUP_AUTH.md.example} +30 -0
  39. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +473 -0
  40. package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +116 -0
  41. package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +404 -0
  42. package/templates/root-consumer/guides/wai-way/agents/architect.md.example +78 -0
  43. package/templates/root-consumer/guides/wai-way/agents/builder.md.example +87 -0
  44. package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +325 -0
  45. package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +100 -0
  46. package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +281 -0
  47. package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +77 -0
  48. package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +104 -0
  49. package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +124 -0
  50. package/templates/root-consumer/guides/wai-way/blueprints/4_configure.md.example +165 -0
  51. package/templates/root-consumer/guides/wai-way/context_map.json.example +95 -0
  52. package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +840 -0
  53. package/templates/root-consumer/guides/wai-way/page_patterns.md.example +686 -0
  54. package/templates/root-consumer/guides/wai-way/presets_guide.md.example +217 -0
  55. package/templates/root-consumer/guides/wai-way/spec_template.md.example +312 -0
  56. package/templates/functions-firebase/functions-firebase/src/crud/createEntity.ts.example +0 -19
  57. package/templates/functions-firebase/functions-firebase/src/crud/deleteEntity.ts.example +0 -14
  58. package/templates/functions-firebase/functions-firebase/src/crud/getEntity.ts.example +0 -14
  59. package/templates/functions-firebase/functions-firebase/src/crud/index.ts.example +0 -12
  60. package/templates/functions-firebase/functions-firebase/src/crud/listEntities.ts.example +0 -14
  61. package/templates/functions-firebase/functions-firebase/src/crud/updateEntity.ts.example +0 -14
  62. package/templates/root-consumer/guides/COMPONENTS_CRUD.md.example +0 -70
  63. package/templates/root-consumer/guides/SETUP_CRUD.md.example +0 -1244
  64. package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +0 -114
  65. /package/templates/root-consumer/guides/{COMPONENTS_ADV.md.example → dndev/COMPONENTS_ADV.md.example} +0 -0
  66. /package/templates/root-consumer/guides/{COMPONENTS_ATOMIC.md.example → dndev/COMPONENTS_ATOMIC.md.example} +0 -0
  67. /package/templates/root-consumer/guides/{COMPONENTS_UI.md.example → dndev/COMPONENTS_UI.md.example} +0 -0
  68. /package/templates/root-consumer/guides/{ENV_SETUP.md.example → dndev/ENV_SETUP.md.example} +0 -0
  69. /package/templates/root-consumer/guides/{INDEX.md.example → dndev/INDEX.md.example} +0 -0
  70. /package/templates/root-consumer/guides/{SETUP_APP_CONFIG.md.example → dndev/SETUP_APP_CONFIG.md.example} +0 -0
  71. /package/templates/root-consumer/guides/{SETUP_BILLING.md.example → dndev/SETUP_BILLING.md.example} +0 -0
  72. /package/templates/root-consumer/guides/{SETUP_I18N.md.example → dndev/SETUP_I18N.md.example} +0 -0
  73. /package/templates/root-consumer/guides/{SETUP_LAYOUTS.md.example → dndev/SETUP_LAYOUTS.md.example} +0 -0
  74. /package/templates/root-consumer/guides/{SETUP_OAUTH.md.example → dndev/SETUP_OAUTH.md.example} +0 -0
  75. /package/templates/root-consumer/guides/{SETUP_PAGES.md.example → dndev/SETUP_PAGES.md.example} +0 -0
  76. /package/templates/root-consumer/guides/{SETUP_PWA.md.example → dndev/SETUP_PWA.md.example} +0 -0
  77. /package/templates/root-consumer/guides/{SETUP_THEMES.md.example → dndev/SETUP_THEMES.md.example} +0 -0
  78. /package/templates/root-consumer/guides/{USE_ROUTING.md.example → dndev/USE_ROUTING.md.example} +0 -0
  79. /package/templates/root-consumer/guides/{advanced → dndev/advanced}/APP_CHECK.md.example +0 -0
  80. /package/templates/root-consumer/guides/{advanced → dndev/advanced}/COOKIE_REFERENCE.md.example +0 -0
  81. /package/templates/root-consumer/guides/{advanced → dndev/advanced}/EMULATORS.md.example +0 -0
  82. /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.**