@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,132 @@
|
|
|
1
|
+
# Configuration Setup
|
|
2
|
+
|
|
3
|
+
**For AI Agents:** Configure `src/config/app.ts` and `vite.config.ts`. Framework handles the rest.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. App Configuration
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
// src/config/app.ts
|
|
11
|
+
import type { AppConfig } from '@donotdev/core';
|
|
12
|
+
|
|
13
|
+
export const appConfig: AppConfig = {
|
|
14
|
+
app: {
|
|
15
|
+
name: 'My App',
|
|
16
|
+
url: 'https://myapp.com',
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
preset: 'landing', // landing | admin | moolti | docs | blog | game | plain
|
|
20
|
+
|
|
21
|
+
features: {
|
|
22
|
+
debug: false, // Enable debug tools
|
|
23
|
+
requiredCookies: ['necessary'], // Cookie consent categories
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
auth: {
|
|
27
|
+
authRoute: '/login',
|
|
28
|
+
roleRoute: '/404',
|
|
29
|
+
tierRoute: '/404',
|
|
30
|
+
loginPath: '/login',
|
|
31
|
+
profilePath: '/profile',
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
i18n: {
|
|
35
|
+
defaultLanguage: 'en',
|
|
36
|
+
fallbackLanguage: 'en',
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
theme: {
|
|
40
|
+
defaultTheme: 'light',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 2. Vite Configuration
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
// vite.config.ts
|
|
51
|
+
import { defineViteConfig } from '@donotdev/core/vite';
|
|
52
|
+
import { appConfig } from './src/config/app';
|
|
53
|
+
|
|
54
|
+
export default defineViteConfig({
|
|
55
|
+
appConfig, // Required
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Done.** Routes, themes, and translations are automatically detected from your `src/` directory.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 3. Optional Vite Options
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
export default defineViteConfig({
|
|
67
|
+
appConfig,
|
|
68
|
+
|
|
69
|
+
// Debug
|
|
70
|
+
debug: true,
|
|
71
|
+
verbose: true,
|
|
72
|
+
|
|
73
|
+
// Debug options
|
|
74
|
+
routes: { debug: true },
|
|
75
|
+
themes: { debug: true },
|
|
76
|
+
i18n: { debug: true },
|
|
77
|
+
|
|
78
|
+
// Server
|
|
79
|
+
server: {
|
|
80
|
+
port: 3000,
|
|
81
|
+
https: true,
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
// Build
|
|
85
|
+
build: {
|
|
86
|
+
sourcemap: false,
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
// SEO
|
|
90
|
+
seo: {
|
|
91
|
+
disabled: false,
|
|
92
|
+
generateRobotsTxt: true,
|
|
93
|
+
generateSitemap: true,
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// PWA
|
|
97
|
+
pwa: {
|
|
98
|
+
enabled: false,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 4. Environment Variables
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# .env
|
|
109
|
+
VITE_APP_NAME="My App"
|
|
110
|
+
VITE_APP_URL=http://localhost:5173
|
|
111
|
+
|
|
112
|
+
# Firebase
|
|
113
|
+
VITE_FIREBASE_API_KEY=your-api-key
|
|
114
|
+
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
|
|
115
|
+
VITE_FIREBASE_PROJECT_ID=your-project-id
|
|
116
|
+
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
|
|
117
|
+
VITE_FIREBASE_MESSAGING_SENDER_ID=123456789
|
|
118
|
+
VITE_FIREBASE_APP_ID=1:123456789:web:abcdef
|
|
119
|
+
|
|
120
|
+
# Auth providers
|
|
121
|
+
VITE_AUTH_PARTNERS=password,emailLink,google,github
|
|
122
|
+
|
|
123
|
+
# Stripe
|
|
124
|
+
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_...
|
|
125
|
+
STRIPE_SECRET_KEY=sk_test_...
|
|
126
|
+
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
127
|
+
STRIPE_API_VERSION=2025-08-27.basil
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
**Zero config. Override when needed.**
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Emulator Setup Guide
|
|
2
|
+
|
|
3
|
+
This guide covers how to set up your local development environment for the Firebase Emulator Suite.
|
|
4
|
+
|
|
5
|
+
## Environment Variables
|
|
6
|
+
|
|
7
|
+
The DoNotDev framework uses a strict separation between local development and production secrets for functions.
|
|
8
|
+
|
|
9
|
+
### Local Development (.env.local)
|
|
10
|
+
|
|
11
|
+
**`.env.local` is the exclusive source of truth for emulators.**
|
|
12
|
+
|
|
13
|
+
When you run `dn emu <app-name>`, the framework loads environment variables **ONLY** from `functions/.env.local`.
|
|
14
|
+
|
|
15
|
+
1. Create `functions/.env.local` (it is git-ignored by default).
|
|
16
|
+
2. Add your local development keys (e.g., Stripe ephemeral webhook secret).
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# functions/.env.local
|
|
20
|
+
STRIPE_SECRET_KEY=sk_test_...
|
|
21
|
+
STRIPE_WEBHOOK_SECRET=whsec_... # Get this from 'stripe listen' output
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Production Secrets (.env)
|
|
25
|
+
|
|
26
|
+
**`.env` is the source of truth for production secrets.**
|
|
27
|
+
|
|
28
|
+
These are the secrets that will be synced to Firebase Cloud Functions when you run `dn deploy` or `dn sync-secrets`.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# functions/.env
|
|
32
|
+
STRIPE_SECRET_KEY=sk_live_...
|
|
33
|
+
STRIPE_WEBHOOK_SECRET=whsec_... # Your permanent production webhook secret
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Running the Emulator
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Start emulators for a specific app
|
|
40
|
+
dn emu showcase
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If you need Stripe webhook forwarding, the emulator command will provide instructions on how to start the Stripe CLI and where to paste the temporary webhook secret.
|
|
44
|
+
|
|
45
|
+
## Troubleshooting
|
|
46
|
+
|
|
47
|
+
1. **Signature Verification Error**: This usually means the `STRIPE_WEBHOOK_SECRET` in your `functions/.env.local` does not match the secret displayed in your active `stripe listen` terminal.
|
|
48
|
+
2. **Missing Secrets**: Ensure you have created the `functions/.env.local` file. The emulator command will warn you if it's missing.
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# Using Features
|
|
2
|
+
|
|
3
|
+
**Optional features with graceful degradation**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Available Features
|
|
8
|
+
|
|
9
|
+
DoNotDev provides 4 optional feature packages:
|
|
10
|
+
|
|
11
|
+
1. **@donotdev/auth** - Firebase Authentication
|
|
12
|
+
2. **@donotdev/billing** - Stripe subscriptions
|
|
13
|
+
3. **@donotdev/oauth** - OAuth providers (GitHub, Google)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Install only the features you need:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Authentication
|
|
23
|
+
bun add @donotdev/auth
|
|
24
|
+
|
|
25
|
+
# Billing (requires auth)
|
|
26
|
+
bun add @donotdev/billing
|
|
27
|
+
|
|
28
|
+
# OAuth
|
|
29
|
+
bun add @donotdev/oauth
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Using Auth
|
|
35
|
+
|
|
36
|
+
### Basic Usage
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { useAuth } from '@donotdev/auth';
|
|
40
|
+
|
|
41
|
+
export function ProfilePage() {
|
|
42
|
+
const isEnabled = useAuth('isAvailable');
|
|
43
|
+
const isLoading = useAuth('loading');
|
|
44
|
+
const user = useAuth('user');
|
|
45
|
+
const signOut = useAuth('signOut');
|
|
46
|
+
|
|
47
|
+
if (!isEnabled) {
|
|
48
|
+
return <div>Auth not available</div>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (isLoading) {
|
|
52
|
+
return <div>Loading...</div>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!user) {
|
|
56
|
+
return <LoginPage />;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div>
|
|
61
|
+
<h1>Welcome, {user.displayName}!</h1>
|
|
62
|
+
<button onClick={() => signOut()}>Logout</button>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Login
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
const signInWithEmail = useAuth('signInWithEmail');
|
|
72
|
+
|
|
73
|
+
async function handleLogin(email: string, password: string) {
|
|
74
|
+
try {
|
|
75
|
+
await signInWithEmail(email, password);
|
|
76
|
+
// User is now authenticated
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error('Login failed:', error);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Sign Up
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
const signUpWithEmail = useAuth('signUpWithEmail');
|
|
87
|
+
|
|
88
|
+
async function handleSignUp(email: string, password: string) {
|
|
89
|
+
try {
|
|
90
|
+
await signUpWithEmail(email, password);
|
|
91
|
+
// User account created and authenticated
|
|
92
|
+
} catch (error) {
|
|
93
|
+
console.error('Sign up failed:', error);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Using Billing
|
|
101
|
+
|
|
102
|
+
**Requires:** `@donotdev/auth` installed
|
|
103
|
+
|
|
104
|
+
### Check Subscription
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
import { useStripeBilling } from '@donotdev/billing';
|
|
108
|
+
|
|
109
|
+
export function UpgradePage() {
|
|
110
|
+
const isEnabled = useStripeBilling('isAvailable');
|
|
111
|
+
const subscription = useStripeBilling('subscription');
|
|
112
|
+
const checkout = useStripeBilling('checkout');
|
|
113
|
+
|
|
114
|
+
if (!isEnabled) {
|
|
115
|
+
return <div>Billing not available</div>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<div>
|
|
120
|
+
<h2>Current Plan: {subscription?.planId || 'Free'}</h2>
|
|
121
|
+
<button onClick={() => checkout({ priceId: 'pro', mode: 'subscription' })}>
|
|
122
|
+
Upgrade to Pro
|
|
123
|
+
</button>
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Create Checkout Session
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
const checkout = useStripeBilling('checkout');
|
|
133
|
+
|
|
134
|
+
async function handleUpgrade() {
|
|
135
|
+
try {
|
|
136
|
+
// The checkout function handles redirecting to Stripe
|
|
137
|
+
await checkout({
|
|
138
|
+
priceId: 'pro', // The ID of the Stripe Price
|
|
139
|
+
mode: 'subscription',
|
|
140
|
+
successUrl: window.location.href, // Optional: URL to redirect on success
|
|
141
|
+
cancelUrl: window.location.origin, // Optional: URL to redirect on cancellation
|
|
142
|
+
});
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.error('Checkout failed:', error);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Using OAuth
|
|
152
|
+
|
|
153
|
+
### GitHub OAuth
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
import { useOAuth } from '@donotdev/oauth';
|
|
157
|
+
|
|
158
|
+
export function ConnectGitHub() {
|
|
159
|
+
const isEnabled = useOAuth('isAvailable');
|
|
160
|
+
const signInWithGitHub = useOAuth('signInWithGitHub');
|
|
161
|
+
|
|
162
|
+
if (!isEnabled) {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
async function handleConnect() {
|
|
167
|
+
try {
|
|
168
|
+
await signInWithGitHub();
|
|
169
|
+
// User connected to GitHub
|
|
170
|
+
} catch (error) {
|
|
171
|
+
console.error('GitHub connection failed:', error);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return (
|
|
176
|
+
<button onClick={handleConnect}>
|
|
177
|
+
Connect GitHub
|
|
178
|
+
</button>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Feature Detection
|
|
186
|
+
|
|
187
|
+
All features export `use{Feature}()` hooks that include `isAvailable` check:
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
import { useAuth } from '@donotdev/auth';
|
|
191
|
+
import { useStripeBilling } from '@donotdev/billing';
|
|
192
|
+
|
|
193
|
+
export function Navigation() {
|
|
194
|
+
const authIsAvailable = useAuth('isAvailable');
|
|
195
|
+
const user = useAuth('user');
|
|
196
|
+
const billingIsAvailable = useStripeBilling('isAvailable');
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
<nav>
|
|
200
|
+
<Link to="/home">Home</Link>
|
|
201
|
+
|
|
202
|
+
{authIsAvailable && user && (
|
|
203
|
+
<Link to="/dashboard">Dashboard</Link>
|
|
204
|
+
)}
|
|
205
|
+
|
|
206
|
+
{billingIsAvailable && (
|
|
207
|
+
<Link to="/upgrade">Upgrade</Link>
|
|
208
|
+
)}
|
|
209
|
+
</nav>
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Benefits:**
|
|
215
|
+
|
|
216
|
+
- Features lazy-load when needed
|
|
217
|
+
- Graceful degradation if not installed
|
|
218
|
+
- Tree-shaking removes unused features
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Configuration
|
|
223
|
+
|
|
224
|
+
### Firebase (for Auth)
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
// src/App.tsx
|
|
228
|
+
import { ViteAppProviders } from '@donotdev/ui';
|
|
229
|
+
|
|
230
|
+
<ViteAppProviders
|
|
231
|
+
firebaseConfig={{
|
|
232
|
+
apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
|
|
233
|
+
authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
|
|
234
|
+
projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
|
|
235
|
+
// ...
|
|
236
|
+
}}
|
|
237
|
+
>
|
|
238
|
+
{/* Your app */}
|
|
239
|
+
</ViteAppProviders>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Stripe (for Billing)
|
|
243
|
+
|
|
244
|
+
Set environment variables:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
# .env
|
|
248
|
+
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_...
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Protected Routes
|
|
254
|
+
|
|
255
|
+
Use `meta.auth.required` to protect pages:
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
import type { PageMeta } from '@donotdev/core';
|
|
259
|
+
|
|
260
|
+
export const meta: PageMeta = {
|
|
261
|
+
auth: { required: true },
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export function DashboardPage() {
|
|
265
|
+
// User is guaranteed to be authenticated here
|
|
266
|
+
return <div>Dashboard</div>;
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Best Practices
|
|
273
|
+
|
|
274
|
+
- ✅ Always check `isEnabled` before using features
|
|
275
|
+
- ✅ Handle loading and error states
|
|
276
|
+
- ✅ Use feature detection for conditional UI
|
|
277
|
+
- ✅ Set up environment variables properly
|
|
278
|
+
- ❌ Don't assume features are installed
|
|
279
|
+
- ❌ Don't call feature methods without checking `isEnabled`
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
**Related:**
|
|
284
|
+
|
|
285
|
+
- [INSTALLATION.md](../../INSTALLATION.md) - Installing packages
|
|
286
|
+
- [docs/architecture/FEATURE_DETECTION.md](../architecture/FEATURE_DETECTION.md) - How feature detection works
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Framework Overview
|
|
2
|
+
|
|
3
|
+
**DoNotDev Package Ecosystem**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Free Public Tools
|
|
8
|
+
|
|
9
|
+
**`@donotdev/cli`** - Command-line tool for scaffolding, dev servers, deployment
|
|
10
|
+
|
|
11
|
+
**`@donotdev/components`** - UI component library (standalone, can use anywhere)
|
|
12
|
+
|
|
13
|
+
**`@donotdev/templates`** - Pre-built page templates (open to contributions)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Paid Framework Packages
|
|
18
|
+
|
|
19
|
+
**Foundation:**
|
|
20
|
+
|
|
21
|
+
- `@donotdev/core` - Engine (utilities, hooks, types, state management)
|
|
22
|
+
- `@donotdev/ui` - Composition layer (layouts, routing, feature integration)
|
|
23
|
+
|
|
24
|
+
**Features** (install what you need):
|
|
25
|
+
|
|
26
|
+
- `@donotdev/auth` - Authentication & authorization
|
|
27
|
+
- `@donotdev/billing` - Stripe integration
|
|
28
|
+
- `@donotdev/crud` - Data operations (forms, tables)
|
|
29
|
+
- `@donotdev/oauth` - Social sign-on
|
|
30
|
+
|
|
31
|
+
**Backend:**
|
|
32
|
+
|
|
33
|
+
- `@donotdev/firebase` - Firebase platform
|
|
34
|
+
- `@donotdev/functions` - Serverless function templates (Firebase/Vercel)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Architecture
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
Your App
|
|
42
|
+
├── @donotdev/ui (Layouts, Routing)
|
|
43
|
+
├── @donotdev/templates (Pre-built Pages)
|
|
44
|
+
├── Features (auth, billing, crud - optional)
|
|
45
|
+
└── @donotdev/core (Foundation)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Key:** Framework detects installed features, keeps bundle lean.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Getting Started
|
|
53
|
+
|
|
54
|
+
**1. Install CLI:**
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm install -g @donotdev/cli
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**2. Create project:**
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
dndev init my-app
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**3. Add features:**
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
cd my-app
|
|
70
|
+
npm install @donotdev/auth @donotdev/billing
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**4. Start dev server:**
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
dndev dev
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Import Pattern
|
|
82
|
+
|
|
83
|
+
Import everything from `@donotdev/core`:
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { useAuth, useTranslation, useThemeStore } from '@donotdev/core';
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Import UI components from `@donotdev/ui`:
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
import { Button, Card } from '@donotdev/ui';
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
**Simple. Modular. Type-safe.**
|