@donotdev/cli 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dependencies-matrix.json +194 -110
- package/dist/bin/commands/bump.d.ts +1 -1
- package/dist/bin/commands/bump.js +103 -96
- package/dist/bin/commands/create-app.js +40 -28
- package/dist/bin/commands/create-project.js +40 -28
- package/dist/bin/commands/format.d.ts +1 -1
- package/dist/bin/commands/lint.d.ts +1 -1
- package/dist/index.js +40 -28
- package/package.json +1 -9
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +5 -5
- package/templates/app-demo/src/themes.css.example +108 -156
- package/templates/app-next/src/app/ClientLayout.tsx.example +1 -1
- package/templates/app-next/src/locales/home_en.json.example +6 -0
- package/templates/app-next/src/pages/HomePage.tsx.example +152 -8
- package/templates/app-next/src/themes.css.example +92 -140
- package/templates/app-vite/src/App.tsx.example +3 -3
- package/templates/app-vite/src/locales/home_en.json.example +6 -0
- package/templates/app-vite/src/pages/HomePage.tsx.example +149 -8
- package/templates/app-vite/src/themes.css.example +90 -138
- package/templates/root-consumer/guides/AGENT_START_HERE.md.example +297 -53
- package/templates/root-consumer/guides/COMPONENTS_ADV.md.example +360 -0
- package/templates/root-consumer/guides/COMPONENTS_ATOMIC.md.example +134 -0
- package/templates/root-consumer/guides/COMPONENTS_CRUD.md.example +70 -0
- package/templates/root-consumer/guides/COMPONENTS_UI.md.example +141 -0
- package/templates/root-consumer/guides/ENV_SETUP.md.example +14 -0
- package/templates/root-consumer/guides/INDEX.md.example +17 -25
- package/templates/root-consumer/guides/SETUP_AUTH.md.example +77 -0
- package/templates/root-consumer/guides/SETUP_BILLING.md.example +78 -0
- package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +62 -0
- package/templates/root-consumer/guides/SETUP_I18N.md.example +187 -0
- package/templates/root-consumer/guides/SETUP_LAYOUTS.md.example +126 -0
- package/templates/root-consumer/guides/SETUP_OAUTH.md.example +53 -0
- package/templates/root-consumer/guides/SETUP_PAGES.md.example +120 -0
- package/templates/root-consumer/guides/SETUP_THEMES.md.example +107 -0
- package/templates/root-consumer/guides/advanced/COOKIE_REFERENCE.md.example +252 -0
- package/templates/root-consumer/guides/{EMULATOR_SETUP.md.example → advanced/EMULATORS.md.example} +1 -1
- package/templates/root-consumer/guides/{VERSION_CONTROL.md.example → advanced/VERSION_CONTROL.md.example} +0 -7
- package/templates/root-consumer/guides/AUTH_SETUP.md.example +0 -92
- package/templates/root-consumer/guides/BILLING_SETUP.md.example +0 -120
- package/templates/root-consumer/guides/CLI.md.example +0 -293
- package/templates/root-consumer/guides/COMPONENTS.md.example +0 -875
- package/templates/root-consumer/guides/FEATURES.md.example +0 -286
- package/templates/root-consumer/guides/FRAMEWORK_OVERVIEW.md.example +0 -97
- package/templates/root-consumer/guides/FUNCTIONS.md.example +0 -177
- package/templates/root-consumer/guides/GETTING_STARTED.md.example +0 -451
- package/templates/root-consumer/guides/HOW_TO_USE.md.example +0 -296
- package/templates/root-consumer/guides/I18N_SETUP.md.example +0 -204
- package/templates/root-consumer/guides/IMPORT_PATTERNS.md.example +0 -79
- package/templates/root-consumer/guides/INSTALLATION.md.example +0 -296
- package/templates/root-consumer/guides/LAYOUTS.md.example +0 -310
- package/templates/root-consumer/guides/PAGES_SETUP.md.example +0 -123
- package/templates/root-consumer/guides/STYLING.md.example +0 -273
- package/templates/root-consumer/guides/THEMING_SETUP.md.example +0 -119
- /package/templates/root-consumer/guides/{CONFIG_SETUP.md.example → SETUP_APP_CONFIG.md.example} +0 -0
- /package/templates/root-consumer/guides/{APP_CHECK_SETUP.md.example → advanced/APP_CHECK.md.example} +0 -0
|
@@ -2,178 +2,130 @@
|
|
|
2
2
|
|
|
3
3
|
/* ===========================
|
|
4
4
|
APP-WIDE SETTINGS
|
|
5
|
-
|
|
5
|
+
Spacing, radius, shadows, animations - apply to all themes
|
|
6
6
|
=========================== */
|
|
7
7
|
:root {
|
|
8
|
-
/*
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/*
|
|
15
|
-
/* --
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/*
|
|
19
|
-
/* --
|
|
20
|
-
/* --
|
|
21
|
-
/* --routing-desktop-duration: var(--routing-default-duration); */
|
|
22
|
-
/* --routing-wide-duration: var(--routing-default-duration); */
|
|
23
|
-
|
|
24
|
-
/* Examples: */
|
|
25
|
-
/* --routing-animation: slide; */ /* Use slide animation */
|
|
26
|
-
/* --routing-animation: none; */ /* Disable animations */
|
|
27
|
-
/* --routing-default-duration: 200ms; */ /* Faster animations */
|
|
28
|
-
|
|
29
|
-
/* ===========================
|
|
30
|
-
SPACING OVERRIDES
|
|
31
|
-
Customize spacing scale
|
|
32
|
-
=========================== */
|
|
33
|
-
/* --gap-sm: 0.5rem; */ /* 8px - tight spacing */
|
|
34
|
-
/* --gap-md: 1rem; */ /* 16px - medium spacing (default) */
|
|
35
|
-
/* --gap-lg: 2rem; */ /* 32px - large spacing */
|
|
36
|
-
|
|
37
|
-
/* ===========================
|
|
38
|
-
BORDER RADIUS OVERRIDES
|
|
39
|
-
Customize component corners
|
|
40
|
-
=========================== */
|
|
41
|
-
/* --radius-interactive: var(--radius-none); */ /* Buttons, links (default: square) */
|
|
42
|
-
/* --radius-surface: var(--radius-md); */ /* Cards, dialogs (default: 8px round) */
|
|
43
|
-
/* --radius-floating: var(--radius-none); */ /* Dropdowns, popovers (default: square) */
|
|
44
|
-
|
|
45
|
-
/* ===========================
|
|
46
|
-
SHADOW OVERRIDES
|
|
47
|
-
Customize elevation
|
|
48
|
-
=========================== */
|
|
49
|
-
/* --shadow-sm: ...; */ /* Small shadows */
|
|
50
|
-
/* --shadow-md: ...; */ /* Medium shadows (default) */
|
|
51
|
-
/* --shadow-xl: ...; */ /* Large shadows */
|
|
8
|
+
/* Routing animations (fade | slide | none) */
|
|
9
|
+
/* --routing-animation: fade; */
|
|
10
|
+
/* --routing-default-duration: var(--dur-normal); */
|
|
11
|
+
|
|
12
|
+
/* Spacing scale */
|
|
13
|
+
/* --gap-sm: 0.5rem; */
|
|
14
|
+
/* --gap-md: 1rem; */
|
|
15
|
+
/* --gap-lg: 2rem; */
|
|
16
|
+
|
|
17
|
+
/* Border radius */
|
|
18
|
+
/* --radius-interactive: var(--radius-none); */
|
|
19
|
+
/* --radius-surface: var(--radius-md); */
|
|
20
|
+
/* --radius-floating: var(--radius-none); */
|
|
52
21
|
}
|
|
53
22
|
|
|
54
23
|
/* ===========================
|
|
55
|
-
LIGHT THEME
|
|
56
|
-
|
|
57
|
-
Foreground: Black
|
|
24
|
+
LIGHT THEME
|
|
25
|
+
Zinc-based neutral palette
|
|
58
26
|
=========================== */
|
|
59
27
|
:root.light {
|
|
60
28
|
--theme-icon: 'Sun';
|
|
61
29
|
--theme-label: 'Light';
|
|
62
30
|
--theme-is-dark: 0;
|
|
63
31
|
|
|
64
|
-
/*
|
|
65
|
-
1. USER SETS - 5 BRAND COLORS
|
|
66
|
-
=========================== */
|
|
67
|
-
--foreground: #000000;
|
|
32
|
+
/* Core colors */
|
|
68
33
|
--background: #ffffff;
|
|
69
|
-
--
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
=========================== */
|
|
77
|
-
--success: #047857; /* Emerald-700 - WCAG AA compliant (5.48:1 with white) */
|
|
78
|
-
--warning: #f59e0b;
|
|
79
|
-
--destructive: #dc2626;
|
|
34
|
+
--foreground: #09090b;
|
|
35
|
+
|
|
36
|
+
/* Surfaces */
|
|
37
|
+
--card: #ffffff;
|
|
38
|
+
--card-foreground: #09090b;
|
|
39
|
+
--popover: #ffffff;
|
|
40
|
+
--popover-foreground: #09090b;
|
|
80
41
|
|
|
81
|
-
/*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
--
|
|
87
|
-
--
|
|
88
|
-
--input: var(--muted);
|
|
42
|
+
/* Muted (zinc-100 / zinc-500) */
|
|
43
|
+
--muted: #f4f4f5;
|
|
44
|
+
--muted-foreground: #71717a;
|
|
45
|
+
|
|
46
|
+
/* Border & input (zinc-200) */
|
|
47
|
+
--border: #e4e4e7;
|
|
48
|
+
--input: #e4e4e7;
|
|
89
49
|
--ring: var(--primary);
|
|
90
50
|
|
|
91
|
-
|
|
92
|
-
--
|
|
93
|
-
--
|
|
94
|
-
|
|
95
|
-
--
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
--
|
|
103
|
-
--
|
|
104
|
-
|
|
105
|
-
--success-foreground:
|
|
106
|
-
--warning
|
|
107
|
-
--
|
|
51
|
+
/* Brand colors - customize these */
|
|
52
|
+
--primary: #0284c7;
|
|
53
|
+
--primary-foreground: #ffffff;
|
|
54
|
+
|
|
55
|
+
--secondary: #f4f4f5;
|
|
56
|
+
--secondary-foreground: #18181b;
|
|
57
|
+
|
|
58
|
+
--accent: #ea580c;
|
|
59
|
+
--accent-foreground: #ffffff;
|
|
60
|
+
|
|
61
|
+
/* Status colors */
|
|
62
|
+
--destructive: #dc2626;
|
|
63
|
+
--destructive-foreground: #ffffff;
|
|
64
|
+
--success: #16a34a;
|
|
65
|
+
--success-foreground: #ffffff;
|
|
66
|
+
--warning: #f59e0b;
|
|
67
|
+
--warning-foreground: #09090b;
|
|
108
68
|
}
|
|
109
69
|
|
|
110
70
|
/* ===========================
|
|
111
|
-
DARK THEME
|
|
112
|
-
|
|
113
|
-
Foreground: White
|
|
71
|
+
DARK THEME
|
|
72
|
+
Zinc-based dark palette
|
|
114
73
|
=========================== */
|
|
115
74
|
:root.dark {
|
|
116
75
|
--theme-icon: 'Moon';
|
|
117
76
|
--theme-label: 'Dark';
|
|
118
77
|
--theme-is-dark: 1;
|
|
119
78
|
|
|
120
|
-
/*
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
--
|
|
126
|
-
--
|
|
127
|
-
--
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
--
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
3. AUTO-COMPUTED - SURFACES
|
|
138
|
-
=========================== */
|
|
139
|
-
--muted: color-mix(in oklab, var(--foreground) 10%, var(--background));
|
|
140
|
-
--muted-foreground: color-mix(in oklab, var(--foreground) 75%, transparent);
|
|
141
|
-
--border: color-mix(in oklab, var(--foreground) 15%, var(--background));
|
|
142
|
-
--input: var(--muted);
|
|
79
|
+
/* Core colors */
|
|
80
|
+
--background: #09090b;
|
|
81
|
+
--foreground: #fafafa;
|
|
82
|
+
|
|
83
|
+
/* Surfaces */
|
|
84
|
+
--card: #09090b;
|
|
85
|
+
--card-foreground: #fafafa;
|
|
86
|
+
--popover: #18181b;
|
|
87
|
+
--popover-foreground: #fafafa;
|
|
88
|
+
|
|
89
|
+
/* Muted (zinc-800 / zinc-400) */
|
|
90
|
+
--muted: #27272a;
|
|
91
|
+
--muted-foreground: #a1a1aa;
|
|
92
|
+
|
|
93
|
+
/* Border & input (zinc-800) */
|
|
94
|
+
--border: #27272a;
|
|
95
|
+
--input: #27272a;
|
|
143
96
|
--ring: var(--primary);
|
|
144
97
|
|
|
145
|
-
|
|
146
|
-
--
|
|
147
|
-
--
|
|
148
|
-
|
|
149
|
-
--
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
--
|
|
157
|
-
|
|
158
|
-
--success
|
|
159
|
-
--
|
|
160
|
-
--
|
|
98
|
+
/* Brand colors - customize these */
|
|
99
|
+
--primary: #0ea5e9;
|
|
100
|
+
--primary-foreground: #ffffff;
|
|
101
|
+
|
|
102
|
+
--secondary: #27272a;
|
|
103
|
+
--secondary-foreground: #fafafa;
|
|
104
|
+
|
|
105
|
+
--accent: #f97316;
|
|
106
|
+
--accent-foreground: #ffffff;
|
|
107
|
+
|
|
108
|
+
/* Status colors */
|
|
109
|
+
--destructive: #dc2626;
|
|
110
|
+
--destructive-foreground: #ffffff;
|
|
111
|
+
--success: #16a34a;
|
|
112
|
+
--success-foreground: #ffffff;
|
|
113
|
+
--warning: #f59e0b;
|
|
114
|
+
--warning-foreground: #09090b;
|
|
161
115
|
}
|
|
162
116
|
|
|
163
117
|
/* ===========================
|
|
164
118
|
CUSTOM THEMES
|
|
119
|
+
Add your brand themes below
|
|
165
120
|
=========================== */
|
|
166
121
|
|
|
167
|
-
/* Add your custom themes here */
|
|
168
122
|
/* Example:
|
|
169
|
-
.brand {
|
|
123
|
+
:root.brand {
|
|
170
124
|
--theme-icon: 'Zap';
|
|
171
125
|
--theme-label: 'Brand';
|
|
172
|
-
--
|
|
173
|
-
--
|
|
174
|
-
--
|
|
175
|
-
|
|
176
|
-
--accent: #your-brand-accent;
|
|
177
|
-
... other variables ...
|
|
126
|
+
--theme-is-dark: 0;
|
|
127
|
+
--background: #your-color;
|
|
128
|
+
--foreground: #your-color;
|
|
129
|
+
...
|
|
178
130
|
}
|
|
179
131
|
*/
|
|
@@ -1,98 +1,342 @@
|
|
|
1
1
|
# DoNotDev Framework - Agent Quick Start
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Persona:** Lead Developer (implementation, code quality) | UX/UI Designer (UX considerations) | Expert Adviser (strategic feedback, trade-offs). **Skills:** TypeScript, React, component composition, convention-over-configuration mindset. **Critical:** ALWAYS follow conventions and trust the framework. Framework handles 90% - discover before building custom.
|
|
4
|
+
|
|
5
|
+
**When Stuck:**
|
|
6
|
+
1. Check JSDoc (hover in IDE)
|
|
7
|
+
2. Read relevant setup guide
|
|
8
|
+
3. Trust framework defaults
|
|
9
|
+
4. Ask user for clarification
|
|
10
|
+
|
|
11
|
+
**Never guess. Always verify.**
|
|
4
12
|
|
|
5
13
|
---
|
|
6
14
|
|
|
7
|
-
##
|
|
15
|
+
## ✅ Success Path: Follow These Steps
|
|
8
16
|
|
|
9
|
-
**
|
|
17
|
+
**Step 1: Install dependencies**
|
|
18
|
+
- Run `bun install` in project root
|
|
19
|
+
- Wait for completion - framework components will load correctly
|
|
20
|
+
- TypeScript imports will resolve properly
|
|
10
21
|
|
|
11
|
-
**
|
|
22
|
+
**Step 2: Create pages correctly**
|
|
23
|
+
- Name files ending in `Page.tsx` (e.g., `HomePage.tsx`)
|
|
24
|
+
- Place them in `src/pages/` folder
|
|
25
|
+
- Framework will auto-discover and route them
|
|
26
|
+
- Navigation will show them automatically
|
|
12
27
|
|
|
13
|
-
**
|
|
28
|
+
**Step 3: Configure app**
|
|
29
|
+
- Edit `src/config/app.ts` with your preset and app name
|
|
30
|
+
- Framework will use your configuration
|
|
31
|
+
- Footer and legal links will be included automatically
|
|
14
32
|
|
|
15
|
-
**
|
|
33
|
+
**Step 4: Customize via config files**
|
|
34
|
+
- Override defaults in `src/config/app.ts`
|
|
35
|
+
- Override themes in `src/themes.css`
|
|
36
|
+
- Framework preserves your changes on updates
|
|
16
37
|
|
|
17
|
-
---
|
|
18
38
|
|
|
19
|
-
|
|
39
|
+
** dndev ** is our custom CLI, dndev --help for info.
|
|
20
40
|
|
|
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
41
|
|
|
28
|
-
|
|
29
|
-
- [AUTH_SETUP.md](./AUTH_SETUP.md) - Authentication
|
|
30
|
-
- [BILLING_SETUP.md](./BILLING_SETUP.md) - Stripe subscriptions
|
|
42
|
+
**🧠 PHILOSOPHY & MINDSET (READ THIS):**
|
|
31
43
|
|
|
32
|
-
**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
**CRITICAL: ALL YOU NEED TO DO IS FOLLOW OUR NAMING CONVENTIONS + FILE STRUCTURE CONVENTIONS AND FOCUS ON THE INSIDE OF YOUR PAGES, WITH OUR COMPONENTS. EVERYTHING ELSE IS HANDLED. JUST TRUST THE FRAMEWORK AND CODE AS FEW AS POSSIBLE.**
|
|
45
|
+
|
|
46
|
+
* **Speed > Polish:** Your goal is to reach UAT (User Acceptance Testing) fast. The app should look "good enough" (80%) using standard components.
|
|
47
|
+
* **Composition > Customization:** Do not waste time writing CSS to make it "perfect" pixel-wise. Drop components, use props, move on.
|
|
48
|
+
* **Standardize:** If it looks like a standard DoNotDev app, you succeeded. If you are writing custom CSS to fight the framework, you failed.
|
|
49
|
+
* **Polishing:** Deep styling is for *after* the core functionality is approved and the User asks you to polish, with their preferred method.
|
|
50
|
+
* **Trust the Framework:** Navigation, routing, layouts, auth, themes, i18n - all handled automatically. Focus on page content only.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
**✅ STYLING STANDARDS (ALWAYS FOLLOW):**
|
|
55
|
+
|
|
56
|
+
1. **Layout Strategy:** Use `<Stack>`, `<Grid>`, and `<Section>` components to organize content. These handle spacing and alignment automatically.
|
|
57
|
+
2. **Component Props:** Leverage component-specific props and trust their defaults, only add what you really need.
|
|
58
|
+
3. **Interactions:** Prefer native component interactions. E.g., Use `<Card onClick={...}>` instead of nesting a Button inside if the whole item is actionable.
|
|
37
59
|
|
|
38
60
|
---
|
|
39
61
|
|
|
40
62
|
## Import Rules
|
|
41
63
|
|
|
64
|
+
**Root imports only:**
|
|
42
65
|
```tsx
|
|
43
|
-
// ✅ Correct
|
|
44
66
|
import { Button } from '@donotdev/components';
|
|
67
|
+
import { PageContainer } from '@donotdev/ui';
|
|
45
68
|
import { useAuth } from '@donotdev/auth';
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Type imports (strict TypeScript):**
|
|
72
|
+
```tsx
|
|
73
|
+
import type { ButtonProps } from '@donotdev/components';
|
|
46
74
|
import type { PageMeta } from '@donotdev/core';
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
47
78
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
79
|
+
## New App Setup
|
|
80
|
+
|
|
81
|
+
**CRITICAL: Follow these steps IN ORDER. Complete each step before moving to the next.**
|
|
82
|
+
|
|
83
|
+
**✅ SCAFFOLDING PHILOSOPHY:**
|
|
84
|
+
The `dndev init` or `dndev create-app` commands create files with working defaults. Your job is to UPDATE these scaffolded files with your specific needs - update values, add content, customize configuration. The scaffolded files are correctly structured and framework-ready. Preserve the structure and imports, update the values and content.
|
|
85
|
+
|
|
86
|
+
### Step 1: Create Project (if starting from scratch)
|
|
87
|
+
```bash
|
|
88
|
+
dndev init my-project-name
|
|
89
|
+
# OR if adding to existing project:
|
|
90
|
+
cd existing-project
|
|
91
|
+
dndev create-app my-app-name
|
|
51
92
|
```
|
|
52
93
|
|
|
53
|
-
|
|
94
|
+
### Step 2: Install Dependencies (REQUIRED - FIRST STEP)
|
|
95
|
+
```bash
|
|
96
|
+
cd my-project-name # or cd apps/my-app-name
|
|
97
|
+
bun install
|
|
98
|
+
```
|
|
99
|
+
**✅ CRITICAL:** Run `bun install` as the first step. This installs all framework dependencies and enables framework components to work correctly.
|
|
54
100
|
|
|
55
|
-
|
|
101
|
+
### Step 3: Configure App (REQUIRED)
|
|
102
|
+
**CRITICAL:** The scaffolding process creates these files with working defaults. UPDATE them with your specific needs - do not replace them entirely.
|
|
56
103
|
|
|
57
|
-
|
|
104
|
+
**File: `src/config/app.ts`** (scaffolded - update with your values):
|
|
105
|
+
```typescript
|
|
106
|
+
import type { AppConfig } from '@donotdev/core';
|
|
58
107
|
|
|
59
|
-
|
|
108
|
+
export const appConfig: AppConfig = {
|
|
109
|
+
preset: 'landing', // Update: Choose your preset (landing | admin | moolti | docs | blog | game | plain)
|
|
110
|
+
app: {
|
|
111
|
+
name: 'My App', // Update: Your app name
|
|
112
|
+
url: 'https://myapp.com', // Update: Your app URL
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**File: `src/config/legal.ts`** (scaffolded - update with your legal pages):
|
|
118
|
+
```typescript
|
|
119
|
+
export const legalConfig = {
|
|
120
|
+
// Update: Add your legal pages (privacy, terms, etc.)
|
|
121
|
+
};
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**File: `vite.config.ts`** (scaffolded - already configured correctly):
|
|
125
|
+
```typescript
|
|
126
|
+
import { defineViteConfig } from '@donotdev/core/vite';
|
|
127
|
+
import { appConfig } from './src/config/app';
|
|
128
|
+
|
|
129
|
+
export default defineViteConfig({
|
|
130
|
+
appConfig, // Already configured - framework imports your appConfig
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**✅ UPDATE STRATEGY:**
|
|
135
|
+
- Scaffolded files are already correctly structured
|
|
136
|
+
- Update values (app name, preset, URLs) to match your needs
|
|
137
|
+
- Keep the file structure and imports as-is
|
|
138
|
+
- Framework expects these exact file paths and exports
|
|
139
|
+
|
|
140
|
+
**✅ CORRECT FILE PATHS:**
|
|
141
|
+
- `src/config/app.ts` - Place in `src/config/` folder
|
|
142
|
+
- `src/config/legal.ts` - Place in `src/config/` folder
|
|
143
|
+
- `vite.config.ts` - Place at project root (same level as `package.json`)
|
|
144
|
+
- `src/pages/*Page.tsx` - Place in `src/pages/` folder
|
|
145
|
+
|
|
146
|
+
### Step 4: Add Logo (Optional but recommended)
|
|
147
|
+
Drop `logo.svg` in `public/` folder. Framework auto-generates favicon, icons, PWA assets.
|
|
148
|
+
|
|
149
|
+
### Step 5: Create or Update Pages
|
|
150
|
+
**Scaffolding creates `src/pages/HomePage.tsx` with a working example. UPDATE it with your content:**
|
|
60
151
|
|
|
61
152
|
```tsx
|
|
62
|
-
|
|
63
|
-
|
|
153
|
+
import { PageContainer } from '@donotdev/ui';
|
|
154
|
+
|
|
155
|
+
export default function HomePage() {
|
|
156
|
+
return <PageContainer><h1>Hello</h1></PageContainer>;
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**✅ UPDATE STRATEGY:**
|
|
161
|
+
- Scaffolded `HomePage.tsx` is already correctly structured
|
|
162
|
+
- Update the content inside `PageContainer` with your components
|
|
163
|
+
- Keep the imports and export structure as-is
|
|
164
|
+
- Add more pages by creating new `*Page.tsx` files in `src/pages/`
|
|
165
|
+
|
|
166
|
+
### Step 6: Verify Setup (BEFORE running dev)
|
|
167
|
+
**Check these files exist:**
|
|
168
|
+
- ✅ `src/config/app.ts` exists
|
|
169
|
+
- ✅ `vite.config.ts` exists and imports `appConfig` from `src/config/app.ts`
|
|
170
|
+
- ✅ `src/pages/HomePage.tsx` exists (or at least one `*Page.tsx` file)
|
|
171
|
+
- ✅ `package.json` exists with `@donotdev/*` dependencies
|
|
172
|
+
- ✅ `bun install` completed successfully
|
|
64
173
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</Card>
|
|
174
|
+
### Step 7: Run Development Server
|
|
175
|
+
```bash
|
|
176
|
+
bun run dev
|
|
69
177
|
```
|
|
70
178
|
|
|
71
|
-
**
|
|
179
|
+
**Expected output:**
|
|
180
|
+
- Server starts on `http://localhost:5173` (or configured port)
|
|
181
|
+
- No "Cannot find module" errors
|
|
182
|
+
- Browser shows your app (may show watermark if no license key)
|
|
183
|
+
|
|
184
|
+
**If you see errors:**
|
|
185
|
+
1. **"Cannot find module '@donotdev/...'"** → Run `bun install` again
|
|
186
|
+
2. **"Cannot find module './src/config/app'"** → Check `vite.config.ts` path is correct
|
|
187
|
+
3. **"No routes found"** → Check you have `*Page.tsx` files in `src/pages/`
|
|
188
|
+
4. **TypeScript errors** → Run `bun run type-check` to see details
|
|
189
|
+
|
|
190
|
+
**✅ ALWAYS DO:**
|
|
191
|
+
- Run `bun install` first - required for dependencies
|
|
192
|
+
- Create pages in `src/pages/` folder - framework discovers them automatically
|
|
193
|
+
- Name files ending in `Page.tsx` - framework routes them automatically
|
|
194
|
+
- Trust framework defaults - routing, navigation, layouts are automatic
|
|
195
|
+
- Use preset components - LanguageSelector, ThemeToggle, AuthMenu are included automatically
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Generic Conventions
|
|
200
|
+
|
|
201
|
+
**File Routing Rule: Only files ending in `Page.tsx` inside `src/pages` become routes.**
|
|
202
|
+
|
|
203
|
+
**✅ ROUTING RULES:**
|
|
204
|
+
- Name files with `Page.tsx` suffix (e.g., `HomePage.tsx`, `AboutPage.tsx`)
|
|
205
|
+
- Place files inside `src/pages/` directory (or subdirectories)
|
|
206
|
+
- Framework auto-discovers routes from `src/pages/*Page.tsx` files
|
|
207
|
+
- Framework automatically generates navigation from discovered routes
|
|
208
|
+
|
|
209
|
+
**Routing:** Drop `*Page.tsx` files in `src/pages/**` → auto-discovered. Use `PageMeta` for routes, auth, icons.
|
|
210
|
+
|
|
211
|
+
**i18n:** Drop `<namespace>_<lng>.json` in `/locales` (eager) or `/pages/locales` (lazy). Framework auto-discovers languages.
|
|
212
|
+
|
|
213
|
+
**Themes:** Override CSS variables in `src/themes.css`. Framework auto-computes surfaces, borders, text colors.
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Success Checklist
|
|
218
|
+
|
|
219
|
+
**✅ Follow these to ensure success:**
|
|
220
|
+
|
|
221
|
+
1. **✅ Always name pages with `Page.tsx` suffix** - Example: `HomePage.tsx`, `AboutPage.tsx`
|
|
222
|
+
2. **✅ Always run `bun install` first** - Required before any other commands
|
|
223
|
+
3. **✅ Trust framework routing** - Framework auto-discovers routes from `src/pages/*Page.tsx`
|
|
224
|
+
4. **✅ Use preset components** - LanguageSelector, ThemeToggle, AuthMenu are included automatically
|
|
225
|
+
5. **✅ Configure via config files** - Edit `src/config/app.ts`, never modify `node_modules`
|
|
226
|
+
6. **✅ Create pages in `src/pages/` folder** - Framework discovers them automatically
|
|
227
|
+
7. **✅ Configure `src/config/app.ts`** - Set your preset and app name
|
|
228
|
+
8. **✅ Run `bun install` before `bun run dev`** - Dependencies must be installed first
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Landing Page Example
|
|
72
233
|
|
|
73
234
|
```tsx
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
235
|
+
import { PageContainer } from '@donotdev/ui';
|
|
236
|
+
import { HeroSection, Section, Card, CallToAction, Button, Grid, Stack } from '@donotdev/components';
|
|
237
|
+
|
|
238
|
+
export default function HomePage() {
|
|
239
|
+
return (
|
|
240
|
+
<PageContainer>
|
|
241
|
+
<HeroSection
|
|
242
|
+
title="Welcome"
|
|
243
|
+
subtitle="Build fast with DoNotDev"
|
|
244
|
+
variant="primary"
|
|
245
|
+
/>
|
|
246
|
+
|
|
247
|
+
<Section title="Features" gridCols={3}>
|
|
248
|
+
<Card title="Fast" content="Lightning fast development" />
|
|
249
|
+
<Card title="Simple" content="Zero configuration needed" />
|
|
250
|
+
<Card title="Powerful" content="Enterprise-grade features" />
|
|
251
|
+
</Section>
|
|
252
|
+
|
|
253
|
+
<Section title="Layout Examples">
|
|
254
|
+
<Grid cols={[1, 1, 2, 2]} gap="medium">
|
|
255
|
+
<Card title="Left Column" />
|
|
256
|
+
<Card title="Right Column" />
|
|
257
|
+
</Grid>
|
|
258
|
+
|
|
259
|
+
<Stack direction="row" gap="medium">
|
|
260
|
+
<Button variant="primary">Primary</Button>
|
|
261
|
+
<Button variant="outline">Secondary</Button>
|
|
262
|
+
</Stack>
|
|
263
|
+
</Section>
|
|
264
|
+
|
|
265
|
+
<CallToAction
|
|
266
|
+
title="Get Started"
|
|
267
|
+
subtitle="Ready to build?"
|
|
268
|
+
primaryAction={<Button variant="primary">Sign Up</Button>}
|
|
269
|
+
secondaryAction={<Button variant="outline">Learn More</Button>}
|
|
270
|
+
/>
|
|
271
|
+
</PageContainer>
|
|
272
|
+
);
|
|
273
|
+
}
|
|
83
274
|
```
|
|
84
275
|
|
|
85
276
|
---
|
|
86
277
|
|
|
87
|
-
|
|
278
|
+
---
|
|
88
279
|
|
|
89
|
-
|
|
90
|
-
2. Read relevant setup guide
|
|
91
|
-
3. Trust framework defaults
|
|
92
|
-
4. Ask user for clarification
|
|
280
|
+
## Required File Structure
|
|
93
281
|
|
|
94
|
-
**
|
|
282
|
+
**CRITICAL:** Your project MUST have this exact structure:
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
my-project/
|
|
286
|
+
├── package.json # At root - contains dependencies
|
|
287
|
+
├── vite.config.ts # At root - imports appConfig
|
|
288
|
+
├── src/
|
|
289
|
+
│ ├── config/
|
|
290
|
+
│ │ ├── app.ts # REQUIRED - app configuration
|
|
291
|
+
│ │ └── legal.ts # REQUIRED - legal pages config
|
|
292
|
+
│ ├── pages/
|
|
293
|
+
│ │ └── HomePage.tsx # Your pages (must end in Page.tsx)
|
|
294
|
+
│ ├── App.tsx # App entry point
|
|
295
|
+
│ └── main.tsx # Vite entry point
|
|
296
|
+
└── public/
|
|
297
|
+
└── logo.svg # Optional - framework generates assets
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**✅ CORRECT FILE PATHS EXAMPLES:**
|
|
301
|
+
- ✅ `src/config/app.ts` (correct location)
|
|
302
|
+
- ✅ `src/pages/HomePage.tsx` (correct location)
|
|
303
|
+
- ✅ `src/pages/AboutPage.tsx` (correct - in pages subfolder)
|
|
304
|
+
- ✅ `src/pages/blog/BlogPostPage.tsx` (correct - nested pages work)
|
|
95
305
|
|
|
96
306
|
---
|
|
97
307
|
|
|
98
|
-
|
|
308
|
+
## Troubleshooting
|
|
309
|
+
|
|
310
|
+
### "Cannot find module '@donotdev/...'"
|
|
311
|
+
**Solution:** Run `bun install` in the project root. Dependencies must be installed before running the app.
|
|
312
|
+
|
|
313
|
+
### "No routes found"
|
|
314
|
+
**Solution:**
|
|
315
|
+
1. Check files are in `src/pages/` folder
|
|
316
|
+
2. Check files end in `Page.tsx` (not `.tsx` or `.ts`)
|
|
317
|
+
3. Check files are exported as default: `export default function HomePage()`
|
|
318
|
+
|
|
319
|
+
### "Cannot find module './src/config/app'"
|
|
320
|
+
**Solution:**
|
|
321
|
+
1. Check `vite.config.ts` is at project root (same level as `package.json`)
|
|
322
|
+
2. Check `src/config/app.ts` exists
|
|
323
|
+
3. Check import path in `vite.config.ts`: `import { appConfig } from './src/config/app';`
|
|
324
|
+
|
|
325
|
+
### App shows blank page
|
|
326
|
+
**Solution:**
|
|
327
|
+
1. Check browser console for errors
|
|
328
|
+
2. Verify at least one `*Page.tsx` file exists in `src/pages/`
|
|
329
|
+
3. Verify `vite.config.ts` imports `appConfig` correctly
|
|
330
|
+
4. Check `src/App.tsx` uses `ViteAppProviders` with `config={appConfig}`
|
|
331
|
+
|
|
332
|
+
### TypeScript errors
|
|
333
|
+
**Solution:**
|
|
334
|
+
1. Run `bun run type-check` to see all errors
|
|
335
|
+
2. Ensure all `@donotdev/*` packages are installed
|
|
336
|
+
3. Check imports use root package names: `@donotdev/components`, not deep paths
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
**Component references:** [COMPONENTS_ATOMIC.md](./COMPONENTS_ATOMIC.md) | [COMPONENTS_UI.md](./COMPONENTS_UI.md) | [COMPONENTS_CRUD.md](./COMPONENTS_CRUD.md)
|
|
341
|
+
|
|
342
|
+
**Full guides:** [INDEX.md](./INDEX.md) - 50-100 LOC per topic (SETUP_*.md, advanced/*.md)
|