zudojs-cli 2.1.3 → 2.2.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/README.md +6 -3
- package/dist/src/adapters/databases/databaseAdapter.resolver.d.ts +0 -1
- package/dist/src/adapters/databases/databaseAdapter.resolver.js +0 -1
- package/dist/src/adapters/databases/index.d.ts +0 -1
- package/dist/src/adapters/databases/index.js +0 -1
- package/dist/src/adapters/databases/mysql.adapter.d.ts +0 -1
- package/dist/src/adapters/databases/mysql.adapter.js +0 -1
- package/dist/src/adapters/databases/postgres.adapter.d.ts +0 -1
- package/dist/src/adapters/databases/postgres.adapter.js +0 -1
- package/dist/src/adapters/databases/sqlite.adapter.d.ts +0 -1
- package/dist/src/adapters/databases/sqlite.adapter.js +0 -1
- package/dist/src/adapters/frontend/angular.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/angular.adapter.js +0 -1
- package/dist/src/adapters/frontend/astro.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/astro.adapter.js +0 -1
- package/dist/src/adapters/frontend/fallback/fallback.helper.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/fallback.helper.js +0 -1
- package/dist/src/adapters/frontend/fallback/framework/angular/angular.fallback.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/framework/angular/angular.fallback.js +0 -1
- package/dist/src/adapters/frontend/fallback/framework/angular/angularWorkspace.fallback.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/framework/angular/angularWorkspace.fallback.js +0 -1
- package/dist/src/adapters/frontend/fallback/framework/angular/index.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/framework/angular/index.js +0 -1
- package/dist/src/adapters/frontend/fallback/framework/astro.fallback.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/framework/astro.fallback.js +0 -1
- package/dist/src/adapters/frontend/fallback/framework/index.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/framework/index.js +0 -1
- package/dist/src/adapters/frontend/fallback/framework/next.fallback.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/framework/next.fallback.js +0 -1
- package/dist/src/adapters/frontend/fallback/framework/nuxt.fallback.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/framework/nuxt.fallback.js +0 -1
- package/dist/src/adapters/frontend/fallback/framework/sveltekit.fallback.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/framework/sveltekit.fallback.js +0 -1
- package/dist/src/adapters/frontend/fallback/index.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/index.js +0 -1
- package/dist/src/adapters/frontend/fallback/vite/index.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/vite/index.js +0 -1
- package/dist/src/adapters/frontend/fallback/vite/react.fallback.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/vite/react.fallback.js +0 -1
- package/dist/src/adapters/frontend/fallback/vite/svelte.fallback.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/vite/svelte.fallback.js +0 -1
- package/dist/src/adapters/frontend/fallback/vite/vanilla.fallback.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/vite/vanilla.fallback.js +0 -1
- package/dist/src/adapters/frontend/fallback/vite/vue.fallback.d.ts +0 -1
- package/dist/src/adapters/frontend/fallback/vite/vue.fallback.js +0 -1
- package/dist/src/adapters/frontend/flutter.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/flutter.adapter.js +0 -1
- package/dist/src/adapters/frontend/frontendAdapter.type.d.ts +0 -1
- package/dist/src/adapters/frontend/frontendAdapter.type.js +0 -1
- package/dist/src/adapters/frontend/index.d.ts +0 -1
- package/dist/src/adapters/frontend/index.js +0 -1
- package/dist/src/adapters/frontend/next.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/next.adapter.js +0 -1
- package/dist/src/adapters/frontend/nuxt.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/nuxt.adapter.js +0 -1
- package/dist/src/adapters/frontend/react-native.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/react-native.adapter.js +0 -1
- package/dist/src/adapters/frontend/react.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/react.adapter.js +0 -1
- package/dist/src/adapters/frontend/svelte.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/svelte.adapter.js +0 -1
- package/dist/src/adapters/frontend/sveltekit.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/sveltekit.adapter.js +0 -1
- package/dist/src/adapters/frontend/vanilla.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/vanilla.adapter.js +0 -1
- package/dist/src/adapters/frontend/vue.adapter.d.ts +0 -1
- package/dist/src/adapters/frontend/vue.adapter.js +0 -1
- package/dist/src/adapters/package-managers/bun.adapter.d.ts +0 -1
- package/dist/src/adapters/package-managers/bun.adapter.js +0 -1
- package/dist/src/adapters/package-managers/index.d.ts +0 -1
- package/dist/src/adapters/package-managers/index.js +0 -1
- package/dist/src/adapters/package-managers/npm.adapter.d.ts +0 -1
- package/dist/src/adapters/package-managers/npm.adapter.js +0 -1
- package/dist/src/adapters/package-managers/packageManager.type.d.ts +0 -1
- package/dist/src/adapters/package-managers/packageManager.type.js +0 -1
- package/dist/src/adapters/package-managers/pnpm.adapter.d.ts +0 -1
- package/dist/src/adapters/package-managers/pnpm.adapter.js +0 -1
- package/dist/src/adapters/package-managers/yarn.adapter.d.ts +0 -1
- package/dist/src/adapters/package-managers/yarn.adapter.js +0 -1
- package/dist/src/bin/bin.menu.d.ts +0 -1
- package/dist/src/bin/bin.menu.js +0 -1
- package/dist/src/bin/bin.runner.d.ts +0 -1
- package/dist/src/bin/bin.runner.js +0 -1
- package/dist/src/bin/index.d.ts +0 -1
- package/dist/src/bin/index.js +0 -1
- package/dist/src/bin/zudojs.d.ts +0 -1
- package/dist/src/bin/zudojs.js +1 -2
- package/dist/src/cliApplication/cliApplication.builtins.d.ts +0 -1
- package/dist/src/cliApplication/cliApplication.builtins.js +0 -1
- package/dist/src/cliApplication/cliApplication.core.d.ts +0 -1
- package/dist/src/cliApplication/cliApplication.core.js +0 -1
- package/dist/src/cliApplication/cliApplication.help.d.ts +0 -1
- package/dist/src/cliApplication/cliApplication.help.js +0 -1
- package/dist/src/cliApplication/cliApplication.logger.d.ts +0 -1
- package/dist/src/cliApplication/cliApplication.logger.js +0 -1
- package/dist/src/cliApplication/cliApplication.writer.d.ts +0 -1
- package/dist/src/cliApplication/cliApplication.writer.js +0 -1
- package/dist/src/cliApplication/index.d.ts +0 -1
- package/dist/src/cliApplication/index.js +0 -1
- package/dist/src/cliApplication/invocation/index.d.ts +0 -1
- package/dist/src/cliApplication/invocation/index.js +0 -1
- package/dist/src/cliApplication/invocation/invocation.hint.d.ts +0 -7
- package/dist/src/cliApplication/invocation/invocation.hint.js +14 -1
- package/dist/src/cliApplication/invocation/invocation.locate.d.ts +0 -1
- package/dist/src/cliApplication/invocation/invocation.locate.js +0 -1
- package/dist/src/cliApplication/invocation/invocation.name.d.ts +0 -1
- package/dist/src/cliApplication/invocation/invocation.name.js +0 -1
- package/dist/src/cliApplication/invocation/invocation.sanitize.d.ts +0 -1
- package/dist/src/cliApplication/invocation/invocation.sanitize.js +0 -1
- package/dist/src/cliCommand/cliCommand.builder.d.ts +0 -1
- package/dist/src/cliCommand/cliCommand.builder.js +0 -1
- package/dist/src/cliCommand/cliCommand.factory.d.ts +0 -1
- package/dist/src/cliCommand/cliCommand.factory.js +0 -1
- package/dist/src/cliCommand/cliCommand.registry.d.ts +0 -1
- package/dist/src/cliCommand/cliCommand.registry.js +0 -1
- package/dist/src/cliCommand/cliCommand.validator.d.ts +0 -1
- package/dist/src/cliCommand/cliCommand.validator.js +0 -1
- package/dist/src/cliCommand/index.d.ts +0 -1
- package/dist/src/cliCommand/index.js +0 -1
- package/dist/src/cliConstant/cliConstant.value.d.ts +0 -1
- package/dist/src/cliConstant/cliConstant.value.js +0 -1
- package/dist/src/cliConstant/cliVersion.d.ts +0 -1
- package/dist/src/cliConstant/cliVersion.js +0 -1
- package/dist/src/cliConstant/index.d.ts +0 -1
- package/dist/src/cliConstant/index.js +0 -1
- package/dist/src/cliError/cliError.argument.d.ts +0 -1
- package/dist/src/cliError/cliError.argument.js +0 -1
- package/dist/src/cliError/cliError.base.d.ts +0 -1
- package/dist/src/cliError/cliError.base.js +0 -1
- package/dist/src/cliError/cliError.command.d.ts +0 -1
- package/dist/src/cliError/cliError.command.js +0 -1
- package/dist/src/cliError/cliError.execution.d.ts +0 -1
- package/dist/src/cliError/cliError.execution.js +0 -1
- package/dist/src/cliError/cliError.option.d.ts +0 -1
- package/dist/src/cliError/cliError.option.js +0 -1
- package/dist/src/cliError/index.d.ts +0 -1
- package/dist/src/cliError/index.js +0 -1
- package/dist/src/cliParser/cliParser.core.d.ts +0 -1
- package/dist/src/cliParser/cliParser.core.js +0 -1
- package/dist/src/cliParser/cliParser.helper.d.ts +0 -1
- package/dist/src/cliParser/cliParser.helper.js +0 -1
- package/dist/src/cliParser/cliParser.longOption.d.ts +0 -1
- package/dist/src/cliParser/cliParser.longOption.js +0 -1
- package/dist/src/cliParser/cliParser.shortOption.d.ts +0 -1
- package/dist/src/cliParser/cliParser.shortOption.js +0 -1
- package/dist/src/cliParser/index.d.ts +0 -1
- package/dist/src/cliParser/index.js +0 -1
- package/dist/src/cliType/cliType.type.d.ts +0 -1
- package/dist/src/cliType/cliType.type.js +0 -1
- package/dist/src/cliType/index.d.ts +0 -1
- package/dist/src/cliType/index.js +0 -1
- package/dist/src/cliVersion/cliVersion.core.d.ts +0 -1
- package/dist/src/cliVersion/cliVersion.core.js +0 -1
- package/dist/src/cliVersion/cliVersion.update.d.ts +0 -1
- package/dist/src/cliVersion/cliVersion.update.js +0 -1
- package/dist/src/cliVersion/index.d.ts +0 -1
- package/dist/src/cliVersion/index.js +0 -1
- package/dist/src/commands/add.command.d.ts +0 -1
- package/dist/src/commands/add.command.js +1 -2
- package/dist/src/commands/build.command.d.ts +0 -1
- package/dist/src/commands/build.command.js +0 -1
- package/dist/src/commands/commandError.helper.d.ts +0 -1
- package/dist/src/commands/commandError.helper.js +0 -1
- package/dist/src/commands/create.command.d.ts +0 -1
- package/dist/src/commands/create.command.js +0 -1
- package/dist/src/commands/dev/dev.plan.d.ts +39 -0
- package/dist/src/commands/dev/dev.plan.js +83 -0
- package/dist/src/commands/dev/index.d.ts +4 -0
- package/dist/src/commands/dev/index.js +4 -0
- package/dist/src/commands/dev.command.d.ts +4 -30
- package/dist/src/commands/dev.command.js +10 -80
- package/dist/src/commands/doctor.command.d.ts +0 -1
- package/dist/src/commands/doctor.command.js +0 -1
- package/dist/src/commands/generate.command.d.ts +0 -1
- package/dist/src/commands/generate.command.js +19 -8
- package/dist/src/commands/index.d.ts +0 -1
- package/dist/src/commands/index.js +0 -1
- package/dist/src/commands/info.command.d.ts +0 -1
- package/dist/src/commands/info.command.js +0 -1
- package/dist/src/constants/index.d.ts +0 -1
- package/dist/src/constants/index.js +0 -1
- package/dist/src/constants/zudojsVersions.generated.d.ts +0 -1
- package/dist/src/constants/zudojsVersions.generated.js +38 -39
- package/dist/src/constants/zudojsVersions.helper.d.ts +0 -1
- package/dist/src/constants/zudojsVersions.helper.js +0 -1
- package/dist/src/errors/index.d.ts +0 -1
- package/dist/src/errors/index.js +0 -1
- package/dist/src/generators/backend/backend.generator.d.ts +0 -1
- package/dist/src/generators/backend/backend.generator.js +0 -1
- package/dist/src/generators/backend/index.d.ts +0 -1
- package/dist/src/generators/backend/index.js +0 -1
- package/dist/src/generators/command/command.generator.d.ts +0 -1
- package/dist/src/generators/command/command.generator.js +0 -1
- package/dist/src/generators/command/command.template.d.ts +0 -1
- package/dist/src/generators/command/command.template.js +0 -1
- package/dist/src/generators/command/index.d.ts +0 -1
- package/dist/src/generators/command/index.js +0 -1
- package/dist/src/generators/event/event.generator.d.ts +0 -1
- package/dist/src/generators/event/event.generator.js +0 -1
- package/dist/src/generators/event/index.d.ts +0 -1
- package/dist/src/generators/event/index.js +0 -1
- package/dist/src/generators/frontend/frontendGenerator.core.d.ts +0 -1
- package/dist/src/generators/frontend/frontendGenerator.core.js +0 -1
- package/dist/src/generators/frontend/frontendPipeline.d.ts +0 -1
- package/dist/src/generators/frontend/frontendPipeline.js +0 -1
- package/dist/src/generators/frontend/index.d.ts +0 -1
- package/dist/src/generators/frontend/index.js +0 -1
- package/dist/src/generators/fullstack/fullstackBackend.layout.d.ts +0 -1
- package/dist/src/generators/fullstack/fullstackBackend.layout.js +0 -1
- package/dist/src/generators/fullstack/fullstackComposer.core.d.ts +0 -1
- package/dist/src/generators/fullstack/fullstackComposer.core.js +0 -1
- package/dist/src/generators/fullstack/index.d.ts +0 -1
- package/dist/src/generators/fullstack/index.js +0 -1
- package/dist/src/generators/index.d.ts +0 -1
- package/dist/src/generators/index.js +0 -1
- package/dist/src/generators/infrastructure/index.d.ts +0 -1
- package/dist/src/generators/infrastructure/index.js +0 -1
- package/dist/src/generators/infrastructure/infrastructure.generator.d.ts +0 -1
- package/dist/src/generators/infrastructure/infrastructure.generator.js +0 -1
- package/dist/src/generators/integration/index.d.ts +0 -1
- package/dist/src/generators/integration/index.js +0 -1
- package/dist/src/generators/integration/integrationGenerator.core.d.ts +0 -1
- package/dist/src/generators/integration/integrationGenerator.core.js +0 -1
- package/dist/src/generators/job/index.d.ts +0 -1
- package/dist/src/generators/job/index.js +0 -1
- package/dist/src/generators/job/job.generator.d.ts +0 -1
- package/dist/src/generators/job/job.generator.js +0 -1
- package/dist/src/generators/middleware/index.d.ts +0 -1
- package/dist/src/generators/middleware/index.js +0 -1
- package/dist/src/generators/middleware/middleware.generator.d.ts +0 -1
- package/dist/src/generators/middleware/middleware.generator.js +0 -1
- package/dist/src/generators/middleware/middleware.template.d.ts +0 -1
- package/dist/src/generators/middleware/middleware.template.js +0 -1
- package/dist/src/generators/model/index.d.ts +0 -1
- package/dist/src/generators/model/index.js +0 -1
- package/dist/src/generators/model/model.generator.d.ts +0 -1
- package/dist/src/generators/model/model.generator.js +0 -1
- package/dist/src/generators/module/index.d.ts +0 -1
- package/dist/src/generators/module/index.js +0 -1
- package/dist/src/generators/module/module.generator.d.ts +0 -1
- package/dist/src/generators/module/module.generator.js +27 -11
- package/dist/src/generators/module/module.registration.d.ts +4 -3
- package/dist/src/generators/module/module.registration.js +5 -4
- package/dist/src/generators/project/project.generator.d.ts +0 -1
- package/dist/src/generators/project/project.generator.js +0 -1
- package/dist/src/generators/query/index.d.ts +0 -1
- package/dist/src/generators/query/index.js +0 -1
- package/dist/src/generators/query/query.generator.d.ts +0 -1
- package/dist/src/generators/query/query.generator.js +0 -1
- package/dist/src/generators/query/query.template.d.ts +0 -1
- package/dist/src/generators/query/query.template.js +0 -1
- package/dist/src/generators/resource/index.d.ts +0 -1
- package/dist/src/generators/resource/index.js +0 -1
- package/dist/src/generators/resource/resource.checks.d.ts +31 -0
- package/dist/src/generators/resource/resource.checks.js +52 -0
- package/dist/src/generators/resource/resource.generator.d.ts +5 -3
- package/dist/src/generators/resource/resource.generator.js +23 -36
- package/dist/src/generators/resource/resource.layout.d.ts +0 -1
- package/dist/src/generators/resource/resource.layout.js +0 -1
- package/dist/src/generators/resource/resource.plan.d.ts +0 -1
- package/dist/src/generators/resource/resource.plan.js +0 -1
- package/dist/src/generators/resource/resource.run.d.ts +12 -2
- package/dist/src/generators/resource/resource.run.js +33 -9
- package/dist/src/generators/validator/index.d.ts +0 -1
- package/dist/src/generators/validator/index.js +0 -1
- package/dist/src/generators/validator/validator.generator.d.ts +6 -2
- package/dist/src/generators/validator/validator.generator.js +31 -10
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/installers/dependency.installer.d.ts +0 -1
- package/dist/src/installers/dependency.installer.js +0 -1
- package/dist/src/installers/index.d.ts +0 -1
- package/dist/src/installers/index.js +0 -1
- package/dist/src/manifest/index.d.ts +0 -1
- package/dist/src/manifest/index.js +0 -1
- package/dist/src/manifest/manifestFile.helper.d.ts +0 -1
- package/dist/src/manifest/manifestFile.helper.js +0 -1
- package/dist/src/manifest/manifestManager.core.d.ts +0 -1
- package/dist/src/manifest/manifestManager.core.js +0 -1
- package/dist/src/prompts/backend/api-style.prompt.d.ts +0 -1
- package/dist/src/prompts/backend/api-style.prompt.js +0 -1
- package/dist/src/prompts/backend/backend-architecture.prompt.d.ts +0 -1
- package/dist/src/prompts/backend/backend-architecture.prompt.js +0 -1
- package/dist/src/prompts/backend/database.prompt.d.ts +0 -1
- package/dist/src/prompts/backend/database.prompt.js +0 -1
- package/dist/src/prompts/backend/index.d.ts +0 -1
- package/dist/src/prompts/backend/index.js +0 -1
- package/dist/src/prompts/backend/services.prompt.d.ts +0 -1
- package/dist/src/prompts/backend/services.prompt.js +0 -1
- package/dist/src/prompts/cancel.prompt.d.ts +0 -1
- package/dist/src/prompts/cancel.prompt.js +0 -1
- package/dist/src/prompts/capabilities/capabilities.prompt.d.ts +0 -1
- package/dist/src/prompts/capabilities/capabilities.prompt.js +0 -1
- package/dist/src/prompts/capabilities/index.d.ts +0 -1
- package/dist/src/prompts/capabilities/index.js +0 -1
- package/dist/src/prompts/frontend/framework.prompt.d.ts +0 -1
- package/dist/src/prompts/frontend/framework.prompt.js +0 -1
- package/dist/src/prompts/frontend/frontend-architecture.prompt.d.ts +0 -1
- package/dist/src/prompts/frontend/frontend-architecture.prompt.js +0 -1
- package/dist/src/prompts/frontend/index.d.ts +0 -1
- package/dist/src/prompts/frontend/index.js +0 -1
- package/dist/src/prompts/index.d.ts +0 -1
- package/dist/src/prompts/index.js +0 -1
- package/dist/src/prompts/menu/index.d.ts +0 -1
- package/dist/src/prompts/menu/index.js +0 -1
- package/dist/src/prompts/menu/menu.adapter.d.ts +0 -1
- package/dist/src/prompts/menu/menu.adapter.js +0 -1
- package/dist/src/prompts/menu/menu.constant.d.ts +0 -1
- package/dist/src/prompts/menu/menu.constant.js +0 -1
- package/dist/src/prompts/menu/menu.flow.d.ts +0 -1
- package/dist/src/prompts/menu/menu.flow.js +0 -1
- package/dist/src/prompts/menu/menu.select.d.ts +0 -1
- package/dist/src/prompts/menu/menu.select.js +0 -1
- package/dist/src/prompts/menu/menu.type.d.ts +0 -1
- package/dist/src/prompts/menu/menu.type.js +0 -1
- package/dist/src/prompts/project/confirmation.prompt.d.ts +0 -1
- package/dist/src/prompts/project/confirmation.prompt.js +0 -1
- package/dist/src/prompts/project/index.d.ts +0 -1
- package/dist/src/prompts/project/index.js +0 -1
- package/dist/src/prompts/project/project-name.prompt.d.ts +0 -1
- package/dist/src/prompts/project/project-name.prompt.js +0 -1
- package/dist/src/prompts/project/project-type.prompt.d.ts +0 -1
- package/dist/src/prompts/project/project-type.prompt.js +0 -1
- package/dist/src/prompts/workspace/index.d.ts +0 -1
- package/dist/src/prompts/workspace/index.js +0 -1
- package/dist/src/prompts/workspace/package-manager.prompt.d.ts +0 -1
- package/dist/src/prompts/workspace/package-manager.prompt.js +0 -1
- package/dist/src/recipes/apply/index.d.ts +0 -1
- package/dist/src/recipes/apply/index.js +0 -1
- package/dist/src/recipes/apply/recipeApply.app.d.ts +0 -1
- package/dist/src/recipes/apply/recipeApply.app.js +0 -1
- package/dist/src/recipes/apply/recipeApply.context.d.ts +0 -1
- package/dist/src/recipes/apply/recipeApply.context.js +0 -1
- package/dist/src/recipes/apply/recipeApply.files.d.ts +0 -1
- package/dist/src/recipes/apply/recipeApply.files.js +0 -1
- package/dist/src/recipes/apply/recipeApply.project.d.ts +13 -3
- package/dist/src/recipes/apply/recipeApply.project.js +56 -3
- package/dist/src/recipes/apply/recipeApply.report.d.ts +0 -1
- package/dist/src/recipes/apply/recipeApply.report.js +0 -1
- package/dist/src/recipes/catalog/database/database.files.d.ts +0 -1
- package/dist/src/recipes/catalog/database/database.files.js +0 -1
- package/dist/src/recipes/catalog/database/database.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/database/database.recipe.js +11 -2
- package/dist/src/recipes/catalog/database/index.d.ts +0 -1
- package/dist/src/recipes/catalog/database/index.js +0 -1
- package/dist/src/recipes/catalog/email.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/email.recipe.js +0 -1
- package/dist/src/recipes/catalog/index.d.ts +0 -1
- package/dist/src/recipes/catalog/index.js +0 -1
- package/dist/src/recipes/catalog/openapi.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/openapi.recipe.js +0 -1
- package/dist/src/recipes/catalog/platform/cache.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/platform/cache.recipe.js +0 -1
- package/dist/src/recipes/catalog/platform/index.d.ts +0 -1
- package/dist/src/recipes/catalog/platform/index.js +0 -1
- package/dist/src/recipes/catalog/platform/messaging.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/platform/messaging.recipe.js +0 -1
- package/dist/src/recipes/catalog/platform/observability.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/platform/observability.recipe.js +0 -1
- package/dist/src/recipes/catalog/platform/queue.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/platform/queue.recipe.js +0 -1
- package/dist/src/recipes/catalog/platform/scheduler.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/platform/scheduler.recipe.js +0 -1
- package/dist/src/recipes/catalog/redis.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/redis.recipe.js +0 -1
- package/dist/src/recipes/catalog/storage.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/storage.recipe.js +0 -1
- package/dist/src/recipes/catalog/websockets.recipe.d.ts +0 -1
- package/dist/src/recipes/catalog/websockets.recipe.js +0 -1
- package/dist/src/recipes/docker/docker.compose.d.ts +0 -1
- package/dist/src/recipes/docker/docker.compose.js +0 -1
- package/dist/src/recipes/docker/docker.recipe.d.ts +0 -1
- package/dist/src/recipes/docker/docker.recipe.js +0 -1
- package/dist/src/recipes/docker/docker.refresh.d.ts +0 -1
- package/dist/src/recipes/docker/docker.refresh.js +0 -1
- package/dist/src/recipes/docker/index.d.ts +0 -1
- package/dist/src/recipes/docker/index.js +0 -1
- package/dist/src/recipes/index.d.ts +0 -1
- package/dist/src/recipes/index.js +0 -1
- package/dist/src/recipes/recipe.registry.d.ts +0 -1
- package/dist/src/recipes/recipe.registry.js +0 -1
- package/dist/src/recipes/recipe.type.d.ts +6 -1
- package/dist/src/recipes/recipe.type.js +0 -1
- package/dist/src/registries/adapter/frontendAdapterRegistry.core.d.ts +0 -1
- package/dist/src/registries/adapter/frontendAdapterRegistry.core.js +0 -1
- package/dist/src/registries/adapter/packageManagerRegistry.core.d.ts +0 -1
- package/dist/src/registries/adapter/packageManagerRegistry.core.js +0 -1
- package/dist/src/registries/dependency/dependencyRegistry.core.d.ts +0 -1
- package/dist/src/registries/dependency/dependencyRegistry.core.js +0 -1
- package/dist/src/registries/dependency/index.d.ts +0 -1
- package/dist/src/registries/dependency/index.js +0 -1
- package/dist/src/registries/generator/generatorRegistry.core.d.ts +0 -1
- package/dist/src/registries/generator/generatorRegistry.core.js +0 -1
- package/dist/src/registries/generator/index.d.ts +0 -1
- package/dist/src/registries/generator/index.js +0 -1
- package/dist/src/registries/index.d.ts +0 -1
- package/dist/src/registries/index.js +0 -1
- package/dist/src/resolvers/architecture.resolver.d.ts +0 -1
- package/dist/src/resolvers/architecture.resolver.js +13 -3
- package/dist/src/resolvers/capability/capabilityResolver.core.d.ts +0 -1
- package/dist/src/resolvers/capability/capabilityResolver.core.js +0 -1
- package/dist/src/resolvers/capability/index.d.ts +0 -1
- package/dist/src/resolvers/capability/index.js +0 -1
- package/dist/src/resolvers/configuration/configurationResolver.core.d.ts +0 -1
- package/dist/src/resolvers/configuration/configurationResolver.core.js +0 -1
- package/dist/src/resolvers/configuration/index.d.ts +0 -1
- package/dist/src/resolvers/configuration/index.js +0 -1
- package/dist/src/resolvers/dependency/dependencyResolver.core.d.ts +0 -1
- package/dist/src/resolvers/dependency/dependencyResolver.core.js +0 -1
- package/dist/src/resolvers/dependency/dependencyVersions.constant.d.ts +0 -1
- package/dist/src/resolvers/dependency/dependencyVersions.constant.js +0 -1
- package/dist/src/resolvers/dependency/index.d.ts +0 -1
- package/dist/src/resolvers/dependency/index.js +0 -1
- package/dist/src/resolvers/index.d.ts +0 -1
- package/dist/src/resolvers/index.js +0 -1
- package/dist/src/resolvers/layout/index.d.ts +0 -1
- package/dist/src/resolvers/layout/index.js +0 -1
- package/dist/src/resolvers/layout/projectLayout.core.d.ts +0 -1
- package/dist/src/resolvers/layout/projectLayout.core.js +0 -1
- package/dist/src/resolvers/project.resolver.d.ts +0 -1
- package/dist/src/resolvers/project.resolver.js +0 -1
- package/dist/src/rollback/index.d.ts +0 -1
- package/dist/src/rollback/index.js +0 -1
- package/dist/src/rollback/rollbackManager.core.d.ts +0 -1
- package/dist/src/rollback/rollbackManager.core.js +0 -1
- package/dist/src/runners/package-manager/index.d.ts +0 -1
- package/dist/src/runners/package-manager/index.js +0 -1
- package/dist/src/runners/package-manager/packageManagerRunner.core.d.ts +0 -1
- package/dist/src/runners/package-manager/packageManagerRunner.core.js +0 -1
- package/dist/src/runners/process/index.d.ts +0 -1
- package/dist/src/runners/process/index.js +0 -1
- package/dist/src/runners/process/processRunner.core.d.ts +0 -1
- package/dist/src/runners/process/processRunner.core.js +0 -1
- package/dist/src/runners/task/index.d.ts +0 -1
- package/dist/src/runners/task/index.js +0 -1
- package/dist/src/runners/task/taskRunner.core.d.ts +0 -1
- package/dist/src/runners/task/taskRunner.core.js +0 -1
- package/dist/src/scaffolders/framework.scaffolder.d.ts +0 -1
- package/dist/src/scaffolders/framework.scaffolder.js +0 -1
- package/dist/src/scaffolders/index.d.ts +0 -1
- package/dist/src/scaffolders/index.js +0 -1
- package/dist/src/scaffolders/scaffolder.helper.d.ts +0 -1
- package/dist/src/scaffolders/scaffolder.helper.js +0 -1
- package/dist/src/templates/backendApp/backendApp.core.d.ts +0 -1
- package/dist/src/templates/backendApp/backendApp.core.js +0 -1
- package/dist/src/templates/backendApp/backendApp.modules.d.ts +0 -1
- package/dist/src/templates/backendApp/backendApp.modules.js +0 -1
- package/dist/src/templates/backendApp/backendApp.project.d.ts +19 -3
- package/dist/src/templates/backendApp/backendApp.project.js +41 -3
- package/dist/src/templates/backendApp/index.d.ts +0 -1
- package/dist/src/templates/backendApp/index.js +0 -1
- package/dist/src/templates/backendApp/parts/config.template.d.ts +0 -1
- package/dist/src/templates/backendApp/parts/config.template.js +13 -6
- package/dist/src/templates/backendApp/parts/httpUtils.template.d.ts +2 -2
- package/dist/src/templates/backendApp/parts/httpUtils.template.js +20 -6
- package/dist/src/templates/backendApp/parts/index.d.ts +0 -1
- package/dist/src/templates/backendApp/parts/index.js +0 -1
- package/dist/src/templates/backendApp/parts/integrations.template.d.ts +0 -1
- package/dist/src/templates/backendApp/parts/integrations.template.js +0 -1
- package/dist/src/templates/backendApp/parts/wiring.template.d.ts +3 -2
- package/dist/src/templates/backendApp/parts/wiring.template.js +13 -3
- package/dist/src/templates/microservice/index.d.ts +0 -1
- package/dist/src/templates/microservice/index.js +0 -1
- package/dist/src/templates/microservice/microservice.template.d.ts +0 -1
- package/dist/src/templates/microservice/microservice.template.js +6 -27
- package/dist/src/templates/modular-monolith/index.d.ts +0 -1
- package/dist/src/templates/modular-monolith/index.js +0 -1
- package/dist/src/templates/modular-monolith/modularMonolith.template.d.ts +0 -1
- package/dist/src/templates/modular-monolith/modularMonolith.template.js +3 -10
- package/dist/src/templates/monolith/index.d.ts +0 -1
- package/dist/src/templates/monolith/index.js +0 -1
- package/dist/src/templates/monolith/monolith.template.d.ts +0 -1
- package/dist/src/templates/monolith/monolith.template.js +3 -11
- package/dist/src/templates/resource/index.d.ts +0 -1
- package/dist/src/templates/resource/index.js +0 -1
- package/dist/src/templates/resource/layers/index.d.ts +4 -4
- package/dist/src/templates/resource/layers/index.js +4 -4
- package/dist/src/templates/resource/layers/resourceData.template.d.ts +8 -4
- package/dist/src/templates/resource/layers/resourceData.template.js +30 -72
- package/dist/src/templates/resource/layers/resourceHttp/index.d.ts +6 -0
- package/dist/src/templates/resource/layers/resourceHttp/index.js +6 -0
- package/dist/src/templates/resource/layers/resourceHttp/resourceController.template.d.ts +10 -0
- package/dist/src/templates/resource/layers/resourceHttp/resourceController.template.js +55 -0
- package/dist/src/templates/resource/layers/resourceHttp/resourceRoutes.template.d.ts +6 -0
- package/dist/src/templates/resource/layers/resourceHttp/resourceRoutes.template.js +77 -0
- package/dist/src/templates/resource/layers/resourceHttp/resourceTest.template.d.ts +11 -0
- package/dist/src/templates/resource/layers/resourceHttp/resourceTest.template.js +84 -0
- package/dist/src/templates/resource/layers/resourceMemory.template.d.ts +6 -0
- package/dist/src/templates/resource/layers/resourceMemory.template.js +87 -0
- package/dist/src/templates/resource/layers/resourcePrisma.template.d.ts +0 -1
- package/dist/src/templates/resource/layers/resourcePrisma.template.js +10 -9
- package/dist/src/templates/resource/layers/resourceService.template.d.ts +1 -8
- package/dist/src/templates/resource/layers/resourceService.template.js +9 -54
- package/dist/src/templates/resource/resource.files.d.ts +0 -1
- package/dist/src/templates/resource/resource.files.js +7 -6
- package/dist/src/templates/resource/resource.names.d.ts +0 -1
- package/dist/src/templates/resource/resource.names.js +0 -1
- package/dist/src/templates/resource/resource.type.d.ts +0 -1
- package/dist/src/templates/resource/resource.type.js +0 -1
- package/dist/src/templates/shared/appRuntime.template.d.ts +0 -1
- package/dist/src/templates/shared/appRuntime.template.js +6 -5
- package/dist/src/templates/shared/capability.template.d.ts +0 -1
- package/dist/src/templates/shared/capability.template.js +0 -1
- package/dist/src/templates/shared/dockerfile/dockerfile.install.d.ts +0 -1
- package/dist/src/templates/shared/dockerfile/dockerfile.install.js +0 -1
- package/dist/src/templates/shared/dockerfile/dockerfile.template.d.ts +0 -1
- package/dist/src/templates/shared/dockerfile/dockerfile.template.js +15 -5
- package/dist/src/templates/shared/dockerfile/index.d.ts +0 -1
- package/dist/src/templates/shared/dockerfile/index.js +0 -1
- package/dist/src/templates/shared/index.d.ts +1 -1
- package/dist/src/templates/shared/index.js +1 -1
- package/dist/src/templates/shared/pnpm.template.d.ts +0 -1
- package/dist/src/templates/shared/pnpm.template.js +0 -1
- package/dist/src/templates/shared/server.parts.d.ts +28 -0
- package/dist/src/templates/shared/server.parts.js +59 -0
- package/dist/src/templates/shared/server.template.d.ts +17 -23
- package/dist/src/templates/shared/server.template.js +42 -69
- package/dist/src/types/index.d.ts +0 -1
- package/dist/src/types/index.js +0 -1
- package/dist/src/types/projectConfiguration.type.d.ts +0 -1
- package/dist/src/types/projectConfiguration.type.js +0 -1
- package/dist/src/types/scaffold.type.d.ts +0 -1
- package/dist/src/types/scaffold.type.js +0 -1
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/utils/index.js +0 -1
- package/dist/src/utils/utils.detect.d.ts +0 -1
- package/dist/src/utils/utils.detect.js +0 -1
- package/dist/src/utils/utils.exec.d.ts +0 -1
- package/dist/src/utils/utils.exec.js +0 -1
- package/dist/src/utils/utils.fileSystem.d.ts +0 -1
- package/dist/src/utils/utils.fileSystem.js +0 -1
- package/dist/src/utils/utils.name.d.ts +0 -1
- package/dist/src/utils/utils.name.js +0 -1
- package/dist/src/utils/utils.writeGuard.d.ts +0 -1
- package/dist/src/utils/utils.writeGuard.js +0 -1
- package/dist/src/validators/compatibility/compatibilityValidator.core.d.ts +0 -1
- package/dist/src/validators/compatibility/compatibilityValidator.core.js +0 -1
- package/dist/src/validators/compatibility/index.d.ts +0 -1
- package/dist/src/validators/compatibility/index.js +0 -1
- package/dist/src/validators/environment/environmentValidator.core.d.ts +0 -1
- package/dist/src/validators/environment/environmentValidator.core.js +0 -1
- package/dist/src/validators/environment/index.d.ts +0 -1
- package/dist/src/validators/environment/index.js +0 -1
- package/dist/src/validators/index.d.ts +0 -1
- package/dist/src/validators/index.js +0 -1
- package/dist/src/validators/project/index.d.ts +0 -1
- package/dist/src/validators/project/index.js +0 -1
- package/dist/src/validators/project/projectValidator.core.d.ts +0 -1
- package/dist/src/validators/project/projectValidator.core.js +0 -1
- package/dist/src/wiring/index.d.ts +0 -1
- package/dist/src/wiring/index.js +0 -1
- package/dist/src/wiring/wiring.dependencies.d.ts +0 -1
- package/dist/src/wiring/wiring.dependencies.js +0 -1
- package/dist/src/wiring/wiring.edits.d.ts +0 -1
- package/dist/src/wiring/wiring.edits.js +0 -1
- package/dist/src/wiring/wiring.markers.d.ts +7 -5
- package/dist/src/wiring/wiring.markers.js +8 -7
- package/package.json +6 -6
- package/dist/src/generators/controller/controller.generator.d.ts +0 -11
- package/dist/src/generators/controller/controller.generator.js +0 -47
- package/dist/src/generators/dto/dto.generator.d.ts +0 -12
- package/dist/src/generators/dto/dto.generator.js +0 -27
- package/dist/src/generators/dto/index.d.ts +0 -5
- package/dist/src/generators/dto/index.js +0 -5
- package/dist/src/generators/repository/repository.generator.d.ts +0 -10
- package/dist/src/generators/repository/repository.generator.js +0 -80
- package/dist/src/generators/route/index.d.ts +0 -5
- package/dist/src/generators/route/index.js +0 -5
- package/dist/src/generators/route/route.generator.d.ts +0 -12
- package/dist/src/generators/route/route.generator.js +0 -31
- package/dist/src/templates/resource/layers/resourceRoutes.template.d.ts +0 -13
- package/dist/src/templates/resource/layers/resourceRoutes.template.js +0 -129
|
@@ -26,7 +26,7 @@ import { zudojsDependencies } from "../../constants/index.js";
|
|
|
26
26
|
import { normalizeName } from "../../utils/utils.name.js";
|
|
27
27
|
import { RUNTIME_APP_DEPENDENCIES, capabilityPackages, moduleSpec, renderAppPackageDockerfile, renderModuleFile, renderPnpmWorkspaceFile, resolveProjectCapabilities, } from "../shared/index.js";
|
|
28
28
|
import { DEPENDENCY_VERSION_RANGES, TYPESCRIPT_VERSION_RANGES, } from "../../resolvers/dependency/dependencyVersions.constant.js";
|
|
29
|
-
import { APP_SOURCE_DEPENDENCIES, APP_TEST_DEPENDENCIES, applyDatabaseSetting, backendDevDependencies, emptyBarrels, renderBackendAppSource, } from "../backendApp/index.js";
|
|
29
|
+
import { APP_SOURCE_DEPENDENCIES, APP_TEST_DEPENDENCIES, applyDatabaseSetting, backendAppScripts, backendDevDependencies, backendTsconfigFiles, emptyBarrels, renderBackendAppSource, } from "../backendApp/index.js";
|
|
30
30
|
/**
|
|
31
31
|
* The gateway app is always generated at `apps/gateway`, so "gateway" is a
|
|
32
32
|
* reserved name: a service called `gateway` would produce a second, competing
|
|
@@ -205,33 +205,13 @@ MIT
|
|
|
205
205
|
// app there, so nothing would compile a file placed in it. Every app owns
|
|
206
206
|
// its own `src/types/`, and code genuinely shared between apps belongs in a
|
|
207
207
|
// workspace package the author creates deliberately.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"target": "ES2024",
|
|
211
|
-
"module": "Node16",
|
|
212
|
-
"moduleResolution": "Node16",
|
|
213
|
-
"outDir": "dist",
|
|
214
|
-
"rootDir": "src",
|
|
215
|
-
"strict": true,
|
|
216
|
-
"skipLibCheck": true,
|
|
217
|
-
"esModuleInterop": true,
|
|
218
|
-
"lib": ["ES2024"],
|
|
219
|
-
"types": ["node"]
|
|
220
|
-
},
|
|
221
|
-
"include": ["src/**/*"]
|
|
222
|
-
}
|
|
223
|
-
`;
|
|
208
|
+
/** tsconfig.json and tsconfig.test.json of one app, under `appDir`. */
|
|
209
|
+
const appTsconfigs = (appDir) => Object.fromEntries(Object.entries(backendTsconfigFiles()).map(([name, content]) => [`${appDir}/${name}`, content]));
|
|
224
210
|
const appDevDeps = {
|
|
225
211
|
...backendDevDependencies(),
|
|
226
212
|
...zudojsDependencies(APP_TEST_DEPENDENCIES),
|
|
227
213
|
};
|
|
228
|
-
const appScripts =
|
|
229
|
-
dev: "tsx watch src/server.ts",
|
|
230
|
-
start: "node dist/server.js",
|
|
231
|
-
build: "tsc",
|
|
232
|
-
typecheck: "tsc --noEmit",
|
|
233
|
-
test: "vitest run",
|
|
234
|
-
};
|
|
214
|
+
const appScripts = backendAppScripts();
|
|
235
215
|
/** The wired source tree of one app, plus its folder barrels. */
|
|
236
216
|
const appSource = (appName, port) => {
|
|
237
217
|
const spec = moduleSpec(appName, "./modules/index.js");
|
|
@@ -273,7 +253,7 @@ MIT
|
|
|
273
253
|
dependencies: zudojsDependencies(gatewayDeps),
|
|
274
254
|
devDependencies: appDevDeps,
|
|
275
255
|
}, null, 2) + "\n";
|
|
276
|
-
files
|
|
256
|
+
Object.assign(files, appTsconfigs("apps/gateway"));
|
|
277
257
|
files["apps/gateway/Dockerfile"] = renderAppPackageDockerfile({
|
|
278
258
|
appPath: "apps/gateway",
|
|
279
259
|
port: 3000,
|
|
@@ -301,7 +281,7 @@ MIT
|
|
|
301
281
|
dependencies: zudojsDependencies(serviceDeps),
|
|
302
282
|
devDependencies: appDevDeps,
|
|
303
283
|
}, null, 2) + "\n";
|
|
304
|
-
files
|
|
284
|
+
Object.assign(files, appTsconfigs(`apps/services/${svcName}`));
|
|
305
285
|
files[`apps/services/${svcName}/Dockerfile`] = renderAppPackageDockerfile({
|
|
306
286
|
appPath: `apps/services/${svcName}`,
|
|
307
287
|
port,
|
|
@@ -313,4 +293,3 @@ MIT
|
|
|
313
293
|
}
|
|
314
294
|
return files;
|
|
315
295
|
}
|
|
316
|
-
//# sourceMappingURL=microservice.template.js.map
|
|
@@ -35,7 +35,7 @@ import { renderDatabaseEnv } from "../../adapters/databases/databaseAdapter.reso
|
|
|
35
35
|
import { zudojsDependencies } from "../../constants/index.js";
|
|
36
36
|
import { normalizeName } from "../../utils/utils.name.js";
|
|
37
37
|
import { RUNTIME_APP_DEPENDENCIES, capabilityPackages, moduleSpec, renderModuleFile, renderPnpmWorkspaceFile, resolveProjectCapabilities, } from "../shared/index.js";
|
|
38
|
-
import { APP_SOURCE_DEPENDENCIES, APP_TEST_DEPENDENCIES, applyDatabaseSetting, backendDevDependencies,
|
|
38
|
+
import { APP_SOURCE_DEPENDENCIES, APP_TEST_DEPENDENCIES, applyDatabaseSetting, backendAppScripts, backendDevDependencies, backendTsconfigFiles, emptyBarrels, renderBackendAppSource, runCommand, } from "../backendApp/index.js";
|
|
39
39
|
export function generateModularMonolithFiles(options) {
|
|
40
40
|
const nameSlug = options.projectName
|
|
41
41
|
.replace(/[^a-z0-9-]+/gi, "-")
|
|
@@ -77,20 +77,14 @@ export function generateModularMonolithFiles(options) {
|
|
|
77
77
|
architecture: "modular-monolith",
|
|
78
78
|
features: capabilities,
|
|
79
79
|
},
|
|
80
|
-
scripts:
|
|
81
|
-
dev: "tsx watch src/server.ts",
|
|
82
|
-
start: "node dist/server.js",
|
|
83
|
-
build: "tsc",
|
|
84
|
-
typecheck: "tsc --noEmit",
|
|
85
|
-
test: "vitest run",
|
|
86
|
-
},
|
|
80
|
+
scripts: backendAppScripts(),
|
|
87
81
|
dependencies: zudojsDependencies(deps),
|
|
88
82
|
devDependencies: {
|
|
89
83
|
...backendDevDependencies(),
|
|
90
84
|
...zudojsDependencies(APP_TEST_DEPENDENCIES),
|
|
91
85
|
},
|
|
92
86
|
}, null, 2) + "\n";
|
|
93
|
-
files
|
|
87
|
+
Object.assign(files, backendTsconfigFiles());
|
|
94
88
|
if (options.packageManager === "pnpm") {
|
|
95
89
|
files["pnpm-workspace.yaml"] = renderPnpmWorkspaceFile();
|
|
96
90
|
}
|
|
@@ -159,4 +153,3 @@ MIT
|
|
|
159
153
|
}
|
|
160
154
|
return files;
|
|
161
155
|
}
|
|
162
|
-
//# sourceMappingURL=modularMonolith.template.js.map
|
|
@@ -26,7 +26,7 @@ import { renderDatabaseEnv } from "../../adapters/databases/databaseAdapter.reso
|
|
|
26
26
|
import { zudojsDependencies } from "../../constants/index.js";
|
|
27
27
|
import { normalizeName, toPascalCase } from "../../utils/utils.name.js";
|
|
28
28
|
import { RUNTIME_APP_DEPENDENCIES, capabilityPackages, moduleSpec, renderModuleFile, renderServiceFile, renderPnpmWorkspaceFile, resolveProjectCapabilities, } from "../shared/index.js";
|
|
29
|
-
import { APP_SOURCE_DEPENDENCIES, APP_TEST_DEPENDENCIES, applyDatabaseSetting, backendDevDependencies,
|
|
29
|
+
import { APP_SOURCE_DEPENDENCIES, APP_TEST_DEPENDENCIES, applyDatabaseSetting, backendAppScripts, backendDevDependencies, backendTsconfigFiles, emptyBarrels, runCommand, renderBackendAppSource, } from "../backendApp/index.js";
|
|
30
30
|
export function generateMonolithFiles(options) {
|
|
31
31
|
const name = options.projectName;
|
|
32
32
|
const nameSlug = name.replace(/[^a-z0-9-]+/gi, "-").toLowerCase();
|
|
@@ -56,21 +56,14 @@ export function generateMonolithFiles(options) {
|
|
|
56
56
|
architecture: "monolith",
|
|
57
57
|
features: capabilities,
|
|
58
58
|
},
|
|
59
|
-
scripts:
|
|
60
|
-
dev: "tsx watch src/server.ts",
|
|
61
|
-
start: "node dist/server.js",
|
|
62
|
-
build: "tsc",
|
|
63
|
-
typecheck: "tsc --noEmit",
|
|
64
|
-
test: "vitest run",
|
|
65
|
-
lint: "tsc --noEmit",
|
|
66
|
-
},
|
|
59
|
+
scripts: backendAppScripts(),
|
|
67
60
|
dependencies: zudojsDependencies(deps),
|
|
68
61
|
devDependencies: {
|
|
69
62
|
...backendDevDependencies(),
|
|
70
63
|
...zudojsDependencies(APP_TEST_DEPENDENCIES),
|
|
71
64
|
},
|
|
72
65
|
}, null, 2) + "\n";
|
|
73
|
-
files
|
|
66
|
+
Object.assign(files, backendTsconfigFiles());
|
|
74
67
|
if (options.packageManager === "pnpm") {
|
|
75
68
|
files["pnpm-workspace.yaml"] = renderPnpmWorkspaceFile();
|
|
76
69
|
}
|
|
@@ -148,4 +141,3 @@ MIT
|
|
|
148
141
|
`export { ${serviceClassName} } from "./${moduleName}.service.js";\n`;
|
|
149
142
|
return files;
|
|
150
143
|
}
|
|
151
|
-
//# sourceMappingURL=monolith.template.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* zudojs-cli — Resource layer templates: DTO, repositories
|
|
3
|
-
* controller, routes
|
|
2
|
+
* zudojs-cli — Resource layer templates: DTO, repositories (in-memory and
|
|
3
|
+
* Prisma), service, and the HTTP layers (controller, routes, test).
|
|
4
4
|
*/
|
|
5
5
|
export * from "./resourceData.template.js";
|
|
6
|
+
export * from "./resourceMemory.template.js";
|
|
6
7
|
export * from "./resourcePrisma.template.js";
|
|
7
8
|
export * from "./resourceService.template.js";
|
|
8
|
-
export * from "./
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
9
|
+
export * from "./resourceHttp/index.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* zudojs-cli — Resource layer templates: DTO, repositories
|
|
3
|
-
* controller, routes
|
|
2
|
+
* zudojs-cli — Resource layer templates: DTO, repositories (in-memory and
|
|
3
|
+
* Prisma), service, and the HTTP layers (controller, routes, test).
|
|
4
4
|
*/
|
|
5
5
|
export * from "./resourceData.template.js";
|
|
6
|
+
export * from "./resourceMemory.template.js";
|
|
6
7
|
export * from "./resourcePrisma.template.js";
|
|
7
8
|
export * from "./resourceService.template.js";
|
|
8
|
-
export * from "./
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
9
|
+
export * from "./resourceHttp/index.js";
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* zudojs-cli — A resource's DTO schemas
|
|
2
|
+
* zudojs-cli — A resource's DTO schemas: record, create/update bodies, path
|
|
3
|
+
* parameters, and the list query and page shape.
|
|
4
|
+
*
|
|
5
|
+
* List endpoints paginate with a cursor: `?limit=` (1–MAX_PAGE_SIZE,
|
|
6
|
+
* default DEFAULT_PAGE_SIZE) and `?cursor=<id of the last item seen>`. A
|
|
7
|
+
* page answers `{ items, nextCursor }`, `nextCursor` being `null` on the
|
|
8
|
+
* last page. They used to return every record at once — up to 10,000 from
|
|
9
|
+
* the in-memory store.
|
|
3
10
|
*/
|
|
4
11
|
import { type ResourceNames } from "../resource.names.js";
|
|
5
12
|
/** `dtos/<slug>.dto.ts`: @zudojs/schema schemas and their inferred types. */
|
|
6
13
|
export declare function renderResourceDto(n: ResourceNames): string;
|
|
7
|
-
/** `repositories/<slug>.repository.ts`: the contract and a memory store. */
|
|
8
|
-
export declare function renderResourceRepository(n: ResourceNames): string;
|
|
9
|
-
//# sourceMappingURL=resourceData.template.d.ts.map
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* zudojs-cli — A resource's DTO schemas
|
|
2
|
+
* zudojs-cli — A resource's DTO schemas: record, create/update bodies, path
|
|
3
|
+
* parameters, and the list query and page shape.
|
|
4
|
+
*
|
|
5
|
+
* List endpoints paginate with a cursor: `?limit=` (1–MAX_PAGE_SIZE,
|
|
6
|
+
* default DEFAULT_PAGE_SIZE) and `?cursor=<id of the last item seen>`. A
|
|
7
|
+
* page answers `{ items, nextCursor }`, `nextCursor` being `null` on the
|
|
8
|
+
* last page. They used to return every record at once — up to 10,000 from
|
|
9
|
+
* the in-memory store.
|
|
3
10
|
*/
|
|
4
11
|
import { withArticle } from "../resource.names.js";
|
|
5
12
|
/** `dtos/<slug>.dto.ts`: @zudojs/schema schemas and their inferred types. */
|
|
@@ -29,81 +36,32 @@ export const ${n.entity}ParamsSchema = schema.object({
|
|
|
29
36
|
id: schema.string().uuid(),
|
|
30
37
|
});
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
`;
|
|
36
|
-
}
|
|
37
|
-
/** `repositories/<slug>.repository.ts`: the contract and a memory store. */
|
|
38
|
-
export function renderResourceRepository(n) {
|
|
39
|
-
const types = `Create${n.entity}Input, ${n.entity}, Update${n.entity}Input`;
|
|
40
|
-
return `import { randomUUID } from "node:crypto";
|
|
39
|
+
/** Page size when \`limit\` is not given, and the most a client may ask for. */
|
|
40
|
+
export const DEFAULT_PAGE_SIZE = 50;
|
|
41
|
+
export const MAX_PAGE_SIZE = 200;
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
/** Query of \`GET ${n.routePath}\`: page size and the id to continue after. */
|
|
44
|
+
export const List${n.pascal}QuerySchema = schema.object({
|
|
45
|
+
limit: schema.coerce.number().int().min(1).max(MAX_PAGE_SIZE).optional(),
|
|
46
|
+
cursor: schema.string().uuid().optional(),
|
|
47
|
+
});
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
/** One page of ${n.label} records; \`nextCursor\` is null on the last page. */
|
|
50
|
+
export const ${n.entity}PageSchema = schema.object({
|
|
51
|
+
items: schema.array(${n.entity}Schema),
|
|
52
|
+
nextCursor: schema.nullable(schema.string().uuid()),
|
|
53
|
+
});
|
|
45
54
|
|
|
46
|
-
/**
|
|
47
|
-
export interface ${n.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
create(input: Create${n.entity}Input): Promise<${n.entity}>;
|
|
51
|
-
update(id: string, input: Update${n.entity}Input): Promise<${n.entity} | undefined>;
|
|
52
|
-
delete(id: string): Promise<boolean>;
|
|
55
|
+
/** What a repository is asked for: a page size and where to continue. */
|
|
56
|
+
export interface ${n.entity}PageRequest {
|
|
57
|
+
readonly limit: number;
|
|
58
|
+
readonly cursor?: string;
|
|
53
59
|
}
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
* Data is lost on restart. Swap the implementation in container.ts.
|
|
61
|
-
*/
|
|
62
|
-
export class InMemory${n.pascal}Repository implements ${n.pascal}Repository {
|
|
63
|
-
private readonly records = new Map<string, ${n.entity}>();
|
|
64
|
-
|
|
65
|
-
public async findAll(): Promise<readonly ${n.entity}[]> {
|
|
66
|
-
return [...this.records.values()];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
public async findById(id: string): Promise<${n.entity} | undefined> {
|
|
70
|
-
return this.records.get(id);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
public async create(input: Create${n.entity}Input): Promise<${n.entity}> {
|
|
74
|
-
if (this.records.size >= MAX_RECORDS) {
|
|
75
|
-
throw new ConflictError("The in-memory ${n.label} store is full.");
|
|
76
|
-
}
|
|
77
|
-
const now = new Date().toISOString();
|
|
78
|
-
const record: ${n.entity} = {
|
|
79
|
-
id: randomUUID(),
|
|
80
|
-
name: input.name,
|
|
81
|
-
createdAt: now,
|
|
82
|
-
updatedAt: now,
|
|
83
|
-
};
|
|
84
|
-
this.records.set(record.id, record);
|
|
85
|
-
return record;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
public async update(
|
|
89
|
-
id: string,
|
|
90
|
-
input: Update${n.entity}Input,
|
|
91
|
-
): Promise<${n.entity} | undefined> {
|
|
92
|
-
const existing = this.records.get(id);
|
|
93
|
-
if (existing === undefined) return undefined;
|
|
94
|
-
const updated: ${n.entity} = {
|
|
95
|
-
...existing,
|
|
96
|
-
name: input.name ?? existing.name,
|
|
97
|
-
updatedAt: new Date().toISOString(),
|
|
98
|
-
};
|
|
99
|
-
this.records.set(id, updated);
|
|
100
|
-
return updated;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
public async delete(id: string): Promise<boolean> {
|
|
104
|
-
return this.records.delete(id);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
61
|
+
export type ${n.entity} = Infer<typeof ${n.entity}Schema>;
|
|
62
|
+
export type Create${n.entity}Input = Infer<typeof Create${n.entity}Schema>;
|
|
63
|
+
export type Update${n.entity}Input = Infer<typeof Update${n.entity}Schema>;
|
|
64
|
+
export type List${n.pascal}Query = Infer<typeof List${n.pascal}QuerySchema>;
|
|
65
|
+
export type ${n.entity}Page = Infer<typeof ${n.entity}PageSchema>;
|
|
107
66
|
`;
|
|
108
67
|
}
|
|
109
|
-
//# sourceMappingURL=resourceData.template.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zudojs-cli — A resource's controller.
|
|
3
|
+
*/
|
|
4
|
+
import type { ResourceNames } from "../../resource.names.js";
|
|
5
|
+
/**
|
|
6
|
+
* `controllers/<slug>.controller.ts`: validates input with the DTO schemas
|
|
7
|
+
* and maps service results to responses. Handlers are arrow properties so
|
|
8
|
+
* they can be passed to the router unbound.
|
|
9
|
+
*/
|
|
10
|
+
export declare function renderResourceController(n: ResourceNames, appSrcFromControllers: string): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zudojs-cli — A resource's controller.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* `controllers/<slug>.controller.ts`: validates input with the DTO schemas
|
|
6
|
+
* and maps service results to responses. Handlers are arrow properties so
|
|
7
|
+
* they can be passed to the router unbound.
|
|
8
|
+
*/
|
|
9
|
+
export function renderResourceController(n, appSrcFromControllers) {
|
|
10
|
+
const schemas = `Create${n.entity}Schema, List${n.pascal}QuerySchema, ${n.entity}ParamsSchema, Update${n.entity}Schema`;
|
|
11
|
+
return `import type { HttpResponseContext, HttpRouterContext } from "@zudojs/http";
|
|
12
|
+
|
|
13
|
+
import { ${schemas} } from "../dtos/${n.slug}.dto.js";
|
|
14
|
+
import type { ${n.pascal}Service } from "../services/${n.slug}.service.js";
|
|
15
|
+
import { empty, json, readJsonBody, validationFailed } from "${appSrcFromControllers}/utils/http.js";
|
|
16
|
+
|
|
17
|
+
/** HTTP handlers for ${n.routePath}. */
|
|
18
|
+
export class ${n.pascal}Controller {
|
|
19
|
+
public constructor(private readonly service: ${n.pascal}Service) {}
|
|
20
|
+
|
|
21
|
+
public readonly list = async (ctx: HttpRouterContext): Promise<HttpResponseContext> => {
|
|
22
|
+
const query = List${n.pascal}QuerySchema.safeParse(ctx.query);
|
|
23
|
+
if (!query.success) return validationFailed(query.issues);
|
|
24
|
+
return json(200, await this.service.list(query.data));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
public readonly get = async (ctx: HttpRouterContext): Promise<HttpResponseContext> => {
|
|
28
|
+
const params = ${n.entity}ParamsSchema.safeParse(ctx.params);
|
|
29
|
+
if (!params.success) return validationFailed(params.issues);
|
|
30
|
+
return json(200, await this.service.get(params.data.id));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
public readonly create = async (ctx: HttpRouterContext): Promise<HttpResponseContext> => {
|
|
34
|
+
const body = Create${n.entity}Schema.safeParse(readJsonBody(ctx));
|
|
35
|
+
if (!body.success) return validationFailed(body.issues);
|
|
36
|
+
return json(201, await this.service.create(body.data));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
public readonly update = async (ctx: HttpRouterContext): Promise<HttpResponseContext> => {
|
|
40
|
+
const params = ${n.entity}ParamsSchema.safeParse(ctx.params);
|
|
41
|
+
if (!params.success) return validationFailed(params.issues);
|
|
42
|
+
const body = Update${n.entity}Schema.safeParse(readJsonBody(ctx));
|
|
43
|
+
if (!body.success) return validationFailed(body.issues);
|
|
44
|
+
return json(200, await this.service.update(params.data.id, body.data));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
public readonly remove = async (ctx: HttpRouterContext): Promise<HttpResponseContext> => {
|
|
48
|
+
const params = ${n.entity}ParamsSchema.safeParse(ctx.params);
|
|
49
|
+
if (!params.success) return validationFailed(params.issues);
|
|
50
|
+
await this.service.remove(params.data.id);
|
|
51
|
+
return empty(204);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zudojs-cli — A resource's CRUD routes, with OpenAPI metadata.
|
|
3
|
+
*/
|
|
4
|
+
import { type ResourceNames } from "../../resource.names.js";
|
|
5
|
+
/** `routes/<slug>.routes.ts`: `register<Pascal>Routes(router, controller)`. */
|
|
6
|
+
export declare function renderResourceRoutes(n: ResourceNames): string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zudojs-cli — A resource's CRUD routes, with OpenAPI metadata.
|
|
3
|
+
*/
|
|
4
|
+
import { withArticle } from "../../resource.names.js";
|
|
5
|
+
/** `routes/<slug>.routes.ts`: `register<Pascal>Routes(router, controller)`. */
|
|
6
|
+
export function renderResourceRoutes(n) {
|
|
7
|
+
const schemas = [
|
|
8
|
+
`Create${n.entity}Schema`,
|
|
9
|
+
`List${n.pascal}QuerySchema`,
|
|
10
|
+
`${n.entity}PageSchema`,
|
|
11
|
+
`${n.entity}ParamsSchema`,
|
|
12
|
+
`${n.entity}Schema`,
|
|
13
|
+
`Update${n.entity}Schema`,
|
|
14
|
+
].join(", ");
|
|
15
|
+
return `import type { HttpRouter } from "@zudojs/http";
|
|
16
|
+
|
|
17
|
+
import type { ${n.pascal}Controller } from "../controllers/${n.slug}.controller.js";
|
|
18
|
+
import { ${schemas} } from "../dtos/${n.slug}.dto.js";
|
|
19
|
+
|
|
20
|
+
const BASE_PATH = "${n.routePath}";
|
|
21
|
+
const TAGS = ["${n.slug}"];
|
|
22
|
+
const invalid = { description: "The request failed validation" };
|
|
23
|
+
const missing = { description: "No ${n.label} has this id" };
|
|
24
|
+
|
|
25
|
+
/** Registers the ${n.slug} CRUD routes. */
|
|
26
|
+
export function register${n.pascal}Routes(
|
|
27
|
+
router: HttpRouter,
|
|
28
|
+
controller: ${n.pascal}Controller,
|
|
29
|
+
): void {
|
|
30
|
+
router.get(BASE_PATH, controller.list, {
|
|
31
|
+
openapi: {
|
|
32
|
+
summary: "List ${n.slug}",
|
|
33
|
+
tags: TAGS,
|
|
34
|
+
query: List${n.pascal}QuerySchema,
|
|
35
|
+
responses: { "200": { description: "A page of ${n.label} records", schema: ${n.entity}PageSchema }, "400": invalid },
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
router.get(\`\${BASE_PATH}/:id\`, controller.get, {
|
|
40
|
+
openapi: {
|
|
41
|
+
summary: "Get ${withArticle(n.label)}",
|
|
42
|
+
tags: TAGS,
|
|
43
|
+
params: ${n.entity}ParamsSchema,
|
|
44
|
+
responses: { "200": { description: "The ${n.label}", schema: ${n.entity}Schema }, "400": invalid, "404": missing },
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
router.post(BASE_PATH, controller.create, {
|
|
49
|
+
openapi: {
|
|
50
|
+
summary: "Create ${withArticle(n.label)}",
|
|
51
|
+
tags: TAGS,
|
|
52
|
+
body: Create${n.entity}Schema,
|
|
53
|
+
responses: { "201": { description: "Created", schema: ${n.entity}Schema }, "400": invalid },
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
router.patch(\`\${BASE_PATH}/:id\`, controller.update, {
|
|
58
|
+
openapi: {
|
|
59
|
+
summary: "Update ${withArticle(n.label)}",
|
|
60
|
+
tags: TAGS,
|
|
61
|
+
params: ${n.entity}ParamsSchema,
|
|
62
|
+
body: Update${n.entity}Schema,
|
|
63
|
+
responses: { "200": { description: "Updated", schema: ${n.entity}Schema }, "400": invalid, "404": missing },
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
router.delete(\`\${BASE_PATH}/:id\`, controller.remove, {
|
|
68
|
+
openapi: {
|
|
69
|
+
summary: "Delete ${withArticle(n.label)}",
|
|
70
|
+
tags: TAGS,
|
|
71
|
+
params: ${n.entity}ParamsSchema,
|
|
72
|
+
responses: { "204": { description: "Deleted" }, "400": invalid, "404": missing },
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zudojs-cli — A resource's HTTP test.
|
|
3
|
+
*/
|
|
4
|
+
import { type ResourceNames } from "../../resource.names.js";
|
|
5
|
+
/**
|
|
6
|
+
* `tests/<slug>.test.ts` (or `tests/modules/<module>/<slug>.test.ts` for a
|
|
7
|
+
* module resource): drives the routes over real HTTP with
|
|
8
|
+
* `createHttpTestClient`, backed by the in-memory repository.
|
|
9
|
+
* `baseFromTests` is the import prefix from the test's folder to the layers.
|
|
10
|
+
*/
|
|
11
|
+
export declare function renderResourceTest(n: ResourceNames, baseFromTests: string): string;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zudojs-cli — A resource's HTTP test.
|
|
3
|
+
*/
|
|
4
|
+
import { withArticle } from "../../resource.names.js";
|
|
5
|
+
/**
|
|
6
|
+
* `tests/<slug>.test.ts` (or `tests/modules/<module>/<slug>.test.ts` for a
|
|
7
|
+
* module resource): drives the routes over real HTTP with
|
|
8
|
+
* `createHttpTestClient`, backed by the in-memory repository.
|
|
9
|
+
* `baseFromTests` is the import prefix from the test's folder to the layers.
|
|
10
|
+
*/
|
|
11
|
+
export function renderResourceTest(n, baseFromTests) {
|
|
12
|
+
const b = baseFromTests;
|
|
13
|
+
return `import { afterAll, describe, expect, it } from "vitest";
|
|
14
|
+
import { createRouter } from "@zudojs/http";
|
|
15
|
+
import { createHttpTestClient } from "@zudojs/testing";
|
|
16
|
+
|
|
17
|
+
import { ${n.pascal}Controller } from "${b}/controllers/${n.slug}.controller.js";
|
|
18
|
+
import type { ${n.entity}Page } from "${b}/dtos/${n.slug}.dto.js";
|
|
19
|
+
import { InMemory${n.pascal}Repository } from "${b}/repositories/${n.slug}.repository.js";
|
|
20
|
+
import { register${n.pascal}Routes } from "${b}/routes/${n.slug}.routes.js";
|
|
21
|
+
import { ${n.pascal}Service } from "${b}/services/${n.slug}.service.js";
|
|
22
|
+
|
|
23
|
+
const router = createRouter();
|
|
24
|
+
register${n.pascal}Routes(
|
|
25
|
+
router,
|
|
26
|
+
new ${n.pascal}Controller(new ${n.pascal}Service(new InMemory${n.pascal}Repository())),
|
|
27
|
+
);
|
|
28
|
+
const client = createHttpTestClient(router);
|
|
29
|
+
afterAll(() => client.close());
|
|
30
|
+
|
|
31
|
+
describe("${n.routePath}", () => {
|
|
32
|
+
it("creates, reads, updates and deletes ${withArticle(n.label)}", async () => {
|
|
33
|
+
const created = await client
|
|
34
|
+
.post("${n.routePath}")
|
|
35
|
+
.send({ name: "Ada" })
|
|
36
|
+
.expect(201)
|
|
37
|
+
.expectJson({ name: "Ada" });
|
|
38
|
+
const { id } = created.json<{ id: string }>();
|
|
39
|
+
|
|
40
|
+
await client.get(\`${n.routePath}/\${id}\`).expect(200).expectJson({ id, name: "Ada" });
|
|
41
|
+
await client
|
|
42
|
+
.patch(\`${n.routePath}/\${id}\`)
|
|
43
|
+
.send({ name: "Grace" })
|
|
44
|
+
.expect(200)
|
|
45
|
+
.expectJson({ name: "Grace" });
|
|
46
|
+
await client.delete(\`${n.routePath}/\${id}\`).expect(204);
|
|
47
|
+
await client.get(\`${n.routePath}/\${id}\`).expect(404);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("lists ${n.label} records a page at a time", async () => {
|
|
51
|
+
const ids: string[] = [];
|
|
52
|
+
for (const name of ["Ada", "Grace", "Linus"]) {
|
|
53
|
+
const created = await client.post("${n.routePath}").send({ name }).expect(201);
|
|
54
|
+
ids.push(created.json<{ id: string }>().id);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const seen: string[] = [];
|
|
58
|
+
let cursor: string | null = null;
|
|
59
|
+
do {
|
|
60
|
+
const query: string = cursor === null ? "?limit=2" : \`?limit=2&cursor=\${cursor}\`;
|
|
61
|
+
const page: ${n.entity}Page = (await client.get(\`${n.routePath}\${query}\`).expect(200)).json<${n.entity}Page>();
|
|
62
|
+
expect(page.items.length).toBeLessThanOrEqual(2);
|
|
63
|
+
seen.push(...page.items.map((item) => item.id));
|
|
64
|
+
cursor = page.nextCursor;
|
|
65
|
+
} while (cursor !== null);
|
|
66
|
+
expect(seen).toEqual(expect.arrayContaining(ids));
|
|
67
|
+
|
|
68
|
+
await client.get("${n.routePath}?limit=0").expect(400);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("rejects an invalid body with 400", async () => {
|
|
72
|
+
await client
|
|
73
|
+
.post("${n.routePath}")
|
|
74
|
+
.send({ name: "" })
|
|
75
|
+
.expect(400)
|
|
76
|
+
.expectJson({ error: "Validation failed" });
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("rejects an id that is not a UUID with 400", async () => {
|
|
80
|
+
await client.get("${n.routePath}/not-a-uuid").expect(400);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zudojs-cli — A resource's repository contract and in-memory store.
|
|
3
|
+
*/
|
|
4
|
+
import type { ResourceNames } from "../resource.names.js";
|
|
5
|
+
/** `repositories/<slug>.repository.ts`: the contract and a memory store. */
|
|
6
|
+
export declare function renderResourceRepository(n: ResourceNames): string;
|