@donotdev/cli 0.3.0 → 0.3.2
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 +51 -27
- package/dist/bin/commands/agent-setup.js +28 -18
- package/dist/bin/commands/build.js +1086 -58
- package/dist/bin/commands/bump.js +337 -53
- package/dist/bin/commands/cacheout.js +28 -18
- package/dist/bin/commands/coach.js +33 -25
- package/dist/bin/commands/create-app.js +597 -244
- package/dist/bin/commands/create-project.js +607 -254
- package/dist/bin/commands/db-check.js +37 -28
- package/dist/bin/commands/db.js +37 -28
- package/dist/bin/commands/deploy.js +13758 -11807
- package/dist/bin/commands/dev.js +50 -34
- package/dist/bin/commands/doctor.js +33 -25
- package/dist/bin/commands/emu.js +65 -43
- package/dist/bin/commands/format.js +28 -18
- package/dist/bin/commands/get-demo.js +81 -46
- package/dist/bin/commands/make-admin.js +966 -896
- package/dist/bin/commands/preview.js +50 -34
- package/dist/bin/commands/seed.js +37 -28
- package/dist/bin/commands/setup-cicd.js +1286 -87
- package/dist/bin/commands/setup.js +152 -138
- package/dist/bin/commands/staging.js +13758 -11807
- package/dist/bin/commands/sync-secrets.js +152 -132
- package/dist/bin/commands/type-check.js +1086 -39
- package/dist/bin/commands/wai.js +28 -18
- package/dist/bin/dndev.js +513 -30
- package/dist/bin/donotdev.js +33 -8
- package/dist/index.js +14568 -12497
- package/package.json +1 -1
- package/templates/app-demo/index.html.example +0 -1
- package/templates/app-demo/src/pages/ConditionalFormPage.tsx.example +2 -2
- package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +1 -0
- package/templates/app-demo/tsconfig.json.example +1 -1
- package/templates/app-dndev/index.html.example +1 -3
- package/templates/app-dndev/src/pages/NotFoundPage.tsx.example +1 -0
- package/templates/app-expo/app/_layout.tsx.example +1 -1
- package/templates/app-expo/app/form.tsx.example +10 -3
- package/templates/app-expo/app/index.tsx.example +3 -3
- package/templates/app-expo/app/list.tsx.example +2 -2
- package/templates/app-expo/app/profile.tsx.example +4 -3
- package/templates/app-expo/app/signin.tsx.example +2 -2
- package/templates/app-expo/babel.config.js.example +23 -6
- package/templates/app-expo/metro.config.js.example +7 -17
- package/templates/app-expo/tsconfig.json.example +2 -1
- package/templates/app-next/src/app/AppDocument.tsx.example +2 -3
- package/templates/app-vite/index.html.example +1 -3
- package/templates/app-vite/src/locales/home_en.json.example +6 -6
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +1 -1
- package/templates/app-vite/src/pages/HomePage.tsx.example +3 -3
- package/templates/app-vite/src/pages/NotFoundPage.tsx.example +1 -0
- package/templates/deploy-config/firebase.json.example +6 -5
- package/templates/deploy-config/tsconfig.functions.json.example +2 -7
- package/templates/deploy-config/vercel.json.example +6 -420
- package/templates/functions-firebase/README.md.example +8 -8
- package/templates/functions-firebase/functions.config.js.example +2 -1
- package/templates/functions-firebase/src/index.ts.example +4 -3
- package/templates/functions-firebase/src/oauth/exchangeToken.ts.example +8 -6
- package/templates/functions-firebase/src/oauth/refreshToken.ts.example +8 -6
- package/templates/functions-firebase/tsconfig.json.example +3 -5
- package/templates/functions-supabase/supabase/config.toml.example +2 -1
- package/templates/functions-supabase/supabase/functions/change-plan/index.ts.example +2 -3
- package/templates/functions-supabase/supabase/functions/create-checkout-session/index.ts.example +2 -3
- package/templates/functions-supabase/supabase/functions/stripe-webhook/index.ts.example +2 -3
- package/templates/functions-vercel/README.md.example +15 -25
- package/templates/functions-vercel/build.mjs.example +4 -46
- package/templates/functions-vercel/src/api/auth/setCustomClaims.ts.example +6 -11
- package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +2 -3
- package/templates/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +5 -11
- package/templates/functions-vercel/src/api/oauth/exchangeToken.ts.example +5 -11
- package/templates/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +5 -11
- package/templates/functions-vercel/tsconfig.json.example +5 -6
- package/templates/github/workflows/firebase-deploy.yml.example +1 -1
- package/templates/preset-admin/src/pages/DashboardPage.tsx.example +3 -2
- package/templates/preset-admin/src/pages/ReportsPage.tsx.example +13 -12
- package/templates/preset-admin/src/pages/SettingsPage.tsx.example +5 -5
- package/templates/preset-admin/src/pages/UsersPage.tsx.example +13 -12
- package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +5 -5
- package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +1 -4
- package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +10 -12
- package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +7 -4
- package/templates/preset-landing/src/pages/AboutPage.tsx.example +11 -9
- package/templates/preset-landing/src/pages/ContactPage.tsx.example +13 -7
- package/templates/preset-landing/src/pages/HomePage.tsx.example +50 -32
- package/templates/preset-saas/src/pages/DashboardPage.tsx.example +1 -1
- package/templates/preset-saas/src/pages/HomePage.tsx.example +3 -2
- package/templates/preset-saas/src/pages/PricingPage.tsx.example +4 -3
- package/templates/preset-saas/src/pages/ProfilePage.tsx.example +7 -7
- package/templates/preset-saas/src/pages/SettingsPage.tsx.example +3 -3
- package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +101 -10
- package/templates/root-consumer/.claude/rules/definition-of-done.md.example +2 -2
- package/templates/root-consumer/.claude/rules/framework.md.example +1 -1
- package/templates/root-consumer/.claude/settings.json.example +0 -11
- package/templates/root-consumer/.claude/skills/build/SKILL.md.example +1 -1
- package/templates/root-consumer/.dndev/args.json.example +2 -2
- package/templates/root-consumer/.env.example +1 -1
- package/templates/root-consumer/.gitignore.example +2 -0
- package/templates/root-consumer/AGENTS.md.example +3 -3
- package/templates/root-consumer/README.md.example +1 -1
- package/templates/app-vite/csp.example.json +0 -44
- package/templates/functions-vercel/src/api/oauth/disconnect.ts.example +0 -20
- package/templates/functions-vercel/src/api/oauth/getConnections.ts.example +0 -20
- package/templates/functions-vercel/src/api/oauth/refreshToken.ts.example +0 -20
- package/templates/functions-vercel/vercel.json.example +0 -14
- package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +0 -18
|
@@ -15,7 +15,7 @@ Architecture and API contracts: **`get_guideline(...)`** and **`lookup_symbol(..
|
|
|
15
15
|
|
|
16
16
|
## The 5 phases
|
|
17
17
|
|
|
18
|
-
Work inside an active phase: **`start_phase(N)`** before work, **`complete_phase({ files })`** before moving on, **`dn tc`** before
|
|
18
|
+
Work inside an active phase: **`start_phase(N)`** before work, **`complete_phase({ files })`** before moving on, **`dn tc`** once at the end of the work batch (before commit / deploy), never after each change or feature.
|
|
19
19
|
|
|
20
20
|
| Phase | Name | Skill (slash) | Focus |
|
|
21
21
|
|-------|------|---------------|--------|
|
|
@@ -52,7 +52,7 @@ Last resort: after **`lookup_symbol`** + **`search_framework`**. If you must add
|
|
|
52
52
|
| Command | Purpose |
|
|
53
53
|
|---------|---------|
|
|
54
54
|
| `dndev dev` / `dndev dev:app` | Dev server |
|
|
55
|
-
| `dn tc` / `dn tc --package <name>` | Type-check (
|
|
55
|
+
| `dn tc` / `dn tc --package <name>` | Type-check, once at the end of the work batch (before commit / deploy), never after each change or feature |
|
|
56
56
|
| `dndev build` | Production build |
|
|
57
57
|
| `dndev coach` / `dndev setup` / `dndev doctor` | Env and health |
|
|
58
58
|
|
|
@@ -63,7 +63,7 @@ Run **`dndev --help`** for the full list. **`dndev create-app`** is interactive
|
|
|
63
63
|
- **No local database.** The app runs locally against the live Supabase database. Never `--local`, never `supabase start` / `supabase db reset`.
|
|
64
64
|
- **Live data:** reads OK. Live writes and migrations only on the owner's order.
|
|
65
65
|
- **Framework changes** arrive via `dn pack --install` run from the framework repo (unpublished build). A `bun install` reverts them: re-run `dn pack`.
|
|
66
|
-
- **Test** by running the app locally on the live database. Typecheck with `dn tc
|
|
66
|
+
- **Test** by running the app locally on the live database. Typecheck with `dn tc` once at the end of the work batch (before commit / deploy), never after each change or feature.
|
|
67
67
|
- **Deploy** only on the owner's order.
|
|
68
68
|
|
|
69
69
|
## Docs and markdown
|
|
@@ -46,7 +46,7 @@ dndev emu start # Start Firebase emulators (Auth, Firestore, Functi
|
|
|
46
46
|
# Deployment
|
|
47
47
|
dndev deploy # Deploy to Firebase (hosting + functions + rules)
|
|
48
48
|
dndev staging # Deploy to staging environment
|
|
49
|
-
dndev sync-secrets # Push
|
|
49
|
+
dndev sync-secrets # Push .dndev.secrets values to Firebase Secret Manager
|
|
50
50
|
|
|
51
51
|
# Quality
|
|
52
52
|
dn tc # Type-check (preferred)
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_comment": "Content Security Policy baseline for DoNotDev apps. Copy the relevant directives into your hosting config (vercel.json headers, netlify _headers, etc.).",
|
|
3
|
-
|
|
4
|
-
"default-src": "'self'",
|
|
5
|
-
"script-src": "'self'",
|
|
6
|
-
"style-src": "'self' 'unsafe-inline'",
|
|
7
|
-
"img-src": "'self' data: blob: https:",
|
|
8
|
-
"font-src": "'self'",
|
|
9
|
-
"object-src": "'none'",
|
|
10
|
-
"base-uri": "'self'",
|
|
11
|
-
"form-action": "'self'",
|
|
12
|
-
|
|
13
|
-
"_supabase": {
|
|
14
|
-
"_comment": "Add these if your app uses Supabase",
|
|
15
|
-
"connect-src": "'self' https://*.supabase.co wss://*.supabase.co",
|
|
16
|
-
"frame-src": "https://*.supabase.co"
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
"_firebase": {
|
|
20
|
-
"_comment": "Add these if your app uses Firebase",
|
|
21
|
-
"connect-src": "'self' https://*.firebaseio.com https://*.googleapis.com wss://*.firebaseio.com",
|
|
22
|
-
"frame-src": "https://*.firebaseapp.com"
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
"_google_maps": {
|
|
26
|
-
"_comment": "Add these if your app uses Google Maps (AddressField)",
|
|
27
|
-
"script-src": "'self' https://maps.googleapis.com",
|
|
28
|
-
"connect-src": "'self' https://maps.googleapis.com",
|
|
29
|
-
"img-src": "'self' data: blob: https: https://*.googleapis.com https://*.gstatic.com"
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
"_google_oauth": {
|
|
33
|
-
"_comment": "Add these if your app uses Google OAuth",
|
|
34
|
-
"connect-src": "'self' https://accounts.google.com https://oauth2.googleapis.com https://www.googleapis.com",
|
|
35
|
-
"frame-src": "https://accounts.google.com"
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
"_rules": [
|
|
39
|
-
"NEVER mix 'none' with URLs in the same directive (e.g., frame-src 'none' https://... is invalid)",
|
|
40
|
-
"NEVER use 'unsafe-eval' — Vite HMR works without it in dev, production never needs it",
|
|
41
|
-
"Merge connect-src values from all providers you use into a single directive",
|
|
42
|
-
"credentials: 'omit' is set by the framework on cross-origin fetches — CSP does not need to allow cookies for these"
|
|
43
|
-
]
|
|
44
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// functions/src/api/oauth/disconnect.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} Disconnect OAuth Wrapper
|
|
5
|
-
* @description Wrapper for framework's disconnect with {{APP_NAME}}-specific configuration
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { NextApiRequest, NextApiResponse } from 'next';
|
|
9
|
-
import { disconnect as frameworkDisconnect } from '@donotdev/functions/vercel';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* {{APP_NAME}} OAuth disconnection
|
|
13
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
14
|
-
*/
|
|
15
|
-
export default async function handler(
|
|
16
|
-
req: NextApiRequest,
|
|
17
|
-
res: NextApiResponse
|
|
18
|
-
) {
|
|
19
|
-
return frameworkDisconnect(req, res);
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// functions/src/api/oauth/getConnections.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} Get Connections Wrapper
|
|
5
|
-
* @description Wrapper for framework's getConnections with {{APP_NAME}}-specific configuration
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { NextApiRequest, NextApiResponse } from 'next';
|
|
9
|
-
import { getConnections as frameworkGetConnections } from '@donotdev/functions/vercel';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* {{APP_NAME}} OAuth connections retrieval
|
|
13
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
14
|
-
*/
|
|
15
|
-
export default async function handler(
|
|
16
|
-
req: NextApiRequest,
|
|
17
|
-
res: NextApiResponse
|
|
18
|
-
) {
|
|
19
|
-
return frameworkGetConnections(req, res);
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// functions/src/api/oauth/refreshToken.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} Refresh Token Wrapper
|
|
5
|
-
* @description Wrapper for framework's refreshToken with {{APP_NAME}}-specific configuration
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type { NextApiRequest, NextApiResponse } from 'next';
|
|
9
|
-
import { refreshToken as frameworkRefreshToken } from '@donotdev/functions/vercel';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* {{APP_NAME}} OAuth token refresh
|
|
13
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
14
|
-
*/
|
|
15
|
-
export default async function handler(
|
|
16
|
-
req: NextApiRequest,
|
|
17
|
-
res: NextApiResponse
|
|
18
|
-
) {
|
|
19
|
-
return frameworkRefreshToken(req, res);
|
|
20
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"functions": {
|
|
3
|
-
"src/api/**/*.ts": {
|
|
4
|
-
"runtime": "nodejs22.x"
|
|
5
|
-
}
|
|
6
|
-
},
|
|
7
|
-
"env": {
|
|
8
|
-
"STRIPE_SECRET_KEY": "@stripe-secret-key",
|
|
9
|
-
"STRIPE_WEBHOOK_SECRET": "@stripe-webhook-secret",
|
|
10
|
-
"GITHUB_PERSONAL_ACCESS_TOKEN": "@github-token",
|
|
11
|
-
"GITHUB_REPO_OWNER": "@github-repo-owner",
|
|
12
|
-
"GITHUB_REPO_NAME": "@github-repo-name"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# .claude/hooks/typecheck-stop.sh
|
|
3
|
-
# Stop hook: run dn tc before declaring done.
|
|
4
|
-
# Ensures type safety before any work is considered complete.
|
|
5
|
-
|
|
6
|
-
set -euo pipefail
|
|
7
|
-
|
|
8
|
-
# Only run if there are uncommitted changes (something was written)
|
|
9
|
-
DIRTY=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
|
|
10
|
-
[ "$DIRTY" -eq 0 ] && exit 0
|
|
11
|
-
|
|
12
|
-
echo "Running typecheck before completion..." >&2
|
|
13
|
-
if ! dn tc 2>&1; then
|
|
14
|
-
echo '{"decision":"block","reason":"Typecheck failed. Fix type errors before completing."}'
|
|
15
|
-
exit 0
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
exit 0
|