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,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**.
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
# new-table
|
|
2
|
-
|
|
3
|
-
Actuá como **arquitecto frontend senior especializado en React 19, TanStack Table, TanStack Query y Tailwind CSS**.
|
|
4
|
-
|
|
5
|
-
Este comando debe crear **una tabla de datos completa con TanStack Table** incluyendo sorting, filtering y paginación, siguiendo las convenciones del proyecto.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Flujo interactivo (obligatorio)
|
|
10
|
-
|
|
11
|
-
1. Preguntar:
|
|
12
|
-
- Nombre del recurso/entidad para la tabla (**singular, kebab-case**, ej: `user`, `product`, `order`)
|
|
13
|
-
2. Preguntar:
|
|
14
|
-
- Columnas de la tabla, una por una:
|
|
15
|
-
- Nombre del campo (camelCase, debe coincidir con la propiedad del modelo)
|
|
16
|
-
- Etiqueta visible (ej: "Nombre", "Email", "Fecha de Creación")
|
|
17
|
-
- Tipo de dato (`string`, `number`, `date`, `boolean`, `custom`)
|
|
18
|
-
- ¿Es sorteable? (Sí / No)
|
|
19
|
-
- ¿Es filtrable? (Sí / No)
|
|
20
|
-
3. Preguntar:
|
|
21
|
-
- ¿Incluir columna de acciones? (Sí / No)
|
|
22
|
-
- Si sí, ¿qué acciones? (Ver, Editar, Eliminar)
|
|
23
|
-
4. Preguntar:
|
|
24
|
-
- ¿Paginación del lado del servidor o del cliente?
|
|
25
|
-
- **Server-side** (paginación en la API)
|
|
26
|
-
- **Client-side** (datos completos en memoria)
|
|
27
|
-
5. Preguntar:
|
|
28
|
-
- ¿Conectar con TanStack Query para obtener datos? (Sí / No)
|
|
29
|
-
6. Preguntar:
|
|
30
|
-
- ¿Qué librería de UI usar?
|
|
31
|
-
- **DaisyUI**
|
|
32
|
-
- **Shadcn UI**
|
|
33
|
-
- **HTML nativo con Tailwind**
|
|
34
|
-
7. Validar:
|
|
35
|
-
- Que el nombre sea válido
|
|
36
|
-
- Que al menos una columna sea definida
|
|
37
|
-
|
|
38
|
-
Si alguna validación falla, **detener la ejecución y explicar el error**.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Estructura a generar
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
src/
|
|
46
|
-
├── components/
|
|
47
|
-
│ └── tables/
|
|
48
|
-
│ └── {Name}Table/
|
|
49
|
-
│ ├── {Name}Table.tsx (componente principal)
|
|
50
|
-
│ ├── {name}-columns.tsx (definición de columnas)
|
|
51
|
-
│ └── index.ts
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## Reglas generales
|
|
57
|
-
|
|
58
|
-
- Código **100% TypeScript** con strict mode
|
|
59
|
-
- Usar `@tanstack/react-table` con tipado estricto
|
|
60
|
-
- Columnas definidas con `createColumnHelper` o `ColumnDef`
|
|
61
|
-
- Tailwind CSS + DaisyUI/Shadcn para estilos
|
|
62
|
-
- Separar definición de columnas del componente
|
|
63
|
-
- No usar `any`
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Definición de columnas (`{name}-columns.tsx`)
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
import { createColumnHelper } from '@tanstack/react-table';
|
|
71
|
-
import type { {Name} } from '@/types/{name}.types';
|
|
72
|
-
|
|
73
|
-
const columnHelper = createColumnHelper<{Name}>();
|
|
74
|
-
|
|
75
|
-
export const {name}Columns = [
|
|
76
|
-
columnHelper.accessor('id', {
|
|
77
|
-
header: 'ID',
|
|
78
|
-
cell: (info) => info.getValue(),
|
|
79
|
-
enableSorting: true,
|
|
80
|
-
}),
|
|
81
|
-
// Columnas dinámicas según campos seleccionados
|
|
82
|
-
columnHelper.accessor('name', {
|
|
83
|
-
header: 'Nombre',
|
|
84
|
-
cell: (info) => info.getValue(),
|
|
85
|
-
enableSorting: true,
|
|
86
|
-
enableColumnFilter: true,
|
|
87
|
-
}),
|
|
88
|
-
columnHelper.accessor('createdAt', {
|
|
89
|
-
header: 'Fecha de Creación',
|
|
90
|
-
cell: (info) => new Date(info.getValue()).toLocaleDateString('es-AR'),
|
|
91
|
-
enableSorting: true,
|
|
92
|
-
}),
|
|
93
|
-
// Columna de acciones (si se seleccionó)
|
|
94
|
-
columnHelper.display({
|
|
95
|
-
id: 'actions',
|
|
96
|
-
header: 'Acciones',
|
|
97
|
-
cell: ({ row }) => (
|
|
98
|
-
<div className="flex gap-2">
|
|
99
|
-
<button className="btn btn-ghost btn-xs" onClick={() => onView(row.original.id)}>
|
|
100
|
-
Ver
|
|
101
|
-
</button>
|
|
102
|
-
<button className="btn btn-ghost btn-xs" onClick={() => onEdit(row.original.id)}>
|
|
103
|
-
Editar
|
|
104
|
-
</button>
|
|
105
|
-
<button className="btn btn-ghost btn-xs text-error" onClick={() => onDelete(row.original.id)}>
|
|
106
|
-
Eliminar
|
|
107
|
-
</button>
|
|
108
|
-
</div>
|
|
109
|
-
),
|
|
110
|
-
}),
|
|
111
|
-
];
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## Componente de tabla (`{Name}Table.tsx`)
|
|
117
|
-
|
|
118
|
-
### Con DaisyUI:
|
|
119
|
-
|
|
120
|
-
```typescript
|
|
121
|
-
import { type FC, useState } from 'react';
|
|
122
|
-
import {
|
|
123
|
-
useReactTable,
|
|
124
|
-
getCoreRowModel,
|
|
125
|
-
getSortedRowModel,
|
|
126
|
-
getFilteredRowModel,
|
|
127
|
-
getPaginationRowModel,
|
|
128
|
-
flexRender,
|
|
129
|
-
type SortingState,
|
|
130
|
-
type ColumnFiltersState,
|
|
131
|
-
} from '@tanstack/react-table';
|
|
132
|
-
import type { {Name} } from '@/types/{name}.types';
|
|
133
|
-
import { {name}Columns } from './{name}-columns';
|
|
134
|
-
|
|
135
|
-
interface {Name}TableProps {
|
|
136
|
-
data: {Name}[];
|
|
137
|
-
isLoading?: boolean;
|
|
138
|
-
onView?: (id: number) => void;
|
|
139
|
-
onEdit?: (id: number) => void;
|
|
140
|
-
onDelete?: (id: number) => void;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export const {Name}Table: FC<{Name}TableProps> = ({
|
|
144
|
-
data,
|
|
145
|
-
isLoading = false,
|
|
146
|
-
onView,
|
|
147
|
-
onEdit,
|
|
148
|
-
onDelete,
|
|
149
|
-
}) => {
|
|
150
|
-
const [sorting, setSorting] = useState<SortingState>([]);
|
|
151
|
-
const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([]);
|
|
152
|
-
const [globalFilter, setGlobalFilter] = useState('');
|
|
153
|
-
|
|
154
|
-
const table = useReactTable({
|
|
155
|
-
data,
|
|
156
|
-
columns: {name}Columns,
|
|
157
|
-
state: { sorting, columnFilters, globalFilter },
|
|
158
|
-
onSortingChange: setSorting,
|
|
159
|
-
onColumnFiltersChange: setColumnFilters,
|
|
160
|
-
onGlobalFilterChange: setGlobalFilter,
|
|
161
|
-
getCoreRowModel: getCoreRowModel(),
|
|
162
|
-
getSortedRowModel: getSortedRowModel(),
|
|
163
|
-
getFilteredRowModel: getFilteredRowModel(),
|
|
164
|
-
getPaginationRowModel: getPaginationRowModel(),
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
if (isLoading) {
|
|
168
|
-
return (
|
|
169
|
-
<div className="flex justify-center p-8">
|
|
170
|
-
<span className="loading loading-spinner loading-lg" />
|
|
171
|
-
</div>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return (
|
|
176
|
-
<div className="space-y-4">
|
|
177
|
-
{/* Búsqueda global */}
|
|
178
|
-
<input
|
|
179
|
-
type="text"
|
|
180
|
-
placeholder="Buscar..."
|
|
181
|
-
className="input input-bordered w-full max-w-xs"
|
|
182
|
-
value={globalFilter}
|
|
183
|
-
onChange={(e) => setGlobalFilter(e.target.value)}
|
|
184
|
-
/>
|
|
185
|
-
|
|
186
|
-
{/* Tabla */}
|
|
187
|
-
<div className="overflow-x-auto">
|
|
188
|
-
<table className="table table-zebra w-full">
|
|
189
|
-
<thead>
|
|
190
|
-
{table.getHeaderGroups().map((headerGroup) => (
|
|
191
|
-
<tr key={headerGroup.id}>
|
|
192
|
-
{headerGroup.headers.map((header) => (
|
|
193
|
-
<th
|
|
194
|
-
key={header.id}
|
|
195
|
-
className={header.column.getCanSort() ? 'cursor-pointer select-none' : ''}
|
|
196
|
-
onClick={header.column.getToggleSortingHandler()}
|
|
197
|
-
>
|
|
198
|
-
<div className="flex items-center gap-1">
|
|
199
|
-
{flexRender(header.column.columnDef.header, header.getContext())}
|
|
200
|
-
{{ asc: ' ↑', desc: ' ↓' }[header.column.getIsSorted() as string] ?? ''}
|
|
201
|
-
</div>
|
|
202
|
-
</th>
|
|
203
|
-
))}
|
|
204
|
-
</tr>
|
|
205
|
-
))}
|
|
206
|
-
</thead>
|
|
207
|
-
<tbody>
|
|
208
|
-
{table.getRowModel().rows.map((row) => (
|
|
209
|
-
<tr key={row.id}>
|
|
210
|
-
{row.getVisibleCells().map((cell) => (
|
|
211
|
-
<td key={cell.id}>
|
|
212
|
-
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
213
|
-
</td>
|
|
214
|
-
))}
|
|
215
|
-
</tr>
|
|
216
|
-
))}
|
|
217
|
-
</tbody>
|
|
218
|
-
</table>
|
|
219
|
-
</div>
|
|
220
|
-
|
|
221
|
-
{/* Paginación */}
|
|
222
|
-
<div className="flex items-center justify-between">
|
|
223
|
-
<span className="text-sm text-base-content/60">
|
|
224
|
-
Mostrando {table.getState().pagination.pageIndex * table.getState().pagination.pageSize + 1} a{' '}
|
|
225
|
-
{Math.min(
|
|
226
|
-
(table.getState().pagination.pageIndex + 1) * table.getState().pagination.pageSize,
|
|
227
|
-
table.getFilteredRowModel().rows.length,
|
|
228
|
-
)}{' '}
|
|
229
|
-
de {table.getFilteredRowModel().rows.length} registros
|
|
230
|
-
</span>
|
|
231
|
-
<div className="join">
|
|
232
|
-
<button
|
|
233
|
-
className="join-item btn btn-sm"
|
|
234
|
-
onClick={() => table.previousPage()}
|
|
235
|
-
disabled={!table.getCanPreviousPage()}
|
|
236
|
-
>
|
|
237
|
-
Anterior
|
|
238
|
-
</button>
|
|
239
|
-
<button className="join-item btn btn-sm">
|
|
240
|
-
Página {table.getState().pagination.pageIndex + 1} de {table.getPageCount()}
|
|
241
|
-
</button>
|
|
242
|
-
<button
|
|
243
|
-
className="join-item btn btn-sm"
|
|
244
|
-
onClick={() => table.nextPage()}
|
|
245
|
-
disabled={!table.getCanNextPage()}
|
|
246
|
-
>
|
|
247
|
-
Siguiente
|
|
248
|
-
</button>
|
|
249
|
-
</div>
|
|
250
|
-
</div>
|
|
251
|
-
</div>
|
|
252
|
-
);
|
|
253
|
-
};
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
---
|
|
257
|
-
|
|
258
|
-
## Barrel export (`index.ts`)
|
|
259
|
-
|
|
260
|
-
```typescript
|
|
261
|
-
export { {Name}Table } from './{Name}Table';
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
---
|
|
265
|
-
|
|
266
|
-
## Mensajes finales obligatorios
|
|
267
|
-
|
|
268
|
-
Al finalizar, mostrar:
|
|
269
|
-
|
|
270
|
-
* Lista de archivos creados
|
|
271
|
-
* Ejemplo de uso:
|
|
272
|
-
|
|
273
|
-
```tsx
|
|
274
|
-
const { data, isLoading } = use{Name}List();
|
|
275
|
-
|
|
276
|
-
<{Name}Table
|
|
277
|
-
data={data ?? []}
|
|
278
|
-
isLoading={isLoading}
|
|
279
|
-
onView={(id) => navigate({ to: '/{name}s/$id', params: { id: String(id) } })}
|
|
280
|
-
onEdit={(id) => navigate({ to: '/{name}s/$id/edit', params: { id: String(id) } })}
|
|
281
|
-
onDelete={(id) => deleteMutation.mutate(id)}
|
|
282
|
-
/>
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
* Recordar crear los tipos en `src/types/` si no existen
|
|
286
|
-
* Recordar crear el hook de query con `/new-query` si no existe
|
|
287
|
-
|
|
288
|
-
---
|
|
289
|
-
|
|
290
|
-
## Criterios de calidad
|
|
291
|
-
|
|
292
|
-
* TanStack Table con tipado estricto
|
|
293
|
-
* Columnas separadas del componente
|
|
294
|
-
* Sorting, filtering y paginación funcionales
|
|
295
|
-
* Tailwind CSS + DaisyUI/Shadcn
|
|
296
|
-
* Loading states
|
|
297
|
-
* Cumple ESLint y Prettier del proyecto
|
|
298
|
-
|
|
299
|
-
Este command debe **crear tablas de datos profesionales con sorting, filtering y paginación listas para usar**.
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# prepare-preview
|
|
2
|
-
|
|
3
|
-
Actuá como asistente de **preparación de preview** para preventa (Huenei AI Hub).
|
|
4
|
-
|
|
5
|
-
Este comando **no publica** a ningún host. Solo verifica que el prototipo compile y documenta que el Hub publicará `dist/` a **Azure Blob**.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Flujo (no interactivo)
|
|
10
|
-
|
|
11
|
-
Ejecutá la secuencia y reportá el resultado en español claro.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Paso 1: Compilar
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
pnpm build
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
- OK → continuar
|
|
22
|
-
- Error → listar y proponer correcciones. No inventar deps nuevas sin autorización.
|
|
23
|
-
|
|
24
|
-
No ejecutar tests ni cobertura salvo pedido explícito.
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Paso 2: Señales de calidad ligeras
|
|
29
|
-
|
|
30
|
-
1. Buscar `console.log` en `src/` (excepto tests): listar si hay.
|
|
31
|
-
2. Revisar `index.html`: charset, viewport, title descriptivo, description, favicon.
|
|
32
|
-
3. Archivos en `src/` preferiblemente ≤ 150 líneas (avisar, no bloquear deploy del Hub).
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Paso 3: Mensaje final para el usuario
|
|
37
|
-
|
|
38
|
-
Si el build pasó:
|
|
39
|
-
|
|
40
|
-
```text
|
|
41
|
-
✅ Preview listo en local
|
|
42
|
-
- Carpeta de salida: dist/
|
|
43
|
-
- Probar: pnpm preview
|
|
44
|
-
- El Hub (fuera de este repo) publicará dist/ a Azure Blob versionado.
|
|
45
|
-
- Este template NO despliega a Vercel ni a otro host por sí solo.
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Si falló: explicar el bloqueo en lenguaje no técnico y los pasos para destrabarlo.
|