@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,142 +0,0 @@
|
|
|
1
|
-
// apps/demo/src/pages/FullPage.tsx
|
|
2
|
-
|
|
3
|
-
import { Rocket, ExternalLink } from 'lucide-react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Button,
|
|
7
|
-
CallToAction,
|
|
8
|
-
Card,
|
|
9
|
-
Code,
|
|
10
|
-
Grid,
|
|
11
|
-
GridArea,
|
|
12
|
-
HeroSection,
|
|
13
|
-
Section,
|
|
14
|
-
Stack,
|
|
15
|
-
Text,
|
|
16
|
-
} from '@donotdev/components';
|
|
17
|
-
|
|
18
|
-
export default function FullPage() {
|
|
19
|
-
return (
|
|
20
|
-
<>
|
|
21
|
-
<HeroSection
|
|
22
|
-
title="Fullwidht hero section with gradient text"
|
|
23
|
-
subtitle="This page displays the Sections, Grid, GridArea, Stack and CallToAction layout components that are meant to wrap the other compoennts."
|
|
24
|
-
badge="This is HeroSection Component"
|
|
25
|
-
/>
|
|
26
|
-
|
|
27
|
-
<Section
|
|
28
|
-
title="Grid + GridArea Components"
|
|
29
|
-
subtitle="CSS Grid layout with named areas. GridArea components map to grid template areas. Full-width container."
|
|
30
|
-
>
|
|
31
|
-
<Card variant="muted" title="Grid Layout Example">
|
|
32
|
-
<Code language="tsx" showLineNumbers={false}>
|
|
33
|
-
{`<Grid
|
|
34
|
-
areas={\`"header header header"
|
|
35
|
-
"main main sidebar"
|
|
36
|
-
"footer footer footer"\`}
|
|
37
|
-
cols="1fr 3fr 1fr"
|
|
38
|
-
gap="none"
|
|
39
|
-
>
|
|
40
|
-
{/* Children */}
|
|
41
|
-
</Grid>`}
|
|
42
|
-
</Code>
|
|
43
|
-
</Card>
|
|
44
|
-
<Grid
|
|
45
|
-
areas={`"header header header"
|
|
46
|
-
"main main sidebar"
|
|
47
|
-
"footer footer footer"`}
|
|
48
|
-
cols="1fr 3fr 1fr"
|
|
49
|
-
gap="none"
|
|
50
|
-
>
|
|
51
|
-
<GridArea as="header" name="header">
|
|
52
|
-
<Section tone="muted" title="Header Area">
|
|
53
|
-
<Text variant="muted">Header content (as="header")</Text>
|
|
54
|
-
</Section>
|
|
55
|
-
</GridArea>
|
|
56
|
-
<GridArea as="section" name="main">
|
|
57
|
-
<Section title="Main Content Area">
|
|
58
|
-
<Text variant="muted">Main content (as="section")</Text>
|
|
59
|
-
</Section>
|
|
60
|
-
</GridArea>
|
|
61
|
-
<GridArea as="aside" name="sidebar">
|
|
62
|
-
<Section tone="muted" title="Sidebar Area">
|
|
63
|
-
<Text variant="muted">Sidebar content (as="aside")</Text>
|
|
64
|
-
</Section>
|
|
65
|
-
</GridArea>
|
|
66
|
-
<GridArea as="footer" name="footer">
|
|
67
|
-
<Section tone="muted" title="Footer Area">
|
|
68
|
-
<Text variant="muted">Footer content (as="footer")</Text>
|
|
69
|
-
</Section>
|
|
70
|
-
</GridArea>
|
|
71
|
-
</Grid>
|
|
72
|
-
</Section>
|
|
73
|
-
|
|
74
|
-
<Section
|
|
75
|
-
title="Stack Component"
|
|
76
|
-
subtitle="Flexbox layout component. Full-width container."
|
|
77
|
-
>
|
|
78
|
-
<Card variant="muted" title="Stack Layout Example">
|
|
79
|
-
<Text variant="muted">
|
|
80
|
-
Stack creates flex containers. Use direction="row" for horizontal,
|
|
81
|
-
default is vertical. Gap controls spacing between items.
|
|
82
|
-
</Text>
|
|
83
|
-
</Card>
|
|
84
|
-
<Stack>
|
|
85
|
-
<Card variant="muted" title="Stack Item 1">
|
|
86
|
-
<Text variant="muted">Vertical stack with</Text>
|
|
87
|
-
</Card>
|
|
88
|
-
<Card variant="muted" title="Stack Item 2">
|
|
89
|
-
<Text variant="muted">Items stack vertically by default</Text>
|
|
90
|
-
</Card>
|
|
91
|
-
<Stack direction="row">
|
|
92
|
-
<Card variant="muted" title="Row Item 1">
|
|
93
|
-
<Text variant="muted">Horizontal stack</Text>
|
|
94
|
-
</Card>
|
|
95
|
-
<Card variant="muted" title="Row Item 2">
|
|
96
|
-
<Text variant="muted">direction="row"</Text>
|
|
97
|
-
</Card>
|
|
98
|
-
</Stack>
|
|
99
|
-
</Stack>
|
|
100
|
-
</Section>
|
|
101
|
-
|
|
102
|
-
<CallToAction
|
|
103
|
-
title="CallToAction Component"
|
|
104
|
-
subtitle="Full-width CTA section with gradient background. Constrained by --content-width, centered. Use for conversion sections."
|
|
105
|
-
primaryAction={
|
|
106
|
-
<Button
|
|
107
|
-
variant="primary"
|
|
108
|
-
fullWidth
|
|
109
|
-
icon={ExternalLink}
|
|
110
|
-
iconEnd
|
|
111
|
-
tooltip="https://donotdev.com/purchase"
|
|
112
|
-
onClick={() =>
|
|
113
|
-
window.open(
|
|
114
|
-
'https://donotdev.com/purchase',
|
|
115
|
-
'_blank',
|
|
116
|
-
'noopener,noreferrer'
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
>
|
|
120
|
-
Get Full Framework
|
|
121
|
-
</Button>
|
|
122
|
-
}
|
|
123
|
-
secondaryAction={
|
|
124
|
-
|
|
125
|
-
<Button
|
|
126
|
-
variant="outline"
|
|
127
|
-
icon={ExternalLink}
|
|
128
|
-
iconEnd
|
|
129
|
-
fullWidth
|
|
130
|
-
onClick={() =>
|
|
131
|
-
window.open('https://donotdev.com', '_blank', 'noopener,noreferrer')
|
|
132
|
-
}
|
|
133
|
-
tooltip="https://donotdev.com"
|
|
134
|
-
>
|
|
135
|
-
Check it more online
|
|
136
|
-
</Button>
|
|
137
|
-
}
|
|
138
|
-
/>
|
|
139
|
-
</>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
// apps/demo/src/pages/components/DemoLayout.tsx
|
|
2
|
-
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
4
|
-
import type { ChangeEvent } from 'react';
|
|
5
|
-
import { useLocation, useNavigate, Outlet } from 'react-router-dom';
|
|
6
|
-
import { ArrowLeft, ExternalLink, Menu } from 'lucide-react';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
Button,
|
|
10
|
-
Input,
|
|
11
|
-
Stack,
|
|
12
|
-
Tabs,
|
|
13
|
-
Text,
|
|
14
|
-
Sheet,
|
|
15
|
-
Grid,
|
|
16
|
-
GridArea,
|
|
17
|
-
} from '@donotdev/components';
|
|
18
|
-
import type { TextProps } from '@donotdev/components';
|
|
19
|
-
|
|
20
|
-
import { getCSSFamilies } from './componentConfig';
|
|
21
|
-
import type { CSSFamily } from './ComponentsData';
|
|
22
|
-
import { ThemeToggle } from '../../components/ThemeToggle';
|
|
23
|
-
|
|
24
|
-
function useMediaQuery(query: string) {
|
|
25
|
-
const [matches, setMatches] = useState(false);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
const media = window.matchMedia(query);
|
|
28
|
-
if (media.matches !== matches) setMatches(media.matches);
|
|
29
|
-
const listener = () => setMatches(media.matches);
|
|
30
|
-
media.addEventListener('change', listener);
|
|
31
|
-
return () => media.removeEventListener('change', listener);
|
|
32
|
-
}, [matches, query]);
|
|
33
|
-
return matches;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
interface DemoLayoutProps {
|
|
37
|
-
selectedTab: CSSFamily | 'all';
|
|
38
|
-
onTabChange: (tab: CSSFamily | 'all') => void;
|
|
39
|
-
searchQuery: string;
|
|
40
|
-
onSearchChange: (query: string) => void;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function DemoLayout({
|
|
44
|
-
selectedTab,
|
|
45
|
-
onTabChange,
|
|
46
|
-
searchQuery,
|
|
47
|
-
onSearchChange,
|
|
48
|
-
}: DemoLayoutProps) {
|
|
49
|
-
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
50
|
-
const location = useLocation();
|
|
51
|
-
const navigate = useNavigate();
|
|
52
|
-
const isLaptop = useMediaQuery('(min-width: 1024px)');
|
|
53
|
-
|
|
54
|
-
const handleBack = () => {
|
|
55
|
-
if (location.pathname === '/full') {
|
|
56
|
-
navigate('/');
|
|
57
|
-
} else if (location.pathname.startsWith('/component/')) {
|
|
58
|
-
navigate('/');
|
|
59
|
-
} else if (selectedTab !== 'all') {
|
|
60
|
-
onTabChange('all');
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const showBackButton =
|
|
65
|
-
location.pathname === '/full' ||
|
|
66
|
-
location.pathname.startsWith('/component/') ||
|
|
67
|
-
selectedTab !== 'all';
|
|
68
|
-
|
|
69
|
-
const SidebarContent = (
|
|
70
|
-
<Stack gap="large" className="dndev-h-full">
|
|
71
|
-
<Stack gap="tight">
|
|
72
|
-
<Text as="h1">
|
|
73
|
-
DoNotDev
|
|
74
|
-
</Text>
|
|
75
|
-
<Text variant="muted">Components Showcase</Text>
|
|
76
|
-
</Stack>
|
|
77
|
-
|
|
78
|
-
<Stack gap="large" className="dndev-flex-1 dndev-min-h-0 dndev-overflow-y-auto">
|
|
79
|
-
<Input
|
|
80
|
-
placeholder="Filter components..."
|
|
81
|
-
value={searchQuery}
|
|
82
|
-
onChange={(e: ChangeEvent<HTMLInputElement>) => onSearchChange(e.target.value)}
|
|
83
|
-
/>
|
|
84
|
-
|
|
85
|
-
<Tabs
|
|
86
|
-
items={getCSSFamilies().map((family) => ({
|
|
87
|
-
value: family.id,
|
|
88
|
-
label: family.label,
|
|
89
|
-
className: 'dndev-w-full',
|
|
90
|
-
content: null,
|
|
91
|
-
}))}
|
|
92
|
-
value={selectedTab}
|
|
93
|
-
onValueChange={(value) => {
|
|
94
|
-
onTabChange(value as CSSFamily | 'all');
|
|
95
|
-
setIsMobileMenuOpen(false);
|
|
96
|
-
if (location.pathname !== '/') {
|
|
97
|
-
navigate('/');
|
|
98
|
-
}
|
|
99
|
-
}}
|
|
100
|
-
cols={1}
|
|
101
|
-
gap="tight"
|
|
102
|
-
/>
|
|
103
|
-
</Stack>
|
|
104
|
-
|
|
105
|
-
<Stack>
|
|
106
|
-
<Button
|
|
107
|
-
variant="primary"
|
|
108
|
-
fullWidth
|
|
109
|
-
icon={ExternalLink}
|
|
110
|
-
iconEnd
|
|
111
|
-
onClick={() =>
|
|
112
|
-
window.open(
|
|
113
|
-
'https://donotdev.com/purchase',
|
|
114
|
-
'_blank',
|
|
115
|
-
'noopener,noreferrer'
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
>
|
|
119
|
-
Get Full Framework
|
|
120
|
-
</Button>
|
|
121
|
-
<Button
|
|
122
|
-
variant="outline"
|
|
123
|
-
icon={ExternalLink}
|
|
124
|
-
iconEnd
|
|
125
|
-
fullWidth
|
|
126
|
-
onClick={() =>
|
|
127
|
-
window.open('https://donotdev.com', '_blank', 'noopener,noreferrer')
|
|
128
|
-
}
|
|
129
|
-
>
|
|
130
|
-
Check it more online
|
|
131
|
-
</Button>
|
|
132
|
-
</Stack>
|
|
133
|
-
</Stack>
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
function lowerCase(label: string): "body" | "code" | "small" | "heading" | "default" | "muted" | "primary" | "secondary" | undefined {
|
|
137
|
-
throw new Error('Function not implemented.');
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<Grid
|
|
142
|
-
className="dndev-h-screen dndev-w-full dndev-overflow-hidden"
|
|
143
|
-
cols={isLaptop ? '280px 1fr' : '1fr'}
|
|
144
|
-
areas={isLaptop ? 'sidebar main' : 'main'}
|
|
145
|
-
gap="none"
|
|
146
|
-
>
|
|
147
|
-
{isLaptop && (
|
|
148
|
-
<GridArea
|
|
149
|
-
name="sidebar"
|
|
150
|
-
style={{
|
|
151
|
-
padding: 'var(--gap-sm) var(--gap-md)',
|
|
152
|
-
overflowY: 'auto',
|
|
153
|
-
background: 'var(--background)',
|
|
154
|
-
borderRadius: 0,
|
|
155
|
-
borderInlineEnd: 'var(--border-hairline) solid var(--border)',
|
|
156
|
-
}}
|
|
157
|
-
>
|
|
158
|
-
{SidebarContent}
|
|
159
|
-
</GridArea>
|
|
160
|
-
)}
|
|
161
|
-
|
|
162
|
-
<GridArea name="main" className="dndev-h-full dndev-overflow-hidden">
|
|
163
|
-
<Stack className="dndev-h-full" gap="none">
|
|
164
|
-
{/* Header */}
|
|
165
|
-
<Grid
|
|
166
|
-
cols="1fr auto 1fr"
|
|
167
|
-
align="center"
|
|
168
|
-
style={{
|
|
169
|
-
padding: 'var(--gap-sm) var(--gap-md)',
|
|
170
|
-
background: 'var(--background)',
|
|
171
|
-
flexShrink: 0,
|
|
172
|
-
borderRadius: 0,
|
|
173
|
-
borderBottom: 'var(--border-hairline) solid var(--border)',
|
|
174
|
-
}}
|
|
175
|
-
>
|
|
176
|
-
<Stack direction="row" align="center" justify="start">
|
|
177
|
-
<Button
|
|
178
|
-
variant="ghost"
|
|
179
|
-
icon={ArrowLeft}
|
|
180
|
-
onClick={showBackButton ? handleBack : undefined}
|
|
181
|
-
disabled={!showBackButton}
|
|
182
|
-
className={!showBackButton ? 'dndev-opacity-0' : ''}
|
|
183
|
-
aria-hidden={!showBackButton}
|
|
184
|
-
>
|
|
185
|
-
Back
|
|
186
|
-
</Button>
|
|
187
|
-
</Stack>
|
|
188
|
-
|
|
189
|
-
<Stack align="center" gap="tight">
|
|
190
|
-
<Text variant="muted" level="body">
|
|
191
|
-
We use a high contrast theme to demonstrate component usage. Update themes.css to customize.
|
|
192
|
-
</Text>
|
|
193
|
-
<Grid cols={4} gap="tight">
|
|
194
|
-
{[
|
|
195
|
-
{ label: 'Foreground', color: 'var(--foreground)', border: true },
|
|
196
|
-
{ label: 'Primary', color: 'var(--primary)' },
|
|
197
|
-
{ label: 'Secondary', color: 'var(--secondary)' },
|
|
198
|
-
{ label: 'Accent', color: 'var(--accent)' },
|
|
199
|
-
].map((item) => (
|
|
200
|
-
<Stack
|
|
201
|
-
key={item.label}
|
|
202
|
-
direction="row"
|
|
203
|
-
gap="tight"
|
|
204
|
-
align="center"
|
|
205
|
-
>
|
|
206
|
-
<span
|
|
207
|
-
style={{
|
|
208
|
-
width: '20px',
|
|
209
|
-
height: '20px',
|
|
210
|
-
background: item.color
|
|
211
|
-
}}
|
|
212
|
-
/>
|
|
213
|
-
<Text
|
|
214
|
-
level="small"
|
|
215
|
-
style={{ color: item.color }}
|
|
216
|
-
>
|
|
217
|
-
{item.label}
|
|
218
|
-
</Text>
|
|
219
|
-
</Stack>
|
|
220
|
-
))}
|
|
221
|
-
</Grid>
|
|
222
|
-
</Stack>
|
|
223
|
-
|
|
224
|
-
{/* Right side: Theme Toggle + Mobile Menu */}
|
|
225
|
-
<Stack direction="row" justify="end" align="center">
|
|
226
|
-
<ThemeToggle />
|
|
227
|
-
{!isLaptop && (
|
|
228
|
-
<Sheet
|
|
229
|
-
open={isMobileMenuOpen}
|
|
230
|
-
onOpenChange={setIsMobileMenuOpen}
|
|
231
|
-
side="left"
|
|
232
|
-
trigger={
|
|
233
|
-
<Button
|
|
234
|
-
variant="ghost"
|
|
235
|
-
display="compact"
|
|
236
|
-
aria-label="Open menu"
|
|
237
|
-
icon={Menu}
|
|
238
|
-
/>
|
|
239
|
-
}
|
|
240
|
-
title="Components"
|
|
241
|
-
>
|
|
242
|
-
{SidebarContent}
|
|
243
|
-
</Sheet>
|
|
244
|
-
)}
|
|
245
|
-
</Stack>
|
|
246
|
-
</Grid>
|
|
247
|
-
|
|
248
|
-
{/* Content */}
|
|
249
|
-
<div
|
|
250
|
-
className="dndev-flex-1 dndev-overflow-y-auto dndev-w-full"
|
|
251
|
-
style={{ padding: 'var(--gap-md)' }}
|
|
252
|
-
>
|
|
253
|
-
<Outlet
|
|
254
|
-
context={{
|
|
255
|
-
selectedTab,
|
|
256
|
-
setSelectedTab: onTabChange,
|
|
257
|
-
searchQuery,
|
|
258
|
-
setSearchQuery: onSearchChange,
|
|
259
|
-
}}
|
|
260
|
-
/>
|
|
261
|
-
</div>
|
|
262
|
-
</Stack>
|
|
263
|
-
</GridArea>
|
|
264
|
-
</Grid>
|
|
265
|
-
);
|
|
266
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// apps/demo/src/pages/components/LayoutRoute.tsx
|
|
2
|
-
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import { DemoLayout } from './DemoLayout';
|
|
6
|
-
import type { CSSFamily } from './ComponentsData';
|
|
7
|
-
|
|
8
|
-
export function LayoutRoute() {
|
|
9
|
-
const [selectedTab, setSelectedTab] = useState<CSSFamily | 'all'>('all');
|
|
10
|
-
const [searchQuery, setSearchQuery] = useState('');
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<DemoLayout
|
|
14
|
-
selectedTab={selectedTab}
|
|
15
|
-
onTabChange={setSelectedTab}
|
|
16
|
-
searchQuery={searchQuery}
|
|
17
|
-
onSearchChange={setSearchQuery}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
# {{APP_NAME}} Functions
|
|
2
|
-
|
|
3
|
-
This directory contains the Firebase Functions for the {{APP_NAME}} app, generated using the DoNotDev framework's scaffolding system.
|
|
4
|
-
|
|
5
|
-
## Structure
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
functions/
|
|
9
|
-
├── src/
|
|
10
|
-
│ ├── auth/ # Authentication functions
|
|
11
|
-
│ ├── oauth/ # OAuth functions
|
|
12
|
-
│ ├── billing/ # Billing functions
|
|
13
|
-
│ └── index.ts # Main functions entry point
|
|
14
|
-
├── package.json # Dependencies and scripts
|
|
15
|
-
├── tsconfig.json # TypeScript configuration
|
|
16
|
-
├── .env.example # Environment variables template
|
|
17
|
-
└── README.md # This file
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Features
|
|
21
|
-
|
|
22
|
-
- **Authentication Management**: User custom claims and auth status
|
|
23
|
-
- **OAuth Integration**: GitHub access management
|
|
24
|
-
- **Billing Processing**: Stripe checkout and webhook handling
|
|
25
|
-
- **Secure API Layer**: Professional frontend-backend communication
|
|
26
|
-
- **Error Handling**: Comprehensive error handling and logging
|
|
27
|
-
|
|
28
|
-
## Environment Variables
|
|
29
|
-
|
|
30
|
-
### File Structure
|
|
31
|
-
|
|
32
|
-
**Functions use a different .env system than Vite/Next.js:**
|
|
33
|
-
- `.env` → Local development only (not automatically loaded, use with dotenv if needed)
|
|
34
|
-
- Production → Use Firebase Functions Secrets (synced automatically during `dndev deploy`)
|
|
35
|
-
|
|
36
|
-
**Note:** Functions don't follow Vite/Next.js `.env.local` priority rules. Use Firebase Secrets for production.
|
|
37
|
-
|
|
38
|
-
### Required Environment Variables
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# Stripe Configuration
|
|
42
|
-
STRIPE_SECRET_KEY=sk_live_...
|
|
43
|
-
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
44
|
-
|
|
45
|
-
# GitHub Configuration
|
|
46
|
-
GITHUB_PERSONAL_ACCESS_TOKEN=ghp_...
|
|
47
|
-
GITHUB_REPO_OWNER=your-org
|
|
48
|
-
GITHUB_REPO_NAME=your-repo
|
|
49
|
-
|
|
50
|
-
# Firebase Configuration
|
|
51
|
-
FIREBASE_PROJECT_ID=your-project-id
|
|
52
|
-
FIREBASE_REGION={{YOUR_REGION}}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Setup Instructions
|
|
56
|
-
|
|
57
|
-
1. **Stripe Setup**:
|
|
58
|
-
- Create products in Stripe Dashboard
|
|
59
|
-
- Get price IDs and add to frontend `.env.local` (dev) or `.env.production.local` (prod)
|
|
60
|
-
- Configure webhook endpoint in Stripe
|
|
61
|
-
- Add webhook secret to functions `.env` (local) or Firebase Secrets (production)
|
|
62
|
-
|
|
63
|
-
2. **GitHub Setup**:
|
|
64
|
-
- Create Personal Access Token with `repo` scope
|
|
65
|
-
- Add token to functions `.env` (local) or Firebase Secrets (production)
|
|
66
|
-
- Configure repository owner/name
|
|
67
|
-
|
|
68
|
-
3. **Firebase Setup**:
|
|
69
|
-
- Get service account key: Firebase Console → Project Settings → Service Accounts → "Generate new private key"
|
|
70
|
-
- Copy JSON content into `service-account-key.json` in app root (shared by frontend + functions)
|
|
71
|
-
- Deploy: `dndev deploy` (from workspace root)
|
|
72
|
-
- Update webhook URL in Stripe dashboard
|
|
73
|
-
|
|
74
|
-
## Deployment
|
|
75
|
-
|
|
76
|
-
Use the unified deployment command from workspace root:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
# Deploy everything (interactive)
|
|
80
|
-
dndev deploy
|
|
81
|
-
|
|
82
|
-
# Deploy specific app
|
|
83
|
-
dndev deploy <app-name>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## Development
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
# Start Firebase emulators
|
|
90
|
-
bun run serve
|
|
91
|
-
|
|
92
|
-
# Start with debugging
|
|
93
|
-
bun run dev
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## API Endpoints
|
|
97
|
-
|
|
98
|
-
### Stripe Webhook
|
|
99
|
-
|
|
100
|
-
- **URL**: `https://your-project.cloudfunctions.net/stripeWebhook`
|
|
101
|
-
- **Events**: `checkout.session.completed`
|
|
102
|
-
- **Purpose**: Processes purchases and grants access
|
|
103
|
-
|
|
104
|
-
### Checkout Session
|
|
105
|
-
|
|
106
|
-
- **Integration**: Direct Stripe calls (no function needed)
|
|
107
|
-
- **Purpose**: Creates Stripe checkout sessions for purchases
|
|
108
|
-
|
|
109
|
-
## Security
|
|
110
|
-
|
|
111
|
-
- All functions require authentication
|
|
112
|
-
- Webhook signature verification
|
|
113
|
-
- Secure GitHub token management
|
|
114
|
-
- Firebase custom claims for user status
|
|
115
|
-
|
|
116
|
-
## Framework Integration
|
|
117
|
-
|
|
118
|
-
This functions package demonstrates how to:
|
|
119
|
-
|
|
120
|
-
- Use the framework's scaffolding system
|
|
121
|
-
- Implement secure API communication
|
|
122
|
-
- Handle complex purchase flows
|
|
123
|
-
- Integrate with external services (Stripe, GitHub)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview {{APP_NAME}} Get Custom Claims Wrapper
|
|
3
|
-
* @description Wrapper for framework's getCustomClaims with {{APP_NAME}}-specific configuration
|
|
4
|
-
* @version 0.0.1
|
|
5
|
-
* @since 0.0.1
|
|
6
|
-
* @author AMBROISE PARK Consulting
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { getCustomClaims as frameworkGetCustomClaims } from '@donotdev/functions/firebase';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* {{APP_NAME}} custom claims retrieval
|
|
13
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
14
|
-
*
|
|
15
|
-
* @version 0.0.1
|
|
16
|
-
* @since 0.0.1
|
|
17
|
-
* @author AMBROISE PARK Consulting
|
|
18
|
-
*/
|
|
19
|
-
export const getCustomClaims = frameworkGetCustomClaims;
|
package/templates/functions-firebase/functions-firebase/src/auth/getUserAuthStatus.ts.example
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// functions/src/auth/getUserAuthStatus.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} User Auth Status Wrapper
|
|
5
|
-
* @description Wrapper for framework's getUserAuthStatus with {{APP_NAME}}-specific configuration
|
|
6
|
-
* @version 0.0.1
|
|
7
|
-
* @since 0.0.1
|
|
8
|
-
* @author AMBROISE PARK Consulting
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { getUserAuthStatus as frameworkGetUserAuthStatus } from '@donotdev/functions/firebase';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* {{APP_NAME}} user authentication status
|
|
15
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
16
|
-
*
|
|
17
|
-
* @version 0.0.1
|
|
18
|
-
* @since 0.0.1
|
|
19
|
-
* @author AMBROISE PARK Consulting
|
|
20
|
-
*/
|
|
21
|
-
export const getUserAuthStatus = frameworkGetUserAuthStatus;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// functions/src/auth/index.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} Auth Functions
|
|
5
|
-
* @description Exports all auth-related functions for the {{APP_NAME}} app
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export { setCustomClaims } from './setCustomClaims';
|
|
9
|
-
export { getCustomClaims } from './getCustomClaims';
|
|
10
|
-
export { removeCustomClaims } from './removeCustomClaims';
|
|
11
|
-
export { getUserAuthStatus } from './getUserAuthStatus';
|
package/templates/functions-firebase/functions-firebase/src/auth/removeCustomClaims.ts.example
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// functions/src/auth/removeCustomClaims.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} Remove Custom Claims Wrapper
|
|
5
|
-
* @description Wrapper for framework's removeCustomClaims with {{APP_NAME}}-specific configuration
|
|
6
|
-
* @version 0.0.1
|
|
7
|
-
* @since 0.0.1
|
|
8
|
-
* @author AMBROISE PARK Consulting
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { removeCustomClaims as frameworkRemoveCustomClaims } from '@donotdev/functions/firebase';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* {{APP_NAME}} custom claims removal
|
|
15
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
16
|
-
*
|
|
17
|
-
* @version 0.0.1
|
|
18
|
-
* @since 0.0.1
|
|
19
|
-
* @author AMBROISE PARK Consulting
|
|
20
|
-
*/
|
|
21
|
-
export const removeCustomClaims = frameworkRemoveCustomClaims;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// functions/src/auth/setCustomClaims.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} Set Custom Claims Wrapper
|
|
5
|
-
* @description Wrapper for framework's setCustomClaims with {{APP_NAME}}-specific configuration
|
|
6
|
-
* @version 0.0.1
|
|
7
|
-
* @since 0.0.1
|
|
8
|
-
* @author AMBROISE PARK Consulting
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { setCustomClaims as frameworkSetCustomClaims } from '@donotdev/functions/firebase';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* {{APP_NAME}} custom claims setting
|
|
15
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
16
|
-
*
|
|
17
|
-
* @version 0.0.1
|
|
18
|
-
* @since 0.0.1
|
|
19
|
-
* @author AMBROISE PARK Consulting
|
|
20
|
-
*/
|
|
21
|
-
export const setCustomClaims = frameworkSetCustomClaims;
|
package/templates/functions-firebase/functions-firebase/src/billing/handleStripeWebhook.ts.example
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// functions/src/billing/handleStripeWebhook.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} Stripe Webhook Wrapper
|
|
5
|
-
* @description Wrapper for framework's createStripeWebhookHandler with {{APP_NAME}}-specific configuration
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { createStripeWebhookHandler } from '@donotdev/functions/firebase';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* {{APP_NAME}} Stripe webhook handler
|
|
12
|
-
* Configured with {{APP_NAME}}-specific product types and settings
|
|
13
|
-
*/
|
|
14
|
-
export const stripeWebhook = createStripeWebhookHandler({
|
|
15
|
-
productTypes: {
|
|
16
|
-
// Add your product types here
|
|
17
|
-
// Example:
|
|
18
|
-
// premium_plan: {
|
|
19
|
-
// tier: 'premium',
|
|
20
|
-
// subscriptionEnd: '2099-12-31T23:59:59.000Z',
|
|
21
|
-
// githubRepo: { owner: 'your-org', repo: 'your-repo' },
|
|
22
|
-
// },
|
|
23
|
-
},
|
|
24
|
-
});
|