@donotdev/cli 0.0.5 → 0.0.6

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 (48) hide show
  1. package/dependencies-matrix.json +57 -33
  2. package/dist/bin/commands/build.js +9 -3
  3. package/dist/bin/commands/bump.js +19 -7
  4. package/dist/bin/commands/cacheout.js +9 -3
  5. package/dist/bin/commands/create-app.js +21 -7
  6. package/dist/bin/commands/create-project.js +22 -7
  7. package/dist/bin/commands/deploy.js +22 -14
  8. package/dist/bin/commands/dev.js +9 -3
  9. package/dist/bin/commands/emu.js +9 -3
  10. package/dist/bin/commands/format.js +9 -3
  11. package/dist/bin/commands/lint.js +9 -3
  12. package/dist/bin/commands/make-admin.d.ts +11 -0
  13. package/dist/bin/commands/make-admin.d.ts.map +1 -0
  14. package/dist/bin/commands/make-admin.js +12 -0
  15. package/dist/bin/commands/make-admin.js.map +1 -0
  16. package/dist/bin/commands/preview.js +9 -3
  17. package/dist/bin/commands/sync-secrets.js +9 -3
  18. package/dist/index.js +33 -17
  19. package/package.json +1 -1
  20. package/templates/app-demo/index.html.example +4 -0
  21. package/templates/app-demo/src/App.tsx.example +28 -10
  22. package/templates/app-demo/src/config/app.ts.example +56 -0
  23. package/templates/app-next/src/app/ClientLayout.tsx.example +4 -3
  24. package/templates/app-next/src/app/layout.tsx.example +17 -25
  25. package/templates/app-next/src/globals.css.example +10 -7
  26. package/templates/app-next/src/locales/dndev_en.json.example +68 -0
  27. package/templates/app-next/src/pages/locales/example_en.json.example +5 -0
  28. package/templates/app-vite/index.html.example +3 -0
  29. package/templates/app-vite/src/globals.css.example +14 -6
  30. package/templates/app-vite/src/locales/dndev_en.json.example +68 -0
  31. package/templates/functions-firebase/README.md.example +25 -0
  32. package/templates/functions-firebase/tsconfig.json.example +3 -13
  33. package/templates/functions-vercel/tsconfig.json.example +1 -13
  34. package/templates/root-consumer/firebase.json.example +1 -1
  35. package/templates/root-consumer/guides/COMPONENTS_ADV.md.example +456 -360
  36. package/templates/root-consumer/guides/COMPONENTS_ATOMIC.md.example +42 -0
  37. package/templates/root-consumer/guides/INDEX.md.example +3 -0
  38. package/templates/root-consumer/guides/SETUP_APP_CONFIG.md.example +5 -2
  39. package/templates/root-consumer/guides/SETUP_BILLING.md.example +44 -4
  40. package/templates/root-consumer/guides/SETUP_CRUD.md.example +1244 -0
  41. package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +52 -0
  42. package/templates/root-consumer/guides/SETUP_PAGES.md.example +17 -0
  43. package/templates/root-consumer/guides/SETUP_PWA.md.example +213 -0
  44. package/templates/root-consumer/guides/USE_ROUTING.md.example +503 -0
  45. package/templates/root-consumer/vercel.json.example +315 -20
  46. package/templates/app-demo/src/Routes.tsx.example +0 -20
  47. package/templates/app-vite/src/Routes.tsx.example +0 -16
  48. package/templates/app-vite/src/pages/locales/README.md.example +0 -1
@@ -1,3 +1,207 @@
1
+ {{#isNextjs}}
2
+ {
3
+ "framework": "nextjs",{{#includeFunctions}}
4
+ "functions": {
5
+ "functions/src/api/**/*.ts": {
6
+ "runtime": "@vercel/node@3"
7
+ }
8
+ },
9
+ "rewrites": [
10
+ {
11
+ "source": "/api/(.*)",
12
+ "destination": "/functions/src/api/$1"
13
+ }
14
+ ],{{/includeFunctions}}
15
+ "headers": [
16
+ {
17
+ "source": "/(.*)",
18
+ "headers": [
19
+ {
20
+ "key": "Content-Security-Policy",
21
+ "value": "default-src 'self'; script-src 'self'{{#needsAuth}} https://accounts.google.com https://apis.google.com{{/needsAuth}}{{#needsBilling}} https://js.stripe.com{{/needsBilling}}; style-src 'self' 'unsafe-inline'{{#needsBilling}} https://fonts.googleapis.com{{/needsBilling}}; img-src 'self' data: blob: https:; font-src 'self' data:{{#needsBilling}} https://fonts.gstatic.com{{/needsBilling}}; connect-src 'self'{{#needsAuth}} https://identitytoolkit.googleapis.com https://securetoken.googleapis.com https://www.googleapis.com https://*.googleapis.com https://{{firebaseProjectId}}.firebaseio.com{{/needsAuth}}{{#needsBilling}} https://api.stripe.com{{/needsBilling}}; frame-src 'none'{{#needsAuth}} https://accounts.google.com{{/needsAuth}}{{#needsBilling}} https://js.stripe.com https://hooks.stripe.com{{/needsBilling}}; object-src 'none'; base-uri 'self'; form-action 'self'; upgrade-insecure-requests"
22
+ },
23
+ {
24
+ "key": "X-Content-Type-Options",
25
+ "value": "nosniff"
26
+ },
27
+ {
28
+ "key": "X-Frame-Options",
29
+ "value": "DENY"
30
+ },
31
+ {
32
+ "key": "X-XSS-Protection",
33
+ "value": "1; mode=block"
34
+ },
35
+ {
36
+ "key": "Referrer-Policy",
37
+ "value": "strict-origin-when-cross-origin"
38
+ },
39
+ {
40
+ "key": "Permissions-Policy",
41
+ "value": "geolocation=(), microphone=(), camera=()"
42
+ }
43
+ ]
44
+ },
45
+ {
46
+ "source": "/assets/:path*.woff",
47
+ "headers": [
48
+ {
49
+ "key": "Cache-Control",
50
+ "value": "public, max-age=31536000, immutable"
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ "source": "/assets/:path*.woff2",
56
+ "headers": [
57
+ {
58
+ "key": "Cache-Control",
59
+ "value": "public, max-age=31536000, immutable"
60
+ }
61
+ ]
62
+ },
63
+ {
64
+ "source": "/assets/:path*.ttf",
65
+ "headers": [
66
+ {
67
+ "key": "Cache-Control",
68
+ "value": "public, max-age=31536000, immutable"
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "source": "/assets/:path*.eot",
74
+ "headers": [
75
+ {
76
+ "key": "Cache-Control",
77
+ "value": "public, max-age=31536000, immutable"
78
+ }
79
+ ]
80
+ },
81
+ {
82
+ "source": "/assets/:path*.js",
83
+ "headers": [
84
+ {
85
+ "key": "Cache-Control",
86
+ "value": "public, max-age=31536000, immutable"
87
+ }
88
+ ]
89
+ },
90
+ {
91
+ "source": "/assets/:path*.css",
92
+ "headers": [
93
+ {
94
+ "key": "Cache-Control",
95
+ "value": "public, max-age=31536000, immutable"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "source": "/:path*.jpg",
101
+ "headers": [
102
+ {
103
+ "key": "Cache-Control",
104
+ "value": "public, max-age=86400"
105
+ }
106
+ ]
107
+ },
108
+ {
109
+ "source": "/:path*.jpeg",
110
+ "headers": [
111
+ {
112
+ "key": "Cache-Control",
113
+ "value": "public, max-age=86400"
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "source": "/:path*.png",
119
+ "headers": [
120
+ {
121
+ "key": "Cache-Control",
122
+ "value": "public, max-age=86400"
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "source": "/:path*.svg",
128
+ "headers": [
129
+ {
130
+ "key": "Cache-Control",
131
+ "value": "public, max-age=86400"
132
+ }
133
+ ]
134
+ },
135
+ {
136
+ "source": "/:path*.webp",
137
+ "headers": [
138
+ {
139
+ "key": "Cache-Control",
140
+ "value": "public, max-age=86400"
141
+ }
142
+ ]
143
+ },
144
+ {
145
+ "source": "/:path*.ico",
146
+ "headers": [
147
+ {
148
+ "key": "Cache-Control",
149
+ "value": "public, max-age=86400"
150
+ }
151
+ ]
152
+ },
153
+ {
154
+ "source": "/:path*.json",
155
+ "headers": [
156
+ {
157
+ "key": "Cache-Control",
158
+ "value": "public, max-age=3600"
159
+ },
160
+ {
161
+ "key": "Content-Type",
162
+ "value": "application/json; charset=utf-8"
163
+ }
164
+ ]
165
+ }{{#includeFunctions}},
166
+ {
167
+ "source": "/api/(.*)",
168
+ "headers": [
169
+ {
170
+ "key": "Access-Control-Allow-Origin",
171
+ "value": "*"
172
+ },
173
+ {
174
+ "key": "Access-Control-Allow-Methods",
175
+ "value": "GET, POST, PUT, DELETE, OPTIONS, PATCH"
176
+ },
177
+ {
178
+ "key": "Access-Control-Allow-Headers",
179
+ "value": "Content-Type, Authorization, X-Requested-With, X-Stripe-Signature"
180
+ },
181
+ {
182
+ "key": "Access-Control-Allow-Credentials",
183
+ "value": "true"
184
+ },
185
+ {
186
+ "key": "Access-Control-Max-Age",
187
+ "value": "86400"
188
+ }
189
+ ]
190
+ }{{/includeFunctions}}
191
+ ]{{#includeFunctions}},
192
+ "env": {
193
+ "STRIPE_SECRET_KEY": "@stripe-secret-key",
194
+ "STRIPE_WEBHOOK_SECRET": "@stripe-webhook-secret",
195
+ "STRIPE_PUBLISHABLE_KEY": "@stripe-publishable-key",
196
+ "FIREBASE_ADMIN_PRIVATE_KEY": "@firebase-admin-private-key",
197
+ "FIREBASE_PROJECT_ID": "@firebase-project-id",
198
+ "FIREBASE_CLIENT_EMAIL": "@firebase-client-email"{{#needsOAuth}},
199
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "@github-token",
200
+ "GITHUB_REPO_OWNER": "@github-repo-owner",
201
+ "GITHUB_REPO_NAME": "@github-repo-name"{{/needsOAuth}}
202
+ }{{/includeFunctions}}
203
+ }
204
+ {{/isNextjs}}{{^isNextjs}}
1
205
  {
2
206
  "buildCommand": "bun run build",
3
207
  "outputDirectory": "dist",
@@ -27,13 +231,9 @@
27
231
  {
28
232
  "source": "/(.*)",
29
233
  "headers": [
30
- {
31
- "key": "Access-Control-Allow-Origin",
32
- "value": "*"
33
- },
34
234
  {
35
235
  "key": "Content-Security-Policy",
36
- "value": "default-src 'self'; script-src 'self' https://accounts.google.com https://apis.google.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; connect-src 'self' https://identitytoolkit.googleapis.com https://securetoken.googleapis.com https://www.googleapis.com https://*.googleapis.com https://{{firebaseProjectId}}.firebaseio.com; frame-src 'self' https://accounts.google.com"
236
+ "value": "default-src 'self'; script-src 'self'{{#needsAuth}} https://accounts.google.com https://apis.google.com{{/needsAuth}}{{#needsBilling}} https://js.stripe.com{{/needsBilling}}; style-src 'self' 'unsafe-inline'{{#needsBilling}} https://fonts.googleapis.com{{/needsBilling}}; img-src 'self' data: blob: https:; font-src 'self' data:{{#needsBilling}} https://fonts.gstatic.com{{/needsBilling}}; connect-src 'self'{{#needsAuth}} https://identitytoolkit.googleapis.com https://securetoken.googleapis.com https://www.googleapis.com https://*.googleapis.com https://{{firebaseProjectId}}.firebaseio.com{{/needsAuth}}{{#needsBilling}} https://api.stripe.com{{/needsBilling}}; frame-src 'none'{{#needsAuth}} https://accounts.google.com{{/needsAuth}}{{#needsBilling}} https://js.stripe.com https://hooks.stripe.com{{/needsBilling}}; object-src 'none'; base-uri 'self'; form-action 'self'; upgrade-insecure-requests"
37
237
  },
38
238
  {
39
239
  "key": "X-Content-Type-Options",
@@ -46,45 +246,135 @@
46
246
  {
47
247
  "key": "X-XSS-Protection",
48
248
  "value": "1; mode=block"
249
+ },
250
+ {
251
+ "key": "Referrer-Policy",
252
+ "value": "strict-origin-when-cross-origin"
253
+ },
254
+ {
255
+ "key": "Permissions-Policy",
256
+ "value": "geolocation=(), microphone=(), camera=()"
49
257
  }
50
258
  ]
51
259
  },
52
260
  {
53
- "source": "/assets/**/*.@(woff|woff2|ttf|eot)",
261
+ "source": "/assets/:path*.woff",
54
262
  "headers": [
55
263
  {
56
264
  "key": "Cache-Control",
57
265
  "value": "public, max-age=31536000, immutable"
58
- },
266
+ }
267
+ ]
268
+ },
269
+ {
270
+ "source": "/assets/:path*.woff2",
271
+ "headers": [
59
272
  {
60
- "key": "Access-Control-Allow-Origin",
61
- "value": "*"
273
+ "key": "Cache-Control",
274
+ "value": "public, max-age=31536000, immutable"
62
275
  }
63
276
  ]
64
277
  },
65
278
  {
66
- "source": "/assets/**/*.@(js|css)",
279
+ "source": "/assets/:path*.ttf",
67
280
  "headers": [
68
281
  {
69
282
  "key": "Cache-Control",
70
283
  "value": "public, max-age=31536000, immutable"
71
- },
284
+ }
285
+ ]
286
+ },
287
+ {
288
+ "source": "/assets/:path*.eot",
289
+ "headers": [
72
290
  {
73
- "key": "Access-Control-Allow-Origin",
74
- "value": "*"
291
+ "key": "Cache-Control",
292
+ "value": "public, max-age=31536000, immutable"
293
+ }
294
+ ]
295
+ },
296
+ {
297
+ "source": "/assets/:path*.js",
298
+ "headers": [
299
+ {
300
+ "key": "Cache-Control",
301
+ "value": "public, max-age=31536000, immutable"
302
+ }
303
+ ]
304
+ },
305
+ {
306
+ "source": "/assets/:path*.css",
307
+ "headers": [
308
+ {
309
+ "key": "Cache-Control",
310
+ "value": "public, max-age=31536000, immutable"
311
+ }
312
+ ]
313
+ },
314
+ {
315
+ "source": "/:path*.jpg",
316
+ "headers": [
317
+ {
318
+ "key": "Cache-Control",
319
+ "value": "public, max-age=86400"
75
320
  }
76
321
  ]
77
322
  },
78
323
  {
79
- "source": "**/*.@(jpg|jpeg|gif|png|svg|webp|ico)",
324
+ "source": "/:path*.jpeg",
80
325
  "headers": [
81
326
  {
82
327
  "key": "Cache-Control",
83
- "value": "no-cache, no-store, must-revalidate"
328
+ "value": "public, max-age=86400"
329
+ }
330
+ ]
331
+ },
332
+ {
333
+ "source": "/:path*.png",
334
+ "headers": [
335
+ {
336
+ "key": "Cache-Control",
337
+ "value": "public, max-age=86400"
338
+ }
339
+ ]
340
+ },
341
+ {
342
+ "source": "/:path*.svg",
343
+ "headers": [
344
+ {
345
+ "key": "Cache-Control",
346
+ "value": "public, max-age=86400"
347
+ }
348
+ ]
349
+ },
350
+ {
351
+ "source": "/:path*.webp",
352
+ "headers": [
353
+ {
354
+ "key": "Cache-Control",
355
+ "value": "public, max-age=86400"
356
+ }
357
+ ]
358
+ },
359
+ {
360
+ "source": "/:path*.ico",
361
+ "headers": [
362
+ {
363
+ "key": "Cache-Control",
364
+ "value": "public, max-age=86400"
365
+ }
366
+ ]
367
+ },
368
+ {
369
+ "source": "/:path*.json",
370
+ "headers": [
371
+ {
372
+ "key": "Cache-Control",
373
+ "value": "public, max-age=3600"
84
374
  },
85
375
  {
86
- "key": "Access-Control-Allow-Origin",
87
- "value": "*"
376
+ "key": "Content-Type",
377
+ "value": "application/json; charset=utf-8"
88
378
  }
89
379
  ]
90
380
  }{{#includeFunctions}},
@@ -97,11 +387,11 @@
97
387
  },
98
388
  {
99
389
  "key": "Access-Control-Allow-Methods",
100
- "value": "GET, POST, PUT, DELETE, OPTIONS"
390
+ "value": "GET, POST, PUT, DELETE, OPTIONS, PATCH"
101
391
  },
102
392
  {
103
393
  "key": "Access-Control-Allow-Headers",
104
- "value": "Content-Type, Authorization, X-Requested-With"
394
+ "value": "Content-Type, Authorization, X-Requested-With, X-Stripe-Signature"
105
395
  },
106
396
  {
107
397
  "key": "Access-Control-Allow-Credentials",
@@ -117,8 +407,13 @@
117
407
  "env": {
118
408
  "STRIPE_SECRET_KEY": "@stripe-secret-key",
119
409
  "STRIPE_WEBHOOK_SECRET": "@stripe-webhook-secret",
410
+ "STRIPE_PUBLISHABLE_KEY": "@stripe-publishable-key",
120
411
  "FIREBASE_ADMIN_PRIVATE_KEY": "@firebase-admin-private-key",
121
412
  "FIREBASE_PROJECT_ID": "@firebase-project-id",
122
- "FIREBASE_CLIENT_EMAIL": "@firebase-client-email"
413
+ "FIREBASE_CLIENT_EMAIL": "@firebase-client-email"{{#needsOAuth}},
414
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "@github-token",
415
+ "GITHUB_REPO_OWNER": "@github-repo-owner",
416
+ "GITHUB_REPO_NAME": "@github-repo-name"{{/needsOAuth}}
123
417
  }{{/includeFunctions}}
124
418
  }
419
+ {{/isNextjs}}
@@ -1,20 +0,0 @@
1
- // apps/demo/src/Routes.tsx
2
-
3
- import { Routes as RouterRoutes, Route } from 'react-router-dom';
4
-
5
- import { LayoutRoute } from './pages/components/LayoutRoute';
6
- import HomePage from './pages/HomePage';
7
- import FullPage from './pages/FullPage';
8
- import DetailPage from './pages/DetailPage';
9
-
10
- export function Routes() {
11
- return (
12
- <RouterRoutes>
13
- <Route element={<LayoutRoute />}>
14
- <Route path="/" element={<HomePage />} />
15
- <Route path="/component/:id" element={<DetailPage />} />
16
- <Route path="/full" element={<FullPage />} />
17
- </Route>
18
- </RouterRoutes>
19
- );
20
- }
@@ -1,16 +0,0 @@
1
-
2
- import { Routes as RouterRoutes, Route } from 'react-router-dom';
3
-
4
- // Import your pages
5
- import HomePage from './pages/HomePage';
6
-
7
-
8
- export function Routes() {
9
- return (
10
- <RouterRoutes>
11
- {/* Public routes */}
12
- <Route path="/" element={<HomePage />} />
13
- {/* Protected routes */}
14
- </RouterRoutes>
15
- );
16
- }