@donotdev/cli 0.0.17 → 0.0.19
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 +67 -60
- package/dist/bin/commands/coach.js +8177 -0
- package/dist/bin/commands/create-app.js +94 -145
- package/dist/bin/commands/create-project.js +98 -149
- package/dist/bin/commands/deploy.js +81 -59
- package/dist/bin/commands/doctor.js +243 -698
- package/dist/bin/commands/emu.js +2 -2
- package/dist/bin/commands/format.js +4 -1
- package/dist/bin/commands/get-demo.js +8351 -0
- package/dist/bin/commands/make-admin.js +773 -152
- package/dist/bin/commands/setup.js +519 -1711
- package/dist/bin/commands/staging.js +17852 -0
- package/dist/bin/commands/sync-secrets.js +2 -11
- package/dist/bin/commands/type-check.js +7733 -1713
- package/dist/bin/dndev.js +913 -182
- package/dist/bin/donotdev.js +913 -182
- package/dist/index.js +191 -211
- package/package.json +1 -1
- package/templates/app-demo/index.html.example +147 -10
- package/templates/app-demo/src/App.tsx.example +7 -13
- package/templates/app-demo/src/config/app.ts.example +12 -48
- package/templates/app-demo/src/entities/product.ts.example +38 -0
- package/templates/app-demo/src/globals.css.example +5 -1
- package/templates/app-demo/src/main.tsx.example +13 -7
- package/templates/app-demo/src/pages/ChangelogPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/DashboardPage.tsx.example +15 -0
- package/templates/app-demo/src/pages/HomePage.tsx.example +3 -77
- package/templates/app-demo/src/pages/PricingPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/ProductsPage.tsx.example +17 -0
- package/templates/app-demo/src/pages/ProfilePage.tsx.example +16 -0
- package/templates/app-demo/src/pages/SettingsPage.tsx.example +15 -0
- package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +112 -0
- package/templates/app-demo/src/pages/ShowcasePage.tsx.example +91 -0
- package/templates/app-demo/src/pages/legal/LegalPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/legal/PrivacyPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/legal/TermsPage.tsx.example +14 -0
- package/templates/app-demo/tsconfig.json.example +1 -1
- package/templates/app-demo/vite.config.ts.example +23 -48
- package/templates/app-expo/README.md.example +1 -1
- package/templates/app-expo/app/index.tsx.example +1 -1
- package/templates/app-vite/src/pages/HomePage.tsx.example +8 -10
- package/templates/overlay-firebase/env.fragment.example +1 -1
- package/templates/overlay-firebase/env.fragment.expo.example +1 -1
- package/templates/overlay-firebase/env.fragment.nextjs.example +1 -1
- package/templates/overlay-supabase/env.fragment.example +1 -1
- package/templates/overlay-supabase/env.fragment.expo.example +1 -1
- package/templates/overlay-supabase/env.fragment.nextjs.example +1 -1
- package/templates/overlay-vercel/env.fragment.example +1 -1
- package/templates/overlay-vercel/env.fragment.nextjs.example +1 -1
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +15 -1
- package/templates/root-consumer/.claude/commands/build.md.example +24 -2
- package/templates/root-consumer/.claude/commands/design.md.example +17 -0
- package/templates/root-consumer/.claude/commands/polish.md.example +17 -0
- package/templates/root-consumer/AI.md.example +54 -21
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +21 -6
- package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +16 -179
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +19 -21
- package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +14 -3
- package/templates/root-consumer/guides/dndev/INDEX.md.example +2 -2
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +3 -3
- package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +19 -2
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +35 -1
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +17 -12
- package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +32 -0
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +1 -1
- package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +74 -6
- package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +2 -2
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +17 -12
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +37 -16
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +18 -18
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +119 -2
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +1 -1
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +14 -0
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +6 -0
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +14 -0
- package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +4 -5
- package/templates/root-consumer/guides/wai-way/page_patterns.md.example +2 -2
- package/dist/bin/commands/agent-setup.d.ts +0 -6
- package/dist/bin/commands/agent-setup.d.ts.map +0 -1
- package/dist/bin/commands/agent-setup.js.map +0 -1
- package/dist/bin/commands/build.d.ts +0 -11
- package/dist/bin/commands/build.d.ts.map +0 -1
- package/dist/bin/commands/build.js.map +0 -1
- package/dist/bin/commands/bump.d.ts +0 -11
- package/dist/bin/commands/bump.d.ts.map +0 -1
- package/dist/bin/commands/bump.js.map +0 -1
- package/dist/bin/commands/cacheout.d.ts +0 -11
- package/dist/bin/commands/cacheout.d.ts.map +0 -1
- package/dist/bin/commands/cacheout.js.map +0 -1
- package/dist/bin/commands/create-app.d.ts +0 -11
- package/dist/bin/commands/create-app.d.ts.map +0 -1
- package/dist/bin/commands/create-app.js.map +0 -1
- package/dist/bin/commands/create-project.d.ts +0 -11
- package/dist/bin/commands/create-project.d.ts.map +0 -1
- package/dist/bin/commands/create-project.js.map +0 -1
- package/dist/bin/commands/deploy.d.ts +0 -11
- package/dist/bin/commands/deploy.d.ts.map +0 -1
- package/dist/bin/commands/deploy.js.map +0 -1
- package/dist/bin/commands/dev.d.ts +0 -11
- package/dist/bin/commands/dev.d.ts.map +0 -1
- package/dist/bin/commands/dev.js.map +0 -1
- package/dist/bin/commands/doctor.d.ts +0 -6
- package/dist/bin/commands/doctor.d.ts.map +0 -1
- package/dist/bin/commands/doctor.js.map +0 -1
- package/dist/bin/commands/emu.d.ts +0 -11
- package/dist/bin/commands/emu.d.ts.map +0 -1
- package/dist/bin/commands/emu.js.map +0 -1
- package/dist/bin/commands/format.d.ts +0 -11
- package/dist/bin/commands/format.d.ts.map +0 -1
- package/dist/bin/commands/format.js.map +0 -1
- package/dist/bin/commands/make-admin.d.ts +0 -11
- package/dist/bin/commands/make-admin.d.ts.map +0 -1
- package/dist/bin/commands/make-admin.js.map +0 -1
- package/dist/bin/commands/preview.d.ts +0 -11
- package/dist/bin/commands/preview.d.ts.map +0 -1
- package/dist/bin/commands/preview.js.map +0 -1
- package/dist/bin/commands/setup.d.ts +0 -6
- package/dist/bin/commands/setup.d.ts.map +0 -1
- package/dist/bin/commands/setup.js.map +0 -1
- package/dist/bin/commands/sync-secrets.d.ts +0 -11
- package/dist/bin/commands/sync-secrets.d.ts.map +0 -1
- package/dist/bin/commands/sync-secrets.js.map +0 -1
- package/dist/bin/commands/type-check.d.ts +0 -14
- package/dist/bin/commands/type-check.d.ts.map +0 -1
- package/dist/bin/commands/type-check.js.map +0 -1
- package/dist/bin/commands/wai.d.ts +0 -11
- package/dist/bin/commands/wai.d.ts.map +0 -1
- package/dist/bin/commands/wai.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/templates/app-demo/src/components/ThemeToggle.tsx.example +0 -48
- package/templates/app-demo/src/pages/DetailPage.tsx.example +0 -103
- package/templates/app-demo/src/pages/FullPage.tsx.example +0 -142
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +0 -266
- package/templates/app-demo/src/pages/components/LayoutRoute.tsx.example +0 -20
- package/templates/functions-firebase/functions-firebase/README.md.example +0 -123
- package/templates/functions-firebase/functions-firebase/build.mjs.example +0 -5
- package/templates/functions-firebase/functions-firebase/src/auth/getCustomClaims.ts.example +0 -19
- package/templates/functions-firebase/functions-firebase/src/auth/getUserAuthStatus.ts.example +0 -21
- package/templates/functions-firebase/functions-firebase/src/auth/index.ts.example +0 -11
- package/templates/functions-firebase/functions-firebase/src/auth/removeCustomClaims.ts.example +0 -21
- package/templates/functions-firebase/functions-firebase/src/auth/setCustomClaims.ts.example +0 -21
- package/templates/functions-firebase/functions-firebase/src/billing/handleStripeWebhook.ts.example +0 -24
- package/templates/functions-firebase/functions-firebase/src/billing/index.ts.example +0 -10
- package/templates/functions-firebase/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/index.ts.example +0 -39
- package/templates/functions-firebase/functions-firebase/src/oauth/checkGitHubAccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/disconnect.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/exchangeToken.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/getConnections.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/grantGitHubAccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/index.ts.example +0 -17
- package/templates/functions-firebase/functions-firebase/src/oauth/refreshToken.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/oauth/revokeGitHubAccess.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/tsconfig.json.example +0 -21
- package/templates/functions-vercel/functions-vercel/README.md.example +0 -116
- package/templates/functions-vercel/functions-vercel/build.mjs.example +0 -52
- package/templates/functions-vercel/functions-vercel/src/api/auth/getCustomClaims.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/auth/getUserAuthStatus.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/auth/removeCustomClaims.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/auth/setCustomClaims.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/createEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/deleteEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/getEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/listEntities.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/crud/updateEntity.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/disconnect.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/exchangeToken.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/getConnections.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/refreshToken.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/src/api/oauth/revokeGitHubAccess.ts.example +0 -20
- package/templates/functions-vercel/functions-vercel/tsconfig.json.example +0 -21
- package/templates/functions-vercel/functions-vercel/vercel.json.example +0 -14
- package/templates/github/github/workflows/firebase-deploy.yml.example +0 -79
- /package/templates/functions-firebase/{functions-firebase/.env.example.example → .env.example} +0 -0
- /package/templates/functions-vercel/{functions-vercel/.env.example.example → .env.example} +0 -0
|
@@ -1,24 +1,161 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
+
|
|
3
4
|
<head>
|
|
4
5
|
<meta charset="UTF-8" />
|
|
6
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
|
+
|
|
8
|
+
<!-- Meta tags -->
|
|
5
9
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>DoNotDev
|
|
7
|
-
|
|
8
|
-
<!--
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
<title>DoNotDev Demo</title>
|
|
11
|
+
|
|
12
|
+
<!-- Fonts: Inter, Space Grotesk, Playfair, Roboto from @donotdev/ui/dndev.css (bundled). -->
|
|
13
|
+
|
|
14
|
+
<!-- ✅ CRITICAL CSS: ECG waveform loader -->
|
|
11
15
|
<style>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
/* Critical above-the-fold styles */
|
|
17
|
+
html, body {
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
22
|
+
body {
|
|
23
|
+
font-family: 'Inter', var(--font-family, ui-sans-serif, system-ui, -apple-system, sans-serif);
|
|
24
|
+
line-height: 1.5;
|
|
25
|
+
-webkit-font-smoothing: antialiased;
|
|
26
|
+
-moz-osx-font-smoothing: grayscale;
|
|
27
|
+
background: #ffffff;
|
|
28
|
+
color: #000000;
|
|
29
|
+
}
|
|
30
|
+
@media (prefers-color-scheme: dark) {
|
|
31
|
+
body {
|
|
32
|
+
background: #000000;
|
|
33
|
+
color: #ffffff;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/* Critical shell loader styles - pure CSS, instant render */
|
|
37
|
+
#shell-loader {
|
|
38
|
+
position: fixed;
|
|
39
|
+
inset: 0;
|
|
15
40
|
background: #000000;
|
|
16
|
-
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
z-index: 9999;
|
|
45
|
+
opacity: 1;
|
|
46
|
+
transition: opacity 0.3s ease-out;
|
|
47
|
+
will-change: opacity;
|
|
48
|
+
margin: 0;
|
|
49
|
+
padding: 0;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
}
|
|
52
|
+
#shell-loader.shell-loader--fading {
|
|
53
|
+
opacity: 0;
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
}
|
|
56
|
+
.shell-loader__content {
|
|
57
|
+
text-align: center;
|
|
58
|
+
color: white;
|
|
59
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
|
|
60
|
+
width: 100%;
|
|
61
|
+
max-width: 500px;
|
|
62
|
+
margin: 0;
|
|
63
|
+
padding: 0;
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
line-height: 1.2;
|
|
66
|
+
}
|
|
67
|
+
.shell-loader__brand {
|
|
68
|
+
display: block;
|
|
69
|
+
font-size: clamp(3rem, 10vw, 5rem);
|
|
70
|
+
font-weight: 800;
|
|
71
|
+
letter-spacing: -0.05em;
|
|
72
|
+
margin: 0 0 1rem 0;
|
|
73
|
+
padding: 0;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
}
|
|
76
|
+
/* ECG Waveform Animation */
|
|
77
|
+
.shell-loader__dots {
|
|
78
|
+
display: block;
|
|
79
|
+
width: 300px;
|
|
80
|
+
height: 60px;
|
|
81
|
+
margin: 0 auto;
|
|
82
|
+
padding: 0;
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
}
|
|
85
|
+
.shell-loader__dots svg {
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 100%;
|
|
88
|
+
display: block;
|
|
89
|
+
}
|
|
90
|
+
.shell-loader__dots path {
|
|
91
|
+
stroke: #667eea;
|
|
92
|
+
stroke-width: 3;
|
|
93
|
+
fill: none;
|
|
94
|
+
stroke-linecap: round;
|
|
95
|
+
stroke-linejoin: round;
|
|
96
|
+
stroke-dasharray: 400;
|
|
97
|
+
stroke-dashoffset: 400;
|
|
98
|
+
animation: ecg-draw 2s linear infinite;
|
|
99
|
+
}
|
|
100
|
+
@keyframes ecg-draw {
|
|
101
|
+
0% {
|
|
102
|
+
stroke-dashoffset: 400;
|
|
103
|
+
opacity: 0;
|
|
104
|
+
}
|
|
105
|
+
10% {
|
|
106
|
+
opacity: 1;
|
|
107
|
+
}
|
|
108
|
+
70% {
|
|
109
|
+
stroke-dashoffset: 0;
|
|
110
|
+
opacity: 1;
|
|
111
|
+
}
|
|
112
|
+
90%, 100% {
|
|
113
|
+
stroke-dashoffset: 0;
|
|
114
|
+
opacity: 0;
|
|
115
|
+
}
|
|
17
116
|
}
|
|
18
117
|
</style>
|
|
118
|
+
|
|
119
|
+
<!-- ✅ THEME DETECTION: Force dark on first visit, remember user choice -->
|
|
120
|
+
<script>
|
|
121
|
+
(function () {
|
|
122
|
+
'use strict';
|
|
123
|
+
|
|
124
|
+
function getInitialTheme() {
|
|
125
|
+
try {
|
|
126
|
+
var saved = localStorage.getItem('dndev-theme');
|
|
127
|
+
if (saved) {
|
|
128
|
+
return saved;
|
|
129
|
+
}
|
|
130
|
+
return 'dark';
|
|
131
|
+
} catch (e) {
|
|
132
|
+
return 'dark';
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
var theme = getInitialTheme();
|
|
137
|
+
document.documentElement.className = theme;
|
|
138
|
+
})();
|
|
139
|
+
</script>
|
|
19
140
|
</head>
|
|
141
|
+
|
|
20
142
|
<body>
|
|
143
|
+
<!-- ✅ SHELL LOADER: Branded loading experience before React loads -->
|
|
144
|
+
<div id="shell-loader">
|
|
145
|
+
<div class="shell-loader__content">
|
|
146
|
+
<span class="shell-loader__brand">DoNotDev</span>
|
|
147
|
+
<span class="shell-loader__dots">
|
|
148
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 60" preserveAspectRatio="xMidYMid meet">
|
|
149
|
+
<path d="M0,30 L100,30 L110,20 L120,30 L130,30 L140,5 L150,55 L160,30 L175,30 L190,20 L205,30 L300,30" />
|
|
150
|
+
</svg>
|
|
151
|
+
</span>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<!-- React mounts here -->
|
|
21
156
|
<div id="root"></div>
|
|
157
|
+
|
|
22
158
|
<script type="module" src="/src/main.tsx"></script>
|
|
23
159
|
</body>
|
|
24
|
-
|
|
160
|
+
|
|
161
|
+
</html>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
// apps/demo/src/App.tsx
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
|
-
* @fileoverview Main application component
|
|
3
|
-
* @description Root application
|
|
4
|
-
* @version 0.0.
|
|
4
|
+
* @fileoverview Main application component for the demo app
|
|
5
|
+
* @description Root component that configures the application with Vite providers and layout.
|
|
6
|
+
* @version 0.0.5
|
|
5
7
|
* @since 0.0.1
|
|
6
8
|
* @author AMBROISE PARK Consulting
|
|
7
9
|
*/
|
|
8
10
|
|
|
9
11
|
import { ViteAppProviders } from '@donotdev/ui/vite';
|
|
10
12
|
|
|
11
|
-
import './config/providers';
|
|
12
13
|
import { appConfig } from './config/app';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -20,17 +21,10 @@ import { appConfig } from './config/app';
|
|
|
20
21
|
*
|
|
21
22
|
* Note: HomePage.tsx in src/pages/ is automatically used for the root route "/"
|
|
22
23
|
*
|
|
23
|
-
* @version 0.0.
|
|
24
|
+
* @version 0.0.5
|
|
24
25
|
* @since 0.0.1
|
|
25
26
|
* @author AMBROISE PARK Consulting
|
|
26
27
|
*/
|
|
27
28
|
export function App() {
|
|
28
|
-
return
|
|
29
|
-
<ViteAppProviders
|
|
30
|
-
config={appConfig}
|
|
31
|
-
layout={{
|
|
32
|
-
breadcrumbs: 'smart', // 'smart' | 'always' | 'never'
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
29
|
+
return <ViteAppProviders config={appConfig} layout={{ breadcrumbs: 'smart' }} />;
|
|
36
30
|
}
|
|
@@ -1,46 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Application configuration
|
|
3
|
-
* @description Defines application metadata and feature flags
|
|
4
|
-
* @version 0.0
|
|
3
|
+
* @description Defines application metadata, layout preset, and feature flags
|
|
4
|
+
* @version 0.1.0
|
|
5
5
|
* @since 0.0.1
|
|
6
6
|
* @author AMBROISE PARK Consulting
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { AppConfig } from '@donotdev/core';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* @version 0.0.1
|
|
15
|
-
* @since 0.0.1
|
|
16
|
-
* @author AMBROISE PARK Consulting
|
|
17
|
-
*/
|
|
18
|
-
export const APP_NAME = '{{appName}}';
|
|
11
|
+
export const APP_NAME = 'DoNotDev';
|
|
12
|
+
export const APP_SHORT_NAME = 'DoNotDev';
|
|
13
|
+
export const APP_DESCRIPTION = 'DoNotDev SaaS Template';
|
|
19
14
|
|
|
20
15
|
/**
|
|
21
|
-
* Application
|
|
16
|
+
* Application configuration
|
|
22
17
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @author AMBROISE PARK Consulting
|
|
26
|
-
*/
|
|
27
|
-
export const APP_SHORT_NAME = '{{appShortName}}';
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Application description constant
|
|
31
|
-
*
|
|
32
|
-
* @version 0.0.1
|
|
33
|
-
* @since 0.0.1
|
|
34
|
-
* @author AMBROISE PARK Consulting
|
|
35
|
-
*/
|
|
36
|
-
export const APP_DESCRIPTION = 'DoNotDev Components Demo';
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Application configuration object
|
|
40
|
-
*
|
|
41
|
-
* @version 0.0.1
|
|
42
|
-
* @since 0.0.1
|
|
43
|
-
* @author AMBROISE PARK Consulting
|
|
18
|
+
* - preset: 'landing' is the app default. Pages can override via PageMeta.preset.
|
|
19
|
+
* - auth: Configure auth routes and menu items.
|
|
44
20
|
*/
|
|
45
21
|
export const appConfig: AppConfig = {
|
|
46
22
|
app: {
|
|
@@ -48,21 +24,9 @@ export const appConfig: AppConfig = {
|
|
|
48
24
|
shortName: APP_SHORT_NAME,
|
|
49
25
|
description: APP_DESCRIPTION,
|
|
50
26
|
},
|
|
51
|
-
preset: 'landing',
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
27
|
+
preset: 'landing',
|
|
28
|
+
auth: {
|
|
29
|
+
authRoute: '/pricing',
|
|
30
|
+
profilePath: '/profile',
|
|
55
31
|
},
|
|
56
|
-
// Optional: Override query cache defaults
|
|
57
|
-
// Framework defaults (infinite cache - cost-optimized):
|
|
58
|
-
// - staleTime: Infinity (data never becomes stale)
|
|
59
|
-
// - refetchOnWindowFocus: false (no auto-refetch on focus)
|
|
60
|
-
// - refetchOnReconnect: false (no auto-refetch on reconnect)
|
|
61
|
-
// This minimizes API costs and is ideal for single-admin apps with manual refresh buttons.
|
|
62
|
-
// Uncomment below to enable auto-refetch behavior:
|
|
63
|
-
// query: {
|
|
64
|
-
// staleTime: 1000 * 60 * 5, // 5 minutes - data becomes stale after 5 minutes
|
|
65
|
-
// refetchOnWindowFocus: true, // Automatically refetch when window regains focus
|
|
66
|
-
// refetchOnReconnect: true, // Automatically refetch when network reconnects
|
|
67
|
-
// },
|
|
68
32
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineEntity } from '@donotdev/core';
|
|
2
|
+
|
|
3
|
+
export const productEntity = defineEntity({
|
|
4
|
+
name: 'Product',
|
|
5
|
+
collection: 'products',
|
|
6
|
+
fields: {
|
|
7
|
+
name: {
|
|
8
|
+
type: 'text',
|
|
9
|
+
visibility: 'user',
|
|
10
|
+
validation: { required: true, minLength: 3 },
|
|
11
|
+
},
|
|
12
|
+
description: {
|
|
13
|
+
type: 'textarea',
|
|
14
|
+
visibility: 'user',
|
|
15
|
+
},
|
|
16
|
+
price: {
|
|
17
|
+
type: 'number',
|
|
18
|
+
visibility: 'user',
|
|
19
|
+
validation: { required: true, min: 0 },
|
|
20
|
+
},
|
|
21
|
+
category: {
|
|
22
|
+
type: 'select',
|
|
23
|
+
visibility: 'user',
|
|
24
|
+
validation: {
|
|
25
|
+
options: [
|
|
26
|
+
{ value: 'electronics', label: 'Electronics' },
|
|
27
|
+
{ value: 'clothing', label: 'Clothing' },
|
|
28
|
+
{ value: 'food', label: 'Food & Drink' },
|
|
29
|
+
{ value: 'other', label: 'Other' },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
image: {
|
|
34
|
+
type: 'image',
|
|
35
|
+
visibility: 'user',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/* apps/demo/src/globals.css */
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/* 1. Group all imports at the top. */
|
|
4
|
+
@import '@donotdev/ui/dndev.css';
|
|
4
5
|
@import './themes.css';
|
|
6
|
+
|
|
7
|
+
/* 2. App-specific overrides — DO NOT set --font-family here,
|
|
8
|
+
it would clobber theme overrides (dark/terminal set it to mono) */
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
// apps/demo/src/main.tsx
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Demo application entry point
|
|
5
|
+
* @description Main entry point for the DoNotDev framework demo application
|
|
6
|
+
*
|
|
7
|
+
* Initializes React with StrictMode for development safety.
|
|
8
|
+
* Shell loader management is handled by BaseStoresInitializer for optimal timing.
|
|
9
|
+
*
|
|
10
|
+
* @version 0.0.1
|
|
11
|
+
* @since 0.0.1
|
|
12
|
+
* @author AMBROISE PARK Consulting
|
|
13
|
+
*/
|
|
14
|
+
|
|
3
15
|
import './globals.css';
|
|
4
16
|
import React from 'react';
|
|
5
17
|
import ReactDOM from 'react-dom/client';
|
|
6
18
|
|
|
7
19
|
import { App } from './App';
|
|
8
20
|
|
|
21
|
+
// Ensure the root element exists
|
|
9
22
|
const rootElement = document.getElementById('root');
|
|
10
23
|
if (!rootElement) {
|
|
11
24
|
throw new Error(
|
|
@@ -13,13 +26,6 @@ if (!rootElement) {
|
|
|
13
26
|
);
|
|
14
27
|
}
|
|
15
28
|
|
|
16
|
-
// Remove shell loader (fade out then remove)
|
|
17
|
-
const shellLoader = document.getElementById('shell-loader');
|
|
18
|
-
if (shellLoader) {
|
|
19
|
-
shellLoader.classList.add('shell-loader--fading');
|
|
20
|
-
window.setTimeout(() => shellLoader.remove(), 300);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
29
|
ReactDOM.createRoot(rootElement).render(
|
|
24
30
|
<React.StrictMode>
|
|
25
31
|
<App />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { History } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
import { WhatsNewTemplate } from '@donotdev/templates';
|
|
4
|
+
|
|
5
|
+
import type { PageMeta } from '@donotdev/core';
|
|
6
|
+
|
|
7
|
+
export const meta: PageMeta = {
|
|
8
|
+
icon: <History />,
|
|
9
|
+
preset: 'docs',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function ChangelogPage() {
|
|
13
|
+
return <WhatsNewTemplate />;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LayoutDashboard } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
import { DashboardTemplate } from '@donotdev/templates';
|
|
4
|
+
|
|
5
|
+
import type { PageMeta } from '@donotdev/core';
|
|
6
|
+
|
|
7
|
+
export const meta: PageMeta = {
|
|
8
|
+
icon: <LayoutDashboard />,
|
|
9
|
+
auth: true,
|
|
10
|
+
preset: 'admin',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default function DashboardPage() {
|
|
14
|
+
return <DashboardTemplate />;
|
|
15
|
+
}
|
|
@@ -1,79 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
import { useNavigate, useOutletContext } from 'react-router-dom';
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
Badge,
|
|
8
|
-
Card,
|
|
9
|
-
Grid,
|
|
10
|
-
Section,
|
|
11
|
-
Stack,
|
|
12
|
-
} from '@donotdev/components';
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
COMPONENT_CONFIGS,
|
|
16
|
-
getCSSFamilies,
|
|
17
|
-
} from './components/componentConfig';
|
|
18
|
-
import type { CSSFamily } from './components/ComponentsData';
|
|
19
|
-
|
|
20
|
-
type LayoutContext = {
|
|
21
|
-
selectedTab: CSSFamily | 'all';
|
|
22
|
-
searchQuery: string;
|
|
23
|
-
};
|
|
1
|
+
import { HomeTemplate } from '@donotdev/templates';
|
|
24
2
|
|
|
25
3
|
export default function HomePage() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
selectedTab,
|
|
29
|
-
searchQuery,
|
|
30
|
-
} = useOutletContext<LayoutContext>();
|
|
31
|
-
|
|
32
|
-
const componentsInTab = useMemo(() => {
|
|
33
|
-
return COMPONENT_CONFIGS.filter((config) => {
|
|
34
|
-
if (selectedTab !== 'all' && config.cssFamily !== selectedTab)
|
|
35
|
-
return false;
|
|
36
|
-
|
|
37
|
-
const matchesSearch =
|
|
38
|
-
searchQuery === '' ||
|
|
39
|
-
config.name.toLowerCase().includes(searchQuery.toLowerCase());
|
|
40
|
-
|
|
41
|
-
return matchesSearch;
|
|
42
|
-
}).sort((a, b) => a.name.localeCompare(b.name));
|
|
43
|
-
}, [selectedTab, searchQuery]);
|
|
44
|
-
|
|
45
|
-
const cssFamilies = getCSSFamilies();
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<Section
|
|
49
|
-
title={
|
|
50
|
-
cssFamilies.find((f) => f.id === selectedTab)?.label ||
|
|
51
|
-
'Components'
|
|
52
|
-
}
|
|
53
|
-
subtitle={`${componentsInTab.length} components`}
|
|
54
|
-
>
|
|
55
|
-
<Grid cols="auto-fit" minColWidth="240px">
|
|
56
|
-
{componentsInTab.map((config) => {
|
|
57
|
-
const isFullPageComponent = config.cssFamily === 'layout';
|
|
58
|
-
return (
|
|
59
|
-
<Card
|
|
60
|
-
key={config.id}
|
|
61
|
-
title={config.name}
|
|
62
|
-
onClick={() =>
|
|
63
|
-
isFullPageComponent
|
|
64
|
-
? navigate('/full')
|
|
65
|
-
: navigate(`/component/${config.id}`)
|
|
66
|
-
}
|
|
67
|
-
>
|
|
68
|
-
<Stack direction="row" justify="end">
|
|
69
|
-
<Badge variant="secondary">
|
|
70
|
-
{cssFamilies.find((f) => f.id === config.cssFamily)?.label || config.cssFamily}
|
|
71
|
-
</Badge>
|
|
72
|
-
</Stack>
|
|
73
|
-
</Card>
|
|
74
|
-
);
|
|
75
|
-
})}
|
|
76
|
-
</Grid>
|
|
77
|
-
</Section>
|
|
78
|
-
);
|
|
79
|
-
}
|
|
4
|
+
return <HomeTemplate />;
|
|
5
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CreditCard } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
import { SubscriptionTemplate } from '@donotdev/templates';
|
|
4
|
+
|
|
5
|
+
import type { PageMeta } from '@donotdev/core';
|
|
6
|
+
|
|
7
|
+
export const meta: PageMeta = {
|
|
8
|
+
icon: <CreditCard />,
|
|
9
|
+
hideFromMenu: true,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default function PricingPage() {
|
|
13
|
+
return <SubscriptionTemplate />;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Package } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
import { ProductCardListTemplate } from '@donotdev/templates';
|
|
4
|
+
|
|
5
|
+
import { productEntity } from '../entities/product';
|
|
6
|
+
|
|
7
|
+
import type { PageMeta } from '@donotdev/core';
|
|
8
|
+
|
|
9
|
+
export const meta: PageMeta = {
|
|
10
|
+
icon: <Package />,
|
|
11
|
+
auth: true,
|
|
12
|
+
preset: 'admin',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default function ProductsPage() {
|
|
16
|
+
return <ProductCardListTemplate entity={productEntity} />;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { User } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
import { ProfileTemplate } from '@donotdev/templates';
|
|
4
|
+
|
|
5
|
+
import type { PageMeta } from '@donotdev/core';
|
|
6
|
+
|
|
7
|
+
export const meta: PageMeta = {
|
|
8
|
+
icon: <User />,
|
|
9
|
+
auth: true,
|
|
10
|
+
preset: 'admin',
|
|
11
|
+
hideFromMenu: true,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default function ProfilePage() {
|
|
15
|
+
return <ProfileTemplate billingPath="/pricing" />;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Settings } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
import { SettingsTemplate } from '@donotdev/templates';
|
|
4
|
+
|
|
5
|
+
import type { PageMeta } from '@donotdev/core';
|
|
6
|
+
|
|
7
|
+
export const meta: PageMeta = {
|
|
8
|
+
icon: <Settings />,
|
|
9
|
+
auth: true,
|
|
10
|
+
preset: 'admin',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default function SettingsPage() {
|
|
14
|
+
return <SettingsTemplate />;
|
|
15
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useParams, Navigate } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Badge,
|
|
6
|
+
Grid,
|
|
7
|
+
Stack,
|
|
8
|
+
Text,
|
|
9
|
+
} from '@donotdev/components';
|
|
10
|
+
import { PageContainer } from '@donotdev/ui';
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
COMPONENT_CONFIGS,
|
|
14
|
+
getCSSFamilies,
|
|
15
|
+
} from './components/componentConfig';
|
|
16
|
+
import { ComponentRenderer } from './components/ComponentRenderer';
|
|
17
|
+
|
|
18
|
+
import type { PageMeta } from '@donotdev/core';
|
|
19
|
+
import type { ComponentConfig } from './components/componentConfig';
|
|
20
|
+
|
|
21
|
+
export const meta: PageMeta = {
|
|
22
|
+
route: { params: ['id'] },
|
|
23
|
+
hideFromMenu: true,
|
|
24
|
+
preset: 'admin',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default function ShowcaseDetailPage() {
|
|
28
|
+
const { id } = useParams<{ id: string }>();
|
|
29
|
+
|
|
30
|
+
const config = useMemo(() => {
|
|
31
|
+
return COMPONENT_CONFIGS.find((c) => c.id === id);
|
|
32
|
+
}, [id]);
|
|
33
|
+
|
|
34
|
+
const cssFamilies = getCSSFamilies();
|
|
35
|
+
|
|
36
|
+
if (!config) {
|
|
37
|
+
return <Navigate to="/showcase" replace />;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const generateVariants = (
|
|
41
|
+
config: ComponentConfig
|
|
42
|
+
): Array<Record<string, any>> => {
|
|
43
|
+
const variants: Array<Record<string, any>> = [{}];
|
|
44
|
+
|
|
45
|
+
const dimensions = ['variant', 'size', 'tone', 'type', 'side', 'mode'] as const;
|
|
46
|
+
|
|
47
|
+
dimensions.forEach((dim) => {
|
|
48
|
+
const values = config.variants[dim];
|
|
49
|
+
if (values?.length) {
|
|
50
|
+
const newVariants: Array<Record<string, any>> = [];
|
|
51
|
+
variants.forEach((base) => {
|
|
52
|
+
values.forEach((value) => {
|
|
53
|
+
newVariants.push({ ...base, [dim]: value });
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
variants.length = 0;
|
|
57
|
+
variants.push(...newVariants);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return variants.length > 0 ? variants : [{}];
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const allVariants = generateVariants(config);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<PageContainer>
|
|
68
|
+
<Stack gap="large" align="center">
|
|
69
|
+
<Stack gap="tight" align="center">
|
|
70
|
+
<Text level="h2">{config.name}</Text>
|
|
71
|
+
<Badge variant="outline">
|
|
72
|
+
{cssFamilies.find((f) => f.id === config.cssFamily)?.label ||
|
|
73
|
+
config.cssFamily}
|
|
74
|
+
</Badge>
|
|
75
|
+
</Stack>
|
|
76
|
+
|
|
77
|
+
<Grid cols="auto-fit" minColWidth="320px" gap="large">
|
|
78
|
+
{allVariants.map((variantProps, idx) => {
|
|
79
|
+
const variantLabels = Object.entries(variantProps)
|
|
80
|
+
.filter(([_, v]) => v)
|
|
81
|
+
.map(([k, v]) => `${k}: ${v}`);
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<Stack key={idx} align="center">
|
|
85
|
+
{variantLabels.length > 0 && (
|
|
86
|
+
<Stack
|
|
87
|
+
direction="row"
|
|
88
|
+
gap="tight"
|
|
89
|
+
wrap="wrap"
|
|
90
|
+
justify="center"
|
|
91
|
+
>
|
|
92
|
+
{variantLabels.map((label) => (
|
|
93
|
+
<Badge key={label} variant="secondary">
|
|
94
|
+
{label}
|
|
95
|
+
</Badge>
|
|
96
|
+
))}
|
|
97
|
+
</Stack>
|
|
98
|
+
)}
|
|
99
|
+
<Stack align="center" justify="center">
|
|
100
|
+
<ComponentRenderer
|
|
101
|
+
config={config}
|
|
102
|
+
variantProps={variantProps}
|
|
103
|
+
/>
|
|
104
|
+
</Stack>
|
|
105
|
+
</Stack>
|
|
106
|
+
);
|
|
107
|
+
})}
|
|
108
|
+
</Grid>
|
|
109
|
+
</Stack>
|
|
110
|
+
</PageContainer>
|
|
111
|
+
);
|
|
112
|
+
}
|