@donotdev/cli 0.0.6 → 0.0.8

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