spoonfeeder 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +249 -0
- package/dist/generator/ai-context-assembler.d.ts +4 -0
- package/dist/generator/ai-context-assembler.js +52 -0
- package/dist/generator/ai-context-assembler.js.map +1 -0
- package/dist/generator/env-merger.d.ts +3 -0
- package/dist/generator/env-merger.js +16 -0
- package/dist/generator/env-merger.js.map +1 -0
- package/dist/generator/generator.d.ts +3 -0
- package/dist/generator/generator.js +253 -0
- package/dist/generator/generator.js.map +1 -0
- package/dist/generator/package-json-merger.d.ts +6 -0
- package/dist/generator/package-json-merger.js +29 -0
- package/dist/generator/package-json-merger.js.map +1 -0
- package/dist/generator/post-generate.d.ts +1 -0
- package/dist/generator/post-generate.js +28 -0
- package/dist/generator/post-generate.js.map +1 -0
- package/dist/generator/template-engine.d.ts +4 -0
- package/dist/generator/template-engine.js +20 -0
- package/dist/generator/template-engine.js.map +1 -0
- package/dist/generators/add-recipe/generator.d.ts +3 -0
- package/dist/generators/add-recipe/generator.js +153 -0
- package/dist/generators/add-recipe/generator.js.map +1 -0
- package/dist/generators/list-recipes/generator.d.ts +3 -0
- package/dist/generators/list-recipes/generator.js +58 -0
- package/dist/generators/list-recipes/generator.js.map +1 -0
- package/dist/generators/migrate-recipe/generator.d.ts +9 -0
- package/dist/generators/migrate-recipe/generator.js +90 -0
- package/dist/generators/migrate-recipe/generator.js.map +1 -0
- package/dist/generators/migrate-recipe/migration-guidance.d.ts +1 -0
- package/dist/generators/migrate-recipe/migration-guidance.js +159 -0
- package/dist/generators/migrate-recipe/migration-guidance.js.map +1 -0
- package/dist/generators/remove-recipe/generator.d.ts +3 -0
- package/dist/generators/remove-recipe/generator.js +176 -0
- package/dist/generators/remove-recipe/generator.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/add-ons.d.ts +3 -0
- package/dist/prompts/add-ons.js +29 -0
- package/dist/prompts/add-ons.js.map +1 -0
- package/dist/prompts/ci-cd.d.ts +2 -0
- package/dist/prompts/ci-cd.js +19 -0
- package/dist/prompts/ci-cd.js.map +1 -0
- package/dist/prompts/cloud-provider.d.ts +2 -0
- package/dist/prompts/cloud-provider.js +18 -0
- package/dist/prompts/cloud-provider.js.map +1 -0
- package/dist/prompts/confirmation.d.ts +2 -0
- package/dist/prompts/confirmation.js +29 -0
- package/dist/prompts/confirmation.js.map +1 -0
- package/dist/prompts/deployment.d.ts +2 -0
- package/dist/prompts/deployment.js +20 -0
- package/dist/prompts/deployment.js.map +1 -0
- package/dist/prompts/frontend.d.ts +2 -0
- package/dist/prompts/frontend.js +18 -0
- package/dist/prompts/frontend.js.map +1 -0
- package/dist/prompts/project-name.d.ts +5 -0
- package/dist/prompts/project-name.js +34 -0
- package/dist/prompts/project-name.js.map +1 -0
- package/dist/prompts/project-type.d.ts +2 -0
- package/dist/prompts/project-type.js +22 -0
- package/dist/prompts/project-type.js.map +1 -0
- package/dist/prompts/run-all.d.ts +3 -0
- package/dist/prompts/run-all.js +83 -0
- package/dist/prompts/run-all.js.map +1 -0
- package/dist/prompts/transport.d.ts +2 -0
- package/dist/prompts/transport.js +22 -0
- package/dist/prompts/transport.js.map +1 -0
- package/dist/recipes/definitions.d.ts +2 -0
- package/dist/recipes/definitions.js +3647 -0
- package/dist/recipes/definitions.js.map +1 -0
- package/dist/recipes/recipe.interface.d.ts +8 -0
- package/dist/recipes/recipe.interface.js +2 -0
- package/dist/recipes/recipe.interface.js.map +1 -0
- package/dist/recipes/registry.d.ts +9 -0
- package/dist/recipes/registry.js +23 -0
- package/dist/recipes/registry.js.map +1 -0
- package/dist/types.d.ts +70 -0
- package/dist/types.js +152 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/ai-context-updater.d.ts +6 -0
- package/dist/utils/ai-context-updater.js +50 -0
- package/dist/utils/ai-context-updater.js.map +1 -0
- package/dist/utils/dependency-checker.d.ts +14 -0
- package/dist/utils/dependency-checker.js +27 -0
- package/dist/utils/dependency-checker.js.map +1 -0
- package/dist/utils/env-updater.d.ts +7 -0
- package/dist/utils/env-updater.js +35 -0
- package/dist/utils/env-updater.js.map +1 -0
- package/dist/utils/main-ts-updater.d.ts +37 -0
- package/dist/utils/main-ts-updater.js +144 -0
- package/dist/utils/main-ts-updater.js.map +1 -0
- package/dist/utils/module-updater.d.ts +26 -0
- package/dist/utils/module-updater.js +167 -0
- package/dist/utils/module-updater.js.map +1 -0
- package/dist/utils/recipe-manifest.d.ts +24 -0
- package/dist/utils/recipe-manifest.js +45 -0
- package/dist/utils/recipe-manifest.js.map +1 -0
- package/dist/validation/config-validator.d.ts +13 -0
- package/dist/validation/config-validator.js +50 -0
- package/dist/validation/config-validator.js.map +1 -0
- package/dist/validation/conflict-detector.d.ts +7 -0
- package/dist/validation/conflict-detector.js +37 -0
- package/dist/validation/conflict-detector.js.map +1 -0
- package/generators.json +24 -0
- package/package.json +78 -0
- package/src/generators/add-recipe/schema.json +21 -0
- package/src/generators/list-recipes/schema.json +18 -0
- package/src/generators/migrate-recipe/schema.json +20 -0
- package/src/generators/remove-recipe/schema.json +21 -0
- package/templates/base/.env.example.ejs +3 -0
- package/templates/base/README.md.ejs +20 -0
- package/templates/base/SECURITY.md +36 -0
- package/templates/base/commitlint.config.js +15 -0
- package/templates/base/docs/adr/000-template.md +45 -0
- package/templates/base/docs/adr/001-framework-selection.md +54 -0
- package/templates/base/docs/adr/002-error-handling-strategy.md +36 -0
- package/templates/base/docs/adr/003-database-strategy.md +40 -0
- package/templates/base/docs/adr/004-authentication-architecture.md +44 -0
- package/templates/base/docs/adr/005-deployment-strategy.md +40 -0
- package/templates/base/docs/adr/006-testing-strategy.md +41 -0
- package/templates/base/docs/adr/007-scaffolder-architecture.md +64 -0
- package/templates/base/docs/adr/008-recipe-system.md +47 -0
- package/templates/base/docs/adr/009-standards-compliance.md +54 -0
- package/templates/base/docs/adr/010-ai-context-generation.md +44 -0
- package/templates/base/docs/adr/011-package-versioning.md +44 -0
- package/templates/base/docs/adr/012-monorepo-strategy.md +54 -0
- package/templates/base/docs/adr/013-http-adapter.md +63 -0
- package/templates/base/docs/adr/014-build-toolchain.md +61 -0
- package/templates/base/docs/adr/015-cloud-provider-strategy.md +49 -0
- package/templates/base/docs/adr/016-ci-cd-pipeline-strategy.md +52 -0
- package/templates/base/docs/adr/017-logging-strategy.md +63 -0
- package/templates/base/docs/adr/018-security-architecture.md +61 -0
- package/templates/base/docs/adr/019-project-type-design.md +61 -0
- package/templates/base/docs/adr/020-frontend-framework-support.md +57 -0
- package/templates/base/docs/adr/021-observability-strategy.md +68 -0
- package/templates/base/docs/adr/022-api-design-patterns.md +64 -0
- package/templates/base/docs/adr/023-error-hierarchy.md +54 -0
- package/templates/base/docs/adr/024-request-context-pattern.md +57 -0
- package/templates/base/docs/adr/025-data-patterns.md +58 -0
- package/templates/base/docs/adr/026-migration-strategy.md +57 -0
- package/templates/base/docs/adr/027-dependency-management.md +60 -0
- package/templates/base/docs/adr/028-code-quality-toolchain.md +60 -0
- package/templates/base/docs/adr/029-admin-panel.md +53 -0
- package/templates/base/docs/adr/030-performance-patterns.md +60 -0
- package/templates/base/docs/adr/031-nx-generators-roadmap.md +73 -0
- package/templates/base/docs/runbooks/000-template.md +78 -0
- package/templates/base/docs/sla-slo.md +36 -0
- package/templates/base/dot-editorconfig +12 -0
- package/templates/base/dot-github/ISSUE_TEMPLATE/bug_report.md +33 -0
- package/templates/base/dot-github/ISSUE_TEMPLATE/feature_request.md +21 -0
- package/templates/base/dot-github/pull_request_template.md +32 -0
- package/templates/base/dot-gitignore +28 -0
- package/templates/base/dot-husky/commit-msg +1 -0
- package/templates/base/dot-husky/pre-commit +1 -0
- package/templates/base/dot-husky/pre-push +2 -0
- package/templates/base/dot-npmrc +1 -0
- package/templates/base/dot-nvmrc +1 -0
- package/templates/base/dot-prettierrc +8 -0
- package/templates/base/eslint.config.mjs +35 -0
- package/templates/base/jest.config.ts +56 -0
- package/templates/base/nest-cli.json.ejs +10 -0
- package/templates/base/nx.json +3 -0
- package/templates/base/package.json.ejs +78 -0
- package/templates/base/src/app/modules/.gitkeep +0 -0
- package/templates/base/src/config/.gitkeep +0 -0
- package/templates/base/src/infrastructure/database/entities/.gitkeep +0 -0
- package/templates/base/src/infrastructure/database/migrations/.gitkeep +0 -0
- package/templates/base/src/infrastructure/database/repositories/.gitkeep +0 -0
- package/templates/base/src/infrastructure/http/.gitkeep +0 -0
- package/templates/base/src/infrastructure/notifications/.gitkeep +0 -0
- package/templates/base/src/infrastructure/queue/.gitkeep +0 -0
- package/templates/base/src/infrastructure/storage/.gitkeep +0 -0
- package/templates/base/src/shared/constants/error-codes.constant.ts +30 -0
- package/templates/base/src/shared/constants/http.constant.ts +134 -0
- package/templates/base/src/shared/constants/index.ts +2 -0
- package/templates/base/src/shared/decorators/.gitkeep +0 -0
- package/templates/base/src/shared/decorators/api-paginated-response.decorator.ts +10 -0
- package/templates/base/src/shared/errors/application.error.ts +21 -0
- package/templates/base/src/shared/errors/forbidden.error.ts +7 -0
- package/templates/base/src/shared/errors/index.ts +6 -0
- package/templates/base/src/shared/errors/invalid-request.error.ts +7 -0
- package/templates/base/src/shared/errors/not-found.error.ts +7 -0
- package/templates/base/src/shared/errors/requester.error.ts +7 -0
- package/templates/base/src/shared/errors/validation.error.ts +7 -0
- package/templates/base/src/shared/filters/http-exception.filter.ts +139 -0
- package/templates/base/src/shared/guards/.gitkeep +0 -0
- package/templates/base/src/shared/interceptors/interfaces/.gitkeep +0 -0
- package/templates/base/src/shared/interceptors/response.interceptor.ts +22 -0
- package/templates/base/src/shared/middleware/request-timeout.middleware.ts +32 -0
- package/templates/base/src/shared/pipes/parse-uuid.pipe.ts +13 -0
- package/templates/base/src/shared/utils/index.ts +2 -0
- package/templates/base/src/shared/utils/retry.util.ts +32 -0
- package/templates/base/src/shared/utils/sleep.util.ts +3 -0
- package/templates/base/tests/e2e/app.e2e-spec.ts.ejs +25 -0
- package/templates/base/tests/factories/.gitkeep +0 -0
- package/templates/base/tests/helpers/.gitkeep +0 -0
- package/templates/base/tests/integration/.gitkeep +0 -0
- package/templates/base/tests/unit/app.module.spec.ts +11 -0
- package/templates/base/tests/unit/shared/errors/error-hierarchy.spec.ts +69 -0
- package/templates/base/tests/unit/shared/filters/http-exception.filter.spec.ts +188 -0
- package/templates/base/tests/unit/shared/interceptors/response.interceptor.spec.ts +54 -0
- package/templates/base/tests/unit/shared/pipes/parse-uuid.pipe.spec.ts +14 -0
- package/templates/base/tsconfig.build.json +4 -0
- package/templates/base/tsconfig.json.ejs +26 -0
- package/templates/project-types/aws-lambda/package-fragment.json +8 -0
- package/templates/project-types/aws-lambda/src/app.module.ts.ejs +9 -0
- package/templates/project-types/aws-lambda/src/main.ts.ejs +32 -0
- package/templates/project-types/aws-lambda/tests/unit/handler.spec.ts +7 -0
- package/templates/project-types/cli-app/package-fragment.json +8 -0
- package/templates/project-types/cli-app/src/app.module.ts.ejs +11 -0
- package/templates/project-types/cli-app/src/commands/hello.command.ts.ejs +8 -0
- package/templates/project-types/cli-app/src/main.ts.ejs +8 -0
- package/templates/project-types/cli-app/tests/unit/commands/hello.command.spec.ts +17 -0
- package/templates/project-types/full-stack/apps/api/src/app.module.ts.ejs +9 -0
- package/templates/project-types/full-stack/apps/api/src/main.ts.ejs +32 -0
- package/templates/project-types/full-stack/frontend/nextjs/.cursor/rules/nextjs.mdc +12 -0
- package/templates/project-types/full-stack/frontend/nextjs/.github/copilot-instructions.md +23 -0
- package/templates/project-types/full-stack/frontend/nextjs/CLAUDE.md +25 -0
- package/templates/project-types/full-stack/frontend/nextjs/next.config.ts +9 -0
- package/templates/project-types/full-stack/frontend/nextjs/package.json +21 -0
- package/templates/project-types/full-stack/frontend/nextjs/src/app/layout.tsx +9 -0
- package/templates/project-types/full-stack/frontend/nextjs/src/app/page.tsx +8 -0
- package/templates/project-types/full-stack/frontend/nextjs/tsconfig.json +21 -0
- package/templates/project-types/full-stack/frontend/nuxt/.cursor/rules/nuxt.mdc +14 -0
- package/templates/project-types/full-stack/frontend/nuxt/.github/copilot-instructions.md +25 -0
- package/templates/project-types/full-stack/frontend/nuxt/CLAUDE.md +25 -0
- package/templates/project-types/full-stack/frontend/nuxt/app.vue +5 -0
- package/templates/project-types/full-stack/frontend/nuxt/nuxt.config.ts +6 -0
- package/templates/project-types/full-stack/frontend/nuxt/package.json +17 -0
- package/templates/project-types/full-stack/frontend/nuxt/pages/index.vue +3 -0
- package/templates/project-types/full-stack/frontend/nuxt/tsconfig.json +1 -0
- package/templates/project-types/full-stack/frontend/sveltekit/.cursor/rules/sveltekit.mdc +13 -0
- package/templates/project-types/full-stack/frontend/sveltekit/.github/copilot-instructions.md +24 -0
- package/templates/project-types/full-stack/frontend/sveltekit/CLAUDE.md +25 -0
- package/templates/project-types/full-stack/frontend/sveltekit/package.json +17 -0
- package/templates/project-types/full-stack/frontend/sveltekit/src/app.html +5 -0
- package/templates/project-types/full-stack/frontend/sveltekit/src/routes/+page.svelte +1 -0
- package/templates/project-types/full-stack/frontend/sveltekit/svelte.config.js +5 -0
- package/templates/project-types/full-stack/frontend/sveltekit/vite.config.ts +9 -0
- package/templates/project-types/full-stack/frontend/vite-react/.cursor/rules/react.mdc +12 -0
- package/templates/project-types/full-stack/frontend/vite-react/.github/copilot-instructions.md +23 -0
- package/templates/project-types/full-stack/frontend/vite-react/CLAUDE.md +24 -0
- package/templates/project-types/full-stack/frontend/vite-react/index.html +5 -0
- package/templates/project-types/full-stack/frontend/vite-react/package.json +22 -0
- package/templates/project-types/full-stack/frontend/vite-react/src/App.tsx +8 -0
- package/templates/project-types/full-stack/frontend/vite-react/src/main.tsx +9 -0
- package/templates/project-types/full-stack/frontend/vite-react/tsconfig.json +21 -0
- package/templates/project-types/full-stack/frontend/vite-react/vite.config.ts +9 -0
- package/templates/project-types/full-stack/libs/shared-types/package.json.ejs +6 -0
- package/templates/project-types/full-stack/libs/shared-types/src/index.ts.ejs +15 -0
- package/templates/project-types/full-stack/nx.json.ejs +20 -0
- package/templates/project-types/full-stack/package-fragment.json +14 -0
- package/templates/project-types/full-stack/pnpm-workspace.yaml +3 -0
- package/templates/project-types/full-stack/tsconfig.json.ejs +27 -0
- package/templates/project-types/http-api/src/app.module.ts.ejs +9 -0
- package/templates/project-types/http-api/src/main.ts.ejs +30 -0
- package/templates/project-types/http-api/tests/e2e/health.e2e-spec.ts +23 -0
- package/templates/project-types/microservice/package-fragment.json +5 -0
- package/templates/project-types/microservice/src/app.module.ts.ejs +9 -0
- package/templates/project-types/microservice/src/main.ts.ejs +15 -0
- package/templates/project-types/microservice/tests/unit/app.module.spec.ts +9 -0
- package/templates/project-types/monorepo/README.md.ejs +33 -0
- package/templates/project-types/monorepo/apps/api/src/app.module.ts.ejs +9 -0
- package/templates/project-types/monorepo/apps/api/src/main.ts.ejs +30 -0
- package/templates/project-types/monorepo/libs/common/package.json.ejs +6 -0
- package/templates/project-types/monorepo/libs/common/src/index.ts.ejs +17 -0
- package/templates/project-types/monorepo/nx.json.ejs +20 -0
- package/templates/project-types/monorepo/package-fragment.json +13 -0
- package/templates/project-types/monorepo/pnpm-workspace.yaml +3 -0
- package/templates/project-types/monorepo/tsconfig.json.ejs +27 -0
- package/templates/project-types/scheduled-worker/package-fragment.json +5 -0
- package/templates/project-types/scheduled-worker/src/app.module.ts.ejs +13 -0
- package/templates/project-types/scheduled-worker/src/jobs/example.job.ts.ejs +12 -0
- package/templates/project-types/scheduled-worker/src/main.ts.ejs +10 -0
- package/templates/project-types/scheduled-worker/tests/unit/jobs/example.job.spec.ts +17 -0
- package/templates/recipes/adminjs/README.md +145 -0
- package/templates/recipes/adminjs/src/app/modules/admin/admin.module.ts +59 -0
- package/templates/recipes/adminjs/tests/unit/app/modules/admin/admin.module.spec.ts +22 -0
- package/templates/recipes/ai-context/README.md +11 -0
- package/templates/recipes/ai-context/claude/base.md +73 -0
- package/templates/recipes/ai-context/claude/commands/add-command.md +48 -0
- package/templates/recipes/ai-context/claude/commands/add-consumer.md +58 -0
- package/templates/recipes/ai-context/claude/commands/add-endpoint.md +69 -0
- package/templates/recipes/ai-context/claude/commands/add-job.md +42 -0
- package/templates/recipes/ai-context/claude/commands/migrate.md +69 -0
- package/templates/recipes/ai-context/copilot/base.md +71 -0
- package/templates/recipes/ai-context/cursor/auth.mdc +44 -0
- package/templates/recipes/ai-context/cursor/base.mdc +44 -0
- package/templates/recipes/ai-context/cursor/prisma.mdc +43 -0
- package/templates/recipes/ai-context/cursor/swagger.mdc +48 -0
- package/templates/recipes/ai-context/cursor/testing.mdc +58 -0
- package/templates/recipes/ai-context/cursor/typeorm.mdc +49 -0
- package/templates/recipes/api-keys/README.md +44 -0
- package/templates/recipes/api-keys/src/shared/guards/api-key.guard.ts +32 -0
- package/templates/recipes/api-keys/tests/unit/shared/guards/api-key.guard.spec.ts +40 -0
- package/templates/recipes/api-versioning/README.md +63 -0
- package/templates/recipes/audit-trail/README.md +75 -0
- package/templates/recipes/audit-trail/src/shared/decorators/auditable.decorator.ts +4 -0
- package/templates/recipes/audit-trail/src/shared/interceptors/audit.interceptor.ts +46 -0
- package/templates/recipes/audit-trail/tests/unit/shared/interceptors/audit.interceptor.spec.ts +82 -0
- package/templates/recipes/auth-flows/README.md +91 -0
- package/templates/recipes/auth-flows/src/app/modules/auth/auth.controller.ts +44 -0
- package/templates/recipes/auth-flows/src/app/modules/auth/auth.module.ts +11 -0
- package/templates/recipes/auth-flows/src/app/modules/auth/auth.service.ts +194 -0
- package/templates/recipes/auth-flows/src/app/modules/auth/dto/forgot-password.dto.ts +6 -0
- package/templates/recipes/auth-flows/src/app/modules/auth/dto/login.dto.ts +9 -0
- package/templates/recipes/auth-flows/src/app/modules/auth/dto/reset-password.dto.ts +11 -0
- package/templates/recipes/auth-flows/src/app/modules/auth/dto/signup.dto.ts +16 -0
- package/templates/recipes/auth-flows/tests/unit/app/modules/auth/auth.service.spec.ts +13 -0
- package/templates/recipes/bullmq/README.md +54 -0
- package/templates/recipes/bullmq/src/infrastructure/queue/example.processor.ts +25 -0
- package/templates/recipes/bullmq/src/infrastructure/queue/queue.module.ts +26 -0
- package/templates/recipes/bullmq/tests/unit/infrastructure/queue/example.processor.spec.ts +17 -0
- package/templates/recipes/changelog/.changelogrc.json +18 -0
- package/templates/recipes/changelog/README.md +44 -0
- package/templates/recipes/ci-cd/README.md +14 -0
- package/templates/recipes/ci-cd/aws-codepipeline/README.md +30 -0
- package/templates/recipes/ci-cd/aws-codepipeline/buildspec.yml +41 -0
- package/templates/recipes/ci-cd/azure-devops/README.md +32 -0
- package/templates/recipes/ci-cd/azure-devops/azure-pipelines.yml +79 -0
- package/templates/recipes/ci-cd/gcp-cloudbuild/README.md +64 -0
- package/templates/recipes/ci-cd/gcp-cloudbuild/cloudbuild.yaml +53 -0
- package/templates/recipes/ci-cd/github-actions/.github/workflows/cd.yml +35 -0
- package/templates/recipes/ci-cd/github-actions/.github/workflows/ci.yml +62 -0
- package/templates/recipes/ci-cd/github-actions/README.md +29 -0
- package/templates/recipes/circuit-breaker/README.md +45 -0
- package/templates/recipes/circuit-breaker/src/shared/utils/circuit-breaker.ts +100 -0
- package/templates/recipes/circuit-breaker/tests/unit/shared/utils/circuit-breaker.spec.ts +28 -0
- package/templates/recipes/cloud-aws/README.md +20 -0
- package/templates/recipes/cloud-aws/cloudfront/README.md +50 -0
- package/templates/recipes/cloud-aws/cloudfront/src/infrastructure/aws/cloudfront.module.ts +8 -0
- package/templates/recipes/cloud-aws/cloudfront/src/infrastructure/aws/cloudfront.service.ts +29 -0
- package/templates/recipes/cloud-aws/cloudwatch/README.md +40 -0
- package/templates/recipes/cloud-aws/cloudwatch/src/infrastructure/aws/cloudwatch.module.ts +8 -0
- package/templates/recipes/cloud-aws/cloudwatch/src/infrastructure/aws/cloudwatch.service.ts +40 -0
- package/templates/recipes/cloud-aws/cognito/README.md +39 -0
- package/templates/recipes/cloud-aws/cognito/src/infrastructure/aws/cognito.module.ts +8 -0
- package/templates/recipes/cloud-aws/cognito/src/infrastructure/aws/cognito.service.ts +47 -0
- package/templates/recipes/cloud-aws/dynamodb/README.md +48 -0
- package/templates/recipes/cloud-aws/dynamodb/src/infrastructure/aws/dynamodb.module.ts +8 -0
- package/templates/recipes/cloud-aws/dynamodb/src/infrastructure/aws/dynamodb.service.ts +49 -0
- package/templates/recipes/cloud-aws/elasticache/README.md +45 -0
- package/templates/recipes/cloud-aws/elasticache/src/infrastructure/aws/redis.module.ts +8 -0
- package/templates/recipes/cloud-aws/elasticache/src/infrastructure/aws/redis.service.ts +47 -0
- package/templates/recipes/cloud-aws/eventbridge/README.md +46 -0
- package/templates/recipes/cloud-aws/eventbridge/src/infrastructure/aws/eventbridge.module.ts +8 -0
- package/templates/recipes/cloud-aws/eventbridge/src/infrastructure/aws/eventbridge.service.ts +48 -0
- package/templates/recipes/cloud-aws/rds/README.md +59 -0
- package/templates/recipes/cloud-aws/s3/README.md +44 -0
- package/templates/recipes/cloud-aws/s3/src/infrastructure/aws/s3.module.ts +8 -0
- package/templates/recipes/cloud-aws/s3/src/infrastructure/aws/s3.service.ts +42 -0
- package/templates/recipes/cloud-aws/secrets-manager/README.md +38 -0
- package/templates/recipes/cloud-aws/secrets-manager/src/infrastructure/aws/secrets.module.ts +8 -0
- package/templates/recipes/cloud-aws/secrets-manager/src/infrastructure/aws/secrets.service.ts +39 -0
- package/templates/recipes/cloud-aws/sns/README.md +43 -0
- package/templates/recipes/cloud-aws/sns/src/infrastructure/aws/sns.module.ts +8 -0
- package/templates/recipes/cloud-aws/sns/src/infrastructure/aws/sns.service.ts +48 -0
- package/templates/recipes/cloud-aws/sqs/README.md +47 -0
- package/templates/recipes/cloud-aws/sqs/src/infrastructure/aws/sqs.module.ts +8 -0
- package/templates/recipes/cloud-aws/sqs/src/infrastructure/aws/sqs.service.ts +58 -0
- package/templates/recipes/cloud-aws/ssm/README.md +41 -0
- package/templates/recipes/cloud-aws/ssm/src/infrastructure/aws/ssm.module.ts +8 -0
- package/templates/recipes/cloud-aws/ssm/src/infrastructure/aws/ssm.service.ts +54 -0
- package/templates/recipes/cloud-azure/README.md +18 -0
- package/templates/recipes/cloud-azure/app-insights/README.md +50 -0
- package/templates/recipes/cloud-azure/app-insights/src/infrastructure/azure/app-insights.module.ts +11 -0
- package/templates/recipes/cloud-azure/app-insights/src/infrastructure/azure/app-insights.service.ts +38 -0
- package/templates/recipes/cloud-azure/blob-storage/README.md +49 -0
- package/templates/recipes/cloud-azure/blob-storage/src/infrastructure/azure/blob-storage.module.ts +11 -0
- package/templates/recipes/cloud-azure/blob-storage/src/infrastructure/azure/blob-storage.service.ts +64 -0
- package/templates/recipes/cloud-azure/cache/README.md +47 -0
- package/templates/recipes/cloud-azure/cache/src/infrastructure/azure/redis.module.ts +11 -0
- package/templates/recipes/cloud-azure/cache/src/infrastructure/azure/redis.service.ts +41 -0
- package/templates/recipes/cloud-azure/cosmos-db/README.md +57 -0
- package/templates/recipes/cloud-azure/cosmos-db/src/infrastructure/azure/cosmos-db.module.ts +11 -0
- package/templates/recipes/cloud-azure/cosmos-db/src/infrastructure/azure/cosmos-db.service.ts +55 -0
- package/templates/recipes/cloud-azure/entra-id/README.md +42 -0
- package/templates/recipes/cloud-azure/entra-id/src/infrastructure/azure/entra-id.module.ts +11 -0
- package/templates/recipes/cloud-azure/entra-id/src/infrastructure/azure/entra-id.service.ts +55 -0
- package/templates/recipes/cloud-azure/front-door/README.md +48 -0
- package/templates/recipes/cloud-azure/functions/README.md +48 -0
- package/templates/recipes/cloud-azure/key-vault/README.md +42 -0
- package/templates/recipes/cloud-azure/key-vault/src/infrastructure/azure/key-vault.module.ts +11 -0
- package/templates/recipes/cloud-azure/key-vault/src/infrastructure/azure/key-vault.service.ts +27 -0
- package/templates/recipes/cloud-azure/service-bus/README.md +49 -0
- package/templates/recipes/cloud-azure/service-bus/src/infrastructure/azure/service-bus.module.ts +11 -0
- package/templates/recipes/cloud-azure/service-bus/src/infrastructure/azure/service-bus.service.ts +52 -0
- package/templates/recipes/cloud-azure/sql-database/README.md +54 -0
- package/templates/recipes/cloud-gcp/README.md +18 -0
- package/templates/recipes/cloud-gcp/cloud-cdn/README.md +40 -0
- package/templates/recipes/cloud-gcp/cloud-functions/README.md +42 -0
- package/templates/recipes/cloud-gcp/cloud-logging/README.md +42 -0
- package/templates/recipes/cloud-gcp/cloud-logging/src/infrastructure/gcp/logging.module.ts +10 -0
- package/templates/recipes/cloud-gcp/cloud-logging/src/infrastructure/gcp/logging.service.ts +50 -0
- package/templates/recipes/cloud-gcp/cloud-sql/README.md +53 -0
- package/templates/recipes/cloud-gcp/cloud-storage/README.md +43 -0
- package/templates/recipes/cloud-gcp/cloud-storage/src/infrastructure/gcp/storage.module.ts +10 -0
- package/templates/recipes/cloud-gcp/cloud-storage/src/infrastructure/gcp/storage.service.ts +51 -0
- package/templates/recipes/cloud-gcp/firebase-auth/README.md +38 -0
- package/templates/recipes/cloud-gcp/firebase-auth/src/infrastructure/gcp/firebase-auth.module.ts +10 -0
- package/templates/recipes/cloud-gcp/firebase-auth/src/infrastructure/gcp/firebase-auth.service.ts +41 -0
- package/templates/recipes/cloud-gcp/firestore/README.md +46 -0
- package/templates/recipes/cloud-gcp/firestore/src/infrastructure/gcp/firestore.module.ts +10 -0
- package/templates/recipes/cloud-gcp/firestore/src/infrastructure/gcp/firestore.service.ts +44 -0
- package/templates/recipes/cloud-gcp/memorystore/README.md +44 -0
- package/templates/recipes/cloud-gcp/memorystore/src/infrastructure/gcp/redis.module.ts +10 -0
- package/templates/recipes/cloud-gcp/memorystore/src/infrastructure/gcp/redis.service.ts +54 -0
- package/templates/recipes/cloud-gcp/pubsub/README.md +43 -0
- package/templates/recipes/cloud-gcp/pubsub/src/infrastructure/gcp/pubsub.module.ts +10 -0
- package/templates/recipes/cloud-gcp/pubsub/src/infrastructure/gcp/pubsub.service.ts +60 -0
- package/templates/recipes/cloud-gcp/secret-manager/README.md +40 -0
- package/templates/recipes/cloud-gcp/secret-manager/src/infrastructure/gcp/secrets.module.ts +10 -0
- package/templates/recipes/cloud-gcp/secret-manager/src/infrastructure/gcp/secrets.service.ts +41 -0
- package/templates/recipes/config-validation/README.md +61 -0
- package/templates/recipes/config-validation/src/config/env.validation.ts +28 -0
- package/templates/recipes/config-validation/tests/unit/config/env.validation.spec.ts +34 -0
- package/templates/recipes/content-digest/README.md +28 -0
- package/templates/recipes/content-digest/src/shared/guards/content-digest.guard.ts +30 -0
- package/templates/recipes/content-digest/src/shared/interceptors/content-digest.interceptor.ts +23 -0
- package/templates/recipes/content-digest/tests/unit/shared/guards/content-digest.guard.spec.ts +56 -0
- package/templates/recipes/content-digest/tests/unit/shared/interceptors/content-digest.interceptor.spec.ts +54 -0
- package/templates/recipes/correlation-id/README.md +44 -0
- package/templates/recipes/correlation-id/src/shared/middleware/correlation-id.middleware.ts +29 -0
- package/templates/recipes/correlation-id/tests/unit/shared/middleware/correlation-id.spec.ts +5 -0
- package/templates/recipes/cors/README.md +45 -0
- package/templates/recipes/cqrs/README.md +39 -0
- package/templates/recipes/cqrs/src/shared/cqrs/example.command.ts +29 -0
- package/templates/recipes/cqrs/tests/unit/shared/cqrs/example.command.spec.ts +38 -0
- package/templates/recipes/csrf/README.md +55 -0
- package/templates/recipes/data-masking/README.md +85 -0
- package/templates/recipes/data-masking/src/shared/decorators/sensitive.decorator.ts +12 -0
- package/templates/recipes/data-masking/src/shared/utils/mask.util.ts +26 -0
- package/templates/recipes/data-masking/tests/unit/shared/utils/mask.util.spec.ts +21 -0
- package/templates/recipes/database-factories/README.md +48 -0
- package/templates/recipes/database-factories/tests/factories/base.factory.ts +51 -0
- package/templates/recipes/database-seeding/README.md +40 -0
- package/templates/recipes/database-seeding/src/infrastructure/database/seed.ts +61 -0
- package/templates/recipes/database-seeding/tests/unit/infrastructure/database/seed.spec.ts +37 -0
- package/templates/recipes/dead-letter-queue/README.md +79 -0
- package/templates/recipes/dead-letter-queue/src/infrastructure/queue/dlq.service.ts +43 -0
- package/templates/recipes/dead-letter-queue/tests/unit/infrastructure/queue/dlq.service.spec.ts +46 -0
- package/templates/recipes/dependabot-renovate/.github/dependabot.yml +52 -0
- package/templates/recipes/dependabot-renovate/README.md +37 -0
- package/templates/recipes/dependabot-renovate/renovate.json +46 -0
- package/templates/recipes/deploy/README.md +13 -0
- package/templates/recipes/deploy/docker-compose/README.md +38 -0
- package/templates/recipes/deploy/docker-compose/docker-compose.yml +43 -0
- package/templates/recipes/deploy/dockerfile/Dockerfile +30 -0
- package/templates/recipes/deploy/dockerfile/README.md +30 -0
- package/templates/recipes/deploy/dockerfile/dot-dockerignore +9 -0
- package/templates/recipes/deploy/kubernetes/README.md +43 -0
- package/templates/recipes/deploy/kubernetes/k8s/configmap.yaml +7 -0
- package/templates/recipes/deploy/kubernetes/k8s/deployment.yaml +45 -0
- package/templates/recipes/deploy/kubernetes/k8s/hpa.yaml +18 -0
- package/templates/recipes/deploy/kubernetes/k8s/ingress.yaml +23 -0
- package/templates/recipes/deploy/kubernetes/k8s/service.yaml +12 -0
- package/templates/recipes/deploy/serverless-framework/README.md +39 -0
- package/templates/recipes/deploy/serverless-framework/serverless.yml.ejs +22 -0
- package/templates/recipes/deploy/terraform/README.md +99 -0
- package/templates/recipes/deploy/terraform/main.tf.ejs +13 -0
- package/templates/recipes/deploy/terraform/modules/app/alb.tf +34 -0
- package/templates/recipes/deploy/terraform/modules/app/iam.tf +30 -0
- package/templates/recipes/deploy/terraform/modules/app/main.tf +80 -0
- package/templates/recipes/deploy/terraform/modules/app/outputs.tf +11 -0
- package/templates/recipes/deploy/terraform/modules/app/security.tf +37 -0
- package/templates/recipes/deploy/terraform/modules/app/variables.tf +42 -0
- package/templates/recipes/deploy/terraform/outputs.tf +4 -0
- package/templates/recipes/deploy/terraform/variables.tf +11 -0
- package/templates/recipes/devcontainer/.devcontainer/Dockerfile +5 -0
- package/templates/recipes/devcontainer/.devcontainer/devcontainer.json +32 -0
- package/templates/recipes/devcontainer/.devcontainer/docker-compose.yml +62 -0
- package/templates/recipes/devcontainer/README.md +31 -0
- package/templates/recipes/distributed-tracing/README.md +45 -0
- package/templates/recipes/distributed-tracing/src/shared/middleware/trace-propagation.middleware.ts +68 -0
- package/templates/recipes/distributed-tracing/tests/unit/shared/middleware/trace-propagation.middleware.spec.ts +76 -0
- package/templates/recipes/docker-compose-dev/Dockerfile.dev +14 -0
- package/templates/recipes/docker-compose-dev/README.md +57 -0
- package/templates/recipes/docker-compose-dev/docker-compose.dev.yml.ejs +54 -0
- package/templates/recipes/docs-site/README.md +41 -0
- package/templates/recipes/docs-site/docs/.vitepress/config.ts.ejs +53 -0
- package/templates/recipes/dpop/README.md +37 -0
- package/templates/recipes/dpop/src/shared/guards/dpop.guard.ts +61 -0
- package/templates/recipes/dpop/tests/unit/shared/guards/dpop.guard.spec.ts +69 -0
- package/templates/recipes/drizzle-postgres/README.md +68 -0
- package/templates/recipes/drizzle-postgres/drizzle.config.ts +10 -0
- package/templates/recipes/drizzle-postgres/src/infrastructure/database/drizzle.module.ts +25 -0
- package/templates/recipes/drizzle-postgres/src/infrastructure/database/schema/example.ts +9 -0
- package/templates/recipes/drizzle-postgres/src/infrastructure/database/schema/index.ts +3 -0
- package/templates/recipes/drizzle-postgres/tests/unit/infrastructure/database/drizzle.module.spec.ts +35 -0
- package/templates/recipes/env-per-environment/.env.development +17 -0
- package/templates/recipes/env-per-environment/.env.production +20 -0
- package/templates/recipes/env-per-environment/.env.test +17 -0
- package/templates/recipes/env-per-environment/README.md +40 -0
- package/templates/recipes/feature-flags/README.md +45 -0
- package/templates/recipes/feature-flags/src/shared/services/feature-flag.service.ts +48 -0
- package/templates/recipes/feature-flags/tests/unit/shared/services/feature-flag.service.spec.ts +36 -0
- package/templates/recipes/file-upload/README.md +104 -0
- package/templates/recipes/file-upload/src/shared/interceptors/file-upload.interceptor.ts +33 -0
- package/templates/recipes/file-upload/src/shared/pipes/file-validation.pipe.ts +45 -0
- package/templates/recipes/file-upload/tests/unit/shared/pipes/file-validation.pipe.spec.ts +56 -0
- package/templates/recipes/filtering/README.md +43 -0
- package/templates/recipes/filtering/src/shared/dto/filter.dto.ts +49 -0
- package/templates/recipes/filtering/tests/unit/shared/dto/filter.dto.spec.ts +38 -0
- package/templates/recipes/graceful-shutdown/README.md +60 -0
- package/templates/recipes/graceful-shutdown/src/shared/lifecycle/shutdown.service.ts +52 -0
- package/templates/recipes/graceful-shutdown/tests/unit/shared/lifecycle/shutdown.service.spec.ts +52 -0
- package/templates/recipes/graphql-mercurius/README.md +37 -0
- package/templates/recipes/graphql-mercurius/src/infrastructure/graphql/graphql.module.ts +18 -0
- package/templates/recipes/graphql-mercurius/tests/unit/infrastructure/graphql/graphql.module.spec.ts +12 -0
- package/templates/recipes/health-checks/README.md +35 -0
- package/templates/recipes/health-checks/src/shared/health/health.controller.ts +26 -0
- package/templates/recipes/health-checks/src/shared/health/health.module.ts +9 -0
- package/templates/recipes/health-checks/tests/unit/shared/health/health.controller.spec.ts +8 -0
- package/templates/recipes/helmet/README.md +43 -0
- package/templates/recipes/http-caching/README.md +63 -0
- package/templates/recipes/http-caching/src/shared/decorators/cache-control.decorator.ts +18 -0
- package/templates/recipes/http-caching/src/shared/interceptors/cache-control.interceptor.ts +43 -0
- package/templates/recipes/http-caching/tests/unit/shared/interceptors/cache-control.interceptor.spec.ts +44 -0
- package/templates/recipes/i18n/README.md +45 -0
- package/templates/recipes/i18n/src/i18n/en/common.json +7 -0
- package/templates/recipes/i18n/src/i18n/nl/common.json +7 -0
- package/templates/recipes/i18n/src/shared/i18n/i18n.module.ts +17 -0
- package/templates/recipes/i18n/tests/unit/shared/i18n/i18n.module.spec.ts +18 -0
- package/templates/recipes/idempotency/README.md +63 -0
- package/templates/recipes/idempotency/src/shared/decorators/idempotent.decorator.ts +4 -0
- package/templates/recipes/idempotency/src/shared/middleware/idempotency.middleware.ts +63 -0
- package/templates/recipes/idempotency/tests/unit/shared/middleware/idempotency.middleware.spec.ts +56 -0
- package/templates/recipes/json-merge-patch/README.md +53 -0
- package/templates/recipes/json-merge-patch/src/shared/pipes/merge-patch.pipe.ts +11 -0
- package/templates/recipes/json-merge-patch/tests/unit/shared/pipes/merge-patch.pipe.spec.ts +30 -0
- package/templates/recipes/json-patch/README.md +54 -0
- package/templates/recipes/json-patch/src/shared/pipes/json-patch.pipe.ts +39 -0
- package/templates/recipes/json-patch/tests/unit/shared/pipes/json-patch.pipe.spec.ts +37 -0
- package/templates/recipes/jwt-auth/README.md +56 -0
- package/templates/recipes/jwt-auth/src/shared/decorators/current-user.decorator.ts +10 -0
- package/templates/recipes/jwt-auth/src/shared/decorators/public.decorator.ts +4 -0
- package/templates/recipes/jwt-auth/src/shared/guards/jwt-auth.guard.ts +24 -0
- package/templates/recipes/jwt-auth/tests/unit/shared/guards/jwt-auth.guard.spec.ts +9 -0
- package/templates/recipes/kysely/README.md +53 -0
- package/templates/recipes/kysely/src/infrastructure/database/database.module.ts +28 -0
- package/templates/recipes/kysely/src/infrastructure/database/types.ts +17 -0
- package/templates/recipes/kysely/tests/unit/infrastructure/database/database.module.spec.ts +35 -0
- package/templates/recipes/license/LICENSE.agpl3 +59 -0
- package/templates/recipes/license/LICENSE.apache +189 -0
- package/templates/recipes/license/LICENSE.bsd3 +28 -0
- package/templates/recipes/license/LICENSE.gpl3 +22 -0
- package/templates/recipes/license/LICENSE.isc +15 -0
- package/templates/recipes/license/LICENSE.mit +21 -0
- package/templates/recipes/license/LICENSE.mpl2 +24 -0
- package/templates/recipes/license/LICENSE.proprietary +76 -0
- package/templates/recipes/license/LICENSE.unlicensed +13 -0
- package/templates/recipes/license/README.md +53 -0
- package/templates/recipes/load-testing/README.md +77 -0
- package/templates/recipes/load-testing/k6/smoke.js +20 -0
- package/templates/recipes/load-testing/k6/stress.js +22 -0
- package/templates/recipes/mfa-totp/README.md +77 -0
- package/templates/recipes/mfa-totp/src/shared/auth/totp.service.ts +26 -0
- package/templates/recipes/mfa-totp/tests/unit/shared/auth/totp.service.spec.ts +65 -0
- package/templates/recipes/mikro-orm/README.md +22 -0
- package/templates/recipes/mikro-orm/src/infrastructure/database/database.module.ts +8 -0
- package/templates/recipes/mikro-orm/src/infrastructure/database/entities/.gitkeep +0 -0
- package/templates/recipes/mikro-orm/src/infrastructure/database/migrations/.gitkeep +0 -0
- package/templates/recipes/mikro-orm/src/infrastructure/database/mikro-orm.config.ts +20 -0
- package/templates/recipes/mikro-orm/tests/unit/infrastructure/database/mikro-orm.config.spec.ts +53 -0
- package/templates/recipes/mongoose/README.md +42 -0
- package/templates/recipes/mongoose/src/infrastructure/database/database.module.ts.ejs +17 -0
- package/templates/recipes/mongoose/tests/unit/infrastructure/database/database.module.spec.ts +25 -0
- package/templates/recipes/multi-tenancy/README.md +49 -0
- package/templates/recipes/multi-tenancy/src/shared/decorators/tenant.decorator.ts +14 -0
- package/templates/recipes/multi-tenancy/src/shared/middleware/tenant.middleware.ts +49 -0
- package/templates/recipes/multi-tenancy/tests/unit/shared/middleware/tenant.middleware.spec.ts +29 -0
- package/templates/recipes/nodemailer/README.md +55 -0
- package/templates/recipes/nodemailer/src/infrastructure/notifications/mail.module.ts +37 -0
- package/templates/recipes/nodemailer/tests/unit/infrastructure/notifications/mail.module.spec.ts +33 -0
- package/templates/recipes/oauth-apple/README.md +68 -0
- package/templates/recipes/oauth-apple/src/shared/auth/apple-auth.guard.ts +5 -0
- package/templates/recipes/oauth-apple/src/shared/auth/apple.strategy.ts +33 -0
- package/templates/recipes/oauth-apple/tests/unit/shared/auth/apple.strategy.spec.ts +65 -0
- package/templates/recipes/oauth-github/README.md +62 -0
- package/templates/recipes/oauth-github/src/shared/auth/github-auth.guard.ts +5 -0
- package/templates/recipes/oauth-github/src/shared/auth/github.strategy.ts +33 -0
- package/templates/recipes/oauth-github/tests/unit/shared/auth/github.strategy.spec.ts +72 -0
- package/templates/recipes/oauth-google/README.md +64 -0
- package/templates/recipes/oauth-google/src/shared/auth/google-auth.guard.ts +5 -0
- package/templates/recipes/oauth-google/src/shared/auth/google.strategy.ts +33 -0
- package/templates/recipes/oauth-google/tests/unit/shared/auth/google.strategy.spec.ts +72 -0
- package/templates/recipes/oauth2-introspection/README.md +62 -0
- package/templates/recipes/oauth2-introspection/src/shared/guards/token-introspection.guard.ts +77 -0
- package/templates/recipes/oauth2-introspection/tests/unit/shared/guards/token-introspection.guard.spec.ts +99 -0
- package/templates/recipes/opentelemetry/README.md +44 -0
- package/templates/recipes/opentelemetry/src/infrastructure/telemetry/tracing.ts +38 -0
- package/templates/recipes/opentelemetry/tests/unit/infrastructure/telemetry/tracing.spec.ts +23 -0
- package/templates/recipes/pagination/README.md +71 -0
- package/templates/recipes/pagination/src/shared/decorators/paginate.decorator.ts +25 -0
- package/templates/recipes/pagination/src/shared/dto/pagination.dto.ts +64 -0
- package/templates/recipes/pagination/src/shared/interceptors/pagination-link.interceptor.ts +31 -0
- package/templates/recipes/pagination/tests/unit/shared/dto/pagination.dto.spec.ts +56 -0
- package/templates/recipes/passport/README.md +41 -0
- package/templates/recipes/passport/src/shared/guards/local-auth.guard.ts +5 -0
- package/templates/recipes/passport/tests/unit/shared/guards/local-auth.guard.spec.ts +17 -0
- package/templates/recipes/pino/README.md +48 -0
- package/templates/recipes/pino/src/infrastructure/logging/logger.module.ts +39 -0
- package/templates/recipes/pino/tests/unit/infrastructure/logging/logger.module.spec.ts +6 -0
- package/templates/recipes/prefer-header/README.md +92 -0
- package/templates/recipes/prefer-header/src/shared/interceptors/prefer.interceptor.ts +60 -0
- package/templates/recipes/prefer-header/tests/unit/shared/interceptors/prefer.interceptor.spec.ts +44 -0
- package/templates/recipes/prisma/README.md +52 -0
- package/templates/recipes/prisma/prisma/schema.prisma.ejs +8 -0
- package/templates/recipes/prisma/src/infrastructure/database/prisma.service.ts +27 -0
- package/templates/recipes/prisma/tests/unit/infrastructure/database/prisma.service.spec.ts +21 -0
- package/templates/recipes/prometheus/README.md +54 -0
- package/templates/recipes/prometheus/src/infrastructure/metrics/metrics.controller.ts +15 -0
- package/templates/recipes/prometheus/src/infrastructure/metrics/metrics.module.ts +29 -0
- package/templates/recipes/prometheus/tests/unit/infrastructure/metrics/metrics.controller.spec.ts +22 -0
- package/templates/recipes/rabbitmq/README.md +53 -0
- package/templates/recipes/rabbitmq/src/infrastructure/queue/queue.module.ts.ejs +27 -0
- package/templates/recipes/rbac-casl/README.md +69 -0
- package/templates/recipes/rbac-casl/src/shared/auth/casl-ability.factory.ts +43 -0
- package/templates/recipes/rbac-casl/src/shared/decorators/roles.decorator.ts +5 -0
- package/templates/recipes/rbac-casl/src/shared/guards/policies.guard.ts +32 -0
- package/templates/recipes/rbac-casl/src/shared/guards/roles.guard.ts +21 -0
- package/templates/recipes/rbac-casl/tests/unit/shared/auth/casl-ability.factory.spec.ts +6 -0
- package/templates/recipes/redis-cache/README.md +55 -0
- package/templates/recipes/redis-cache/src/infrastructure/cache/cache.module.ts +26 -0
- package/templates/recipes/redis-cache/tests/unit/infrastructure/cache/cache.module.spec.ts +12 -0
- package/templates/recipes/request-context/README.md +57 -0
- package/templates/recipes/request-context/src/shared/context/request-context.module.ts +19 -0
- package/templates/recipes/request-context/tests/unit/shared/context/request-context.module.spec.ts +20 -0
- package/templates/recipes/request-logging/README.md +36 -0
- package/templates/recipes/request-logging/src/shared/middleware/request-logging.middleware.ts +40 -0
- package/templates/recipes/request-logging/tests/unit/shared/middleware/request-logging.middleware.spec.ts +64 -0
- package/templates/recipes/s3-minio/README.md +52 -0
- package/templates/recipes/s3-minio/src/infrastructure/storage/storage.module.ts +10 -0
- package/templates/recipes/s3-minio/src/infrastructure/storage/storage.service.ts +72 -0
- package/templates/recipes/s3-minio/tests/unit/infrastructure/storage/storage.service.spec.ts +23 -0
- package/templates/recipes/sdk-generation/README.md +40 -0
- package/templates/recipes/sdk-generation/openapitools.json +21 -0
- package/templates/recipes/sendgrid/README.md +45 -0
- package/templates/recipes/sendgrid/src/infrastructure/notifications/sendgrid.service.ts +60 -0
- package/templates/recipes/sendgrid/tests/unit/infrastructure/notifications/sendgrid.service.spec.ts +59 -0
- package/templates/recipes/sentry/README.md +49 -0
- package/templates/recipes/sentry/src/infrastructure/sentry/sentry.filter.ts +34 -0
- package/templates/recipes/sentry/src/infrastructure/sentry/sentry.module.ts +23 -0
- package/templates/recipes/sentry/tests/unit/infrastructure/sentry/sentry.filter.spec.ts +50 -0
- package/templates/recipes/seq2/README.md +41 -0
- package/templates/recipes/seq2/src/infrastructure/logging/seq.transport.ts +57 -0
- package/templates/recipes/seq2/tests/unit/infrastructure/logging/seq.transport.spec.ts +53 -0
- package/templates/recipes/serialization-groups/README.md +105 -0
- package/templates/recipes/serialization-groups/src/shared/interceptors/serialize.interceptor.ts +29 -0
- package/templates/recipes/serialization-groups/tests/unit/shared/interceptors/serialize.interceptor.spec.ts +48 -0
- package/templates/recipes/soft-delete/README.md +71 -0
- package/templates/recipes/soft-delete/src/shared/decorators/with-deleted.decorator.ts +4 -0
- package/templates/recipes/soft-delete/src/shared/entities/soft-deletable.entity.ts +20 -0
- package/templates/recipes/soft-delete/tests/unit/shared/entities/soft-deletable.entity.spec.ts +35 -0
- package/templates/recipes/sse/README.md +43 -0
- package/templates/recipes/sse/src/shared/gateways/events.sse.controller.ts +21 -0
- package/templates/recipes/sse/tests/unit/shared/gateways/events.sse.controller.spec.ts +32 -0
- package/templates/recipes/swagger/README.md +42 -0
- package/templates/recipes/swagger/src/main.swagger.ts.ejs +20 -0
- package/templates/recipes/swagger/tests/unit/main.swagger.spec.ts +5 -0
- package/templates/recipes/throttler/README.md +49 -0
- package/templates/recipes/throttler/src/shared/guards/throttle.config.ts +33 -0
- package/templates/recipes/throttler/tests/unit/shared/guards/throttle.spec.ts +5 -0
- package/templates/recipes/transactional-outbox/README.md +98 -0
- package/templates/recipes/transactional-outbox/src/infrastructure/outbox/outbox.entity.ts +30 -0
- package/templates/recipes/transactional-outbox/src/infrastructure/outbox/outbox.service.ts +21 -0
- package/templates/recipes/transactional-outbox/tests/unit/infrastructure/outbox/outbox.service.spec.ts +38 -0
- package/templates/recipes/typeorm-mysql/README.md +48 -0
- package/templates/recipes/typeorm-mysql/src/infrastructure/database/database.module.ts.ejs +24 -0
- package/templates/recipes/typeorm-postgres/README.md +101 -0
- package/templates/recipes/typeorm-postgres/src/infrastructure/database/data-source.ts.ejs +14 -0
- package/templates/recipes/typeorm-postgres/src/infrastructure/database/database.module.ts.ejs +24 -0
- package/templates/recipes/typeorm-postgres/src/infrastructure/database/entities/.gitkeep +0 -0
- package/templates/recipes/typeorm-postgres/src/infrastructure/database/entities/index.ts +7 -0
- package/templates/recipes/typeorm-postgres/src/infrastructure/database/migrations/.gitkeep +0 -0
- package/templates/recipes/typeorm-postgres/src/infrastructure/database/migrations/index.ts +10 -0
- package/templates/recipes/typeorm-postgres/tests/unit/infrastructure/database/database.module.spec.ts +11 -0
- package/templates/recipes/webhooks/README.md +76 -0
- package/templates/recipes/webhooks/src/infrastructure/webhooks/webhook.service.ts +53 -0
- package/templates/recipes/webhooks/tests/unit/infrastructure/webhooks/webhook.service.spec.ts +31 -0
- package/templates/recipes/websockets/README.md +44 -0
- package/templates/recipes/websockets/src/shared/gateways/events.gateway.ts +55 -0
- package/templates/recipes/websockets/tests/unit/shared/gateways/events.gateway.spec.ts +23 -0
- package/templates/recipes/winston/README.md +45 -0
- package/templates/recipes/winston/src/infrastructure/logging/logger.module.ts +34 -0
- package/templates/recipes/winston/tests/unit/infrastructure/logging/logger.module.spec.ts +12 -0
- package/templates/recipes/worker-threads/README.md +71 -0
- package/templates/recipes/worker-threads/src/shared/utils/worker-pool.ts +59 -0
- package/templates/recipes/worker-threads/tests/unit/shared/utils/worker-pool.spec.ts +36 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface BlockImport {
|
|
2
|
+
defaultImport?: string;
|
|
3
|
+
namedImports: string[];
|
|
4
|
+
moduleSpecifier: string;
|
|
5
|
+
}
|
|
6
|
+
export interface BlockDefinition {
|
|
7
|
+
imports: BlockImport[];
|
|
8
|
+
code: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Inserts a delimited code block into main.ts before the `await app.listen` line.
|
|
12
|
+
*
|
|
13
|
+
* The block is wrapped with start/end markers for clean removal later.
|
|
14
|
+
* Import declarations are added at the top of the file.
|
|
15
|
+
*
|
|
16
|
+
* Idempotent: skips if the start marker already exists in the file.
|
|
17
|
+
*/
|
|
18
|
+
export declare function insertBlock(filePath: string, blockId: string, block: BlockDefinition): void;
|
|
19
|
+
/**
|
|
20
|
+
* Inserts a delimited code block into a main.ts source string (in-memory, no filesystem access).
|
|
21
|
+
* Returns the transformed source text.
|
|
22
|
+
*/
|
|
23
|
+
export declare function insertBlockToString(source: string, blockId: string, block: BlockDefinition): string;
|
|
24
|
+
/**
|
|
25
|
+
* Removes a delimited code block from main.ts by its block ID.
|
|
26
|
+
*
|
|
27
|
+
* Removes everything between the start/end markers (inclusive) and
|
|
28
|
+
* optionally removes import declarations for the specified module specifiers.
|
|
29
|
+
*
|
|
30
|
+
* No-op if the block markers are not found.
|
|
31
|
+
*/
|
|
32
|
+
export declare function removeBlock(filePath: string, blockId: string, importModuleSpecifiers: string[]): void;
|
|
33
|
+
/**
|
|
34
|
+
* Removes a delimited code block from a main.ts source string (in-memory, no filesystem access).
|
|
35
|
+
* Returns the transformed source text.
|
|
36
|
+
*/
|
|
37
|
+
export declare function removeBlockFromString(source: string, blockId: string, importModuleSpecifiers: string[]): string;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
const START_MARKER = (blockId) => `// --- ${blockId} start ---`;
|
|
3
|
+
const END_MARKER = (blockId) => `// --- ${blockId} end ---`;
|
|
4
|
+
function formatImportStatement(imp) {
|
|
5
|
+
const parts = [];
|
|
6
|
+
if (imp.defaultImport)
|
|
7
|
+
parts.push(imp.defaultImport);
|
|
8
|
+
if (imp.namedImports.length > 0)
|
|
9
|
+
parts.push(`{ ${imp.namedImports.join(', ')} }`);
|
|
10
|
+
return `import ${parts.join(', ')} from '${imp.moduleSpecifier}';`;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Inserts a delimited code block into main.ts before the `await app.listen` line.
|
|
14
|
+
*
|
|
15
|
+
* The block is wrapped with start/end markers for clean removal later.
|
|
16
|
+
* Import declarations are added at the top of the file.
|
|
17
|
+
*
|
|
18
|
+
* Idempotent: skips if the start marker already exists in the file.
|
|
19
|
+
*/
|
|
20
|
+
export function insertBlock(filePath, blockId, block) {
|
|
21
|
+
if (!fs.existsSync(filePath)) {
|
|
22
|
+
throw new Error(`File not found: ${filePath}`);
|
|
23
|
+
}
|
|
24
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
25
|
+
const result = insertBlockToString(content, blockId, block);
|
|
26
|
+
if (result !== content) {
|
|
27
|
+
fs.writeFileSync(filePath, result, 'utf-8');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Inserts a delimited code block into a main.ts source string (in-memory, no filesystem access).
|
|
32
|
+
* Returns the transformed source text.
|
|
33
|
+
*/
|
|
34
|
+
export function insertBlockToString(source, blockId, block) {
|
|
35
|
+
let content = source;
|
|
36
|
+
// Guard: skip if block already exists
|
|
37
|
+
if (content.includes(START_MARKER(blockId)))
|
|
38
|
+
return content;
|
|
39
|
+
// Add import declarations at the top of the file (after existing imports)
|
|
40
|
+
if (block.imports.length > 0) {
|
|
41
|
+
const importStatements = block.imports.map((imp) => formatImportStatement(imp)).join('\n');
|
|
42
|
+
const lines = content.split('\n');
|
|
43
|
+
let lastImportIdx = -1;
|
|
44
|
+
for (let i = 0; i < lines.length; i++) {
|
|
45
|
+
if (lines[i].startsWith('import ')) {
|
|
46
|
+
lastImportIdx = i;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (lastImportIdx >= 0) {
|
|
50
|
+
lines.splice(lastImportIdx + 1, 0, importStatements);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
lines.unshift(importStatements);
|
|
54
|
+
}
|
|
55
|
+
content = lines.join('\n');
|
|
56
|
+
}
|
|
57
|
+
// Insert the delimited block before `await app.listen`
|
|
58
|
+
const delimitedBlock = [
|
|
59
|
+
'',
|
|
60
|
+
` ${START_MARKER(blockId)}`,
|
|
61
|
+
block.code,
|
|
62
|
+
` ${END_MARKER(blockId)}`,
|
|
63
|
+
'',
|
|
64
|
+
].join('\n');
|
|
65
|
+
const listenPattern = /^(\s*(?:const\s+\w+\s*=\s*)?(?:await\s+)?app\.listen)/m;
|
|
66
|
+
const listenMatch = content.match(listenPattern);
|
|
67
|
+
if (listenMatch && listenMatch.index !== undefined) {
|
|
68
|
+
content =
|
|
69
|
+
content.slice(0, listenMatch.index) +
|
|
70
|
+
delimitedBlock +
|
|
71
|
+
'\n' +
|
|
72
|
+
content.slice(listenMatch.index);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// Secondary anchor: insert after `await app.init()` (Lambda pattern)
|
|
76
|
+
const initPattern = /^(\s*await\s+app\.init\(\)\s*;?\s*)$/m;
|
|
77
|
+
const initMatch = content.match(initPattern);
|
|
78
|
+
if (initMatch && initMatch.index !== undefined) {
|
|
79
|
+
const insertAfter = initMatch.index + initMatch[0].length;
|
|
80
|
+
content =
|
|
81
|
+
content.slice(0, insertAfter) + '\n' + delimitedBlock + content.slice(insertAfter);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Fallback: insert before the last closing brace of the bootstrap function
|
|
85
|
+
const lastBraceIdx = content.lastIndexOf('}');
|
|
86
|
+
if (lastBraceIdx >= 0) {
|
|
87
|
+
content =
|
|
88
|
+
content.slice(0, lastBraceIdx) + delimitedBlock + '\n' + content.slice(lastBraceIdx);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
content += delimitedBlock;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Clean up excessive blank lines
|
|
96
|
+
content = content.replace(/\n{3,}/g, '\n\n');
|
|
97
|
+
return content;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Removes a delimited code block from main.ts by its block ID.
|
|
101
|
+
*
|
|
102
|
+
* Removes everything between the start/end markers (inclusive) and
|
|
103
|
+
* optionally removes import declarations for the specified module specifiers.
|
|
104
|
+
*
|
|
105
|
+
* No-op if the block markers are not found.
|
|
106
|
+
*/
|
|
107
|
+
export function removeBlock(filePath, blockId, importModuleSpecifiers) {
|
|
108
|
+
if (!fs.existsSync(filePath))
|
|
109
|
+
return;
|
|
110
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
111
|
+
const result = removeBlockFromString(content, blockId, importModuleSpecifiers);
|
|
112
|
+
if (result !== content) {
|
|
113
|
+
fs.writeFileSync(filePath, result, 'utf-8');
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Removes a delimited code block from a main.ts source string (in-memory, no filesystem access).
|
|
118
|
+
* Returns the transformed source text.
|
|
119
|
+
*/
|
|
120
|
+
export function removeBlockFromString(source, blockId, importModuleSpecifiers) {
|
|
121
|
+
let content = source;
|
|
122
|
+
const startMarker = START_MARKER(blockId);
|
|
123
|
+
const endMarker = END_MARKER(blockId);
|
|
124
|
+
const startIdx = content.indexOf(startMarker);
|
|
125
|
+
const endIdx = content.indexOf(endMarker);
|
|
126
|
+
if (startIdx === -1 || endIdx === -1 || endIdx < startIdx)
|
|
127
|
+
return content;
|
|
128
|
+
const lineStartIdx = content.lastIndexOf('\n', startIdx);
|
|
129
|
+
const lineEndIdx = content.indexOf('\n', endIdx + endMarker.length);
|
|
130
|
+
const before = lineStartIdx >= 0 ? content.slice(0, lineStartIdx) : '';
|
|
131
|
+
const after = lineEndIdx >= 0 ? content.slice(lineEndIdx) : '';
|
|
132
|
+
content = before + after;
|
|
133
|
+
for (const specifier of importModuleSpecifiers) {
|
|
134
|
+
const importRegex = new RegExp(`^import\\s+.*from\\s+['"]${escapeRegex(specifier)}['"];?\\s*\\n?`, 'gm');
|
|
135
|
+
content = content.replace(importRegex, '');
|
|
136
|
+
}
|
|
137
|
+
content = content.replace(/\n{3,}/g, '\n\n');
|
|
138
|
+
content = content.trimEnd() + '\n';
|
|
139
|
+
return content;
|
|
140
|
+
}
|
|
141
|
+
function escapeRegex(str) {
|
|
142
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=main-ts-updater.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main-ts-updater.js","sourceRoot":"","sources":["../../src/utils/main-ts-updater.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAa9B,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,UAAU,OAAO,YAAY,CAAC;AACxE,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,UAAU,OAAO,UAAU,CAAC;AAEpE,SAAS,qBAAqB,CAAC,GAAgB;IAC7C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,GAAG,CAAC,aAAa;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACrD,IAAI,GAAG,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClF,OAAO,UAAU,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,eAAe,IAAI,CAAC;AACrE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB,EAAE,OAAe,EAAE,KAAsB;IACnF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,C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[...] }) array
|
|
5
|
+
*
|
|
6
|
+
* Idempotent: skips if the import path already exists.
|
|
7
|
+
*/
|
|
8
|
+
export declare function addModuleImport(filePath: string, moduleName: string, importPath: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Adds a module import to an app.module.ts source string (in-memory, no filesystem access).
|
|
11
|
+
* Returns the transformed source text.
|
|
12
|
+
*/
|
|
13
|
+
export declare function addModuleImportToString(source: string, moduleName: string, importPath: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Removes a module import from app.module.ts:
|
|
16
|
+
* 1. Removes the import declaration matching the import path
|
|
17
|
+
* 2. Removes the module name from the @Module({ imports: [...] }) array
|
|
18
|
+
*
|
|
19
|
+
* No-op if the import is not present.
|
|
20
|
+
*/
|
|
21
|
+
export declare function removeModuleImport(filePath: string, moduleName: string, importPath: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Removes a module import from an app.module.ts source string (in-memory, no filesystem access).
|
|
24
|
+
* Returns the transformed source text.
|
|
25
|
+
*/
|
|
26
|
+
export declare function removeModuleImportFromString(source: string, moduleName: string, importPath: string): string;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { Project, SyntaxKind } from 'ts-morph';
|
|
2
|
+
/**
|
|
3
|
+
* Adds a module import to app.module.ts:
|
|
4
|
+
* 1. Adds an import declaration at the top of the file
|
|
5
|
+
* 2. Adds the module name to the @Module({ imports: [...] }) array
|
|
6
|
+
*
|
|
7
|
+
* Idempotent: skips if the import path already exists.
|
|
8
|
+
*/
|
|
9
|
+
export function addModuleImport(filePath, moduleName, importPath) {
|
|
10
|
+
const project = new Project({ useInMemoryFileSystem: false });
|
|
11
|
+
const sourceFile = project.addSourceFileAtPath(filePath);
|
|
12
|
+
// Guard: skip if import already exists
|
|
13
|
+
const existing = sourceFile.getImportDeclaration((decl) => decl.getModuleSpecifierValue() === importPath);
|
|
14
|
+
if (existing)
|
|
15
|
+
return;
|
|
16
|
+
// Add import declaration
|
|
17
|
+
sourceFile.addImportDeclaration({
|
|
18
|
+
namedImports: [moduleName],
|
|
19
|
+
moduleSpecifier: importPath,
|
|
20
|
+
});
|
|
21
|
+
// Find the AppModule class and its @Module decorator
|
|
22
|
+
const appModuleClass = sourceFile.getClasses().find((c) => c.getDecorator('Module'));
|
|
23
|
+
if (!appModuleClass) {
|
|
24
|
+
throw new Error('No class with @Module decorator found');
|
|
25
|
+
}
|
|
26
|
+
const moduleDecorator = appModuleClass.getDecorator('Module');
|
|
27
|
+
const args = moduleDecorator.getArguments();
|
|
28
|
+
if (args.length === 0) {
|
|
29
|
+
throw new Error('@Module decorator has no arguments');
|
|
30
|
+
}
|
|
31
|
+
const objectLiteral = args[0];
|
|
32
|
+
const importsProp = objectLiteral.getProperty('imports');
|
|
33
|
+
if (importsProp) {
|
|
34
|
+
// Append to existing imports array
|
|
35
|
+
const initializer = importsProp
|
|
36
|
+
.asKindOrThrow(SyntaxKind.PropertyAssignment)
|
|
37
|
+
.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression);
|
|
38
|
+
initializer.addElement(moduleName);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// Create imports property with array if it doesn't exist
|
|
42
|
+
objectLiteral.addPropertyAssignment({
|
|
43
|
+
name: 'imports',
|
|
44
|
+
initializer: `[${moduleName}]`,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
sourceFile.formatText();
|
|
48
|
+
sourceFile.saveSync();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Adds a module import to an app.module.ts source string (in-memory, no filesystem access).
|
|
52
|
+
* Returns the transformed source text.
|
|
53
|
+
*/
|
|
54
|
+
export function addModuleImportToString(source, moduleName, importPath) {
|
|
55
|
+
const project = new Project({ useInMemoryFileSystem: true });
|
|
56
|
+
const sourceFile = project.createSourceFile('app.module.ts', source);
|
|
57
|
+
// Guard: skip if import already exists
|
|
58
|
+
const existing = sourceFile.getImportDeclaration((decl) => decl.getModuleSpecifierValue() === importPath);
|
|
59
|
+
if (existing)
|
|
60
|
+
return sourceFile.getFullText();
|
|
61
|
+
// Add import declaration
|
|
62
|
+
sourceFile.addImportDeclaration({
|
|
63
|
+
namedImports: [moduleName],
|
|
64
|
+
moduleSpecifier: importPath,
|
|
65
|
+
});
|
|
66
|
+
// Find the AppModule class and its @Module decorator
|
|
67
|
+
const appModuleClass = sourceFile.getClasses().find((c) => c.getDecorator('Module'));
|
|
68
|
+
if (!appModuleClass) {
|
|
69
|
+
throw new Error('No class with @Module decorator found');
|
|
70
|
+
}
|
|
71
|
+
const moduleDecorator = appModuleClass.getDecorator('Module');
|
|
72
|
+
const args = moduleDecorator.getArguments();
|
|
73
|
+
if (args.length === 0) {
|
|
74
|
+
throw new Error('@Module decorator has no arguments');
|
|
75
|
+
}
|
|
76
|
+
const objectLiteral = args[0];
|
|
77
|
+
const importsProp = objectLiteral.getProperty('imports');
|
|
78
|
+
if (importsProp) {
|
|
79
|
+
const initializer = importsProp
|
|
80
|
+
.asKindOrThrow(SyntaxKind.PropertyAssignment)
|
|
81
|
+
.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression);
|
|
82
|
+
initializer.addElement(moduleName);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
objectLiteral.addPropertyAssignment({
|
|
86
|
+
name: 'imports',
|
|
87
|
+
initializer: `[${moduleName}]`,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
sourceFile.formatText();
|
|
91
|
+
return sourceFile.getFullText();
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Removes a module import from app.module.ts:
|
|
95
|
+
* 1. Removes the import declaration matching the import path
|
|
96
|
+
* 2. Removes the module name from the @Module({ imports: [...] }) array
|
|
97
|
+
*
|
|
98
|
+
* No-op if the import is not present.
|
|
99
|
+
*/
|
|
100
|
+
export function removeModuleImport(filePath, moduleName, importPath) {
|
|
101
|
+
const project = new Project({ useInMemoryFileSystem: false });
|
|
102
|
+
const sourceFile = project.addSourceFileAtPath(filePath);
|
|
103
|
+
// Check if import declaration exists — if not, nothing to do
|
|
104
|
+
const importDecl = sourceFile.getImportDeclaration((decl) => decl.getModuleSpecifierValue() === importPath);
|
|
105
|
+
if (!importDecl)
|
|
106
|
+
return;
|
|
107
|
+
// Remove import declaration
|
|
108
|
+
importDecl.remove();
|
|
109
|
+
// Remove from @Module imports array
|
|
110
|
+
const appModuleClass = sourceFile.getClasses().find((c) => c.getDecorator('Module'));
|
|
111
|
+
if (!appModuleClass)
|
|
112
|
+
return;
|
|
113
|
+
const moduleDecorator = appModuleClass.getDecorator('Module');
|
|
114
|
+
const args = moduleDecorator.getArguments();
|
|
115
|
+
if (args.length === 0)
|
|
116
|
+
return;
|
|
117
|
+
const objectLiteral = args[0];
|
|
118
|
+
const importsProp = objectLiteral.getProperty('imports');
|
|
119
|
+
if (!importsProp)
|
|
120
|
+
return;
|
|
121
|
+
const initializer = importsProp
|
|
122
|
+
.asKindOrThrow(SyntaxKind.PropertyAssignment)
|
|
123
|
+
.getInitializerIfKind(SyntaxKind.ArrayLiteralExpression);
|
|
124
|
+
if (!initializer)
|
|
125
|
+
return;
|
|
126
|
+
const elementIndex = initializer.getElements().findIndex((e) => e.getText() === moduleName);
|
|
127
|
+
if (elementIndex >= 0) {
|
|
128
|
+
initializer.removeElement(elementIndex);
|
|
129
|
+
}
|
|
130
|
+
sourceFile.formatText();
|
|
131
|
+
sourceFile.saveSync();
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Removes a module import from an app.module.ts source string (in-memory, no filesystem access).
|
|
135
|
+
* Returns the transformed source text.
|
|
136
|
+
*/
|
|
137
|
+
export function removeModuleImportFromString(source, moduleName, importPath) {
|
|
138
|
+
const project = new Project({ useInMemoryFileSystem: true });
|
|
139
|
+
const sourceFile = project.createSourceFile('app.module.ts', source);
|
|
140
|
+
const importDecl = sourceFile.getImportDeclaration((decl) => decl.getModuleSpecifierValue() === importPath);
|
|
141
|
+
if (!importDecl)
|
|
142
|
+
return sourceFile.getFullText();
|
|
143
|
+
importDecl.remove();
|
|
144
|
+
const appModuleClass = sourceFile.getClasses().find((c) => c.getDecorator('Module'));
|
|
145
|
+
if (!appModuleClass)
|
|
146
|
+
return sourceFile.getFullText();
|
|
147
|
+
const moduleDecorator = appModuleClass.getDecorator('Module');
|
|
148
|
+
const args = moduleDecorator.getArguments();
|
|
149
|
+
if (args.length === 0)
|
|
150
|
+
return sourceFile.getFullText();
|
|
151
|
+
const objectLiteral = args[0];
|
|
152
|
+
const importsProp = objectLiteral.getProperty('imports');
|
|
153
|
+
if (!importsProp)
|
|
154
|
+
return sourceFile.getFullText();
|
|
155
|
+
const initializer = importsProp
|
|
156
|
+
.asKindOrThrow(SyntaxKind.PropertyAssignment)
|
|
157
|
+
.getInitializerIfKind(SyntaxKind.ArrayLiteralExpression);
|
|
158
|
+
if (!initializer)
|
|
159
|
+
return sourceFile.getFullText();
|
|
160
|
+
const elementIndex = initializer.getElements().findIndex((e) => e.getText() === moduleName);
|
|
161
|
+
if (elementIndex >= 0) {
|
|
162
|
+
initializer.removeElement(elementIndex);
|
|
163
|
+
}
|
|
164
|
+
sourceFile.formatText();
|
|
165
|
+
return sourceFile.getFullText();
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=module-updater.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-updater.js","sourceRoot":"","sources":["../../src/utils/module-updater.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAgC,MAAM,UAAU,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB,EAAE,UAAkB,EAAE,UAAkB;IACtF,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,qBAAqB,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9D,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAEzD,uCAAuC;IACvC,MAAM,QAAQ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1,24 @@
|
|
|
1
|
+
export interface RecipeManifestEntry {
|
|
2
|
+
installedAt: string;
|
|
3
|
+
version: string;
|
|
4
|
+
files: string[];
|
|
5
|
+
mainTsBlocks?: string[];
|
|
6
|
+
envSection?: string;
|
|
7
|
+
moduleImport?: {
|
|
8
|
+
moduleName: string;
|
|
9
|
+
importPath: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface SpoonfeederManifest {
|
|
13
|
+
projectType: string;
|
|
14
|
+
cloudProvider: string;
|
|
15
|
+
spoonfeederVersion: string;
|
|
16
|
+
generatedAt: string;
|
|
17
|
+
recipes: Record<string, RecipeManifestEntry>;
|
|
18
|
+
}
|
|
19
|
+
export declare function readManifest(projectDir: string): SpoonfeederManifest | null;
|
|
20
|
+
export declare function writeManifest(projectDir: string, manifest: SpoonfeederManifest): void;
|
|
21
|
+
export declare function addRecipeToManifest(projectDir: string, recipeId: string, entry: Omit<RecipeManifestEntry, 'installedAt' | 'version'>): void;
|
|
22
|
+
export declare function removeRecipeFromManifest(projectDir: string, recipeId: string): void;
|
|
23
|
+
export declare function isRecipeInstalled(projectDir: string, recipeId: string): boolean;
|
|
24
|
+
export declare function getInstalledRecipeIds(projectDir: string): string[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
const MANIFEST_FILE = '.spoonfeeder.json';
|
|
4
|
+
export function readManifest(projectDir) {
|
|
5
|
+
const filePath = path.join(projectDir, MANIFEST_FILE);
|
|
6
|
+
if (!fs.existsSync(filePath))
|
|
7
|
+
return null;
|
|
8
|
+
try {
|
|
9
|
+
return JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
10
|
+
}
|
|
11
|
+
catch (e) {
|
|
12
|
+
throw new Error(`.spoonfeeder.json contains invalid JSON: ${e instanceof Error ? e.message : String(e)}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function writeManifest(projectDir, manifest) {
|
|
16
|
+
const filePath = path.join(projectDir, MANIFEST_FILE);
|
|
17
|
+
fs.writeFileSync(filePath, JSON.stringify(manifest, null, 2) + '\n', 'utf-8');
|
|
18
|
+
}
|
|
19
|
+
export function addRecipeToManifest(projectDir, recipeId, entry) {
|
|
20
|
+
const manifest = readManifest(projectDir);
|
|
21
|
+
if (!manifest)
|
|
22
|
+
throw new Error('.spoonfeeder.json not found');
|
|
23
|
+
manifest.recipes[recipeId] = {
|
|
24
|
+
...entry,
|
|
25
|
+
installedAt: new Date().toISOString(),
|
|
26
|
+
version: manifest.spoonfeederVersion ?? '0.0.1',
|
|
27
|
+
};
|
|
28
|
+
writeManifest(projectDir, manifest);
|
|
29
|
+
}
|
|
30
|
+
export function removeRecipeFromManifest(projectDir, recipeId) {
|
|
31
|
+
const manifest = readManifest(projectDir);
|
|
32
|
+
if (!manifest)
|
|
33
|
+
throw new Error('.spoonfeeder.json not found');
|
|
34
|
+
delete manifest.recipes[recipeId];
|
|
35
|
+
writeManifest(projectDir, manifest);
|
|
36
|
+
}
|
|
37
|
+
export function isRecipeInstalled(projectDir, recipeId) {
|
|
38
|
+
const manifest = readManifest(projectDir);
|
|
39
|
+
return !!manifest?.recipes[recipeId];
|
|
40
|
+
}
|
|
41
|
+
export function getInstalledRecipeIds(projectDir) {
|
|
42
|
+
const manifest = readManifest(projectDir);
|
|
43
|
+
return manifest ? Object.keys(manifest.recipes) : [];
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=recipe-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipe-manifest.js","sourceRoot":"","sources":["../../src/utils/recipe-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAsBlC,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAE1C,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,MAAM,QA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,CAAC,UAAkB,EAAE,QAAgB;IAC3E,MAAM,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAE9D,OAAO,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAAkB,EAAE,QAAgB;IACpE,MAAM,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IAC1C,OAAO,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,UAAkB;IACtD,MAAM,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IAC1C,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ProjectConfig } from '../types.js';
|
|
2
|
+
export interface ConfigValidationError {
|
|
3
|
+
field: string;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export type ConfigValidationResult = {
|
|
7
|
+
success: true;
|
|
8
|
+
config: ProjectConfig;
|
|
9
|
+
} | {
|
|
10
|
+
success: false;
|
|
11
|
+
errors: ConfigValidationError[];
|
|
12
|
+
};
|
|
13
|
+
export declare function validateConfig(config: ProjectConfig): ConfigValidationResult;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PROJECT_TYPES, CLOUD_PROVIDERS, TRANSPORT_LAYERS, FRONTEND_FRAMEWORKS, DEPLOYMENT_TARGETS, CI_CD_PROVIDERS, RECIPE_IDS, } from '../types.js';
|
|
3
|
+
const projectNameRegex = /^[a-z0-9][a-z0-9-]*$/;
|
|
4
|
+
const projectConfigSchema = z
|
|
5
|
+
.object({
|
|
6
|
+
name: z
|
|
7
|
+
.string()
|
|
8
|
+
.min(1, 'Project name is required')
|
|
9
|
+
.regex(projectNameRegex, 'Use lowercase letters, numbers, and hyphens only'),
|
|
10
|
+
scope: z
|
|
11
|
+
.string()
|
|
12
|
+
.regex(/^@[a-z0-9-]+$/, 'Scope must start with @ and use lowercase')
|
|
13
|
+
.optional(),
|
|
14
|
+
projectType: z.enum(PROJECT_TYPES),
|
|
15
|
+
cloudProvider: z.enum(CLOUD_PROVIDERS),
|
|
16
|
+
recipes: z.array(z.enum(RECIPE_IDS)),
|
|
17
|
+
transportLayer: z.enum(TRANSPORT_LAYERS).optional(),
|
|
18
|
+
frontendFramework: z.enum(FRONTEND_FRAMEWORKS).optional(),
|
|
19
|
+
deploymentTargets: z.array(z.enum(DEPLOYMENT_TARGETS)),
|
|
20
|
+
ciCdProvider: z.enum(CI_CD_PROVIDERS).optional(),
|
|
21
|
+
outputDir: z.string().min(1),
|
|
22
|
+
})
|
|
23
|
+
.superRefine((data, ctx) => {
|
|
24
|
+
if (data.projectType === 'microservice' && !data.transportLayer) {
|
|
25
|
+
ctx.addIssue({
|
|
26
|
+
code: 'custom',
|
|
27
|
+
message: 'Transport layer is required for microservice projects',
|
|
28
|
+
path: ['transportLayer'],
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (data.projectType === 'full-stack' && !data.frontendFramework) {
|
|
32
|
+
ctx.addIssue({
|
|
33
|
+
code: 'custom',
|
|
34
|
+
message: 'Frontend framework is required for full-stack projects',
|
|
35
|
+
path: ['frontendFramework'],
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export function validateConfig(config) {
|
|
40
|
+
const result = projectConfigSchema.safeParse(config);
|
|
41
|
+
if (result.success) {
|
|
42
|
+
return { success: true, config: result.data };
|
|
43
|
+
}
|
|
44
|
+
const errors = result.error.issues.map((issue) => ({
|
|
45
|
+
field: issue.path.join('.') || 'unknown',
|
|
46
|
+
message: issue.message,
|
|
47
|
+
}));
|
|
48
|
+
return { success: false, errors };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=config-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-validator.js","sourceRoot":"","sources":["../../src/validation/config-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,UAAU,GACX,MAAM,aAAa,CAAC;AAGrB,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD,MAAM,mBAAmB,GAAG,CAAC;KAC1B,MAAM,CAAC;IACN,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,0BAA0B,CAAC;SAClC,KAAK,CAAC,gBAAgB,EAAE,kDAAkD,CAAC;IAC9E,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,KAAK,CAAC,eAAe,EAAE,2CAA2C,CAAC;SACnE,QAAQ,EAAE;IACb,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;IAClC,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;IACnD,iBAAiB,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;IACzD,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACtD,YAAY,EA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AE,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RecipeId, RecipeDefinition } from '../types.js';
|
|
2
|
+
export interface Conflict {
|
|
3
|
+
type: 'mutual-exclusion' | 'missing-requirement';
|
|
4
|
+
recipes: RecipeId[];
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function detectConflicts(selectedIds: RecipeId[], allRecipes?: RecipeDefinition[]): Conflict[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function detectConflicts(selectedIds, allRecipes = []) {
|
|
2
|
+
const conflicts = [];
|
|
3
|
+
const selectedSet = new Set(selectedIds);
|
|
4
|
+
const recipeMap = new Map(allRecipes.map((r) => [r.id, r]));
|
|
5
|
+
// Check mutual exclusions
|
|
6
|
+
for (const id of selectedIds) {
|
|
7
|
+
const recipe = recipeMap.get(id);
|
|
8
|
+
if (!recipe)
|
|
9
|
+
continue;
|
|
10
|
+
for (const conflictId of recipe.conflicts) {
|
|
11
|
+
if (selectedSet.has(conflictId) && id < conflictId) {
|
|
12
|
+
conflicts.push({
|
|
13
|
+
type: 'mutual-exclusion',
|
|
14
|
+
recipes: [id, conflictId],
|
|
15
|
+
message: `${recipe.name} conflicts with ${recipeMap.get(conflictId)?.name ?? conflictId}`,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// Check missing requirements
|
|
21
|
+
for (const id of selectedIds) {
|
|
22
|
+
const recipe = recipeMap.get(id);
|
|
23
|
+
if (!recipe)
|
|
24
|
+
continue;
|
|
25
|
+
for (const reqId of recipe.requires) {
|
|
26
|
+
if (!selectedSet.has(reqId)) {
|
|
27
|
+
conflicts.push({
|
|
28
|
+
type: 'missing-requirement',
|
|
29
|
+
recipes: [id, reqId],
|
|
30
|
+
message: `${recipe.name} requires ${recipeMap.get(reqId)?.name ?? reqId}`,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return conflicts;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=conflict-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflict-detector.js","sourceRoot":"","sources":["../../src/validation/conflict-detector.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,eAAe,CAC7B,WAAuB,EACvB,aAAiC,EAAE;IAEnC,MAAM,SAAS,GAAe,EAAE,CAAC;IACjC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5D,0BAA0B;IAC1B,KAAK,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,MAAM;YAAE,SAAS;QAEtB,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YAC1C,IAAI,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,UAAU,EAAE,CAAC;gBACnD,SAAS,CAAC,IAAI,CAAC;oBACb,IAAI,EAAE,kBAAkB;oBACxB,OAAO,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC;oBACzB,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,mBAAmB,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,IAAI,IAAI,UAAU,EAAE;iBAC1F,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,6BAA6B;IAC7B,KAAK,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,MAAM;YAAE,SAAS;QAEtB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,SAAS,CAAC,IAAI,CAAC;oBACb,IAAI,EAAE,qBAAqB;oBAC3B,OAAO,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC;oBACpB,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,aAAa,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,IAAI,KAAK,EAAE;iBAC1E,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/generators.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generators": {
|
|
3
|
+
"add": {
|
|
4
|
+
"factory": "./dist/generators/add-recipe/generator",
|
|
5
|
+
"schema": "./src/generators/add-recipe/schema.json",
|
|
6
|
+
"description": "Add a recipe to an existing project"
|
|
7
|
+
},
|
|
8
|
+
"list": {
|
|
9
|
+
"factory": "./dist/generators/list-recipes/generator",
|
|
10
|
+
"schema": "./src/generators/list-recipes/schema.json",
|
|
11
|
+
"description": "List installed and available recipes"
|
|
12
|
+
},
|
|
13
|
+
"remove": {
|
|
14
|
+
"factory": "./dist/generators/remove-recipe/generator",
|
|
15
|
+
"schema": "./src/generators/remove-recipe/schema.json",
|
|
16
|
+
"description": "Remove a recipe from an existing project"
|
|
17
|
+
},
|
|
18
|
+
"migrate": {
|
|
19
|
+
"factory": "./dist/generators/migrate-recipe/generator",
|
|
20
|
+
"schema": "./src/generators/migrate-recipe/schema.json",
|
|
21
|
+
"description": "Migrate from one recipe to another within the same category"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|