create-huenei-template 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/templates.js +14 -0
- package/dist/core/file-operations.js +15 -0
- package/dist/core/prompts.js +77 -135
- package/dist/index.js +55 -11
- package/dist/templates/README.md +7 -1
- package/dist/templates/backend/README.md +19 -9
- package/dist/templates/backend/nestjs-api-mysql/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/agents/prisma-guardian.md +67 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/agents/test-runner.md +57 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/autoTestOnStop.ts +127 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/blockDangerous.ts +98 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/ensureTestsExist.ts +405 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/formatOnEdit.ts +70 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/protectSecrets.ts +101 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/sessionInit.ts +104 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks/validatePrisma.ts +121 -0
- package/dist/templates/backend/nestjs-api-mysql/.cursor/hooks.json +46 -0
- package/dist/templates/backend/nestjs-api-mysql/README.md +26 -0
- package/dist/templates/backend/nestjs-api-mysql/eslint.config.mjs +1 -1
- package/dist/templates/backend/nestjs-api-mysql/package.json +7 -7
- package/dist/templates/backend/nestjs-api-postgres/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/agents/prisma-guardian.md +62 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/agents/security-auditor.md +71 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/agents/test-runner.md +58 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks/auto-retry.ts +62 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks/block-dangerous.ts +202 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks/format-and-validate.ts +124 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks/protect-secrets.ts +105 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks/session-context.ts +130 -0
- package/dist/templates/backend/nestjs-api-postgres/.cursor/hooks.json +36 -0
- package/dist/templates/backend/nestjs-api-postgres/eslint.config.mjs +1 -1
- package/dist/templates/backend/nestjs-api-postgres/package.json +6 -6
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/agents/code-reviewer.md +153 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/agents/nestjs-architect.md +138 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/agents/prisma-analyst.md +164 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/agents/security-auditor.md +150 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/agents/test-engineer.md +290 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks/auto-format.ts +80 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks/block-dangerous-commands.ts +144 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks/prisma-schema-watcher.ts +64 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks/protect-sensitive-files.ts +122 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks/session-context.ts +105 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/hooks.json +18 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/conventional-commits/SKILL.md +318 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/docker/SKILL.md +82 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/jest/SKILL.md +72 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/logging-best-practices/SKILL.md +127 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/prisma-database-setup/SKILL.md +186 -0
- package/dist/templates/backend/nestjs-api-sqlite/.cursor/skills/quality-gates-enforcer/SKILL.md +301 -0
- package/dist/templates/backend/nestjs-api-sqlite/README.md +34 -1
- package/dist/templates/backend/nestjs-api-sqlite/eslint.config.mjs +1 -1
- package/dist/templates/backend/nestjs-api-sqlite/package.json +6 -6
- package/dist/templates/backend/nestjs-api-sqlite/prisma/schema.prisma +1 -0
- package/dist/templates/backend/nestjs-api-sqlite/prisma/seed.ts +2 -2
- package/dist/templates/backend/nestjs-api-sqlite/src/posts/dto/post-response.dto.ts +5 -1
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/profile-response.dto.ts +1 -1
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/update-profile.dto.ts +1 -1
- package/dist/templates/backend/nestjs-api-sqlite/src/users/dto/user-response.dto.ts +4 -0
- package/dist/templates/backend/nestjs-api-sqlite/src/users/profile.service.ts +24 -8
- package/dist/templates/backend/nestjs-api-sqlite/src/users/users.service.ts +1 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/agents/prisma-guardian.md +67 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/agents/test-runner.md +57 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/commands/new-endpoint.md +209 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/commands/new-model.md +201 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/autoTestOnStop.ts +127 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/blockDangerous.ts +98 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/ensureTestsExist.ts +405 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/formatOnEdit.ts +70 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/protectSecrets.ts +101 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/sessionInit.ts +104 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks/validatePrisma.ts +121 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/hooks.json +46 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/api-rest.mdc +126 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/authentication-security.mdc +86 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/dto-validation.mdc +93 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/general-rules.mdc +126 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/nestjs-architecture.mdc +83 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/prisma-standards.mdc +111 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/rules/swagger-documentation.mdc +90 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/api-security-best-practices/SKILL.md +907 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/docker-expert/SKILL.md +409 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-expert/SKILL.md +552 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-the-best-practices/AGENTS.md +5958 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-the-best-practices/SKILL.md +130 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/nodejs-best-practices/SKILL.md +333 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/prisma-expert/SKILL.md +355 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.cursor/skills/sqlserver-table-design/SKILL.md +125 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.dockerignore +50 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.env.example +17 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.env.test +17 -0
- package/dist/templates/backend/nestjs-api-sqlserver/.prettierrc +4 -0
- package/dist/templates/backend/nestjs-api-sqlserver/README.md +587 -0
- package/dist/templates/backend/nestjs-api-sqlserver/docker-compose.yml +24 -0
- package/dist/templates/backend/nestjs-api-sqlserver/eslint.config.mjs +41 -0
- package/dist/templates/backend/nestjs-api-sqlserver/nest-cli.json +8 -0
- package/dist/templates/backend/nestjs-api-sqlserver/package.json +107 -0
- package/dist/templates/backend/nestjs-api-sqlserver/prisma/schema.prisma +70 -0
- package/dist/templates/backend/nestjs-api-sqlserver/prisma/seed.ts +215 -0
- package/dist/templates/backend/nestjs-api-sqlserver/prisma.config.ts +12 -0
- package/dist/templates/backend/nestjs-api-sqlserver/scripts/check-docker.js +64 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/app.module.ts +39 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/app.service.ts +8 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/auth.controller.ts +36 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/auth.module.ts +22 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/auth.service.ts +64 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/decorators/roles.decorator.ts +5 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/dto/login-response.dto.ts +23 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/dto/login.dto.ts +27 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/enums/role.enum.ts +5 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/guards/jwt-auth.guard.ts +20 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/guards/roles.guard.ts +23 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/strategies/jwt.strategy.ts +32 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/auth/types.ts +18 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/common/dto/paginated-response.dto.ts +16 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/common/dto/pagination.dto.ts +31 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/common/filters/http-exception.filter.ts +53 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/config/env.validation.ts +41 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/health/health.controller.ts +35 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/health/health.module.ts +7 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/main.ts +87 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/dto/create-post.dto.ts +32 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/dto/post-response.dto.ts +41 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/dto/update-post.dto.ts +31 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/posts.controller.ts +161 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/posts.module.ts +12 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/posts/posts.service.ts +171 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/prisma/prisma.module.ts +9 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/prisma/prisma.service.ts +62 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/constants/settings.constants.ts +9 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/dto/profile-response.dto.ts +39 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/dto/settings-response.dto.ts +18 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/dto/update-profile.dto.ts +48 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/dto/update-settings.dto.ts +40 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/dto/user-response.dto.ts +18 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/profile.service.ts +67 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/settings.service.ts +77 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/users.controller.ts +102 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/users.module.ts +14 -0
- package/dist/templates/backend/nestjs-api-sqlserver/src/users/users.service.ts +27 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/README.md +412 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/e2e/auth.e2e-spec.ts +147 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/e2e/health.e2e-spec.ts +62 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/e2e/posts.e2e-spec.ts +407 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/e2e/users.e2e-spec.ts +287 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/fixtures/test-data.ts +109 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/helpers/auth.helper.ts +54 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/helpers/db.helper.ts +68 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/jest-e2e.json +12 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/setup-e2e.ts +8 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/app.service.spec.ts +24 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/auth.controller.spec.ts +91 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/auth.service.spec.ts +161 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/health.controller.spec.ts +78 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/http-exception.filter.spec.ts +150 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/jwt-auth.guard.spec.ts +50 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/jwt.strategy.spec.ts +41 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/posts.controller.spec.ts +249 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/posts.service.spec.ts +328 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/profile.service.spec.ts +146 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/settings.service.spec.ts +242 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/users.controller.spec.ts +178 -0
- package/dist/templates/backend/nestjs-api-sqlserver/test/unit/users.service.spec.ts +96 -0
- package/dist/templates/backend/nestjs-api-sqlserver/tsconfig.build.json +4 -0
- package/dist/templates/backend/nestjs-api-sqlserver/tsconfig.json +28 -0
- package/dist/templates/cursor/.cursor/commands/configurar-cursor.md +763 -0
- package/dist/templates/cursor/.cursor/skills/create-huenei-subagent/SKILL.md +223 -0
- package/dist/templates/cursor/.cursor/skills/create-huenei-subagent/examples.md +236 -0
- package/dist/templates/cursor/.cursor/skills/cursor-hooks/SKILL.md +1100 -0
- package/dist/templates/cursor/.cursor/skills/find-skills/SKILL.md +133 -0
- package/dist/templates/frontend/angular-base/.cursor/agents/accessibility-reviewer.md +67 -0
- package/dist/templates/frontend/angular-base/.cursor/agents/angular-code-reviewer.md +60 -0
- package/dist/templates/frontend/angular-base/.cursor/agents/qa-test-expert.md +70 -0
- package/dist/templates/frontend/angular-base/.cursor/agents/security-auditor.md +58 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/auto-format.ts +70 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/auto-test-on-stop.ts +113 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/block-dangerous-commands.ts +160 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/ensure-tests-exist.ts +363 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/protect-sensitive-files.ts +118 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks/session-context.ts +110 -0
- package/dist/templates/frontend/angular-base/.cursor/hooks.json +41 -0
- package/dist/templates/frontend/angular-nx/.cursor/agents/angular-code-reviewer.md +64 -0
- package/dist/templates/frontend/angular-nx/.cursor/agents/nx-architecture-guardian.md +69 -0
- package/dist/templates/frontend/angular-nx/.cursor/agents/qa-test-expert.md +75 -0
- package/dist/templates/frontend/angular-nx/.cursor/agents/security-auditor.md +61 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/auto-format.ts +70 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/auto-test-on-stop.ts +115 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/block-dangerous-commands.ts +188 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/ensure-tests-exist.ts +399 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/protect-sensitive-files.ts +128 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks/session-context.ts +121 -0
- package/dist/templates/frontend/angular-nx/.cursor/hooks.json +41 -0
- package/dist/templates/frontend/react-vite/.cursor/agents/frontend-senior.agent.md +49 -49
- package/dist/templates/frontend/react-vite/.cursor/agents/qa-test-expert.agent.md +126 -49
- package/dist/templates/frontend/react-vite/.cursor/agents/security-expert.agent.md +39 -39
- package/dist/templates/frontend/react-vite/.cursor/agents/ux-ui-expert.agent.md +45 -45
- package/dist/templates/frontend/react-vite/.cursor/hooks/autoTestOnStop.ts +117 -0
- package/dist/templates/frontend/react-vite/.cursor/hooks/blockDangerous.ts +75 -0
- package/dist/templates/frontend/react-vite/.cursor/hooks/ensureTestsExist.ts +306 -220
- package/dist/templates/frontend/react-vite/.cursor/hooks/formatOnEdit.ts +49 -0
- package/dist/templates/frontend/react-vite/.cursor/hooks/protectSecrets.ts +88 -0
- package/dist/templates/frontend/react-vite/.cursor/hooks/sessionInit.ts +77 -0
- package/dist/templates/frontend/react-vite/.cursor/hooks.json +41 -10
- package/dist/templates/frontend/react-vite/.cursor/settings.json +13 -13
- package/dist/templates/frontend/react-vite/.vscode/settings.json +31 -31
- package/dist/templates/frontend/react-vite/README.md +34 -34
- package/dist/templates/frontend/react-vite/package.json +82 -82
- package/dist/templates/frontend/react-vite/pnpm-lock.yaml +6575 -6575
- package/dist/templates/frontend/react-vite/src/__tests__/components/layout/navbar.test.tsx +63 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/avatar.test.tsx +74 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/badge.test.tsx +55 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/breadcrumb.test.tsx +140 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/button.test.tsx +121 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/card.test.tsx +144 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/dialog.test.tsx +121 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/form.test.tsx +165 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/input.test.tsx +52 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/label.test.tsx +40 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/password-input.test.tsx +59 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/separator.test.tsx +40 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/table.test.tsx +254 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/tabs.test.tsx +82 -0
- package/dist/templates/frontend/react-vite/src/__tests__/components/ui/textarea.test.tsx +47 -0
- package/dist/templates/frontend/react-vite/src/__tests__/helpers/render.tsx +114 -0
- package/dist/templates/frontend/react-vite/src/__tests__/hooks/useLocalStorage.test.ts +95 -0
- package/dist/templates/frontend/react-vite/src/__tests__/lib/queryClient.test.ts +24 -0
- package/dist/templates/frontend/react-vite/src/__tests__/lib/utils.test.ts +43 -0
- package/dist/templates/frontend/react-vite/src/__tests__/routes/index.test.tsx +111 -0
- package/dist/templates/frontend/react-vite/src/__tests__/routes/otra-ruta.test.tsx +126 -0
- package/dist/templates/frontend/react-vite/src/__tests__/routes/root.test.tsx +78 -0
- package/dist/templates/frontend/react-vite/src/__tests__/routes/ui-components.test.tsx +286 -0
- package/dist/templates/frontend/react-vite/src/components/layout/navbar.tsx +38 -38
- package/dist/templates/frontend/react-vite/src/components/ui/avatar.tsx +42 -42
- package/dist/templates/frontend/react-vite/src/components/ui/dialog.tsx +122 -122
- package/dist/templates/frontend/react-vite/src/components/ui/table.tsx +229 -244
- package/dist/templates/frontend/react-vite/src/hooks/useLocalStorage.ts +32 -32
- package/dist/templates/frontend/react-vite/src/routes/__root.tsx +48 -48
- package/dist/templates/frontend/react-vite/src/routes/ui-components.tsx +359 -85
- package/dist/templates/frontend/react-vite/src/test/setup.ts +24 -24
- package/dist/templates/frontend/react-vite/vite.config.ts +2 -2
- package/dist/templates/frontend/react-vite/vitest.config.ts +13 -2
- package/dist/templates/frontend/react-vite-help/.cursor/RECONSTRUCTION-PROMPT.md +738 -0
- package/package.json +1 -1
- package/templates/README.md +7 -1
- package/templates/backend/README.md +19 -9
- package/templates/backend/nestjs-api-mysql/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/templates/backend/nestjs-api-mysql/.cursor/agents/prisma-guardian.md +67 -0
- package/templates/backend/nestjs-api-mysql/.cursor/agents/test-runner.md +57 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/autoTestOnStop.ts +127 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/blockDangerous.ts +98 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/ensureTestsExist.ts +405 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/formatOnEdit.ts +70 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/protectSecrets.ts +101 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/sessionInit.ts +104 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks/validatePrisma.ts +121 -0
- package/templates/backend/nestjs-api-mysql/.cursor/hooks.json +46 -0
- package/templates/backend/nestjs-api-mysql/README.md +26 -0
- package/templates/backend/nestjs-api-mysql/dist/tsconfig.build.tsbuildinfo +1 -1
- package/templates/backend/nestjs-api-mysql/eslint.config.mjs +1 -1
- package/templates/backend/nestjs-api-mysql/package.json +7 -7
- package/templates/backend/nestjs-api-postgres/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/templates/backend/nestjs-api-postgres/.cursor/agents/prisma-guardian.md +62 -0
- package/templates/backend/nestjs-api-postgres/.cursor/agents/security-auditor.md +71 -0
- package/templates/backend/nestjs-api-postgres/.cursor/agents/test-runner.md +58 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/auto-retry.ts +62 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/block-dangerous.ts +202 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/format-and-validate.ts +124 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/protect-secrets.ts +105 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks/session-context.ts +130 -0
- package/templates/backend/nestjs-api-postgres/.cursor/hooks.json +36 -0
- package/templates/backend/nestjs-api-postgres/eslint.config.mjs +1 -1
- package/templates/backend/nestjs-api-postgres/package.json +6 -6
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/code-reviewer.md +153 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/nestjs-architect.md +138 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/prisma-analyst.md +164 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/security-auditor.md +150 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/agents/test-engineer.md +290 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/auto-format.ts +80 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/block-dangerous-commands.ts +144 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/prisma-schema-watcher.ts +64 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/protect-sensitive-files.ts +122 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks/session-context.ts +105 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/hooks.json +18 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/conventional-commits/SKILL.md +318 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/docker/SKILL.md +82 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/jest/SKILL.md +72 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/logging-best-practices/SKILL.md +127 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/prisma-database-setup/SKILL.md +186 -0
- package/templates/backend/nestjs-api-sqlite/.cursor/skills/quality-gates-enforcer/SKILL.md +301 -0
- package/templates/backend/nestjs-api-sqlite/README.md +34 -1
- package/templates/backend/nestjs-api-sqlite/eslint.config.mjs +1 -1
- package/templates/backend/nestjs-api-sqlite/package.json +6 -6
- package/templates/backend/nestjs-api-sqlite/prisma/schema.prisma +1 -0
- package/templates/backend/nestjs-api-sqlite/prisma/seed.ts +2 -2
- package/templates/backend/nestjs-api-sqlite/src/posts/dto/post-response.dto.ts +5 -1
- package/templates/backend/nestjs-api-sqlite/src/users/dto/profile-response.dto.ts +1 -1
- package/templates/backend/nestjs-api-sqlite/src/users/dto/update-profile.dto.ts +1 -1
- package/templates/backend/nestjs-api-sqlite/src/users/dto/user-response.dto.ts +4 -0
- package/templates/backend/nestjs-api-sqlite/src/users/profile.service.ts +24 -8
- package/templates/backend/nestjs-api-sqlite/src/users/users.service.ts +1 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/agents/nestjs-code-reviewer.md +54 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/agents/prisma-guardian.md +67 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/agents/test-runner.md +57 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/commands/new-endpoint.md +209 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/commands/new-model.md +201 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/autoTestOnStop.ts +127 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/blockDangerous.ts +98 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/ensureTestsExist.ts +405 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/formatOnEdit.ts +70 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/protectSecrets.ts +101 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/sessionInit.ts +104 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks/validatePrisma.ts +121 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/hooks.json +46 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/api-rest.mdc +126 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/authentication-security.mdc +86 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/dto-validation.mdc +93 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/general-rules.mdc +126 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/nestjs-architecture.mdc +83 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/prisma-standards.mdc +111 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/rules/swagger-documentation.mdc +90 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/api-security-best-practices/SKILL.md +907 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/docker-expert/SKILL.md +409 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-expert/SKILL.md +552 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-the-best-practices/AGENTS.md +5958 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/nestjs-the-best-practices/SKILL.md +130 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/nodejs-best-practices/SKILL.md +333 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/prisma-expert/SKILL.md +355 -0
- package/templates/backend/nestjs-api-sqlserver/.cursor/skills/sqlserver-table-design/SKILL.md +125 -0
- package/templates/backend/nestjs-api-sqlserver/.dockerignore +50 -0
- package/templates/backend/nestjs-api-sqlserver/.env.example +17 -0
- package/templates/backend/nestjs-api-sqlserver/.env.test +17 -0
- package/templates/backend/nestjs-api-sqlserver/.prettierrc +4 -0
- package/templates/backend/nestjs-api-sqlserver/README.md +587 -0
- package/templates/backend/nestjs-api-sqlserver/docker-compose.yml +24 -0
- package/templates/backend/nestjs-api-sqlserver/eslint.config.mjs +41 -0
- package/templates/backend/nestjs-api-sqlserver/nest-cli.json +8 -0
- package/templates/backend/nestjs-api-sqlserver/package.json +107 -0
- package/templates/backend/nestjs-api-sqlserver/prisma/schema.prisma +70 -0
- package/templates/backend/nestjs-api-sqlserver/prisma/seed.ts +215 -0
- package/templates/backend/nestjs-api-sqlserver/prisma.config.ts +12 -0
- package/templates/backend/nestjs-api-sqlserver/scripts/check-docker.js +64 -0
- package/templates/backend/nestjs-api-sqlserver/src/app.module.ts +39 -0
- package/templates/backend/nestjs-api-sqlserver/src/app.service.ts +8 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/auth.controller.ts +36 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/auth.module.ts +22 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/auth.service.ts +64 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/decorators/roles.decorator.ts +5 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/dto/login-response.dto.ts +23 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/dto/login.dto.ts +27 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/enums/role.enum.ts +5 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/guards/jwt-auth.guard.ts +20 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/guards/roles.guard.ts +23 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/strategies/jwt.strategy.ts +32 -0
- package/templates/backend/nestjs-api-sqlserver/src/auth/types.ts +18 -0
- package/templates/backend/nestjs-api-sqlserver/src/common/dto/paginated-response.dto.ts +16 -0
- package/templates/backend/nestjs-api-sqlserver/src/common/dto/pagination.dto.ts +31 -0
- package/templates/backend/nestjs-api-sqlserver/src/common/filters/http-exception.filter.ts +53 -0
- package/templates/backend/nestjs-api-sqlserver/src/config/env.validation.ts +41 -0
- package/templates/backend/nestjs-api-sqlserver/src/health/health.controller.ts +35 -0
- package/templates/backend/nestjs-api-sqlserver/src/health/health.module.ts +7 -0
- package/templates/backend/nestjs-api-sqlserver/src/main.ts +87 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/dto/create-post.dto.ts +32 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/dto/post-response.dto.ts +41 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/dto/update-post.dto.ts +31 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/posts.controller.ts +161 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/posts.module.ts +12 -0
- package/templates/backend/nestjs-api-sqlserver/src/posts/posts.service.ts +171 -0
- package/templates/backend/nestjs-api-sqlserver/src/prisma/prisma.module.ts +9 -0
- package/templates/backend/nestjs-api-sqlserver/src/prisma/prisma.service.ts +62 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/constants/settings.constants.ts +9 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/dto/profile-response.dto.ts +39 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/dto/settings-response.dto.ts +18 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/dto/update-profile.dto.ts +48 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/dto/update-settings.dto.ts +40 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/dto/user-response.dto.ts +18 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/profile.service.ts +67 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/settings.service.ts +77 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/users.controller.ts +102 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/users.module.ts +14 -0
- package/templates/backend/nestjs-api-sqlserver/src/users/users.service.ts +27 -0
- package/templates/backend/nestjs-api-sqlserver/test/README.md +412 -0
- package/templates/backend/nestjs-api-sqlserver/test/e2e/auth.e2e-spec.ts +147 -0
- package/templates/backend/nestjs-api-sqlserver/test/e2e/health.e2e-spec.ts +62 -0
- package/templates/backend/nestjs-api-sqlserver/test/e2e/posts.e2e-spec.ts +407 -0
- package/templates/backend/nestjs-api-sqlserver/test/e2e/users.e2e-spec.ts +287 -0
- package/templates/backend/nestjs-api-sqlserver/test/fixtures/test-data.ts +109 -0
- package/templates/backend/nestjs-api-sqlserver/test/helpers/auth.helper.ts +54 -0
- package/templates/backend/nestjs-api-sqlserver/test/helpers/db.helper.ts +68 -0
- package/templates/backend/nestjs-api-sqlserver/test/jest-e2e.json +12 -0
- package/templates/backend/nestjs-api-sqlserver/test/setup-e2e.ts +8 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/app.service.spec.ts +24 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/auth.controller.spec.ts +91 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/auth.service.spec.ts +161 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/health.controller.spec.ts +78 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/http-exception.filter.spec.ts +150 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/jwt-auth.guard.spec.ts +50 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/jwt.strategy.spec.ts +41 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/posts.controller.spec.ts +249 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/posts.service.spec.ts +328 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/profile.service.spec.ts +146 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/settings.service.spec.ts +242 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/users.controller.spec.ts +178 -0
- package/templates/backend/nestjs-api-sqlserver/test/unit/users.service.spec.ts +96 -0
- package/templates/backend/nestjs-api-sqlserver/tsconfig.build.json +4 -0
- package/templates/backend/nestjs-api-sqlserver/tsconfig.json +28 -0
- package/templates/cursor/.cursor/commands/configurar-cursor.md +763 -0
- package/templates/cursor/.cursor/skills/create-huenei-subagent/SKILL.md +223 -0
- package/templates/cursor/.cursor/skills/create-huenei-subagent/examples.md +236 -0
- package/templates/cursor/.cursor/skills/cursor-hooks/SKILL.md +1100 -0
- package/templates/cursor/.cursor/skills/find-skills/SKILL.md +133 -0
- package/templates/frontend/angular-base/.cursor/agents/accessibility-reviewer.md +67 -0
- package/templates/frontend/angular-base/.cursor/agents/angular-code-reviewer.md +60 -0
- package/templates/frontend/angular-base/.cursor/agents/qa-test-expert.md +70 -0
- package/templates/frontend/angular-base/.cursor/agents/security-auditor.md +58 -0
- package/templates/frontend/angular-base/.cursor/hooks/auto-format.ts +70 -0
- package/templates/frontend/angular-base/.cursor/hooks/auto-test-on-stop.ts +113 -0
- package/templates/frontend/angular-base/.cursor/hooks/block-dangerous-commands.ts +160 -0
- package/templates/frontend/angular-base/.cursor/hooks/ensure-tests-exist.ts +363 -0
- package/templates/frontend/angular-base/.cursor/hooks/protect-sensitive-files.ts +118 -0
- package/templates/frontend/angular-base/.cursor/hooks/session-context.ts +110 -0
- package/templates/frontend/angular-base/.cursor/hooks.json +41 -0
- package/templates/frontend/angular-nx/.cursor/agents/angular-code-reviewer.md +64 -0
- package/templates/frontend/angular-nx/.cursor/agents/nx-architecture-guardian.md +69 -0
- package/templates/frontend/angular-nx/.cursor/agents/qa-test-expert.md +75 -0
- package/templates/frontend/angular-nx/.cursor/agents/security-auditor.md +61 -0
- package/templates/frontend/angular-nx/.cursor/hooks/auto-format.ts +70 -0
- package/templates/frontend/angular-nx/.cursor/hooks/auto-test-on-stop.ts +115 -0
- package/templates/frontend/angular-nx/.cursor/hooks/block-dangerous-commands.ts +188 -0
- package/templates/frontend/angular-nx/.cursor/hooks/ensure-tests-exist.ts +399 -0
- package/templates/frontend/angular-nx/.cursor/hooks/protect-sensitive-files.ts +128 -0
- package/templates/frontend/angular-nx/.cursor/hooks/session-context.ts +121 -0
- package/templates/frontend/angular-nx/.cursor/hooks.json +41 -0
- package/templates/frontend/react-vite/.cursor/agents/frontend-senior.agent.md +49 -49
- package/templates/frontend/react-vite/.cursor/agents/qa-test-expert.agent.md +126 -49
- package/templates/frontend/react-vite/.cursor/agents/security-expert.agent.md +39 -39
- package/templates/frontend/react-vite/.cursor/agents/ux-ui-expert.agent.md +45 -45
- package/templates/frontend/react-vite/.cursor/hooks/autoTestOnStop.ts +117 -0
- package/templates/frontend/react-vite/.cursor/hooks/blockDangerous.ts +75 -0
- package/templates/frontend/react-vite/.cursor/hooks/ensureTestsExist.ts +306 -220
- package/templates/frontend/react-vite/.cursor/hooks/formatOnEdit.ts +49 -0
- package/templates/frontend/react-vite/.cursor/hooks/protectSecrets.ts +88 -0
- package/templates/frontend/react-vite/.cursor/hooks/sessionInit.ts +77 -0
- package/templates/frontend/react-vite/.cursor/hooks.json +41 -10
- package/templates/frontend/react-vite/.cursor/settings.json +13 -13
- package/templates/frontend/react-vite/.vscode/settings.json +31 -31
- package/templates/frontend/react-vite/README.md +34 -34
- package/templates/frontend/react-vite/package.json +82 -82
- package/templates/frontend/react-vite/pnpm-lock.yaml +6575 -6575
- package/templates/frontend/react-vite/src/__tests__/components/layout/navbar.test.tsx +63 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/avatar.test.tsx +74 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/badge.test.tsx +55 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/breadcrumb.test.tsx +140 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/button.test.tsx +121 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/card.test.tsx +144 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/dialog.test.tsx +121 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/form.test.tsx +165 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/input.test.tsx +52 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/label.test.tsx +40 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/password-input.test.tsx +59 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/separator.test.tsx +40 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/table.test.tsx +254 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/tabs.test.tsx +82 -0
- package/templates/frontend/react-vite/src/__tests__/components/ui/textarea.test.tsx +47 -0
- package/templates/frontend/react-vite/src/__tests__/helpers/render.tsx +114 -0
- package/templates/frontend/react-vite/src/__tests__/hooks/useLocalStorage.test.ts +95 -0
- package/templates/frontend/react-vite/src/__tests__/lib/queryClient.test.ts +24 -0
- package/templates/frontend/react-vite/src/__tests__/lib/utils.test.ts +43 -0
- package/templates/frontend/react-vite/src/__tests__/routes/index.test.tsx +111 -0
- package/templates/frontend/react-vite/src/__tests__/routes/otra-ruta.test.tsx +126 -0
- package/templates/frontend/react-vite/src/__tests__/routes/root.test.tsx +78 -0
- package/templates/frontend/react-vite/src/__tests__/routes/ui-components.test.tsx +286 -0
- package/templates/frontend/react-vite/src/components/layout/navbar.tsx +38 -38
- package/templates/frontend/react-vite/src/components/ui/avatar.tsx +42 -42
- package/templates/frontend/react-vite/src/components/ui/dialog.tsx +122 -122
- package/templates/frontend/react-vite/src/components/ui/table.tsx +229 -244
- package/templates/frontend/react-vite/src/hooks/useLocalStorage.ts +32 -32
- package/templates/frontend/react-vite/src/routes/__root.tsx +48 -48
- package/templates/frontend/react-vite/src/routes/ui-components.tsx +359 -85
- package/templates/frontend/react-vite/src/test/setup.ts +24 -24
- package/templates/frontend/react-vite/vite.config.ts +2 -2
- package/templates/frontend/react-vite/vitest.config.ts +13 -2
- package/templates/frontend/react-vite-help/.cursor/RECONSTRUCTION-PROMPT.md +738 -0
package/dist/config/templates.js
CHANGED
|
@@ -41,6 +41,13 @@ export const TEMPLATE_CATALOG = [
|
|
|
41
41
|
category: "backend",
|
|
42
42
|
path: "backend/nestjs-api-mysql",
|
|
43
43
|
},
|
|
44
|
+
{
|
|
45
|
+
id: "nestjs-api-sqlserver",
|
|
46
|
+
name: "NestJS API + SQL Server",
|
|
47
|
+
description: "API NestJS para desarrollo backend con SQL Server y Docker. Ideal para desarrollo de APIs empresariales.",
|
|
48
|
+
category: "backend",
|
|
49
|
+
path: "backend/nestjs-api-sqlserver",
|
|
50
|
+
},
|
|
44
51
|
{
|
|
45
52
|
id: "angular-base",
|
|
46
53
|
name: "Angular Base",
|
|
@@ -54,6 +61,13 @@ export const TEMPLATE_CATALOG = [
|
|
|
54
61
|
description: "Monorepo Angular con Nx para arquitectura escalable de micro-frontends. Ideal para proyectos empresariales.",
|
|
55
62
|
category: "frontend",
|
|
56
63
|
path: "frontend/angular-nx",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "cursor-config",
|
|
67
|
+
name: "Cursor Configuration",
|
|
68
|
+
description: "Rules, skills, commands, agents y hooks para desarrollo asistido por IA con Cursor",
|
|
69
|
+
category: "cursor",
|
|
70
|
+
path: "cursor",
|
|
57
71
|
}
|
|
58
72
|
];
|
|
59
73
|
export function getTemplatesByCategory(category) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from "path";
|
|
1
2
|
import { mkdir, cp, rm, access } from "fs/promises";
|
|
2
3
|
import { constants } from "fs";
|
|
3
4
|
export async function ensureDirectory(dirPath) {
|
|
@@ -23,3 +24,17 @@ export async function directoryExists(dirPath) {
|
|
|
23
24
|
return false;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
export async function copyToExistingDir(source, dest) {
|
|
28
|
+
await ensureDirectory(dest);
|
|
29
|
+
await cp(source, dest, { recursive: true, force: true });
|
|
30
|
+
}
|
|
31
|
+
export async function mergeSubdirectories(source, dest, subdirs) {
|
|
32
|
+
for (const subdir of subdirs) {
|
|
33
|
+
const srcPath = path.join(source, subdir);
|
|
34
|
+
const destPath = path.join(dest, subdir);
|
|
35
|
+
if (await directoryExists(srcPath)) {
|
|
36
|
+
await ensureDirectory(destPath);
|
|
37
|
+
await cp(srcPath, destPath, { recursive: true, force: true });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
package/dist/core/prompts.js
CHANGED
|
@@ -2,113 +2,83 @@ import prompts from "prompts";
|
|
|
2
2
|
import { getTemplatesByCategory, getAvailableCategories } from "../config/templates.js";
|
|
3
3
|
const BACK_OPTION = "<<<BACK>>>";
|
|
4
4
|
const BACK_LABEL = "← Volver";
|
|
5
|
+
const onCancel = () => {
|
|
6
|
+
throw new Error("USER_CANCELLED");
|
|
7
|
+
};
|
|
5
8
|
export async function askProjectSetup() {
|
|
6
|
-
// Step 1: Project Name (no back option - first step)
|
|
7
|
-
const nameResponse = await prompts({
|
|
8
|
-
type: "text",
|
|
9
|
-
name: "projectName",
|
|
10
|
-
message: "Project name",
|
|
11
|
-
initial: "my-project",
|
|
12
|
-
validate: (value) => {
|
|
13
|
-
if (!value || value.trim().length === 0) {
|
|
14
|
-
return "Project name is required";
|
|
15
|
-
}
|
|
16
|
-
if (!/^[a-z0-9-_]+$/i.test(value)) {
|
|
17
|
-
return "Project name can only contain letters, numbers, hyphens and underscores";
|
|
18
|
-
}
|
|
19
|
-
return true;
|
|
20
|
-
},
|
|
21
|
-
}, {
|
|
22
|
-
onCancel: () => {
|
|
23
|
-
throw new Error("USER_CANCELLED");
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
if (!nameResponse.projectName) {
|
|
27
|
-
throw new Error("USER_CANCELLED");
|
|
28
|
-
}
|
|
29
|
-
const projectName = nameResponse.projectName;
|
|
30
|
-
// Step 2 & 3: Category and Template Selection (with back navigation)
|
|
31
9
|
let category = null;
|
|
32
10
|
let templateId = "";
|
|
33
11
|
while (!templateId) {
|
|
34
|
-
// Step 2: Category Selection (no back option)
|
|
35
12
|
if (!category) {
|
|
36
|
-
|
|
37
|
-
const choices = categories.map((cat) => ({
|
|
38
|
-
title: cat.charAt(0).toUpperCase() + cat.slice(1),
|
|
39
|
-
value: cat,
|
|
40
|
-
}));
|
|
41
|
-
const categoryResponse = await prompts({
|
|
42
|
-
type: "select",
|
|
43
|
-
name: "category",
|
|
44
|
-
message: "Select project category",
|
|
45
|
-
choices,
|
|
46
|
-
initial: 0,
|
|
47
|
-
}, {
|
|
48
|
-
onCancel: () => {
|
|
49
|
-
throw new Error("USER_CANCELLED");
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
if (!categoryResponse.category) {
|
|
53
|
-
throw new Error("USER_CANCELLED");
|
|
54
|
-
}
|
|
55
|
-
category = categoryResponse.category;
|
|
13
|
+
category = await askCategorySelection();
|
|
56
14
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
...templates.map((template) => ({
|
|
61
|
-
title: template.name,
|
|
62
|
-
description: template.description,
|
|
63
|
-
value: template.id,
|
|
64
|
-
})),
|
|
65
|
-
{
|
|
66
|
-
title: BACK_LABEL,
|
|
67
|
-
value: BACK_OPTION,
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
const templateResponse = await prompts({
|
|
71
|
-
type: "select",
|
|
72
|
-
name: "templateId",
|
|
73
|
-
message: "Select template",
|
|
74
|
-
choices,
|
|
75
|
-
initial: 0, // Start at first template, not at back option
|
|
76
|
-
}, {
|
|
77
|
-
onCancel: () => {
|
|
78
|
-
throw new Error("USER_CANCELLED");
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
if (!templateResponse.templateId) {
|
|
82
|
-
throw new Error("USER_CANCELLED");
|
|
15
|
+
if (category === "cursor") {
|
|
16
|
+
const installScope = await askCursorInstallScope();
|
|
17
|
+
return { mode: "cursor", installScope };
|
|
83
18
|
}
|
|
84
|
-
|
|
85
|
-
|
|
19
|
+
const result = await askTemplateSelection(category);
|
|
20
|
+
if (result === BACK_OPTION) {
|
|
86
21
|
category = null;
|
|
87
|
-
continue;
|
|
22
|
+
continue;
|
|
88
23
|
}
|
|
89
|
-
templateId =
|
|
24
|
+
templateId = result;
|
|
90
25
|
}
|
|
91
|
-
|
|
26
|
+
const projectName = await askProjectName();
|
|
92
27
|
const pnpmResponse = await prompts({
|
|
93
28
|
type: "confirm",
|
|
94
29
|
name: "checkPnpm",
|
|
95
30
|
message: "Check / install pnpm?",
|
|
96
31
|
initial: true,
|
|
97
|
-
}, {
|
|
98
|
-
onCancel: () => {
|
|
99
|
-
throw new Error("USER_CANCELLED");
|
|
100
|
-
},
|
|
101
|
-
});
|
|
32
|
+
}, { onCancel });
|
|
102
33
|
const checkPnpm = pnpmResponse.checkPnpm ?? true;
|
|
103
34
|
return {
|
|
35
|
+
mode: "project",
|
|
104
36
|
projectName,
|
|
105
|
-
category: category, // We know it's not null here
|
|
106
37
|
templateId,
|
|
107
38
|
checkPnpm,
|
|
108
39
|
};
|
|
109
40
|
}
|
|
110
|
-
|
|
111
|
-
|
|
41
|
+
async function askCategorySelection() {
|
|
42
|
+
const categories = getAvailableCategories();
|
|
43
|
+
const choices = categories.map((cat) => ({
|
|
44
|
+
title: cat.charAt(0).toUpperCase() + cat.slice(1),
|
|
45
|
+
value: cat,
|
|
46
|
+
}));
|
|
47
|
+
const response = await prompts({
|
|
48
|
+
type: "select",
|
|
49
|
+
name: "category",
|
|
50
|
+
message: "Select project category",
|
|
51
|
+
choices,
|
|
52
|
+
initial: 0,
|
|
53
|
+
}, { onCancel });
|
|
54
|
+
if (!response.category) {
|
|
55
|
+
throw new Error("USER_CANCELLED");
|
|
56
|
+
}
|
|
57
|
+
return response.category;
|
|
58
|
+
}
|
|
59
|
+
async function askTemplateSelection(category) {
|
|
60
|
+
const templates = getTemplatesByCategory(category);
|
|
61
|
+
const choices = [
|
|
62
|
+
...templates.map((template) => ({
|
|
63
|
+
title: template.name,
|
|
64
|
+
description: template.description,
|
|
65
|
+
value: template.id,
|
|
66
|
+
})),
|
|
67
|
+
{ title: BACK_LABEL, value: BACK_OPTION },
|
|
68
|
+
];
|
|
69
|
+
const response = await prompts({
|
|
70
|
+
type: "select",
|
|
71
|
+
name: "templateId",
|
|
72
|
+
message: "Select template",
|
|
73
|
+
choices,
|
|
74
|
+
initial: 0,
|
|
75
|
+
}, { onCancel });
|
|
76
|
+
if (!response.templateId) {
|
|
77
|
+
throw new Error("USER_CANCELLED");
|
|
78
|
+
}
|
|
79
|
+
return response.templateId;
|
|
80
|
+
}
|
|
81
|
+
async function askProjectName() {
|
|
112
82
|
const response = await prompts({
|
|
113
83
|
type: "text",
|
|
114
84
|
name: "projectName",
|
|
@@ -123,61 +93,33 @@ export async function askProjectName() {
|
|
|
123
93
|
}
|
|
124
94
|
return true;
|
|
125
95
|
},
|
|
126
|
-
});
|
|
96
|
+
}, { onCancel });
|
|
127
97
|
if (!response.projectName) {
|
|
128
|
-
throw new Error("
|
|
98
|
+
throw new Error("USER_CANCELLED");
|
|
129
99
|
}
|
|
130
100
|
return response.projectName;
|
|
131
101
|
}
|
|
132
|
-
export async function
|
|
133
|
-
const categories = getAvailableCategories();
|
|
134
|
-
const response = await prompts({
|
|
135
|
-
type: "select",
|
|
136
|
-
name: "category",
|
|
137
|
-
message: "Select project category",
|
|
138
|
-
choices: categories.map((cat) => ({
|
|
139
|
-
title: cat.charAt(0).toUpperCase() + cat.slice(1),
|
|
140
|
-
value: cat,
|
|
141
|
-
})),
|
|
142
|
-
});
|
|
143
|
-
if (!response.category) {
|
|
144
|
-
throw new Error("Category selection is required");
|
|
145
|
-
}
|
|
146
|
-
return response.category;
|
|
147
|
-
}
|
|
148
|
-
export async function askTemplate(category) {
|
|
149
|
-
const templates = getTemplatesByCategory(category);
|
|
150
|
-
if (templates.length === 0) {
|
|
151
|
-
throw new Error(`No templates available for category: ${category}`);
|
|
152
|
-
}
|
|
102
|
+
export async function askCursorInstallScope() {
|
|
153
103
|
const response = await prompts({
|
|
154
104
|
type: "select",
|
|
155
|
-
name: "
|
|
156
|
-
message: "
|
|
157
|
-
choices:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
105
|
+
name: "scope",
|
|
106
|
+
message: "Where do you want to install Cursor configuration?",
|
|
107
|
+
choices: [
|
|
108
|
+
{
|
|
109
|
+
title: "Current project",
|
|
110
|
+
description: "Copy .cursor/ folder into the current working directory",
|
|
111
|
+
value: "project",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: "User level (~/.cursor/)",
|
|
115
|
+
description: "Merge skills/ and commands/ into your user-level Cursor config",
|
|
116
|
+
value: "user",
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
initial: 0,
|
|
120
|
+
}, { onCancel });
|
|
121
|
+
if (!response.scope) {
|
|
122
|
+
throw new Error("USER_CANCELLED");
|
|
165
123
|
}
|
|
166
|
-
return response.
|
|
167
|
-
}
|
|
168
|
-
export async function askPnpmCheck() {
|
|
169
|
-
const response = await prompts({
|
|
170
|
-
type: "confirm",
|
|
171
|
-
name: "checkPnpm",
|
|
172
|
-
message: "Check / install pnpm?",
|
|
173
|
-
initial: true,
|
|
174
|
-
});
|
|
175
|
-
return response.checkPnpm ?? true;
|
|
176
|
-
}
|
|
177
|
-
export function setupCancellationHandler(cleanup) {
|
|
178
|
-
prompts.override({ onCancel: async () => {
|
|
179
|
-
console.log("\n⚠️ Cancelled by user");
|
|
180
|
-
await cleanup();
|
|
181
|
-
process.exit(1);
|
|
182
|
-
} });
|
|
124
|
+
return response.scope;
|
|
183
125
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import os from "os";
|
|
2
3
|
import path from "path";
|
|
3
4
|
import process from "process";
|
|
4
5
|
import { execSync } from "child_process";
|
|
5
|
-
import {
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
import { askProjectSetup, askCursorInstallScope, } from "./core/prompts.js";
|
|
6
8
|
import { ensurePnpm } from "./core/dependency-manager.js";
|
|
7
9
|
import { resolveTemplatePath } from "./core/template-resolver.js";
|
|
8
|
-
import { ensureDirectory, copyTemplate, cleanupOnError, } from "./core/file-operations.js";
|
|
10
|
+
import { ensureDirectory, copyTemplate, cleanupOnError, copyToExistingDir, mergeSubdirectories, directoryExists, } from "./core/file-operations.js";
|
|
9
11
|
import { formatError } from "./core/errors.js";
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const CURSOR_TEMPLATE_SOURCE = path.resolve(__dirname, "../templates/cursor/.cursor");
|
|
15
|
+
const CURSOR_MERGE_SUBDIRS = ["skills", "commands"];
|
|
16
|
+
function hasCursorFlag() {
|
|
17
|
+
return process.argv.includes("--cursor");
|
|
18
|
+
}
|
|
10
19
|
function initializeGit(projectDir) {
|
|
11
20
|
try {
|
|
12
21
|
execSync("git init", {
|
|
@@ -42,31 +51,67 @@ function displaySuccessMessage(projectName, pnpmWasJustInstalled) {
|
|
|
42
51
|
console.log("\n✨ Thanks for using create-huenei-template");
|
|
43
52
|
console.log("🚀 Happy coding!\n");
|
|
44
53
|
}
|
|
54
|
+
function displayCursorSuccessMessage(scope, targetPath) {
|
|
55
|
+
console.log("\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
|
|
56
|
+
console.log("🎉 Cursor configuration installed!");
|
|
57
|
+
console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
|
|
58
|
+
if (scope === "project") {
|
|
59
|
+
console.log(` Installed in: ${targetPath}`);
|
|
60
|
+
console.log(" Content: skills, commands");
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
console.log(` Installed in: ${targetPath}`);
|
|
64
|
+
console.log(` Merged: ${CURSOR_MERGE_SUBDIRS.join(", ")}`);
|
|
65
|
+
}
|
|
66
|
+
console.log("\n✨ Thanks for using create-huenei-template");
|
|
67
|
+
console.log("🚀 Happy coding!\n");
|
|
68
|
+
}
|
|
69
|
+
async function handleCursorInstall(scope) {
|
|
70
|
+
if (scope === "project") {
|
|
71
|
+
const dest = path.join(process.cwd(), ".cursor");
|
|
72
|
+
if (await directoryExists(dest)) {
|
|
73
|
+
console.log(`\n⚠️ .cursor/ already exists in ${process.cwd()}`);
|
|
74
|
+
console.log(" Existing files with the same name will be overwritten.\n");
|
|
75
|
+
}
|
|
76
|
+
console.log("\n📦 Installing Cursor configuration...");
|
|
77
|
+
await copyToExistingDir(CURSOR_TEMPLATE_SOURCE, dest);
|
|
78
|
+
displayCursorSuccessMessage("project", dest);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
const userCursorDir = path.join(os.homedir(), ".cursor");
|
|
82
|
+
console.log("\n📦 Merging Cursor configuration...");
|
|
83
|
+
await mergeSubdirectories(CURSOR_TEMPLATE_SOURCE, userCursorDir, CURSOR_MERGE_SUBDIRS);
|
|
84
|
+
displayCursorSuccessMessage("user", userCursorDir);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
45
87
|
async function main() {
|
|
46
88
|
let targetDir = "";
|
|
47
89
|
try {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
90
|
+
if (hasCursorFlag()) {
|
|
91
|
+
const installScope = await askCursorInstallScope();
|
|
92
|
+
await handleCursorInstall(installScope);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const setup = await askProjectSetup();
|
|
96
|
+
if (setup.mode === "cursor") {
|
|
97
|
+
await handleCursorInstall(setup.installScope);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const { projectName, templateId, checkPnpm } = setup;
|
|
51
101
|
let pnpmWasJustInstalled = false;
|
|
52
102
|
if (checkPnpm) {
|
|
53
103
|
const result = await ensurePnpm();
|
|
54
104
|
pnpmWasJustInstalled = result.wasJustInstalled;
|
|
55
105
|
}
|
|
56
|
-
// Prepare target directory
|
|
57
106
|
targetDir = path.resolve(process.cwd(), projectName);
|
|
58
107
|
await ensureDirectory(targetDir);
|
|
59
|
-
// Resolve and copy template
|
|
60
108
|
const templatePath = resolveTemplatePath(templateId);
|
|
61
109
|
await copyTemplate(templatePath, targetDir);
|
|
62
|
-
// Initialize git repository
|
|
63
110
|
console.log("\n📦 Setting up project...");
|
|
64
111
|
initializeGit(targetDir);
|
|
65
|
-
// Success!
|
|
66
112
|
displaySuccessMessage(projectName, pnpmWasJustInstalled);
|
|
67
113
|
}
|
|
68
114
|
catch (error) {
|
|
69
|
-
// Handle user cancellation gracefully
|
|
70
115
|
if (error instanceof Error && error.message === "USER_CANCELLED") {
|
|
71
116
|
console.log("\n⚠️ Cancelled by user");
|
|
72
117
|
if (targetDir) {
|
|
@@ -75,7 +120,6 @@ async function main() {
|
|
|
75
120
|
process.exit(1);
|
|
76
121
|
}
|
|
77
122
|
console.error(`\n${formatError(error)}`);
|
|
78
|
-
// Cleanup on error
|
|
79
123
|
if (targetDir) {
|
|
80
124
|
await cleanupOnError(targetDir);
|
|
81
125
|
}
|
package/dist/templates/README.md
CHANGED
|
@@ -15,6 +15,7 @@ Catálogo completo de templates disponibles en el CLI `create-huenei-template`.
|
|
|
15
15
|
| Backend | [nestjs-api-sqlite](backend/nestjs-api-sqlite/) | NestJS 11 + Prisma 7 + SQLite | Desarrollo rápido, demos, prototipos |
|
|
16
16
|
| Backend | [nestjs-api-postgres](backend/nestjs-api-postgres/) | NestJS 11 + Prisma 7 + PostgreSQL 16 | Producción empresarial |
|
|
17
17
|
| Backend | [nestjs-api-mysql](backend/nestjs-api-mysql/) | NestJS 11 + Prisma 7 + MySQL 8.0 | Producción con ecosistema MySQL |
|
|
18
|
+
| Backend | [nestjs-api-sqlserver](backend/nestjs-api-sqlserver/) | NestJS 11 + Prisma 7 + SQL Server 2022 | Producción con ecosistema Microsoft |
|
|
18
19
|
| Mobile | [expo-base](mobile/expo-base/) | Expo 54 + React Native 0.81 | App móvil profesional multiplataforma |
|
|
19
20
|
|
|
20
21
|
---
|
|
@@ -65,6 +66,7 @@ Templates para APIs REST empresariales. Todos comparten la misma arquitectura ba
|
|
|
65
66
|
| [nestjs-api-sqlite](backend/nestjs-api-sqlite/) | SQLite | No | `@prisma/adapter-libsql` | Requiere migración |
|
|
66
67
|
| [nestjs-api-postgres](backend/nestjs-api-postgres/) | PostgreSQL 16 | Sí | `@prisma/adapter-pg` | Sí |
|
|
67
68
|
| [nestjs-api-mysql](backend/nestjs-api-mysql/) | MySQL 8.0 | Sí | `@prisma/adapter-mariadb` | Sí |
|
|
69
|
+
| [nestjs-api-sqlserver](backend/nestjs-api-sqlserver/) | SQL Server 2022 | Sí | `@prisma/adapter-mssql` | Sí |
|
|
68
70
|
|
|
69
71
|
### Stack compartido backend
|
|
70
72
|
|
|
@@ -94,6 +96,10 @@ PostgreSQL 16 vía Docker Compose. Soporte completo de ACID, índices avanzados,
|
|
|
94
96
|
|
|
95
97
|
MySQL 8.0 vía Docker Compose. Validación automática de Docker antes de iniciar. Excelente rendimiento en queries de lectura.
|
|
96
98
|
|
|
99
|
+
### nestjs-api-sqlserver
|
|
100
|
+
|
|
101
|
+
SQL Server 2022 vía Docker Compose. Validación automática de Docker antes de iniciar. Enterprise-ready con integración nativa al ecosistema Microsoft. Nota: SQL Server no soporta enums nativos en Prisma (usa String + TypeScript enum local).
|
|
102
|
+
|
|
97
103
|
---
|
|
98
104
|
|
|
99
105
|
## Mobile
|
|
@@ -151,6 +157,6 @@ Los templates de frontend React además incluyen:
|
|
|
151
157
|
|
|
152
158
|
**¿App web con Angular?** → `angular-base` (SPA simple) o `angular-nx` (monorepo empresarial)
|
|
153
159
|
|
|
154
|
-
**¿API REST?** → `nestjs-api-sqlite` (sin infraestructura) o `nestjs-api-postgres` / `nestjs-api-mysql` (producción)
|
|
160
|
+
**¿API REST?** → `nestjs-api-sqlite` (sin infraestructura) o `nestjs-api-postgres` / `nestjs-api-mysql` / `nestjs-api-sqlserver` (producción)
|
|
155
161
|
|
|
156
162
|
**¿App móvil?** → `expo-base` (iOS + Android + Web)
|
|
@@ -11,12 +11,13 @@ Templates de Huenei para APIs REST empresariales. Todos comparten la misma arqui
|
|
|
11
11
|
| [nestjs-api-sqlite](nestjs-api-sqlite/) | SQLite | No | `@prisma/adapter-libsql` | `@libsql/client` | Desarrollo rápido, demos, prototipos |
|
|
12
12
|
| [nestjs-api-postgres](nestjs-api-postgres/) | PostgreSQL 16 | Sí | `@prisma/adapter-pg` | `pg` | Producción empresarial, features avanzados |
|
|
13
13
|
| [nestjs-api-mysql](nestjs-api-mysql/) | MySQL 8.0 | Sí | `@prisma/adapter-mariadb` | `mariadb` | Producción con ecosistema MySQL/MariaDB |
|
|
14
|
+
| [nestjs-api-sqlserver](nestjs-api-sqlserver/) | SQL Server 2022 | Sí | `@prisma/adapter-mssql` | (built-in) | Producción con ecosistema Microsoft |
|
|
14
15
|
|
|
15
16
|
---
|
|
16
17
|
|
|
17
18
|
## Stack Compartido
|
|
18
19
|
|
|
19
|
-
Los
|
|
20
|
+
Los cuatro templates comparten exactamente el mismo stack base y la misma estructura de código:
|
|
20
21
|
|
|
21
22
|
| Tecnología | Versión | Descripción |
|
|
22
23
|
|------------|---------|-------------|
|
|
@@ -77,18 +78,27 @@ MySQL 8.0 vía Docker Compose. Incluye validación automática de Docker antes d
|
|
|
77
78
|
|
|
78
79
|
**Elegir cuando:** el proyecto requiere MySQL/MariaDB, la infraestructura existente usa MySQL o hay preferencia organizacional por este motor.
|
|
79
80
|
|
|
81
|
+
### nestjs-api-sqlserver
|
|
82
|
+
|
|
83
|
+
SQL Server 2022 vía Docker Compose. Incluye validación automática de Docker antes de iniciar el servidor de desarrollo. Enterprise-ready con integración nativa al ecosistema Microsoft.
|
|
84
|
+
|
|
85
|
+
**Elegir cuando:** el proyecto requiere SQL Server, la infraestructura existente usa Microsoft SQL Server, Azure SQL o hay preferencia organizacional por el ecosistema Microsoft.
|
|
86
|
+
|
|
87
|
+
**Nota:** SQL Server no soporta enums nativos en Prisma. Los roles se manejan como `String` en el schema con un enum TypeScript local para type-safety.
|
|
88
|
+
|
|
80
89
|
---
|
|
81
90
|
|
|
82
91
|
## Diferencias Clave
|
|
83
92
|
|
|
84
|
-
| Característica | SQLite | PostgreSQL | MySQL |
|
|
85
|
-
|
|
86
|
-
| Requiere Docker | No | Sí | Sí |
|
|
87
|
-
| Validación de Docker en `start:dev` | No | No | Sí |
|
|
88
|
-
| Archivo `.env.example` | `DATABASE_URL=file:./prisma/dev.db` | URL con credenciales PostgreSQL | URL con credenciales MySQL |
|
|
89
|
-
| `docker-compose.yml` | No existe | `postgres:16-alpine` | `mysql:8.0` |
|
|
90
|
-
| Healthcheck | N/A | `pg_isready` | `mysqladmin ping` |
|
|
91
|
-
|
|
|
93
|
+
| Característica | SQLite | PostgreSQL | MySQL | SQL Server |
|
|
94
|
+
|---------------|--------|------------|-------|------------|
|
|
95
|
+
| Requiere Docker | No | Sí | Sí | Sí |
|
|
96
|
+
| Validación de Docker en `start:dev` | No | No | Sí | Sí |
|
|
97
|
+
| Archivo `.env.example` | `DATABASE_URL=file:./prisma/dev.db` | URL con credenciales PostgreSQL | URL con credenciales MySQL | URL con credenciales SQL Server |
|
|
98
|
+
| `docker-compose.yml` | No existe | `postgres:16-alpine` | `mysql:8.0` | `mssql/server:2022-latest` |
|
|
99
|
+
| Healthcheck | N/A | `pg_isready` | `mysqladmin ping` | `sqlcmd` |
|
|
100
|
+
| Enums nativos Prisma | Sí | Sí | Sí | No (String + TS enum) |
|
|
101
|
+
| Producción-ready | Requiere migración | Sí | Sí | Sí |
|
|
92
102
|
|
|
93
103
|
---
|
|
94
104
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nestjs-code-reviewer
|
|
3
|
+
model: composer-1.5
|
|
4
|
+
description: Revisa código NestJS modificado contra las reglas de arquitectura, DTOs, Swagger y seguridad del proyecto. Usar proactivamente después de modificar código en src/ para garantizar cumplimiento de convenciones corporativas.
|
|
5
|
+
readonly: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a strict NestJS code reviewer for a NestJS 11 + Fastify + Prisma + MySQL API.
|
|
9
|
+
|
|
10
|
+
When invoked, review the recently modified files against these project standards:
|
|
11
|
+
|
|
12
|
+
## Review checklist
|
|
13
|
+
|
|
14
|
+
### 1. Architecture (nestjs-architecture rule)
|
|
15
|
+
- Each feature in its own module with `@Module()` decorator
|
|
16
|
+
- Controllers handle ONLY HTTP concerns (no business logic)
|
|
17
|
+
- Services contain ALL business logic with `@Injectable()`
|
|
18
|
+
- Constructor injection for all dependencies
|
|
19
|
+
- `@Global()` only for infrastructure modules (Prisma, Config)
|
|
20
|
+
|
|
21
|
+
### 2. DTOs (dto-validation rule)
|
|
22
|
+
- Every DTO field has BOTH `class-validator` decorators AND `@ApiProperty()`
|
|
23
|
+
- Optional fields use `@IsOptional()` + `@ApiProperty({ required: false })`
|
|
24
|
+
- Update DTOs extend `PartialType(CreateDto)` from `@nestjs/swagger`
|
|
25
|
+
- Response DTOs have `@ApiProperty()` on every field, no validation decorators
|
|
26
|
+
- No `id`, `createdAt`, `updatedAt` in create DTOs
|
|
27
|
+
|
|
28
|
+
### 3. Swagger (swagger-documentation rule)
|
|
29
|
+
- Every controller has `@ApiTags()`
|
|
30
|
+
- Every endpoint has `@ApiOperation()` + `@ApiResponse()` with status codes
|
|
31
|
+
- Protected endpoints have `@ApiBearerAuth('JWT-auth')`
|
|
32
|
+
- Query parameters documented with `@ApiQuery()`
|
|
33
|
+
- Response types specified in `@ApiResponse({ type: ResponseDto })`
|
|
34
|
+
|
|
35
|
+
### 4. Security (authentication-security rule)
|
|
36
|
+
- Protected endpoints use `@UseGuards(JwtAuthGuard)` + `@ApiBearerAuth('JWT-auth')`
|
|
37
|
+
- Passwords never returned in responses
|
|
38
|
+
- Passwords hashed with bcrypt before storing
|
|
39
|
+
- Public endpoints explicitly NOT guarded
|
|
40
|
+
|
|
41
|
+
### 5. Code quality (general-rules rule)
|
|
42
|
+
- No `any` types without justification
|
|
43
|
+
- Errors handled with NestJS exceptions (`NotFoundException`, `ForbiddenException`)
|
|
44
|
+
- Async/await everywhere, no `.then()` chains
|
|
45
|
+
- TypeScript strict mode compliance
|
|
46
|
+
|
|
47
|
+
## Output format
|
|
48
|
+
|
|
49
|
+
For each file reviewed, report:
|
|
50
|
+
- **File**: path
|
|
51
|
+
- **Status**: PASS or ISSUES FOUND
|
|
52
|
+
- **Issues** (if any): numbered list with rule reference, line context, and fix suggestion
|
|
53
|
+
|
|
54
|
+
End with a summary: total files reviewed, passed, issues found.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prisma-guardian
|
|
3
|
+
model: composer-1.5
|
|
4
|
+
description: Valida cambios en el schema de Prisma contra los estándares del proyecto (timestamps, cascades, índices, enums). Usar proactivamente después de modificar código en prisma/ para garantizar integridad del modelo de datos.
|
|
5
|
+
readonly: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a Prisma schema guardian for a NestJS API using Prisma ORM with MySQL.
|
|
9
|
+
|
|
10
|
+
When invoked, review `prisma/schema.prisma` and `prisma/seed.ts` against project standards.
|
|
11
|
+
|
|
12
|
+
## Validation rules
|
|
13
|
+
|
|
14
|
+
### 1. Timestamps (mandatory)
|
|
15
|
+
Every model MUST have:
|
|
16
|
+
```prisma
|
|
17
|
+
createdAt DateTime @default(now())
|
|
18
|
+
updatedAt DateTime @updatedAt
|
|
19
|
+
```
|
|
20
|
+
Flag any model missing these fields.
|
|
21
|
+
|
|
22
|
+
### 2. Cascade deletions
|
|
23
|
+
Dependent relations MUST use `onDelete: Cascade`:
|
|
24
|
+
```prisma
|
|
25
|
+
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
|
26
|
+
```
|
|
27
|
+
Flag relations without explicit `onDelete` policy.
|
|
28
|
+
|
|
29
|
+
### 3. Indexes
|
|
30
|
+
Verify indexes exist for:
|
|
31
|
+
- Fields used in WHERE clauses or JOINs
|
|
32
|
+
- Fields used in ORDER BY
|
|
33
|
+
- Composite indexes for multi-column queries
|
|
34
|
+
Use `@@index([fieldName])` syntax.
|
|
35
|
+
|
|
36
|
+
### 4. Naming conventions
|
|
37
|
+
- Model names: PascalCase, singular (`User`, not `Users`)
|
|
38
|
+
- Field names: camelCase (`createdAt`, not `created_at`)
|
|
39
|
+
- Enum names: PascalCase, values: UPPER_SNAKE_CASE
|
|
40
|
+
|
|
41
|
+
### 5. Enums
|
|
42
|
+
Type-safe enums defined at schema level:
|
|
43
|
+
```prisma
|
|
44
|
+
enum Role {
|
|
45
|
+
ADMIN
|
|
46
|
+
EDITOR
|
|
47
|
+
READER
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
Flag string fields that should be enums.
|
|
51
|
+
|
|
52
|
+
### 6. JSON fields
|
|
53
|
+
JSON only for flexible/dynamic data rarely queried. Handle defaults in application layer, not database.
|
|
54
|
+
|
|
55
|
+
### 7. Seed consistency
|
|
56
|
+
Check `prisma/seed.ts` creates data matching the current schema (correct fields, relations, enum values).
|
|
57
|
+
|
|
58
|
+
## Output format
|
|
59
|
+
|
|
60
|
+
- **Schema status**: VALID or ISSUES FOUND
|
|
61
|
+
- **Issues** (numbered): rule violated, model/field affected, fix suggestion
|
|
62
|
+
- **Migration reminder**: If schema changed, remind to run:
|
|
63
|
+
```bash
|
|
64
|
+
pnpm prisma:migrate
|
|
65
|
+
pnpm prisma:generate
|
|
66
|
+
```
|
|
67
|
+
- **Seed status**: IN SYNC or NEEDS UPDATE (with details)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-runner
|
|
3
|
+
model: composer-1.5
|
|
4
|
+
description: Ejecuta tests unitarios y E2E después de cambios en el código. Usar proactivamente después de modificar código en src/ o test/ para detectar regresiones y mantener la cobertura del proyecto.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are a test automation expert for a NestJS 11 + Fastify + Prisma + MySQL API using Jest.
|
|
8
|
+
|
|
9
|
+
When invoked, run the appropriate tests and analyze results.
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
1. **Identify scope**: Check which files were modified to decide test scope
|
|
14
|
+
- Changes in `src/{module}/` → run unit tests for that module
|
|
15
|
+
- Changes in `prisma/` → run E2E tests
|
|
16
|
+
- Changes in `test/` → run the modified test files
|
|
17
|
+
- Unsure → run all unit tests first
|
|
18
|
+
|
|
19
|
+
2. **Run unit tests**:
|
|
20
|
+
```bash
|
|
21
|
+
pnpm test -- --passWithNoTests
|
|
22
|
+
```
|
|
23
|
+
For specific modules:
|
|
24
|
+
```bash
|
|
25
|
+
pnpm test -- --testPathPattern="test/unit/{module}" --passWithNoTests
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3. **Run E2E tests** (if relevant):
|
|
29
|
+
```bash
|
|
30
|
+
pnpm test:e2e
|
|
31
|
+
```
|
|
32
|
+
Note: E2E tests require Docker MySQL running (`docker-compose up -d`)
|
|
33
|
+
|
|
34
|
+
4. **Analyze failures**: For each failing test:
|
|
35
|
+
- Read the test file and the source file it tests
|
|
36
|
+
- Identify root cause (missing mock, changed API, broken logic)
|
|
37
|
+
- Apply minimal fix preserving test intent
|
|
38
|
+
|
|
39
|
+
5. **Re-run** after fixes to confirm resolution
|
|
40
|
+
|
|
41
|
+
## Report format
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
Tests: X passed, Y failed, Z total
|
|
45
|
+
Coverage: XX% (if --coverage was used)
|
|
46
|
+
|
|
47
|
+
Failures (if any):
|
|
48
|
+
1. [test-file]: description of failure → fix applied / fix suggested
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Important
|
|
52
|
+
|
|
53
|
+
- Never delete or skip failing tests without justification
|
|
54
|
+
- Prefer fixing source code over weakening tests
|
|
55
|
+
- Module mapper: `@/` resolves to `src/` (configured in jest)
|
|
56
|
+
- Test files: unit in `test/unit/`, E2E in `test/e2e/`
|
|
57
|
+
- E2E setup: `test/setup-e2e.ts`, helpers in `test/helpers/`
|