zudojs-cli 0.1.2 → 1.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 +26 -3
- package/dist/src/adapters/databases/postgres.adapter.d.ts +0 -14
- package/dist/src/adapters/databases/postgres.adapter.js +0 -30
- package/dist/src/adapters/frontend/angular.adapter.js +6 -0
- package/dist/src/adapters/frontend/astro.adapter.js +2 -2
- package/dist/src/adapters/frontend/frontendAdapter.type.d.ts +6 -0
- package/dist/src/adapters/frontend/react.adapter.js +26 -17
- package/dist/src/adapters/frontend/svelte.adapter.js +1 -0
- package/dist/src/adapters/frontend/sveltekit.adapter.js +7 -8
- package/dist/src/adapters/frontend/vanilla.adapter.js +1 -1
- package/dist/src/adapters/frontend/vue.adapter.js +1 -0
- package/dist/src/adapters/package-managers/bun.adapter.js +5 -5
- package/dist/src/adapters/package-managers/npm.adapter.js +5 -5
- package/dist/src/adapters/package-managers/pnpm.adapter.js +5 -5
- package/dist/src/adapters/package-managers/yarn.adapter.js +5 -5
- package/dist/src/bin/zudojs.js +23 -11
- package/dist/src/cliApplication/cliApplication.builtins.d.ts +11 -2
- package/dist/src/cliApplication/cliApplication.builtins.js +15 -4
- package/dist/src/cliApplication/cliApplication.core.js +22 -7
- package/dist/src/cliApplication/cliApplication.logger.d.ts +28 -0
- package/dist/src/cliApplication/cliApplication.logger.js +68 -0
- package/dist/src/cliApplication/index.d.ts +1 -3
- package/dist/src/cliApplication/index.js +1 -3
- package/dist/src/cliConstant/cliConstant.value.d.ts +1 -1
- package/dist/src/cliConstant/cliConstant.value.js +2 -1
- package/dist/src/cliConstant/cliVersion.d.ts +16 -0
- package/dist/src/cliConstant/cliVersion.js +57 -0
- package/dist/src/cliParser/cliParser.core.js +7 -0
- package/dist/src/cliParser/cliParser.shortOption.js +1 -1
- package/dist/src/cliVersion/cliVersion.update.d.ts +38 -0
- package/dist/src/cliVersion/cliVersion.update.js +63 -0
- package/dist/src/cliVersion/index.d.ts +2 -1
- package/dist/src/cliVersion/index.js +2 -1
- package/dist/src/commands/add.command.d.ts +29 -0
- package/dist/src/commands/add.command.js +95 -107
- package/dist/src/commands/build.command.d.ts +8 -0
- package/dist/src/commands/build.command.js +24 -24
- package/dist/src/commands/create.command.js +176 -55
- package/dist/src/commands/dev.command.d.ts +30 -2
- package/dist/src/commands/dev.command.js +106 -150
- package/dist/src/commands/doctor.command.d.ts +18 -0
- package/dist/src/commands/doctor.command.js +160 -110
- package/dist/src/commands/generate.command.d.ts +2 -1
- package/dist/src/commands/generate.command.js +91 -41
- package/dist/src/commands/info.command.js +61 -30
- package/dist/src/constants/index.d.ts +19 -1
- package/dist/src/constants/index.js +32 -1
- package/dist/src/generators/command/command.generator.d.ts +1 -0
- package/dist/src/generators/command/command.generator.js +10 -4
- package/dist/src/generators/controller/controller.generator.d.ts +1 -0
- package/dist/src/generators/controller/controller.generator.js +12 -9
- package/dist/src/generators/dto/dto.generator.d.ts +1 -0
- package/dist/src/generators/dto/dto.generator.js +9 -3
- package/dist/src/generators/event/event.generator.d.ts +1 -0
- package/dist/src/generators/event/event.generator.js +10 -4
- package/dist/src/generators/frontend/frontendGenerator.core.d.ts +2 -0
- package/dist/src/generators/frontend/frontendGenerator.core.js +14 -27
- package/dist/src/generators/frontend/frontendPipeline.d.ts +26 -0
- package/dist/src/generators/frontend/frontendPipeline.js +136 -0
- package/dist/src/generators/fullstack/fullstackComposer.core.d.ts +3 -2
- package/dist/src/generators/fullstack/fullstackComposer.core.js +58 -43
- package/dist/src/generators/infrastructure/infrastructure.generator.d.ts +11 -0
- package/dist/src/generators/infrastructure/infrastructure.generator.js +101 -61
- package/dist/src/generators/integration/integrationGenerator.core.d.ts +6 -0
- package/dist/src/generators/integration/integrationGenerator.core.js +35 -6
- package/dist/src/generators/job/job.generator.d.ts +1 -0
- package/dist/src/generators/job/job.generator.js +9 -3
- package/dist/src/generators/middleware/middleware.generator.d.ts +1 -0
- package/dist/src/generators/middleware/middleware.generator.js +10 -4
- package/dist/src/generators/model/model.generator.d.ts +1 -0
- package/dist/src/generators/model/model.generator.js +9 -3
- package/dist/src/generators/module/module.generator.d.ts +1 -0
- package/dist/src/generators/module/module.generator.js +11 -24
- package/dist/src/generators/project/project.generator.js +2 -23
- package/dist/src/generators/query/query.generator.d.ts +1 -0
- package/dist/src/generators/query/query.generator.js +10 -4
- package/dist/src/generators/repository/repository.generator.d.ts +1 -0
- package/dist/src/generators/repository/repository.generator.js +12 -9
- package/dist/src/generators/route/route.generator.d.ts +1 -0
- package/dist/src/generators/route/route.generator.js +11 -5
- package/dist/src/generators/service/service.generator.d.ts +1 -0
- package/dist/src/generators/service/service.generator.js +12 -9
- package/dist/src/generators/validator/validator.generator.d.ts +1 -0
- package/dist/src/generators/validator/validator.generator.js +9 -3
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.js +3 -2
- package/dist/src/installers/dependency.installer.d.ts +9 -0
- package/dist/src/installers/dependency.installer.js +27 -2
- package/dist/src/installers/index.d.ts +1 -3
- package/dist/src/installers/index.js +1 -3
- package/dist/src/manifest/manifestManager.core.d.ts +3 -0
- package/dist/src/prompts/backend/index.d.ts +1 -0
- package/dist/src/prompts/backend/index.js +1 -0
- package/dist/src/prompts/backend/services.prompt.d.ts +7 -0
- package/dist/src/prompts/backend/services.prompt.js +39 -0
- package/dist/src/prompts/index.d.ts +0 -1
- package/dist/src/prompts/index.js +0 -1
- package/dist/src/resolvers/architecture.resolver.d.ts +11 -1
- package/dist/src/resolvers/architecture.resolver.js +12 -13
- package/dist/src/resolvers/configuration/configurationResolver.core.d.ts +10 -1
- package/dist/src/resolvers/configuration/configurationResolver.core.js +68 -29
- package/dist/src/resolvers/index.d.ts +1 -0
- package/dist/src/resolvers/index.js +1 -0
- package/dist/src/resolvers/layout/index.d.ts +5 -0
- package/dist/src/resolvers/layout/index.js +5 -0
- package/dist/src/resolvers/layout/projectLayout.core.d.ts +60 -0
- package/dist/src/resolvers/layout/projectLayout.core.js +236 -0
- package/dist/src/resolvers/project.resolver.d.ts +5 -0
- package/dist/src/resolvers/project.resolver.js +10 -6
- package/dist/src/rollback/rollbackManager.core.js +0 -1
- package/dist/src/runners/process/processRunner.core.d.ts +4 -0
- package/dist/src/runners/process/processRunner.core.js +17 -3
- package/dist/src/scaffolders/framework.scaffolder.js +9 -6
- package/dist/src/scaffolders/scaffolder.helper.js +7 -2
- package/dist/src/templates/microservice/index.d.ts +1 -1
- package/dist/src/templates/microservice/index.js +1 -1
- package/dist/src/templates/microservice/microservice.template.d.ts +14 -0
- package/dist/src/templates/microservice/microservice.template.js +140 -162
- package/dist/src/templates/modular-monolith/modularMonolith.template.d.ts +0 -1
- package/dist/src/templates/modular-monolith/modularMonolith.template.js +43 -77
- package/dist/src/templates/monolith/monolith.template.d.ts +1 -1
- package/dist/src/templates/monolith/monolith.template.js +46 -69
- package/dist/src/templates/shared/appRuntime.template.d.ts +60 -0
- package/dist/src/templates/shared/appRuntime.template.js +189 -0
- package/dist/src/templates/shared/index.d.ts +6 -0
- package/dist/src/templates/shared/index.js +6 -0
- package/dist/src/templates/shared/pnpm.template.d.ts +27 -0
- package/dist/src/templates/shared/pnpm.template.js +57 -0
- package/dist/src/utils/index.d.ts +3 -3
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/utils.detect.d.ts +9 -0
- package/dist/src/utils/utils.detect.js +11 -11
- package/dist/src/utils/utils.exec.d.ts +35 -1
- package/dist/src/utils/utils.exec.js +99 -4
- package/dist/src/utils/utils.fileSystem.d.ts +6 -0
- package/dist/src/utils/utils.fileSystem.js +19 -0
- package/dist/src/utils/utils.name.d.ts +26 -0
- package/dist/src/utils/utils.name.js +51 -1
- package/package.json +32 -23
- package/dist/.tsbuildinfo +0 -1
- package/dist/src/adapters/databases/index.d.ts.map +0 -1
- package/dist/src/adapters/databases/index.js.map +0 -1
- package/dist/src/adapters/databases/mysql.adapter.d.ts.map +0 -1
- package/dist/src/adapters/databases/mysql.adapter.js.map +0 -1
- package/dist/src/adapters/databases/postgres.adapter.d.ts.map +0 -1
- package/dist/src/adapters/databases/postgres.adapter.js.map +0 -1
- package/dist/src/adapters/databases/sqlite.adapter.d.ts.map +0 -1
- package/dist/src/adapters/databases/sqlite.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/angular.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/angular.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/astro.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/astro.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/flutter.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/flutter.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/frontendAdapter.type.d.ts.map +0 -1
- package/dist/src/adapters/frontend/frontendAdapter.type.js.map +0 -1
- package/dist/src/adapters/frontend/index.d.ts.map +0 -1
- package/dist/src/adapters/frontend/index.js.map +0 -1
- package/dist/src/adapters/frontend/next.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/next.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/nuxt.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/nuxt.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/react-native.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/react-native.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/react.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/react.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/svelte.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/svelte.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/sveltekit.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/sveltekit.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/vanilla.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/vanilla.adapter.js.map +0 -1
- package/dist/src/adapters/frontend/vue.adapter.d.ts.map +0 -1
- package/dist/src/adapters/frontend/vue.adapter.js.map +0 -1
- package/dist/src/adapters/package-managers/bun.adapter.d.ts.map +0 -1
- package/dist/src/adapters/package-managers/bun.adapter.js.map +0 -1
- package/dist/src/adapters/package-managers/index.d.ts.map +0 -1
- package/dist/src/adapters/package-managers/index.js.map +0 -1
- package/dist/src/adapters/package-managers/npm.adapter.d.ts.map +0 -1
- package/dist/src/adapters/package-managers/npm.adapter.js.map +0 -1
- package/dist/src/adapters/package-managers/packageManager.type.d.ts.map +0 -1
- package/dist/src/adapters/package-managers/packageManager.type.js.map +0 -1
- package/dist/src/adapters/package-managers/pnpm.adapter.d.ts.map +0 -1
- package/dist/src/adapters/package-managers/pnpm.adapter.js.map +0 -1
- package/dist/src/adapters/package-managers/yarn.adapter.d.ts.map +0 -1
- package/dist/src/adapters/package-managers/yarn.adapter.js.map +0 -1
- package/dist/src/bin/zudojs.d.ts.map +0 -1
- package/dist/src/bin/zudojs.js.map +0 -1
- package/dist/src/cliApplication/cliApplication.builtins.d.ts.map +0 -1
- package/dist/src/cliApplication/cliApplication.builtins.js.map +0 -1
- package/dist/src/cliApplication/cliApplication.core.d.ts.map +0 -1
- package/dist/src/cliApplication/cliApplication.core.js.map +0 -1
- package/dist/src/cliApplication/cliApplication.writer.d.ts.map +0 -1
- package/dist/src/cliApplication/cliApplication.writer.js.map +0 -1
- package/dist/src/cliApplication/index.d.ts.map +0 -1
- package/dist/src/cliApplication/index.js.map +0 -1
- package/dist/src/cliCommand/cliCommand.builder.d.ts.map +0 -1
- package/dist/src/cliCommand/cliCommand.builder.js.map +0 -1
- package/dist/src/cliCommand/cliCommand.factory.d.ts.map +0 -1
- package/dist/src/cliCommand/cliCommand.factory.js.map +0 -1
- package/dist/src/cliCommand/cliCommand.registry.d.ts.map +0 -1
- package/dist/src/cliCommand/cliCommand.registry.js.map +0 -1
- package/dist/src/cliCommand/cliCommand.validator.d.ts.map +0 -1
- package/dist/src/cliCommand/cliCommand.validator.js.map +0 -1
- package/dist/src/cliCommand/index.d.ts.map +0 -1
- package/dist/src/cliCommand/index.js.map +0 -1
- package/dist/src/cliConstant/cliConstant.value.d.ts.map +0 -1
- package/dist/src/cliConstant/cliConstant.value.js.map +0 -1
- package/dist/src/cliConstant/index.d.ts.map +0 -1
- package/dist/src/cliConstant/index.js.map +0 -1
- package/dist/src/cliError/cliError.argument.d.ts.map +0 -1
- package/dist/src/cliError/cliError.argument.js.map +0 -1
- package/dist/src/cliError/cliError.base.d.ts.map +0 -1
- package/dist/src/cliError/cliError.base.js.map +0 -1
- package/dist/src/cliError/cliError.command.d.ts.map +0 -1
- package/dist/src/cliError/cliError.command.js.map +0 -1
- package/dist/src/cliError/cliError.execution.d.ts.map +0 -1
- package/dist/src/cliError/cliError.execution.js.map +0 -1
- package/dist/src/cliError/cliError.option.d.ts.map +0 -1
- package/dist/src/cliError/cliError.option.js.map +0 -1
- package/dist/src/cliError/index.d.ts.map +0 -1
- package/dist/src/cliError/index.js.map +0 -1
- package/dist/src/cliParser/cliParser.core.d.ts.map +0 -1
- package/dist/src/cliParser/cliParser.core.js.map +0 -1
- package/dist/src/cliParser/cliParser.helper.d.ts.map +0 -1
- package/dist/src/cliParser/cliParser.helper.js.map +0 -1
- package/dist/src/cliParser/cliParser.longOption.d.ts.map +0 -1
- package/dist/src/cliParser/cliParser.longOption.js.map +0 -1
- package/dist/src/cliParser/cliParser.shortOption.d.ts.map +0 -1
- package/dist/src/cliParser/cliParser.shortOption.js.map +0 -1
- package/dist/src/cliParser/index.d.ts.map +0 -1
- package/dist/src/cliParser/index.js.map +0 -1
- package/dist/src/cliType/cliType.type.d.ts.map +0 -1
- package/dist/src/cliType/cliType.type.js.map +0 -1
- package/dist/src/cliType/index.d.ts.map +0 -1
- package/dist/src/cliType/index.js.map +0 -1
- package/dist/src/cliVersion/cliVersion.core.d.ts.map +0 -1
- package/dist/src/cliVersion/cliVersion.core.js.map +0 -1
- package/dist/src/cliVersion/index.d.ts.map +0 -1
- package/dist/src/cliVersion/index.js.map +0 -1
- package/dist/src/commands/add.command.d.ts.map +0 -1
- package/dist/src/commands/add.command.js.map +0 -1
- package/dist/src/commands/build.command.d.ts.map +0 -1
- package/dist/src/commands/build.command.js.map +0 -1
- package/dist/src/commands/create.command.d.ts.map +0 -1
- package/dist/src/commands/create.command.js.map +0 -1
- package/dist/src/commands/dev.command.d.ts.map +0 -1
- package/dist/src/commands/dev.command.js.map +0 -1
- package/dist/src/commands/doctor.command.d.ts.map +0 -1
- package/dist/src/commands/doctor.command.js.map +0 -1
- package/dist/src/commands/generate.command.d.ts.map +0 -1
- package/dist/src/commands/generate.command.js.map +0 -1
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/commands/index.js.map +0 -1
- package/dist/src/commands/info.command.d.ts.map +0 -1
- package/dist/src/commands/info.command.js.map +0 -1
- package/dist/src/constants/index.d.ts.map +0 -1
- package/dist/src/constants/index.js.map +0 -1
- package/dist/src/errors/index.d.ts.map +0 -1
- package/dist/src/errors/index.js.map +0 -1
- package/dist/src/generators/backend/backend.generator.d.ts.map +0 -1
- package/dist/src/generators/backend/backend.generator.js.map +0 -1
- package/dist/src/generators/backend/index.d.ts.map +0 -1
- package/dist/src/generators/backend/index.js.map +0 -1
- package/dist/src/generators/command/command.generator.d.ts.map +0 -1
- package/dist/src/generators/command/command.generator.js.map +0 -1
- package/dist/src/generators/controller/controller.generator.d.ts.map +0 -1
- package/dist/src/generators/controller/controller.generator.js.map +0 -1
- package/dist/src/generators/dto/dto.generator.d.ts.map +0 -1
- package/dist/src/generators/dto/dto.generator.js.map +0 -1
- package/dist/src/generators/dto/index.d.ts.map +0 -1
- package/dist/src/generators/dto/index.js.map +0 -1
- package/dist/src/generators/event/event.generator.d.ts.map +0 -1
- package/dist/src/generators/event/event.generator.js.map +0 -1
- package/dist/src/generators/event/index.d.ts.map +0 -1
- package/dist/src/generators/event/index.js.map +0 -1
- package/dist/src/generators/frontend/frontendGenerator.core.d.ts.map +0 -1
- package/dist/src/generators/frontend/frontendGenerator.core.js.map +0 -1
- package/dist/src/generators/frontend/index.d.ts.map +0 -1
- package/dist/src/generators/frontend/index.js.map +0 -1
- package/dist/src/generators/fullstack/fullstackComposer.core.d.ts.map +0 -1
- package/dist/src/generators/fullstack/fullstackComposer.core.js.map +0 -1
- package/dist/src/generators/fullstack/index.d.ts.map +0 -1
- package/dist/src/generators/fullstack/index.js.map +0 -1
- package/dist/src/generators/index.d.ts.map +0 -1
- package/dist/src/generators/index.js.map +0 -1
- package/dist/src/generators/infrastructure/index.d.ts.map +0 -1
- package/dist/src/generators/infrastructure/index.js.map +0 -1
- package/dist/src/generators/infrastructure/infrastructure.generator.d.ts.map +0 -1
- package/dist/src/generators/infrastructure/infrastructure.generator.js.map +0 -1
- package/dist/src/generators/integration/index.d.ts.map +0 -1
- package/dist/src/generators/integration/index.js.map +0 -1
- package/dist/src/generators/integration/integrationGenerator.core.d.ts.map +0 -1
- package/dist/src/generators/integration/integrationGenerator.core.js.map +0 -1
- package/dist/src/generators/job/index.d.ts.map +0 -1
- package/dist/src/generators/job/index.js.map +0 -1
- package/dist/src/generators/job/job.generator.d.ts.map +0 -1
- package/dist/src/generators/job/job.generator.js.map +0 -1
- package/dist/src/generators/middleware/index.d.ts.map +0 -1
- package/dist/src/generators/middleware/index.js.map +0 -1
- package/dist/src/generators/middleware/middleware.generator.d.ts.map +0 -1
- package/dist/src/generators/middleware/middleware.generator.js.map +0 -1
- package/dist/src/generators/model/index.d.ts.map +0 -1
- package/dist/src/generators/model/index.js.map +0 -1
- package/dist/src/generators/model/model.generator.d.ts.map +0 -1
- package/dist/src/generators/model/model.generator.js.map +0 -1
- package/dist/src/generators/module/module.generator.d.ts.map +0 -1
- package/dist/src/generators/module/module.generator.js.map +0 -1
- package/dist/src/generators/project/project.generator.d.ts.map +0 -1
- package/dist/src/generators/project/project.generator.js.map +0 -1
- package/dist/src/generators/query/query.generator.d.ts.map +0 -1
- package/dist/src/generators/query/query.generator.js.map +0 -1
- package/dist/src/generators/repository/repository.generator.d.ts.map +0 -1
- package/dist/src/generators/repository/repository.generator.js.map +0 -1
- package/dist/src/generators/route/index.d.ts.map +0 -1
- package/dist/src/generators/route/index.js.map +0 -1
- package/dist/src/generators/route/route.generator.d.ts.map +0 -1
- package/dist/src/generators/route/route.generator.js.map +0 -1
- package/dist/src/generators/service/service.generator.d.ts.map +0 -1
- package/dist/src/generators/service/service.generator.js.map +0 -1
- package/dist/src/generators/validator/index.d.ts.map +0 -1
- package/dist/src/generators/validator/index.js.map +0 -1
- package/dist/src/generators/validator/validator.generator.d.ts.map +0 -1
- package/dist/src/generators/validator/validator.generator.js.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/installers/dependency.installer.d.ts.map +0 -1
- package/dist/src/installers/dependency.installer.js.map +0 -1
- package/dist/src/installers/index.d.ts.map +0 -1
- package/dist/src/installers/index.js.map +0 -1
- package/dist/src/manifest/index.d.ts.map +0 -1
- package/dist/src/manifest/index.js.map +0 -1
- package/dist/src/manifest/manifestManager.core.d.ts.map +0 -1
- package/dist/src/manifest/manifestManager.core.js.map +0 -1
- package/dist/src/prompts/backend/api-style.prompt.d.ts.map +0 -1
- package/dist/src/prompts/backend/api-style.prompt.js.map +0 -1
- package/dist/src/prompts/backend/backend-architecture.prompt.d.ts.map +0 -1
- package/dist/src/prompts/backend/backend-architecture.prompt.js.map +0 -1
- package/dist/src/prompts/backend/database.prompt.d.ts.map +0 -1
- package/dist/src/prompts/backend/database.prompt.js.map +0 -1
- package/dist/src/prompts/backend/index.d.ts.map +0 -1
- package/dist/src/prompts/backend/index.js.map +0 -1
- package/dist/src/prompts/capabilities/capabilities.prompt.d.ts.map +0 -1
- package/dist/src/prompts/capabilities/capabilities.prompt.js.map +0 -1
- package/dist/src/prompts/capabilities/index.d.ts.map +0 -1
- package/dist/src/prompts/capabilities/index.js.map +0 -1
- package/dist/src/prompts/frontend/framework.prompt.d.ts.map +0 -1
- package/dist/src/prompts/frontend/framework.prompt.js.map +0 -1
- package/dist/src/prompts/frontend/frontend-architecture.prompt.d.ts.map +0 -1
- package/dist/src/prompts/frontend/frontend-architecture.prompt.js.map +0 -1
- package/dist/src/prompts/frontend/index.d.ts.map +0 -1
- package/dist/src/prompts/frontend/index.js.map +0 -1
- package/dist/src/prompts/index.d.ts.map +0 -1
- package/dist/src/prompts/index.js.map +0 -1
- package/dist/src/prompts/project/confirmation.prompt.d.ts.map +0 -1
- package/dist/src/prompts/project/confirmation.prompt.js.map +0 -1
- package/dist/src/prompts/project/index.d.ts.map +0 -1
- package/dist/src/prompts/project/index.js.map +0 -1
- package/dist/src/prompts/project/project-name.prompt.d.ts.map +0 -1
- package/dist/src/prompts/project/project-name.prompt.js.map +0 -1
- package/dist/src/prompts/project/project-type.prompt.d.ts.map +0 -1
- package/dist/src/prompts/project/project-type.prompt.js.map +0 -1
- package/dist/src/prompts/prompts.createProject.d.ts +0 -33
- package/dist/src/prompts/prompts.createProject.d.ts.map +0 -1
- package/dist/src/prompts/prompts.createProject.js +0 -150
- package/dist/src/prompts/prompts.createProject.js.map +0 -1
- package/dist/src/prompts/workspace/index.d.ts.map +0 -1
- package/dist/src/prompts/workspace/index.js.map +0 -1
- package/dist/src/prompts/workspace/package-manager.prompt.d.ts.map +0 -1
- package/dist/src/prompts/workspace/package-manager.prompt.js.map +0 -1
- package/dist/src/registries/adapter/frontendAdapterRegistry.core.d.ts.map +0 -1
- package/dist/src/registries/adapter/frontendAdapterRegistry.core.js.map +0 -1
- package/dist/src/registries/adapter/packageManagerRegistry.core.d.ts.map +0 -1
- package/dist/src/registries/adapter/packageManagerRegistry.core.js.map +0 -1
- package/dist/src/registries/dependency/dependencyRegistry.core.d.ts.map +0 -1
- package/dist/src/registries/dependency/dependencyRegistry.core.js.map +0 -1
- package/dist/src/registries/dependency/index.d.ts.map +0 -1
- package/dist/src/registries/dependency/index.js.map +0 -1
- package/dist/src/registries/generator/generatorRegistry.core.d.ts.map +0 -1
- package/dist/src/registries/generator/generatorRegistry.core.js.map +0 -1
- package/dist/src/registries/generator/index.d.ts.map +0 -1
- package/dist/src/registries/generator/index.js.map +0 -1
- package/dist/src/registries/index.d.ts.map +0 -1
- package/dist/src/registries/index.js.map +0 -1
- package/dist/src/resolvers/architecture.resolver.d.ts.map +0 -1
- package/dist/src/resolvers/architecture.resolver.js.map +0 -1
- package/dist/src/resolvers/capability/capabilityResolver.core.d.ts.map +0 -1
- package/dist/src/resolvers/capability/capabilityResolver.core.js.map +0 -1
- package/dist/src/resolvers/capability/index.d.ts.map +0 -1
- package/dist/src/resolvers/capability/index.js.map +0 -1
- package/dist/src/resolvers/configuration/configurationResolver.core.d.ts.map +0 -1
- package/dist/src/resolvers/configuration/configurationResolver.core.js.map +0 -1
- package/dist/src/resolvers/configuration/index.d.ts.map +0 -1
- package/dist/src/resolvers/configuration/index.js.map +0 -1
- package/dist/src/resolvers/dependency/dependencyResolver.core.d.ts.map +0 -1
- package/dist/src/resolvers/dependency/dependencyResolver.core.js.map +0 -1
- package/dist/src/resolvers/dependency/index.d.ts.map +0 -1
- package/dist/src/resolvers/dependency/index.js.map +0 -1
- package/dist/src/resolvers/index.d.ts.map +0 -1
- package/dist/src/resolvers/index.js.map +0 -1
- package/dist/src/resolvers/project.resolver.d.ts.map +0 -1
- package/dist/src/resolvers/project.resolver.js.map +0 -1
- package/dist/src/rollback/index.d.ts.map +0 -1
- package/dist/src/rollback/index.js.map +0 -1
- package/dist/src/rollback/rollbackManager.core.d.ts.map +0 -1
- package/dist/src/rollback/rollbackManager.core.js.map +0 -1
- package/dist/src/runners/package-manager/index.d.ts.map +0 -1
- package/dist/src/runners/package-manager/index.js.map +0 -1
- package/dist/src/runners/package-manager/packageManagerRunner.core.d.ts.map +0 -1
- package/dist/src/runners/package-manager/packageManagerRunner.core.js.map +0 -1
- package/dist/src/runners/process/index.d.ts.map +0 -1
- package/dist/src/runners/process/index.js.map +0 -1
- package/dist/src/runners/process/processRunner.core.d.ts.map +0 -1
- package/dist/src/runners/process/processRunner.core.js.map +0 -1
- package/dist/src/runners/task/index.d.ts.map +0 -1
- package/dist/src/runners/task/index.js.map +0 -1
- package/dist/src/runners/task/taskRunner.core.d.ts.map +0 -1
- package/dist/src/runners/task/taskRunner.core.js.map +0 -1
- package/dist/src/scaffolders/framework.scaffolder.d.ts.map +0 -1
- package/dist/src/scaffolders/framework.scaffolder.js.map +0 -1
- package/dist/src/scaffolders/index.d.ts.map +0 -1
- package/dist/src/scaffolders/index.js.map +0 -1
- package/dist/src/scaffolders/scaffolder.helper.d.ts.map +0 -1
- package/dist/src/scaffolders/scaffolder.helper.js.map +0 -1
- package/dist/src/scripts/postinstall.cjs +0 -56
- package/dist/src/templates/microservice/index.d.ts.map +0 -1
- package/dist/src/templates/microservice/index.js.map +0 -1
- package/dist/src/templates/microservice/microservice.template.d.ts.map +0 -1
- package/dist/src/templates/microservice/microservice.template.js.map +0 -1
- package/dist/src/templates/modular-monolith/index.d.ts.map +0 -1
- package/dist/src/templates/modular-monolith/index.js.map +0 -1
- package/dist/src/templates/modular-monolith/modularMonolith.template.d.ts.map +0 -1
- package/dist/src/templates/modular-monolith/modularMonolith.template.js.map +0 -1
- package/dist/src/templates/monolith/index.d.ts.map +0 -1
- package/dist/src/templates/monolith/index.js.map +0 -1
- package/dist/src/templates/monolith/monolith.template.d.ts.map +0 -1
- package/dist/src/templates/monolith/monolith.template.js.map +0 -1
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/index.js.map +0 -1
- package/dist/src/types/projectConfiguration.type.d.ts.map +0 -1
- package/dist/src/types/projectConfiguration.type.js.map +0 -1
- package/dist/src/types/scaffold.type.d.ts.map +0 -1
- package/dist/src/types/scaffold.type.js.map +0 -1
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/index.js.map +0 -1
- package/dist/src/utils/utils.detect.d.ts.map +0 -1
- package/dist/src/utils/utils.detect.js.map +0 -1
- package/dist/src/utils/utils.exec.d.ts.map +0 -1
- package/dist/src/utils/utils.exec.js.map +0 -1
- package/dist/src/utils/utils.fileSystem.d.ts.map +0 -1
- package/dist/src/utils/utils.fileSystem.js.map +0 -1
- package/dist/src/utils/utils.name.d.ts.map +0 -1
- package/dist/src/utils/utils.name.js.map +0 -1
- package/dist/src/validators/compatibility/compatibilityValidator.core.d.ts.map +0 -1
- package/dist/src/validators/compatibility/compatibilityValidator.core.js.map +0 -1
- package/dist/src/validators/compatibility/index.d.ts.map +0 -1
- package/dist/src/validators/compatibility/index.js.map +0 -1
- package/dist/src/validators/environment/environmentValidator.core.d.ts.map +0 -1
- package/dist/src/validators/environment/environmentValidator.core.js.map +0 -1
- package/dist/src/validators/environment/index.d.ts.map +0 -1
- package/dist/src/validators/environment/index.js.map +0 -1
- package/dist/src/validators/index.d.ts.map +0 -1
- package/dist/src/validators/index.js.map +0 -1
- package/dist/src/validators/project/index.d.ts.map +0 -1
- package/dist/src/validators/project/index.js.map +0 -1
- package/dist/src/validators/project/projectValidator.core.d.ts.map +0 -1
- package/dist/src/validators/project/projectValidator.core.js.map +0 -1
- package/src/scripts/postinstall.cjs +0 -56
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module generators/integration
|
|
5
5
|
*/
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
6
8
|
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
7
9
|
/**
|
|
8
10
|
* Generates integration files between frontend and backend.
|
|
@@ -21,12 +23,22 @@ export class IntegrationGenerator {
|
|
|
21
23
|
const apiPath = this.getApiClientPath(context);
|
|
22
24
|
files[apiPath] = apiClient;
|
|
23
25
|
}
|
|
24
|
-
// CORS configuration
|
|
25
|
-
|
|
26
|
-
//
|
|
26
|
+
// CORS configuration, written next to the backend it configures. In a
|
|
27
|
+
// fullstack workspace the backend lives in apps/api; writing it at the
|
|
28
|
+
// workspace root left it where nothing could import it.
|
|
29
|
+
files[`${this.getBackendPath(context)}config/cors.ts`] =
|
|
30
|
+
this.generateCorsConfig(context);
|
|
31
|
+
// Development proxy configuration (belongs to the frontend app). The
|
|
32
|
+
// frontend adapter has already written a vite.config.ts carrying the
|
|
33
|
+
// framework plugin and path aliases; overwriting it with this minimal
|
|
34
|
+
// proxy-only config silently destroyed that work, so only create the
|
|
35
|
+
// file when the adapter did not.
|
|
27
36
|
if (context.project.frontend?.framework === "react" ||
|
|
28
37
|
context.project.frontend?.framework === "vue") {
|
|
29
|
-
|
|
38
|
+
const viteConfigPath = "apps/web/vite.config.ts";
|
|
39
|
+
if (!existsSync(join(context.projectPath, viteConfigPath))) {
|
|
40
|
+
files[viteConfigPath] = this.generateViteProxy(context);
|
|
41
|
+
}
|
|
30
42
|
}
|
|
31
43
|
await writeFileTree(context.projectPath, files);
|
|
32
44
|
}
|
|
@@ -38,6 +50,10 @@ export class IntegrationGenerator {
|
|
|
38
50
|
`API_URL=http://localhost:${backendPort}`,
|
|
39
51
|
"",
|
|
40
52
|
"# Frontend",
|
|
53
|
+
// The frontend dev-server port was accepted, defaulted and then never
|
|
54
|
+
// written anywhere, so nothing downstream could agree with the CORS
|
|
55
|
+
// origins generated from the same value.
|
|
56
|
+
`FRONTEND_PORT=${frontendPort}`,
|
|
41
57
|
`VITE_API_URL=http://localhost:${backendPort}`,
|
|
42
58
|
"",
|
|
43
59
|
"# Database",
|
|
@@ -51,6 +67,14 @@ export class IntegrationGenerator {
|
|
|
51
67
|
}
|
|
52
68
|
return lines.join("\n");
|
|
53
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Path prefix (relative to projectPath) of the backend application.
|
|
72
|
+
*
|
|
73
|
+
* Ends with a "/" when non-empty so it can be prefixed directly.
|
|
74
|
+
*/
|
|
75
|
+
getBackendPath(context) {
|
|
76
|
+
return context.project.type === "fullstack" ? "apps/api/" : "";
|
|
77
|
+
}
|
|
54
78
|
generateApiClient(context) {
|
|
55
79
|
const backendPort = context.backendPort ?? 3000;
|
|
56
80
|
const isNext = context.project.frontend?.framework === "next";
|
|
@@ -153,11 +177,16 @@ export const corsConfig = {
|
|
|
153
177
|
}
|
|
154
178
|
generateViteProxy(context) {
|
|
155
179
|
const backendPort = context.backendPort ?? 3000;
|
|
180
|
+
const isVue = context.project.frontend?.framework === "vue";
|
|
181
|
+
const pluginImport = isVue
|
|
182
|
+
? `import vue from "@vitejs/plugin-vue";`
|
|
183
|
+
: `import react from "@vitejs/plugin-react";`;
|
|
184
|
+
const pluginCall = isVue ? "vue()" : "react()";
|
|
156
185
|
return `import { defineConfig } from "vite";
|
|
157
|
-
|
|
186
|
+
${pluginImport}
|
|
158
187
|
|
|
159
188
|
export default defineConfig({
|
|
160
|
-
plugins: [
|
|
189
|
+
plugins: [${pluginCall}],
|
|
161
190
|
server: {
|
|
162
191
|
proxy: {
|
|
163
192
|
"/api": {
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export interface GenerateJobOptions {
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly basePath: string;
|
|
9
|
+
readonly dryRun?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function generateJob(options: GenerateJobOptions, cwd: string): Promise<string[]>;
|
|
11
12
|
//# sourceMappingURL=job.generator.d.ts.map
|
|
@@ -4,17 +4,23 @@
|
|
|
4
4
|
* Generates job files.
|
|
5
5
|
*/
|
|
6
6
|
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
7
|
+
import { normalizeName, toCamelCase } from "../../utils/utils.name.js";
|
|
7
8
|
export async function generateJob(options, cwd) {
|
|
9
|
+
const name = normalizeName(options.name);
|
|
10
|
+
const nameCamel = toCamelCase(options.name);
|
|
8
11
|
const files = {
|
|
9
|
-
[`${options.basePath}/jobs/${
|
|
10
|
-
* ${
|
|
12
|
+
[`${options.basePath}/jobs/${name}.job.ts`]: `/**
|
|
13
|
+
* ${name} job.
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
|
-
export async function ${
|
|
16
|
+
export async function ${nameCamel}Job() {
|
|
14
17
|
// Job implementation
|
|
15
18
|
}
|
|
16
19
|
`,
|
|
17
20
|
};
|
|
21
|
+
if (options.dryRun) {
|
|
22
|
+
return Object.keys(files);
|
|
23
|
+
}
|
|
18
24
|
await writeFileTree(cwd, files);
|
|
19
25
|
return Object.keys(files);
|
|
20
26
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export interface GenerateMiddlewareOptions {
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly basePath: string;
|
|
9
|
+
readonly dryRun?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function generateMiddleware(options: GenerateMiddlewareOptions, cwd: string): Promise<string[]>;
|
|
11
12
|
//# sourceMappingURL=middleware.generator.d.ts.map
|
|
@@ -4,19 +4,25 @@
|
|
|
4
4
|
* Generates middleware files.
|
|
5
5
|
*/
|
|
6
6
|
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
7
|
+
import { normalizeName, toCamelCase } from "../../utils/utils.name.js";
|
|
7
8
|
export async function generateMiddleware(options, cwd) {
|
|
9
|
+
const name = normalizeName(options.name);
|
|
10
|
+
const nameCamel = toCamelCase(options.name);
|
|
8
11
|
const files = {
|
|
9
|
-
[`${options.basePath}/middlewares/${
|
|
10
|
-
* ${
|
|
12
|
+
[`${options.basePath}/middlewares/${name}.middleware.ts`]: `/**
|
|
13
|
+
* ${name} middleware.
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
|
-
export function ${
|
|
14
|
-
return async (ctx:
|
|
16
|
+
export function ${nameCamel}Middleware() {
|
|
17
|
+
return async (ctx: unknown, next: () => Promise<void>) => {
|
|
15
18
|
await next();
|
|
16
19
|
};
|
|
17
20
|
}
|
|
18
21
|
`,
|
|
19
22
|
};
|
|
23
|
+
if (options.dryRun) {
|
|
24
|
+
return Object.keys(files);
|
|
25
|
+
}
|
|
20
26
|
await writeFileTree(cwd, files);
|
|
21
27
|
return Object.keys(files);
|
|
22
28
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export interface GenerateModelOptions {
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly basePath: string;
|
|
9
|
+
readonly dryRun?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function generateModel(options: GenerateModelOptions, cwd: string): Promise<string[]>;
|
|
11
12
|
//# sourceMappingURL=model.generator.d.ts.map
|
|
@@ -4,19 +4,25 @@
|
|
|
4
4
|
* Generates model files.
|
|
5
5
|
*/
|
|
6
6
|
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
7
|
+
import { normalizeName, toPascalCase } from "../../utils/utils.name.js";
|
|
7
8
|
export async function generateModel(options, cwd) {
|
|
9
|
+
const name = normalizeName(options.name);
|
|
10
|
+
const namePascal = toPascalCase(options.name);
|
|
8
11
|
const files = {
|
|
9
|
-
[`${options.basePath}/models/${
|
|
10
|
-
* ${
|
|
12
|
+
[`${options.basePath}/models/${name}.model.ts`]: `/**
|
|
13
|
+
* ${name} model.
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
|
-
export interface ${
|
|
16
|
+
export interface ${namePascal}Model {
|
|
14
17
|
readonly id: string;
|
|
15
18
|
readonly createdAt: Date;
|
|
16
19
|
readonly updatedAt: Date;
|
|
17
20
|
}
|
|
18
21
|
`,
|
|
19
22
|
};
|
|
23
|
+
if (options.dryRun) {
|
|
24
|
+
return Object.keys(files);
|
|
25
|
+
}
|
|
20
26
|
await writeFileTree(cwd, files);
|
|
21
27
|
return Object.keys(files);
|
|
22
28
|
}
|
|
@@ -7,6 +7,7 @@ export interface GenerateModuleOptions {
|
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly feature?: boolean;
|
|
9
9
|
readonly basePath?: string;
|
|
10
|
+
readonly dryRun?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare function generateModule(options: GenerateModuleOptions, cwd: string): Promise<string[]>;
|
|
12
13
|
//# sourceMappingURL=module.generator.d.ts.map
|
|
@@ -3,21 +3,17 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates a new feature module within a Zudojs project.
|
|
5
5
|
*/
|
|
6
|
-
import { mkdir } from "node:fs/promises";
|
|
7
|
-
import { join } from "node:path";
|
|
8
6
|
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
9
|
-
import { CLIGenerationError
|
|
7
|
+
import { CLIGenerationError } from "../../errors/index.js";
|
|
8
|
+
import { assertGeneratableName, toPascalCase } from "../../utils/utils.name.js";
|
|
10
9
|
export async function generateModule(options, cwd) {
|
|
11
10
|
const basePath = options.basePath ?? "modules";
|
|
12
|
-
const name = options.name
|
|
11
|
+
const name = assertGeneratableName(options.name, "module name");
|
|
12
|
+
const namePascal = toPascalCase(name);
|
|
13
13
|
const files = {
|
|
14
14
|
[`${basePath}/${name}/${name}.module.ts`]: `import { createLogger } from "@zudojs/logger";
|
|
15
15
|
|
|
16
|
-
export class ${
|
|
17
|
-
.replace(/-([a-z])/g, (_, c) => c.toUpperCase())
|
|
18
|
-
.charAt(0)
|
|
19
|
-
.toUpperCase() +
|
|
20
|
-
name.replace(/-([a-z])/g, (_, c) => c.toUpperCase()).slice(1)}Module {
|
|
16
|
+
export class ${namePascal}Module {
|
|
21
17
|
private readonly logger = createLogger({ name: "${name}-module" });
|
|
22
18
|
|
|
23
19
|
id = "${name}-module";
|
|
@@ -27,11 +23,7 @@ export class ${name
|
|
|
27
23
|
}
|
|
28
24
|
}
|
|
29
25
|
`,
|
|
30
|
-
[`${basePath}/${name}/index.ts`]: `export { ${name
|
|
31
|
-
.replace(/-([a-z])/g, (_, c) => c.toUpperCase())
|
|
32
|
-
.charAt(0)
|
|
33
|
-
.toUpperCase() +
|
|
34
|
-
name.replace(/-([a-z])/g, (_, c) => c.toUpperCase()).slice(1)}Module } from "./${name}.module.js";
|
|
26
|
+
[`${basePath}/${name}/index.ts`]: `export { ${namePascal}Module } from "./${name}.module.js";
|
|
35
27
|
`,
|
|
36
28
|
};
|
|
37
29
|
if (options.feature) {
|
|
@@ -39,21 +31,16 @@ export class ${name
|
|
|
39
31
|
files[`${basePath}/${name}/features/${featureName}.ts`] =
|
|
40
32
|
`import { createLogger } from "@zudojs/logger";
|
|
41
33
|
|
|
42
|
-
export class ${
|
|
43
|
-
.replace(/-([a-z])/g, (_, c) => c.toUpperCase())
|
|
44
|
-
.charAt(0)
|
|
45
|
-
.toUpperCase() +
|
|
46
|
-
name.replace(/-([a-z])/g, (_, c) => c.toUpperCase()).slice(1)}Feature {
|
|
34
|
+
export class ${namePascal}Feature {
|
|
47
35
|
private readonly logger = createLogger({ name: "${name}-feature" });
|
|
48
36
|
}
|
|
49
37
|
`;
|
|
50
|
-
files[`${basePath}/${name}/features/index.ts`] = `export { ${
|
|
51
|
-
.replace(/-([a-z])/g, (_, c) => c.toUpperCase())
|
|
52
|
-
.charAt(0)
|
|
53
|
-
.toUpperCase() +
|
|
54
|
-
name.replace(/-([a-z])/g, (_, c) => c.toUpperCase()).slice(1)}Feature } from "./${featureName}.js";
|
|
38
|
+
files[`${basePath}/${name}/features/index.ts`] = `export { ${namePascal}Feature } from "./${featureName}.js";
|
|
55
39
|
`;
|
|
56
40
|
}
|
|
41
|
+
if (options.dryRun) {
|
|
42
|
+
return Object.keys(files);
|
|
43
|
+
}
|
|
57
44
|
try {
|
|
58
45
|
await writeFileTree(cwd, files);
|
|
59
46
|
return Object.keys(files);
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { mkdir } from "node:fs/promises";
|
|
2
2
|
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
3
|
-
import { execCommand } from "../../utils/utils.exec.js";
|
|
4
3
|
import { CLI_VERSION } from "../../constants/index.js";
|
|
5
4
|
import { generateMonolithFiles } from "../../templates/monolith/index.js";
|
|
6
5
|
import { generateModularMonolithFiles } from "../../templates/modular-monolith/index.js";
|
|
7
6
|
import { generateMicroserviceFiles } from "../../templates/microservice/index.js";
|
|
8
7
|
import { CLIGenerationError } from "../../errors/index.js";
|
|
9
|
-
import { getInstallCommand } from "../../installers/dependency.installer.js";
|
|
10
8
|
export async function generateProject(options, basePath = ".") {
|
|
11
9
|
let templateFiles;
|
|
12
10
|
switch (options.architecture) {
|
|
@@ -36,27 +34,8 @@ export async function generateProject(options, basePath = ".") {
|
|
|
36
34
|
throw new CLIGenerationError(`Failed to write project files:`, error);
|
|
37
35
|
}
|
|
38
36
|
const filesCreated = Object.keys(templateFiles);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
await execCommand("git", ["init"], projectPath);
|
|
42
|
-
await execCommand("git", ["config", "user.name", "Zudojs CLI"], projectPath);
|
|
43
|
-
await execCommand("git", ["config", "user.email", "cli@zudojs.dev"], projectPath);
|
|
44
|
-
await execCommand("git", ["add", "-A"], projectPath);
|
|
45
|
-
await execCommand("git", ["commit", "-m", "chore: initial commit from Zudojs CLI"], projectPath);
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
// Git operations are best-effort; non-fatal
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (options.installDeps) {
|
|
52
|
-
try {
|
|
53
|
-
const [installFile, ...installArgs] = getInstallCommand(options.packageManager);
|
|
54
|
-
await execCommand(installFile, installArgs, projectPath);
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
// Best-effort: project files are already created.
|
|
58
|
-
}
|
|
59
|
-
}
|
|
37
|
+
// Note: git initialization and dependency installation are orchestrated by
|
|
38
|
+
// the create command — this generator only writes project files.
|
|
60
39
|
return {
|
|
61
40
|
projectPath,
|
|
62
41
|
filesCreated,
|
|
@@ -7,6 +7,7 @@ export interface GenerateQueryOptions {
|
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly service?: string;
|
|
9
9
|
readonly basePath?: string;
|
|
10
|
+
readonly dryRun?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare function generateQuery(options: GenerateQueryOptions, cwd: string): Promise<string[]>;
|
|
12
13
|
//# sourceMappingURL=query.generator.d.ts.map
|
|
@@ -4,16 +4,19 @@
|
|
|
4
4
|
* Generates a CQRS query with handler.
|
|
5
5
|
*/
|
|
6
6
|
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
7
|
-
import { CLIGenerationError
|
|
7
|
+
import { CLIGenerationError } from "../../errors/index.js";
|
|
8
8
|
import { normalizeName } from "../../utils/utils.name.js";
|
|
9
9
|
export async function generateQuery(options, cwd) {
|
|
10
10
|
const name = normalizeName(options.name);
|
|
11
11
|
const nameCamel = name
|
|
12
12
|
.replace(/-([a-z])/g, (_m, c) => c.toUpperCase())
|
|
13
13
|
.replace(/^./, (c) => c.toUpperCase());
|
|
14
|
-
const service = options.service
|
|
14
|
+
const service = options.service;
|
|
15
15
|
const basePath = options.basePath ?? "services";
|
|
16
|
-
|
|
16
|
+
// When no service grouping is given the schematic is written directly under
|
|
17
|
+
// basePath. Callers that resolved the owning app into basePath (the
|
|
18
|
+
// microservice layout) pass no service, so the path is not nested twice.
|
|
19
|
+
const servicePath = service ? `${basePath}/${service}` : basePath;
|
|
17
20
|
const files = {
|
|
18
21
|
[`${servicePath}/queries/${name}/${name}.query.ts`]: `import type { BaseQuery } from "@zudojs/cqrs";
|
|
19
22
|
|
|
@@ -48,12 +51,15 @@ export class ${nameCamel}QueryHandler implements QueryHandler<${nameCamel}Query>
|
|
|
48
51
|
export { ${nameCamel}QueryHandler } from "./${name}.handler.js";
|
|
49
52
|
`,
|
|
50
53
|
};
|
|
54
|
+
if (options.dryRun) {
|
|
55
|
+
return Object.keys(files);
|
|
56
|
+
}
|
|
51
57
|
try {
|
|
52
58
|
await writeFileTree(cwd, files);
|
|
53
59
|
return Object.keys(files);
|
|
54
60
|
}
|
|
55
61
|
catch (error) {
|
|
56
|
-
throw new CLIGenerationError(`Failed to generate query: ${name}
|
|
62
|
+
throw new CLIGenerationError(`Failed to generate query: ${name} in ${servicePath}`, error);
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
//# sourceMappingURL=query.generator.js.map
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
export interface GenerateRepositoryOptions {
|
|
5
5
|
readonly name: string;
|
|
6
6
|
readonly basePath?: string;
|
|
7
|
+
readonly dryRun?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare function generateRepository(options: GenerateRepositoryOptions, cwd: string): Promise<string[]>;
|
|
9
10
|
//# sourceMappingURL=repository.generator.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* zudojs-cli — Repository Generator
|
|
3
3
|
*/
|
|
4
|
-
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
5
|
-
import { CLIGenerationError
|
|
6
|
-
import { normalizeName } from "../../utils/utils.name.js";
|
|
4
|
+
import { writeFileTree, mergeBarrelExport, } from "../../utils/utils.fileSystem.js";
|
|
5
|
+
import { CLIGenerationError } from "../../errors/index.js";
|
|
6
|
+
import { normalizeName, toPascalCase } from "../../utils/utils.name.js";
|
|
7
7
|
export async function generateRepository(options, cwd) {
|
|
8
8
|
const name = normalizeName(options.name);
|
|
9
|
-
const nameCamel = name
|
|
10
|
-
.replace(/-([a-z])/g, (_m, c) => c.toUpperCase())
|
|
11
|
-
.replace(/^./, (c) => c.toUpperCase());
|
|
9
|
+
const nameCamel = toPascalCase(options.name);
|
|
12
10
|
const basePath = options.basePath ?? "";
|
|
11
|
+
const prefix = basePath ? `${basePath}/` : "";
|
|
12
|
+
const indexPath = `${prefix}repositories/index.ts`;
|
|
13
13
|
const files = {
|
|
14
|
-
[`${
|
|
14
|
+
[`${prefix}repositories/${name}.repository.ts`]: `import { createLogger } from "@zudojs/logger";
|
|
15
15
|
|
|
16
16
|
export interface ${nameCamel}Entity {
|
|
17
17
|
readonly id: string;
|
|
@@ -63,9 +63,12 @@ export class ${nameCamel}Repository {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
`,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
// Merge with any existing barrel content instead of overwriting it.
|
|
67
|
+
[indexPath]: mergeBarrelExport(cwd, indexPath, `export { ${nameCamel}Repository } from "./${name}.repository.js";`),
|
|
68
68
|
};
|
|
69
|
+
if (options.dryRun) {
|
|
70
|
+
return Object.keys(files);
|
|
71
|
+
}
|
|
69
72
|
try {
|
|
70
73
|
await writeFileTree(cwd, files);
|
|
71
74
|
return Object.keys(files);
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export interface GenerateRouteOptions {
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly basePath: string;
|
|
9
|
+
readonly dryRun?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function generateRoute(options: GenerateRouteOptions, cwd: string): Promise<string[]>;
|
|
11
12
|
//# sourceMappingURL=route.generator.d.ts.map
|
|
@@ -4,21 +4,27 @@
|
|
|
4
4
|
* Generates route files.
|
|
5
5
|
*/
|
|
6
6
|
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
7
|
+
import { normalizeName, toCamelCase } from "../../utils/utils.name.js";
|
|
7
8
|
export async function generateRoute(options, cwd) {
|
|
9
|
+
const name = normalizeName(options.name);
|
|
10
|
+
const nameCamel = toCamelCase(options.name);
|
|
8
11
|
const files = {
|
|
9
|
-
[`${options.basePath}/routes/${
|
|
10
|
-
* ${
|
|
12
|
+
[`${options.basePath}/routes/${name}.route.ts`]: `/**
|
|
13
|
+
* ${name} route.
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
|
-
export const ${
|
|
14
|
-
path: "/${
|
|
16
|
+
export const ${nameCamel}Route = {
|
|
17
|
+
path: "/${name}",
|
|
15
18
|
method: "GET",
|
|
16
19
|
handler: async () => {
|
|
17
|
-
return { message: "${
|
|
20
|
+
return { message: "${name}" };
|
|
18
21
|
},
|
|
19
22
|
};
|
|
20
23
|
`,
|
|
21
24
|
};
|
|
25
|
+
if (options.dryRun) {
|
|
26
|
+
return Object.keys(files);
|
|
27
|
+
}
|
|
22
28
|
await writeFileTree(cwd, files);
|
|
23
29
|
return Object.keys(files);
|
|
24
30
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export interface GenerateServiceOptions {
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly basePath?: string;
|
|
9
|
+
readonly dryRun?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function generateService(options: GenerateServiceOptions, cwd: string): Promise<string[]>;
|
|
11
12
|
//# sourceMappingURL=service.generator.d.ts.map
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates a new service with CQRS structure.
|
|
5
5
|
*/
|
|
6
|
-
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
6
|
+
import { writeFileTree, mergeBarrelExport, } from "../../utils/utils.fileSystem.js";
|
|
7
7
|
import { CLIGenerationError } from "../../errors/index.js";
|
|
8
|
+
import { assertGeneratableName, toPascalCase } from "../../utils/utils.name.js";
|
|
8
9
|
export async function generateService(options, cwd) {
|
|
9
10
|
const basePath = options.basePath ?? "services";
|
|
10
|
-
const name = options.name
|
|
11
|
-
const namePascal = name
|
|
12
|
-
.replace(/-([a-z])/g, (_, c) => c.toUpperCase())
|
|
13
|
-
.replace(/^./, (c) => c.toUpperCase());
|
|
11
|
+
const name = assertGeneratableName(options.name, "service name");
|
|
12
|
+
const namePascal = toPascalCase(name);
|
|
14
13
|
const files = {
|
|
15
14
|
[`${basePath}/${name}/${name}.service.ts`]: `import { createLogger } from "@zudojs/logger";
|
|
16
15
|
|
|
@@ -22,11 +21,15 @@ export class ${namePascal}Service {
|
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
`,
|
|
25
|
-
|
|
26
|
-
`,
|
|
27
|
-
|
|
28
|
-
[`${basePath}/${name}/
|
|
24
|
+
// Merge with any existing barrel content instead of overwriting it.
|
|
25
|
+
[`${basePath}/${name}/index.ts`]: mergeBarrelExport(cwd, `${basePath}/${name}/index.ts`, `export { ${namePascal}Service } from "./${name}.service.js";`),
|
|
26
|
+
// Preserve any existing content in the CQRS barrels.
|
|
27
|
+
[`${basePath}/${name}/commands/index.ts`]: mergeBarrelExport(cwd, `${basePath}/${name}/commands/index.ts`, ""),
|
|
28
|
+
[`${basePath}/${name}/queries/index.ts`]: mergeBarrelExport(cwd, `${basePath}/${name}/queries/index.ts`, ""),
|
|
29
29
|
};
|
|
30
|
+
if (options.dryRun) {
|
|
31
|
+
return Object.keys(files);
|
|
32
|
+
}
|
|
30
33
|
try {
|
|
31
34
|
await writeFileTree(cwd, files);
|
|
32
35
|
return Object.keys(files);
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export interface GenerateValidatorOptions {
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly basePath: string;
|
|
9
|
+
readonly dryRun?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function generateValidator(options: GenerateValidatorOptions, cwd: string): Promise<string[]>;
|
|
11
12
|
//# sourceMappingURL=validator.generator.d.ts.map
|
|
@@ -4,17 +4,23 @@
|
|
|
4
4
|
* Generates validator files.
|
|
5
5
|
*/
|
|
6
6
|
import { writeFileTree } from "../../utils/utils.fileSystem.js";
|
|
7
|
+
import { normalizeName, toPascalCase } from "../../utils/utils.name.js";
|
|
7
8
|
export async function generateValidator(options, cwd) {
|
|
9
|
+
const name = normalizeName(options.name);
|
|
10
|
+
const namePascal = toPascalCase(options.name);
|
|
8
11
|
const files = {
|
|
9
|
-
[`${options.basePath}/validators/${
|
|
10
|
-
* ${
|
|
12
|
+
[`${options.basePath}/validators/${name}.validator.ts`]: `/**
|
|
13
|
+
* ${name} validator.
|
|
11
14
|
*/
|
|
12
15
|
|
|
13
|
-
export function validate${
|
|
16
|
+
export function validate${namePascal}(input: unknown): boolean {
|
|
14
17
|
return true;
|
|
15
18
|
}
|
|
16
19
|
`,
|
|
17
20
|
};
|
|
21
|
+
if (options.dryRun) {
|
|
22
|
+
return Object.keys(files);
|
|
23
|
+
}
|
|
18
24
|
await writeFileTree(cwd, files);
|
|
19
25
|
return Object.keys(files);
|
|
20
26
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ export { CLI_NAME, CLI_DEFAULTS, CLI_COMMANDS, CLI_ALIASES, CLI_OPTION_PREFIXES,
|
|
|
23
23
|
export { CLIError, isCLIError, normalizeCLIError, getCLIExitCode, getCLIErrorCode, type CLIErrorOptions, CommandNotFoundError, DuplicateCommandError, InvalidCommandNameError, InvalidArgumentsError, MissingArgumentError, InvalidOptionError, InvalidOptionNameError, MissingOptionValueError, DuplicateOptionError, CLIExecutionError, CLIPermissionError, CLIInterruptedError, CLIConfigurationError, } from "./cliError/index.js";
|
|
24
24
|
export { CLICommandRegistry, CLICommandBuilder, createCommand, command, executeCommand, validateCommand, isCLICommand, sortCommands, } from "./cliCommand/index.js";
|
|
25
25
|
export { CLIParser, type CLIParserOptions, parseCLIArguments, parseOptionValue, parseBoolean, isOption, isLongOption, isShortOption, resolveCommand, normalizeCLIValue, } from "./cliParser/index.js";
|
|
26
|
-
export { ZudojsCLI, createCLI, createCLIWriter, registerCLIInterruptHandler, } from "./cliApplication/index.js";
|
|
27
|
-
export { getCLIVersion, formatCLIVersion, getVersionString, isValidVersion, compareVersions, parseVersion, isCompatibleVersion, type CLIVersionInfo, } from "./cliVersion/index.js";
|
|
26
|
+
export { ZudojsCLI, createCLI, createCLIWriter, createCLILogger, formatCLILogLine, registerCLIInterruptHandler, type CLILoggerOptions, } from "./cliApplication/index.js";
|
|
27
|
+
export { getCLIVersion, formatCLIVersion, getVersionString, isValidVersion, compareVersions, parseVersion, isCompatibleVersion, checkForNewerVersion, isUpdateCheckDisabled, type CLIVersionInfo, type UpdateCheckOptions, type UpdateCheckResult, } from "./cliVersion/index.js";
|
|
28
28
|
export type { FrontendAdapter, FrontendGenerationContext, FrontendFeatures, DependencyRequirement, ValidationResult, } from "./adapters/frontend/index.js";
|
|
29
29
|
export { ReactAdapter, NextAdapter, VueAdapter, NuxtAdapter, AngularAdapter, SvelteAdapter, SvelteKitAdapter, AstroAdapter, VanillaAdapter, FlutterAdapter, ReactNativeAdapter, } from "./adapters/frontend/index.js";
|
|
30
30
|
export { PnpmAdapter, NpmAdapter, YarnAdapter, BunAdapter, } from "./adapters/package-managers/index.js";
|
|
@@ -34,6 +34,7 @@ export { detectArchitecture } from "./resolvers/index.js";
|
|
|
34
34
|
export { resolveProjectPath, findProjectRoot, } from "./resolvers/project.resolver.js";
|
|
35
35
|
export { CapabilityResolver, type CapabilityDependency, type CapabilityResolutionResult, } from "./resolvers/capability/index.js";
|
|
36
36
|
export { ConfigurationResolver, type ResolvedConfiguration, } from "./resolvers/configuration/index.js";
|
|
37
|
+
export { resolveProjectLayout, detectPackageManager, type ProjectLayout, type ProjectLayoutType, type ProjectLayoutSource, } from "./resolvers/layout/index.js";
|
|
37
38
|
export { EnvironmentValidator, type EnvironmentCheck, type EnvironmentValidationResult, } from "./validators/index.js";
|
|
38
39
|
export { ProjectValidator, type ProjectCheck, type ProjectValidationResult, } from "./validators/index.js";
|
|
39
40
|
export { CompatibilityValidator, type CompatibilityCheck, type CompatibilityResult, } from "./validators/compatibility/index.js";
|
package/dist/src/index.js
CHANGED
|
@@ -27,9 +27,9 @@ export { CLICommandRegistry, CLICommandBuilder, createCommand, command, executeC
|
|
|
27
27
|
// Parser
|
|
28
28
|
export { CLIParser, parseCLIArguments, parseOptionValue, parseBoolean, isOption, isLongOption, isShortOption, resolveCommand, normalizeCLIValue, } from "./cliParser/index.js";
|
|
29
29
|
// Application
|
|
30
|
-
export { ZudojsCLI, createCLI, createCLIWriter, registerCLIInterruptHandler, } from "./cliApplication/index.js";
|
|
30
|
+
export { ZudojsCLI, createCLI, createCLIWriter, createCLILogger, formatCLILogLine, registerCLIInterruptHandler, } from "./cliApplication/index.js";
|
|
31
31
|
// Version
|
|
32
|
-
export { getCLIVersion, formatCLIVersion, getVersionString, isValidVersion, compareVersions, parseVersion, isCompatibleVersion, } from "./cliVersion/index.js";
|
|
32
|
+
export { getCLIVersion, formatCLIVersion, getVersionString, isValidVersion, compareVersions, parseVersion, isCompatibleVersion, checkForNewerVersion, isUpdateCheckDisabled, } from "./cliVersion/index.js";
|
|
33
33
|
export { ReactAdapter, NextAdapter, VueAdapter, NuxtAdapter, AngularAdapter, SvelteAdapter, SvelteKitAdapter, AstroAdapter, VanillaAdapter, FlutterAdapter, ReactNativeAdapter, } from "./adapters/frontend/index.js";
|
|
34
34
|
export { PnpmAdapter, NpmAdapter, YarnAdapter, BunAdapter, } from "./adapters/package-managers/index.js";
|
|
35
35
|
export { PostgresAdapter, MySqlAdapter, SqliteAdapter, } from "./adapters/databases/index.js";
|
|
@@ -39,6 +39,7 @@ export { detectArchitecture } from "./resolvers/index.js";
|
|
|
39
39
|
export { resolveProjectPath, findProjectRoot, } from "./resolvers/project.resolver.js";
|
|
40
40
|
export { CapabilityResolver, } from "./resolvers/capability/index.js";
|
|
41
41
|
export { ConfigurationResolver, } from "./resolvers/configuration/index.js";
|
|
42
|
+
export { resolveProjectLayout, detectPackageManager, } from "./resolvers/layout/index.js";
|
|
42
43
|
// Validators
|
|
43
44
|
export { EnvironmentValidator, } from "./validators/index.js";
|
|
44
45
|
export { ProjectValidator, } from "./validators/index.js";
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { PackageManager } from "../types/index.js";
|
|
2
2
|
export declare function getInstallCommand(packageManager: PackageManager): [string, ...string[]];
|
|
3
3
|
export declare function getAddCommand(packageManager: PackageManager, pkg: string): [string, ...string[]];
|
|
4
|
+
/**
|
|
5
|
+
* The command that runs a `package.json` script with the given manager.
|
|
6
|
+
*
|
|
7
|
+
* Generated projects declare their dev/build tooling (`tsx`, `vite`, `ng`)
|
|
8
|
+
* as devDependencies, so the binaries live in `node_modules/.bin` and are
|
|
9
|
+
* not on the user's PATH. Running the script through the package manager is
|
|
10
|
+
* what puts them there.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getRunScriptCommand(packageManager: PackageManager, script: string): [string, ...string[]];
|
|
4
13
|
export declare function installDependencies(packageManager: PackageManager, cwd: string): Promise<void>;
|
|
5
14
|
//# sourceMappingURL=dependency.installer.d.ts.map
|