@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
package/dist/index.js
CHANGED
|
@@ -9797,52 +9797,60 @@ async function mergeRootTurboJson(rootDir) {
|
|
|
9797
9797
|
// packages/tooling/src/utils/matrix.ts
|
|
9798
9798
|
init_utils();
|
|
9799
9799
|
init_pathResolver();
|
|
9800
|
+
import { createRequire as createRequire4 } from "node:module";
|
|
9800
9801
|
var cachedMatrix = null;
|
|
9801
9802
|
function getMatrixPath(mode) {
|
|
9803
|
+
try {
|
|
9804
|
+
const require3 = createRequire4(import.meta.url);
|
|
9805
|
+
const resolved = require3.resolve("@donotdev/cli/dependencies-matrix.json");
|
|
9806
|
+
if (pathExists(resolved)) {
|
|
9807
|
+
return resolved;
|
|
9808
|
+
}
|
|
9809
|
+
} catch {
|
|
9810
|
+
}
|
|
9802
9811
|
const executionMode = mode || detectExecutionMode();
|
|
9803
9812
|
if (executionMode === "development") {
|
|
9804
9813
|
const repoRoot = getRepoRoot();
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9814
|
+
if (repoRoot) {
|
|
9815
|
+
const devPath = normalizePath(
|
|
9816
|
+
repoRoot,
|
|
9817
|
+
"packages/cli/dependencies-matrix.json"
|
|
9818
|
+
);
|
|
9819
|
+
if (pathExists(devPath)) {
|
|
9820
|
+
return devPath;
|
|
9821
|
+
}
|
|
9811
9822
|
}
|
|
9812
|
-
return devPath;
|
|
9813
9823
|
}
|
|
9814
|
-
|
|
9815
|
-
const matrixPath = joinPath(cliPackagePath, "dependencies-matrix.json");
|
|
9816
|
-
if (!pathExists(matrixPath)) {
|
|
9817
|
-
throw new Error(`[PROD] Matrix not found at: ${matrixPath}`);
|
|
9818
|
-
}
|
|
9819
|
-
return matrixPath;
|
|
9824
|
+
return null;
|
|
9820
9825
|
}
|
|
9821
9826
|
function getCliVersion(mode) {
|
|
9827
|
+
try {
|
|
9828
|
+
const require3 = createRequire4(import.meta.url);
|
|
9829
|
+
const packageJsonPath = require3.resolve("@donotdev/cli/package.json");
|
|
9830
|
+
const pkg = readSync(packageJsonPath, { format: "json" });
|
|
9831
|
+
return String(pkg?.version || "0.0.0");
|
|
9832
|
+
} catch {
|
|
9833
|
+
}
|
|
9822
9834
|
const executionMode = mode || detectExecutionMode();
|
|
9823
9835
|
if (executionMode === "development") {
|
|
9824
9836
|
const repoRoot = getRepoRoot();
|
|
9825
9837
|
const cliPackageJson = joinPath(repoRoot, "packages/cli/package.json");
|
|
9826
|
-
if (
|
|
9827
|
-
|
|
9838
|
+
if (pathExists(cliPackageJson)) {
|
|
9839
|
+
const pkg = readSync(cliPackageJson, { format: "json" });
|
|
9840
|
+
return String(pkg?.version || "0.0.0");
|
|
9828
9841
|
}
|
|
9829
|
-
const pkg2 = readSync(cliPackageJson, { format: "json" });
|
|
9830
|
-
return String(pkg2?.version || "0.0.0");
|
|
9831
|
-
}
|
|
9832
|
-
const cliPackagePath = getCliRootFromBundle();
|
|
9833
|
-
const packageJsonPath = joinPath(cliPackagePath, "package.json");
|
|
9834
|
-
if (!pathExists(packageJsonPath)) {
|
|
9835
|
-
throw new Error(`[PROD] CLI package.json not found at: ${packageJsonPath}`);
|
|
9836
9842
|
}
|
|
9837
|
-
|
|
9838
|
-
return String(pkg?.version || "0.0.0");
|
|
9843
|
+
return "0.0.0";
|
|
9839
9844
|
}
|
|
9840
9845
|
function loadMatrix(mode) {
|
|
9841
9846
|
if (cachedMatrix) return cachedMatrix;
|
|
9842
9847
|
const matrixPath = getMatrixPath(mode);
|
|
9848
|
+
if (!matrixPath) {
|
|
9849
|
+
return null;
|
|
9850
|
+
}
|
|
9843
9851
|
const content = readSync(matrixPath, { format: "json" });
|
|
9844
9852
|
if (!content) {
|
|
9845
|
-
|
|
9853
|
+
return null;
|
|
9846
9854
|
}
|
|
9847
9855
|
cachedMatrix = {
|
|
9848
9856
|
matrix: content,
|
|
@@ -11151,7 +11159,11 @@ function generateScripts(templateName, options) {
|
|
|
11151
11159
|
return scripts;
|
|
11152
11160
|
}
|
|
11153
11161
|
function generatePackageJson(templateName, mode, options = {}) {
|
|
11154
|
-
const
|
|
11162
|
+
const matrixResult = loadMatrix(mode);
|
|
11163
|
+
if (!matrixResult) {
|
|
11164
|
+
throw new Error("dependencies-matrix.json not found. This command requires the matrix file.");
|
|
11165
|
+
}
|
|
11166
|
+
const { matrix, cliVersion } = matrixResult;
|
|
11155
11167
|
const template = matrix.templateMapping?.[templateName];
|
|
11156
11168
|
if (!template) {
|
|
11157
11169
|
throw new Error(`Template "${templateName}" not found in matrix`);
|
|
@@ -11201,8 +11213,8 @@ function generatePackageJson(templateName, mode, options = {}) {
|
|
|
11201
11213
|
result.peerDependencies = peerDependencies;
|
|
11202
11214
|
}
|
|
11203
11215
|
if (templateName === "consumer-root") {
|
|
11204
|
-
result.packageManager = "bun@1.3.
|
|
11205
|
-
result.engines = { node: ">=
|
|
11216
|
+
result.packageManager = "bun@1.3.5";
|
|
11217
|
+
result.engines = { node: ">=24.0.0", bun: ">=1.3.0" };
|
|
11206
11218
|
result.workspaces = ["apps/*", "entities"];
|
|
11207
11219
|
}
|
|
11208
11220
|
if (templateName === "entities") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donotdev/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Command-line interface for DoNotDev Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -37,14 +37,6 @@
|
|
|
37
37
|
"commander": "^14.0.2",
|
|
38
38
|
"fast-glob": "^3.3.3"
|
|
39
39
|
},
|
|
40
|
-
"peerDependencies": {
|
|
41
|
-
"@donotdev/core": "0.0.3"
|
|
42
|
-
},
|
|
43
|
-
"peerDependenciesMeta": {
|
|
44
|
-
"@donotdev/core": {
|
|
45
|
-
"optional": true
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
40
|
"repository": {
|
|
49
41
|
"type": "git",
|
|
50
42
|
"url": "https://github.com/donotdev/cli.git"
|
|
@@ -49,7 +49,7 @@ export function DemoLayout({
|
|
|
49
49
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
50
50
|
const location = useLocation();
|
|
51
51
|
const navigate = useNavigate();
|
|
52
|
-
const
|
|
52
|
+
const isLaptop = useMediaQuery('(min-width: 1024px)');
|
|
53
53
|
|
|
54
54
|
const handleBack = () => {
|
|
55
55
|
if (location.pathname === '/full') {
|
|
@@ -140,11 +140,11 @@ export function DemoLayout({
|
|
|
140
140
|
return (
|
|
141
141
|
<Grid
|
|
142
142
|
className="dndev-h-screen dndev-w-full dndev-overflow-hidden"
|
|
143
|
-
templateColumns={
|
|
144
|
-
areas={
|
|
143
|
+
templateColumns={isLaptop ? '280px 1fr' : '1fr'}
|
|
144
|
+
areas={isLaptop ? 'sidebar main' : 'main'}
|
|
145
145
|
gap="none"
|
|
146
146
|
>
|
|
147
|
-
{
|
|
147
|
+
{isLaptop && (
|
|
148
148
|
<GridArea
|
|
149
149
|
name="sidebar"
|
|
150
150
|
style={{
|
|
@@ -224,7 +224,7 @@ export function DemoLayout({
|
|
|
224
224
|
{/* Right side: Theme Toggle + Mobile Menu */}
|
|
225
225
|
<Stack direction="row" gap="medium" justify="end" align="center">
|
|
226
226
|
<ThemeToggle />
|
|
227
|
-
{!
|
|
227
|
+
{!isLaptop && (
|
|
228
228
|
<Sheet
|
|
229
229
|
open={isMobileMenuOpen}
|
|
230
230
|
onOpenChange={setIsMobileMenuOpen}
|
|
@@ -1,179 +1,131 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* src/themes.css */
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
--
|
|
70
|
-
--
|
|
71
|
-
--
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
--
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
=========================== */
|
|
101
|
-
--primary-foreground: var(--foreground);
|
|
102
|
-
--secondary-foreground: var(--background);
|
|
103
|
-
--accent-foreground: var(--foreground);
|
|
104
|
-
|
|
105
|
-
--success-foreground: var(--background);
|
|
106
|
-
--warning-foreground: var(--foreground);
|
|
107
|
-
--destructive-foreground: var(--background);
|
|
28
|
+
--theme-icon: 'Sun';
|
|
29
|
+
--theme-label: 'Light';
|
|
30
|
+
--theme-is-dark: 0;
|
|
31
|
+
|
|
32
|
+
/* Core colors */
|
|
33
|
+
--background: #ffffff;
|
|
34
|
+
--foreground: #09090b;
|
|
35
|
+
|
|
36
|
+
/* Surfaces */
|
|
37
|
+
--card: #ffffff;
|
|
38
|
+
--card-foreground: #09090b;
|
|
39
|
+
--popover: #ffffff;
|
|
40
|
+
--popover-foreground: #09090b;
|
|
41
|
+
|
|
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;
|
|
49
|
+
--ring: var(--primary);
|
|
50
|
+
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
=========================== */
|
|
71
|
+
DARK THEME
|
|
72
|
+
Zinc-based dark palette
|
|
73
|
+
=========================== */
|
|
115
74
|
:root.dark {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
--
|
|
126
|
-
--
|
|
127
|
-
--
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
--
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
--
|
|
155
|
-
|
|
156
|
-
--accent-foreground: var(--background);
|
|
157
|
-
|
|
158
|
-
--success-foreground: var(--foreground);
|
|
159
|
-
--warning-foreground: var(--background);
|
|
160
|
-
--destructive-foreground: var(--foreground);
|
|
75
|
+
--theme-icon: 'Moon';
|
|
76
|
+
--theme-label: 'Dark';
|
|
77
|
+
--theme-is-dark: 1;
|
|
78
|
+
|
|
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;
|
|
96
|
+
--ring: var(--primary);
|
|
97
|
+
|
|
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
|
|
165
|
-
|
|
119
|
+
Add your brand themes below
|
|
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
|
*/
|
|
@@ -25,7 +25,7 @@ export function ClientLayout({ children, serverCookies }: ClientLayoutProps) {
|
|
|
25
25
|
config={appConfig}
|
|
26
26
|
serverCookies={serverCookies}
|
|
27
27
|
layout={{
|
|
28
|
-
breadcrumbs: 'smart', // 'smart' | 'always' | 'never'
|
|
28
|
+
breadcrumbs: 'smart', // 'smart' | 'always' | 'never'
|
|
29
29
|
header: {
|
|
30
30
|
// end: () => <YourHeaderActions />,
|
|
31
31
|
},
|
|
@@ -1,20 +1,164 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
// apps/{{appName}}/src/pages/HomePage.tsx
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* @fileoverview Home page component
|
|
3
|
-
* @description
|
|
4
|
-
* @version 0.0.
|
|
6
|
+
* @description Scaffold landing page demonstrating DoNotDev framework patterns
|
|
7
|
+
* @version 0.0.4
|
|
5
8
|
* @since 0.0.1
|
|
6
|
-
* @author AMBROISE PARK Consulting
|
|
7
9
|
*/
|
|
8
10
|
|
|
9
|
-
import { HomeTemplate } from '@donotdev/templates';
|
|
10
11
|
import { Home } from 'lucide-react';
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
Button,
|
|
15
|
+
CallToAction,
|
|
16
|
+
Card,
|
|
17
|
+
Grid,
|
|
18
|
+
GridArea,
|
|
19
|
+
HeroSection,
|
|
20
|
+
RadioGroup,
|
|
21
|
+
Section,
|
|
22
|
+
Stack,
|
|
23
|
+
Text,
|
|
24
|
+
} from '@donotdev/components';
|
|
25
|
+
import {
|
|
26
|
+
useLayout,
|
|
27
|
+
useTranslation,
|
|
28
|
+
type LayoutPreset,
|
|
29
|
+
type PageMeta,
|
|
30
|
+
} from '@donotdev/core';
|
|
31
|
+
import { PageContainer, Link } from '@donotdev/ui';
|
|
32
|
+
|
|
33
|
+
const LAYOUT_PRESETS: LayoutPreset[] = [
|
|
34
|
+
'admin',
|
|
35
|
+
'docs',
|
|
36
|
+
'landing',
|
|
37
|
+
'moolti',
|
|
38
|
+
'blog',
|
|
39
|
+
'game',
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
export const NAMESPACE = 'home';
|
|
12
43
|
|
|
13
44
|
export const meta: PageMeta = {
|
|
14
|
-
|
|
45
|
+
namespace: NAMESPACE,
|
|
15
46
|
icon: <Home />,
|
|
16
47
|
};
|
|
17
48
|
|
|
18
49
|
export default function HomePage() {
|
|
19
|
-
|
|
20
|
-
|
|
50
|
+
const currentPreset = useLayout('layoutPreset');
|
|
51
|
+
const setLayoutPreset = useLayout('setLayoutPreset');
|
|
52
|
+
const { t } = useTranslation([NAMESPACE]);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<PageContainer>
|
|
56
|
+
<HeroSection
|
|
57
|
+
title={t('hero.title', "Welcome to DnDev")}
|
|
58
|
+
subtitle={t('hero.subtitle', "Your app is ready. Explore the framework patterns below.")}
|
|
59
|
+
variant="primary"
|
|
60
|
+
/>
|
|
61
|
+
|
|
62
|
+
{/* Layout Switcher */}
|
|
63
|
+
<Section title="Try Our Layouts" tone="muted" align="center">
|
|
64
|
+
<Text>
|
|
65
|
+
Pick a layout and see it change live. Set your preferred layout in
|
|
66
|
+
config/app.ts
|
|
67
|
+
</Text>
|
|
68
|
+
<RadioGroup
|
|
69
|
+
value={currentPreset || 'landing'}
|
|
70
|
+
onValueChange={(value) => setLayoutPreset(value as LayoutPreset)}
|
|
71
|
+
gridCols={3}
|
|
72
|
+
items={LAYOUT_PRESETS.map((preset) => ({
|
|
73
|
+
value: preset,
|
|
74
|
+
label: preset.charAt(0).toUpperCase() + preset.slice(1),
|
|
75
|
+
}))}
|
|
76
|
+
/>
|
|
77
|
+
</Section>
|
|
78
|
+
|
|
79
|
+
{/* Components Showcase */}
|
|
80
|
+
<Section title="Components Showcase">
|
|
81
|
+
{/* Stack Example */}
|
|
82
|
+
<Card title="Stack Component">
|
|
83
|
+
<Text variant="muted">
|
|
84
|
+
Stack creates flex containers. Default vertical, use direction="row"
|
|
85
|
+
for horizontal.
|
|
86
|
+
</Text>
|
|
87
|
+
<Stack direction="row" gap="medium">
|
|
88
|
+
<Card variant="primary" title="Item 1">
|
|
89
|
+
<Text>Horizontal</Text>
|
|
90
|
+
</Card>
|
|
91
|
+
<Card variant="accent" title="Item 2">
|
|
92
|
+
<Text>Stack</Text>
|
|
93
|
+
</Card>
|
|
94
|
+
</Stack>
|
|
95
|
+
</Card>
|
|
96
|
+
|
|
97
|
+
{/* Grid + GridArea Example */}
|
|
98
|
+
<Card title="Grid + GridArea Components">
|
|
99
|
+
<Text variant="muted">
|
|
100
|
+
Grid with named areas for complex layouts.
|
|
101
|
+
</Text>
|
|
102
|
+
<Grid
|
|
103
|
+
areas={`"header header"
|
|
104
|
+
"sidebar main"
|
|
105
|
+
"footer footer"`}
|
|
106
|
+
templateColumns="1fr 2fr"
|
|
107
|
+
gap="tight"
|
|
108
|
+
>
|
|
109
|
+
<GridArea name="header">
|
|
110
|
+
<Card variant="glass">
|
|
111
|
+
<Text>Header Header</Text>
|
|
112
|
+
</Card>
|
|
113
|
+
</GridArea>
|
|
114
|
+
<GridArea name="main">
|
|
115
|
+
<Card variant="glass">
|
|
116
|
+
<Text>Main 2fr</Text>
|
|
117
|
+
</Card>
|
|
118
|
+
</GridArea>
|
|
119
|
+
<GridArea name="sidebar">
|
|
120
|
+
<Card variant="glass">
|
|
121
|
+
<Text>Sidebar 1fr</Text>
|
|
122
|
+
</Card>
|
|
123
|
+
</GridArea>
|
|
124
|
+
<GridArea name="footer">
|
|
125
|
+
<Card variant="glass">
|
|
126
|
+
<Text>Footer Footer</Text>
|
|
127
|
+
</Card>
|
|
128
|
+
</GridArea>
|
|
129
|
+
</Grid>
|
|
130
|
+
</Card>
|
|
131
|
+
</Section>
|
|
132
|
+
|
|
133
|
+
{/* CallToAction */}
|
|
134
|
+
<CallToAction
|
|
135
|
+
title="Ready to Build?"
|
|
136
|
+
subtitle="Check out the guides folder for setup instructions."
|
|
137
|
+
primaryAction={
|
|
138
|
+
<Button
|
|
139
|
+
variant="primary"
|
|
140
|
+
render={({ children, ...props }) => (
|
|
141
|
+
<Link path="https://donotdev.com" {...props}>
|
|
142
|
+
{children}
|
|
143
|
+
</Link>
|
|
144
|
+
)}
|
|
145
|
+
>
|
|
146
|
+
Learn More
|
|
147
|
+
</Button>
|
|
148
|
+
}
|
|
149
|
+
secondaryAction={
|
|
150
|
+
<Button
|
|
151
|
+
variant="outline"
|
|
152
|
+
render={({ children, ...props }) => (
|
|
153
|
+
<Link path="https://discord.gg/fbeYWDak" {...props}>
|
|
154
|
+
{children}
|
|
155
|
+
</Link>
|
|
156
|
+
)}
|
|
157
|
+
>
|
|
158
|
+
Join Discord
|
|
159
|
+
</Button>
|
|
160
|
+
}
|
|
161
|
+
/>
|
|
162
|
+
</PageContainer>
|
|
163
|
+
);
|
|
164
|
+
}
|