create-huenei-template 0.2.14 → 0.2.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/dist/config/templates.js +7 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
- package/dist/templates/frontend/react-ssr/.dockerignore +14 -0
- package/dist/templates/frontend/react-ssr/.env.example +9 -0
- package/dist/templates/frontend/react-ssr/.husky/pre-commit +1 -0
- package/dist/templates/frontend/react-ssr/Dockerfile +41 -0
- package/dist/templates/frontend/react-ssr/README.md +121 -0
- package/dist/templates/frontend/react-ssr/components.json +22 -0
- package/dist/templates/frontend/react-ssr/docker-compose.yml +21 -0
- package/dist/templates/frontend/react-ssr/eslint.config.mjs +26 -0
- package/dist/templates/frontend/react-ssr/next.config.ts +7 -0
- package/dist/templates/frontend/react-ssr/package.json +86 -0
- package/dist/templates/frontend/react-ssr/postcss.config.mjs +5 -0
- package/dist/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
- package/dist/templates/frontend/react-ssr/prisma/seed.ts +109 -0
- package/dist/templates/frontend/react-ssr/prisma.config.ts +17 -0
- package/dist/templates/frontend/react-ssr/skills-lock.json +65 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
- package/dist/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
- package/dist/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
- package/dist/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
- package/dist/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
- package/dist/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
- package/dist/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
- package/dist/templates/frontend/react-ssr/src/app/globals.css +99 -0
- package/dist/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
- package/dist/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
- package/dist/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
- package/dist/templates/frontend/react-ssr/src/app/page.tsx +331 -0
- package/dist/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
- package/dist/templates/frontend/react-ssr/src/auth.ts +64 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
- package/dist/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
- package/dist/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
- package/dist/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
- package/dist/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
- package/dist/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
- package/dist/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
- package/dist/templates/frontend/react-ssr/src/proxy.ts +31 -0
- package/dist/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
- package/dist/templates/frontend/react-ssr/src/test/setup.ts +1 -0
- package/dist/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
- package/dist/templates/frontend/react-ssr/src/types/index.ts +36 -0
- package/dist/templates/frontend/react-ssr/tsconfig.json +41 -0
- package/dist/templates/frontend/react-ssr/vitest.config.ts +41 -0
- package/package.json +1 -1
- package/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
- package/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
- package/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
- package/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
- package/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
- package/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
- package/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
- package/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
- package/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
- package/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
- package/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
- package/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
- package/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
- package/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
- package/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
- package/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
- package/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
- package/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
- package/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
- package/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
- package/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
- package/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
- package/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
- package/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
- package/templates/frontend/react-ssr/.dockerignore +14 -0
- package/templates/frontend/react-ssr/.env.example +9 -0
- package/templates/frontend/react-ssr/.husky/pre-commit +1 -0
- package/templates/frontend/react-ssr/Dockerfile +41 -0
- package/templates/frontend/react-ssr/README.md +121 -0
- package/templates/frontend/react-ssr/components.json +22 -0
- package/templates/frontend/react-ssr/docker-compose.yml +21 -0
- package/templates/frontend/react-ssr/eslint.config.mjs +26 -0
- package/templates/frontend/react-ssr/next.config.ts +7 -0
- package/templates/frontend/react-ssr/package.json +86 -0
- package/templates/frontend/react-ssr/postcss.config.mjs +5 -0
- package/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
- package/templates/frontend/react-ssr/prisma/seed.ts +109 -0
- package/templates/frontend/react-ssr/prisma.config.ts +17 -0
- package/templates/frontend/react-ssr/skills-lock.json +65 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
- package/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
- package/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
- package/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
- package/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
- package/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
- package/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
- package/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
- package/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
- package/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
- package/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
- package/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
- package/templates/frontend/react-ssr/src/app/globals.css +99 -0
- package/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
- package/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
- package/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
- package/templates/frontend/react-ssr/src/app/page.tsx +331 -0
- package/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
- package/templates/frontend/react-ssr/src/auth.ts +64 -0
- package/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
- package/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
- package/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
- package/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
- package/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
- package/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
- package/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
- package/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
- package/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
- package/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
- package/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
- package/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
- package/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
- package/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
- package/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
- package/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
- package/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
- package/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
- package/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
- package/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
- package/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
- package/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
- package/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
- package/templates/frontend/react-ssr/src/proxy.ts +31 -0
- package/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
- package/templates/frontend/react-ssr/src/test/setup.ts +1 -0
- package/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
- package/templates/frontend/react-ssr/src/types/index.ts +36 -0
- package/templates/frontend/react-ssr/tsconfig.json +41 -0
- package/templates/frontend/react-ssr/vitest.config.ts +41 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync } from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
interface AfterFileEditInput {
|
|
5
|
+
file_path: string;
|
|
6
|
+
workspace_roots: string[];
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function readStdin(): Promise<string> {
|
|
11
|
+
return new Promise((resolve) => {
|
|
12
|
+
let data = "";
|
|
13
|
+
process.stdin.setEncoding("utf8");
|
|
14
|
+
process.stdin.on("data", (chunk: string) => {
|
|
15
|
+
data += chunk;
|
|
16
|
+
});
|
|
17
|
+
process.stdin.on("end", () => resolve(data));
|
|
18
|
+
process.stdin.on("error", () => resolve(""));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const SKIP_PATTERNS = [
|
|
23
|
+
"__tests__",
|
|
24
|
+
".test.",
|
|
25
|
+
".spec.",
|
|
26
|
+
"test/",
|
|
27
|
+
"node_modules",
|
|
28
|
+
".next",
|
|
29
|
+
".cursor",
|
|
30
|
+
"globals.css",
|
|
31
|
+
"layout.tsx",
|
|
32
|
+
"providers.tsx",
|
|
33
|
+
"setup.ts",
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
type FileType = "component" | "hook" | "util" | "action" | null;
|
|
37
|
+
|
|
38
|
+
function detectFileType(relativePath: string): FileType {
|
|
39
|
+
if (relativePath.startsWith("src/components/")) return "component";
|
|
40
|
+
if (relativePath.startsWith("src/hooks/")) return "hook";
|
|
41
|
+
if (relativePath.startsWith("src/lib/")) return "util";
|
|
42
|
+
if (relativePath.startsWith("src/actions/")) return "action";
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function generateScaffold(
|
|
47
|
+
fileType: FileType,
|
|
48
|
+
relativePath: string,
|
|
49
|
+
fileName: string,
|
|
50
|
+
): string {
|
|
51
|
+
const moduleName = fileName.replace(/\.(tsx?|jsx?)$/, "");
|
|
52
|
+
const importPath = `@/${relativePath.replace(/^src\//, "").replace(/\.(tsx?|jsx?)$/, "")}`;
|
|
53
|
+
|
|
54
|
+
switch (fileType) {
|
|
55
|
+
case "component":
|
|
56
|
+
return [
|
|
57
|
+
`import { describe, it, expect } from "vitest";`,
|
|
58
|
+
`import { render, screen } from "@testing-library/react";`,
|
|
59
|
+
`// import { ${toPascalCase(moduleName)} } from "${importPath}";`,
|
|
60
|
+
"",
|
|
61
|
+
`describe("${toPascalCase(moduleName)}", () => {`,
|
|
62
|
+
` it.todo("renders correctly");`,
|
|
63
|
+
"});",
|
|
64
|
+
"",
|
|
65
|
+
].join("\n");
|
|
66
|
+
|
|
67
|
+
case "hook":
|
|
68
|
+
return [
|
|
69
|
+
`import { describe, it, expect } from "vitest";`,
|
|
70
|
+
`import { renderHook } from "@testing-library/react";`,
|
|
71
|
+
`// import { ${toCamelCase(moduleName)} } from "${importPath}";`,
|
|
72
|
+
"",
|
|
73
|
+
`describe("${toCamelCase(moduleName)}", () => {`,
|
|
74
|
+
` it.todo("returns expected value");`,
|
|
75
|
+
"});",
|
|
76
|
+
"",
|
|
77
|
+
].join("\n");
|
|
78
|
+
|
|
79
|
+
case "action":
|
|
80
|
+
return [
|
|
81
|
+
`import { describe, it, expect, vi } from "vitest";`,
|
|
82
|
+
`// import { ... } from "${importPath}";`,
|
|
83
|
+
"",
|
|
84
|
+
`vi.mock("@/lib/prisma", () => ({`,
|
|
85
|
+
` prisma: { /* mock Prisma methods */ },`,
|
|
86
|
+
`}));`,
|
|
87
|
+
`vi.mock("@/auth", () => ({`,
|
|
88
|
+
` auth: vi.fn(() => ({ user: { id: "test-user-id" } })),`,
|
|
89
|
+
`}));`,
|
|
90
|
+
"",
|
|
91
|
+
`describe("${moduleName} actions", () => {`,
|
|
92
|
+
` it.todo("performs action correctly");`,
|
|
93
|
+
"});",
|
|
94
|
+
"",
|
|
95
|
+
].join("\n");
|
|
96
|
+
|
|
97
|
+
case "util":
|
|
98
|
+
default:
|
|
99
|
+
return [
|
|
100
|
+
`import { describe, it, expect } from "vitest";`,
|
|
101
|
+
`// import { ... } from "${importPath}";`,
|
|
102
|
+
"",
|
|
103
|
+
`describe("${moduleName}", () => {`,
|
|
104
|
+
` it.todo("works as expected");`,
|
|
105
|
+
"});",
|
|
106
|
+
"",
|
|
107
|
+
].join("\n");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function toPascalCase(str: string): string {
|
|
112
|
+
return str
|
|
113
|
+
.split(/[-_]/)
|
|
114
|
+
.map((s) => s.charAt(0).toUpperCase() + s.slice(1))
|
|
115
|
+
.join("");
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function toCamelCase(str: string): string {
|
|
119
|
+
const pascal = toPascalCase(str);
|
|
120
|
+
return pascal.charAt(0).toLowerCase() + pascal.slice(1);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface PendingTest {
|
|
124
|
+
source: string;
|
|
125
|
+
testPath: string;
|
|
126
|
+
type: FileType;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async function main(): Promise<void> {
|
|
130
|
+
try {
|
|
131
|
+
const raw = await readStdin();
|
|
132
|
+
if (!raw?.trim()) return;
|
|
133
|
+
|
|
134
|
+
const payload = JSON.parse(
|
|
135
|
+
raw.replace(/^\uFEFF/, "").trim(),
|
|
136
|
+
) as AfterFileEditInput;
|
|
137
|
+
const filePath = payload.file_path;
|
|
138
|
+
const workspaceRoot =
|
|
139
|
+
payload.workspace_roots?.[0] ||
|
|
140
|
+
process.env.CURSOR_PROJECT_DIR ||
|
|
141
|
+
process.cwd();
|
|
142
|
+
|
|
143
|
+
if (!filePath) return;
|
|
144
|
+
|
|
145
|
+
const normalizedPath = filePath.replace(/\\/g, "/");
|
|
146
|
+
const normalizedRoot = workspaceRoot.replace(/\\/g, "/");
|
|
147
|
+
|
|
148
|
+
if (SKIP_PATTERNS.some((p) => normalizedPath.includes(p))) return;
|
|
149
|
+
if (!/\.(tsx?|jsx?)$/.test(normalizedPath)) return;
|
|
150
|
+
|
|
151
|
+
const relativePath = normalizedPath.startsWith(normalizedRoot)
|
|
152
|
+
? normalizedPath.slice(normalizedRoot.length + 1)
|
|
153
|
+
: normalizedPath;
|
|
154
|
+
|
|
155
|
+
if (!relativePath.startsWith("src/")) return;
|
|
156
|
+
|
|
157
|
+
const fileType = detectFileType(relativePath);
|
|
158
|
+
if (!fileType) return;
|
|
159
|
+
|
|
160
|
+
const fileName = path.basename(relativePath);
|
|
161
|
+
if (fileName.startsWith("index.")) return;
|
|
162
|
+
|
|
163
|
+
const category =
|
|
164
|
+
fileType === "component"
|
|
165
|
+
? "components"
|
|
166
|
+
: fileType === "hook"
|
|
167
|
+
? "hooks"
|
|
168
|
+
: fileType === "action"
|
|
169
|
+
? "actions"
|
|
170
|
+
: "lib";
|
|
171
|
+
const testExt = fileType === "component" ? ".test.tsx" : ".test.ts";
|
|
172
|
+
const testFileName = fileName.replace(/\.(tsx?|jsx?)$/, testExt);
|
|
173
|
+
const testRelativePath = `src/__tests__/${category}/${testFileName}`;
|
|
174
|
+
const testAbsolutePath = path.join(workspaceRoot, testRelativePath);
|
|
175
|
+
|
|
176
|
+
if (existsSync(testAbsolutePath)) return;
|
|
177
|
+
|
|
178
|
+
const testDir = path.dirname(testAbsolutePath);
|
|
179
|
+
mkdirSync(testDir, { recursive: true });
|
|
180
|
+
|
|
181
|
+
const scaffold = generateScaffold(fileType, relativePath, fileName);
|
|
182
|
+
writeFileSync(testAbsolutePath, scaffold, "utf8");
|
|
183
|
+
|
|
184
|
+
console.error(`[ensure-tests-exist] Created scaffold: ${testRelativePath}`);
|
|
185
|
+
|
|
186
|
+
const pendingPath = path.join(workspaceRoot, ".pending-tests.json");
|
|
187
|
+
let pending: PendingTest[] = [];
|
|
188
|
+
if (existsSync(pendingPath)) {
|
|
189
|
+
try {
|
|
190
|
+
pending = JSON.parse(readFileSync(pendingPath, "utf8"));
|
|
191
|
+
} catch {
|
|
192
|
+
pending = [];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
pending.push({
|
|
196
|
+
source: relativePath,
|
|
197
|
+
testPath: testRelativePath,
|
|
198
|
+
type: fileType,
|
|
199
|
+
});
|
|
200
|
+
writeFileSync(pendingPath, JSON.stringify(pending, null, 2), "utf8");
|
|
201
|
+
} catch (err) {
|
|
202
|
+
console.error(
|
|
203
|
+
"[ensure-tests-exist] Error:",
|
|
204
|
+
err instanceof Error ? err.message : String(err),
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
main();
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
|
|
3
|
+
interface BeforeReadFileInput {
|
|
4
|
+
file_path: string;
|
|
5
|
+
content: string;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function readStdin(): Promise<string> {
|
|
10
|
+
return new Promise((resolve) => {
|
|
11
|
+
let data = "";
|
|
12
|
+
process.stdin.setEncoding("utf8");
|
|
13
|
+
process.stdin.on("data", (chunk: string) => {
|
|
14
|
+
data += chunk;
|
|
15
|
+
});
|
|
16
|
+
process.stdin.on("end", () => resolve(data));
|
|
17
|
+
process.stdin.on("error", () => resolve(""));
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function respond(output: Record<string, unknown>): void {
|
|
22
|
+
process.stdout.write(JSON.stringify(output) + "\n");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const PROTECTED_FILES = [
|
|
26
|
+
".env",
|
|
27
|
+
".env.local",
|
|
28
|
+
".env.production",
|
|
29
|
+
".env.development",
|
|
30
|
+
".env.staging",
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const PROTECTED_EXTENSIONS = [".pem", ".key", ".pfx", ".p12"];
|
|
34
|
+
|
|
35
|
+
const ALLOWED_FILES = [".env.example", ".env.template"];
|
|
36
|
+
|
|
37
|
+
async function main(): Promise<void> {
|
|
38
|
+
try {
|
|
39
|
+
const raw = await readStdin();
|
|
40
|
+
if (!raw?.trim()) {
|
|
41
|
+
respond({ permission: "allow" });
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const payload = JSON.parse(
|
|
46
|
+
raw.replace(/^\uFEFF/, "").trim(),
|
|
47
|
+
) as BeforeReadFileInput;
|
|
48
|
+
const filePath = payload.file_path;
|
|
49
|
+
|
|
50
|
+
if (!filePath) {
|
|
51
|
+
respond({ permission: "allow" });
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const basename = path.basename(filePath);
|
|
56
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
57
|
+
|
|
58
|
+
if (ALLOWED_FILES.includes(basename)) {
|
|
59
|
+
respond({ permission: "allow" });
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (PROTECTED_FILES.includes(basename)) {
|
|
64
|
+
respond({
|
|
65
|
+
permission: "deny",
|
|
66
|
+
user_message: `Access to ${basename} blocked. This file may contain secrets. Use .env.example as reference.`,
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (PROTECTED_EXTENSIONS.includes(ext)) {
|
|
72
|
+
respond({
|
|
73
|
+
permission: "deny",
|
|
74
|
+
user_message: `Access to ${basename} blocked. Certificate/key files should not be read by the agent.`,
|
|
75
|
+
});
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (
|
|
80
|
+
basename === "credentials.json" ||
|
|
81
|
+
basename === "secrets.yaml" ||
|
|
82
|
+
basename === "secrets.json"
|
|
83
|
+
) {
|
|
84
|
+
respond({
|
|
85
|
+
permission: "deny",
|
|
86
|
+
user_message: `Access to ${basename} blocked. This file may contain credentials.`,
|
|
87
|
+
});
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
respond({ permission: "allow" });
|
|
92
|
+
} catch (err) {
|
|
93
|
+
console.error(
|
|
94
|
+
"[protect-sensitive-files] Error:",
|
|
95
|
+
err instanceof Error ? err.message : String(err),
|
|
96
|
+
);
|
|
97
|
+
respond({ permission: "allow" });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
main();
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
|
|
3
|
+
interface SessionStartInput {
|
|
4
|
+
session_id: string;
|
|
5
|
+
is_background_agent: boolean;
|
|
6
|
+
composer_mode: string;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function readStdin(): Promise<string> {
|
|
11
|
+
return new Promise((resolve) => {
|
|
12
|
+
let data = "";
|
|
13
|
+
process.stdin.setEncoding("utf8");
|
|
14
|
+
process.stdin.on("data", (chunk: string) => {
|
|
15
|
+
data += chunk;
|
|
16
|
+
});
|
|
17
|
+
process.stdin.on("end", () => resolve(data));
|
|
18
|
+
process.stdin.on("error", () => resolve(""));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function respond(output: Record<string, unknown>): void {
|
|
23
|
+
process.stdout.write(JSON.stringify(output) + "\n");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function run(cmd: string): string {
|
|
27
|
+
try {
|
|
28
|
+
return execSync(cmd, { encoding: "utf8", timeout: 5000 }).trim();
|
|
29
|
+
} catch {
|
|
30
|
+
return "unknown";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function main(): Promise<void> {
|
|
35
|
+
try {
|
|
36
|
+
const raw = await readStdin();
|
|
37
|
+
if (!raw?.trim()) {
|
|
38
|
+
respond({});
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
JSON.parse(raw.replace(/^\uFEFF/, "").trim()) as SessionStartInput;
|
|
42
|
+
|
|
43
|
+
const gitBranch = run("git rev-parse --abbrev-ref HEAD");
|
|
44
|
+
const nodeVersion = run("node --version");
|
|
45
|
+
const pnpmVersion = run("pnpm --version");
|
|
46
|
+
const lastCommit = run('git log -1 --format="%h %s"');
|
|
47
|
+
|
|
48
|
+
const context = [
|
|
49
|
+
"## Project Context — react-ssr (Next.js 16 Template)",
|
|
50
|
+
"",
|
|
51
|
+
`- Branch: ${gitBranch}`,
|
|
52
|
+
`- Node: ${nodeVersion} | pnpm: ${pnpmVersion}`,
|
|
53
|
+
`- Last commit: ${lastCommit}`,
|
|
54
|
+
"",
|
|
55
|
+
"### Stack",
|
|
56
|
+
"Next.js 16 (App Router, standalone), React 19, TypeScript 5.9, Prisma 7 (MariaDB adapter → MySQL 8.4),",
|
|
57
|
+
"Auth.js v5 (Credentials + JWT), Tailwind v4 + DaisyUI v5 + shadcn/ui (new-york), TanStack Query v5,",
|
|
58
|
+
"Vitest 4 + Testing Library, ESLint 9 + Prettier, Husky + lint-staged, Docker multi-stage.",
|
|
59
|
+
"",
|
|
60
|
+
"### Key Commands",
|
|
61
|
+
"- `pnpm dev` — Start dev server (Turbopack)",
|
|
62
|
+
"- `pnpm build` — Production build",
|
|
63
|
+
"- `pnpm test` — Run Vitest in watch mode",
|
|
64
|
+
"- `pnpm test:coverage` — Coverage report",
|
|
65
|
+
"- `pnpm db:migrate` — Prisma migrations",
|
|
66
|
+
"- `pnpm db:seed` — Seed database",
|
|
67
|
+
"- `pnpm db:studio` — Open Prisma Studio",
|
|
68
|
+
"",
|
|
69
|
+
"### Conventions",
|
|
70
|
+
"- Server Components by default, Client Components use `*-client.tsx` suffix",
|
|
71
|
+
"- Server Actions in `src/actions/` with Zod validation",
|
|
72
|
+
"- `proxy.ts` (NOT middleware.ts) for route protection — Next.js 16 convention",
|
|
73
|
+
"- Path alias: `@/*` → `./src/*`",
|
|
74
|
+
"- UI text in Spanish (Argentine voseo), code identifiers in English/Spanish mix",
|
|
75
|
+
].join("\n");
|
|
76
|
+
|
|
77
|
+
respond({
|
|
78
|
+
env: {
|
|
79
|
+
GIT_BRANCH: gitBranch,
|
|
80
|
+
NODE_VERSION: nodeVersion,
|
|
81
|
+
},
|
|
82
|
+
additional_context: context,
|
|
83
|
+
continue: true,
|
|
84
|
+
});
|
|
85
|
+
} catch (err) {
|
|
86
|
+
console.error(
|
|
87
|
+
"[session-context] Error:",
|
|
88
|
+
err instanceof Error ? err.message : String(err),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
main();
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"hooks": {
|
|
4
|
+
"sessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"command": "npx tsx .cursor/hooks/session-context.ts",
|
|
7
|
+
"timeout": 15
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"afterFileEdit": [
|
|
11
|
+
{
|
|
12
|
+
"command": "npx tsx .cursor/hooks/auto-format.ts",
|
|
13
|
+
"timeout": 15
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"command": "npx tsx .cursor/hooks/ensure-tests-exist.ts",
|
|
17
|
+
"timeout": 15
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"beforeReadFile": [
|
|
21
|
+
{
|
|
22
|
+
"command": "npx tsx .cursor/hooks/protect-sensitive-files.ts",
|
|
23
|
+
"timeout": 10
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"beforeShellExecution": [
|
|
27
|
+
{
|
|
28
|
+
"command": "npx tsx .cursor/hooks/block-dangerous-commands.ts",
|
|
29
|
+
"matcher": "rm|del|rmdir|drop|truncate|format|mkfs|Remove-Item|git|prisma",
|
|
30
|
+
"timeout": 10
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"stop": [
|
|
34
|
+
{
|
|
35
|
+
"command": "npx tsx .cursor/hooks/auto-test-on-stop.ts",
|
|
36
|
+
"timeout": 10,
|
|
37
|
+
"loop_limit": 2
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Patrones de autenticación con Auth.js v5, proxy.ts y protección de rutas en Next.js 16
|
|
3
|
+
globs: src/auth.ts,src/proxy.ts,src/actions/auth.ts
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Autenticación — Auth.js v5
|
|
8
|
+
|
|
9
|
+
## Configuración (`src/auth.ts`)
|
|
10
|
+
|
|
11
|
+
- **Auth.js v5** (next-auth beta.25) con Credentials provider
|
|
12
|
+
- **Estrategia de sesión**: JWT (no database sessions)
|
|
13
|
+
- **Adapter**: PrismaAdapter para sincronizar modelos User/Account/Session
|
|
14
|
+
- **Hashing**: bcryptjs con `bcrypt.hash(password, 12)` para registro
|
|
15
|
+
- **Página login custom**: `/auth/iniciar-sesion`
|
|
16
|
+
|
|
17
|
+
## Proxy de rutas (`src/proxy.ts`)
|
|
18
|
+
|
|
19
|
+
En Next.js 16, `middleware.ts` fue renombrado a `proxy.ts`. Exportar función `proxy`:
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { auth } from "@/auth";
|
|
23
|
+
export const proxy = auth((req) => {
|
|
24
|
+
// Lógica de protección de rutas
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- **Rutas protegidas**: `/dashboard`, `/perfil`, `/proyectos-crud`, `/ui-components`
|
|
29
|
+
- **Redirect no autenticado** → `/auth/iniciar-sesion?callbackUrl=<ruta>`
|
|
30
|
+
- **Redirect autenticado** en `/auth/*` → `/dashboard`
|
|
31
|
+
|
|
32
|
+
## Patrones en Server Actions
|
|
33
|
+
|
|
34
|
+
Siempre verificar autenticación antes de operar:
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
const session = await auth();
|
|
38
|
+
if (!session?.user?.id) {
|
|
39
|
+
return { error: "No autenticado" };
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Exports de `src/auth.ts`
|
|
44
|
+
|
|
45
|
+
- `handlers` — Route handlers para `/api/auth/*`
|
|
46
|
+
- `auth` — Función para obtener sesión (server-side)
|
|
47
|
+
- `signIn` — Programatic sign in
|
|
48
|
+
- `signOut` — Programatic sign out
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: ESLint 9 flat config, Prettier, Husky pre-commit y estándares de calidad de código
|
|
3
|
+
globs: "eslint.config.mjs,**/*.ts,**/*.tsx"
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Calidad de código
|
|
8
|
+
|
|
9
|
+
## ESLint 9 (Flat Config)
|
|
10
|
+
|
|
11
|
+
Configurado en `eslint.config.mjs`:
|
|
12
|
+
- `@eslint/js` recommended
|
|
13
|
+
- `typescript-eslint` recommended
|
|
14
|
+
- `eslint-config-next`
|
|
15
|
+
- `eslint-config-prettier` (desactiva reglas que conflictúan con Prettier)
|
|
16
|
+
|
|
17
|
+
Reglas clave:
|
|
18
|
+
- `@typescript-eslint/no-unused-vars`: warn (ignora args con `_` prefix)
|
|
19
|
+
- `@typescript-eslint/no-explicit-any`: error — **NO usar `any`**
|
|
20
|
+
|
|
21
|
+
## Prettier
|
|
22
|
+
|
|
23
|
+
- Prettier 3.5 como formatter
|
|
24
|
+
- Sin archivo `.prettierrc` — usa defaults de Prettier
|
|
25
|
+
- Se ejecuta automáticamente via lint-staged en pre-commit
|
|
26
|
+
|
|
27
|
+
## Husky + lint-staged
|
|
28
|
+
|
|
29
|
+
Pre-commit (`husky`):
|
|
30
|
+
- `*.{ts,tsx}` → `eslint --fix` + `prettier --write`
|
|
31
|
+
- `*.{json,css,md}` → `prettier --write`
|
|
32
|
+
|
|
33
|
+
## TypeScript
|
|
34
|
+
|
|
35
|
+
- **Strict mode** habilitado
|
|
36
|
+
- **Path alias**: `@/*` → `./src/*`
|
|
37
|
+
- **Module resolution**: `bundler`
|
|
38
|
+
- **JSX**: `react-jsx` (no necesita import React)
|
|
39
|
+
- **No explicit any**: Siempre tipar correctamente
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Convenciones de nombrado del template — idioma, casing y patrones
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Convenciones de nombrado
|
|
7
|
+
|
|
8
|
+
## Idioma
|
|
9
|
+
|
|
10
|
+
- **Rutas URL**: Español kebab-case (`/auth/iniciar-sesion`, `/proyectos-crud`, `/recuperar-password`)
|
|
11
|
+
- **Labels UI / textos**: Español argentino con voseo ("Ingresá", "Registrate", "Completá tu perfil")
|
|
12
|
+
- **Código TypeScript**: Inglés para infraestructura, español para dominio de negocio
|
|
13
|
+
|
|
14
|
+
## Casing por tipo
|
|
15
|
+
|
|
16
|
+
| Elemento | Convención | Ejemplo |
|
|
17
|
+
|----------|-----------|---------|
|
|
18
|
+
| Archivos `.tsx` / `.ts` | kebab-case | `sign-out-button.tsx`, `proyectos-crud-client.tsx` |
|
|
19
|
+
| Componentes React | PascalCase | `SignOutButton`, `DashboardClient` |
|
|
20
|
+
| Server Actions | camelCase + verbo español | `crearProyecto`, `editarProyecto`, `enviarContacto` |
|
|
21
|
+
| Schemas Zod | camelCase | `loginSchema`, `proyectoSchema`, `contactoSchema` |
|
|
22
|
+
| Modelos Prisma | PascalCase singular | `User`, `Proyecto`, `Account` |
|
|
23
|
+
| Campos DB | camelCase | `userId`, `createdAt`, `emailVerified` |
|
|
24
|
+
| Custom hooks | camelCase con `use` | `useLocalStorage` |
|
|
25
|
+
| Constantes | camelCase o UPPER_SNAKE_CASE | `protectedRoutes`, `SALT_ROUNDS` |
|
|
26
|
+
| Tipos/Interfaces | PascalCase | `ProyectoFormState`, `LoginFormState` |
|
|
27
|
+
|
|
28
|
+
## Carpetas
|
|
29
|
+
|
|
30
|
+
- `src/app/`: Rutas en español kebab-case (ej: `auth/iniciar-sesion/`)
|
|
31
|
+
- `src/components/ui/`: Componentes shadcn en inglés kebab-case (ej: `button.tsx`)
|
|
32
|
+
- `src/actions/`: Archivos en español kebab-case por dominio (ej: `proyectos.ts`, `contacto.ts`)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Arquitectura Next.js 16 App Router con Server Components, Server Actions, proxy.ts y standalone output
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Arquitectura Next.js 16
|
|
7
|
+
|
|
8
|
+
## Stack
|
|
9
|
+
|
|
10
|
+
- **Next.js 16** con App Router (`src/app/`)
|
|
11
|
+
- **React 19** con Server Components por defecto
|
|
12
|
+
- **TypeScript 5.9** en strict mode
|
|
13
|
+
- **Turbopack** en desarrollo (`next dev --turbopack`)
|
|
14
|
+
- **Output standalone** para Docker (`next.config.ts`)
|
|
15
|
+
|
|
16
|
+
## Estructura de carpetas
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
src/
|
|
20
|
+
├── app/ # Pages, layouts, route groups (App Router)
|
|
21
|
+
│ ├── (authenticated)/ # Route group — rutas que requieren auth
|
|
22
|
+
│ ├── auth/ # Rutas públicas de autenticación
|
|
23
|
+
│ ├── layout.tsx # Root layout (Server Component)
|
|
24
|
+
│ ├── page.tsx # Home page
|
|
25
|
+
│ └── globals.css # Estilos globales + Tailwind + DaisyUI theme
|
|
26
|
+
├── actions/ # Server Actions (mutaciones con "use server")
|
|
27
|
+
├── components/ # Componentes React reutilizables
|
|
28
|
+
│ ├── ui/ # Componentes shadcn/ui
|
|
29
|
+
│ └── layout/ # Componentes de layout (sidebar, navbar)
|
|
30
|
+
├── lib/ # Utilidades y configuración (prisma, queryClient, utils)
|
|
31
|
+
├── hooks/ # Custom hooks
|
|
32
|
+
├── types/ # Definiciones de tipos compartidos
|
|
33
|
+
├── data/ # Datos estáticos / constantes
|
|
34
|
+
├── auth.ts # Configuración Auth.js (NextAuth v5)
|
|
35
|
+
└── proxy.ts # Proxy de rutas (reemplazo de middleware.ts en Next.js 16)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Server Components vs Client Components
|
|
39
|
+
|
|
40
|
+
- Los archivos en `src/app/**/page.tsx` son **Server Components** por defecto
|
|
41
|
+
- Los Client Components llevan `"use client"` y se nombran `*-client.tsx`
|
|
42
|
+
- Los Server Actions llevan `"use server"` y viven en `src/actions/`
|
|
43
|
+
- **NO usar** `middleware.ts` — en Next.js 16 se usa `proxy.ts` con export `proxy`
|
|
44
|
+
|
|
45
|
+
## Patrones clave
|
|
46
|
+
|
|
47
|
+
- **Data fetching**: Los Server Components obtienen datos directamente con Prisma (no API routes)
|
|
48
|
+
- **Mutaciones**: Via Server Actions en `src/actions/` con validación Zod
|
|
49
|
+
- **Revalidación**: Usar `revalidatePath()` después de mutaciones
|
|
50
|
+
- **Providers**: `src/components/providers.tsx` envuelve con SessionProvider + QueryClientProvider + ToastContainer
|
|
51
|
+
- **Path alias**: `@/*` → `./src/*` (configurado en tsconfig.json)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Convenciones de Prisma 7 con adapter MariaDB, modelos, migraciones y acceso a datos
|
|
3
|
+
globs: prisma/**,src/lib/prisma.ts
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Prisma 7 — Convenciones
|
|
8
|
+
|
|
9
|
+
## Configuración
|
|
10
|
+
|
|
11
|
+
- **Provider**: `mysql` en `prisma/schema.prisma`
|
|
12
|
+
- **Adapter**: `@prisma/adapter-mariadb` (protocolo MariaDB sobre MySQL 8.4)
|
|
13
|
+
- **Singleton**: `src/lib/prisma.ts` implementa patrón singleton con global cache en dev
|
|
14
|
+
- **DB**: MySQL 8.4 vía Docker Compose (`docker-compose.yml`)
|
|
15
|
+
|
|
16
|
+
## Modelos
|
|
17
|
+
|
|
18
|
+
- **Nombres**: PascalCase singular (`User`, `Proyecto`, `Account`)
|
|
19
|
+
- **Campos**: camelCase (`userId`, `createdAt`, `emailVerified`)
|
|
20
|
+
- **IDs**: `String @id @default(cuid())`
|
|
21
|
+
- **Timestamps**: `createdAt DateTime @default(now())` + `updatedAt DateTime @updatedAt`
|
|
22
|
+
- **Relaciones**: Siempre con `onDelete: Cascade` cuando corresponda
|
|
23
|
+
- **Índices**: `@@index([campo])` para campos de búsqueda frecuente (ej: `userId`)
|
|
24
|
+
|
|
25
|
+
```prisma
|
|
26
|
+
model NuevoModelo {
|
|
27
|
+
id String @id @default(cuid())
|
|
28
|
+
nombre String
|
|
29
|
+
userId String
|
|
30
|
+
createdAt DateTime @default(now())
|
|
31
|
+
updatedAt DateTime @updatedAt
|
|
32
|
+
|
|
33
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
34
|
+
|
|
35
|
+
@@index([userId])
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Comandos
|
|
40
|
+
|
|
41
|
+
| Comando | Uso |
|
|
42
|
+
|---------|-----|
|
|
43
|
+
| `pnpm db:generate` | Regenerar Prisma Client |
|
|
44
|
+
| `pnpm db:migrate` | Crear y aplicar migraciones |
|
|
45
|
+
| `pnpm db:push` | Push schema sin migración (dev rápido) |
|
|
46
|
+
| `pnpm db:seed` | Ejecutar seed (`prisma/seed.ts`) |
|
|
47
|
+
| `pnpm db:studio` | Abrir Prisma Studio (GUI) |
|
|
48
|
+
|
|
49
|
+
## Acceso a datos
|
|
50
|
+
|
|
51
|
+
- En **Server Components**: Usar `prisma` directamente (import desde `@/lib/prisma`)
|
|
52
|
+
- En **Server Actions**: Usar `prisma` con validación de sesión (`auth()`)
|
|
53
|
+
- **NUNCA** exponer Prisma Client al cliente
|