@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
@@ -22,6 +22,7 @@ These are the only ways one should handle layout to get to quick results functio
22
22
  ## Content Components
23
23
 
24
24
  - **Card** - Premium card component with title, content, footer, and elevation variants.
25
+ - **Navigation with middle-click support:** Wrap Card in Link component for navigation that supports middle-click (opens in new tab). See navigation section below.
25
26
  - **DualCard** - Side-by-side card layout for comparison or feature showcases.
26
27
  - **Text** - Typography component with semantic text variants.
27
28
  - **Blockquote** - Styled blockquote for citations and testimonials.
@@ -130,5 +131,46 @@ These are the only ways one should handle layout to get to quick results functio
130
131
 
131
132
  **See also:** [COMPONENTS_UI.md](./COMPONENTS_UI.md) for layout/composition components | [COMPONENTS_CRUD.md](./COMPONENTS_CRUD.md) for CRUD operations and entity forms
132
133
 
134
+ ---
135
+
136
+ ## Navigation with Card Component
137
+
138
+ **For clickable cards with navigation support (including middle-click):**
139
+
140
+ Wrap Card in Link component from `@donotdev/ui`:
141
+
142
+ ```tsx
143
+ import { Card } from '@donotdev/components';
144
+ import { Link } from '@donotdev/ui';
145
+
146
+ // Card with navigation (supports middle-click)
147
+ <Link
148
+ path="/about"
149
+ style={{ display: 'block', textDecoration: 'none', height: '100%' }}
150
+ aria-label="Learn more about About"
151
+ >
152
+ <Card
153
+ title="About"
154
+ subtitle="Learn more about us"
155
+ content="Click to navigate"
156
+ />
157
+ </Link>
158
+
159
+ // Card with onClick only (no middle-click support)
160
+ <Card
161
+ title="Action Card"
162
+ onClick={() => handleAction()}
163
+ />
164
+ ```
165
+
166
+ **Why wrap in Link?**
167
+ - Card component is standalone and not routing-aware
168
+ - Link wrapper provides framework navigation (SPA routing, keeps outlet context)
169
+ - Native browser middle-click support (opens in new tab)
170
+ - CSR/SSR safe
171
+
172
+ **Alternative:** Use FeatureCard from `@donotdev/ui` which handles this automatically when `href` prop is provided.
173
+
174
+ ---
133
175
 
134
176
  **All props documented in JSDoc** - Hover in IDE for complete reference.
@@ -7,6 +7,7 @@
7
7
  ## Core Setup
8
8
 
9
9
  - [SETUP_PAGES.md](./SETUP_PAGES.md) - Pages & routing (pre-configured)
10
+ - [USE_ROUTING.md](./USE_ROUTING.md) - **Routing components & hooks (CRITICAL)**
10
11
  - [SETUP_APP_CONFIG.md](./SETUP_APP_CONFIG.md) - App + Vite configuration
11
12
  - [SETUP_I18N.md](./SETUP_I18N.md) - Translations (pre-configured)
12
13
  - [SETUP_THEMES.md](./SETUP_THEMES.md) - Themes & CSS variables (pre-configured)
@@ -16,9 +17,11 @@
16
17
 
17
18
  ## Feature Setup
18
19
 
20
+ - [SETUP_CRUD.md](./SETUP_CRUD.md) - CRUD operations & data access (critical)
19
21
  - [SETUP_AUTH.md](./SETUP_AUTH.md) - Authentication (pre-configured)
20
22
  - [SETUP_OAUTH.md](./SETUP_OAUTH.md) - OAuth connections (pre-configured)
21
23
  - [SETUP_BILLING.md](./SETUP_BILLING.md) - Stripe subscriptions (pre-configured)
24
+ - [SETUP_PWA.md](./SETUP_PWA.md) - Progressive Web App setup
22
25
  - [SETUP_FUNCTIONS.md](./SETUP_FUNCTIONS.md) - Firebase Functions (pre-configured)
23
26
 
24
27
  ---
@@ -13,6 +13,8 @@ import type { AppConfig } from '@donotdev/core';
13
13
  export const appConfig: AppConfig = {
14
14
  app: {
15
15
  name: 'My App',
16
+ shortName: 'App', // Required for PWA
17
+ description: 'My app description', // Required for PWA
16
18
  url: 'https://myapp.com',
17
19
  },
18
20
 
@@ -93,9 +95,10 @@ export default defineViteConfig({
93
95
  generateSitemap: true,
94
96
  },
95
97
 
96
- // PWA
98
+ // PWA (see SETUP_PWA.md for full guide)
97
99
  pwa: {
98
- enabled: false,
100
+ enabled: false, // Enable PWA in production
101
+ devEnabled: false, // Enable PWA in development (optional)
99
102
  },
100
103
  });
101
104
  ```
@@ -1,6 +1,6 @@
1
1
  # Setup: Billing
2
2
 
3
- **Most is pre-configured.** Create Stripe config files. Framework handles checkout, webhooks, subscriptions.
3
+ **Most is pre-configured.** Create Stripe config files. Framework handles checkout, webhooks, subscriptions, and loading UX.
4
4
 
5
5
  ---
6
6
 
@@ -24,6 +24,36 @@ STRIPE_WEBHOOK_SECRET=whsec_xxx
24
24
 
25
25
  ---
26
26
 
27
+ ## Automatic UX (Zero Config)
28
+
29
+ **The hook handles loading overlays automatically for redirect operations:**
30
+
31
+ ```tsx
32
+ // Just call the method - framework handles the rest
33
+ const checkout = useStripeBilling('checkout', authState);
34
+ const openCustomerPortal = useStripeBilling('openCustomerPortal', authState);
35
+
36
+ // Checkout → Shows "Redirecting to Stripe" / "Initializing secure payment..."
37
+ await checkout({ priceId: 'price_123', mode: 'payment' });
38
+
39
+ // Portal → Shows "Redirecting to Stripe" / "Opening billing portal..."
40
+ await openCustomerPortal();
41
+ ```
42
+
43
+ **What happens automatically:**
44
+ - Blocking fullscreen overlay during Firebase Functions cold start
45
+ - Operation-specific messaging (checkout vs portal)
46
+ - Translated in all 8 supported languages
47
+ - Clean removal on redirect or error
48
+
49
+ **Optional:** Use `loading` state if you want to disable your own buttons:
50
+ ```tsx
51
+ const loading = useStripeBilling('loading', authState);
52
+ <Button disabled={loading}>Purchase</Button>
53
+ ```
54
+
55
+ ---
56
+
27
57
  ## Advanced: Frontend Config
28
58
 
29
59
  ```typescript
@@ -69,10 +99,20 @@ import { useStripeBilling } from '@donotdev/billing';
69
99
  import { SubscriptionTemplate, PaymentTemplate } from '@donotdev/templates';
70
100
  import { ProductCard, SubscriptionManager } from '@donotdev/billing';
71
101
 
72
- const checkout = useStripeBilling('checkout');
73
- await checkout({ priceId: 'price_123', mode: 'subscription' });
102
+ // Auth state required
103
+ const user = useAuth('user');
104
+ const status = useAuth('status');
105
+ const authState = { user, status };
106
+
107
+ // Methods - framework handles overlay automatically
108
+ const checkout = useStripeBilling('checkout', authState);
109
+ const openCustomerPortal = useStripeBilling('openCustomerPortal', authState);
110
+
111
+ // Optional state access
112
+ const loading = useStripeBilling('loading', authState);
113
+ const error = useStripeBilling('error', authState);
74
114
  ```
75
115
 
76
116
  ---
77
117
 
78
- **Create config files, get billing. Framework handles the rest.**
118
+ **Create config files, get billing with best-in-class UX. Framework handles the rest.**