@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,296 @@
|
|
|
1
|
+
# Installation Guide
|
|
2
|
+
|
|
3
|
+
**Installing DoNotDev Framework Packages from npm**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- [Bun](https://bun.sh/) >= 1.3.0 (recommended) or Node.js >= 20.19.0 / >= 22.12.0 (LTS)
|
|
10
|
+
- Git
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Step 1: Install Packages
|
|
15
|
+
|
|
16
|
+
### Install Framework Core
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Install core bundle + UI layer
|
|
20
|
+
bun add @donotdev/core @donotdev/ui
|
|
21
|
+
|
|
22
|
+
# Or with npm
|
|
23
|
+
npm install @donotdev/core @donotdev/ui
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Install Features (Optional)
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Add authentication
|
|
30
|
+
bun add @donotdev/auth
|
|
31
|
+
|
|
32
|
+
# Add billing (Stripe)
|
|
33
|
+
bun add @donotdev/billing
|
|
34
|
+
|
|
35
|
+
# Add OAuth providers
|
|
36
|
+
bun add @donotdev/oauth
|
|
37
|
+
|
|
38
|
+
# Add Firebase provider (if using Firebase)
|
|
39
|
+
bun add @donotdev/firebase
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Install Build Tools
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Add Vite config factories
|
|
46
|
+
bun add -D @donotdev/config
|
|
47
|
+
|
|
48
|
+
# Add CLI (for scaffolding)
|
|
49
|
+
bun add -D @donotdev/cli
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Install Free Showcase Packages
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Pure UI components (public)
|
|
56
|
+
bun add @donotdev/components
|
|
57
|
+
|
|
58
|
+
# Page templates
|
|
59
|
+
bun add @donotdev/templates
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Step 2: Configure License Key
|
|
65
|
+
|
|
66
|
+
To remove the watermark, add your license key:
|
|
67
|
+
|
|
68
|
+
### For Vite Projects
|
|
69
|
+
|
|
70
|
+
Add to `.env` file:
|
|
71
|
+
|
|
72
|
+
```env
|
|
73
|
+
VITE_DONOTDEV_LICENSE_KEY=dndev_your_key_here
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### For Next.js Projects
|
|
77
|
+
|
|
78
|
+
Add to `.env.local` file:
|
|
79
|
+
|
|
80
|
+
```env
|
|
81
|
+
NEXT_PUBLIC_DONOTDEV_LICENSE_KEY=dndev_your_key_here
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Or in Code (Before Framework Initialization)
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
globalThis.__DONOTDEV_LICENSE_KEY__ = 'dndev_your_key_here';
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Get your license key:** [donotdev.com/pricing](https://donotdev.com/pricing)
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Step 3: Verify Installation
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Check installed packages
|
|
98
|
+
bun pm ls | grep @donotdev
|
|
99
|
+
|
|
100
|
+
# Or with npm
|
|
101
|
+
npm list | grep @donotdev
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
You should see all installed `@donotdev/*` packages listed.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Example: Complete Setup
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# 1. Create project
|
|
112
|
+
mkdir my-app
|
|
113
|
+
cd my-app
|
|
114
|
+
|
|
115
|
+
# 2. Initialize package.json
|
|
116
|
+
bun init -y
|
|
117
|
+
|
|
118
|
+
# 3. Install framework
|
|
119
|
+
bun add @donotdev/core @donotdev/ui @donotdev/auth @donotdev/billing
|
|
120
|
+
bun add -D @donotdev/cli @donotdev/config
|
|
121
|
+
|
|
122
|
+
# 4. Create .env file
|
|
123
|
+
echo "VITE_DONOTDEV_LICENSE_KEY=dndev_your_key_here" > .env
|
|
124
|
+
|
|
125
|
+
# 5. Start development
|
|
126
|
+
bun run dev
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## CI/CD Configuration
|
|
132
|
+
|
|
133
|
+
### GitHub Actions
|
|
134
|
+
|
|
135
|
+
```yaml
|
|
136
|
+
# .github/workflows/build.yml
|
|
137
|
+
name: Build
|
|
138
|
+
|
|
139
|
+
on: [push]
|
|
140
|
+
|
|
141
|
+
jobs:
|
|
142
|
+
build:
|
|
143
|
+
runs-on: ubuntu-latest
|
|
144
|
+
steps:
|
|
145
|
+
- uses: actions/checkout@v3
|
|
146
|
+
- uses: oven-sh/setup-bun@v1
|
|
147
|
+
|
|
148
|
+
- name: Install dependencies
|
|
149
|
+
run: bun install
|
|
150
|
+
|
|
151
|
+
- name: Build
|
|
152
|
+
run: bun run build
|
|
153
|
+
env:
|
|
154
|
+
VITE_DONOTDEV_LICENSE_KEY: ${{ secrets.DONOTDEV_LICENSE_KEY }}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Add `DONOTDEV_LICENSE_KEY` secret:**
|
|
158
|
+
|
|
159
|
+
1. Go to your repo settings → Secrets → Actions
|
|
160
|
+
2. Add new secret: `DONOTDEV_LICENSE_KEY`
|
|
161
|
+
3. Paste your license key
|
|
162
|
+
|
|
163
|
+
### Vercel
|
|
164
|
+
|
|
165
|
+
Add environment variable in Vercel dashboard:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
VITE_DONOTDEV_LICENSE_KEY=dndev_your_key_here
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Or for Next.js:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
NEXT_PUBLIC_DONOTDEV_LICENSE_KEY=dndev_your_key_here
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Docker
|
|
178
|
+
|
|
179
|
+
```dockerfile
|
|
180
|
+
# Dockerfile
|
|
181
|
+
FROM oven/bun:1
|
|
182
|
+
|
|
183
|
+
WORKDIR /app
|
|
184
|
+
|
|
185
|
+
# Copy package files
|
|
186
|
+
COPY package.json bun.lockb ./
|
|
187
|
+
|
|
188
|
+
# Install dependencies
|
|
189
|
+
RUN bun install
|
|
190
|
+
|
|
191
|
+
# Copy source
|
|
192
|
+
COPY . .
|
|
193
|
+
|
|
194
|
+
# Build
|
|
195
|
+
RUN bun run build
|
|
196
|
+
|
|
197
|
+
CMD ["bun", "run", "start"]
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**Build with license key:**
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
docker build --build-arg VITE_DONOTDEV_LICENSE_KEY=your_key -t my-app .
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Troubleshooting
|
|
209
|
+
|
|
210
|
+
### "Package not found"
|
|
211
|
+
|
|
212
|
+
**Problem:** `@donotdev/core` not found
|
|
213
|
+
|
|
214
|
+
**Solutions:**
|
|
215
|
+
|
|
216
|
+
1. Verify package name is correct (check spelling)
|
|
217
|
+
2. Try clearing cache: `bun pm cache rm` or `npm cache clean --force`
|
|
218
|
+
3. Check internet connection
|
|
219
|
+
|
|
220
|
+
### "Failed to fetch"
|
|
221
|
+
|
|
222
|
+
**Problem:** Network/registry errors
|
|
223
|
+
|
|
224
|
+
**Solutions:**
|
|
225
|
+
|
|
226
|
+
1. Check internet connection
|
|
227
|
+
2. Verify npm registry is accessible
|
|
228
|
+
3. Try with verbose logging: `bun install --verbose`
|
|
229
|
+
|
|
230
|
+
### Watermark Still Showing
|
|
231
|
+
|
|
232
|
+
**Problem:** License key not working
|
|
233
|
+
|
|
234
|
+
**Solutions:**
|
|
235
|
+
|
|
236
|
+
1. Verify license key is correct (starts with `dndev_`)
|
|
237
|
+
2. Check environment variable name matches your framework (Vite vs Next.js)
|
|
238
|
+
3. Restart development server after adding license key
|
|
239
|
+
4. For production builds, ensure environment variable is set in deployment platform
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Updating Packages
|
|
244
|
+
|
|
245
|
+
### Check for Updates
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
# Check outdated packages
|
|
249
|
+
bun outdated | grep @donotdev
|
|
250
|
+
|
|
251
|
+
# Or with npm
|
|
252
|
+
npm outdated | grep @donotdev
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Update to Latest
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
# Update all @donotdev packages
|
|
259
|
+
bun update @donotdev/core @donotdev/ui @donotdev/auth @donotdev/billing
|
|
260
|
+
|
|
261
|
+
# Or with npm
|
|
262
|
+
npm update @donotdev/core @donotdev/ui @donotdev/auth @donotdev/billing
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Update to Specific Version
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
# Install specific version
|
|
269
|
+
bun add @donotdev/core@0.3.0
|
|
270
|
+
|
|
271
|
+
# Or with npm
|
|
272
|
+
npm install @donotdev/core@0.3.0
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Next Steps
|
|
278
|
+
|
|
279
|
+
After installation:
|
|
280
|
+
|
|
281
|
+
1. **Read the guide:** [GETTING_STARTED.md](GETTING_STARTED.md)
|
|
282
|
+
2. **Scaffold a project:** `bunx @donotdev/cli create-project`
|
|
283
|
+
3. **Explore examples:** Check framework documentation
|
|
284
|
+
4. **Join Discord:** Get help from the community
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Support
|
|
289
|
+
|
|
290
|
+
- **Discord:** [Join our community](https://discord.gg/donotdev)
|
|
291
|
+
- **Email:** mooti.web.app@gmail.com
|
|
292
|
+
- **Issues:** [GitHub Issues](https://github.com/SkillsAreImba/dndev/issues)
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
**Get your license key:** [donotdev.com/pricing](https://donotdev.com/pricing)
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# Layouts
|
|
2
|
+
|
|
3
|
+
**Status:** Up to date. See live examples at https://donotdev.com/showcase/layouts
|
|
4
|
+
|
|
5
|
+
**Pre-Built Layout Presets**
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 7 Layout Presets
|
|
10
|
+
|
|
11
|
+
**Landing** (default) - Marketing sites, landing pages
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
// config/app.ts
|
|
15
|
+
export const appConfig: AppConfig = {
|
|
16
|
+
preset: 'landing',
|
|
17
|
+
// ...
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// App.tsx
|
|
21
|
+
<ViteAppProviders
|
|
22
|
+
config={appConfig}
|
|
23
|
+
LandingPage={HomePage}
|
|
24
|
+
/>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- Header + footer (no sidebar)
|
|
28
|
+
- Full-width content area
|
|
29
|
+
- Optimized for marketing content
|
|
30
|
+
|
|
31
|
+
**Admin** - Dashboards, admin panels
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// config/app.ts
|
|
35
|
+
export const appConfig: AppConfig = {
|
|
36
|
+
preset: 'admin',
|
|
37
|
+
// ...
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// App.tsx
|
|
41
|
+
<ViteAppProviders
|
|
42
|
+
config={appConfig}
|
|
43
|
+
LandingPage={HomePage}
|
|
44
|
+
/>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- Header + collapsible sidebar (240px) + footer
|
|
48
|
+
- Search bar, user menu, notifications
|
|
49
|
+
- Content max-width: 1480px
|
|
50
|
+
- Responsive with mobile hamburger menu
|
|
51
|
+
|
|
52
|
+
**Moolti** - SaaS applications, productivity tools
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
// config/app.ts
|
|
56
|
+
export const appConfig: AppConfig = {
|
|
57
|
+
preset: 'moolti',
|
|
58
|
+
// ...
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// App.tsx
|
|
62
|
+
<ViteAppProviders
|
|
63
|
+
config={appConfig}
|
|
64
|
+
LandingPage={HomePage}
|
|
65
|
+
/>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- Sidebar only (256px, no header/footer on desktop)
|
|
69
|
+
- Mobile header with hamburger menu
|
|
70
|
+
- Full-height immersive content
|
|
71
|
+
- Integrated branding and controls in sidebar
|
|
72
|
+
|
|
73
|
+
**Docs** - Documentation sites, knowledge bases
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
// config/app.ts
|
|
77
|
+
export const appConfig: AppConfig = {
|
|
78
|
+
preset: 'docs',
|
|
79
|
+
// ...
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// App.tsx
|
|
83
|
+
<ViteAppProviders
|
|
84
|
+
config={appConfig}
|
|
85
|
+
LandingPage={HomePage}
|
|
86
|
+
/>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- Wide sidebar (300px) for TOC
|
|
90
|
+
- Header with search
|
|
91
|
+
- Reading-optimized spacing
|
|
92
|
+
- Content-focused layout
|
|
93
|
+
|
|
94
|
+
**Blog** - Blog platforms, content sites
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// config/app.ts
|
|
98
|
+
export const appConfig: AppConfig = {
|
|
99
|
+
preset: 'blog',
|
|
100
|
+
// ...
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// App.tsx
|
|
104
|
+
<ViteAppProviders
|
|
105
|
+
config={appConfig}
|
|
106
|
+
LandingPage={HomePage}
|
|
107
|
+
/>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
- Header + sidebar + footer
|
|
111
|
+
- Optimized for article reading
|
|
112
|
+
|
|
113
|
+
**Game** - Mobile gaming interfaces
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
// config/app.ts
|
|
117
|
+
export const appConfig: AppConfig = {
|
|
118
|
+
preset: 'game',
|
|
119
|
+
// ...
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// App.tsx
|
|
123
|
+
<ViteAppProviders
|
|
124
|
+
config={appConfig}
|
|
125
|
+
LandingPage={HomePage}
|
|
126
|
+
/>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- Fixed header (64px) + footer (24px)
|
|
130
|
+
- No sidebar
|
|
131
|
+
- Mobile-optimized
|
|
132
|
+
|
|
133
|
+
**Plain** - Minimal, content-only
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
// config/app.ts
|
|
137
|
+
export const appConfig: AppConfig = {
|
|
138
|
+
preset: 'plain',
|
|
139
|
+
// ...
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// App.tsx
|
|
143
|
+
<ViteAppProviders
|
|
144
|
+
config={appConfig}
|
|
145
|
+
LandingPage={HomePage}
|
|
146
|
+
/>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
- No header, sidebar, or footer
|
|
150
|
+
- Full control over layout
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Layout Customization
|
|
155
|
+
|
|
156
|
+
Customize specific zones without rebuilding layouts:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
// config/app.ts
|
|
160
|
+
export const appConfig: AppConfig = {
|
|
161
|
+
preset: 'admin',
|
|
162
|
+
// ...
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// App.tsx
|
|
166
|
+
<ViteAppProviders
|
|
167
|
+
config={appConfig}
|
|
168
|
+
layout={{
|
|
169
|
+
header: {
|
|
170
|
+
start: () => <CustomLogo />,
|
|
171
|
+
center: () => <SearchBar />,
|
|
172
|
+
end: () => <UserMenu />,
|
|
173
|
+
},
|
|
174
|
+
sidebar: {
|
|
175
|
+
top: () => <Branding />,
|
|
176
|
+
content: () => <CustomNavigation />,
|
|
177
|
+
bottom: () => <UserProfile />,
|
|
178
|
+
},
|
|
179
|
+
footer: () => <CustomFooter />,
|
|
180
|
+
}}
|
|
181
|
+
LandingPage={HomePage}
|
|
182
|
+
/>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Full zone override:**
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
layout={{
|
|
189
|
+
header: () => <MyCustomHeader />, // Replace entire header
|
|
190
|
+
sidebar: () => <MyCustomSidebar />, // Replace entire sidebar
|
|
191
|
+
footer: () => <MyCustomFooter />, // Replace entire footer
|
|
192
|
+
}}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Available slots:**
|
|
196
|
+
|
|
197
|
+
- `header.start`, `header.center`, `header.end` - Header zones (start=start-aligned, center=absolutely centered, end=end-aligned)
|
|
198
|
+
- `sidebar.top`, `sidebar.content`, `sidebar.bottom` - Sidebar zones
|
|
199
|
+
- `footer` - Footer component (function that returns ReactNode)
|
|
200
|
+
- `mergedbar` - Mobile navigation bar (trigger, top, content, bottom)
|
|
201
|
+
|
|
202
|
+
**Slot override behavior:**
|
|
203
|
+
- Omit property → Uses preset defaults merged with framework defaults
|
|
204
|
+
- `() => null` → Explicitly hides the slot (no content rendered)
|
|
205
|
+
- `() => ReactNode` → Custom component override
|
|
206
|
+
|
|
207
|
+
**Note:** All overrides are lazy functions `() => ReactNode | null` - components load when rendered, not in provider tree.
|
|
208
|
+
|
|
209
|
+
**Example:**
|
|
210
|
+
```typescript
|
|
211
|
+
layout={{
|
|
212
|
+
header: {
|
|
213
|
+
start: () => <CustomLogo />, // Override
|
|
214
|
+
center: () => null, // Hide
|
|
215
|
+
// end omitted → uses defaults
|
|
216
|
+
}
|
|
217
|
+
}}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## CSS Variable Overrides
|
|
221
|
+
|
|
222
|
+
Fine-tune layout dimensions via CSS variables in `themes.css`:
|
|
223
|
+
|
|
224
|
+
```css
|
|
225
|
+
/* src/themes.css */
|
|
226
|
+
:root {
|
|
227
|
+
/* Layout dimension overrides */
|
|
228
|
+
--header-height: 96px;
|
|
229
|
+
--sidebar-width: 320px;
|
|
230
|
+
--main-max-width: 1480px;
|
|
231
|
+
--section-gap: 2rem;
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Common variables:**
|
|
236
|
+
|
|
237
|
+
- `--header-height` - Header height (default varies by preset)
|
|
238
|
+
- `--sidebar-width` - Sidebar width (default varies by preset)
|
|
239
|
+
- `--footer-height` - Footer height
|
|
240
|
+
- `--main-max-width` - Content max width
|
|
241
|
+
- `--section-gap`, `--component-gap` - Spacing
|
|
242
|
+
|
|
243
|
+
**Note:** CSS variable overrides in `themes.css` take priority over framework defaults. See scaffolded `themes.css.example` for complete reference.
|
|
244
|
+
|
|
245
|
+
## Density System
|
|
246
|
+
|
|
247
|
+
Control spacing and typography scale globally:
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
// config/app.ts
|
|
251
|
+
export const appConfig: AppConfig = {
|
|
252
|
+
preset: 'admin',
|
|
253
|
+
// ...
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
// App.tsx
|
|
257
|
+
<ViteAppProviders
|
|
258
|
+
config={appConfig}
|
|
259
|
+
layout={{
|
|
260
|
+
density: 'compact', // compact | standard | expressive
|
|
261
|
+
}}
|
|
262
|
+
LandingPage={HomePage}
|
|
263
|
+
/>
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**Three densities:**
|
|
267
|
+
|
|
268
|
+
- **compact** - Dense layouts for data-heavy interfaces (admin, dashboards)
|
|
269
|
+
- **standard** - DEFAULT, balanced for readability (docs, SaaS)
|
|
270
|
+
- **expressive** - Spacious, dramatic for marketing (landing pages)
|
|
271
|
+
|
|
272
|
+
Each density uses a musical scale for harmonious typography:
|
|
273
|
+
|
|
274
|
+
- Compact: Minor Third (1.2×)
|
|
275
|
+
- Standard: Major Third (1.25×)
|
|
276
|
+
- Expressive: Perfect Fourth (1.333×)
|
|
277
|
+
|
|
278
|
+
**Per-page density:**
|
|
279
|
+
|
|
280
|
+
```typescript
|
|
281
|
+
<PageContainer density="expressive">
|
|
282
|
+
<HeroSection title="Hero" />
|
|
283
|
+
</PageContainer>
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
All spacing (`gap-sm/md/lg`) and typography automatically adjust.
|
|
287
|
+
|
|
288
|
+
## Changing Layout Preset at Runtime
|
|
289
|
+
|
|
290
|
+
Change layout preset programmatically using the store:
|
|
291
|
+
|
|
292
|
+
```typescript
|
|
293
|
+
import { useLayout } from '@donotdev/core';
|
|
294
|
+
|
|
295
|
+
function MyComponent() {
|
|
296
|
+
const setLayoutPreset = useLayout('setLayoutPreset');
|
|
297
|
+
|
|
298
|
+
return (
|
|
299
|
+
<Button onClick={() => setLayoutPreset('plain')}>
|
|
300
|
+
Switch to Plain Layout
|
|
301
|
+
</Button>
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**Note:** Preset changes apply globally to the entire app. The store is the single source of truth.
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
**7 presets. Fully customizable via slots and CSS variables.**
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Pages Setup
|
|
2
|
+
|
|
3
|
+
**For AI Agents:** Drop `*Page.tsx` files in `src/pages/`. Routes auto-discovered.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. File Naming
|
|
8
|
+
|
|
9
|
+
**Pattern:** `src/pages/**/*Page.tsx` → routes
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
src/pages/
|
|
13
|
+
├── AboutPage.tsx → /about
|
|
14
|
+
├── DashboardPage.tsx → /dashboard
|
|
15
|
+
└── blog/BlogPostPage.tsx → /blog/blog-post
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Root `/` handled separately (see step 4).
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 2. Basic Page
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
// src/pages/AboutPage.tsx
|
|
26
|
+
import { PageContainer } from '@donotdev/ui';
|
|
27
|
+
|
|
28
|
+
export default function AboutPage() {
|
|
29
|
+
return <PageContainer><h1>About</h1></PageContainer>;
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. PageMeta (Optional)
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import type { PageMeta } from '@donotdev/core';
|
|
39
|
+
import { Info } from 'lucide-react';
|
|
40
|
+
|
|
41
|
+
export const meta: PageMeta = {
|
|
42
|
+
namespace: 'about', // Translation namespace
|
|
43
|
+
icon: <Info />, // Menu icon (default: Link)
|
|
44
|
+
hideFromMenu: false, // Show in navigation
|
|
45
|
+
auth: { required: false }, // Protected route
|
|
46
|
+
};
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Options:**
|
|
50
|
+
- `route: '/custom-url'` - Override auto-generated path
|
|
51
|
+
- `route: { params: ['slug'] }` - Dynamic route `/blog/:slug`
|
|
52
|
+
- `auth: { required: true, role: 'admin' }` - Role-based access
|
|
53
|
+
- `auth: { required: true, tier: 'pro' }` - Tier-based access
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 4. Root Route
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
// src/App.tsx
|
|
61
|
+
import { ViteAppProviders } from '@donotdev/ui/vite';
|
|
62
|
+
|
|
63
|
+
export function App() {
|
|
64
|
+
return (
|
|
65
|
+
<ViteAppProviders
|
|
66
|
+
config={appConfig}
|
|
67
|
+
// HomePage.tsx in src/pages/ is automatically used for the root route "/"
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 5. Dynamic Routes
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
// src/pages/blog/BlogPostPage.tsx
|
|
79
|
+
import { useParams } from 'react-router-dom';
|
|
80
|
+
|
|
81
|
+
export const meta: PageMeta = {
|
|
82
|
+
namespace: 'blog',
|
|
83
|
+
route: { params: ['slug'] }, // → /blog/:slug
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export default function BlogPostPage() {
|
|
87
|
+
const { slug } = useParams<{ slug: string }>();
|
|
88
|
+
return <PageContainer><h1>{slug}</h1></PageContainer>;
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 6. Protected Routes
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
export const meta: PageMeta = {
|
|
98
|
+
auth: { required: true },
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export default function DashboardPage() {
|
|
102
|
+
const user = useAuth('user');
|
|
103
|
+
return <PageContainer>Welcome {user?.displayName}</PageContainer>;
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 7. Navigation
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
import { useNavigate } from '@donotdev/core';
|
|
113
|
+
import { Link } from '@donotdev/ui';
|
|
114
|
+
|
|
115
|
+
const navigate = useNavigate();
|
|
116
|
+
navigate('/about');
|
|
117
|
+
|
|
118
|
+
<Link path="/about">About</Link>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
**That's it. Drop files, get routes.**
|