create-huenei-template 0.2.18 → 0.3.1
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/templates/frontend/hub-pre-sales/.cursor/context/pre-sales.md +3 -2
- package/dist/templates/frontend/hub-pre-sales/.cursor/rules/architech.mdc +13 -1
- package/dist/templates/frontend/hub-pre-sales/.cursor/rules/component-patterns.mdc +1 -1
- package/dist/templates/frontend/hub-pre-sales/.cursor/rules/gsap-animations.mdc +46 -0
- package/dist/templates/frontend/hub-pre-sales/.cursor/rules/pre-sales-mode.mdc +2 -1
- package/dist/templates/frontend/hub-pre-sales/.cursor/rules/restrictions.mdc +3 -1
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/animate/SKILL.md +23 -10
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/delight/SKILL.md +3 -4
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/gsap-core/SKILL.md +254 -0
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/gsap-frameworks/SKILL.md +266 -0
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/gsap-performance/SKILL.md +79 -0
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/gsap-plugins/SKILL.md +433 -0
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/gsap-react/SKILL.md +136 -0
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/gsap-scrolltrigger/SKILL.md +296 -0
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/gsap-timeline/SKILL.md +107 -0
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/gsap-utils/SKILL.md +284 -0
- package/dist/templates/frontend/hub-pre-sales/.cursor/skills/overdrive/SKILL.md +1 -1
- package/dist/templates/frontend/hub-pre-sales/AGENTS.md +13 -3
- package/dist/templates/frontend/hub-pre-sales/README.md +2 -1
- package/dist/templates/frontend/hub-pre-sales/package.json +84 -82
- package/dist/templates/frontend/hub-pre-sales/src/lib/gsap.ts +6 -0
- package/dist/templates/frontend/pre-sales/.cursor/rules/architech.mdc +199 -199
- package/dist/templates/frontend/pre-sales/.cursor/rules/deployment-ready.mdc +52 -52
- package/dist/templates/frontend/pre-sales/.cursor/rules/domain-business-bootstrap.mdc +74 -74
- package/dist/templates/frontend/pre-sales/.cursor/rules/pre-sales-mode.mdc +104 -104
- package/dist/templates/frontend/pre-sales/.cursor/rules/separation-of-concerns.mdc +41 -41
- package/dist/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/SKILL.md +296 -296
- package/dist/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/resources/deploy-codex.sh +301 -301
- package/dist/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/resources/deploy.sh +301 -301
- package/dist/templates/frontend/pre-sales/src/__tests__/components/layout/sidebar.test.tsx +58 -58
- package/dist/templates/frontend/pre-sales/src/__tests__/lib/auth.test.ts +102 -102
- package/dist/templates/frontend/pre-sales/src/__tests__/routes/__root.test.tsx +72 -72
- package/dist/templates/frontend/pre-sales/src/__tests__/routes/_authenticated.test.tsx +57 -57
- package/dist/templates/frontend/pre-sales/src/components/layout/navbar.tsx +121 -121
- package/dist/templates/frontend/pre-sales/src/components/ui/combobox.tsx +308 -308
- package/dist/templates/frontend/pre-sales/src/components/ui/command.tsx +179 -179
- package/dist/templates/frontend/pre-sales/src/data/dashboard.ts +249 -249
- package/dist/templates/frontend/pre-sales/src/hooks/useTheme.ts +73 -73
- package/dist/templates/frontend/pre-sales/src/index.css +282 -282
- package/dist/templates/frontend/pre-sales/src/routes/__root.tsx +62 -62
- package/dist/templates/frontend/pre-sales/src/routes/auth/iniciar-sesion.tsx +173 -173
- package/dist/templates/frontend/react-vite/.npmrc.example +28 -0
- package/dist/templates/frontend/react-vite/README.md +17 -0
- package/dist/templates/frontend/react-vite/eslint.config.js +41 -31
- package/dist/templates/frontend/react-vite/package.json +2 -0
- package/dist/templates/frontend/react-vite/src/index.css +3 -15
- package/dist/templates/frontend/react-vite/src/main.tsx +36 -33
- package/dist/templates/frontend/react-vite/src/routes/__root.tsx +3 -3
- package/dist/templates/frontend/react-vite/src/routes/index.tsx +185 -187
- package/dist/templates/frontend/react-vite/src/routes/ui-components.tsx +698 -922
- package/dist/templates/frontend/react-vite/vite.config.ts +7 -2
- package/dist/templates/frontend/react-vite-help/.vscode/settings.json +26 -0
- package/dist/templates/mobile/expo-base/package.json +3 -2
- package/dist/templates/mobile/expo-base/pnpm-workspace.yaml +3 -0
- package/dist/templates/mobile/expo-base/src/features/auth/login-screen.tsx +144 -177
- package/dist/templates/mobile/expo-base/src/i18n/locales/en-US.json +136 -134
- package/dist/templates/mobile/expo-base/src/i18n/locales/es-AR.json +136 -134
- package/package.json +1 -1
- package/templates/frontend/hub-pre-sales/.cursor/context/pre-sales.md +3 -2
- package/templates/frontend/hub-pre-sales/.cursor/rules/architech.mdc +13 -1
- package/templates/frontend/hub-pre-sales/.cursor/rules/component-patterns.mdc +1 -1
- package/templates/frontend/hub-pre-sales/.cursor/rules/gsap-animations.mdc +46 -0
- package/templates/frontend/hub-pre-sales/.cursor/rules/pre-sales-mode.mdc +2 -1
- package/templates/frontend/hub-pre-sales/.cursor/rules/restrictions.mdc +3 -1
- package/templates/frontend/hub-pre-sales/.cursor/skills/animate/SKILL.md +23 -10
- package/templates/frontend/hub-pre-sales/.cursor/skills/delight/SKILL.md +3 -4
- package/templates/frontend/hub-pre-sales/.cursor/skills/gsap-core/SKILL.md +254 -0
- package/templates/frontend/hub-pre-sales/.cursor/skills/gsap-frameworks/SKILL.md +266 -0
- package/templates/frontend/hub-pre-sales/.cursor/skills/gsap-performance/SKILL.md +79 -0
- package/templates/frontend/hub-pre-sales/.cursor/skills/gsap-plugins/SKILL.md +433 -0
- package/templates/frontend/hub-pre-sales/.cursor/skills/gsap-react/SKILL.md +136 -0
- package/templates/frontend/hub-pre-sales/.cursor/skills/gsap-scrolltrigger/SKILL.md +296 -0
- package/templates/frontend/hub-pre-sales/.cursor/skills/gsap-timeline/SKILL.md +107 -0
- package/templates/frontend/hub-pre-sales/.cursor/skills/gsap-utils/SKILL.md +284 -0
- package/templates/frontend/hub-pre-sales/.cursor/skills/overdrive/SKILL.md +1 -1
- package/templates/frontend/hub-pre-sales/AGENTS.md +13 -3
- package/templates/frontend/hub-pre-sales/README.md +2 -1
- package/templates/frontend/hub-pre-sales/package.json +84 -82
- package/templates/frontend/hub-pre-sales/pnpm-lock.yaml +6597 -6575
- package/templates/frontend/hub-pre-sales/skills-lock.json +53 -0
- package/templates/frontend/hub-pre-sales/src/lib/gsap.ts +6 -0
- package/templates/frontend/pre-sales/.cursor/rules/architech.mdc +199 -199
- package/templates/frontend/pre-sales/.cursor/rules/deployment-ready.mdc +52 -52
- package/templates/frontend/pre-sales/.cursor/rules/domain-business-bootstrap.mdc +74 -74
- package/templates/frontend/pre-sales/.cursor/rules/pre-sales-mode.mdc +104 -104
- package/templates/frontend/pre-sales/.cursor/rules/separation-of-concerns.mdc +41 -41
- package/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/SKILL.md +296 -296
- package/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/resources/deploy-codex.sh +301 -301
- package/templates/frontend/pre-sales/.cursor/skills/deploy-to-vercel/resources/deploy.sh +301 -301
- package/templates/frontend/pre-sales/pnpm-lock.yaml +6448 -6448
- package/templates/frontend/pre-sales/skills-lock.json +10 -10
- package/templates/frontend/pre-sales/src/__tests__/components/layout/sidebar.test.tsx +58 -58
- package/templates/frontend/pre-sales/src/__tests__/lib/auth.test.ts +102 -102
- package/templates/frontend/pre-sales/src/__tests__/routes/__root.test.tsx +72 -72
- package/templates/frontend/pre-sales/src/__tests__/routes/_authenticated.test.tsx +57 -57
- package/templates/frontend/pre-sales/src/components/layout/navbar.tsx +121 -121
- package/templates/frontend/pre-sales/src/components/ui/combobox.tsx +308 -308
- package/templates/frontend/pre-sales/src/components/ui/command.tsx +179 -179
- package/templates/frontend/pre-sales/src/data/dashboard.ts +249 -249
- package/templates/frontend/pre-sales/src/hooks/useTheme.ts +73 -73
- package/templates/frontend/pre-sales/src/index.css +282 -282
- package/templates/frontend/pre-sales/src/routes/__root.tsx +62 -62
- package/templates/frontend/pre-sales/src/routes/auth/iniciar-sesion.tsx +173 -173
- package/templates/frontend/react-vite/.npmrc.example +28 -0
- package/templates/frontend/react-vite/README.md +17 -0
- package/templates/frontend/react-vite/eslint.config.js +41 -31
- package/templates/frontend/react-vite/package.json +2 -0
- package/templates/frontend/react-vite/pnpm-lock.yaml +535 -13
- package/templates/frontend/react-vite/src/index.css +3 -15
- package/templates/frontend/react-vite/src/main.tsx +36 -33
- package/templates/frontend/react-vite/src/routes/__root.tsx +3 -3
- package/templates/frontend/react-vite/src/routes/index.tsx +185 -187
- package/templates/frontend/react-vite/src/routes/ui-components.tsx +698 -922
- package/templates/frontend/react-vite/vite.config.ts +7 -2
- package/templates/frontend/react-vite-help/.vscode/settings.json +26 -0
- package/templates/mobile/expo-base/package.json +3 -2
- package/templates/mobile/expo-base/pnpm-lock.yaml +10240 -11354
- package/templates/mobile/expo-base/pnpm-workspace.yaml +3 -0
- package/templates/mobile/expo-base/src/features/auth/login-screen.tsx +144 -177
- package/templates/mobile/expo-base/src/i18n/locales/en-US.json +136 -134
- package/templates/mobile/expo-base/src/i18n/locales/es-AR.json +136 -134
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/agents/nestjs-code-reviewer.md +0 -54
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/agents/prisma-guardian.md +0 -67
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/agents/test-runner.md +0 -57
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/commands/new-endpoint.md +0 -209
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/commands/new-model.md +0 -201
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/hooks/autoTestOnStop.ts +0 -127
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/hooks/blockDangerous.ts +0 -98
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/hooks/ensureTestsExist.ts +0 -405
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/hooks/formatOnEdit.ts +0 -70
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/hooks/protectSecrets.ts +0 -101
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/hooks/sessionInit.ts +0 -104
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/hooks/validatePrisma.ts +0 -121
- package/templates/backend/nestjs-api-mysql-prisma-express/.cursor/hooks.json +0 -46
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/agents/nestjs-code-reviewer.md +0 -54
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/agents/prisma-guardian.md +0 -67
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/agents/test-runner.md +0 -57
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/commands/new-endpoint.md +0 -209
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/commands/new-model.md +0 -201
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/hooks/autoTestOnStop.ts +0 -127
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/hooks/blockDangerous.ts +0 -98
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/hooks/ensureTestsExist.ts +0 -405
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/hooks/formatOnEdit.ts +0 -70
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/hooks/protectSecrets.ts +0 -101
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/hooks/sessionInit.ts +0 -104
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/hooks/validatePrisma.ts +0 -121
- package/templates/backend/nestjs-api-mysql-prisma-fastify/.cursor/hooks.json +0 -46
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/agents/nestjs-code-reviewer.md +0 -23
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/agents/sequelize-guardian.md +0 -37
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/agents/test-runner.md +0 -33
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/commands/new-endpoint.md +0 -76
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/commands/new-model.md +0 -85
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/hooks/autoTestOnStop.ts +0 -127
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/hooks/blockDangerous.ts +0 -98
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/hooks/ensureTestsExist.ts +0 -397
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/hooks/formatOnEdit.ts +0 -66
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/hooks/protectSecrets.ts +0 -101
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/hooks/sessionInit.ts +0 -104
- package/templates/backend/nestjs-api-mysql-sequelize-express/.cursor/hooks.json +0 -41
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/agents/nestjs-code-reviewer.md +0 -23
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/agents/sequelize-guardian.md +0 -37
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/agents/test-runner.md +0 -33
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/commands/new-endpoint.md +0 -76
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/commands/new-model.md +0 -85
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/hooks/autoTestOnStop.ts +0 -127
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/hooks/blockDangerous.ts +0 -98
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/hooks/ensureTestsExist.ts +0 -397
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/hooks/formatOnEdit.ts +0 -66
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/hooks/protectSecrets.ts +0 -101
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/hooks/sessionInit.ts +0 -104
- package/templates/backend/nestjs-api-mysql-sequelize-fastify/.cursor/hooks.json +0 -41
- package/templates/backend/nestjs-api-postgres/.cursor/agents/nestjs-code-reviewer.md +0 -54
- package/templates/backend/nestjs-api-postgres/.cursor/agents/prisma-guardian.md +0 -62
- package/templates/backend/nestjs-api-postgres/.cursor/agents/security-auditor.md +0 -71
- package/templates/backend/nestjs-api-postgres/.cursor/agents/test-runner.md +0 -58
- package/templates/backend/nestjs-api-postgres/.cursor/commands/add-pagination.md +0 -235
- package/templates/backend/nestjs-api-postgres/.cursor/commands/add-seed.md +0 -160
- package/templates/backend/nestjs-api-postgres/.cursor/commands/add-tests.md +0 -322
- package/templates/backend/nestjs-api-postgres/.cursor/commands/new-endpoint.md +0 -209
- package/templates/backend/nestjs-api-postgres/.cursor/commands/new-guard.md +0 -195
- package/templates/backend/nestjs-api-postgres/.cursor/commands/new-interceptor.md +0 -188
- package/templates/backend/nestjs-api-postgres/.cursor/commands/new-middleware.md +0 -176
- package/templates/backend/nestjs-api-postgres/.cursor/commands/new-model.md +0 -201
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/auto-retry.ts +0 -62
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/block-dangerous.ts +0 -202
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/format-and-validate.ts +0 -124
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/protect-secrets.ts +0 -105
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/session-context.ts +0 -130
- package/templates/backend/nestjs-api-postgres/.cursor/hooks.json +0 -36
- package/templates/backend/nestjs-api-postgres/.cursor/mcp.json +0 -21
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/code-reviewer.md +0 -153
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/nestjs-architect.md +0 -138
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/prisma-analyst.md +0 -164
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/security-auditor.md +0 -150
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/test-engineer.md +0 -290
- package/templates/backend/nestjs-api-sqlite/.cursor/commands/add-pagination.md +0 -235
- package/templates/backend/nestjs-api-sqlite/.cursor/commands/add-seed.md +0 -172
- package/templates/backend/nestjs-api-sqlite/.cursor/commands/add-tests.md +0 -322
- package/templates/backend/nestjs-api-sqlite/.cursor/commands/new-endpoint.md +0 -209
- package/templates/backend/nestjs-api-sqlite/.cursor/commands/new-guard.md +0 -195
- package/templates/backend/nestjs-api-sqlite/.cursor/commands/new-interceptor.md +0 -188
- package/templates/backend/nestjs-api-sqlite/.cursor/commands/new-middleware.md +0 -176
- package/templates/backend/nestjs-api-sqlite/.cursor/commands/new-model.md +0 -201
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/auto-format.ts +0 -80
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/block-dangerous-commands.ts +0 -144
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/prisma-schema-watcher.ts +0 -64
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/protect-sensitive-files.ts +0 -122
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/session-context.ts +0 -105
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks.json +0 -18
- package/templates/backend/nestjs-api-sqlite/.cursor/mcp.json +0 -17
- package/templates/backend/nestjs-api-sqlserver/.cursor/agents/nestjs-code-reviewer.md +0 -54
- package/templates/backend/nestjs-api-sqlserver/.cursor/agents/prisma-guardian.md +0 -67
- package/templates/backend/nestjs-api-sqlserver/.cursor/agents/test-runner.md +0 -57
- package/templates/backend/nestjs-api-sqlserver/.cursor/commands/new-endpoint.md +0 -209
- package/templates/backend/nestjs-api-sqlserver/.cursor/commands/new-model.md +0 -201
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/autoTestOnStop.ts +0 -127
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/blockDangerous.ts +0 -98
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/ensureTestsExist.ts +0 -405
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/formatOnEdit.ts +0 -70
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/protectSecrets.ts +0 -101
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/sessionInit.ts +0 -104
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/validatePrisma.ts +0 -121
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks.json +0 -46
- package/templates/frontend/angular-base/.cursor/agents/accessibility-reviewer.md +0 -67
- package/templates/frontend/angular-base/.cursor/agents/angular-code-reviewer.md +0 -60
- package/templates/frontend/angular-base/.cursor/agents/qa-test-expert.md +0 -70
- package/templates/frontend/angular-base/.cursor/agents/security-auditor.md +0 -58
- package/templates/frontend/angular-base/.cursor/commands/add-e2e-test.md +0 -236
- package/templates/frontend/angular-base/.cursor/commands/new-component.md +0 -211
- package/templates/frontend/angular-base/.cursor/commands/new-form.md +0 -284
- package/templates/frontend/angular-base/.cursor/commands/new-interceptor.md +0 -257
- package/templates/frontend/angular-base/.cursor/commands/new-page.md +0 -215
- package/templates/frontend/angular-base/.cursor/commands/new-service.md +0 -203
- package/templates/frontend/angular-base/.cursor/hooks/auto-format.ts +0 -70
- package/templates/frontend/angular-base/.cursor/hooks/auto-test-on-stop.ts +0 -113
- package/templates/frontend/angular-base/.cursor/hooks/block-dangerous-commands.ts +0 -160
- package/templates/frontend/angular-base/.cursor/hooks/ensure-tests-exist.ts +0 -363
- package/templates/frontend/angular-base/.cursor/hooks/protect-sensitive-files.ts +0 -118
- package/templates/frontend/angular-base/.cursor/hooks/session-context.ts +0 -110
- package/templates/frontend/angular-base/.cursor/hooks.json +0 -41
- package/templates/frontend/angular-base/.cursor/mcp.json +0 -21
- package/templates/frontend/angular-nx/.cursor/agents/angular-code-reviewer.md +0 -64
- package/templates/frontend/angular-nx/.cursor/agents/ci-watcher.md +0 -480
- package/templates/frontend/angular-nx/.cursor/agents/nx-architecture-guardian.md +0 -69
- package/templates/frontend/angular-nx/.cursor/agents/qa-test-expert.md +0 -75
- package/templates/frontend/angular-nx/.cursor/agents/security-auditor.md +0 -61
- package/templates/frontend/angular-nx/.cursor/commands/ci-monitor.md +0 -428
- package/templates/frontend/angular-nx/.cursor/hooks/auto-format.ts +0 -70
- package/templates/frontend/angular-nx/.cursor/hooks/auto-test-on-stop.ts +0 -115
- package/templates/frontend/angular-nx/.cursor/hooks/block-dangerous-commands.ts +0 -188
- package/templates/frontend/angular-nx/.cursor/hooks/ensure-tests-exist.ts +0 -399
- package/templates/frontend/angular-nx/.cursor/hooks/protect-sensitive-files.ts +0 -128
- package/templates/frontend/angular-nx/.cursor/hooks/session-context.ts +0 -121
- package/templates/frontend/angular-nx/.cursor/hooks.json +0 -41
- package/templates/frontend/angular-nx/.cursor/mcp.json +0 -12
- package/templates/frontend/hub-pre-sales/.cursor/agents/frontend-senior.agent.md +0 -49
- package/templates/frontend/hub-pre-sales/.cursor/agents/pre-sales-builder.agent.md +0 -98
- package/templates/frontend/hub-pre-sales/.cursor/agents/pre-sales-demo-runner.agent.md +0 -36
- package/templates/frontend/hub-pre-sales/.cursor/agents/pre-sales-refactor.agent.md +0 -54
- package/templates/frontend/hub-pre-sales/.cursor/agents/pre-sales-validator.agent.md +0 -69
- package/templates/frontend/hub-pre-sales/.cursor/agents/qa-test-expert.agent.md +0 -48
- package/templates/frontend/hub-pre-sales/.cursor/agents/security-expert.agent.md +0 -39
- package/templates/frontend/hub-pre-sales/.cursor/agents/ux-ui-expert.agent.md +0 -45
- package/templates/frontend/hub-pre-sales/.cursor/commands/add-calendar.md +0 -151
- package/templates/frontend/hub-pre-sales/.cursor/commands/add-chart.md +0 -148
- package/templates/frontend/hub-pre-sales/.cursor/commands/add-dashboard.md +0 -135
- package/templates/frontend/hub-pre-sales/.cursor/commands/add-form.md +0 -128
- package/templates/frontend/hub-pre-sales/.cursor/commands/add-login.md +0 -160
- package/templates/frontend/hub-pre-sales/.cursor/commands/add-map.md +0 -172
- package/templates/frontend/hub-pre-sales/.cursor/commands/add-route.md +0 -211
- package/templates/frontend/hub-pre-sales/.cursor/commands/add-screen.md +0 -118
- package/templates/frontend/hub-pre-sales/.cursor/commands/add-table.md +0 -156
- package/templates/frontend/hub-pre-sales/.cursor/commands/add-tests.md +0 -269
- package/templates/frontend/hub-pre-sales/.cursor/commands/mock-backend.md +0 -139
- package/templates/frontend/hub-pre-sales/.cursor/commands/new-component.md +0 -192
- package/templates/frontend/hub-pre-sales/.cursor/commands/new-form.md +0 -268
- package/templates/frontend/hub-pre-sales/.cursor/commands/new-page.md +0 -203
- package/templates/frontend/hub-pre-sales/.cursor/commands/new-query.md +0 -287
- package/templates/frontend/hub-pre-sales/.cursor/commands/new-table.md +0 -299
- package/templates/frontend/hub-pre-sales/.cursor/commands/prepare-preview.md +0 -48
- package/templates/frontend/hub-pre-sales/.cursor/commands/refactor-ui.md +0 -94
- package/templates/frontend/hub-pre-sales/.cursor/commands/ver-demo.md +0 -58
- package/templates/frontend/hub-pre-sales/.cursor/hooks/checkFileLength.ts +0 -69
- package/templates/frontend/hub-pre-sales/.cursor/hooks/injectPreSalesContext.ts +0 -103
- package/templates/frontend/hub-pre-sales/.cursor/hooks.json +0 -23
- package/templates/frontend/hub-pre-sales/.cursor/mcp.json +0 -17
- package/templates/frontend/pre-sales/.cursor/agents/frontend-senior.agent.md +0 -49
- package/templates/frontend/pre-sales/.cursor/agents/pre-sales-builder.agent.md +0 -92
- package/templates/frontend/pre-sales/.cursor/agents/pre-sales-demo-runner.agent.md +0 -36
- package/templates/frontend/pre-sales/.cursor/agents/pre-sales-deploy.agent.md +0 -87
- package/templates/frontend/pre-sales/.cursor/agents/pre-sales-refactor.agent.md +0 -54
- package/templates/frontend/pre-sales/.cursor/agents/pre-sales-validator.agent.md +0 -69
- package/templates/frontend/pre-sales/.cursor/agents/qa-test-expert.agent.md +0 -48
- package/templates/frontend/pre-sales/.cursor/agents/security-expert.agent.md +0 -39
- package/templates/frontend/pre-sales/.cursor/agents/ux-ui-expert.agent.md +0 -45
- package/templates/frontend/pre-sales/.cursor/commands/add-calendar.md +0 -151
- package/templates/frontend/pre-sales/.cursor/commands/add-chart.md +0 -148
- package/templates/frontend/pre-sales/.cursor/commands/add-dashboard.md +0 -135
- package/templates/frontend/pre-sales/.cursor/commands/add-form.md +0 -128
- package/templates/frontend/pre-sales/.cursor/commands/add-login.md +0 -160
- package/templates/frontend/pre-sales/.cursor/commands/add-map.md +0 -172
- package/templates/frontend/pre-sales/.cursor/commands/add-route.md +0 -211
- package/templates/frontend/pre-sales/.cursor/commands/add-screen.md +0 -118
- package/templates/frontend/pre-sales/.cursor/commands/add-table.md +0 -156
- package/templates/frontend/pre-sales/.cursor/commands/add-tests.md +0 -269
- package/templates/frontend/pre-sales/.cursor/commands/deploy-demo.md +0 -73
- package/templates/frontend/pre-sales/.cursor/commands/mock-backend.md +0 -139
- package/templates/frontend/pre-sales/.cursor/commands/new-component.md +0 -192
- package/templates/frontend/pre-sales/.cursor/commands/new-form.md +0 -268
- package/templates/frontend/pre-sales/.cursor/commands/new-page.md +0 -203
- package/templates/frontend/pre-sales/.cursor/commands/new-query.md +0 -287
- package/templates/frontend/pre-sales/.cursor/commands/new-table.md +0 -299
- package/templates/frontend/pre-sales/.cursor/commands/prepare-deploy.md +0 -135
- package/templates/frontend/pre-sales/.cursor/commands/refactor-ui.md +0 -94
- package/templates/frontend/pre-sales/.cursor/commands/ver-demo.md +0 -58
- package/templates/frontend/pre-sales/.cursor/hooks/checkFileLength.ts +0 -69
- package/templates/frontend/pre-sales/.cursor/hooks/ensureTestsExist.ts +0 -220
- package/templates/frontend/pre-sales/.cursor/hooks/injectPreSalesContext.ts +0 -97
- package/templates/frontend/pre-sales/.cursor/hooks.json +0 -23
- package/templates/frontend/pre-sales/.cursor/mcp.json +0 -13
- package/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +0 -22
- package/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +0 -24
- package/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +0 -32
- package/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +0 -25
- package/templates/frontend/react-ssr/.cursor/commands/new-component.md +0 -97
- package/templates/frontend/react-ssr/.cursor/commands/new-page.md +0 -95
- package/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +0 -66
- package/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +0 -89
- package/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +0 -64
- package/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +0 -94
- package/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +0 -120
- package/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +0 -209
- package/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +0 -101
- package/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +0 -93
- package/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +0 -10
- package/templates/frontend/react-ssr/.cursor/hooks.json +0 -41
- package/templates/frontend/react-vite/.cursor/agents/frontend-senior.agent.md +0 -49
- package/templates/frontend/react-vite/.cursor/agents/qa-test-expert.agent.md +0 -126
- package/templates/frontend/react-vite/.cursor/agents/security-expert.agent.md +0 -39
- package/templates/frontend/react-vite/.cursor/agents/ux-ui-expert.agent.md +0 -45
- package/templates/frontend/react-vite/.cursor/commands/add-route.md +0 -211
- package/templates/frontend/react-vite/.cursor/commands/add-tests.md +0 -269
- package/templates/frontend/react-vite/.cursor/commands/new-component.md +0 -232
- package/templates/frontend/react-vite/.cursor/commands/new-form.md +0 -268
- package/templates/frontend/react-vite/.cursor/commands/new-page.md +0 -203
- package/templates/frontend/react-vite/.cursor/commands/new-query.md +0 -287
- package/templates/frontend/react-vite/.cursor/commands/new-table.md +0 -299
- package/templates/frontend/react-vite/.cursor/hooks/autoTestOnStop.ts +0 -117
- package/templates/frontend/react-vite/.cursor/hooks/blockDangerous.ts +0 -75
- package/templates/frontend/react-vite/.cursor/hooks/ensureTestsExist.ts +0 -306
- package/templates/frontend/react-vite/.cursor/hooks/formatOnEdit.ts +0 -49
- package/templates/frontend/react-vite/.cursor/hooks/protectSecrets.ts +0 -88
- package/templates/frontend/react-vite/.cursor/hooks/sessionInit.ts +0 -77
- package/templates/frontend/react-vite/.cursor/hooks.json +0 -41
- package/templates/frontend/react-vite/.cursor/mcp.json +0 -17
- package/templates/frontend/react-vite-help/.cursor/RECONSTRUCTION-PROMPT.md +0 -738
- package/templates/frontend/react-vite-help/.cursor/agents/frontend-senior.agent.md +0 -49
- package/templates/frontend/react-vite-help/.cursor/agents/qa-test-expert.agent.md +0 -49
- package/templates/frontend/react-vite-help/.cursor/agents/security-expert.agent.md +0 -39
- package/templates/frontend/react-vite-help/.cursor/agents/ux-ui-expert.agent.md +0 -45
- package/templates/frontend/react-vite-help/.cursor/commands/add-route.md +0 -211
- package/templates/frontend/react-vite-help/.cursor/commands/add-tests.md +0 -269
- package/templates/frontend/react-vite-help/.cursor/commands/new-component.md +0 -232
- package/templates/frontend/react-vite-help/.cursor/commands/new-form.md +0 -268
- package/templates/frontend/react-vite-help/.cursor/commands/new-page.md +0 -203
- package/templates/frontend/react-vite-help/.cursor/commands/new-query.md +0 -287
- package/templates/frontend/react-vite-help/.cursor/commands/new-table.md +0 -299
- package/templates/frontend/react-vite-help/.cursor/hooks/ensureTestsExist.ts +0 -220
- package/templates/frontend/react-vite-help/.cursor/hooks.json +0 -10
- package/templates/frontend/react-vite-help/.cursor/mcp.json +0 -17
- package/templates/mobile/expo-base/.cursor/agents/api-integration.md +0 -139
- package/templates/mobile/expo-base/.cursor/agents/feature-architect.md +0 -131
- package/templates/mobile/expo-base/.cursor/agents/i18n-manager.md +0 -147
- package/templates/mobile/expo-base/.cursor/agents/quality-reviewer.md +0 -137
- package/templates/mobile/expo-base/.cursor/agents/testing-specialist.md +0 -123
- package/templates/mobile/expo-base/.cursor/agents/theme-engineer.md +0 -106
- package/templates/mobile/expo-base/.cursor/commands/add-translation.md +0 -184
- package/templates/mobile/expo-base/.cursor/commands/new-api-service.md +0 -280
- package/templates/mobile/expo-base/.cursor/commands/new-component.md +0 -298
- package/templates/mobile/expo-base/.cursor/commands/new-hook.md +0 -291
- package/templates/mobile/expo-base/.cursor/commands/new-modal.md +0 -345
- package/templates/mobile/expo-base/.cursor/commands/new-screen.md +0 -267
- package/templates/mobile/expo-base/.cursor/commands/new-tab.md +0 -238
- package/templates/mobile/expo-base/.cursor/mcp.json +0 -21
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
# new-page
|
|
2
|
-
|
|
3
|
-
Actuá como **arquitecto frontend senior especializado en React 19, TanStack Router, TanStack Query y Vite**.
|
|
4
|
-
|
|
5
|
-
Este comando debe crear **una página completa con ruta TanStack Router configurada** siguiendo estrictamente las convenciones del proyecto.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Flujo interactivo (obligatorio)
|
|
10
|
-
|
|
11
|
-
1. Preguntar:
|
|
12
|
-
- Nombre de la página (**kebab-case**, ej: `dashboard`, `user-profile`, `product-detail`)
|
|
13
|
-
2. Preguntar:
|
|
14
|
-
- Ruta URL deseada (ej: `/dashboard`, `/users/$userId`, `/products`)
|
|
15
|
-
3. Preguntar:
|
|
16
|
-
- ¿Es una ruta hija (nested)? (Sí / No)
|
|
17
|
-
- Si sí, ¿de cuál ruta padre?
|
|
18
|
-
4. Preguntar:
|
|
19
|
-
- ¿Tiene parámetros de ruta? (ej: `$userId`, `$productId`)
|
|
20
|
-
5. Preguntar:
|
|
21
|
-
- ¿Necesita cargar datos (loader con TanStack Query)? (Sí / No)
|
|
22
|
-
6. Preguntar:
|
|
23
|
-
- ¿Requiere autenticación? (Sí / No)
|
|
24
|
-
7. Validar:
|
|
25
|
-
- Que el nombre sea válido
|
|
26
|
-
- Que no exista ya el archivo de ruta en `src/routes/`
|
|
27
|
-
|
|
28
|
-
Si alguna validación falla, **detener la ejecución y explicar el error**.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Estructura a generar
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
src/
|
|
36
|
-
├── routes/
|
|
37
|
-
│ └── {path}.tsx (archivo de ruta TanStack Router)
|
|
38
|
-
├── components/
|
|
39
|
-
│ └── pages/
|
|
40
|
-
│ └── {name}/
|
|
41
|
-
│ ├── {Name}Page.tsx (componente de página)
|
|
42
|
-
│ └── index.ts (barrel export)
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Reglas generales
|
|
48
|
-
|
|
49
|
-
- Código **100% TypeScript** con strict mode
|
|
50
|
-
- Usar **TanStack Router** file-based routing
|
|
51
|
-
- Usar **TanStack Query** para data fetching
|
|
52
|
-
- Tailwind CSS + DaisyUI/Shadcn para estilos
|
|
53
|
-
- Componentes funcionales con hooks
|
|
54
|
-
- No usar `any`
|
|
55
|
-
- Error boundaries para manejo de errores
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## Archivo de ruta (`src/routes/{path}.tsx`)
|
|
60
|
-
|
|
61
|
-
### Ruta básica:
|
|
62
|
-
|
|
63
|
-
```typescript
|
|
64
|
-
import { createFileRoute } from '@tanstack/react-router';
|
|
65
|
-
import { {Name}Page } from '@/components/pages/{name}';
|
|
66
|
-
|
|
67
|
-
export const Route = createFileRoute('/{route}')({
|
|
68
|
-
component: {Name}Page,
|
|
69
|
-
});
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Con loader (TanStack Query):
|
|
73
|
-
|
|
74
|
-
```typescript
|
|
75
|
-
import { createFileRoute } from '@tanstack/react-router';
|
|
76
|
-
import { queryClient } from '@/lib/query-client';
|
|
77
|
-
import { {name}QueryOptions } from '@/hooks/use-{name}';
|
|
78
|
-
import { {Name}Page } from '@/components/pages/{name}';
|
|
79
|
-
|
|
80
|
-
export const Route = createFileRoute('/{route}')({
|
|
81
|
-
loader: () => queryClient.ensureQueryData({name}QueryOptions()),
|
|
82
|
-
component: {Name}Page,
|
|
83
|
-
errorComponent: ({ error }) => (
|
|
84
|
-
<div className="flex items-center justify-center p-8">
|
|
85
|
-
<p className="text-error">Error: {error.message}</p>
|
|
86
|
-
</div>
|
|
87
|
-
),
|
|
88
|
-
pendingComponent: () => (
|
|
89
|
-
<div className="flex items-center justify-center p-8">
|
|
90
|
-
<span className="loading loading-spinner loading-lg" />
|
|
91
|
-
</div>
|
|
92
|
-
),
|
|
93
|
-
});
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Con parámetros:
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
import { createFileRoute } from '@tanstack/react-router';
|
|
100
|
-
import { {Name}Page } from '@/components/pages/{name}';
|
|
101
|
-
|
|
102
|
-
export const Route = createFileRoute('/{parent}/${ paramName }')({
|
|
103
|
-
component: {Name}Page,
|
|
104
|
-
});
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## Componente de página (`{Name}Page.tsx`)
|
|
110
|
-
|
|
111
|
-
```typescript
|
|
112
|
-
import { FC } from 'react';
|
|
113
|
-
|
|
114
|
-
export const {Name}Page: FC = () => {
|
|
115
|
-
return (
|
|
116
|
-
<main className="container mx-auto px-4 py-8">
|
|
117
|
-
<h1 className="text-2xl font-bold mb-6">{Name}</h1>
|
|
118
|
-
|
|
119
|
-
<section className="space-y-4">
|
|
120
|
-
{/* Contenido de la página */}
|
|
121
|
-
</section>
|
|
122
|
-
</main>
|
|
123
|
-
);
|
|
124
|
-
};
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Con datos del loader:
|
|
128
|
-
|
|
129
|
-
```typescript
|
|
130
|
-
import { FC } from 'react';
|
|
131
|
-
import { useQuery } from '@tanstack/react-query';
|
|
132
|
-
import { {name}QueryOptions } from '@/hooks/use-{name}';
|
|
133
|
-
|
|
134
|
-
export const {Name}Page: FC = () => {
|
|
135
|
-
const { data, isLoading, error } = useQuery({name}QueryOptions());
|
|
136
|
-
|
|
137
|
-
if (isLoading) {
|
|
138
|
-
return <div className="flex justify-center p-8"><span className="loading loading-spinner" /></div>;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (error) {
|
|
142
|
-
return <div className="alert alert-error">{error.message}</div>;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return (
|
|
146
|
-
<main className="container mx-auto px-4 py-8">
|
|
147
|
-
<h1 className="text-2xl font-bold mb-6">{Name}</h1>
|
|
148
|
-
<section className="space-y-4">
|
|
149
|
-
{/* Renderizar data */}
|
|
150
|
-
</section>
|
|
151
|
-
</main>
|
|
152
|
-
);
|
|
153
|
-
};
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
### Con parámetros de ruta:
|
|
157
|
-
|
|
158
|
-
```typescript
|
|
159
|
-
import { FC } from 'react';
|
|
160
|
-
import { useParams } from '@tanstack/react-router';
|
|
161
|
-
|
|
162
|
-
export const {Name}Page: FC = () => {
|
|
163
|
-
const { {paramName} } = useParams({ from: '/{parent}/${ paramName }' });
|
|
164
|
-
|
|
165
|
-
return (
|
|
166
|
-
<main className="container mx-auto px-4 py-8">
|
|
167
|
-
<h1 className="text-2xl font-bold mb-6">{Name} #{paramName}</h1>
|
|
168
|
-
</main>
|
|
169
|
-
);
|
|
170
|
-
};
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## Barrel export (`index.ts`)
|
|
176
|
-
|
|
177
|
-
```typescript
|
|
178
|
-
export { {Name}Page } from './{Name}Page';
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## Mensajes finales obligatorios
|
|
184
|
-
|
|
185
|
-
Al finalizar, mostrar:
|
|
186
|
-
|
|
187
|
-
* Lista de archivos creados
|
|
188
|
-
* URL de acceso: `http://localhost:5173/{route}`
|
|
189
|
-
* Si usa loader, recordar crear el hook de query con `/new-query`
|
|
190
|
-
* Si requiere auth, recordar implementar el guard de ruta
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## Criterios de calidad
|
|
195
|
-
|
|
196
|
-
* TanStack Router file-based routing correcto
|
|
197
|
-
* TanStack Query para data fetching
|
|
198
|
-
* Componentes con error/loading states
|
|
199
|
-
* Tailwind CSS + DaisyUI
|
|
200
|
-
* Tipado estricto
|
|
201
|
-
* Cumple ESLint y Prettier del proyecto
|
|
202
|
-
|
|
203
|
-
Este command debe **crear páginas React completas con routing, data fetching y estados de carga configurados**.
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
# new-query
|
|
2
|
-
|
|
3
|
-
Actuá como **arquitecto frontend senior especializado en React 19, TanStack Query y TypeScript**.
|
|
4
|
-
|
|
5
|
-
Este comando debe crear **hooks de TanStack Query completos (query + mutation)** para interactuar con una API REST, siguiendo las convenciones del proyecto.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Flujo interactivo (obligatorio)
|
|
10
|
-
|
|
11
|
-
1. Preguntar:
|
|
12
|
-
- Nombre del recurso/entidad (**singular, kebab-case**, ej: `user`, `product`, `category`)
|
|
13
|
-
2. Preguntar:
|
|
14
|
-
- URL base de la API (ej: `/api/users`, `https://api.example.com/products`)
|
|
15
|
-
3. Preguntar:
|
|
16
|
-
- ¿Qué hooks generar?
|
|
17
|
-
- **useQuery** (obtener lista / obtener por ID)
|
|
18
|
-
- **useMutation create** (crear nuevo)
|
|
19
|
-
- **useMutation update** (actualizar)
|
|
20
|
-
- **useMutation delete** (eliminar)
|
|
21
|
-
- Permitir selección múltiple — Recomendado: Todos
|
|
22
|
-
4. Preguntar:
|
|
23
|
-
- ¿Incluir optimistic updates en mutations? (Sí / No)
|
|
24
|
-
5. Preguntar:
|
|
25
|
-
- ¿Incluir paginación en el query de lista? (Sí / No)
|
|
26
|
-
6. Validar:
|
|
27
|
-
- Que el nombre sea válido
|
|
28
|
-
- Que no exista ya `src/hooks/use-{name}.ts`
|
|
29
|
-
|
|
30
|
-
Si alguna validación falla, **detener la ejecución y explicar el error**.
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Estructura a generar
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
src/
|
|
38
|
-
├── hooks/
|
|
39
|
-
│ └── use-{name}.ts (hooks de TanStack Query)
|
|
40
|
-
├── services/
|
|
41
|
-
│ └── {name}.service.ts (funciones de API)
|
|
42
|
-
├── types/
|
|
43
|
-
│ └── {name}.types.ts (interfaces TypeScript)
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Reglas generales
|
|
49
|
-
|
|
50
|
-
- Código **100% TypeScript** con strict mode
|
|
51
|
-
- No usar `any`
|
|
52
|
-
- Query keys consistentes y tipadas
|
|
53
|
-
- Separar funciones de API de los hooks
|
|
54
|
-
- Invalidación automática de queries en mutations
|
|
55
|
-
- Manejo de errores con tipos
|
|
56
|
-
- Stale time y cache time configurados
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Tipos (`{name}.types.ts`)
|
|
61
|
-
|
|
62
|
-
```typescript
|
|
63
|
-
export interface {Name} {
|
|
64
|
-
id: number;
|
|
65
|
-
// campos del modelo
|
|
66
|
-
createdAt: string;
|
|
67
|
-
updatedAt: string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface Create{Name}Dto {
|
|
71
|
-
// campos requeridos (sin id, timestamps)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface Update{Name}Dto extends Partial<Create{Name}Dto> {}
|
|
75
|
-
|
|
76
|
-
export interface PaginatedResponse<T> {
|
|
77
|
-
data: T[];
|
|
78
|
-
meta: {
|
|
79
|
-
page: number;
|
|
80
|
-
limit: number;
|
|
81
|
-
total: number;
|
|
82
|
-
totalPages: number;
|
|
83
|
-
hasNextPage: boolean;
|
|
84
|
-
hasPreviousPage: boolean;
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Servicio API (`{name}.service.ts`)
|
|
92
|
-
|
|
93
|
-
```typescript
|
|
94
|
-
import type { {Name}, Create{Name}Dto, Update{Name}Dto, PaginatedResponse } from '@/types/{name}.types';
|
|
95
|
-
|
|
96
|
-
const BASE_URL = '/api/{name}s';
|
|
97
|
-
|
|
98
|
-
export const {name}Service = {
|
|
99
|
-
async getAll(page = 1, limit = 10): Promise<PaginatedResponse<{Name}>> {
|
|
100
|
-
const params = new URLSearchParams({ page: String(page), limit: String(limit) });
|
|
101
|
-
const response = await fetch(`${BASE_URL}?${params}`);
|
|
102
|
-
if (!response.ok) throw new Error('Error al obtener {name}s');
|
|
103
|
-
return response.json();
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
async getById(id: number): Promise<{Name}> {
|
|
107
|
-
const response = await fetch(`${BASE_URL}/${id}`);
|
|
108
|
-
if (!response.ok) throw new Error('{Name} no encontrado');
|
|
109
|
-
return response.json();
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
async create(dto: Create{Name}Dto): Promise<{Name}> {
|
|
113
|
-
const response = await fetch(BASE_URL, {
|
|
114
|
-
method: 'POST',
|
|
115
|
-
headers: { 'Content-Type': 'application/json' },
|
|
116
|
-
body: JSON.stringify(dto),
|
|
117
|
-
});
|
|
118
|
-
if (!response.ok) throw new Error('Error al crear {name}');
|
|
119
|
-
return response.json();
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
async update(id: number, dto: Update{Name}Dto): Promise<{Name}> {
|
|
123
|
-
const response = await fetch(`${BASE_URL}/${id}`, {
|
|
124
|
-
method: 'PATCH',
|
|
125
|
-
headers: { 'Content-Type': 'application/json' },
|
|
126
|
-
body: JSON.stringify(dto),
|
|
127
|
-
});
|
|
128
|
-
if (!response.ok) throw new Error('Error al actualizar {name}');
|
|
129
|
-
return response.json();
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
async remove(id: number): Promise<void> {
|
|
133
|
-
const response = await fetch(`${BASE_URL}/${id}`, { method: 'DELETE' });
|
|
134
|
-
if (!response.ok) throw new Error('Error al eliminar {name}');
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## Hooks de Query (`use-{name}.ts`)
|
|
142
|
-
|
|
143
|
-
```typescript
|
|
144
|
-
import { useQuery, useMutation, useQueryClient, queryOptions } from '@tanstack/react-query';
|
|
145
|
-
import { {name}Service } from '@/services/{name}.service';
|
|
146
|
-
import type { {Name}, Create{Name}Dto, Update{Name}Dto } from '@/types/{name}.types';
|
|
147
|
-
|
|
148
|
-
// Query keys
|
|
149
|
-
export const {name}Keys = {
|
|
150
|
-
all: ['{name}s'] as const,
|
|
151
|
-
lists: () => [...{name}Keys.all, 'list'] as const,
|
|
152
|
-
list: (page: number, limit: number) => [...{name}Keys.lists(), { page, limit }] as const,
|
|
153
|
-
details: () => [...{name}Keys.all, 'detail'] as const,
|
|
154
|
-
detail: (id: number) => [...{name}Keys.details(), id] as const,
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
/** Query options para obtener lista (reutilizable en loaders) */
|
|
158
|
-
export const {name}ListQueryOptions = (page = 1, limit = 10) =>
|
|
159
|
-
queryOptions({
|
|
160
|
-
queryKey: {name}Keys.list(page, limit),
|
|
161
|
-
queryFn: () => {name}Service.getAll(page, limit),
|
|
162
|
-
staleTime: 5 * 60 * 1000, // 5 minutos
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
/** Query options para obtener por ID */
|
|
166
|
-
export const {name}DetailQueryOptions = (id: number) =>
|
|
167
|
-
queryOptions({
|
|
168
|
-
queryKey: {name}Keys.detail(id),
|
|
169
|
-
queryFn: () => {name}Service.getById(id),
|
|
170
|
-
staleTime: 5 * 60 * 1000,
|
|
171
|
-
enabled: id > 0,
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
/** Hook para obtener lista de {name}s */
|
|
175
|
-
export function use{Name}List(page = 1, limit = 10) {
|
|
176
|
-
return useQuery({name}ListQueryOptions(page, limit));
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/** Hook para obtener un {name} por ID */
|
|
180
|
-
export function use{Name}Detail(id: number) {
|
|
181
|
-
return useQuery({name}DetailQueryOptions(id));
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/** Hook para crear un {name} */
|
|
185
|
-
export function useCreate{Name}() {
|
|
186
|
-
const queryClient = useQueryClient();
|
|
187
|
-
|
|
188
|
-
return useMutation({
|
|
189
|
-
mutationFn: (dto: Create{Name}Dto) => {name}Service.create(dto),
|
|
190
|
-
onSuccess: () => {
|
|
191
|
-
queryClient.invalidateQueries({ queryKey: {name}Keys.lists() });
|
|
192
|
-
},
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/** Hook para actualizar un {name} */
|
|
197
|
-
export function useUpdate{Name}() {
|
|
198
|
-
const queryClient = useQueryClient();
|
|
199
|
-
|
|
200
|
-
return useMutation({
|
|
201
|
-
mutationFn: ({ id, dto }: { id: number; dto: Update{Name}Dto }) =>
|
|
202
|
-
{name}Service.update(id, dto),
|
|
203
|
-
onSuccess: (data, { id }) => {
|
|
204
|
-
queryClient.invalidateQueries({ queryKey: {name}Keys.detail(id) });
|
|
205
|
-
queryClient.invalidateQueries({ queryKey: {name}Keys.lists() });
|
|
206
|
-
},
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/** Hook para eliminar un {name} */
|
|
211
|
-
export function useDelete{Name}() {
|
|
212
|
-
const queryClient = useQueryClient();
|
|
213
|
-
|
|
214
|
-
return useMutation({
|
|
215
|
-
mutationFn: (id: number) => {name}Service.remove(id),
|
|
216
|
-
onSuccess: () => {
|
|
217
|
-
queryClient.invalidateQueries({ queryKey: {name}Keys.lists() });
|
|
218
|
-
},
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
## Con Optimistic Updates
|
|
226
|
-
|
|
227
|
-
Si se seleccionó optimistic updates:
|
|
228
|
-
|
|
229
|
-
```typescript
|
|
230
|
-
export function useDelete{Name}() {
|
|
231
|
-
const queryClient = useQueryClient();
|
|
232
|
-
|
|
233
|
-
return useMutation({
|
|
234
|
-
mutationFn: (id: number) => {name}Service.remove(id),
|
|
235
|
-
onMutate: async (id) => {
|
|
236
|
-
await queryClient.cancelQueries({ queryKey: {name}Keys.lists() });
|
|
237
|
-
const previousData = queryClient.getQueryData({name}Keys.lists());
|
|
238
|
-
|
|
239
|
-
queryClient.setQueriesData({ queryKey: {name}Keys.lists() }, (old: any) => ({
|
|
240
|
-
...old,
|
|
241
|
-
data: old?.data?.filter((item: {Name}) => item.id !== id) ?? [],
|
|
242
|
-
}));
|
|
243
|
-
|
|
244
|
-
return { previousData };
|
|
245
|
-
},
|
|
246
|
-
onError: (_err, _id, context) => {
|
|
247
|
-
if (context?.previousData) {
|
|
248
|
-
queryClient.setQueriesData({ queryKey: {name}Keys.lists() }, context.previousData);
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
onSettled: () => {
|
|
252
|
-
queryClient.invalidateQueries({ queryKey: {name}Keys.lists() });
|
|
253
|
-
},
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
|
|
260
|
-
## Mensajes finales obligatorios
|
|
261
|
-
|
|
262
|
-
Al finalizar, mostrar:
|
|
263
|
-
|
|
264
|
-
* Lista de archivos creados
|
|
265
|
-
* Ejemplo de uso en un componente:
|
|
266
|
-
|
|
267
|
-
```tsx
|
|
268
|
-
const { data, isLoading, error } = use{Name}List();
|
|
269
|
-
const createMutation = useCreate{Name}();
|
|
270
|
-
const deleteMutation = useDelete{Name}();
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
* Recordar ajustar los tipos y la URL de API
|
|
274
|
-
* Recordar que las query options se pueden usar en TanStack Router loaders
|
|
275
|
-
|
|
276
|
-
---
|
|
277
|
-
|
|
278
|
-
## Criterios de calidad
|
|
279
|
-
|
|
280
|
-
* Query keys factory pattern
|
|
281
|
-
* Separación de API service y hooks
|
|
282
|
-
* Invalidación automática en mutations
|
|
283
|
-
* Query options reutilizables (para loaders)
|
|
284
|
-
* Tipado estricto sin `any`
|
|
285
|
-
* Cumple ESLint y Prettier del proyecto
|
|
286
|
-
|
|
287
|
-
Este command debe **estandarizar el data fetching con TanStack Query y mantener consistencia en toda la aplicación**.
|