@donotdev/cli 0.0.3 → 0.0.5

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 (55) hide show
  1. package/dependencies-matrix.json +194 -110
  2. package/dist/bin/commands/bump.d.ts +1 -1
  3. package/dist/bin/commands/bump.js +103 -96
  4. package/dist/bin/commands/create-app.js +40 -28
  5. package/dist/bin/commands/create-project.js +40 -28
  6. package/dist/bin/commands/format.d.ts +1 -1
  7. package/dist/bin/commands/lint.d.ts +1 -1
  8. package/dist/index.js +40 -28
  9. package/package.json +1 -9
  10. package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +5 -5
  11. package/templates/app-demo/src/themes.css.example +108 -156
  12. package/templates/app-next/src/app/ClientLayout.tsx.example +1 -1
  13. package/templates/app-next/src/locales/home_en.json.example +6 -0
  14. package/templates/app-next/src/pages/HomePage.tsx.example +152 -8
  15. package/templates/app-next/src/themes.css.example +92 -140
  16. package/templates/app-vite/src/App.tsx.example +3 -3
  17. package/templates/app-vite/src/locales/home_en.json.example +6 -0
  18. package/templates/app-vite/src/pages/HomePage.tsx.example +149 -8
  19. package/templates/app-vite/src/themes.css.example +90 -138
  20. package/templates/root-consumer/guides/AGENT_START_HERE.md.example +297 -53
  21. package/templates/root-consumer/guides/COMPONENTS_ADV.md.example +360 -0
  22. package/templates/root-consumer/guides/COMPONENTS_ATOMIC.md.example +134 -0
  23. package/templates/root-consumer/guides/COMPONENTS_CRUD.md.example +70 -0
  24. package/templates/root-consumer/guides/COMPONENTS_UI.md.example +141 -0
  25. package/templates/root-consumer/guides/ENV_SETUP.md.example +14 -0
  26. package/templates/root-consumer/guides/INDEX.md.example +17 -25
  27. package/templates/root-consumer/guides/SETUP_AUTH.md.example +77 -0
  28. package/templates/root-consumer/guides/SETUP_BILLING.md.example +78 -0
  29. package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +62 -0
  30. package/templates/root-consumer/guides/SETUP_I18N.md.example +187 -0
  31. package/templates/root-consumer/guides/SETUP_LAYOUTS.md.example +126 -0
  32. package/templates/root-consumer/guides/SETUP_OAUTH.md.example +53 -0
  33. package/templates/root-consumer/guides/SETUP_PAGES.md.example +120 -0
  34. package/templates/root-consumer/guides/SETUP_THEMES.md.example +107 -0
  35. package/templates/root-consumer/guides/advanced/COOKIE_REFERENCE.md.example +252 -0
  36. package/templates/root-consumer/guides/{EMULATOR_SETUP.md.example → advanced/EMULATORS.md.example} +1 -1
  37. package/templates/root-consumer/guides/{VERSION_CONTROL.md.example → advanced/VERSION_CONTROL.md.example} +0 -7
  38. package/templates/root-consumer/guides/AUTH_SETUP.md.example +0 -92
  39. package/templates/root-consumer/guides/BILLING_SETUP.md.example +0 -120
  40. package/templates/root-consumer/guides/CLI.md.example +0 -293
  41. package/templates/root-consumer/guides/COMPONENTS.md.example +0 -875
  42. package/templates/root-consumer/guides/FEATURES.md.example +0 -286
  43. package/templates/root-consumer/guides/FRAMEWORK_OVERVIEW.md.example +0 -97
  44. package/templates/root-consumer/guides/FUNCTIONS.md.example +0 -177
  45. package/templates/root-consumer/guides/GETTING_STARTED.md.example +0 -451
  46. package/templates/root-consumer/guides/HOW_TO_USE.md.example +0 -296
  47. package/templates/root-consumer/guides/I18N_SETUP.md.example +0 -204
  48. package/templates/root-consumer/guides/IMPORT_PATTERNS.md.example +0 -79
  49. package/templates/root-consumer/guides/INSTALLATION.md.example +0 -296
  50. package/templates/root-consumer/guides/LAYOUTS.md.example +0 -310
  51. package/templates/root-consumer/guides/PAGES_SETUP.md.example +0 -123
  52. package/templates/root-consumer/guides/STYLING.md.example +0 -273
  53. package/templates/root-consumer/guides/THEMING_SETUP.md.example +0 -119
  54. /package/templates/root-consumer/guides/{CONFIG_SETUP.md.example → SETUP_APP_CONFIG.md.example} +0 -0
  55. /package/templates/root-consumer/guides/{APP_CHECK_SETUP.md.example → advanced/APP_CHECK.md.example} +0 -0
@@ -1,293 +0,0 @@
1
- # DoNotDev CLI Guide
2
-
3
- **Status:** Up to date with implementation.
4
-
5
- **Professional, cross-platform CLI for DoNotDev framework**
6
-
7
- ## Installation
8
-
9
- ```bash
10
- bun install -g @donotdev/cli
11
- ```
12
-
13
- ## Getting Started
14
-
15
- ### Initialize a New Project
16
-
17
- ```bash
18
- dndev init [project-name]
19
- ```
20
-
21
- Creates a new DoNotDev project. If no name is provided, creates in current directory.
22
-
23
- ```bash
24
- cd my-project
25
- bun install
26
- ```
27
-
28
- ## App Commands
29
-
30
- All app commands support smart app detection:
31
-
32
- ### Development
33
-
34
- ```bash
35
- # Launch specific app in development mode
36
- dndev dev:my-app
37
-
38
- # If only one app exists, you can omit the app name
39
- dndev dev
40
-
41
- # If multiple apps exist, you'll be prompted to choose
42
- dndev dev
43
- # ? Select app: (Use arrow keys)
44
- # > my-app
45
- # admin-panel
46
- # landing-page
47
- ```
48
-
49
- The CLI automatically detects your Vite app and runs the dev server.
50
-
51
- ### Development with Emulators
52
-
53
- ```bash
54
- # Launch app with Firebase emulators
55
- dndev emu:my-app
56
-
57
- # Smart detection works here too
58
- dndev emu
59
- ```
60
-
61
- ### Build
62
-
63
- ```bash
64
- # Build specific app for production (prompts for frontend/functions/both)
65
- dndev build:my-app
66
-
67
- # Build with explicit type
68
- dndev build:my-app:front # Frontend only
69
- dndev build:my-app:func # Functions only
70
- dndev build:my-app:both # Both frontend and functions
71
-
72
- # Smart detection
73
- dndev build
74
- ```
75
-
76
- **Build prompts:**
77
-
78
- - If app has both frontend and functions:
79
- ```
80
- ? What would you like to build?
81
- > Frontend only
82
- Functions only
83
- Both (frontend + functions)
84
- ```
85
- - If app has only frontend or only functions, builds automatically
86
-
87
- ### Preview
88
-
89
- ```bash
90
- # Preview production build (builds if needed)
91
- dndev preview:my-app
92
-
93
- # Smart detection
94
- dndev preview
95
- ```
96
-
97
- ### Deploy
98
-
99
- ```bash
100
- # Deploy app (asks what to deploy if both frontend and functions exist)
101
- dndev deploy:my-app
102
-
103
- # Smart detection
104
- dndev deploy
105
- ```
106
-
107
- **Deployment prompts:**
108
-
109
- - If app has both frontend and functions:
110
- ```
111
- ? What would you like to deploy?
112
- > Frontend only
113
- Functions only
114
- Both (frontend + functions)
115
- ```
116
- - If app has only frontend or only functions, deploys automatically
117
-
118
- ## Utility Commands
119
-
120
- ### Format Code
121
-
122
- ```bash
123
- dndev format
124
- ```
125
-
126
- Formats code according to framework standards.
127
-
128
- ### Clean
129
-
130
- ```bash
131
- dndev clean
132
- ```
133
-
134
- Removes build artifacts, caches, and `node_modules`. Use when troubleshooting build issues, then it'll bun install
135
-
136
- ### Clear Caches
137
-
138
- ```bash
139
- dndev cacheout
140
- ```
141
-
142
- Clears build caches (`.turbo`, `.next`, `dist`, .vite, tsconfig.json.buildinfo, ...) without removing `node_modules`. Faster than `clean`.
143
- Use when you've made many changes to your app to make sure you don't have stale code.
144
-
145
- ### Lint
146
-
147
- ```bash
148
- # Check for linting issues
149
- dndev lint
150
-
151
- # Auto-fix linting issues
152
- dndev lint:fix
153
- ```
154
-
155
- ## Smart App Detection
156
-
157
- The CLI automatically detects apps in your project:
158
-
159
- 1. **Single app**: Commands work without specifying app name
160
-
161
- ```bash
162
- dndev dev # Uses the only app automatically
163
- ```
164
-
165
- 2. **Multiple apps**: CLI prompts you to choose
166
-
167
- ```bash
168
- dndev dev
169
- # ? Select app:
170
- # > my-app
171
- # admin-panel
172
- ```
173
-
174
- 3. **Explicit app name**: Always works
175
- ```bash
176
- dndev dev:my-app # Always uses my-app
177
- ```
178
-
179
- ## App Detection Logic
180
-
181
- The CLI looks for apps in:
182
-
183
- - `apps/*/package.json` (monorepo structure)
184
- - `package.json` with `name` matching app pattern (single app projects)
185
-
186
- For each app, it detects:
187
-
188
- - **Framework**: Vite (SPA)
189
- - **Backend**: Whether functions directory exists
190
- - **Platform**: Firebase or Vercel (from config files)
191
-
192
- ## Examples
193
-
194
- ### Monorepo with Multiple Apps
195
-
196
- ```bash
197
- # Project structure:
198
- # apps/
199
- # ├── web/ (Vite app)
200
- # ├── admin/ (Vite app)
201
- # └── api/ (Functions only)
202
-
203
- # Develop web app
204
- dndev dev:web
205
-
206
- # Deploy admin app
207
- dndev deploy:admin
208
- # ? What would you like to deploy?
209
- # > Frontend only
210
- # Functions only
211
- # Both
212
-
213
- # Build all (if you have a build:all script)
214
- dndev build
215
- # ? Select app: web
216
- ```
217
-
218
- ### Single App Project
219
-
220
- ```bash
221
- # Project structure:
222
- # package.json
223
- # src/
224
- # functions/
225
-
226
- # All commands work without app name
227
- dndev dev # Automatically uses the app
228
- dndev build # Automatically uses the app
229
- dndev deploy # Automatically uses the app
230
- ```
231
-
232
- ## Cross-Platform Support
233
-
234
- The CLI works seamlessly on:
235
-
236
- - ✅ Windows (PowerShell, CMD)
237
- - ✅ Windows Subsystem for Linux (WSL)
238
- - ✅ macOS
239
- - ✅ Linux
240
-
241
- All commands use cross-platform path handling and work identically across platforms.
242
-
243
- ## Error Handling
244
-
245
- The CLI provides clear error messages:
246
-
247
- ```bash
248
- $ dndev dev:non-existent
249
- ❌ App "non-existent" not found.
250
-
251
- Available apps:
252
- - my-app
253
- - admin-panel
254
-
255
- Run 'dndev dev' to select interactively.
256
- ```
257
-
258
- ## Best Practices
259
-
260
- 1. **Use smart detection**: Omit app names when working with a single app
261
- 2. **Be explicit in CI/CD**: Always specify app names in scripts
262
- 3. **Use cacheout**: Clear caches before troubleshooting instead of full clean
263
- 4. **Format before commit**: Run `dndev format` before committing code
264
-
265
- ## Advanced Usage
266
-
267
- ### Environment Variables
268
-
269
- The CLI respects environment variables:
270
-
271
- ```bash
272
- # Skip build during deploy
273
- SKIP_BUILD=true dndev deploy:my-app
274
-
275
- # Verbose output
276
- VERBOSE=true dndev build:my-app
277
- ```
278
-
279
- ### Custom Scripts
280
-
281
- You can still use `package.json` scripts directly:
282
-
283
- ```bash
284
- bun run dev:my-app
285
- bun run build:my-app
286
- ```
287
-
288
- But `dndev` commands provide:
289
-
290
- - Cross-platform compatibility
291
- - Smart app detection
292
- - Consistent interface
293
- - Better error messages