@donotdev/cli 0.1.0 → 0.1.42
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/LICENSE.md +1 -1
- package/README.md +0 -0
- package/dependencies-matrix.json +175 -72
- package/dist/bin/commands/agent-setup.js +936 -428
- package/dist/bin/commands/build.js +4363 -883
- package/dist/bin/commands/bump.js +1296 -780
- package/dist/bin/commands/cacheout.js +494 -363
- package/dist/bin/commands/coach.js +632 -431
- package/dist/bin/commands/create-app.js +1316 -799
- package/dist/bin/commands/create-project.js +1355 -827
- package/dist/bin/commands/db.js +26158 -18868
- package/dist/bin/commands/deploy.js +5983 -1971
- package/dist/bin/commands/dev.js +1223 -657
- package/dist/bin/commands/doctor.js +1100 -528
- package/dist/bin/commands/emu.js +1380 -757
- package/dist/bin/commands/format.js +494 -363
- package/dist/bin/commands/get-demo.js +1210 -715
- package/dist/bin/commands/make-admin.js +16073 -8700
- package/dist/bin/commands/preview.js +1227 -658
- package/dist/bin/commands/seed.js +26171 -18881
- package/dist/bin/commands/setup-cicd.js +1475 -880
- package/dist/bin/commands/setup.js +1574 -956
- package/dist/bin/commands/staging.js +5984 -1972
- package/dist/bin/commands/sync-secrets.js +1423 -676
- package/dist/bin/commands/type-check.js +976 -469
- package/dist/bin/commands/wai.js +499 -368
- package/dist/bin/dndev.js +43 -19
- package/dist/bin/donotdev.js +43 -19
- package/dist/index.js +6166 -2133
- package/guidelines/DEPENDENCIES.md +155 -0
- package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
- package/package.json +2 -1
- package/templates/app-demo/.env.example +1 -1
- package/templates/app-demo/entities/Contact.ts.example +0 -0
- package/templates/app-demo/entities/ExampleEntity.ts.example +0 -0
- package/templates/app-demo/entities/demo.ts.example +0 -0
- package/templates/app-demo/index.html.example +0 -0
- package/templates/app-demo/public/apple-touch-icon.png.example +0 -0
- package/templates/app-demo/public/fonts/fonts.css.example +0 -0
- package/templates/app-demo/public/icon-192x192.png.example +0 -0
- package/templates/app-demo/public/icon-512x512.png.example +0 -0
- package/templates/app-demo/src/App.tsx.example +0 -0
- package/templates/app-demo/src/config/app.ts.example +0 -0
- package/templates/app-demo/src/entities/booking.ts.example +0 -0
- package/templates/app-demo/src/entities/onboarding.ts.example +0 -0
- package/templates/app-demo/src/entities/product.ts.example +0 -0
- package/templates/app-demo/src/entities/quote.ts.example +0 -0
- package/templates/app-demo/src/globals.css.example +0 -0
- package/templates/app-demo/src/main.tsx.example +0 -0
- package/templates/app-demo/src/pages/ChangelogPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/ConditionalFormPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/DashboardPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/HomePage.tsx.example +0 -0
- package/templates/app-demo/src/pages/OnboardingPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/PricingPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/ProductsPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/ProfilePage.tsx.example +0 -0
- package/templates/app-demo/src/pages/SettingsPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/ShowcasePage.tsx.example +0 -0
- package/templates/app-demo/src/pages/components/ComponentRenderer.tsx.example +0 -0
- package/templates/app-demo/src/pages/components/ComponentsData.tsx.example +0 -0
- package/templates/app-demo/src/pages/components/componentConfig.ts.example +0 -0
- package/templates/app-demo/src/pages/legal/LegalPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/legal/PrivacyPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/legal/TermsPage.tsx.example +0 -0
- package/templates/app-demo/src/themes.css.example +27 -0
- package/templates/app-demo/tsconfig.json.example +0 -0
- package/templates/app-demo/vite.config.ts.example +0 -0
- package/templates/app-dndev/index.html.example +0 -3
- package/templates/app-dndev/src/App.tsx.example +0 -0
- package/templates/app-dndev/src/components/CockpitLayout.css.example +0 -0
- package/templates/app-dndev/src/components/CockpitLayout.tsx.example +0 -0
- package/templates/app-dndev/src/components/Kanban.css.example +0 -0
- package/templates/app-dndev/src/components/ModeToggle.tsx.example +0 -0
- package/templates/app-dndev/src/components/OverlaySlot.tsx.example +0 -0
- package/templates/app-dndev/src/components/TerminalPanel.css.example +0 -0
- package/templates/app-dndev/src/components/TerminalPanel.tsx.example +0 -0
- package/templates/app-dndev/src/components/markdown-prose.css.example +0 -0
- package/templates/app-dndev/src/components/phases/CaptainLog.tsx.example +0 -0
- package/templates/app-dndev/src/components/phases/ContextTabs.tsx.example +0 -0
- package/templates/app-dndev/src/components/phases/PhaseCard.tsx.example +0 -0
- package/templates/app-dndev/src/components/phases/PhaseDetail.tsx.example +0 -0
- package/templates/app-dndev/src/components/phases/ReviewPanel.tsx.example +0 -0
- package/templates/app-dndev/src/components/phases/phaseData.ts.example +0 -0
- package/templates/app-dndev/src/config/app.ts.example +0 -0
- package/templates/app-dndev/src/config/commands.ts.example +0 -0
- package/templates/app-dndev/src/config/legal.ts.example +0 -0
- package/templates/app-dndev/src/config/providers.ts.example +1 -1
- package/templates/app-dndev/src/globals.css.example +0 -0
- package/templates/app-dndev/src/hooks/useDndevFile.ts.example +0 -0
- package/templates/app-dndev/src/main.tsx.example +0 -0
- package/templates/app-dndev/src/pages/BoardPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/GrillPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/HomePage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/NotFoundPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/PhasesPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/SettingsPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/legal/LegalNoticePage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/legal/PrivacyPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/legal/TermsPage.tsx.example +0 -0
- package/templates/app-dndev/src/stores/dndevStore.ts.example +0 -0
- package/templates/app-dndev/src/themes.css.example +26 -0
- package/templates/app-dndev/terminal-sidecar.cjs.example +0 -0
- package/templates/app-dndev/vite.config.ts.example +0 -0
- package/templates/app-expo/.env.example +0 -32
- package/templates/app-expo/.expo/README.md.example +0 -0
- package/templates/app-expo/.gitignore.example +0 -0
- package/templates/app-expo/README.md.example +1 -1
- package/templates/app-expo/app/.gitkeep +0 -0
- package/templates/app-expo/app/_layout.tsx.example +0 -0
- package/templates/app-expo/app/form.tsx.example +0 -0
- package/templates/app-expo/app/index.tsx.example +0 -0
- package/templates/app-expo/app/list.tsx.example +0 -0
- package/templates/app-expo/app/profile.tsx.example +0 -0
- package/templates/app-expo/app/signin.tsx.example +0 -0
- package/templates/app-expo/app.json.example +0 -0
- package/templates/app-expo/assets/adaptive-icon.png +0 -0
- package/templates/app-expo/assets/favicon.png +0 -0
- package/templates/app-expo/assets/icon.png +0 -0
- package/templates/app-expo/assets/splash.png +0 -0
- package/templates/app-expo/babel.config.js.example +0 -0
- package/templates/app-expo/eas.json.example +0 -0
- package/templates/app-expo/expo-env.d.ts.example +0 -0
- package/templates/app-expo/metro.config.js.example +0 -0
- package/templates/app-expo/service-account-key.json.example +1 -1
- package/templates/app-expo/src/config/app.ts.example +0 -0
- package/templates/app-expo/src/config/providers.ts.example +1 -1
- package/templates/app-expo/tsconfig.json.example +0 -0
- package/templates/app-next/.env.example +0 -33
- package/templates/app-next/next.config.ts.example +0 -2
- package/templates/app-next/postcss.config.js.example +0 -0
- package/templates/app-next/service-account-key.json.example +0 -0
- package/templates/app-next/src/app/ClientLayout.tsx.example +0 -0
- package/templates/app-next/src/app/layout.tsx.example +13 -4
- package/templates/app-next/src/app/not-found.tsx.example +0 -0
- package/templates/app-next/src/config/app.ts.example +0 -0
- package/templates/app-next/src/config/legal.ts.example +0 -0
- package/templates/app-next/src/config/providers.ts.example +1 -1
- package/templates/app-next/src/globals.css.example +0 -0
- package/templates/app-next/src/locales/dndev_en.json.example +0 -0
- package/templates/app-next/src/locales/home_en.json.example +6 -6
- package/templates/app-next/src/pages/HomePage.tsx.example +0 -0
- package/templates/app-next/src/pages/legal/LegalNoticePage.tsx.example +0 -0
- package/templates/app-next/src/pages/legal/PrivacyPage.tsx.example +0 -0
- package/templates/app-next/src/pages/legal/TermsPage.tsx.example +0 -0
- package/templates/app-next/src/pages/locales/example_en.json.example +0 -0
- package/templates/app-next/src/themes.css.example +28 -1
- package/templates/app-vite/.env.example +0 -33
- package/templates/app-vite/csp.example.json +44 -0
- package/templates/app-vite/index.html.example +0 -3
- package/templates/app-vite/service-account-key.json.example +0 -0
- package/templates/app-vite/src/App.tsx.example +0 -0
- package/templates/app-vite/src/config/app.ts.example +0 -0
- package/templates/app-vite/src/config/legal.ts.example +0 -0
- package/templates/app-vite/src/config/providers.ts.example +1 -1
- package/templates/app-vite/src/globals.css.example +0 -0
- package/templates/app-vite/src/locales/dndev_en.json.example +0 -0
- package/templates/app-vite/src/locales/home_en.json.example +6 -6
- package/templates/app-vite/src/main.tsx.example +0 -0
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +0 -0
- package/templates/app-vite/src/pages/HomePage.tsx.example +1 -1
- package/templates/app-vite/src/pages/ListPageExample.tsx.example +0 -0
- package/templates/app-vite/src/pages/NotFoundPage.tsx.example +0 -0
- package/templates/app-vite/src/pages/legal/LegalNoticePage.tsx.example +0 -0
- package/templates/app-vite/src/pages/legal/PrivacyPage.tsx.example +0 -0
- package/templates/app-vite/src/pages/legal/TermsPage.tsx.example +0 -0
- package/templates/app-vite/src/pages/locales/example_en.json.example +0 -0
- package/templates/app-vite/src/themes.css.example +26 -0
- package/templates/deploy-config/.firebaserc.example +0 -0
- package/templates/deploy-config/firestore.indexes.json.example +0 -0
- package/templates/deploy-config/firestore.rules.example +0 -0
- package/templates/deploy-config/storage.rules.example +0 -0
- package/templates/deploy-config/tsconfig.functions.json.example +0 -0
- package/templates/deploy-config/vercel.json.example +2 -2
- package/templates/functions-firebase/.env.example +2 -2
- package/templates/functions-firebase/README.md.example +3 -3
- package/templates/functions-firebase/build.mjs.example +0 -0
- package/templates/functions-firebase/functions.config.js.example +0 -0
- package/templates/functions-firebase/functions.yaml.example +0 -0
- package/templates/functions-firebase/src/auth/getCustomClaims.ts.example +0 -0
- package/templates/functions-firebase/src/auth/getUserAuthStatus.ts.example +0 -0
- package/templates/functions-firebase/src/auth/index.ts.example +0 -0
- package/templates/functions-firebase/src/auth/removeCustomClaims.ts.example +0 -0
- package/templates/functions-firebase/src/auth/setCustomClaims.ts.example +0 -0
- package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +0 -0
- package/templates/functions-firebase/src/billing/index.ts.example +0 -0
- package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -0
- package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +0 -0
- package/templates/functions-firebase/src/crud/createEntity.ts.example +0 -0
- package/templates/functions-firebase/src/crud/deleteEntity.ts.example +0 -0
- package/templates/functions-firebase/src/crud/getEntity.ts.example +0 -0
- package/templates/functions-firebase/src/crud/index.ts.example +0 -0
- package/templates/functions-firebase/src/crud/listEntities.ts.example +0 -0
- package/templates/functions-firebase/src/crud/updateEntity.ts.example +0 -0
- package/templates/functions-firebase/src/index.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/checkGitHubAccess.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/disconnect.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/exchangeToken.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/getConnections.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/grantGitHubAccess.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/index.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/refreshToken.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/revokeGitHubAccess.ts.example +0 -0
- package/templates/functions-firebase/tsconfig.json.example +0 -0
- package/templates/functions-supabase/supabase/config.toml.example +0 -0
- package/templates/functions-supabase/supabase/functions/.env.example +0 -0
- package/templates/functions-supabase/supabase/functions/cancel-subscription/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/change-plan/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/create-checkout-session/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/create-customer-portal/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/crud/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/delete-account/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/deno.json.example +0 -0
- package/templates/functions-supabase/supabase/functions/disconnect-oauth/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/exchange-token/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/get-connections/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/get-custom-claims/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/get-user-auth-status/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/refresh-subscription-status/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/refresh-token/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/remove-custom-claims/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/set-custom-claims/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000002_cleanup_jobs.sql +0 -0
- package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000004_crud_bulk.sql +192 -0
- package/templates/functions-vercel/.env.example +3 -3
- package/templates/functions-vercel/README.md.example +2 -2
- package/templates/functions-vercel/build.mjs.example +0 -0
- package/templates/functions-vercel/src/api/auth/getCustomClaims.ts.example +0 -0
- package/templates/functions-vercel/src/api/auth/getUserAuthStatus.ts.example +0 -0
- package/templates/functions-vercel/src/api/auth/removeCustomClaims.ts.example +0 -0
- package/templates/functions-vercel/src/api/auth/setCustomClaims.ts.example +0 -0
- package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +0 -0
- package/templates/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -0
- package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +0 -0
- package/templates/functions-vercel/src/api/crud/createEntity.ts.example +0 -0
- package/templates/functions-vercel/src/api/crud/deleteEntity.ts.example +0 -0
- package/templates/functions-vercel/src/api/crud/getEntity.ts.example +0 -0
- package/templates/functions-vercel/src/api/crud/listEntities.ts.example +0 -0
- package/templates/functions-vercel/src/api/crud/updateEntity.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/disconnect.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/exchangeToken.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/getConnections.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/refreshToken.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/revokeGitHubAccess.ts.example +0 -0
- package/templates/functions-vercel/tsconfig.json.example +0 -0
- package/templates/functions-vercel/vercel.json.example +0 -0
- package/templates/github-consumer/.github/workflows/ci.yml.example +0 -0
- package/templates/overlay-firebase/env.fragment.example +0 -0
- package/templates/overlay-firebase/env.fragment.expo.example +0 -0
- package/templates/overlay-firebase/env.fragment.nextjs.example +0 -0
- package/templates/overlay-firebase/src/config/providers.expo.ts.example +0 -0
- package/templates/overlay-firebase/src/config/providers.ts.example +0 -0
- package/templates/overlay-supabase/env.fragment.example +0 -0
- package/templates/overlay-supabase/env.fragment.expo.example +0 -0
- package/templates/overlay-supabase/env.fragment.nextjs.example +0 -0
- package/templates/overlay-supabase/src/config/providers.expo.ts.example +1 -1
- package/templates/overlay-supabase/src/config/providers.ts.example +1 -1
- package/templates/overlay-vercel/env.fragment.example +0 -0
- package/templates/overlay-vercel/env.fragment.nextjs.example +0 -0
- package/templates/overlay-vercel/src/config/providers.ts.example +0 -0
- package/templates/preset-admin/src/pages/DashboardPage.tsx.example +0 -0
- package/templates/preset-admin/src/pages/EntityPage.tsx.example +0 -0
- package/templates/preset-admin/src/pages/ReportsPage.tsx.example +0 -0
- package/templates/preset-admin/src/pages/SettingsPage.tsx.example +0 -0
- package/templates/preset-admin/src/pages/UsersPage.tsx.example +0 -0
- package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +0 -0
- package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +0 -0
- package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +0 -0
- package/templates/preset-ecommerce/src/pages/HomePage.tsx.example +0 -0
- package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +0 -0
- package/templates/preset-landing/src/pages/AboutPage.tsx.example +0 -0
- package/templates/preset-landing/src/pages/ContactPage.tsx.example +0 -0
- package/templates/preset-landing/src/pages/HomePage.tsx.example +0 -0
- package/templates/preset-saas/src/pages/DashboardPage.tsx.example +0 -0
- package/templates/preset-saas/src/pages/HomePage.tsx.example +0 -0
- package/templates/preset-saas/src/pages/PricingPage.tsx.example +0 -0
- package/templates/preset-saas/src/pages/ProfilePage.tsx.example +0 -0
- package/templates/preset-saas/src/pages/SettingsPage.tsx.example +0 -0
- package/templates/root-consumer/.claude/agents/architect.md.example +0 -0
- package/templates/root-consumer/.claude/agents/builder.md.example +0 -0
- package/templates/root-consumer/.claude/agents/coder.md.example +0 -0
- package/templates/root-consumer/.claude/agents/extractor.md.example +0 -0
- package/templates/root-consumer/.claude/agents/polisher.md.example +0 -0
- package/templates/root-consumer/.claude/agents/prompt-engineer.md.example +0 -0
- package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +61 -0
- package/templates/root-consumer/.claude/hooks/guard-write.sh.example +56 -0
- package/templates/root-consumer/.claude/hooks/session-start.sh.example +50 -0
- package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +18 -0
- package/templates/root-consumer/.claude/rules/consumer-ux.md.example +32 -0
- package/templates/root-consumer/.claude/rules/definition-of-done.md.example +32 -0
- package/templates/root-consumer/.claude/rules/framework.md.example +39 -0
- package/templates/root-consumer/.claude/rules/git.md.example +14 -0
- package/templates/root-consumer/.claude/rules/security.md.example +13 -0
- package/templates/root-consumer/.claude/settings.json.example +100 -4
- package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +0 -0
- package/templates/root-consumer/.claude/skills/build/SKILL.md.example +22 -27
- package/templates/root-consumer/.claude/skills/design/SKILL.md.example +0 -0
- package/templates/root-consumer/.claude/skills/design/output-template.md +0 -0
- package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +26 -15
- package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +50 -37
- package/templates/root-consumer/.claude/skills/techdebt/SKILL.md.example +0 -0
- package/templates/root-consumer/.cursor/mcp.json.example +0 -0
- package/templates/root-consumer/.cursor/rules/no-docs.mdc.example +5 -1
- package/templates/root-consumer/.dndev/args.json.example +0 -0
- package/templates/root-consumer/.dndev.secrets.example +0 -0
- package/templates/root-consumer/.env.example +0 -1
- package/templates/root-consumer/.gemini/settings.json.example +0 -0
- package/templates/root-consumer/.gitignore.example +1 -0
- package/templates/root-consumer/.mcp.json.example +0 -0
- package/templates/root-consumer/.prettierrc.cjs.example +0 -0
- package/templates/root-consumer/AGENTS.md.example +63 -0
- package/templates/root-consumer/CLAUDE.md.example +1 -1
- package/templates/root-consumer/README.md.example +11 -33
- package/templates/root-consumer/entities/index.ts.example +0 -0
- package/templates/root-consumer/eslint.config.js.example +0 -0
- package/templates/root-consumer/tsconfig.json.example +0 -0
- package/templates/app-demo/public/manifest.json.example +0 -10
- package/templates/app-dndev/public/manifest.json.example +0 -10
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +0 -175
- package/templates/root-consumer/.claude/commands/build.md.example +0 -131
- package/templates/root-consumer/.claude/commands/design.md.example +0 -184
- package/templates/root-consumer/.claude/commands/grill.md.example +0 -135
- package/templates/root-consumer/.claude/commands/polish.md.example +0 -146
- package/templates/root-consumer/.claude/commands/techdebt.md.example +0 -28
- package/templates/root-consumer/.claude/statusline.py.example +0 -79
- package/templates/root-consumer/.clinerules.example +0 -1
- package/templates/root-consumer/.cursorrules.example +0 -1
- package/templates/root-consumer/.github/copilot-instructions.md.example +0 -1
- package/templates/root-consumer/.windsurfrules.example +0 -1
- package/templates/root-consumer/AI.md.example +0 -108
- package/templates/root-consumer/CONVENTIONS.md.example +0 -1
- package/templates/root-consumer/GEMINI.md.example +0 -1
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +0 -135
- package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +0 -276
- package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +0 -180
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +0 -234
- package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +0 -136
- package/templates/root-consumer/guides/dndev/COMPONENT_API.md.example +0 -195
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +0 -219
- package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +0 -197
- package/templates/root-consumer/guides/dndev/INDEX.md.example +0 -60
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +0 -132
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +0 -133
- package/templates/root-consumer/guides/dndev/SETUP_BILLING.md.example +0 -114
- package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +0 -280
- package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +0 -115
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +0 -334
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +0 -231
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +0 -9
- package/templates/root-consumer/guides/dndev/SETUP_I18N.md.example +0 -233
- package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +0 -158
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +0 -54
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +0 -60
- package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +0 -205
- package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +0 -213
- package/templates/root-consumer/guides/dndev/SETUP_SOC2.md.example +0 -234
- package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +0 -62
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +0 -215
- package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +0 -184
- package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +0 -111
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +0 -260
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +0 -499
- package/templates/root-consumer/guides/dndev/advanced/APP_CHECK.md.example +0 -111
- package/templates/root-consumer/guides/dndev/advanced/COOKIE_REFERENCE.md.example +0 -252
- package/templates/root-consumer/guides/dndev/advanced/EMULATORS.md.example +0 -48
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +0 -288
- package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +0 -402
- package/templates/root-consumer/guides/wai-way/agents/architect.md.example +0 -78
- package/templates/root-consumer/guides/wai-way/agents/builder.md.example +0 -97
- package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +0 -363
- package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +0 -133
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +0 -315
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +0 -133
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +0 -111
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +0 -150
- package/templates/root-consumer/guides/wai-way/blueprints/4_configure.md.example +0 -238
- package/templates/root-consumer/guides/wai-way/context_map.json.example +0 -127
- package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +0 -839
- package/templates/root-consumer/guides/wai-way/hld_template.md.example +0 -138
- package/templates/root-consumer/guides/wai-way/lld_template.md.example +0 -103
- package/templates/root-consumer/guides/wai-way/page_patterns.md.example +0 -722
- package/templates/root-consumer/guides/wai-way/prd_template.md.example +0 -140
- package/templates/root-consumer/guides/wai-way/presets_guide.md.example +0 -217
- package/templates/root-consumer/guides/wai-way/spec_template.md.example +0 -313
|
@@ -1,499 +0,0 @@
|
|
|
1
|
-
# Routing Guide
|
|
2
|
-
|
|
3
|
-
**For AI Agents:** Use framework routing components/hooks. NEVER import from `react-router-dom` directly. Framework handles SPA navigation, Outlet, and overlay closing automatically.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 🚨 Critical Rule: Never Use react-router-dom Directly
|
|
8
|
-
|
|
9
|
-
**❌ WRONG:**
|
|
10
|
-
```tsx
|
|
11
|
-
import { Link, useNavigate, useParams } from 'react-router-dom'; // ❌ BREAKS FRAMEWORK
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
**✅ CORRECT:**
|
|
15
|
-
```tsx
|
|
16
|
-
import { Link, useNavigate, useParams } from '@donotdev/ui'; // ✅ Framework routing
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**Why?** The framework's routing components:
|
|
20
|
-
- Automatically close overlays on navigation
|
|
21
|
-
- Handle SPA navigation correctly with Outlet
|
|
22
|
-
- Work with both Vite and Next.js
|
|
23
|
-
- Integrate with auth and route discovery
|
|
24
|
-
- Provide proper TypeScript types
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Framework Routing API
|
|
29
|
-
|
|
30
|
-
### Components
|
|
31
|
-
|
|
32
|
-
```tsx
|
|
33
|
-
import { Link, DnDevNavigationMenu } from '@donotdev/ui';
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**Link Component:**
|
|
37
|
-
```tsx
|
|
38
|
-
<Link path="/products" label="Products" icon="Package" />
|
|
39
|
-
<Link path="/users/:id" replace prefetch={false}>User Details</Link>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
**DnDevNavigationMenu (Sidebar/Header):**
|
|
43
|
-
```tsx
|
|
44
|
-
// Auto-fetches routes, handles auth filtering
|
|
45
|
-
<DnDevNavigationMenu vertical display={DISPLAY.AUTO} />
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Hooks
|
|
49
|
-
|
|
50
|
-
```tsx
|
|
51
|
-
import {
|
|
52
|
-
useNavigate,
|
|
53
|
-
useLocation,
|
|
54
|
-
useParams,
|
|
55
|
-
useRouteParam,
|
|
56
|
-
useSearchParams,
|
|
57
|
-
useNavigationItems,
|
|
58
|
-
} from '@donotdev/ui';
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Navigation Patterns
|
|
64
|
-
|
|
65
|
-
### 1. Basic Navigation
|
|
66
|
-
|
|
67
|
-
**✅ Use framework Link:**
|
|
68
|
-
```tsx
|
|
69
|
-
import { Link } from '@donotdev/ui';
|
|
70
|
-
|
|
71
|
-
function ProductCard({ product }) {
|
|
72
|
-
return (
|
|
73
|
-
<Link path={`/products/${product.id}`} label={product.name} />
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**✅ Use framework useNavigate:**
|
|
79
|
-
```tsx
|
|
80
|
-
import { useNavigate } from '@donotdev/ui';
|
|
81
|
-
|
|
82
|
-
function ProductForm() {
|
|
83
|
-
const navigate = useNavigate();
|
|
84
|
-
|
|
85
|
-
const handleSubmit = async () => {
|
|
86
|
-
await saveProduct();
|
|
87
|
-
navigate('/products'); // ✅ Closes overlays automatically
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
return <form onSubmit={handleSubmit}>...</form>;
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
**❌ DON'T use react-router-dom:**
|
|
95
|
-
```tsx
|
|
96
|
-
import { useNavigate } from 'react-router-dom'; // ❌ BREAKS FRAMEWORK
|
|
97
|
-
|
|
98
|
-
function ProductForm() {
|
|
99
|
-
const navigate = useNavigate(); // ❌ Doesn't close overlays, breaks SPA
|
|
100
|
-
// ...
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
### 2. Route Parameters
|
|
107
|
-
|
|
108
|
-
**✅ Use framework useRouteParam:**
|
|
109
|
-
```tsx
|
|
110
|
-
import { useRouteParam } from '@donotdev/ui';
|
|
111
|
-
|
|
112
|
-
function ProductPage() {
|
|
113
|
-
const id = useRouteParam('id'); // ✅ Returns string | undefined
|
|
114
|
-
// Safe: handles string | string[] | undefined automatically
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**✅ Or use framework useParams:**
|
|
119
|
-
```tsx
|
|
120
|
-
import { useParams } from '@donotdev/ui';
|
|
121
|
-
|
|
122
|
-
function ProductPage() {
|
|
123
|
-
const params = useParams();
|
|
124
|
-
const id = typeof params.id === 'string' ? params.id : undefined;
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**❌ DON'T use react-router-dom:**
|
|
129
|
-
```tsx
|
|
130
|
-
import { useParams } from 'react-router-dom'; // ❌ Type issues, breaks framework
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
### 3. Sidebar Navigation
|
|
136
|
-
|
|
137
|
-
**✅ Use DnDevNavigationMenu (auto-fetches routes):**
|
|
138
|
-
```tsx
|
|
139
|
-
import { DnDevNavigationMenu, DISPLAY } from '@donotdev/ui';
|
|
140
|
-
|
|
141
|
-
function Sidebar() {
|
|
142
|
-
return (
|
|
143
|
-
<DnDevNavigationMenu
|
|
144
|
-
vertical
|
|
145
|
-
display={DISPLAY.AUTO} // CSS-driven collapse
|
|
146
|
-
showIcons={true}
|
|
147
|
-
/>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
**✅ Or use useNavigationItems for custom sidebar:**
|
|
153
|
-
```tsx
|
|
154
|
-
import { Link, useNavigationItems } from '@donotdev/ui';
|
|
155
|
-
|
|
156
|
-
function CustomSidebar() {
|
|
157
|
-
const menuItems = useNavigationItems(); // ✅ Auth-filtered routes
|
|
158
|
-
|
|
159
|
-
return (
|
|
160
|
-
<nav>
|
|
161
|
-
{menuItems.map((item) => (
|
|
162
|
-
<Link
|
|
163
|
-
key={item.path}
|
|
164
|
-
path={item.path}
|
|
165
|
-
label={item.label}
|
|
166
|
-
icon={item.icon}
|
|
167
|
-
className={item.isActive ? 'active' : ''}
|
|
168
|
-
/>
|
|
169
|
-
))}
|
|
170
|
-
</nav>
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
**❌ DON'T manually build navigation:**
|
|
176
|
-
```tsx
|
|
177
|
-
import { Link } from 'react-router-dom'; // ❌ BREAKS FRAMEWORK
|
|
178
|
-
|
|
179
|
-
function Sidebar() {
|
|
180
|
-
// ❌ Doesn't integrate with route discovery
|
|
181
|
-
// ❌ Doesn't handle auth filtering
|
|
182
|
-
// ❌ Doesn't work with Outlet
|
|
183
|
-
return (
|
|
184
|
-
<nav>
|
|
185
|
-
<Link to="/products">Products</Link>
|
|
186
|
-
</nav>
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
### 4. Programmatic Navigation
|
|
194
|
-
|
|
195
|
-
**✅ Use framework useNavigate:**
|
|
196
|
-
```tsx
|
|
197
|
-
import { useNavigate } from '@donotdev/ui';
|
|
198
|
-
|
|
199
|
-
function LoginForm() {
|
|
200
|
-
const navigate = useNavigate();
|
|
201
|
-
|
|
202
|
-
const handleLogin = async () => {
|
|
203
|
-
await signIn();
|
|
204
|
-
navigate('/dashboard', { replace: true }); // ✅ Closes overlays
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
return <form onSubmit={handleLogin}>...</form>;
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
**✅ Navigate back:**
|
|
212
|
-
```tsx
|
|
213
|
-
const navigate = useNavigate();
|
|
214
|
-
navigate('back'); // ✅ Framework handles browser history
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
**✅ With options:**
|
|
218
|
-
```tsx
|
|
219
|
-
navigate('/products', {
|
|
220
|
-
replace: true, // Replace history entry
|
|
221
|
-
preserveScroll: true, // Preserve scroll position
|
|
222
|
-
});
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
---
|
|
226
|
-
|
|
227
|
-
### 5. Query Parameters
|
|
228
|
-
|
|
229
|
-
**✅ Use framework useSearchParams (read-only, returns URLSearchParams directly):**
|
|
230
|
-
```tsx
|
|
231
|
-
import { useSearchParams } from '@donotdev/ui';
|
|
232
|
-
|
|
233
|
-
function ProductList() {
|
|
234
|
-
const searchParams = useSearchParams();
|
|
235
|
-
const page = searchParams.get('page') || '1';
|
|
236
|
-
|
|
237
|
-
return <div>Page: {page}</div>;
|
|
238
|
-
}
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
**✅ Or use useQueryParams helper:**
|
|
242
|
-
```tsx
|
|
243
|
-
import { useQueryParams } from '@donotdev/ui';
|
|
244
|
-
|
|
245
|
-
function ProductList() {
|
|
246
|
-
const { page, sort } = useQueryParams({ page: '1', sort: 'name' });
|
|
247
|
-
// Returns { page: string, sort: string } with defaults
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
### 6. Route Matching
|
|
254
|
-
|
|
255
|
-
**✅ Use framework useMatch:**
|
|
256
|
-
```tsx
|
|
257
|
-
import { useMatch } from '@donotdev/ui';
|
|
258
|
-
|
|
259
|
-
function NavigationItem({ path }) {
|
|
260
|
-
const isActive = useMatch(path);
|
|
261
|
-
return <Link path={path} className={isActive ? 'active' : ''} />;
|
|
262
|
-
}
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
|
-
## Outlet and Nested Routes
|
|
268
|
-
|
|
269
|
-
**Framework handles Outlet automatically.** You don't need to manually use `<Outlet />` in most cases.
|
|
270
|
-
|
|
271
|
-
### How It Works
|
|
272
|
-
|
|
273
|
-
1. **RootLayout** wraps all routes and includes `<Outlet />`
|
|
274
|
-
2. **DnDevLayout** receives `<Outlet />` and renders it in the main content area
|
|
275
|
-
3. **Routes are discovered** from `src/pages/*Page.tsx` files automatically
|
|
276
|
-
|
|
277
|
-
**✅ Your pages just render content:**
|
|
278
|
-
```tsx
|
|
279
|
-
// src/pages/ProductsPage.tsx
|
|
280
|
-
export function ProductsPage() {
|
|
281
|
-
return <div>Products List</div>; // ✅ Rendered via Outlet automatically
|
|
282
|
-
}
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
**❌ DON'T manually use Outlet:**
|
|
286
|
-
```tsx
|
|
287
|
-
import { Outlet } from 'react-router-dom'; // ❌ BREAKS FRAMEWORK
|
|
288
|
-
|
|
289
|
-
export function ProductsPage() {
|
|
290
|
-
return (
|
|
291
|
-
<div>
|
|
292
|
-
<h1>Products</h1>
|
|
293
|
-
<Outlet /> {/* ❌ Framework already handles this */}
|
|
294
|
-
</div>
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
### Nested Routes (Advanced)
|
|
300
|
-
|
|
301
|
-
If you need nested routes, use the framework's route discovery:
|
|
302
|
-
|
|
303
|
-
```tsx
|
|
304
|
-
// src/pages/products/ProductsPage.tsx
|
|
305
|
-
export const pageMeta = {
|
|
306
|
-
route: '/products',
|
|
307
|
-
// ...
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
// src/pages/products/ProductDetailPage.tsx
|
|
311
|
-
export const pageMeta = {
|
|
312
|
-
route: '/products/:id',
|
|
313
|
-
// ...
|
|
314
|
-
};
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
Framework automatically creates nested route structure.
|
|
318
|
-
|
|
319
|
-
---
|
|
320
|
-
|
|
321
|
-
## Route Discovery
|
|
322
|
-
|
|
323
|
-
**Routes are auto-discovered from `src/pages/*Page.tsx` files.**
|
|
324
|
-
|
|
325
|
-
**✅ Define routes with PageMeta:**
|
|
326
|
-
```tsx
|
|
327
|
-
// src/pages/ProductsPage.tsx
|
|
328
|
-
import type { PageMeta } from '@donotdev/core';
|
|
329
|
-
|
|
330
|
-
export const pageMeta: PageMeta = {
|
|
331
|
-
title: 'Products',
|
|
332
|
-
route: '/products',
|
|
333
|
-
icon: 'Package',
|
|
334
|
-
auth: { required: true, roles: ['user', 'admin'] },
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
export function ProductsPage() {
|
|
338
|
-
return <div>Products</div>;
|
|
339
|
-
}
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
**Framework automatically:**
|
|
343
|
-
- Discovers routes from filesystem
|
|
344
|
-
- Generates navigation menus
|
|
345
|
-
- Filters by auth permissions
|
|
346
|
-
- Handles lazy loading
|
|
347
|
-
- Creates route structure
|
|
348
|
-
|
|
349
|
-
---
|
|
350
|
-
|
|
351
|
-
## Common Mistakes
|
|
352
|
-
|
|
353
|
-
### ❌ Mistake 1: Importing from react-router-dom
|
|
354
|
-
|
|
355
|
-
```tsx
|
|
356
|
-
// ❌ WRONG
|
|
357
|
-
import { Link, useNavigate } from 'react-router-dom';
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
**Fix:**
|
|
361
|
-
```tsx
|
|
362
|
-
// ✅ CORRECT
|
|
363
|
-
import { Link, useNavigate } from '@donotdev/ui';
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
---
|
|
367
|
-
|
|
368
|
-
### ❌ Mistake 2: Manual Outlet Usage
|
|
369
|
-
|
|
370
|
-
```tsx
|
|
371
|
-
// ❌ WRONG
|
|
372
|
-
import { Outlet } from 'react-router-dom';
|
|
373
|
-
|
|
374
|
-
export function Layout() {
|
|
375
|
-
return <Outlet />; // Framework already handles this
|
|
376
|
-
}
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
**Fix:** Don't use Outlet manually. Framework handles it.
|
|
380
|
-
|
|
381
|
-
---
|
|
382
|
-
|
|
383
|
-
### ❌ Mistake 3: Manual Route Configuration
|
|
384
|
-
|
|
385
|
-
```tsx
|
|
386
|
-
// ❌ WRONG
|
|
387
|
-
import { Routes, Route } from 'react-router-dom';
|
|
388
|
-
|
|
389
|
-
function App() {
|
|
390
|
-
return (
|
|
391
|
-
<Routes>
|
|
392
|
-
<Route path="/products" element={<ProductsPage />} />
|
|
393
|
-
</Routes>
|
|
394
|
-
);
|
|
395
|
-
}
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
**Fix:** Use route discovery. Create `src/pages/ProductsPage.tsx` with `pageMeta`.
|
|
399
|
-
|
|
400
|
-
---
|
|
401
|
-
|
|
402
|
-
### ❌ Mistake 4: Manual Navigation Menu
|
|
403
|
-
|
|
404
|
-
```tsx
|
|
405
|
-
// ❌ WRONG
|
|
406
|
-
function Sidebar() {
|
|
407
|
-
return (
|
|
408
|
-
<nav>
|
|
409
|
-
<Link to="/products">Products</Link>
|
|
410
|
-
<Link to="/users">Users</Link>
|
|
411
|
-
</nav>
|
|
412
|
-
);
|
|
413
|
-
}
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
**Fix:**
|
|
417
|
-
```tsx
|
|
418
|
-
// ✅ CORRECT
|
|
419
|
-
import { DnDevNavigationMenu } from '@donotdev/ui';
|
|
420
|
-
|
|
421
|
-
function Sidebar() {
|
|
422
|
-
return <DnDevNavigationMenu vertical />; // Auto-fetches routes
|
|
423
|
-
}
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
---
|
|
427
|
-
|
|
428
|
-
### ❌ Mistake 5: Not Using Framework Link
|
|
429
|
-
|
|
430
|
-
```tsx
|
|
431
|
-
// ❌ WRONG
|
|
432
|
-
import { Link } from 'react-router-dom';
|
|
433
|
-
|
|
434
|
-
<Link to="/products">Products</Link>
|
|
435
|
-
```
|
|
436
|
-
|
|
437
|
-
**Fix:**
|
|
438
|
-
```tsx
|
|
439
|
-
// ✅ CORRECT
|
|
440
|
-
import { Link } from '@donotdev/ui';
|
|
441
|
-
|
|
442
|
-
<Link path="/products" label="Products" />
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
---
|
|
446
|
-
|
|
447
|
-
## Quick Reference
|
|
448
|
-
|
|
449
|
-
### Import Paths
|
|
450
|
-
|
|
451
|
-
```tsx
|
|
452
|
-
// ✅ Framework routing (platform-agnostic)
|
|
453
|
-
import {
|
|
454
|
-
Link,
|
|
455
|
-
useNavigate,
|
|
456
|
-
useLocation,
|
|
457
|
-
useParams,
|
|
458
|
-
useRouteParam,
|
|
459
|
-
useSearchParams,
|
|
460
|
-
useNavigationItems,
|
|
461
|
-
DnDevNavigationMenu,
|
|
462
|
-
} from '@donotdev/ui';
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
### Common Patterns
|
|
466
|
-
|
|
467
|
-
```tsx
|
|
468
|
-
// Navigation
|
|
469
|
-
const navigate = useNavigate();
|
|
470
|
-
navigate('/products');
|
|
471
|
-
navigate('back');
|
|
472
|
-
navigate('/products', { replace: true });
|
|
473
|
-
|
|
474
|
-
// Route params
|
|
475
|
-
const id = useRouteParam('id');
|
|
476
|
-
|
|
477
|
-
// Query params (read-only, returns URLSearchParams directly)
|
|
478
|
-
const searchParams = useSearchParams();
|
|
479
|
-
const page = searchParams.get('page');
|
|
480
|
-
|
|
481
|
-
// Navigation menu
|
|
482
|
-
const menuItems = useNavigationItems(); // Auth-filtered routes
|
|
483
|
-
|
|
484
|
-
// Link component
|
|
485
|
-
<Link path="/products" label="Products" icon="Package" />
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
---
|
|
489
|
-
|
|
490
|
-
## Summary
|
|
491
|
-
|
|
492
|
-
1. **Always import from `@donotdev/ui`** — never `react-router-dom`
|
|
493
|
-
2. **Use `DnDevNavigationMenu`** for sidebars/headers
|
|
494
|
-
3. **Use `useNavigationItems()`** for custom navigation
|
|
495
|
-
4. **Don't use `<Outlet />` manually** - framework handles it
|
|
496
|
-
5. **Routes are auto-discovered** from `src/pages/*Page.tsx`
|
|
497
|
-
6. **Framework closes overlays** on navigation automatically
|
|
498
|
-
|
|
499
|
-
**Framework handles SPA navigation, Outlet, and route discovery. Use framework components/hooks only.**
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
# App Check Setup (Abuse Protection)
|
|
2
|
-
|
|
3
|
-
**For AI Agents:** Configure reCAPTCHA key. Framework auto-enables App Check for all Firebase resources.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 1. Environment Variables
|
|
8
|
-
|
|
9
|
-
**Vite:**
|
|
10
|
-
```bash
|
|
11
|
-
# .env
|
|
12
|
-
VITE_RECAPTCHA_SITE_KEY=6LcXXXX... # reCAPTCHA v3 site key
|
|
13
|
-
VITE_APPCHECK_DEBUG_TOKEN=XXXX-XXXX-XXXX # Optional: localhost testing
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
**Next.js:**
|
|
17
|
-
```bash
|
|
18
|
-
# .env.local
|
|
19
|
-
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=6LcXXXX...
|
|
20
|
-
NEXT_PUBLIC_APPCHECK_DEBUG_TOKEN=XXXX-XXXX-XXXX
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
**Functions (.env):**
|
|
24
|
-
```bash
|
|
25
|
-
ENFORCE_APP_CHECK=false # Set 'true' to reject requests without tokens
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## 2. Get reCAPTCHA Enterprise Key
|
|
31
|
-
|
|
32
|
-
1. Go to [Google Cloud Console - reCAPTCHA](https://console.cloud.google.com/security/recaptcha)
|
|
33
|
-
2. Create key:
|
|
34
|
-
- Platform: Website
|
|
35
|
-
- Type: Score-based (checkbox optional)
|
|
36
|
-
- Domains: `localhost`, `yourdomain.com`
|
|
37
|
-
3. Copy Site Key (starts with `6L...`)
|
|
38
|
-
|
|
39
|
-
> First 1M calls/month are free.
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## 3. Enable in Firebase Console
|
|
44
|
-
|
|
45
|
-
1. [Firebase Console](https://console.firebase.google.com) → **App Check**
|
|
46
|
-
2. Click **Register app** → select your web app
|
|
47
|
-
3. Choose **reCAPTCHA v3**, paste Site Key
|
|
48
|
-
4. Save
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## 4. Localhost Debug Token
|
|
53
|
-
|
|
54
|
-
reCAPTCHA doesn't work on localhost. Use debug tokens:
|
|
55
|
-
|
|
56
|
-
1. Start app in dev mode
|
|
57
|
-
2. Check console for: `App Check debug token: XXXXXXXX-XXXX-...`
|
|
58
|
-
3. Copy token
|
|
59
|
-
4. Firebase Console → App Check → **Manage debug tokens**
|
|
60
|
-
5. Add token with name (e.g., "Local Dev - John")
|
|
61
|
-
6. Add to `.env`:
|
|
62
|
-
- Vite: `VITE_APPCHECK_DEBUG_TOKEN=XXXXXXXX-XXXX-...`
|
|
63
|
-
- Next.js: `NEXT_PUBLIC_APPCHECK_DEBUG_TOKEN=XXXXXXXX-XXXX-...`
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## 5. How It Works
|
|
68
|
-
|
|
69
|
-
**Automatic:**
|
|
70
|
-
- Framework detects `RECAPTCHA_SITE_KEY` env var
|
|
71
|
-
- Auto-initializes App Check during Firebase init
|
|
72
|
-
- All Firebase requests include tokens automatically
|
|
73
|
-
- No code changes needed
|
|
74
|
-
|
|
75
|
-
**Server-side:**
|
|
76
|
-
- Default: Logs warnings for missing tokens
|
|
77
|
-
- Set `ENFORCE_APP_CHECK=true` to reject invalid requests
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## 6. Verification
|
|
82
|
-
|
|
83
|
-
**Console messages:**
|
|
84
|
-
| Message | Status |
|
|
85
|
-
|---------|--------|
|
|
86
|
-
| `[AppCheck] Enabled - all Firebase requests are protected` | Working |
|
|
87
|
-
| `[AppCheck] Not configured...` | Key missing (prod only) |
|
|
88
|
-
| `[AppCheck] Missing token for <operation>` | Server warning |
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## 7. Rollout Strategy
|
|
93
|
-
|
|
94
|
-
1. **Monitor:** Deploy without enforcement, check logs
|
|
95
|
-
2. **Enforce:** Set `ENFORCE_APP_CHECK=true` when ready
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## What App Check Protects
|
|
100
|
-
|
|
101
|
-
- Bot/script attacks
|
|
102
|
-
- Unauthorized API access
|
|
103
|
-
- Request replay attacks
|
|
104
|
-
|
|
105
|
-
**Does NOT replace:** Firebase Auth, Firestore Rules, Rate Limiting
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
**Files to configure:**
|
|
110
|
-
- `.env` or `.env.local` - Add reCAPTCHA key
|
|
111
|
-
- `functions/.env` - Optional enforcement
|