@donotdev/cli 0.0.13 → 0.0.15
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 +357 -89
- package/dist/bin/commands/agent-setup.d.ts +6 -0
- package/dist/bin/commands/agent-setup.d.ts.map +1 -0
- package/dist/bin/commands/agent-setup.js +629 -0
- package/dist/bin/commands/agent-setup.js.map +1 -0
- package/dist/bin/commands/build.js +131 -50
- package/dist/bin/commands/bump.js +137 -49
- package/dist/bin/commands/cacheout.js +50 -21
- package/dist/bin/commands/create-app.js +270 -261
- package/dist/bin/commands/create-project.js +418 -197
- package/dist/bin/commands/deploy.js +1752 -712
- package/dist/bin/commands/dev.js +151 -35
- package/dist/bin/commands/emu.js +228 -70
- package/dist/bin/commands/format.js +50 -21
- package/dist/bin/commands/lint.js +50 -21
- package/dist/bin/commands/preview.js +155 -35
- package/dist/bin/commands/supabase-setup.d.ts +6 -0
- package/dist/bin/commands/supabase-setup.d.ts.map +1 -0
- package/dist/bin/commands/supabase-setup.js +7 -0
- package/dist/bin/commands/supabase-setup.js.map +1 -0
- package/dist/bin/commands/sync-secrets.js +224 -46
- package/dist/bin/commands/type-check.d.ts +14 -0
- package/dist/bin/commands/type-check.d.ts.map +1 -0
- package/dist/bin/commands/type-check.js +314 -0
- package/dist/bin/commands/type-check.js.map +1 -0
- package/dist/bin/commands/wai.js +7399 -11
- package/dist/bin/dndev.js +27 -2
- package/dist/bin/donotdev.js +27 -2
- package/dist/index.js +3960 -2996
- package/package.json +2 -2
- package/templates/app-demo/src/App.tsx.example +1 -0
- package/templates/app-demo/src/pages/FullPage.tsx.example +2 -2
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +2 -2
- package/templates/app-demo/src/themes.css.example +5 -12
- package/templates/app-expo/.env.example +64 -0
- package/templates/app-expo/.expo/README.md.example +5 -0
- package/templates/app-expo/.gitignore.example +36 -0
- package/templates/app-expo/README.md.example +58 -0
- package/templates/app-expo/app/.gitkeep +2 -0
- package/templates/app-expo/app/_layout.tsx.example +41 -0
- package/templates/app-expo/app/form.tsx.example +52 -0
- package/templates/app-expo/app/index.tsx.example +89 -0
- package/templates/app-expo/app/list.tsx.example +32 -0
- package/templates/app-expo/app/profile.tsx.example +76 -0
- package/templates/app-expo/app/signin.tsx.example +53 -0
- package/templates/app-expo/app.json.example +39 -0
- package/templates/app-expo/babel.config.js.example +10 -0
- package/templates/app-expo/eas.json.example +20 -0
- package/templates/app-expo/expo-env.d.ts.example +4 -0
- package/templates/app-expo/metro.config.js.example +20 -0
- package/templates/app-expo/service-account-key.json.example +12 -0
- package/templates/app-expo/tsconfig.json.example +19 -0
- package/templates/app-next/.env.example +4 -33
- package/templates/app-next/src/app/ClientLayout.tsx.example +2 -0
- package/templates/app-next/src/app/layout.tsx.example +7 -6
- package/templates/app-next/src/globals.css.example +2 -11
- package/templates/app-next/src/pages/HomePage.tsx.example +1 -1
- package/templates/app-next/src/themes.css.example +10 -13
- package/templates/app-vite/.env.example +3 -32
- package/templates/app-vite/index.html.example +2 -24
- package/templates/app-vite/src/App.tsx.example +2 -0
- package/templates/app-vite/src/globals.css.example +2 -12
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +1 -2
- package/templates/app-vite/src/pages/HomePage.tsx.example +1 -1
- package/templates/app-vite/src/themes.css.example +109 -79
- package/templates/app-vite/vercel.json.example +11 -0
- package/templates/functions-firebase/build.mjs.example +2 -72
- package/templates/functions-firebase/functions-firebase/.env.example.example +23 -25
- package/templates/functions-firebase/functions-firebase/build.mjs.example +2 -72
- package/templates/functions-firebase/functions-firebase/tsconfig.json.example +1 -1
- package/templates/functions-supabase/supabase/functions/cancel-subscription/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/change-plan/index.ts.example +11 -0
- package/templates/functions-supabase/supabase/functions/create-checkout-session/index.ts.example +11 -0
- package/templates/functions-supabase/supabase/functions/create-customer-portal/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/crud/index.ts.example +16 -0
- package/templates/functions-supabase/supabase/functions/delete-account/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/get-custom-claims/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/get-user-auth-status/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/refresh-subscription-status/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/remove-custom-claims/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/set-custom-claims/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +24 -0
- package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +22 -0
- package/templates/functions-supabase/supabase/migrations/20250101000002_cleanup_jobs.sql +28 -0
- package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +28 -0
- package/templates/functions-vercel/functions-vercel/tsconfig.json.example +1 -1
- package/templates/functions-vercel/functions-vercel/vercel.json.example +1 -1
- package/templates/functions-vercel/vercel.json.example +1 -1
- package/templates/github/github/workflows/firebase-deploy.yml.example +1 -1
- package/templates/github/workflows/firebase-deploy.yml.example +1 -1
- package/templates/overlay-firebase/env.fragment.example +34 -0
- package/templates/overlay-firebase/env.fragment.expo.example +34 -0
- package/templates/overlay-firebase/env.fragment.nextjs.example +34 -0
- package/templates/overlay-firebase/src/config/providers.expo.ts.example +49 -0
- package/templates/overlay-firebase/src/config/providers.ts.example +23 -0
- package/templates/overlay-supabase/env.fragment.example +7 -0
- package/templates/overlay-supabase/env.fragment.expo.example +7 -0
- package/templates/overlay-supabase/env.fragment.nextjs.example +7 -0
- package/templates/overlay-supabase/src/config/providers.expo.ts.example +35 -0
- package/templates/overlay-supabase/src/config/providers.ts.example +33 -0
- package/templates/overlay-supabase/vercel.headers.example +23 -0
- package/templates/overlay-supabase/vercel.json.example +22 -0
- package/templates/overlay-vercel/env.fragment.example +34 -0
- package/templates/overlay-vercel/env.fragment.nextjs.example +34 -0
- package/templates/overlay-vercel/src/config/providers.ts.example +24 -0
- package/templates/root-consumer/.claude/agents/architect.md.example +2 -310
- package/templates/root-consumer/.claude/agents/builder.md.example +2 -326
- package/templates/root-consumer/.claude/agents/coder.md.example +2 -83
- package/templates/root-consumer/.claude/agents/extractor.md.example +2 -231
- package/templates/root-consumer/.claude/agents/polisher.md.example +2 -132
- package/templates/root-consumer/.claude/agents/prompt-engineer.md.example +2 -81
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +1 -1
- package/templates/root-consumer/.claude/commands/build.md.example +1 -1
- package/templates/root-consumer/.claude/commands/design.md.example +1 -1
- package/templates/root-consumer/.claude/commands/grill.md.example +30 -0
- package/templates/root-consumer/.claude/commands/polish.md.example +1 -1
- package/templates/root-consumer/.claude/commands/techdebt.md.example +28 -0
- package/templates/root-consumer/.clinerules.example +1 -0
- package/templates/root-consumer/.cursor/rules/no-docs.mdc.example +15 -0
- package/templates/root-consumer/.cursorrules.example +1 -0
- package/templates/root-consumer/.dndev/args.json.example +6 -0
- package/templates/root-consumer/.gemini/settings.json.example +2 -2
- package/templates/root-consumer/.github/copilot-instructions.md.example +1 -0
- package/templates/root-consumer/.windsurfrules.example +1 -0
- package/templates/root-consumer/AI.md.example +25 -108
- package/templates/root-consumer/CLAUDE.md.example +1 -128
- package/templates/root-consumer/CONVENTIONS.md.example +1 -0
- package/templates/root-consumer/GEMINI.md.example +1 -0
- package/templates/root-consumer/firebase.json.example +1 -1
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +54 -0
- package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +0 -18
- package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +1 -1
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +99 -30
- package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +186 -0
- package/templates/root-consumer/guides/dndev/INDEX.md.example +4 -1
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +143 -12
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +9 -3
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +12 -7
- package/templates/root-consumer/guides/dndev/SETUP_SOC2.md.example +234 -0
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +124 -0
- package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +6 -2
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +176 -0
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +5 -9
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +174 -0
- package/templates/root-consumer/guides/wai-way/agents/builder.md.example +10 -0
- package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +25 -5
- package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +13 -2
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +2 -2
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +47 -11
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +15 -4
- package/templates/root-consumer/guides/wai-way/spec_template.md.example +7 -6
- package/templates/app-payload/.env.example +0 -28
- package/templates/app-payload/README.md.example +0 -233
- package/templates/app-payload/collections/Company.ts.example +0 -125
- package/templates/app-payload/collections/Hero.ts.example +0 -62
- package/templates/app-payload/collections/Media.ts.example +0 -41
- package/templates/app-payload/collections/Products.ts.example +0 -115
- package/templates/app-payload/collections/Services.ts.example +0 -104
- package/templates/app-payload/collections/Testimonials.ts.example +0 -92
- package/templates/app-payload/collections/Users.ts.example +0 -35
- package/templates/app-payload/src/server.ts.example +0 -79
- package/templates/app-payload/tsconfig.json.example +0 -24
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// src/config/providers.ts — Firebase provider bootstrap (Expo)
|
|
2
|
+
// Auto-generated by DoNotDev scaffolding. Edit freely.
|
|
3
|
+
// Import from root layout (app/_layout.tsx): import '../src/config/providers';
|
|
4
|
+
|
|
5
|
+
import { initializeApp } from 'firebase/app';
|
|
6
|
+
|
|
7
|
+
import { configureProviders } from '@donotdev/core';
|
|
8
|
+
import {
|
|
9
|
+
FirestoreAdapter,
|
|
10
|
+
FirebaseAuth,
|
|
11
|
+
FirebaseStorageAdapter,
|
|
12
|
+
} from '@donotdev/firebase';
|
|
13
|
+
import { initializeExpoAuth } from '@donotdev/expo';
|
|
14
|
+
|
|
15
|
+
const apiKey = process.env.EXPO_PUBLIC_FIREBASE_API_KEY;
|
|
16
|
+
const projectId = process.env.EXPO_PUBLIC_FIREBASE_PROJECT_ID;
|
|
17
|
+
|
|
18
|
+
if (!apiKey || !projectId) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
'[dndev] Missing Firebase env vars (EXPO_PUBLIC_FIREBASE_API_KEY, EXPO_PUBLIC_FIREBASE_PROJECT_ID). ' +
|
|
21
|
+
'Copy .env.example to .env and fill in your Firebase config.'
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const firebaseConfig = {
|
|
26
|
+
apiKey,
|
|
27
|
+
projectId,
|
|
28
|
+
authDomain: process.env.EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN,
|
|
29
|
+
storageBucket: process.env.EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET,
|
|
30
|
+
messagingSenderId: process.env.EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
|
|
31
|
+
appId: process.env.EXPO_PUBLIC_FIREBASE_APP_ID,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
initializeApp(firebaseConfig);
|
|
35
|
+
// Must run before FirebaseAuth — sets up AsyncStorage persistence
|
|
36
|
+
initializeExpoAuth();
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Register Firebase as the backend provider.
|
|
40
|
+
* Must run before any CRUD/auth/storage operations.
|
|
41
|
+
*
|
|
42
|
+
* Uses EXPO_PUBLIC_FIREBASE_* env vars (not VITE_*).
|
|
43
|
+
* initializeExpoAuth() sets up AsyncStorage persistence before FirebaseAuth.
|
|
44
|
+
*/
|
|
45
|
+
configureProviders({
|
|
46
|
+
crud: new FirestoreAdapter(),
|
|
47
|
+
auth: new FirebaseAuth(),
|
|
48
|
+
storage: new FirebaseStorageAdapter(),
|
|
49
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/config/providers.ts — Firebase provider bootstrap
|
|
2
|
+
// Auto-generated by DoNotDev scaffolding. Edit freely.
|
|
3
|
+
// Import from root component (App.tsx): import './config/providers';
|
|
4
|
+
|
|
5
|
+
import { configureProviders } from '@donotdev/core';
|
|
6
|
+
import {
|
|
7
|
+
FirestoreAdapter,
|
|
8
|
+
FirebaseAuth,
|
|
9
|
+
FirebaseStorageAdapter,
|
|
10
|
+
} from '@donotdev/firebase';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Register Firebase as the backend provider.
|
|
14
|
+
* Must run before any CRUD/auth/storage operations.
|
|
15
|
+
*
|
|
16
|
+
* Firebase SDK is auto-initialized by the framework's Vite plugin
|
|
17
|
+
* from VITE_FIREBASE_* env vars — no `initializeApp()` needed here.
|
|
18
|
+
*/
|
|
19
|
+
configureProviders({
|
|
20
|
+
crud: new FirestoreAdapter(),
|
|
21
|
+
auth: new FirebaseAuth(),
|
|
22
|
+
storage: new FirebaseStorageAdapter(),
|
|
23
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# Supabase Configuration
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Get these values from your Supabase project settings > API
|
|
6
|
+
VITE_SUPABASE_URL=
|
|
7
|
+
VITE_SUPABASE_ANON_KEY=
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# Supabase Configuration
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Get these values from your Supabase project settings > API
|
|
6
|
+
EXPO_PUBLIC_SUPABASE_URL=
|
|
7
|
+
EXPO_PUBLIC_SUPABASE_ANON_KEY=
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# Supabase Configuration
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Get these values from your Supabase project settings > API
|
|
6
|
+
NEXT_PUBLIC_SUPABASE_URL=
|
|
7
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY=
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/config/providers.ts — Supabase provider bootstrap (Expo)
|
|
2
|
+
// Auto-generated by DoNotDev scaffolding. Edit freely.
|
|
3
|
+
// Import from root layout (app/_layout.tsx): import '../src/config/providers';
|
|
4
|
+
|
|
5
|
+
import { createClient } from '@supabase/supabase-js';
|
|
6
|
+
|
|
7
|
+
import { configureProviders } from '@donotdev/core';
|
|
8
|
+
import {
|
|
9
|
+
SupabaseAuth,
|
|
10
|
+
SupabaseCrudAdapter,
|
|
11
|
+
SupabaseStorageAdapter,
|
|
12
|
+
} from '@donotdev/supabase';
|
|
13
|
+
|
|
14
|
+
const url = process.env.EXPO_PUBLIC_SUPABASE_URL;
|
|
15
|
+
const publicKey = process.env.EXPO_PUBLIC_SUPABASE_PUBLIC_KEY || process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY; // New: sb_publishable_..., Legacy: anon key
|
|
16
|
+
|
|
17
|
+
if (!url || !publicKey) {
|
|
18
|
+
console.warn(
|
|
19
|
+
'[dndev] Supabase not configured. Set EXPO_PUBLIC_SUPABASE_URL and EXPO_PUBLIC_SUPABASE_ANON_KEY in .env'
|
|
20
|
+
);
|
|
21
|
+
} else {
|
|
22
|
+
const supabase = createClient(url, publicKey);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Register Supabase as the backend provider.
|
|
26
|
+
* Must run before any CRUD/auth/storage operations.
|
|
27
|
+
*
|
|
28
|
+
* Uses EXPO_PUBLIC_SUPABASE_* env vars (not VITE_*).
|
|
29
|
+
*/
|
|
30
|
+
configureProviders({
|
|
31
|
+
crud: new SupabaseCrudAdapter(supabase),
|
|
32
|
+
auth: new SupabaseAuth(supabase),
|
|
33
|
+
storage: new SupabaseStorageAdapter(supabase),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/config/providers.ts — Supabase provider bootstrap
|
|
2
|
+
// Auto-generated by DoNotDev scaffolding. Edit freely.
|
|
3
|
+
// Import from root component (App.tsx): import './config/providers';
|
|
4
|
+
|
|
5
|
+
import { createClient } from '@supabase/supabase-js';
|
|
6
|
+
|
|
7
|
+
import { configureProviders } from '@donotdev/core';
|
|
8
|
+
import {
|
|
9
|
+
SupabaseAuth,
|
|
10
|
+
SupabaseCrudAdapter,
|
|
11
|
+
SupabaseStorageAdapter,
|
|
12
|
+
} from '@donotdev/supabase';
|
|
13
|
+
|
|
14
|
+
const url = import.meta.env.VITE_SUPABASE_URL;
|
|
15
|
+
const publicKey = import.meta.env.VITE_SUPABASE_PUBLIC_KEY || import.meta.env.VITE_SUPABASE_ANON_KEY; // New: sb_publishable_..., Legacy: anon key
|
|
16
|
+
|
|
17
|
+
if (!url || !publicKey) {
|
|
18
|
+
console.warn(
|
|
19
|
+
'[dndev] Supabase not configured. Set VITE_SUPABASE_URL and VITE_SUPABASE_PUBLIC_KEY (or VITE_SUPABASE_ANON_KEY) in .env'
|
|
20
|
+
);
|
|
21
|
+
} else {
|
|
22
|
+
const supabase = createClient(url, publicKey);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Register Supabase as the backend provider.
|
|
26
|
+
* Must run before any CRUD/auth/storage operations.
|
|
27
|
+
*/
|
|
28
|
+
configureProviders({
|
|
29
|
+
crud: new SupabaseCrudAdapter(supabase),
|
|
30
|
+
auth: new SupabaseAuth(supabase),
|
|
31
|
+
storage: new SupabaseStorageAdapter(supabase),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"source": "/(.*)",
|
|
4
|
+
"headers": [
|
|
5
|
+
{
|
|
6
|
+
"key": "Content-Security-Policy",
|
|
7
|
+
"value": "default-src 'self'; script-src 'self' https://js.stripe.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https:; font-src 'self' data: https://fonts.gstatic.com; connect-src 'self' https://*.supabase.co wss://*.supabase.co https://api.stripe.com; frame-src 'none' https://js.stripe.com https://hooks.stripe.com; object-src 'none'; base-uri 'self'; form-action 'self'"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"key": "X-Content-Type-Options",
|
|
11
|
+
"value": "nosniff"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"key": "X-Frame-Options",
|
|
15
|
+
"value": "DENY"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"key": "Referrer-Policy",
|
|
19
|
+
"value": "strict-origin-when-cross-origin"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"buildCommand": "bun run build",
|
|
3
|
+
"outputDirectory": "dist",
|
|
4
|
+
"installCommand": "bun install",
|
|
5
|
+
"rewrites": [
|
|
6
|
+
{ "source": "/(.*)", "destination": "/index.html" }
|
|
7
|
+
],
|
|
8
|
+
"headers": [
|
|
9
|
+
{
|
|
10
|
+
"source": "/(.*)",
|
|
11
|
+
"headers": [
|
|
12
|
+
{
|
|
13
|
+
"key": "Content-Security-Policy",
|
|
14
|
+
"value": "default-src 'self'; script-src 'self' https://js.stripe.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https:; font-src 'self' data: https://fonts.gstatic.com; connect-src 'self' https://*.supabase.co wss://*.supabase.co https://api.stripe.com; frame-src 'none' https://js.stripe.com https://hooks.stripe.com; object-src 'none'; base-uri 'self'; form-action 'self'"
|
|
15
|
+
},
|
|
16
|
+
{ "key": "X-Content-Type-Options", "value": "nosniff" },
|
|
17
|
+
{ "key": "X-Frame-Options", "value": "DENY" },
|
|
18
|
+
{ "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# Firebase Configuration (data layer for Vercel-hosted app)
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Get these values from your Firebase project settings
|
|
6
|
+
# Run `dndev firebase:setup` to auto-populate, or copy from Firebase Console
|
|
7
|
+
VITE_FIREBASE_API_KEY=
|
|
8
|
+
VITE_FIREBASE_PROJECT_ID=
|
|
9
|
+
# Copy from Firebase Console. Framework uses APP_URL hostname in production automatically.
|
|
10
|
+
VITE_FIREBASE_AUTH_DOMAIN=
|
|
11
|
+
VITE_FIREBASE_STORAGE_BUCKET=
|
|
12
|
+
VITE_FIREBASE_MESSAGING_SENDER_ID=
|
|
13
|
+
VITE_FIREBASE_APP_ID=
|
|
14
|
+
VITE_FIREBASE_MEASUREMENT_ID=
|
|
15
|
+
VITE_FIREBASE_FUNCTIONS_REGION=
|
|
16
|
+
|
|
17
|
+
# =============================================================================
|
|
18
|
+
# Firebase Emulator (Development only)
|
|
19
|
+
# =============================================================================
|
|
20
|
+
# Set to true to use Firebase emulators instead of production services
|
|
21
|
+
VITE_USE_FIREBASE_EMULATOR=false
|
|
22
|
+
VITE_FIREBASE_EMULATOR_HOST=localhost
|
|
23
|
+
VITE_FIREBASE_EMULATOR_PORT=9099
|
|
24
|
+
VITE_FIREBASE_AUTH_EMULATOR_HOST=http://localhost:9099
|
|
25
|
+
VITE_FIREBASE_FIRESTORE_EMULATOR_HOST=localhost:8080
|
|
26
|
+
VITE_FIREBASE_FUNCTIONS_EMULATOR_PORT=5001
|
|
27
|
+
|
|
28
|
+
# =============================================================================
|
|
29
|
+
# Firebase App Check (Abuse Protection)
|
|
30
|
+
# =============================================================================
|
|
31
|
+
# reCAPTCHA v3 site key for App Check
|
|
32
|
+
# VITE_RECAPTCHA_SITE_KEY=6LcXXXX...
|
|
33
|
+
# Optional: Debug token for localhost testing
|
|
34
|
+
# VITE_APPCHECK_DEBUG_TOKEN=XXXX-XXXX-XXXX
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# Firebase Configuration (data layer for Vercel-hosted app)
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Get these values from your Firebase project settings
|
|
6
|
+
# Run `dndev firebase:setup` to auto-populate, or copy from Firebase Console
|
|
7
|
+
NEXT_PUBLIC_FIREBASE_API_KEY=
|
|
8
|
+
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
|
|
9
|
+
# Copy from Firebase Console. Framework uses APP_URL hostname in production automatically.
|
|
10
|
+
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
|
|
11
|
+
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
|
|
12
|
+
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
|
|
13
|
+
NEXT_PUBLIC_FIREBASE_APP_ID=
|
|
14
|
+
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=
|
|
15
|
+
NEXT_PUBLIC_FIREBASE_FUNCTIONS_REGION=
|
|
16
|
+
|
|
17
|
+
# =============================================================================
|
|
18
|
+
# Firebase Emulator (Development only)
|
|
19
|
+
# =============================================================================
|
|
20
|
+
# Set to true to use Firebase emulators instead of production services
|
|
21
|
+
NEXT_PUBLIC_USE_FIREBASE_EMULATOR=false
|
|
22
|
+
NEXT_PUBLIC_FIREBASE_EMULATOR_HOST=localhost
|
|
23
|
+
NEXT_PUBLIC_FIREBASE_EMULATOR_PORT=9099
|
|
24
|
+
NEXT_PUBLIC_FIREBASE_AUTH_EMULATOR_HOST=http://localhost:9099
|
|
25
|
+
NEXT_PUBLIC_FIREBASE_FIRESTORE_EMULATOR_HOST=localhost:8080
|
|
26
|
+
NEXT_PUBLIC_FIREBASE_FUNCTIONS_EMULATOR_PORT=5001
|
|
27
|
+
|
|
28
|
+
# =============================================================================
|
|
29
|
+
# Firebase App Check (Abuse Protection)
|
|
30
|
+
# =============================================================================
|
|
31
|
+
# reCAPTCHA v3 site key for App Check
|
|
32
|
+
# NEXT_PUBLIC_RECAPTCHA_SITE_KEY=6LcXXXX...
|
|
33
|
+
# Optional: Debug token for localhost testing
|
|
34
|
+
# NEXT_PUBLIC_APPCHECK_DEBUG_TOKEN=XXXX-XXXX-XXXX
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/config/providers.ts — Vercel + Firebase provider bootstrap
|
|
2
|
+
// Auto-generated by DoNotDev scaffolding. Edit freely.
|
|
3
|
+
// Import from root component (App.tsx): import './config/providers';
|
|
4
|
+
|
|
5
|
+
import { configureProviders } from '@donotdev/core';
|
|
6
|
+
import {
|
|
7
|
+
FirestoreAdapter,
|
|
8
|
+
FirebaseAuth,
|
|
9
|
+
FirebaseStorageAdapter,
|
|
10
|
+
} from '@donotdev/firebase';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Register Firebase as the data provider for a Vercel-hosted app.
|
|
14
|
+
* Vercel handles hosting + API routes; Firebase provides CRUD/auth/storage.
|
|
15
|
+
* Must run before any CRUD/auth/storage operations.
|
|
16
|
+
*
|
|
17
|
+
* Firebase SDK is auto-initialized by the framework's Vite plugin
|
|
18
|
+
* from VITE_FIREBASE_* env vars — no `initializeApp()` needed here.
|
|
19
|
+
*/
|
|
20
|
+
configureProviders({
|
|
21
|
+
crud: new FirestoreAdapter(),
|
|
22
|
+
auth: new FirebaseAuth(),
|
|
23
|
+
storage: new FirebaseStorageAdapter(),
|
|
24
|
+
});
|
|
@@ -1,313 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: BMAD PRINTER
|
|
2
|
+
description: BMAD PRINTER — Transform HLD into technical specifications
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
You are PRINTER — a Framework Architect who transforms HLD documents into technical specifications.
|
|
7
|
-
|
|
8
|
-
Your personality:
|
|
9
|
-
- PRECISE: You generate exact code, not descriptions
|
|
10
|
-
- FRAMEWORK-NATIVE: You know DoNotDev inside-out and map everything to it
|
|
11
|
-
- VIGILANT: You catch inconsistencies and flag them
|
|
12
|
-
- MINIMAL: You include only what's in the HLD
|
|
13
|
-
|
|
14
|
-
You focus on:
|
|
15
|
-
- Generating schemas and configuration code, not implementing app features
|
|
16
|
-
- Including only features specified in the HLD
|
|
17
|
-
- Flagging every issue you find for human review
|
|
18
|
-
- Letting code speak for itself, keeping explanations concise
|
|
19
|
-
</persona>
|
|
20
|
-
|
|
21
|
-
<mission>
|
|
22
|
-
Transform the HLD into technical artifacts (LLD - Low-Level Design):
|
|
23
|
-
1. Entity Schemas — defineEntity() code for each entity
|
|
24
|
-
2. Navigation Config — route definitions
|
|
25
|
-
3. Feature Mapping — what framework packages implement what
|
|
26
|
-
4. Custom Component Specs — detailed specs for custom components (if any)
|
|
27
|
-
|
|
28
|
-
You succeed when artifacts are complete and valid.
|
|
29
|
-
You fail if you generate invalid code or miss HLD items.
|
|
30
|
-
</mission>
|
|
31
|
-
|
|
32
|
-
<input_context>
|
|
33
|
-
You are receiving an HLD document from Step 1 (Brainstorm) or `/brainstorm` command.
|
|
34
|
-
The HLD contains: Vision, Users, Entities, Features, Pages, Constraints, Native vs Custom.
|
|
35
|
-
Your job is to translate this into DoNotDev framework code and implementation plan.
|
|
36
|
-
</input_context>
|
|
37
|
-
|
|
38
|
-
<framework_knowledge>
|
|
39
|
-
DoNotDev Entity System:
|
|
40
|
-
|
|
41
|
-
```typescript
|
|
42
|
-
import { defineEntity } from '@donotdev/core';
|
|
43
|
-
|
|
44
|
-
export const exampleEntity = defineEntity({
|
|
45
|
-
name: 'Example', // Display name
|
|
46
|
-
collection: 'examples', // Firestore collection (plural, lowercase)
|
|
47
|
-
fields: {
|
|
48
|
-
fieldName: {
|
|
49
|
-
type: 'text', // Field type
|
|
50
|
-
visibility: 'user', // guest | user | admin | technical | hidden
|
|
51
|
-
validation: { // Optional
|
|
52
|
-
required: true,
|
|
53
|
-
minLength: 3
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Field Types:
|
|
61
|
-
text, email, number, textarea, select, date, checkbox, dropdown,
|
|
62
|
-
multiDropdown, file, image, radio, range, phone, geopoint, map,
|
|
63
|
-
timestamp, reference, password, address, avatar, hidden
|
|
64
|
-
|
|
65
|
-
Technical Fields (auto-added by defineEntity, no need to add manually):
|
|
66
|
-
- id, createdAt, updatedAt, createdById, updatedById
|
|
67
|
-
- All have visibility: 'technical' (shown as read-only in edit forms, hidden in create forms)
|
|
68
|
-
|
|
69
|
-
Reference Format:
|
|
70
|
-
- type: 'reference'
|
|
71
|
-
- ref: 'collectionName' (the target collection, plural lowercase)
|
|
72
|
-
|
|
73
|
-
Select Format:
|
|
74
|
-
- type: 'select'
|
|
75
|
-
- options: ['option1', 'option2']
|
|
76
|
-
|
|
77
|
-
Validation Options:
|
|
78
|
-
- required: boolean
|
|
79
|
-
- minLength / maxLength: number
|
|
80
|
-
- min / max: number
|
|
81
|
-
- nullable: boolean
|
|
82
|
-
</framework_knowledge>
|
|
83
|
-
|
|
84
|
-
<framework_packages>
|
|
85
|
-
Available packages for feature mapping:
|
|
86
|
-
|
|
87
|
-
| Package | Purpose |
|
|
88
|
-
|---------|---------|
|
|
89
|
-
| @donotdev/core | defineEntity, utilities |
|
|
90
|
-
| @donotdev/features/auth | Email/password auth, AuthForm |
|
|
91
|
-
| @donotdev/features/oauth | OAuth providers (Google, GitHub) |
|
|
92
|
-
| @donotdev/crud | useCrud hook, EntityFormRenderer, EntityList |
|
|
93
|
-
| @donotdev/features/billing | Stripe integration |
|
|
94
|
-
| @donotdev/components | UI: Section, Card, Hero, Button, etc. |
|
|
95
|
-
| @donotdev/ui | Layouts, navigation, theme |
|
|
96
|
-
</framework_packages>
|
|
97
|
-
|
|
98
|
-
<mcp_usage>
|
|
99
|
-
Before generating code, use MCP to verify component capabilities:
|
|
100
|
-
|
|
101
|
-
1. For each component mentioned in HLD:
|
|
102
|
-
- Call `lookup_symbol({ symbol: "ComponentName" })`
|
|
103
|
-
- Verify props match requirements
|
|
104
|
-
- Document any limitations
|
|
105
|
-
|
|
106
|
-
2. For custom components identified in HLD:
|
|
107
|
-
- Use `search_framework` to check if similar component exists
|
|
108
|
-
- If not, create detailed spec for custom component
|
|
109
|
-
|
|
110
|
-
3. Document MCP findings in "Custom Component Specs" section
|
|
111
|
-
</mcp_usage>
|
|
112
|
-
|
|
113
|
-
<output_format>
|
|
114
|
-
Generate EXACTLY this structure:
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## 1. Entity Schemas
|
|
119
|
-
|
|
120
|
-
### entities/[name].ts
|
|
121
|
-
|
|
122
|
-
```typescript
|
|
123
|
-
import { defineEntity } from '@donotdev/core';
|
|
124
|
-
|
|
125
|
-
export const [name]Entity = defineEntity({
|
|
126
|
-
name: '[Name]',
|
|
127
|
-
collection: '[names]',
|
|
128
|
-
fields: {
|
|
129
|
-
// Technical fields (id, createdAt, updatedAt, createdById, updatedById)
|
|
130
|
-
// are automatically added by defineEntity - no need to add them manually
|
|
131
|
-
// ... all fields from HLD
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
(Generate one block per entity)
|
|
137
|
-
|
|
138
|
-
### entities/index.ts
|
|
139
|
-
|
|
140
|
-
```typescript
|
|
141
|
-
export { [name]Entity } from './[name]';
|
|
142
|
-
// ... export all
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## 2. Navigation Config
|
|
148
|
-
|
|
149
|
-
```typescript
|
|
150
|
-
export const routes = [
|
|
151
|
-
{
|
|
152
|
-
path: '/path',
|
|
153
|
-
name: 'PageName',
|
|
154
|
-
access: 'public' | 'protected' | 'admin',
|
|
155
|
-
layout: 'marketing' | 'app' | 'auth' | 'admin',
|
|
156
|
-
components: ['ComponentName']
|
|
157
|
-
}
|
|
158
|
-
];
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## 3. Feature Mapping
|
|
164
|
-
|
|
165
|
-
| HLD Feature | Implementation | Package |
|
|
166
|
-
|-------------|----------------|---------|
|
|
167
|
-
| [Feature from HLD] | [How to implement] | [@donotdev/...] |
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## 4. Custom Component Specs
|
|
172
|
-
|
|
173
|
-
For each custom component identified in HLD "Native vs Custom" section:
|
|
174
|
-
|
|
175
|
-
### [ComponentName]
|
|
176
|
-
|
|
177
|
-
**Purpose:** [What it does]
|
|
178
|
-
|
|
179
|
-
**Props:**
|
|
180
|
-
```typescript
|
|
181
|
-
interface [ComponentName]Props {
|
|
182
|
-
// ... props definition
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
**Behavior:** [How it works]
|
|
187
|
-
|
|
188
|
-
**Integration:** [How it integrates with framework]
|
|
189
|
-
|
|
190
|
-
**Implementation Notes:** [Any special considerations]
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## 5. Implementation Plan
|
|
195
|
-
|
|
196
|
-
**Order of Implementation:**
|
|
197
|
-
1. Entities (create all entity files)
|
|
198
|
-
2. Native Pages (using framework defaults)
|
|
199
|
-
3. Custom Components (create custom components)
|
|
200
|
-
4. Integration (wire everything together)
|
|
201
|
-
|
|
202
|
-
**Dependencies:**
|
|
203
|
-
- [What depends on what]
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## 6. Validation Issues
|
|
208
|
-
|
|
209
|
-
List ANY problems found:
|
|
210
|
-
- ⚠️ [Issue description]
|
|
211
|
-
|
|
212
|
-
If no issues: ✅ All valid
|
|
213
|
-
</output_format>
|
|
214
|
-
|
|
215
|
-
<validation_checks>
|
|
216
|
-
Before outputting, verify:
|
|
217
|
-
□ Every HLD entity has a schema
|
|
218
|
-
□ Technical fields (id, createdAt, etc.) are NOT manually added (auto-added by defineEntity)
|
|
219
|
-
□ Every reference field has valid ref pointing to existing collection
|
|
220
|
-
□ Every select field has options array
|
|
221
|
-
□ Every HLD page has a route
|
|
222
|
-
□ Every HLD feature is mapped to a package
|
|
223
|
-
□ Collection names are plural lowercase
|
|
224
|
-
□ Visibility levels are: guest | user | admin | technical | hidden
|
|
225
|
-
□ All custom components have detailed specs
|
|
226
|
-
□ Implementation order is clear
|
|
227
|
-
|
|
228
|
-
Flag violations in "Validation Issues" section.
|
|
229
|
-
</validation_checks>
|
|
230
|
-
|
|
231
|
-
<examples>
|
|
232
|
-
GOOD OUTPUT (partial):
|
|
233
|
-
|
|
234
|
-
### entities/project.ts
|
|
235
|
-
```typescript
|
|
236
|
-
import { defineEntity } from '@donotdev/core';
|
|
237
|
-
|
|
238
|
-
export const projectEntity = defineEntity({
|
|
239
|
-
name: 'Project',
|
|
240
|
-
collection: 'projects',
|
|
241
|
-
fields: {
|
|
242
|
-
// Technical fields (id, createdAt, updatedAt, createdById, updatedById)
|
|
243
|
-
// are automatically added by defineEntity - no need to add them manually
|
|
244
|
-
name: {
|
|
245
|
-
type: 'text',
|
|
246
|
-
visibility: 'user',
|
|
247
|
-
validation: { required: true, minLength: 3 }
|
|
248
|
-
},
|
|
249
|
-
owner: {
|
|
250
|
-
type: 'reference',
|
|
251
|
-
visibility: 'user',
|
|
252
|
-
ref: 'users',
|
|
253
|
-
validation: { required: true }
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
BAD OUTPUT:
|
|
262
|
-
|
|
263
|
-
"The Project entity should have fields for name, owner, and status."
|
|
264
|
-
[WRONG: Description instead of code]
|
|
265
|
-
|
|
266
|
-
```typescript
|
|
267
|
-
owner: {
|
|
268
|
-
type: 'reference',
|
|
269
|
-
ref: 'User' // WRONG: Should be 'users' (collection name, not entity name)
|
|
270
|
-
}
|
|
271
|
-
```
|
|
272
|
-
</examples>
|
|
273
|
-
|
|
274
|
-
<recovery>
|
|
275
|
-
If HLD is ambiguous:
|
|
276
|
-
- State what's unclear
|
|
277
|
-
- Provide your best interpretation
|
|
278
|
-
- Flag in Validation Issues
|
|
279
|
-
|
|
280
|
-
If HLD has invalid field type:
|
|
281
|
-
- Map to closest valid type
|
|
282
|
-
- Flag in Validation Issues
|
|
283
|
-
|
|
284
|
-
If HLD entity has no fields listed:
|
|
285
|
-
- Flag as critical issue
|
|
286
|
-
- Skip generating empty schema
|
|
287
|
-
|
|
288
|
-
If custom component is unclear:
|
|
289
|
-
- Ask for clarification
|
|
290
|
-
- Provide best interpretation
|
|
291
|
-
- Flag in Validation Issues
|
|
292
|
-
</recovery>
|
|
293
|
-
|
|
294
|
-
<completion_check>
|
|
295
|
-
Output is complete when:
|
|
296
|
-
□ All entities have full schemas with code
|
|
297
|
-
□ Index file exports all entities
|
|
298
|
-
□ All routes are defined
|
|
299
|
-
□ All features are mapped
|
|
300
|
-
□ All custom components have detailed specs
|
|
301
|
-
□ Implementation plan is clear
|
|
302
|
-
□ All issues are flagged (or "✅ All valid")
|
|
303
|
-
|
|
304
|
-
Always generate complete results. If something is missing, flag it and still generate what you can.
|
|
305
|
-
</completion_check>
|
|
306
|
-
|
|
307
|
-
<start>
|
|
308
|
-
I will paste my HLD below. Transform it into technical artifacts (LLD).
|
|
309
|
-
|
|
310
|
-
---
|
|
311
|
-
HLD START
|
|
312
|
-
---
|
|
313
|
-
</start>
|
|
5
|
+
Persona and instructions are loaded by `start_phase(2)`. Call it before starting work.
|