zudojs-cli 0.1.2 → 1.0.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.
Files changed (431) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +14 -1
  3. package/dist/src/adapters/databases/postgres.adapter.d.ts +0 -14
  4. package/dist/src/adapters/databases/postgres.adapter.js +0 -30
  5. package/dist/src/adapters/frontend/angular.adapter.js +6 -0
  6. package/dist/src/adapters/frontend/astro.adapter.js +2 -2
  7. package/dist/src/adapters/frontend/react.adapter.js +26 -17
  8. package/dist/src/adapters/frontend/svelte.adapter.js +1 -0
  9. package/dist/src/adapters/frontend/sveltekit.adapter.js +7 -8
  10. package/dist/src/adapters/frontend/vanilla.adapter.js +1 -1
  11. package/dist/src/adapters/frontend/vue.adapter.js +1 -0
  12. package/dist/src/adapters/package-managers/bun.adapter.js +5 -5
  13. package/dist/src/adapters/package-managers/npm.adapter.js +5 -5
  14. package/dist/src/adapters/package-managers/pnpm.adapter.js +5 -5
  15. package/dist/src/adapters/package-managers/yarn.adapter.js +5 -5
  16. package/dist/src/bin/zudojs.js +42 -6
  17. package/dist/src/cliApplication/cliApplication.builtins.d.ts +11 -2
  18. package/dist/src/cliApplication/cliApplication.builtins.js +15 -4
  19. package/dist/src/cliApplication/cliApplication.core.js +20 -5
  20. package/dist/src/cliConstant/cliConstant.value.d.ts +1 -1
  21. package/dist/src/cliConstant/cliConstant.value.js +2 -1
  22. package/dist/src/cliConstant/cliVersion.d.ts +16 -0
  23. package/dist/src/cliConstant/cliVersion.js +57 -0
  24. package/dist/src/cliParser/cliParser.core.js +7 -0
  25. package/dist/src/cliParser/cliParser.shortOption.js +1 -1
  26. package/dist/src/commands/add.command.js +27 -24
  27. package/dist/src/commands/build.command.js +13 -7
  28. package/dist/src/commands/create.command.js +169 -51
  29. package/dist/src/commands/dev.command.js +62 -27
  30. package/dist/src/commands/doctor.command.js +45 -23
  31. package/dist/src/commands/generate.command.js +103 -34
  32. package/dist/src/constants/index.d.ts +3 -1
  33. package/dist/src/constants/index.js +3 -1
  34. package/dist/src/generators/command/command.generator.d.ts +1 -0
  35. package/dist/src/generators/command/command.generator.js +10 -4
  36. package/dist/src/generators/controller/controller.generator.d.ts +1 -0
  37. package/dist/src/generators/controller/controller.generator.js +12 -9
  38. package/dist/src/generators/dto/dto.generator.d.ts +1 -0
  39. package/dist/src/generators/dto/dto.generator.js +9 -3
  40. package/dist/src/generators/event/event.generator.d.ts +1 -0
  41. package/dist/src/generators/event/event.generator.js +10 -4
  42. package/dist/src/generators/frontend/frontendGenerator.core.js +4 -28
  43. package/dist/src/generators/frontend/frontendPipeline.d.ts +26 -0
  44. package/dist/src/generators/frontend/frontendPipeline.js +93 -0
  45. package/dist/src/generators/fullstack/fullstackComposer.core.d.ts +1 -2
  46. package/dist/src/generators/fullstack/fullstackComposer.core.js +72 -43
  47. package/dist/src/generators/infrastructure/infrastructure.generator.d.ts +11 -0
  48. package/dist/src/generators/infrastructure/infrastructure.generator.js +101 -61
  49. package/dist/src/generators/integration/integrationGenerator.core.d.ts +6 -0
  50. package/dist/src/generators/integration/integrationGenerator.core.js +35 -6
  51. package/dist/src/generators/job/job.generator.d.ts +1 -0
  52. package/dist/src/generators/job/job.generator.js +9 -3
  53. package/dist/src/generators/middleware/middleware.generator.d.ts +1 -0
  54. package/dist/src/generators/middleware/middleware.generator.js +10 -4
  55. package/dist/src/generators/model/model.generator.d.ts +1 -0
  56. package/dist/src/generators/model/model.generator.js +9 -3
  57. package/dist/src/generators/module/module.generator.d.ts +1 -0
  58. package/dist/src/generators/module/module.generator.js +11 -24
  59. package/dist/src/generators/project/project.generator.js +2 -23
  60. package/dist/src/generators/query/query.generator.d.ts +1 -0
  61. package/dist/src/generators/query/query.generator.js +10 -4
  62. package/dist/src/generators/repository/repository.generator.d.ts +1 -0
  63. package/dist/src/generators/repository/repository.generator.js +12 -9
  64. package/dist/src/generators/route/route.generator.d.ts +1 -0
  65. package/dist/src/generators/route/route.generator.js +11 -5
  66. package/dist/src/generators/service/service.generator.d.ts +1 -0
  67. package/dist/src/generators/service/service.generator.js +12 -9
  68. package/dist/src/generators/validator/validator.generator.d.ts +1 -0
  69. package/dist/src/generators/validator/validator.generator.js +9 -3
  70. package/dist/src/installers/dependency.installer.js +6 -2
  71. package/dist/src/manifest/manifestManager.core.d.ts +3 -0
  72. package/dist/src/prompts/backend/index.d.ts +1 -0
  73. package/dist/src/prompts/backend/index.js +1 -0
  74. package/dist/src/prompts/backend/services.prompt.d.ts +7 -0
  75. package/dist/src/prompts/backend/services.prompt.js +39 -0
  76. package/dist/src/prompts/index.d.ts +0 -1
  77. package/dist/src/prompts/index.js +0 -1
  78. package/dist/src/rollback/rollbackManager.core.js +0 -1
  79. package/dist/src/runners/process/processRunner.core.d.ts +4 -0
  80. package/dist/src/runners/process/processRunner.core.js +17 -3
  81. package/dist/src/scaffolders/framework.scaffolder.js +9 -6
  82. package/dist/src/scaffolders/scaffolder.helper.js +7 -2
  83. package/dist/src/scripts/postinstall.cjs +24 -3
  84. package/dist/src/templates/microservice/index.d.ts +1 -1
  85. package/dist/src/templates/microservice/index.js +1 -1
  86. package/dist/src/templates/microservice/microservice.template.d.ts +15 -0
  87. package/dist/src/templates/microservice/microservice.template.js +148 -162
  88. package/dist/src/templates/modular-monolith/modularMonolith.template.js +45 -76
  89. package/dist/src/templates/monolith/monolith.template.d.ts +1 -0
  90. package/dist/src/templates/monolith/monolith.template.js +48 -68
  91. package/dist/src/templates/shared/appRuntime.template.d.ts +71 -0
  92. package/dist/src/templates/shared/appRuntime.template.js +209 -0
  93. package/dist/src/templates/shared/index.d.ts +5 -0
  94. package/dist/src/templates/shared/index.js +5 -0
  95. package/dist/src/utils/index.d.ts +3 -3
  96. package/dist/src/utils/index.js +3 -3
  97. package/dist/src/utils/utils.exec.d.ts +19 -1
  98. package/dist/src/utils/utils.exec.js +37 -3
  99. package/dist/src/utils/utils.fileSystem.d.ts +6 -0
  100. package/dist/src/utils/utils.fileSystem.js +19 -0
  101. package/dist/src/utils/utils.name.d.ts +26 -0
  102. package/dist/src/utils/utils.name.js +51 -1
  103. package/package.json +29 -22
  104. package/src/scripts/postinstall.cjs +24 -3
  105. package/dist/.tsbuildinfo +0 -1
  106. package/dist/src/adapters/databases/index.d.ts.map +0 -1
  107. package/dist/src/adapters/databases/index.js.map +0 -1
  108. package/dist/src/adapters/databases/mysql.adapter.d.ts.map +0 -1
  109. package/dist/src/adapters/databases/mysql.adapter.js.map +0 -1
  110. package/dist/src/adapters/databases/postgres.adapter.d.ts.map +0 -1
  111. package/dist/src/adapters/databases/postgres.adapter.js.map +0 -1
  112. package/dist/src/adapters/databases/sqlite.adapter.d.ts.map +0 -1
  113. package/dist/src/adapters/databases/sqlite.adapter.js.map +0 -1
  114. package/dist/src/adapters/frontend/angular.adapter.d.ts.map +0 -1
  115. package/dist/src/adapters/frontend/angular.adapter.js.map +0 -1
  116. package/dist/src/adapters/frontend/astro.adapter.d.ts.map +0 -1
  117. package/dist/src/adapters/frontend/astro.adapter.js.map +0 -1
  118. package/dist/src/adapters/frontend/flutter.adapter.d.ts.map +0 -1
  119. package/dist/src/adapters/frontend/flutter.adapter.js.map +0 -1
  120. package/dist/src/adapters/frontend/frontendAdapter.type.d.ts.map +0 -1
  121. package/dist/src/adapters/frontend/frontendAdapter.type.js.map +0 -1
  122. package/dist/src/adapters/frontend/index.d.ts.map +0 -1
  123. package/dist/src/adapters/frontend/index.js.map +0 -1
  124. package/dist/src/adapters/frontend/next.adapter.d.ts.map +0 -1
  125. package/dist/src/adapters/frontend/next.adapter.js.map +0 -1
  126. package/dist/src/adapters/frontend/nuxt.adapter.d.ts.map +0 -1
  127. package/dist/src/adapters/frontend/nuxt.adapter.js.map +0 -1
  128. package/dist/src/adapters/frontend/react-native.adapter.d.ts.map +0 -1
  129. package/dist/src/adapters/frontend/react-native.adapter.js.map +0 -1
  130. package/dist/src/adapters/frontend/react.adapter.d.ts.map +0 -1
  131. package/dist/src/adapters/frontend/react.adapter.js.map +0 -1
  132. package/dist/src/adapters/frontend/svelte.adapter.d.ts.map +0 -1
  133. package/dist/src/adapters/frontend/svelte.adapter.js.map +0 -1
  134. package/dist/src/adapters/frontend/sveltekit.adapter.d.ts.map +0 -1
  135. package/dist/src/adapters/frontend/sveltekit.adapter.js.map +0 -1
  136. package/dist/src/adapters/frontend/vanilla.adapter.d.ts.map +0 -1
  137. package/dist/src/adapters/frontend/vanilla.adapter.js.map +0 -1
  138. package/dist/src/adapters/frontend/vue.adapter.d.ts.map +0 -1
  139. package/dist/src/adapters/frontend/vue.adapter.js.map +0 -1
  140. package/dist/src/adapters/package-managers/bun.adapter.d.ts.map +0 -1
  141. package/dist/src/adapters/package-managers/bun.adapter.js.map +0 -1
  142. package/dist/src/adapters/package-managers/index.d.ts.map +0 -1
  143. package/dist/src/adapters/package-managers/index.js.map +0 -1
  144. package/dist/src/adapters/package-managers/npm.adapter.d.ts.map +0 -1
  145. package/dist/src/adapters/package-managers/npm.adapter.js.map +0 -1
  146. package/dist/src/adapters/package-managers/packageManager.type.d.ts.map +0 -1
  147. package/dist/src/adapters/package-managers/packageManager.type.js.map +0 -1
  148. package/dist/src/adapters/package-managers/pnpm.adapter.d.ts.map +0 -1
  149. package/dist/src/adapters/package-managers/pnpm.adapter.js.map +0 -1
  150. package/dist/src/adapters/package-managers/yarn.adapter.d.ts.map +0 -1
  151. package/dist/src/adapters/package-managers/yarn.adapter.js.map +0 -1
  152. package/dist/src/bin/zudojs.d.ts.map +0 -1
  153. package/dist/src/bin/zudojs.js.map +0 -1
  154. package/dist/src/cliApplication/cliApplication.builtins.d.ts.map +0 -1
  155. package/dist/src/cliApplication/cliApplication.builtins.js.map +0 -1
  156. package/dist/src/cliApplication/cliApplication.core.d.ts.map +0 -1
  157. package/dist/src/cliApplication/cliApplication.core.js.map +0 -1
  158. package/dist/src/cliApplication/cliApplication.writer.d.ts.map +0 -1
  159. package/dist/src/cliApplication/cliApplication.writer.js.map +0 -1
  160. package/dist/src/cliApplication/index.d.ts.map +0 -1
  161. package/dist/src/cliApplication/index.js.map +0 -1
  162. package/dist/src/cliCommand/cliCommand.builder.d.ts.map +0 -1
  163. package/dist/src/cliCommand/cliCommand.builder.js.map +0 -1
  164. package/dist/src/cliCommand/cliCommand.factory.d.ts.map +0 -1
  165. package/dist/src/cliCommand/cliCommand.factory.js.map +0 -1
  166. package/dist/src/cliCommand/cliCommand.registry.d.ts.map +0 -1
  167. package/dist/src/cliCommand/cliCommand.registry.js.map +0 -1
  168. package/dist/src/cliCommand/cliCommand.validator.d.ts.map +0 -1
  169. package/dist/src/cliCommand/cliCommand.validator.js.map +0 -1
  170. package/dist/src/cliCommand/index.d.ts.map +0 -1
  171. package/dist/src/cliCommand/index.js.map +0 -1
  172. package/dist/src/cliConstant/cliConstant.value.d.ts.map +0 -1
  173. package/dist/src/cliConstant/cliConstant.value.js.map +0 -1
  174. package/dist/src/cliConstant/index.d.ts.map +0 -1
  175. package/dist/src/cliConstant/index.js.map +0 -1
  176. package/dist/src/cliError/cliError.argument.d.ts.map +0 -1
  177. package/dist/src/cliError/cliError.argument.js.map +0 -1
  178. package/dist/src/cliError/cliError.base.d.ts.map +0 -1
  179. package/dist/src/cliError/cliError.base.js.map +0 -1
  180. package/dist/src/cliError/cliError.command.d.ts.map +0 -1
  181. package/dist/src/cliError/cliError.command.js.map +0 -1
  182. package/dist/src/cliError/cliError.execution.d.ts.map +0 -1
  183. package/dist/src/cliError/cliError.execution.js.map +0 -1
  184. package/dist/src/cliError/cliError.option.d.ts.map +0 -1
  185. package/dist/src/cliError/cliError.option.js.map +0 -1
  186. package/dist/src/cliError/index.d.ts.map +0 -1
  187. package/dist/src/cliError/index.js.map +0 -1
  188. package/dist/src/cliParser/cliParser.core.d.ts.map +0 -1
  189. package/dist/src/cliParser/cliParser.core.js.map +0 -1
  190. package/dist/src/cliParser/cliParser.helper.d.ts.map +0 -1
  191. package/dist/src/cliParser/cliParser.helper.js.map +0 -1
  192. package/dist/src/cliParser/cliParser.longOption.d.ts.map +0 -1
  193. package/dist/src/cliParser/cliParser.longOption.js.map +0 -1
  194. package/dist/src/cliParser/cliParser.shortOption.d.ts.map +0 -1
  195. package/dist/src/cliParser/cliParser.shortOption.js.map +0 -1
  196. package/dist/src/cliParser/index.d.ts.map +0 -1
  197. package/dist/src/cliParser/index.js.map +0 -1
  198. package/dist/src/cliType/cliType.type.d.ts.map +0 -1
  199. package/dist/src/cliType/cliType.type.js.map +0 -1
  200. package/dist/src/cliType/index.d.ts.map +0 -1
  201. package/dist/src/cliType/index.js.map +0 -1
  202. package/dist/src/cliVersion/cliVersion.core.d.ts.map +0 -1
  203. package/dist/src/cliVersion/cliVersion.core.js.map +0 -1
  204. package/dist/src/cliVersion/index.d.ts.map +0 -1
  205. package/dist/src/cliVersion/index.js.map +0 -1
  206. package/dist/src/commands/add.command.d.ts.map +0 -1
  207. package/dist/src/commands/add.command.js.map +0 -1
  208. package/dist/src/commands/build.command.d.ts.map +0 -1
  209. package/dist/src/commands/build.command.js.map +0 -1
  210. package/dist/src/commands/create.command.d.ts.map +0 -1
  211. package/dist/src/commands/create.command.js.map +0 -1
  212. package/dist/src/commands/dev.command.d.ts.map +0 -1
  213. package/dist/src/commands/dev.command.js.map +0 -1
  214. package/dist/src/commands/doctor.command.d.ts.map +0 -1
  215. package/dist/src/commands/doctor.command.js.map +0 -1
  216. package/dist/src/commands/generate.command.d.ts.map +0 -1
  217. package/dist/src/commands/generate.command.js.map +0 -1
  218. package/dist/src/commands/index.d.ts.map +0 -1
  219. package/dist/src/commands/index.js.map +0 -1
  220. package/dist/src/commands/info.command.d.ts.map +0 -1
  221. package/dist/src/commands/info.command.js.map +0 -1
  222. package/dist/src/constants/index.d.ts.map +0 -1
  223. package/dist/src/constants/index.js.map +0 -1
  224. package/dist/src/errors/index.d.ts.map +0 -1
  225. package/dist/src/errors/index.js.map +0 -1
  226. package/dist/src/generators/backend/backend.generator.d.ts.map +0 -1
  227. package/dist/src/generators/backend/backend.generator.js.map +0 -1
  228. package/dist/src/generators/backend/index.d.ts.map +0 -1
  229. package/dist/src/generators/backend/index.js.map +0 -1
  230. package/dist/src/generators/command/command.generator.d.ts.map +0 -1
  231. package/dist/src/generators/command/command.generator.js.map +0 -1
  232. package/dist/src/generators/controller/controller.generator.d.ts.map +0 -1
  233. package/dist/src/generators/controller/controller.generator.js.map +0 -1
  234. package/dist/src/generators/dto/dto.generator.d.ts.map +0 -1
  235. package/dist/src/generators/dto/dto.generator.js.map +0 -1
  236. package/dist/src/generators/dto/index.d.ts.map +0 -1
  237. package/dist/src/generators/dto/index.js.map +0 -1
  238. package/dist/src/generators/event/event.generator.d.ts.map +0 -1
  239. package/dist/src/generators/event/event.generator.js.map +0 -1
  240. package/dist/src/generators/event/index.d.ts.map +0 -1
  241. package/dist/src/generators/event/index.js.map +0 -1
  242. package/dist/src/generators/frontend/frontendGenerator.core.d.ts.map +0 -1
  243. package/dist/src/generators/frontend/frontendGenerator.core.js.map +0 -1
  244. package/dist/src/generators/frontend/index.d.ts.map +0 -1
  245. package/dist/src/generators/frontend/index.js.map +0 -1
  246. package/dist/src/generators/fullstack/fullstackComposer.core.d.ts.map +0 -1
  247. package/dist/src/generators/fullstack/fullstackComposer.core.js.map +0 -1
  248. package/dist/src/generators/fullstack/index.d.ts.map +0 -1
  249. package/dist/src/generators/fullstack/index.js.map +0 -1
  250. package/dist/src/generators/index.d.ts.map +0 -1
  251. package/dist/src/generators/index.js.map +0 -1
  252. package/dist/src/generators/infrastructure/index.d.ts.map +0 -1
  253. package/dist/src/generators/infrastructure/index.js.map +0 -1
  254. package/dist/src/generators/infrastructure/infrastructure.generator.d.ts.map +0 -1
  255. package/dist/src/generators/infrastructure/infrastructure.generator.js.map +0 -1
  256. package/dist/src/generators/integration/index.d.ts.map +0 -1
  257. package/dist/src/generators/integration/index.js.map +0 -1
  258. package/dist/src/generators/integration/integrationGenerator.core.d.ts.map +0 -1
  259. package/dist/src/generators/integration/integrationGenerator.core.js.map +0 -1
  260. package/dist/src/generators/job/index.d.ts.map +0 -1
  261. package/dist/src/generators/job/index.js.map +0 -1
  262. package/dist/src/generators/job/job.generator.d.ts.map +0 -1
  263. package/dist/src/generators/job/job.generator.js.map +0 -1
  264. package/dist/src/generators/middleware/index.d.ts.map +0 -1
  265. package/dist/src/generators/middleware/index.js.map +0 -1
  266. package/dist/src/generators/middleware/middleware.generator.d.ts.map +0 -1
  267. package/dist/src/generators/middleware/middleware.generator.js.map +0 -1
  268. package/dist/src/generators/model/index.d.ts.map +0 -1
  269. package/dist/src/generators/model/index.js.map +0 -1
  270. package/dist/src/generators/model/model.generator.d.ts.map +0 -1
  271. package/dist/src/generators/model/model.generator.js.map +0 -1
  272. package/dist/src/generators/module/module.generator.d.ts.map +0 -1
  273. package/dist/src/generators/module/module.generator.js.map +0 -1
  274. package/dist/src/generators/project/project.generator.d.ts.map +0 -1
  275. package/dist/src/generators/project/project.generator.js.map +0 -1
  276. package/dist/src/generators/query/query.generator.d.ts.map +0 -1
  277. package/dist/src/generators/query/query.generator.js.map +0 -1
  278. package/dist/src/generators/repository/repository.generator.d.ts.map +0 -1
  279. package/dist/src/generators/repository/repository.generator.js.map +0 -1
  280. package/dist/src/generators/route/index.d.ts.map +0 -1
  281. package/dist/src/generators/route/index.js.map +0 -1
  282. package/dist/src/generators/route/route.generator.d.ts.map +0 -1
  283. package/dist/src/generators/route/route.generator.js.map +0 -1
  284. package/dist/src/generators/service/service.generator.d.ts.map +0 -1
  285. package/dist/src/generators/service/service.generator.js.map +0 -1
  286. package/dist/src/generators/validator/index.d.ts.map +0 -1
  287. package/dist/src/generators/validator/index.js.map +0 -1
  288. package/dist/src/generators/validator/validator.generator.d.ts.map +0 -1
  289. package/dist/src/generators/validator/validator.generator.js.map +0 -1
  290. package/dist/src/index.d.ts.map +0 -1
  291. package/dist/src/index.js.map +0 -1
  292. package/dist/src/installers/dependency.installer.d.ts.map +0 -1
  293. package/dist/src/installers/dependency.installer.js.map +0 -1
  294. package/dist/src/installers/index.d.ts.map +0 -1
  295. package/dist/src/installers/index.js.map +0 -1
  296. package/dist/src/manifest/index.d.ts.map +0 -1
  297. package/dist/src/manifest/index.js.map +0 -1
  298. package/dist/src/manifest/manifestManager.core.d.ts.map +0 -1
  299. package/dist/src/manifest/manifestManager.core.js.map +0 -1
  300. package/dist/src/prompts/backend/api-style.prompt.d.ts.map +0 -1
  301. package/dist/src/prompts/backend/api-style.prompt.js.map +0 -1
  302. package/dist/src/prompts/backend/backend-architecture.prompt.d.ts.map +0 -1
  303. package/dist/src/prompts/backend/backend-architecture.prompt.js.map +0 -1
  304. package/dist/src/prompts/backend/database.prompt.d.ts.map +0 -1
  305. package/dist/src/prompts/backend/database.prompt.js.map +0 -1
  306. package/dist/src/prompts/backend/index.d.ts.map +0 -1
  307. package/dist/src/prompts/backend/index.js.map +0 -1
  308. package/dist/src/prompts/capabilities/capabilities.prompt.d.ts.map +0 -1
  309. package/dist/src/prompts/capabilities/capabilities.prompt.js.map +0 -1
  310. package/dist/src/prompts/capabilities/index.d.ts.map +0 -1
  311. package/dist/src/prompts/capabilities/index.js.map +0 -1
  312. package/dist/src/prompts/frontend/framework.prompt.d.ts.map +0 -1
  313. package/dist/src/prompts/frontend/framework.prompt.js.map +0 -1
  314. package/dist/src/prompts/frontend/frontend-architecture.prompt.d.ts.map +0 -1
  315. package/dist/src/prompts/frontend/frontend-architecture.prompt.js.map +0 -1
  316. package/dist/src/prompts/frontend/index.d.ts.map +0 -1
  317. package/dist/src/prompts/frontend/index.js.map +0 -1
  318. package/dist/src/prompts/index.d.ts.map +0 -1
  319. package/dist/src/prompts/index.js.map +0 -1
  320. package/dist/src/prompts/project/confirmation.prompt.d.ts.map +0 -1
  321. package/dist/src/prompts/project/confirmation.prompt.js.map +0 -1
  322. package/dist/src/prompts/project/index.d.ts.map +0 -1
  323. package/dist/src/prompts/project/index.js.map +0 -1
  324. package/dist/src/prompts/project/project-name.prompt.d.ts.map +0 -1
  325. package/dist/src/prompts/project/project-name.prompt.js.map +0 -1
  326. package/dist/src/prompts/project/project-type.prompt.d.ts.map +0 -1
  327. package/dist/src/prompts/project/project-type.prompt.js.map +0 -1
  328. package/dist/src/prompts/prompts.createProject.d.ts +0 -33
  329. package/dist/src/prompts/prompts.createProject.d.ts.map +0 -1
  330. package/dist/src/prompts/prompts.createProject.js +0 -150
  331. package/dist/src/prompts/prompts.createProject.js.map +0 -1
  332. package/dist/src/prompts/workspace/index.d.ts.map +0 -1
  333. package/dist/src/prompts/workspace/index.js.map +0 -1
  334. package/dist/src/prompts/workspace/package-manager.prompt.d.ts.map +0 -1
  335. package/dist/src/prompts/workspace/package-manager.prompt.js.map +0 -1
  336. package/dist/src/registries/adapter/frontendAdapterRegistry.core.d.ts.map +0 -1
  337. package/dist/src/registries/adapter/frontendAdapterRegistry.core.js.map +0 -1
  338. package/dist/src/registries/adapter/packageManagerRegistry.core.d.ts.map +0 -1
  339. package/dist/src/registries/adapter/packageManagerRegistry.core.js.map +0 -1
  340. package/dist/src/registries/dependency/dependencyRegistry.core.d.ts.map +0 -1
  341. package/dist/src/registries/dependency/dependencyRegistry.core.js.map +0 -1
  342. package/dist/src/registries/dependency/index.d.ts.map +0 -1
  343. package/dist/src/registries/dependency/index.js.map +0 -1
  344. package/dist/src/registries/generator/generatorRegistry.core.d.ts.map +0 -1
  345. package/dist/src/registries/generator/generatorRegistry.core.js.map +0 -1
  346. package/dist/src/registries/generator/index.d.ts.map +0 -1
  347. package/dist/src/registries/generator/index.js.map +0 -1
  348. package/dist/src/registries/index.d.ts.map +0 -1
  349. package/dist/src/registries/index.js.map +0 -1
  350. package/dist/src/resolvers/architecture.resolver.d.ts.map +0 -1
  351. package/dist/src/resolvers/architecture.resolver.js.map +0 -1
  352. package/dist/src/resolvers/capability/capabilityResolver.core.d.ts.map +0 -1
  353. package/dist/src/resolvers/capability/capabilityResolver.core.js.map +0 -1
  354. package/dist/src/resolvers/capability/index.d.ts.map +0 -1
  355. package/dist/src/resolvers/capability/index.js.map +0 -1
  356. package/dist/src/resolvers/configuration/configurationResolver.core.d.ts.map +0 -1
  357. package/dist/src/resolvers/configuration/configurationResolver.core.js.map +0 -1
  358. package/dist/src/resolvers/configuration/index.d.ts.map +0 -1
  359. package/dist/src/resolvers/configuration/index.js.map +0 -1
  360. package/dist/src/resolvers/dependency/dependencyResolver.core.d.ts.map +0 -1
  361. package/dist/src/resolvers/dependency/dependencyResolver.core.js.map +0 -1
  362. package/dist/src/resolvers/dependency/index.d.ts.map +0 -1
  363. package/dist/src/resolvers/dependency/index.js.map +0 -1
  364. package/dist/src/resolvers/index.d.ts.map +0 -1
  365. package/dist/src/resolvers/index.js.map +0 -1
  366. package/dist/src/resolvers/project.resolver.d.ts.map +0 -1
  367. package/dist/src/resolvers/project.resolver.js.map +0 -1
  368. package/dist/src/rollback/index.d.ts.map +0 -1
  369. package/dist/src/rollback/index.js.map +0 -1
  370. package/dist/src/rollback/rollbackManager.core.d.ts.map +0 -1
  371. package/dist/src/rollback/rollbackManager.core.js.map +0 -1
  372. package/dist/src/runners/package-manager/index.d.ts.map +0 -1
  373. package/dist/src/runners/package-manager/index.js.map +0 -1
  374. package/dist/src/runners/package-manager/packageManagerRunner.core.d.ts.map +0 -1
  375. package/dist/src/runners/package-manager/packageManagerRunner.core.js.map +0 -1
  376. package/dist/src/runners/process/index.d.ts.map +0 -1
  377. package/dist/src/runners/process/index.js.map +0 -1
  378. package/dist/src/runners/process/processRunner.core.d.ts.map +0 -1
  379. package/dist/src/runners/process/processRunner.core.js.map +0 -1
  380. package/dist/src/runners/task/index.d.ts.map +0 -1
  381. package/dist/src/runners/task/index.js.map +0 -1
  382. package/dist/src/runners/task/taskRunner.core.d.ts.map +0 -1
  383. package/dist/src/runners/task/taskRunner.core.js.map +0 -1
  384. package/dist/src/scaffolders/framework.scaffolder.d.ts.map +0 -1
  385. package/dist/src/scaffolders/framework.scaffolder.js.map +0 -1
  386. package/dist/src/scaffolders/index.d.ts.map +0 -1
  387. package/dist/src/scaffolders/index.js.map +0 -1
  388. package/dist/src/scaffolders/scaffolder.helper.d.ts.map +0 -1
  389. package/dist/src/scaffolders/scaffolder.helper.js.map +0 -1
  390. package/dist/src/templates/microservice/index.d.ts.map +0 -1
  391. package/dist/src/templates/microservice/index.js.map +0 -1
  392. package/dist/src/templates/microservice/microservice.template.d.ts.map +0 -1
  393. package/dist/src/templates/microservice/microservice.template.js.map +0 -1
  394. package/dist/src/templates/modular-monolith/index.d.ts.map +0 -1
  395. package/dist/src/templates/modular-monolith/index.js.map +0 -1
  396. package/dist/src/templates/modular-monolith/modularMonolith.template.d.ts.map +0 -1
  397. package/dist/src/templates/modular-monolith/modularMonolith.template.js.map +0 -1
  398. package/dist/src/templates/monolith/index.d.ts.map +0 -1
  399. package/dist/src/templates/monolith/index.js.map +0 -1
  400. package/dist/src/templates/monolith/monolith.template.d.ts.map +0 -1
  401. package/dist/src/templates/monolith/monolith.template.js.map +0 -1
  402. package/dist/src/types/index.d.ts.map +0 -1
  403. package/dist/src/types/index.js.map +0 -1
  404. package/dist/src/types/projectConfiguration.type.d.ts.map +0 -1
  405. package/dist/src/types/projectConfiguration.type.js.map +0 -1
  406. package/dist/src/types/scaffold.type.d.ts.map +0 -1
  407. package/dist/src/types/scaffold.type.js.map +0 -1
  408. package/dist/src/utils/index.d.ts.map +0 -1
  409. package/dist/src/utils/index.js.map +0 -1
  410. package/dist/src/utils/utils.detect.d.ts.map +0 -1
  411. package/dist/src/utils/utils.detect.js.map +0 -1
  412. package/dist/src/utils/utils.exec.d.ts.map +0 -1
  413. package/dist/src/utils/utils.exec.js.map +0 -1
  414. package/dist/src/utils/utils.fileSystem.d.ts.map +0 -1
  415. package/dist/src/utils/utils.fileSystem.js.map +0 -1
  416. package/dist/src/utils/utils.name.d.ts.map +0 -1
  417. package/dist/src/utils/utils.name.js.map +0 -1
  418. package/dist/src/validators/compatibility/compatibilityValidator.core.d.ts.map +0 -1
  419. package/dist/src/validators/compatibility/compatibilityValidator.core.js.map +0 -1
  420. package/dist/src/validators/compatibility/index.d.ts.map +0 -1
  421. package/dist/src/validators/compatibility/index.js.map +0 -1
  422. package/dist/src/validators/environment/environmentValidator.core.d.ts.map +0 -1
  423. package/dist/src/validators/environment/environmentValidator.core.js.map +0 -1
  424. package/dist/src/validators/environment/index.d.ts.map +0 -1
  425. package/dist/src/validators/environment/index.js.map +0 -1
  426. package/dist/src/validators/index.d.ts.map +0 -1
  427. package/dist/src/validators/index.js.map +0 -1
  428. package/dist/src/validators/project/index.d.ts.map +0 -1
  429. package/dist/src/validators/project/index.js.map +0 -1
  430. package/dist/src/validators/project/projectValidator.core.d.ts.map +0 -1
  431. package/dist/src/validators/project/projectValidator.core.js.map +0 -1
@@ -0,0 +1,57 @@
1
+ /**
2
+ * zudojs-cli — Version resolution
3
+ *
4
+ * The CLI's own version, read from its `package.json` at runtime.
5
+ *
6
+ * It used to be a hand-maintained string literal duplicated in two places
7
+ * (`constants/index.ts` and `cliConstant.value.ts`). Both are stamped into the
8
+ * manifest of every generated project, so a release that bumped `package.json`
9
+ * without editing both copies would silently scaffold projects claiming the
10
+ * previous version. Reading the manifest removes the duplication entirely.
11
+ *
12
+ * @module cliConstant/cliVersion
13
+ */
14
+ import { existsSync, readFileSync } from "node:fs";
15
+ import { dirname, join } from "node:path";
16
+ import { fileURLToPath } from "node:url";
17
+ /** Package name to match, so a parent workspace manifest is never picked up. */
18
+ const PACKAGE_NAME = "zudojs-cli";
19
+ /** Directory levels to walk upward before giving up. */
20
+ const MAX_LOOKUP_DEPTH = 8;
21
+ /**
22
+ * Walks upward from this module looking for the CLI's own `package.json`.
23
+ *
24
+ * The compiled layout (`dist/src/cliConstant/`) sits one level deeper than the
25
+ * source layout (`src/cliConstant/`), so a fixed relative path would be correct
26
+ * in only one of them. Matching on `name` also means a parent workspace
27
+ * manifest cannot be mistaken for ours.
28
+ *
29
+ * @returns The version string declared in the CLI's `package.json`.
30
+ * @throws {Error} If the manifest cannot be located or has no string version.
31
+ */
32
+ function readOwnVersion() {
33
+ let directory = dirname(fileURLToPath(import.meta.url));
34
+ for (let depth = 0; depth < MAX_LOOKUP_DEPTH; depth += 1) {
35
+ const manifestPath = join(directory, "package.json");
36
+ if (existsSync(manifestPath)) {
37
+ const parsed = JSON.parse(readFileSync(manifestPath, "utf8"));
38
+ if (typeof parsed === "object" && parsed !== null) {
39
+ const { name, version } = parsed;
40
+ if (name === PACKAGE_NAME &&
41
+ typeof version === "string" &&
42
+ version.length > 0) {
43
+ return version;
44
+ }
45
+ }
46
+ }
47
+ const parent = dirname(directory);
48
+ if (parent === directory) {
49
+ break;
50
+ }
51
+ directory = parent;
52
+ }
53
+ throw new Error(`${PACKAGE_NAME}: could not resolve its own package.json to read the version.`);
54
+ }
55
+ /** The CLI's version, matching its `package.json`. */
56
+ export const CLI_VERSION = readOwnVersion();
57
+ //# sourceMappingURL=cliVersion.js.map
@@ -57,6 +57,13 @@ export class CLIParser {
57
57
  positional.push(token);
58
58
  index++;
59
59
  }
60
+ // Apply documented option defaults for options not provided on the CLI.
61
+ for (const definition of definitions) {
62
+ if (definition.defaultValue !== undefined &&
63
+ !(definition.name in options)) {
64
+ options[definition.name] = definition.defaultValue;
65
+ }
66
+ }
60
67
  const parsedArguments = this.parseArguments(positional, argumentsDefinitions);
61
68
  if (!this.allowUnknownCommands &&
62
69
  !command &&
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { CLI_OPTION_PREFIXES } from "../cliConstant/cliConstant.value.js";
7
7
  import { InvalidOptionError, MissingOptionValueError, } from "../cliError/cliError.option.js";
8
- import { findOption, assignOptionValue } from "./cliParser.longOption.js";
8
+ import { assignOptionValue } from "./cliParser.longOption.js";
9
9
  /** Parses a short option token from the token stream. */
10
10
  export function parseShortOption(tokens, index, definitions, values, allowUnknownOptions) {
11
11
  const token = tokens[index];
@@ -3,11 +3,12 @@
3
3
  *
4
4
  * The `zudojs add` command for adding feature packages.
5
5
  */
6
- import { join, dirname } from "node:path";
6
+ import { join } from "node:path";
7
7
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
8
- import { execCommand } from "../utils/utils.exec.js";
8
+ import { runStreaming } from "../utils/utils.exec.js";
9
9
  import { CLIValidationError, CLIGenerationError } from "../errors/index.js";
10
10
  import { ManifestManager } from "../manifest/manifestManager.core.js";
11
+ import { ZUDOJS_PACKAGES_VERSION } from "../constants/index.js";
11
12
  const FEATURE_PACKAGES = {
12
13
  database: ["@zudojs/database"],
13
14
  queue: ["@zudojs/queue"],
@@ -32,9 +33,9 @@ export async function runAddCommand(context) {
32
33
  context.logger.info(`Adding feature: ${feature}`);
33
34
  context.logger.info(`Packages: ${packages.join(", ")}`);
34
35
  try {
35
- const { manager, rootPkg, isWorkspace } = detectPackageManager();
36
+ const { manager, rootPkg, isWorkspace } = detectPackageManager(context.cwd);
36
37
  const pkgPath = join(context.cwd, rootPkg);
37
- const version = isWorkspace ? "workspace:*" : readZudojsVersion();
38
+ const version = isWorkspace ? "workspace:*" : ZUDOJS_PACKAGES_VERSION;
38
39
  if (!existsSync(pkgPath)) {
39
40
  throw new CLIGenerationError(`Could not find package.json at ${pkgPath}`);
40
41
  }
@@ -64,7 +65,7 @@ export async function runAddCommand(context) {
64
65
  }
65
66
  if (context.values["skip-install"] !== true) {
66
67
  context.logger.info(`Installing dependencies with ${manager}...`);
67
- await execCommand(manager, ["install"], context.cwd);
68
+ await runStreaming(manager, ["install"], context.cwd);
68
69
  }
69
70
  context.logger.info(`Feature "${feature}" added successfully.`);
70
71
  context.logger.info(`Next steps:`);
@@ -79,30 +80,32 @@ export async function runAddCommand(context) {
79
80
  throw new CLIGenerationError(`Failed to add feature: ${feature}: ${message}`, error);
80
81
  }
81
82
  }
82
- function detectPackageManager() {
83
- if (existsSync("pnpm-workspace.yaml")) {
84
- return { manager: "pnpm", rootPkg: "package.json", isWorkspace: true };
85
- }
86
- if (existsSync("yarn.lock")) {
87
- return { manager: "yarn", rootPkg: "package.json", isWorkspace: true };
88
- }
89
- if (existsSync("lerna.json")) {
90
- return { manager: "npm", rootPkg: "package.json", isWorkspace: true };
91
- }
92
- return { manager: "npm", rootPkg: "package.json", isWorkspace: false };
93
- }
94
- function readZudojsVersion() {
83
+ function detectPackageManager(cwd) {
84
+ // A project is a workspace only when a workspace definition exists:
85
+ // pnpm-workspace.yaml or a "workspaces" field in package.json. Lock files
86
+ // merely indicate the package manager.
87
+ const hasPnpmWorkspace = existsSync(join(cwd, "pnpm-workspace.yaml"));
88
+ let hasWorkspacesField = false;
95
89
  try {
96
- const rootPkg = join(process.cwd(), "package.json");
97
- if (existsSync(rootPkg)) {
98
- const pkg = JSON.parse(readFileSync(rootPkg, "utf-8"));
99
- return pkg.version ?? "latest";
90
+ const pkgPath = join(cwd, "package.json");
91
+ if (existsSync(pkgPath)) {
92
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
93
+ hasWorkspacesField = pkg.workspaces !== undefined;
100
94
  }
101
95
  }
102
96
  catch {
103
- // ignore
97
+ // ignore malformed package.json
104
98
  }
105
- return "latest";
99
+ const isWorkspace = hasPnpmWorkspace || hasWorkspacesField;
100
+ const manager = hasPnpmWorkspace || existsSync(join(cwd, "pnpm-lock.yaml"))
101
+ ? "pnpm"
102
+ : existsSync(join(cwd, "yarn.lock"))
103
+ ? "yarn"
104
+ : existsSync(join(cwd, "bun.lock")) ||
105
+ existsSync(join(cwd, "bun.lockb"))
106
+ ? "bun"
107
+ : "npm";
108
+ return { manager, rootPkg: "package.json", isWorkspace };
106
109
  }
107
110
  function updateZudojsConfig(cwd, feature) {
108
111
  const configPath = join(cwd, "zudojs.config.ts");
@@ -5,24 +5,28 @@
5
5
  */
6
6
  import { existsSync } from "node:fs";
7
7
  import { join } from "node:path";
8
- import { execCommand } from "../utils/utils.exec.js";
8
+ import { runStreaming } from "../utils/utils.exec.js";
9
9
  import { findProjectRoot } from "../resolvers/project.resolver.js";
10
+ import { CLIGenerationError, CLINotInProjectError } from "../errors/index.js";
10
11
  export async function runBuildCommand(context) {
11
12
  const projectRoot = findProjectRoot(context.cwd);
12
13
  if (!projectRoot) {
13
- context.logger.error("No Zudojs project found. Run this command from a Zudojs project directory.");
14
- return;
14
+ // Throwing (rather than returning) is what gives the process a non-zero
15
+ // exit code; CI must not see a green build for a missing project.
16
+ throw new CLINotInProjectError();
15
17
  }
16
18
  context.logger.info(`Building project at: ${projectRoot}`);
17
19
  const packageManager = detectPackageManager(projectRoot);
18
20
  const buildArgs = getBuildArgs(packageManager);
19
21
  try {
20
- await execCommand(packageManager, buildArgs, projectRoot);
22
+ await runStreaming(packageManager, buildArgs, projectRoot);
21
23
  context.logger.info("Build completed successfully.");
22
24
  }
23
25
  catch (error) {
24
26
  const message = error instanceof Error ? error.message : String(error);
25
27
  context.logger.error(`Build failed: ${message}`);
28
+ // A failed build must fail the command so CI does not report success.
29
+ throw new CLIGenerationError(`Build failed: ${message}`, error);
26
30
  }
27
31
  }
28
32
  function detectPackageManager(cwd) {
@@ -32,7 +36,7 @@ function detectPackageManager(cwd) {
32
36
  return "yarn";
33
37
  if (existsSync(join(cwd, "package-lock.json")))
34
38
  return "npm";
35
- if (existsSync(join(cwd, "bun.lockb")))
39
+ if (existsSync(join(cwd, "bun.lock")) || existsSync(join(cwd, "bun.lockb")))
36
40
  return "bun";
37
41
  return "npm";
38
42
  }
@@ -41,9 +45,11 @@ function getBuildArgs(packageManager) {
41
45
  case "pnpm":
42
46
  return ["-r", "run", "build"];
43
47
  case "yarn":
44
- return ["workspaces", "run", "build"];
48
+ // Plain `yarn run build` works on both Yarn classic and Berry without
49
+ // requiring the workspace-tools plugin.
50
+ return ["run", "build"];
45
51
  case "bun":
46
- return ["-r", "run", "build"];
52
+ return ["run", "build"];
47
53
  default:
48
54
  return ["run", "build"];
49
55
  }
@@ -15,17 +15,25 @@ import { InfrastructureGenerator } from "../generators/infrastructure/infrastruc
15
15
  import { BackendGenerator } from "../generators/backend/backend.generator.js";
16
16
  import { RollbackManager } from "../rollback/rollbackManager.core.js";
17
17
  import { promptProjectName, promptProjectType, promptConfirmation, } from "../prompts/project/index.js";
18
- import { promptBackendArchitecture, promptDatabase, promptApiStyle, } from "../prompts/backend/index.js";
18
+ import { promptBackendArchitecture, promptDatabase, promptApiStyle, promptServices, } from "../prompts/backend/index.js";
19
19
  import { promptFramework, promptFrontendArchitecture, } from "../prompts/frontend/index.js";
20
20
  import { promptPackageManager } from "../prompts/workspace/index.js";
21
21
  import { promptCapabilities } from "../prompts/capabilities/index.js";
22
22
  import { CLIValidationError, CLIGenerationError } from "../errors/index.js";
23
- import { execCommand } from "../utils/utils.exec.js";
23
+ import { execCommand, runStreaming } from "../utils/utils.exec.js";
24
24
  import { writeFileTree } from "../utils/utils.fileSystem.js";
25
- import { generateMonolithFiles } from "../templates/monolith/index.js";
26
- import { generateModularMonolithFiles } from "../templates/modular-monolith/index.js";
27
- import { generateMicroserviceFiles } from "../templates/microservice/index.js";
25
+ import { resolveMicroserviceServices } from "../templates/microservice/index.js";
26
+ import { ManifestManager } from "../manifest/manifestManager.core.js";
27
+ import { CLI_VERSION } from "../constants/index.js";
28
28
  const VALID_PROJECT_TYPES = ["backend", "frontend", "fullstack"];
29
+ const VALID_ARCHITECTURES = [
30
+ "monolith",
31
+ "modular-monolith",
32
+ "microservice",
33
+ ];
34
+ const VALID_DATABASES = ["postgresql", "mysql", "sqlite", "mongodb"];
35
+ const VALID_PACKAGE_MANAGERS = ["npm", "pnpm", "yarn", "bun"];
36
+ const SERVICE_NAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
29
37
  const VALID_FRONTENDS = [
30
38
  "none",
31
39
  "react",
@@ -59,8 +67,54 @@ function validateProjectName(name) {
59
67
  throw new CLIValidationError("Project name must contain only alphanumeric characters, hyphens, and underscores.");
60
68
  }
61
69
  }
70
+ /**
71
+ * Returns whether the user typed a flag on the command line.
72
+ *
73
+ * All the shapes the parser accepts must be recognised here, otherwise an
74
+ * explicitly supplied flag is silently dropped and the interactive prompt
75
+ * offers its own default instead:
76
+ *
77
+ * `--type backend` `--type=backend` `-t backend` `-tbackend` `-abt`
78
+ */
79
+ /**
80
+ * Narrows a raw CLI string to one of a fixed set of choices.
81
+ *
82
+ * The returned value is typed as the union, which is what lets the
83
+ * non-interactive branch build ScaffoldOptions without `as any` casts. The
84
+ * cast below is guarded by the membership test immediately above it.
85
+ */
86
+ function validateChoice(value, allowed, label) {
87
+ if (!allowed.includes(value)) {
88
+ throw new CLIValidationError(`Invalid ${label}: ${value}. Valid: ${allowed.join(", ")}`);
89
+ }
90
+ return value;
91
+ }
62
92
  function hasExplicitFlag(args, long, short) {
63
- return args.some((arg) => arg === long || (short !== undefined && arg === short));
93
+ const longName = long.startsWith("--") ? long.slice(2) : long;
94
+ const shortName = short !== undefined && short.startsWith("-") ? short.slice(1) : short;
95
+ for (const arg of args) {
96
+ if (arg === "--")
97
+ break;
98
+ if (arg.startsWith("--")) {
99
+ const body = arg.slice(2);
100
+ const separator = body.indexOf("=");
101
+ const name = separator >= 0 ? body.slice(0, separator) : body;
102
+ // `--no-install` negates the boolean `install`; both count as explicit.
103
+ if (name === longName || name === `no-${longName}`)
104
+ return true;
105
+ continue;
106
+ }
107
+ if (shortName === undefined)
108
+ continue;
109
+ if (arg.startsWith("-") && arg.length > 1) {
110
+ // Every short flag `create` defines takes a value, so it can only be
111
+ // the first character of the token: `-t backend` or `-tbackend`.
112
+ // Matching anywhere would treat the "t" in `-fnuxt` as `--type`.
113
+ if (arg[1] === shortName)
114
+ return true;
115
+ }
116
+ }
117
+ return false;
64
118
  }
65
119
  export async function runCreateCommand(context) {
66
120
  const projectName = context.values["project-name"];
@@ -76,34 +130,36 @@ export async function runCreateCommand(context) {
76
130
  const noInstall = context.values["no-install"] === true;
77
131
  const noGit = context.values["no-git"] === true;
78
132
  const servicesRaw = context.values.services;
79
- const services = servicesRaw
133
+ const servicesExplicit = hasExplicitFlag(context.args, "--services");
134
+ const parsedServices = servicesRaw
80
135
  ? servicesRaw
81
136
  .split(",")
82
137
  .map((s) => s.trim())
83
138
  .filter(Boolean)
84
139
  : [];
140
+ // The --services option only applies to microservice architecture; ignore
141
+ // its parser-applied default for other architectures.
142
+ const services = servicesExplicit || architecture === "microservice" ? parsedServices : [];
85
143
  if (projectName) {
86
144
  validateProjectName(projectName);
87
145
  }
88
- if (!VALID_PROJECT_TYPES.includes(projectType)) {
89
- throw new CLIValidationError(`Invalid project type: ${projectType}. Valid: ${VALID_PROJECT_TYPES.join(", ")}`);
90
- }
91
- if (!VALID_FRONTENDS.includes(frontend)) {
92
- throw new CLIValidationError(`Invalid frontend: ${frontend}. Valid: ${VALID_FRONTENDS.join(", ")}`);
93
- }
94
- if (!VALID_FRONTEND_ARCHITECTURES.includes(frontendArchitecture)) {
95
- throw new CLIValidationError(`Invalid frontend architecture: ${frontendArchitecture}. Valid: ${VALID_FRONTEND_ARCHITECTURES.join(", ")}`);
96
- }
97
- if (!VALID_LANGUAGES.includes(language)) {
98
- throw new CLIValidationError(`Invalid language: ${language}. Valid: ${VALID_LANGUAGES.join(", ")}`);
99
- }
100
- if (!VALID_APIS.includes(api)) {
101
- throw new CLIValidationError(`Invalid API style: ${api}. Valid: ${VALID_APIS.join(", ")}`);
146
+ const projectTypeValue = validateChoice(projectType, VALID_PROJECT_TYPES, "project type");
147
+ const architectureValue = validateChoice(architecture, VALID_ARCHITECTURES, "architecture");
148
+ const databaseValue = validateChoice(database, VALID_DATABASES, "database");
149
+ const packageManagerValue = validateChoice(packageManager, VALID_PACKAGE_MANAGERS, "package manager");
150
+ const frontendValue = validateChoice(frontend, VALID_FRONTENDS, "frontend");
151
+ const frontendArchitectureValue = validateChoice(frontendArchitecture, VALID_FRONTEND_ARCHITECTURES, "frontend architecture");
152
+ const languageValue = validateChoice(language, VALID_LANGUAGES, "language");
153
+ const apiValue = validateChoice(api, VALID_APIS, "API style");
154
+ for (const service of services) {
155
+ if (!SERVICE_NAME_PATTERN.test(service)) {
156
+ throw new CLIValidationError(`Invalid service name: "${service}". Service names must contain only alphanumeric characters, hyphens, and underscores.`);
157
+ }
102
158
  }
103
- const resolvedFrontend = projectType === "frontend" || projectType === "fullstack"
104
- ? frontend === "none"
159
+ const resolvedFrontend = projectTypeValue === "frontend" || projectTypeValue === "fullstack"
160
+ ? frontendValue === "none"
105
161
  ? "react"
106
- : frontend
162
+ : frontendValue
107
163
  : undefined;
108
164
  const explicitOverrides = {
109
165
  projectName,
@@ -126,7 +182,7 @@ export async function runCreateCommand(context) {
126
182
  if (hasExplicitFlag(context.args, "--frontend", "-f")) {
127
183
  explicitOverrides.frontend = resolvedFrontend;
128
184
  }
129
- if (hasExplicitFlag(context.args, "--frontend-architecture", "-fa")) {
185
+ if (hasExplicitFlag(context.args, "--frontend-architecture", "-F")) {
130
186
  explicitOverrides.frontendArchitecture = frontendArchitecture;
131
187
  }
132
188
  if (hasExplicitFlag(context.args, "--language", "-l")) {
@@ -138,9 +194,17 @@ export async function runCreateCommand(context) {
138
194
  p.intro("Zudojs");
139
195
  const name = (await promptProjectName(projectName ?? undefined));
140
196
  const type = await promptProjectType(explicitOverrides.projectType);
141
- const arch = type === "backend"
197
+ // `architecture` is a required ScaffoldOptions field and is written to
198
+ // the project manifest. For a frontend-only project no prompt runs, so
199
+ // without this default it was `undefined` and the generated manifest
200
+ // came out with no architecture at all, breaking `zudojs dev` and
201
+ // `zudojs generate` in the new project.
202
+ const arch = type === "backend" || type === "fullstack"
142
203
  ? await promptBackendArchitecture(explicitOverrides.architecture)
143
- : explicitOverrides.architecture;
204
+ : (explicitOverrides.architecture ?? architectureValue);
205
+ const interactiveServices = arch === "microservice"
206
+ ? await promptServices(servicesExplicit ? services : undefined)
207
+ : services;
144
208
  const db = type === "backend" || type === "fullstack"
145
209
  ? await promptDatabase(explicitOverrides.database)
146
210
  : explicitOverrides.database;
@@ -179,7 +243,7 @@ export async function runCreateCommand(context) {
179
243
  frontendPath: "apps/web",
180
244
  language: (explicitOverrides.language ??
181
245
  "typescript"),
182
- services: [],
246
+ services: interactiveServices,
183
247
  enableCQRS,
184
248
  enableMessaging,
185
249
  enableObservability,
@@ -194,15 +258,17 @@ export async function runCreateCommand(context) {
194
258
  else {
195
259
  answers = {
196
260
  projectName: projectName ?? "",
197
- projectType: projectType,
198
- architecture: architecture,
199
- packageManager: packageManager,
200
- database: database,
201
- api: api,
202
- frontend: resolvedFrontend,
203
- frontendArchitecture: frontendArchitecture,
261
+ projectType: projectTypeValue,
262
+ architecture: architectureValue,
263
+ packageManager: packageManagerValue,
264
+ database: databaseValue,
265
+ api: apiValue,
266
+ ...(resolvedFrontend !== undefined
267
+ ? { frontend: resolvedFrontend }
268
+ : {}),
269
+ frontendArchitecture: frontendArchitectureValue,
204
270
  frontendPath: "apps/web",
205
- language: language,
271
+ language: languageValue,
206
272
  services,
207
273
  enableCQRS: true,
208
274
  enableMessaging: true,
@@ -210,7 +276,8 @@ export async function runCreateCommand(context) {
210
276
  enableOpenAPI: true,
211
277
  enableDatabase: true,
212
278
  enableQueue: false,
213
- enableDocker: false,
279
+ // Match the interactive branch, which enables Docker for microservices.
280
+ enableDocker: architectureValue === "microservice",
214
281
  installDeps: !noInstall,
215
282
  initGit: !noGit,
216
283
  };
@@ -254,6 +321,7 @@ async function createProject(options, context) {
254
321
  context.logger.info(`Files created: ${result.filesCreated.length}`);
255
322
  spinner.stop("Backend project generated");
256
323
  }
324
+ await writeProjectManifest(options, targetPath);
257
325
  if (options.installDeps) {
258
326
  spinner.start("Installing dependencies");
259
327
  const installFile = packageManager === "pnpm"
@@ -264,11 +332,14 @@ async function createProject(options, context) {
264
332
  ? "bun"
265
333
  : "npm";
266
334
  try {
267
- await execCommand(installFile, ["install"], targetPath);
268
- spinner.stop("Dependencies installed");
335
+ // Streamed with no timeout: installs can be slow and their output
336
+ // should reach the user.
337
+ spinner.stop("Installing dependencies...");
338
+ await runStreaming(installFile, ["install"], targetPath);
339
+ p.log.success("Dependencies installed");
269
340
  }
270
341
  catch {
271
- spinner.stop("Dependencies installation skipped");
342
+ p.log.warn("Dependency installation skipped");
272
343
  }
273
344
  }
274
345
  if (options.initGit) {
@@ -298,6 +369,58 @@ async function createProject(options, context) {
298
369
  throw new CLIGenerationError(`Failed to create project "${projectName}"`, error);
299
370
  }
300
371
  }
372
+ /**
373
+ * Writes the machine-managed .zudojs/manifest.json so follow-up commands
374
+ * (`zudojs dev`, `generate`, `add`) recognize the project immediately.
375
+ */
376
+ async function writeProjectManifest(options, targetPath) {
377
+ const capabilities = [];
378
+ if (options.enableCQRS)
379
+ capabilities.push("cqrs");
380
+ if (options.enableMessaging)
381
+ capabilities.push("messaging");
382
+ if (options.enableObservability)
383
+ capabilities.push("observability");
384
+ if (options.enableOpenAPI)
385
+ capabilities.push("openapi");
386
+ if (options.enableDatabase)
387
+ capabilities.push("database");
388
+ if (options.enableQueue)
389
+ capabilities.push("queue");
390
+ // Record the services actually generated, not the raw request: the
391
+ // template drops reserved names (gateway) and duplicates, and substitutes
392
+ // its own defaults for an empty list.
393
+ const services = options.architecture === "microservice"
394
+ ? resolveMicroserviceServices(options.services)
395
+ : undefined;
396
+ const hasFrontend = options.frontend !== undefined && options.frontend !== "none";
397
+ const hasBackend = options.projectType !== "frontend";
398
+ await new ManifestManager(targetPath).create({
399
+ version: CLI_VERSION,
400
+ projectType: options.projectType ?? "backend",
401
+ architecture: options.architecture,
402
+ ...(hasBackend
403
+ ? {
404
+ backend: {
405
+ architecture: options.architecture,
406
+ api: options.api ?? "rest",
407
+ },
408
+ }
409
+ : {}),
410
+ ...(hasFrontend
411
+ ? {
412
+ frontend: {
413
+ framework: options.frontend,
414
+ architecture: options.frontendArchitecture ?? "zudojs-standard",
415
+ },
416
+ }
417
+ : {}),
418
+ ...(options.database ? { database: { provider: options.database } } : {}),
419
+ workspace: { packageManager: options.packageManager },
420
+ capabilities,
421
+ ...(services ? { services: [...services] } : {}),
422
+ });
423
+ }
301
424
  async function generateFullstackProject(options, projectPath, rollback) {
302
425
  const composer = new FullstackComposer();
303
426
  const result = await composer.generate({
@@ -326,17 +449,12 @@ async function generateFullstackProject(options, projectPath, rollback) {
326
449
  if (!result.success) {
327
450
  throw new CLIGenerationError(`Fullstack generation failed:\n${result.errors.join("\n")}`);
328
451
  }
329
- let backendFiles;
330
- switch (options.architecture) {
331
- case "modular-monolith":
332
- backendFiles = generateModularMonolithFiles(options);
333
- break;
334
- case "microservice":
335
- backendFiles = generateMicroserviceFiles(options);
336
- break;
337
- default:
338
- backendFiles = generateMonolithFiles(options);
339
- }
452
+ // Uses the same BackendGenerator the generator registry exposes rather
453
+ // than a third private copy of the architecture switch.
454
+ const backendFiles = await new BackendGenerator().generate(options, join(projectPath, "apps/api"));
455
+ // The backend template may carry its own workspace definition; nested in
456
+ // apps/api it would create a second workspace root, so strip it.
457
+ delete backendFiles["pnpm-workspace.yaml"];
340
458
  await writeFileTree(join(projectPath, "apps/api"), backendFiles);
341
459
  rollback.trackDirectory(join(projectPath, "apps/api"));
342
460
  const integrationGenerator = new IntegrationGenerator();