@donotdev/cli 0.0.3
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.
- package/LICENSE.md +48 -0
- package/README.md +291 -0
- package/dependencies-matrix.json +694 -0
- package/dist/bin/commands/build.d.ts +11 -0
- package/dist/bin/commands/build.d.ts.map +1 -0
- package/dist/bin/commands/build.js +8162 -0
- package/dist/bin/commands/build.js.map +1 -0
- package/dist/bin/commands/bump.d.ts +11 -0
- package/dist/bin/commands/bump.d.ts.map +1 -0
- package/dist/bin/commands/bump.js +8004 -0
- package/dist/bin/commands/bump.js.map +1 -0
- package/dist/bin/commands/cacheout.d.ts +11 -0
- package/dist/bin/commands/cacheout.d.ts.map +1 -0
- package/dist/bin/commands/cacheout.js +7630 -0
- package/dist/bin/commands/cacheout.js.map +1 -0
- package/dist/bin/commands/create-app.d.ts +11 -0
- package/dist/bin/commands/create-app.d.ts.map +1 -0
- package/dist/bin/commands/create-app.js +9032 -0
- package/dist/bin/commands/create-app.js.map +1 -0
- package/dist/bin/commands/create-project.d.ts +11 -0
- package/dist/bin/commands/create-project.d.ts.map +1 -0
- package/dist/bin/commands/create-project.js +9643 -0
- package/dist/bin/commands/create-project.js.map +1 -0
- package/dist/bin/commands/deploy.d.ts +11 -0
- package/dist/bin/commands/deploy.d.ts.map +1 -0
- package/dist/bin/commands/deploy.js +9007 -0
- package/dist/bin/commands/deploy.js.map +1 -0
- package/dist/bin/commands/dev.d.ts +11 -0
- package/dist/bin/commands/dev.d.ts.map +1 -0
- package/dist/bin/commands/dev.js +7892 -0
- package/dist/bin/commands/dev.js.map +1 -0
- package/dist/bin/commands/emu.d.ts +11 -0
- package/dist/bin/commands/emu.d.ts.map +1 -0
- package/dist/bin/commands/emu.js +8302 -0
- package/dist/bin/commands/emu.js.map +1 -0
- package/dist/bin/commands/format.d.ts +11 -0
- package/dist/bin/commands/format.d.ts.map +1 -0
- package/dist/bin/commands/format.js +8009 -0
- package/dist/bin/commands/format.js.map +1 -0
- package/dist/bin/commands/lint.d.ts +11 -0
- package/dist/bin/commands/lint.d.ts.map +1 -0
- package/dist/bin/commands/lint.js +7481 -0
- package/dist/bin/commands/lint.js.map +1 -0
- package/dist/bin/commands/preview.d.ts +11 -0
- package/dist/bin/commands/preview.d.ts.map +1 -0
- package/dist/bin/commands/preview.js +7909 -0
- package/dist/bin/commands/preview.js.map +1 -0
- package/dist/bin/commands/sync-secrets.d.ts +11 -0
- package/dist/bin/commands/sync-secrets.d.ts.map +1 -0
- package/dist/bin/commands/sync-secrets.js +8227 -0
- package/dist/bin/commands/sync-secrets.js.map +1 -0
- package/dist/bin/dndev.js +222 -0
- package/dist/bin/donotdev.js +222 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12820 -0
- package/dist/index.js.map +1 -0
- package/package.json +71 -0
- package/templates/app-demo/index.html.example +20 -0
- package/templates/app-demo/public/favicon.ico.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-400-cyrillic-ext.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-400-cyrillic.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-400-greek-ext.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-400-greek.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-400-latin-ext.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-400-latin.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-400-vietnamese.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-700-cyrillic-ext.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-700-cyrillic.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-700-greek-ext.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-700-greek.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-700-latin-ext.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-700-latin.woff2.example +0 -0
- package/templates/app-demo/public/fonts/Roboto-700-vietnamese.woff2.example +0 -0
- package/templates/app-demo/public/fonts/fonts.css.example +144 -0
- package/templates/app-demo/public/logo.png.example +0 -0
- package/templates/app-demo/public/logo.svg.example +1 -0
- package/templates/app-demo/public/manifest.json.example +10 -0
- package/templates/app-demo/src/App.tsx.example +17 -0
- package/templates/app-demo/src/Routes.tsx.example +20 -0
- package/templates/app-demo/src/components/ThemeToggle.tsx.example +48 -0
- package/templates/app-demo/src/globals.css.example +4 -0
- package/templates/app-demo/src/main.tsx.example +27 -0
- package/templates/app-demo/src/pages/DetailPage.tsx.example +103 -0
- package/templates/app-demo/src/pages/FullPage.tsx.example +142 -0
- package/templates/app-demo/src/pages/HomePage.tsx.example +79 -0
- package/templates/app-demo/src/pages/components/ComponentRenderer.tsx.example +511 -0
- package/templates/app-demo/src/pages/components/ComponentsData.tsx.example +152 -0
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +266 -0
- package/templates/app-demo/src/pages/components/LayoutRoute.tsx.example +20 -0
- package/templates/app-demo/src/pages/components/componentConfig.ts.example +921 -0
- package/templates/app-demo/src/themes.css.example +179 -0
- package/templates/app-demo/tsconfig.json.example +9 -0
- package/templates/app-demo/vite.config.ts.example +53 -0
- package/templates/app-next/.env.example +92 -0
- package/templates/app-next/next.config.ts.example +8 -0
- package/templates/app-next/postcss.config.js.example +58 -0
- package/templates/app-next/service-account-key.json.example +2 -0
- package/templates/app-next/src/app/ClientLayout.tsx.example +39 -0
- package/templates/app-next/src/app/layout.tsx.example +52 -0
- package/templates/app-next/src/app/not-found.tsx.example +21 -0
- package/templates/app-next/src/config/app.ts.example +75 -0
- package/templates/app-next/src/config/legal.ts.example +170 -0
- package/templates/app-next/src/globals.css.example +15 -0
- package/templates/app-next/src/locales/dndev_en.json.example +516 -0
- package/templates/app-next/src/pages/HomePage.tsx.example +20 -0
- package/templates/app-next/src/pages/legal/LegalNoticePage.tsx.example +75 -0
- package/templates/app-next/src/pages/legal/PrivacyPage.tsx.example +69 -0
- package/templates/app-next/src/pages/legal/TermsPage.tsx.example +71 -0
- package/templates/app-next/src/themes.css.example +179 -0
- package/templates/app-next/tsconfig.json.example +11 -0
- package/templates/app-payload/.env.example +28 -0
- package/templates/app-payload/README.md.example +233 -0
- package/templates/app-payload/collections/Company.ts.example +125 -0
- package/templates/app-payload/collections/Hero.ts.example +62 -0
- package/templates/app-payload/collections/Media.ts.example +41 -0
- package/templates/app-payload/collections/Products.ts.example +115 -0
- package/templates/app-payload/collections/Services.ts.example +104 -0
- package/templates/app-payload/collections/Testimonials.ts.example +92 -0
- package/templates/app-payload/collections/Users.ts.example +35 -0
- package/templates/app-payload/src/server.ts.example +79 -0
- package/templates/app-payload/tsconfig.json.example +24 -0
- package/templates/app-vite/.env.example +77 -0
- package/templates/app-vite/index.html.example +127 -0
- package/templates/app-vite/service-account-key.json.example +2 -0
- package/templates/app-vite/src/App.tsx.example +39 -0
- package/templates/app-vite/src/Routes.tsx.example +16 -0
- package/templates/app-vite/src/config/app.ts.example +75 -0
- package/templates/app-vite/src/config/legal.ts.example +170 -0
- package/templates/app-vite/src/globals.css.example +11 -0
- package/templates/app-vite/src/locales/dndev_en.json.example +516 -0
- package/templates/app-vite/src/main.tsx.example +21 -0
- package/templates/app-vite/src/pages/HomePage.tsx.example +22 -0
- package/templates/app-vite/src/pages/NotFoundPage.tsx.example +33 -0
- package/templates/app-vite/src/pages/legal/LegalNoticePage.tsx.example +75 -0
- package/templates/app-vite/src/pages/legal/PrivacyPage.tsx.example +69 -0
- package/templates/app-vite/src/pages/legal/TermsPage.tsx.example +71 -0
- package/templates/app-vite/src/pages/locales/README.md.example +1 -0
- package/templates/app-vite/src/pages/locales/example_en.json.example +5 -0
- package/templates/app-vite/src/themes.css.example +179 -0
- package/templates/app-vite/tsconfig.json.example +9 -0
- package/templates/app-vite/vite.config.ts.example +9 -0
- package/templates/functions-firebase/README.md.example +129 -0
- package/templates/functions-firebase/build.mjs.example +52 -0
- package/templates/functions-firebase/functions-firebase/.env.example.example +45 -0
- package/templates/functions-firebase/functions-firebase/README.md.example +123 -0
- package/templates/functions-firebase/functions-firebase/build.mjs.example +52 -0
- package/templates/functions-firebase/functions-firebase/src/auth/getCustomClaims.ts.example +19 -0
- package/templates/functions-firebase/functions-firebase/src/auth/getUserAuthStatus.ts.example +21 -0
- package/templates/functions-firebase/functions-firebase/src/auth/index.ts.example +11 -0
- package/templates/functions-firebase/functions-firebase/src/auth/removeCustomClaims.ts.example +21 -0
- package/templates/functions-firebase/functions-firebase/src/auth/setCustomClaims.ts.example +21 -0
- package/templates/functions-firebase/functions-firebase/src/billing/handleStripeWebhook.ts.example +24 -0
- package/templates/functions-firebase/functions-firebase/src/billing/index.ts.example +10 -0
- package/templates/functions-firebase/functions-firebase/src/billing/processPaymentSuccess.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/crud/createEntity.ts.example +19 -0
- package/templates/functions-firebase/functions-firebase/src/crud/deleteEntity.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/crud/getEntity.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/crud/index.ts.example +12 -0
- package/templates/functions-firebase/functions-firebase/src/crud/listEntities.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/crud/updateEntity.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/index.ts.example +45 -0
- package/templates/functions-firebase/functions-firebase/src/oauth/checkGitHubAccess.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/oauth/disconnect.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/oauth/exchangeToken.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/oauth/getConnections.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/oauth/grantGitHubAccess.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/oauth/index.ts.example +17 -0
- package/templates/functions-firebase/functions-firebase/src/oauth/refreshToken.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/src/oauth/revokeGitHubAccess.ts.example +14 -0
- package/templates/functions-firebase/functions-firebase/tsconfig.json.example +21 -0
- package/templates/functions-firebase/functions.yaml.example +14 -0
- package/templates/functions-firebase/src/auth/getCustomClaims.ts.example +19 -0
- package/templates/functions-firebase/src/auth/getUserAuthStatus.ts.example +21 -0
- package/templates/functions-firebase/src/auth/index.ts.example +11 -0
- package/templates/functions-firebase/src/auth/removeCustomClaims.ts.example +21 -0
- package/templates/functions-firebase/src/auth/setCustomClaims.ts.example +21 -0
- package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +24 -0
- package/templates/functions-firebase/src/billing/index.ts.example +10 -0
- package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +14 -0
- package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +14 -0
- package/templates/functions-firebase/src/crud/createEntity.ts.example +19 -0
- package/templates/functions-firebase/src/crud/deleteEntity.ts.example +14 -0
- package/templates/functions-firebase/src/crud/getEntity.ts.example +14 -0
- package/templates/functions-firebase/src/crud/index.ts.example +12 -0
- package/templates/functions-firebase/src/crud/listEntities.ts.example +14 -0
- package/templates/functions-firebase/src/crud/updateEntity.ts.example +14 -0
- package/templates/functions-firebase/src/index.ts.example +45 -0
- package/templates/functions-firebase/src/oauth/checkGitHubAccess.ts.example +14 -0
- package/templates/functions-firebase/src/oauth/disconnect.ts.example +14 -0
- package/templates/functions-firebase/src/oauth/exchangeToken.ts.example +14 -0
- package/templates/functions-firebase/src/oauth/getConnections.ts.example +14 -0
- package/templates/functions-firebase/src/oauth/grantGitHubAccess.ts.example +14 -0
- package/templates/functions-firebase/src/oauth/index.ts.example +17 -0
- package/templates/functions-firebase/src/oauth/refreshToken.ts.example +14 -0
- package/templates/functions-firebase/src/oauth/revokeGitHubAccess.ts.example +14 -0
- package/templates/functions-firebase/tsconfig.json.example +24 -0
- package/templates/functions-vercel/README.md.example +116 -0
- package/templates/functions-vercel/build.mjs.example +52 -0
- package/templates/functions-vercel/functions-vercel/.env.example.example +37 -0
- package/templates/functions-vercel/functions-vercel/README.md.example +116 -0
- package/templates/functions-vercel/functions-vercel/build.mjs.example +52 -0
- package/templates/functions-vercel/functions-vercel/src/api/auth/getCustomClaims.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/auth/getUserAuthStatus.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/auth/removeCustomClaims.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/auth/setCustomClaims.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/crud/createEntity.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/crud/deleteEntity.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/crud/getEntity.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/crud/listEntities.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/crud/updateEntity.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/oauth/disconnect.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/oauth/exchangeToken.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/oauth/getConnections.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/oauth/refreshToken.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/src/api/oauth/revokeGitHubAccess.ts.example +20 -0
- package/templates/functions-vercel/functions-vercel/tsconfig.json.example +21 -0
- package/templates/functions-vercel/functions-vercel/vercel.json.example +14 -0
- package/templates/functions-vercel/src/api/auth/getCustomClaims.ts.example +20 -0
- package/templates/functions-vercel/src/api/auth/getUserAuthStatus.ts.example +20 -0
- package/templates/functions-vercel/src/api/auth/removeCustomClaims.ts.example +20 -0
- package/templates/functions-vercel/src/api/auth/setCustomClaims.ts.example +20 -0
- package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +20 -0
- package/templates/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +20 -0
- package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +20 -0
- package/templates/functions-vercel/src/api/crud/createEntity.ts.example +20 -0
- package/templates/functions-vercel/src/api/crud/deleteEntity.ts.example +20 -0
- package/templates/functions-vercel/src/api/crud/getEntity.ts.example +20 -0
- package/templates/functions-vercel/src/api/crud/listEntities.ts.example +20 -0
- package/templates/functions-vercel/src/api/crud/updateEntity.ts.example +20 -0
- package/templates/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +20 -0
- package/templates/functions-vercel/src/api/oauth/disconnect.ts.example +20 -0
- package/templates/functions-vercel/src/api/oauth/exchangeToken.ts.example +20 -0
- package/templates/functions-vercel/src/api/oauth/getConnections.ts.example +20 -0
- package/templates/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +20 -0
- package/templates/functions-vercel/src/api/oauth/refreshToken.ts.example +20 -0
- package/templates/functions-vercel/src/api/oauth/revokeGitHubAccess.ts.example +20 -0
- package/templates/functions-vercel/tsconfig.json.example +24 -0
- package/templates/functions-vercel/vercel.json.example +14 -0
- package/templates/github/github/workflows/firebase-deploy.yml.example +79 -0
- package/templates/github/workflows/firebase-deploy.yml.example +79 -0
- package/templates/root-consumer/.env.example +19 -0
- package/templates/root-consumer/.gitignore.example +82 -0
- package/templates/root-consumer/.prettierrc.cjs.example +12 -0
- package/templates/root-consumer/CLAUDE.md.example +73 -0
- package/templates/root-consumer/README.md.example +295 -0
- package/templates/root-consumer/bunfig.toml.example +68 -0
- package/templates/root-consumer/eslint.config.js.example +336 -0
- package/templates/root-consumer/firebase.json.example +348 -0
- package/templates/root-consumer/guides/AGENT_START_HERE.md.example +98 -0
- package/templates/root-consumer/guides/APP_CHECK_SETUP.md.example +111 -0
- package/templates/root-consumer/guides/AUTH_SETUP.md.example +92 -0
- package/templates/root-consumer/guides/BILLING_SETUP.md.example +120 -0
- package/templates/root-consumer/guides/CLI.md.example +293 -0
- package/templates/root-consumer/guides/COMPONENTS.md.example +875 -0
- package/templates/root-consumer/guides/CONFIG_SETUP.md.example +132 -0
- package/templates/root-consumer/guides/EMULATOR_SETUP.md.example +48 -0
- package/templates/root-consumer/guides/FEATURES.md.example +286 -0
- package/templates/root-consumer/guides/FRAMEWORK_OVERVIEW.md.example +97 -0
- package/templates/root-consumer/guides/FUNCTIONS.md.example +177 -0
- package/templates/root-consumer/guides/GETTING_STARTED.md.example +451 -0
- package/templates/root-consumer/guides/HOW_TO_USE.md.example +296 -0
- package/templates/root-consumer/guides/I18N_SETUP.md.example +204 -0
- package/templates/root-consumer/guides/IMPORT_PATTERNS.md.example +79 -0
- package/templates/root-consumer/guides/INDEX.md.example +50 -0
- package/templates/root-consumer/guides/INSTALLATION.md.example +296 -0
- package/templates/root-consumer/guides/LAYOUTS.md.example +310 -0
- package/templates/root-consumer/guides/PAGES_SETUP.md.example +123 -0
- package/templates/root-consumer/guides/STYLING.md.example +273 -0
- package/templates/root-consumer/guides/THEMING_SETUP.md.example +119 -0
- package/templates/root-consumer/guides/VERSION_CONTROL.md.example +181 -0
- package/templates/root-consumer/tsconfig.functions.json.example +15 -0
- package/templates/root-consumer/tsconfig.json.example +18 -0
- package/templates/root-consumer/turbo.json.example +46 -0
- package/templates/root-consumer/vercel.json.example +124 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# DoNotDev Framework - Agent Quick Start
|
|
2
|
+
|
|
3
|
+
**For AI Agents: Read this first.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Prime Directive
|
|
8
|
+
|
|
9
|
+
**Framework-first.** 90% of what you need already exists. Discover and use before building custom.
|
|
10
|
+
|
|
11
|
+
**Trust conventions.** File-based routing, auto-discovery, defaults work.
|
|
12
|
+
|
|
13
|
+
**Zero CSS.** Component props only. No inline styles, no custom CSS (unless explicitly needed).
|
|
14
|
+
|
|
15
|
+
**Strict typing.** TypeScript mandatory. `any` forbidden. `import type` for types.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Setup Guides (Read These)
|
|
20
|
+
|
|
21
|
+
**Core setup:**
|
|
22
|
+
- [PAGES_SETUP.md](./PAGES_SETUP.md) - Drop `*Page.tsx`, get routes
|
|
23
|
+
- [CONFIG_SETUP.md](./CONFIG_SETUP.md) - `app.ts` + `vite.config.ts`
|
|
24
|
+
- [EMULATOR_SETUP.md](./EMULATOR_SETUP.md) - Local secrets (.env.local)
|
|
25
|
+
- [I18N_SETUP.md](./I18N_SETUP.md) - Drop `*_en.json`, get languages
|
|
26
|
+
- [THEMING_SETUP.md](./THEMING_SETUP.md) - Override `themes.css`
|
|
27
|
+
|
|
28
|
+
**Features:**
|
|
29
|
+
- [AUTH_SETUP.md](./AUTH_SETUP.md) - Authentication
|
|
30
|
+
- [BILLING_SETUP.md](./BILLING_SETUP.md) - Stripe subscriptions
|
|
31
|
+
|
|
32
|
+
**Reference:**
|
|
33
|
+
- [HOW_TO_USE.md](./HOW_TO_USE.md) - Component composition philosophy
|
|
34
|
+
- [COMPONENTS.md](./COMPONENTS.md) - Component catalog
|
|
35
|
+
- [LAYOUTS.md](./LAYOUTS.md) - Layout presets
|
|
36
|
+
- [INDEX.md](./INDEX.md) - Full guide navigation
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Import Rules
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
// ✅ Correct
|
|
44
|
+
import { Button } from '@donotdev/components';
|
|
45
|
+
import { useAuth } from '@donotdev/auth';
|
|
46
|
+
import type { PageMeta } from '@donotdev/core';
|
|
47
|
+
|
|
48
|
+
// ❌ Wrong
|
|
49
|
+
import { Button } from '@donotdev/components/src/atomic/Button';
|
|
50
|
+
import { PageMeta } from '@donotdev/core'; // Missing 'type'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
See [IMPORT_PATTERNS.md](./IMPORT_PATTERNS.md)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Component Philosophy
|
|
58
|
+
|
|
59
|
+
**Props, not CSS:**
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
// ✅ Correct
|
|
63
|
+
<Card title="Feature" subtitle="Description" icon={Rocket} elevated />
|
|
64
|
+
|
|
65
|
+
// ❌ Wrong
|
|
66
|
+
<Card style={{ padding: '2rem' }}>
|
|
67
|
+
<CardTitle>Feature</CardTitle>
|
|
68
|
+
</Card>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Composition, not nesting:**
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
// ✅ Correct
|
|
75
|
+
<Section gridCols={3} tone="muted">
|
|
76
|
+
<Card title="One" />
|
|
77
|
+
<Card title="Two" />
|
|
78
|
+
<Card title="Three" />
|
|
79
|
+
</Section>
|
|
80
|
+
|
|
81
|
+
// ❌ Wrong - writing custom CSS
|
|
82
|
+
<div className="my-custom-grid">...</div>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## When Stuck
|
|
88
|
+
|
|
89
|
+
1. Check JSDoc (hover in IDE)
|
|
90
|
+
2. Read relevant setup guide
|
|
91
|
+
3. Trust framework defaults
|
|
92
|
+
4. Ask user for clarification
|
|
93
|
+
|
|
94
|
+
**Never guess. Always verify.**
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
**Start building. Framework handles the rest.**
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# App Check Setup (Abuse Protection)
|
|
2
|
+
|
|
3
|
+
**For AI Agents:** Configure reCAPTCHA key. Framework auto-enables App Check for all Firebase resources.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Environment Variables
|
|
8
|
+
|
|
9
|
+
**Vite:**
|
|
10
|
+
```bash
|
|
11
|
+
# .env
|
|
12
|
+
VITE_RECAPTCHA_SITE_KEY=6LcXXXX... # reCAPTCHA v3 site key
|
|
13
|
+
VITE_APPCHECK_DEBUG_TOKEN=XXXX-XXXX-XXXX # Optional: localhost testing
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Next.js:**
|
|
17
|
+
```bash
|
|
18
|
+
# .env.local
|
|
19
|
+
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=6LcXXXX...
|
|
20
|
+
NEXT_PUBLIC_APPCHECK_DEBUG_TOKEN=XXXX-XXXX-XXXX
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Functions (.env):**
|
|
24
|
+
```bash
|
|
25
|
+
ENFORCE_APP_CHECK=false # Set 'true' to reject requests without tokens
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. Get reCAPTCHA Enterprise Key
|
|
31
|
+
|
|
32
|
+
1. Go to [Google Cloud Console - reCAPTCHA](https://console.cloud.google.com/security/recaptcha)
|
|
33
|
+
2. Create key:
|
|
34
|
+
- Platform: Website
|
|
35
|
+
- Type: Score-based (checkbox optional)
|
|
36
|
+
- Domains: `localhost`, `yourdomain.com`
|
|
37
|
+
3. Copy Site Key (starts with `6L...`)
|
|
38
|
+
|
|
39
|
+
> First 1M calls/month are free.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 3. Enable in Firebase Console
|
|
44
|
+
|
|
45
|
+
1. [Firebase Console](https://console.firebase.google.com) → **App Check**
|
|
46
|
+
2. Click **Register app** → select your web app
|
|
47
|
+
3. Choose **reCAPTCHA v3**, paste Site Key
|
|
48
|
+
4. Save
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 4. Localhost Debug Token
|
|
53
|
+
|
|
54
|
+
reCAPTCHA doesn't work on localhost. Use debug tokens:
|
|
55
|
+
|
|
56
|
+
1. Start app in dev mode
|
|
57
|
+
2. Check console for: `App Check debug token: XXXXXXXX-XXXX-...`
|
|
58
|
+
3. Copy token
|
|
59
|
+
4. Firebase Console → App Check → **Manage debug tokens**
|
|
60
|
+
5. Add token with name (e.g., "Local Dev - John")
|
|
61
|
+
6. Add to `.env`:
|
|
62
|
+
- Vite: `VITE_APPCHECK_DEBUG_TOKEN=XXXXXXXX-XXXX-...`
|
|
63
|
+
- Next.js: `NEXT_PUBLIC_APPCHECK_DEBUG_TOKEN=XXXXXXXX-XXXX-...`
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 5. How It Works
|
|
68
|
+
|
|
69
|
+
**Automatic:**
|
|
70
|
+
- Framework detects `RECAPTCHA_SITE_KEY` env var
|
|
71
|
+
- Auto-initializes App Check during Firebase init
|
|
72
|
+
- All Firebase requests include tokens automatically
|
|
73
|
+
- No code changes needed
|
|
74
|
+
|
|
75
|
+
**Server-side:**
|
|
76
|
+
- Default: Logs warnings for missing tokens
|
|
77
|
+
- Set `ENFORCE_APP_CHECK=true` to reject invalid requests
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 6. Verification
|
|
82
|
+
|
|
83
|
+
**Console messages:**
|
|
84
|
+
| Message | Status |
|
|
85
|
+
|---------|--------|
|
|
86
|
+
| `[AppCheck] Enabled - all Firebase requests are protected` | Working |
|
|
87
|
+
| `[AppCheck] Not configured...` | Key missing (prod only) |
|
|
88
|
+
| `[AppCheck] Missing token for <operation>` | Server warning |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 7. Rollout Strategy
|
|
93
|
+
|
|
94
|
+
1. **Monitor:** Deploy without enforcement, check logs
|
|
95
|
+
2. **Enforce:** Set `ENFORCE_APP_CHECK=true` when ready
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## What App Check Protects
|
|
100
|
+
|
|
101
|
+
- Bot/script attacks
|
|
102
|
+
- Unauthorized API access
|
|
103
|
+
- Request replay attacks
|
|
104
|
+
|
|
105
|
+
**Does NOT replace:** Firebase Auth, Firestore Rules, Rate Limiting
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
**Files to configure:**
|
|
110
|
+
- `.env` or `.env.local` - Add reCAPTCHA key
|
|
111
|
+
- `functions/.env` - Optional enforcement
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Authentication Setup
|
|
2
|
+
|
|
3
|
+
**For AI Agents:** Configure auth providers and routes. Framework handles the rest.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Environment Variables
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# .env
|
|
11
|
+
VITE_AUTH_PARTNERS=password,emailLink,google,github,facebook
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
**Available Firebase Auth providers:** `password`, `emailLink`, `google`, `github`, `facebook`, `twitter`, `microsoft`, `yahoo`, `apple`
|
|
15
|
+
|
|
16
|
+
**Default:** If not set, only `google` is enabled.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 2. App Configuration
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
// apps/your-app/src/config/app.ts
|
|
24
|
+
import type { AppConfig } from '@donotdev/core';
|
|
25
|
+
|
|
26
|
+
export const appConfig: AppConfig = {
|
|
27
|
+
auth: {
|
|
28
|
+
authRoute: '/login', // Redirect when auth required (default: '/login')
|
|
29
|
+
roleRoute: '/404', // Redirect when role insufficient (default: '/404')
|
|
30
|
+
tierRoute: '/404', // Redirect when tier insufficient (default: '/404')
|
|
31
|
+
loginPath: '/login', // Optional: Login page path (undefined = show providers in header)
|
|
32
|
+
profilePath: '/profile', // Optional: Profile page path (default: '/profile')
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 3. Firebase Console Setup
|
|
40
|
+
|
|
41
|
+
**User must enable providers in Firebase Console:**
|
|
42
|
+
- Authentication > Sign-in method
|
|
43
|
+
- Enable Email/Password (for `password` and `emailLink`)
|
|
44
|
+
- Enable OAuth providers (Google, GitHub, etc.) and configure credentials
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## What You Get
|
|
49
|
+
|
|
50
|
+
**Automatic:**
|
|
51
|
+
- ✅ `AuthHeader` component in layout (null if auth not needed)
|
|
52
|
+
- ✅ OAuth callbacks handled automatically
|
|
53
|
+
- ✅ Protected routes via `PageMeta.auth`
|
|
54
|
+
- ✅ Session management
|
|
55
|
+
|
|
56
|
+
**Components:**
|
|
57
|
+
- `AuthHeader`, `AuthMenu` from `@donotdev/ui`
|
|
58
|
+
- `LoginTemplate` from `@donotdev/templates`
|
|
59
|
+
- `EmailPasswordForm`, `MultipleAuthProviders` from `@donotdev/auth`
|
|
60
|
+
|
|
61
|
+
**Hook:**
|
|
62
|
+
```typescript
|
|
63
|
+
import { useAuth } from '@donotdev/auth';
|
|
64
|
+
|
|
65
|
+
const user = useAuth('user');
|
|
66
|
+
const signIn = useAuth('signInWithEmail');
|
|
67
|
+
const signOut = useAuth('signOut');
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Protected Route Example
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
// apps/your-app/src/pages/DashboardPage.tsx
|
|
76
|
+
export const meta = {
|
|
77
|
+
namespace: 'dashboard',
|
|
78
|
+
auth: { required: true }, // ← Protected route
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export default function DashboardPage() {
|
|
82
|
+
const user = useAuth('user');
|
|
83
|
+
return <PageContainer>Welcome, {user?.displayName}!</PageContainer>;
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
**Files to modify:**
|
|
90
|
+
- `.env` - Add `VITE_AUTH_PARTNERS`
|
|
91
|
+
- `src/config/app.ts` - Add `auth` config
|
|
92
|
+
- `src/pages/**/*.tsx` - Add `auth` to `PageMeta` for protected routes
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Billing Setup
|
|
2
|
+
|
|
3
|
+
**For AI Agents:** Create Stripe config files. Framework handles checkout, webhooks, subscriptions.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Environment Variables
|
|
8
|
+
|
|
9
|
+
**Local Emulators (.env.local):**
|
|
10
|
+
```bash
|
|
11
|
+
# apps/your-app/functions/.env.local
|
|
12
|
+
STRIPE_SECRET_KEY=sk_test_xxx
|
|
13
|
+
STRIPE_WEBHOOK_SECRET=whsec_xxx # Get from 'stripe listen'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Production (.env):**
|
|
17
|
+
```bash
|
|
18
|
+
# apps/your-app/functions/.env
|
|
19
|
+
STRIPE_SECRET_KEY=sk_live_xxx
|
|
20
|
+
STRIPE_WEBHOOK_SECRET=whsec_xxx # Permanent production secret
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Frontend (.env):**
|
|
24
|
+
```bash
|
|
25
|
+
# apps/your-app/.env
|
|
26
|
+
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_xxx
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 2. Stripe Dashboard
|
|
32
|
+
|
|
33
|
+
**User must:**
|
|
34
|
+
1. Create products in Stripe Dashboard
|
|
35
|
+
2. Copy Price IDs (starts with `price_...`)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 3. Frontend Config
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
// apps/your-app/src/config/stripeFrontConfig.ts
|
|
43
|
+
import type { StripeFrontConfig } from '@donotdev/core';
|
|
44
|
+
|
|
45
|
+
export const stripeFrontConfig: StripeFrontConfig = {
|
|
46
|
+
pro_plan: {
|
|
47
|
+
name: 'Pro Plan',
|
|
48
|
+
price: 29,
|
|
49
|
+
currency: 'USD',
|
|
50
|
+
description: 'Perfect for growing teams',
|
|
51
|
+
features: ['Unlimited projects', 'Priority support'],
|
|
52
|
+
priceId: 'price_1234567890', // ← Stripe Price ID
|
|
53
|
+
allowPromotionCodes: true,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 4. Backend Config
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
// apps/your-app/functions/src/config/stripeBackConfig.ts
|
|
64
|
+
import type { StripeBackConfig } from '@donotdev/core';
|
|
65
|
+
|
|
66
|
+
export const stripeBackConfig: StripeBackConfig = {
|
|
67
|
+
pro_plan: {
|
|
68
|
+
type: 'StripeSubscription', // or 'StripePayment'
|
|
69
|
+
name: 'Pro Plan',
|
|
70
|
+
price: 2900, // In cents
|
|
71
|
+
currency: 'USD',
|
|
72
|
+
priceId: process.env.STRIPE_PRICE_PRO_PLAN!,
|
|
73
|
+
tier: 'pro',
|
|
74
|
+
duration: 'month',
|
|
75
|
+
|
|
76
|
+
// Optional hooks
|
|
77
|
+
onPurchaseSuccess: async (userId, metadata) => {
|
|
78
|
+
// Grant features, send email, etc.
|
|
79
|
+
},
|
|
80
|
+
onSubscriptionCancelled: async (userId) => {
|
|
81
|
+
// Revoke features, etc.
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 5. Wire Up Functions
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
// apps/your-app/functions/src/index.ts
|
|
93
|
+
import { createCheckoutSession } from '@donotdev/functions/firebase';
|
|
94
|
+
import { stripeBackConfig } from './config/stripeBackConfig';
|
|
95
|
+
|
|
96
|
+
export const createCheckout = createCheckoutSession(stripeBackConfig);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## What You Get
|
|
102
|
+
|
|
103
|
+
**Components:**
|
|
104
|
+
- `SubscriptionTemplate`, `PaymentTemplate` from `@donotdev/templates`
|
|
105
|
+
- `ProductCard`, `SubscriptionManager` from `@donotdev/billing`
|
|
106
|
+
|
|
107
|
+
**Hook:**
|
|
108
|
+
```typescript
|
|
109
|
+
import { useStripeBilling } from '@donotdev/billing';
|
|
110
|
+
|
|
111
|
+
const checkout = useStripeBilling('checkout');
|
|
112
|
+
await checkout({ priceId: 'price_123', mode: 'subscription' });
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
**Files to create:**
|
|
118
|
+
- `src/config/stripeFrontConfig.ts` - Frontend config
|
|
119
|
+
- `functions/src/config/stripeBackConfig.ts` - Backend config
|
|
120
|
+
- `functions/src/index.ts` - Wire up functions
|
|
@@ -0,0 +1,293 @@
|
|
|
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
|