@donotdev/cli 0.0.3 → 0.0.4

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 +12 -24
  2. package/dist/bin/commands/bump.d.ts +1 -1
  3. package/dist/bin/commands/format.d.ts +1 -1
  4. package/dist/bin/commands/lint.d.ts +1 -1
  5. package/package.json +1 -9
  6. package/templates/app-demo/src/themes.css.example +108 -156
  7. package/templates/app-next/src/locales/home_en.json.example +6 -0
  8. package/templates/app-next/src/pages/HomePage.tsx.example +152 -8
  9. package/templates/app-next/src/themes.css.example +92 -140
  10. package/templates/app-vite/src/App.tsx.example +2 -2
  11. package/templates/app-vite/src/locales/home_en.json.example +6 -0
  12. package/templates/app-vite/src/pages/HomePage.tsx.example +149 -8
  13. package/templates/app-vite/src/themes.css.example +90 -138
  14. package/templates/root-consumer/guides/AGENT_START_HERE.md.example +83 -61
  15. package/templates/root-consumer/guides/COMPONENTS_ATOMIC.md.example +134 -0
  16. package/templates/root-consumer/guides/COMPONENTS_CRUD.md.example +70 -0
  17. package/templates/root-consumer/guides/COMPONENTS_UI.md.example +135 -0
  18. package/templates/root-consumer/guides/ENV_SETUP.md.example +14 -0
  19. package/templates/root-consumer/guides/INDEX.md.example +17 -25
  20. package/templates/root-consumer/guides/SETUP_AUTH.md.example +77 -0
  21. package/templates/root-consumer/guides/SETUP_BILLING.md.example +78 -0
  22. package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +62 -0
  23. package/templates/root-consumer/guides/SETUP_I18N.md.example +48 -0
  24. package/templates/root-consumer/guides/SETUP_LAYOUTS.md.example +108 -0
  25. package/templates/root-consumer/guides/SETUP_OAUTH.md.example +53 -0
  26. package/templates/root-consumer/guides/SETUP_PAGES.md.example +112 -0
  27. package/templates/root-consumer/guides/SETUP_THEMES.md.example +107 -0
  28. package/templates/root-consumer/guides/advanced/COOKIE_REFERENCE.md.example +252 -0
  29. package/templates/root-consumer/guides/{EMULATOR_SETUP.md.example → advanced/EMULATORS.md.example} +1 -1
  30. package/templates/root-consumer/guides/{VERSION_CONTROL.md.example → advanced/VERSION_CONTROL.md.example} +0 -7
  31. package/templates/root-consumer/guides/AUTH_SETUP.md.example +0 -92
  32. package/templates/root-consumer/guides/BILLING_SETUP.md.example +0 -120
  33. package/templates/root-consumer/guides/CLI.md.example +0 -293
  34. package/templates/root-consumer/guides/COMPONENTS.md.example +0 -875
  35. package/templates/root-consumer/guides/FEATURES.md.example +0 -286
  36. package/templates/root-consumer/guides/FRAMEWORK_OVERVIEW.md.example +0 -97
  37. package/templates/root-consumer/guides/FUNCTIONS.md.example +0 -177
  38. package/templates/root-consumer/guides/GETTING_STARTED.md.example +0 -451
  39. package/templates/root-consumer/guides/HOW_TO_USE.md.example +0 -296
  40. package/templates/root-consumer/guides/I18N_SETUP.md.example +0 -204
  41. package/templates/root-consumer/guides/IMPORT_PATTERNS.md.example +0 -79
  42. package/templates/root-consumer/guides/INSTALLATION.md.example +0 -296
  43. package/templates/root-consumer/guides/LAYOUTS.md.example +0 -310
  44. package/templates/root-consumer/guides/PAGES_SETUP.md.example +0 -123
  45. package/templates/root-consumer/guides/STYLING.md.example +0 -273
  46. package/templates/root-consumer/guides/THEMING_SETUP.md.example +0 -119
  47. /package/templates/root-consumer/guides/{CONFIG_SETUP.md.example → SETUP_APP_CONFIG.md.example} +0 -0
  48. /package/templates/root-consumer/guides/{APP_CHECK_SETUP.md.example → advanced/APP_CHECK.md.example} +0 -0
@@ -1,451 +0,0 @@
1
- # 🚀 Getting Started with DoNotDev Framework
2
-
3
- This guide will help you create your first DoNotDev application from scratch.
4
-
5
- ## Prerequisites
6
-
7
- Before you begin, ensure you have:
8
-
9
- - **Bun** >= 1.3.0 ([install](https://bun.sh/))
10
- - **Node.js** >= 20.19.0 or >= 22.12.0 (LTS)
11
- - **Git** (for version control)
12
- - A GitHub account (for framework access)
13
-
14
- ## Step 1: Install the CLI
15
-
16
- ```bash
17
- # Using npx (temporary)
18
- npx @donotdev/cli create-project
19
-
20
- # Or install globally with Bun
21
- bun add -g @donotdev/cli
22
-
23
- # Or use bunx (recommended)
24
- bunx @donotdev/cli create-project
25
- ```
26
-
27
- ## Choosing Your Features
28
-
29
- Before creating your project, decide what features you need:
30
-
31
- ### Do You Need Billing?
32
-
33
- ```
34
- ┌─────────────────────────────────────────┐
35
- │ Do you need billing/subscriptions? │
36
- └─────────┬───────────────────────────────┘
37
-
38
- ┌─────┴─────┐
39
- │ │
40
- No Yes
41
- │ │
42
- ▼ ▼
43
- ┌────────┐ ┌─────────┐
44
- │ Auth │ │ Auth │
45
- │ Only │ │ + │
46
- │ │ │ Billing │
47
- └────────┘ └─────────┘
48
- │ │
49
- ├───────────┼──────────────────────┐
50
- │ │ │
51
- ▼ ▼ ▼
52
- Internal Subscription One-Time
53
- Tools (Recurring) Payment
54
- Free Apps SaaS Apps Lifetime
55
- MVPs Monthly/Yearly License
56
- ```
57
-
58
- **Auth-Only Apps:**
59
-
60
- - ✅ 49% smaller bundle
61
- - ✅ No Stripe overhead
62
- - ✅ Simpler setup
63
- - ✅ Easy to add billing later
64
- - **Use cases:** Internal tools, free apps, MVPs, prototypes
65
- - **Guide:** [Auth-Only Apps](docs/guides/AUTH_ONLY_APPS.md)
66
-
67
- **Billing-Enabled Apps:**
68
-
69
- - ✅ Full Stripe integration
70
- - ✅ 80-90% less code than manual
71
- - ✅ Webhook handling included
72
- - ✅ Subscription management
73
- - **Use cases:** SaaS products, paid tools, membership sites
74
- - **Guide:** [Billing Quickstart](docs/guides/BILLING_QUICKSTART.md)
75
-
76
- ## Step 2: Create Your Project
77
-
78
- ```bash
79
- # Run the scaffolding command
80
- bunx @donotdev/cli create-project
81
-
82
- # You'll be prompted for:
83
- # - Project name: my-awesome-app
84
- # - Include Firebase Functions: Yes/No
85
- # - App name(s): web, admin (comma-separated)
86
- # - Template for each app: Vite (SPA)
87
- ```
88
-
89
- **Example interaction:**
90
-
91
- ```
92
- 🚀 DoNotDev Project Creator
93
-
94
- ? Project name: my-awesome-app
95
- ? Include Firebase Functions? Yes
96
- ? Configuration mode? Guided (recommended)
97
- ? App name(s): web
98
- ? What are you building? A web application with user accounts
99
- ? Need backend/API? Yes, Firebase
100
- ? User authentication? Yes, email/password
101
- ? Payment/subscriptions? No
102
- ```
103
-
104
- ## Step 3: Navigate and Install
105
-
106
- ```bash
107
- cd my-awesome-app
108
- bun install
109
- ```
110
-
111
- ## Step 4: Configure Environment
112
-
113
- Create `.env` file in your project root:
114
-
115
- ```bash
116
- # Firebase Configuration (if using Firebase)
117
- VITE_FIREBASE_API_KEY=your-api-key
118
- VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
119
- VITE_FIREBASE_PROJECT_ID=your-project-id
120
- VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
121
- VITE_FIREBASE_MESSAGING_SENDER_ID=123456789
122
- VITE_FIREBASE_APP_ID=1:123456789:web:abcdef
123
-
124
- # Stripe Configuration (if using billing)
125
- VITE_STRIPE_PUBLISHABLE_KEY=pk_test_...
126
- STRIPE_SECRET_KEY=sk_test_...
127
- STRIPE_WEBHOOK_SECRET=whsec_...
128
-
129
- # App Configuration
130
- VITE_APP_NAME="My Awesome App"
131
- VITE_APP_URL=http://localhost:5173
132
- ```
133
-
134
- ## Step 5: Start Development
135
-
136
- ```bash
137
- # Start all apps
138
- bun run dev
139
-
140
- # Or start a specific app
141
- bun run dev:web
142
- ```
143
-
144
- Your app should now be running at `http://localhost:5173`!
145
-
146
- **Note:** During the first build, if `logo.svg` is missing, the framework will prompt: "We didn't find a logo.svg. Do you want us to provide one from the framework?" You can say yes, or add your own logo to `public/logo.svg`.
147
-
148
- ## Project Structure Explained
149
-
150
- ```
151
- my-awesome-app/
152
- ├── apps/
153
- │ └── web/ # Your application
154
- │ ├── src/
155
- │ │ ├── pages/ # Routes (auto-discovered)
156
- │ │ │ ├── HomePage.tsx # → /home
157
- │ │ │ ├── AboutPage.tsx # → /about
158
- │ │ │ └── blog/
159
- │ │ │ └── BlogPostPage.tsx # → /blog/:slug
160
- │ │ ├── components/ # Your components
161
- │ │ ├── locales/ # Translation files
162
- │ │ │ ├── home_en.json
163
- │ │ │ ├── home_fr.json
164
- │ │ │ └── ...
165
- │ │ ├── themes.css # Custom themes
166
- │ │ ├── App.tsx # App entry
167
- │ │ └── main.tsx # Vite entry
168
- │ ├── public/ # Static assets
169
- │ ├── functions/ # Backend functions (if enabled, per-app)
170
- │ │ ├── src/
171
- │ │ │ ├── firebase/ # Firebase Cloud Functions
172
- │ │ │ │ └── auth/
173
- │ │ │ │ └── onCreate.ts
174
- │ │ │ └── shared/ # Shared business logic
175
- │ │ └── package.json
176
- │ ├── package.json
177
- │ └── vite.config.ts # Vite configuration
178
- ├── entities/ # Your data models (Valibot schemas, workspace package)
179
- │ ├── package.json # Workspace package (includes valibot from matrix)
180
- │ ├── index.ts
181
- │ ├── user.ts
182
- │ └── post.ts
183
- ├── .env # Environment variables (don't commit!)
184
- ├── .env.example # Example env vars (commit this)
185
- ├── firebase.json # Firebase config (if using Firebase)
186
- ├── turbo.json # Turborepo configuration
187
- └── package.json # Monorepo root
188
- ```
189
-
190
- ## Step 6: Create Your First Page
191
-
192
- ```tsx
193
- // apps/web/src/pages/DashboardPage.tsx
194
- import { PageContainer } from '@donotdev/templates';
195
- import { useAuth } from '@donotdev/auth';
196
-
197
- export function DashboardPage() {
198
- const { user } = useAuth();
199
-
200
- return (
201
- <PageContainer>
202
- <h1>Welcome, {user?.displayName}!</h1>
203
- <p>This is your dashboard.</p>
204
- </PageContainer>
205
- );
206
- }
207
-
208
- // Auto-discovered route: /dashboard
209
- // No configuration needed!
210
- ```
211
-
212
- ## Step 7: Add Translations
213
-
214
- ```json
215
- // apps/web/src/locales/dashboard_en.json
216
- {
217
- "title": "Dashboard",
218
- "welcome": "Welcome, {{name}}!",
219
- "description": "This is your dashboard."
220
- }
221
- ```
222
-
223
- ```tsx
224
- // Use in your component
225
- import { useTranslation } from '@donotdev/core';
226
-
227
- export function DashboardPage() {
228
- const { t } = useTranslation();
229
- const { user } = useAuth();
230
-
231
- return (
232
- <PageContainer>
233
- <h1>{t('dashboard.welcome', { name: user?.displayName })}</h1>
234
- <p>{t('dashboard.description')}</p>
235
- </PageContainer>
236
- );
237
- }
238
- ```
239
-
240
- ## Step 8: Customize Your Theme
241
-
242
- ```css
243
- /* apps/web/src/themes.css */
244
-
245
- /* Extend the default light theme */
246
- .light {
247
- --primary: #3b82f6; /* Your brand color */
248
- --secondary: #10b981;
249
- --background: #ffffff;
250
- --foreground: #0a0a0a;
251
- }
252
-
253
- /* Extend the default dark theme */
254
- .dark {
255
- --primary: #60a5fa;
256
- --secondary: #34d399;
257
- --background: #0a0a0a;
258
- --foreground: #fafafa;
259
- }
260
-
261
- /* Add a custom theme */
262
- .ocean {
263
- --theme-icon: 'Waves'; /* Lucide icon name */
264
- --theme-label: 'Ocean'; /* Display name */
265
- --primary: #0ea5e9;
266
- --secondary: #06b6d4;
267
- --background: #001a33;
268
- --foreground: #e0f2fe;
269
- }
270
- ```
271
-
272
- Users can now switch between light, dark, and ocean themes!
273
-
274
- ## Step 9: Add Dynamic Routes
275
-
276
- ```tsx
277
- // apps/web/src/pages/blog/BlogPostPage.tsx
278
- import type { PageMeta } from '@donotdev/types';
279
- import { useParams } from 'react-router-dom';
280
-
281
- // Define route parameters
282
- export const meta: PageMeta = {
283
- route: { params: ['slug'] }, // Creates /blog/:slug
284
- };
285
-
286
- export function BlogPostPage() {
287
- const { slug } = useParams<{ slug: string }>();
288
-
289
- return (
290
- <article>
291
- <h1>Blog Post: {slug}</h1>
292
- {/* Fetch and display post content */}
293
- </article>
294
- );
295
- }
296
- ```
297
-
298
- ## Step 10: Deploy
299
-
300
- ### Firebase
301
-
302
- ```bash
303
- # Login to Firebase
304
- firebase login
305
-
306
- # Initialize (if not already done)
307
- firebase init
308
-
309
- # Deploy
310
- dndev deploy
311
- ```
312
-
313
- ### Vercel
314
-
315
- ```bash
316
- # Login to Vercel
317
- vercel login
318
-
319
- # Link project
320
- vercel link
321
-
322
- # Deploy
323
- vercel --prod
324
- ```
325
-
326
- ## Common Tasks
327
-
328
- ### Add Authentication
329
-
330
- ```tsx
331
- import { useAuth, LoginPage } from '@donotdev/auth';
332
-
333
- export function ProtectedPage() {
334
- const user = useAuth('user');
335
- const isLoading = useAuth('loading');
336
-
337
- if (isLoading) return <div>Loading...</div>;
338
- if (!user) return <LoginPage />;
339
-
340
- return <div>Protected content for {user.email}</div>;
341
- }
342
- ```
343
-
344
- ### Add Billing
345
-
346
- ```tsx
347
- import { useStripeBilling } from '@donotdev/billing';
348
-
349
- export function UpgradePage() {
350
- const subscription = useStripeBilling('subscription');
351
- const checkout = useStripeBilling('checkout');
352
-
353
- return (
354
- <div>
355
- <h2>Current Plan: {subscription?.planId || 'Free'}</h2>
356
- <button
357
- onClick={() => checkout({ priceId: 'pro', mode: 'subscription' })}
358
- >
359
- Upgrade to Pro
360
- </button>
361
- </div>
362
- );
363
- }
364
- ```
365
-
366
- ### Add a New Language
367
-
368
- 1. Create translation files in `apps/web/src/locales/`:
369
-
370
- ```
371
- home_es.json (Spanish)
372
- about_es.json
373
- dashboard_es.json
374
- ```
375
-
376
- 2. The framework automatically detects and enables the language!
377
-
378
- ### Create CRUD Operations
379
-
380
- ```tsx
381
- import { DataTable, CreateForm, EditForm } from '@donotdev/ui';
382
- import { userSchema } from 'entities/user';
383
-
384
- export function UsersPage() {
385
- return (
386
- <DataTable
387
- entity="users"
388
- schema={userSchema}
389
- columns={['name', 'email', 'role']}
390
- actions={['create', 'edit', 'delete']}
391
- />
392
- );
393
- }
394
- ```
395
-
396
- ## Next Steps
397
-
398
- - **Read the full documentation**: [docs.donotdev.com](https://docs.donotdev.com)
399
- - **Join the community**: [Discord](https://discord.gg/your-invite)
400
- - **Explore the demo app**: `apps/demo` in the framework repository
401
- - **Check CLAUDE.md**: For architecture deep-dive and framework internals
402
-
403
- ## Troubleshooting
404
-
405
- ### "Module not found: @donotdev/..."
406
-
407
- Make sure you ran `bun install` in the project root. The framework uses workspaces.
408
-
409
- ```bash
410
- cd /path/to/your/project
411
- bun install
412
- ```
413
-
414
- ### Firebase deployment fails
415
-
416
- 1. Check you're logged in: `firebase login`
417
- 2. Verify project ID in `.firebaserc`
418
- 3. Ensure functions are built: `bun run build`
419
-
420
- ### Vite dev server not starting
421
-
422
- 1. Check port 5173 isn't already in use
423
- 2. Clear cache: `rm -rf node_modules/.vite`
424
- 3. Reinstall: `bun install`
425
-
426
- ### Type errors in IDE
427
-
428
- 1. Restart TypeScript server in your IDE
429
- 2. Check `tsconfig.json` is properly configured
430
- 3. Run `bun run type-check` to see actual errors
431
-
432
- ## Tips & Tricks
433
-
434
- 1. **Use the demo app as reference** - It showcases all features
435
- 2. **Follow the dependency hierarchy** - Don't import up the chain
436
- 3. **Let the framework handle routing** - Just create pages, routes are auto-discovered
437
- 4. **Use TypeScript** - Full type safety throughout
438
- 5. **Customize via override** - Don't modify framework files directly
439
-
440
- ## Need Help?
441
-
442
- - **Discord**: Real-time help from the community
443
- - **GitHub Issues**: Report bugs or request features
444
- - **Email**: mooti.web.app@gmail.com for licensing questions
445
- - **Documentation**: Comprehensive guides at docs.donotdev.com
446
-
447
- ---
448
-
449
- **Happy coding! 🚀**
450
-
451
- Built something cool? Share it in the Discord community!