zudojs-cli 0.1.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (469) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -3
  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/frontendAdapter.type.d.ts +6 -0
  8. package/dist/src/adapters/frontend/react.adapter.js +26 -17
  9. package/dist/src/adapters/frontend/svelte.adapter.js +1 -0
  10. package/dist/src/adapters/frontend/sveltekit.adapter.js +7 -8
  11. package/dist/src/adapters/frontend/vanilla.adapter.js +1 -1
  12. package/dist/src/adapters/frontend/vue.adapter.js +1 -0
  13. package/dist/src/adapters/package-managers/bun.adapter.js +5 -5
  14. package/dist/src/adapters/package-managers/npm.adapter.js +5 -5
  15. package/dist/src/adapters/package-managers/pnpm.adapter.js +5 -5
  16. package/dist/src/adapters/package-managers/yarn.adapter.js +5 -5
  17. package/dist/src/bin/zudojs.js +23 -11
  18. package/dist/src/cliApplication/cliApplication.builtins.d.ts +11 -2
  19. package/dist/src/cliApplication/cliApplication.builtins.js +15 -4
  20. package/dist/src/cliApplication/cliApplication.core.js +22 -7
  21. package/dist/src/cliApplication/cliApplication.logger.d.ts +28 -0
  22. package/dist/src/cliApplication/cliApplication.logger.js +68 -0
  23. package/dist/src/cliApplication/index.d.ts +1 -3
  24. package/dist/src/cliApplication/index.js +1 -3
  25. package/dist/src/cliConstant/cliConstant.value.d.ts +1 -1
  26. package/dist/src/cliConstant/cliConstant.value.js +2 -1
  27. package/dist/src/cliConstant/cliVersion.d.ts +16 -0
  28. package/dist/src/cliConstant/cliVersion.js +57 -0
  29. package/dist/src/cliParser/cliParser.core.js +7 -0
  30. package/dist/src/cliParser/cliParser.shortOption.js +1 -1
  31. package/dist/src/cliVersion/cliVersion.update.d.ts +38 -0
  32. package/dist/src/cliVersion/cliVersion.update.js +63 -0
  33. package/dist/src/cliVersion/index.d.ts +2 -1
  34. package/dist/src/cliVersion/index.js +2 -1
  35. package/dist/src/commands/add.command.d.ts +29 -0
  36. package/dist/src/commands/add.command.js +95 -107
  37. package/dist/src/commands/build.command.d.ts +8 -0
  38. package/dist/src/commands/build.command.js +24 -24
  39. package/dist/src/commands/create.command.js +176 -55
  40. package/dist/src/commands/dev.command.d.ts +30 -2
  41. package/dist/src/commands/dev.command.js +106 -150
  42. package/dist/src/commands/doctor.command.d.ts +18 -0
  43. package/dist/src/commands/doctor.command.js +160 -110
  44. package/dist/src/commands/generate.command.d.ts +2 -1
  45. package/dist/src/commands/generate.command.js +91 -41
  46. package/dist/src/commands/info.command.js +61 -30
  47. package/dist/src/constants/index.d.ts +19 -1
  48. package/dist/src/constants/index.js +32 -1
  49. package/dist/src/generators/command/command.generator.d.ts +1 -0
  50. package/dist/src/generators/command/command.generator.js +10 -4
  51. package/dist/src/generators/controller/controller.generator.d.ts +1 -0
  52. package/dist/src/generators/controller/controller.generator.js +12 -9
  53. package/dist/src/generators/dto/dto.generator.d.ts +1 -0
  54. package/dist/src/generators/dto/dto.generator.js +9 -3
  55. package/dist/src/generators/event/event.generator.d.ts +1 -0
  56. package/dist/src/generators/event/event.generator.js +10 -4
  57. package/dist/src/generators/frontend/frontendGenerator.core.d.ts +2 -0
  58. package/dist/src/generators/frontend/frontendGenerator.core.js +14 -27
  59. package/dist/src/generators/frontend/frontendPipeline.d.ts +26 -0
  60. package/dist/src/generators/frontend/frontendPipeline.js +136 -0
  61. package/dist/src/generators/fullstack/fullstackComposer.core.d.ts +3 -2
  62. package/dist/src/generators/fullstack/fullstackComposer.core.js +58 -43
  63. package/dist/src/generators/infrastructure/infrastructure.generator.d.ts +11 -0
  64. package/dist/src/generators/infrastructure/infrastructure.generator.js +101 -61
  65. package/dist/src/generators/integration/integrationGenerator.core.d.ts +6 -0
  66. package/dist/src/generators/integration/integrationGenerator.core.js +35 -6
  67. package/dist/src/generators/job/job.generator.d.ts +1 -0
  68. package/dist/src/generators/job/job.generator.js +9 -3
  69. package/dist/src/generators/middleware/middleware.generator.d.ts +1 -0
  70. package/dist/src/generators/middleware/middleware.generator.js +10 -4
  71. package/dist/src/generators/model/model.generator.d.ts +1 -0
  72. package/dist/src/generators/model/model.generator.js +9 -3
  73. package/dist/src/generators/module/module.generator.d.ts +1 -0
  74. package/dist/src/generators/module/module.generator.js +11 -24
  75. package/dist/src/generators/project/project.generator.js +2 -23
  76. package/dist/src/generators/query/query.generator.d.ts +1 -0
  77. package/dist/src/generators/query/query.generator.js +10 -4
  78. package/dist/src/generators/repository/repository.generator.d.ts +1 -0
  79. package/dist/src/generators/repository/repository.generator.js +12 -9
  80. package/dist/src/generators/route/route.generator.d.ts +1 -0
  81. package/dist/src/generators/route/route.generator.js +11 -5
  82. package/dist/src/generators/service/service.generator.d.ts +1 -0
  83. package/dist/src/generators/service/service.generator.js +12 -9
  84. package/dist/src/generators/validator/validator.generator.d.ts +1 -0
  85. package/dist/src/generators/validator/validator.generator.js +9 -3
  86. package/dist/src/index.d.ts +3 -2
  87. package/dist/src/index.js +3 -2
  88. package/dist/src/installers/dependency.installer.d.ts +9 -0
  89. package/dist/src/installers/dependency.installer.js +27 -2
  90. package/dist/src/installers/index.d.ts +1 -3
  91. package/dist/src/installers/index.js +1 -3
  92. package/dist/src/manifest/manifestManager.core.d.ts +3 -0
  93. package/dist/src/prompts/backend/index.d.ts +1 -0
  94. package/dist/src/prompts/backend/index.js +1 -0
  95. package/dist/src/prompts/backend/services.prompt.d.ts +7 -0
  96. package/dist/src/prompts/backend/services.prompt.js +39 -0
  97. package/dist/src/prompts/index.d.ts +0 -1
  98. package/dist/src/prompts/index.js +0 -1
  99. package/dist/src/resolvers/architecture.resolver.d.ts +11 -1
  100. package/dist/src/resolvers/architecture.resolver.js +12 -13
  101. package/dist/src/resolvers/configuration/configurationResolver.core.d.ts +10 -1
  102. package/dist/src/resolvers/configuration/configurationResolver.core.js +68 -29
  103. package/dist/src/resolvers/index.d.ts +1 -0
  104. package/dist/src/resolvers/index.js +1 -0
  105. package/dist/src/resolvers/layout/index.d.ts +5 -0
  106. package/dist/src/resolvers/layout/index.js +5 -0
  107. package/dist/src/resolvers/layout/projectLayout.core.d.ts +60 -0
  108. package/dist/src/resolvers/layout/projectLayout.core.js +236 -0
  109. package/dist/src/resolvers/project.resolver.d.ts +5 -0
  110. package/dist/src/resolvers/project.resolver.js +10 -6
  111. package/dist/src/rollback/rollbackManager.core.js +0 -1
  112. package/dist/src/runners/process/processRunner.core.d.ts +4 -0
  113. package/dist/src/runners/process/processRunner.core.js +17 -3
  114. package/dist/src/scaffolders/framework.scaffolder.js +9 -6
  115. package/dist/src/scaffolders/scaffolder.helper.js +7 -2
  116. package/dist/src/templates/microservice/index.d.ts +1 -1
  117. package/dist/src/templates/microservice/index.js +1 -1
  118. package/dist/src/templates/microservice/microservice.template.d.ts +14 -0
  119. package/dist/src/templates/microservice/microservice.template.js +140 -162
  120. package/dist/src/templates/modular-monolith/modularMonolith.template.d.ts +0 -1
  121. package/dist/src/templates/modular-monolith/modularMonolith.template.js +43 -77
  122. package/dist/src/templates/monolith/monolith.template.d.ts +1 -1
  123. package/dist/src/templates/monolith/monolith.template.js +46 -69
  124. package/dist/src/templates/shared/appRuntime.template.d.ts +60 -0
  125. package/dist/src/templates/shared/appRuntime.template.js +189 -0
  126. package/dist/src/templates/shared/index.d.ts +6 -0
  127. package/dist/src/templates/shared/index.js +6 -0
  128. package/dist/src/templates/shared/pnpm.template.d.ts +27 -0
  129. package/dist/src/templates/shared/pnpm.template.js +57 -0
  130. package/dist/src/utils/index.d.ts +3 -3
  131. package/dist/src/utils/index.js +3 -3
  132. package/dist/src/utils/utils.detect.d.ts +9 -0
  133. package/dist/src/utils/utils.detect.js +11 -11
  134. package/dist/src/utils/utils.exec.d.ts +35 -1
  135. package/dist/src/utils/utils.exec.js +99 -4
  136. package/dist/src/utils/utils.fileSystem.d.ts +6 -0
  137. package/dist/src/utils/utils.fileSystem.js +19 -0
  138. package/dist/src/utils/utils.name.d.ts +26 -0
  139. package/dist/src/utils/utils.name.js +51 -1
  140. package/package.json +32 -23
  141. package/dist/.tsbuildinfo +0 -1
  142. package/dist/src/adapters/databases/index.d.ts.map +0 -1
  143. package/dist/src/adapters/databases/index.js.map +0 -1
  144. package/dist/src/adapters/databases/mysql.adapter.d.ts.map +0 -1
  145. package/dist/src/adapters/databases/mysql.adapter.js.map +0 -1
  146. package/dist/src/adapters/databases/postgres.adapter.d.ts.map +0 -1
  147. package/dist/src/adapters/databases/postgres.adapter.js.map +0 -1
  148. package/dist/src/adapters/databases/sqlite.adapter.d.ts.map +0 -1
  149. package/dist/src/adapters/databases/sqlite.adapter.js.map +0 -1
  150. package/dist/src/adapters/frontend/angular.adapter.d.ts.map +0 -1
  151. package/dist/src/adapters/frontend/angular.adapter.js.map +0 -1
  152. package/dist/src/adapters/frontend/astro.adapter.d.ts.map +0 -1
  153. package/dist/src/adapters/frontend/astro.adapter.js.map +0 -1
  154. package/dist/src/adapters/frontend/flutter.adapter.d.ts.map +0 -1
  155. package/dist/src/adapters/frontend/flutter.adapter.js.map +0 -1
  156. package/dist/src/adapters/frontend/frontendAdapter.type.d.ts.map +0 -1
  157. package/dist/src/adapters/frontend/frontendAdapter.type.js.map +0 -1
  158. package/dist/src/adapters/frontend/index.d.ts.map +0 -1
  159. package/dist/src/adapters/frontend/index.js.map +0 -1
  160. package/dist/src/adapters/frontend/next.adapter.d.ts.map +0 -1
  161. package/dist/src/adapters/frontend/next.adapter.js.map +0 -1
  162. package/dist/src/adapters/frontend/nuxt.adapter.d.ts.map +0 -1
  163. package/dist/src/adapters/frontend/nuxt.adapter.js.map +0 -1
  164. package/dist/src/adapters/frontend/react-native.adapter.d.ts.map +0 -1
  165. package/dist/src/adapters/frontend/react-native.adapter.js.map +0 -1
  166. package/dist/src/adapters/frontend/react.adapter.d.ts.map +0 -1
  167. package/dist/src/adapters/frontend/react.adapter.js.map +0 -1
  168. package/dist/src/adapters/frontend/svelte.adapter.d.ts.map +0 -1
  169. package/dist/src/adapters/frontend/svelte.adapter.js.map +0 -1
  170. package/dist/src/adapters/frontend/sveltekit.adapter.d.ts.map +0 -1
  171. package/dist/src/adapters/frontend/sveltekit.adapter.js.map +0 -1
  172. package/dist/src/adapters/frontend/vanilla.adapter.d.ts.map +0 -1
  173. package/dist/src/adapters/frontend/vanilla.adapter.js.map +0 -1
  174. package/dist/src/adapters/frontend/vue.adapter.d.ts.map +0 -1
  175. package/dist/src/adapters/frontend/vue.adapter.js.map +0 -1
  176. package/dist/src/adapters/package-managers/bun.adapter.d.ts.map +0 -1
  177. package/dist/src/adapters/package-managers/bun.adapter.js.map +0 -1
  178. package/dist/src/adapters/package-managers/index.d.ts.map +0 -1
  179. package/dist/src/adapters/package-managers/index.js.map +0 -1
  180. package/dist/src/adapters/package-managers/npm.adapter.d.ts.map +0 -1
  181. package/dist/src/adapters/package-managers/npm.adapter.js.map +0 -1
  182. package/dist/src/adapters/package-managers/packageManager.type.d.ts.map +0 -1
  183. package/dist/src/adapters/package-managers/packageManager.type.js.map +0 -1
  184. package/dist/src/adapters/package-managers/pnpm.adapter.d.ts.map +0 -1
  185. package/dist/src/adapters/package-managers/pnpm.adapter.js.map +0 -1
  186. package/dist/src/adapters/package-managers/yarn.adapter.d.ts.map +0 -1
  187. package/dist/src/adapters/package-managers/yarn.adapter.js.map +0 -1
  188. package/dist/src/bin/zudojs.d.ts.map +0 -1
  189. package/dist/src/bin/zudojs.js.map +0 -1
  190. package/dist/src/cliApplication/cliApplication.builtins.d.ts.map +0 -1
  191. package/dist/src/cliApplication/cliApplication.builtins.js.map +0 -1
  192. package/dist/src/cliApplication/cliApplication.core.d.ts.map +0 -1
  193. package/dist/src/cliApplication/cliApplication.core.js.map +0 -1
  194. package/dist/src/cliApplication/cliApplication.writer.d.ts.map +0 -1
  195. package/dist/src/cliApplication/cliApplication.writer.js.map +0 -1
  196. package/dist/src/cliApplication/index.d.ts.map +0 -1
  197. package/dist/src/cliApplication/index.js.map +0 -1
  198. package/dist/src/cliCommand/cliCommand.builder.d.ts.map +0 -1
  199. package/dist/src/cliCommand/cliCommand.builder.js.map +0 -1
  200. package/dist/src/cliCommand/cliCommand.factory.d.ts.map +0 -1
  201. package/dist/src/cliCommand/cliCommand.factory.js.map +0 -1
  202. package/dist/src/cliCommand/cliCommand.registry.d.ts.map +0 -1
  203. package/dist/src/cliCommand/cliCommand.registry.js.map +0 -1
  204. package/dist/src/cliCommand/cliCommand.validator.d.ts.map +0 -1
  205. package/dist/src/cliCommand/cliCommand.validator.js.map +0 -1
  206. package/dist/src/cliCommand/index.d.ts.map +0 -1
  207. package/dist/src/cliCommand/index.js.map +0 -1
  208. package/dist/src/cliConstant/cliConstant.value.d.ts.map +0 -1
  209. package/dist/src/cliConstant/cliConstant.value.js.map +0 -1
  210. package/dist/src/cliConstant/index.d.ts.map +0 -1
  211. package/dist/src/cliConstant/index.js.map +0 -1
  212. package/dist/src/cliError/cliError.argument.d.ts.map +0 -1
  213. package/dist/src/cliError/cliError.argument.js.map +0 -1
  214. package/dist/src/cliError/cliError.base.d.ts.map +0 -1
  215. package/dist/src/cliError/cliError.base.js.map +0 -1
  216. package/dist/src/cliError/cliError.command.d.ts.map +0 -1
  217. package/dist/src/cliError/cliError.command.js.map +0 -1
  218. package/dist/src/cliError/cliError.execution.d.ts.map +0 -1
  219. package/dist/src/cliError/cliError.execution.js.map +0 -1
  220. package/dist/src/cliError/cliError.option.d.ts.map +0 -1
  221. package/dist/src/cliError/cliError.option.js.map +0 -1
  222. package/dist/src/cliError/index.d.ts.map +0 -1
  223. package/dist/src/cliError/index.js.map +0 -1
  224. package/dist/src/cliParser/cliParser.core.d.ts.map +0 -1
  225. package/dist/src/cliParser/cliParser.core.js.map +0 -1
  226. package/dist/src/cliParser/cliParser.helper.d.ts.map +0 -1
  227. package/dist/src/cliParser/cliParser.helper.js.map +0 -1
  228. package/dist/src/cliParser/cliParser.longOption.d.ts.map +0 -1
  229. package/dist/src/cliParser/cliParser.longOption.js.map +0 -1
  230. package/dist/src/cliParser/cliParser.shortOption.d.ts.map +0 -1
  231. package/dist/src/cliParser/cliParser.shortOption.js.map +0 -1
  232. package/dist/src/cliParser/index.d.ts.map +0 -1
  233. package/dist/src/cliParser/index.js.map +0 -1
  234. package/dist/src/cliType/cliType.type.d.ts.map +0 -1
  235. package/dist/src/cliType/cliType.type.js.map +0 -1
  236. package/dist/src/cliType/index.d.ts.map +0 -1
  237. package/dist/src/cliType/index.js.map +0 -1
  238. package/dist/src/cliVersion/cliVersion.core.d.ts.map +0 -1
  239. package/dist/src/cliVersion/cliVersion.core.js.map +0 -1
  240. package/dist/src/cliVersion/index.d.ts.map +0 -1
  241. package/dist/src/cliVersion/index.js.map +0 -1
  242. package/dist/src/commands/add.command.d.ts.map +0 -1
  243. package/dist/src/commands/add.command.js.map +0 -1
  244. package/dist/src/commands/build.command.d.ts.map +0 -1
  245. package/dist/src/commands/build.command.js.map +0 -1
  246. package/dist/src/commands/create.command.d.ts.map +0 -1
  247. package/dist/src/commands/create.command.js.map +0 -1
  248. package/dist/src/commands/dev.command.d.ts.map +0 -1
  249. package/dist/src/commands/dev.command.js.map +0 -1
  250. package/dist/src/commands/doctor.command.d.ts.map +0 -1
  251. package/dist/src/commands/doctor.command.js.map +0 -1
  252. package/dist/src/commands/generate.command.d.ts.map +0 -1
  253. package/dist/src/commands/generate.command.js.map +0 -1
  254. package/dist/src/commands/index.d.ts.map +0 -1
  255. package/dist/src/commands/index.js.map +0 -1
  256. package/dist/src/commands/info.command.d.ts.map +0 -1
  257. package/dist/src/commands/info.command.js.map +0 -1
  258. package/dist/src/constants/index.d.ts.map +0 -1
  259. package/dist/src/constants/index.js.map +0 -1
  260. package/dist/src/errors/index.d.ts.map +0 -1
  261. package/dist/src/errors/index.js.map +0 -1
  262. package/dist/src/generators/backend/backend.generator.d.ts.map +0 -1
  263. package/dist/src/generators/backend/backend.generator.js.map +0 -1
  264. package/dist/src/generators/backend/index.d.ts.map +0 -1
  265. package/dist/src/generators/backend/index.js.map +0 -1
  266. package/dist/src/generators/command/command.generator.d.ts.map +0 -1
  267. package/dist/src/generators/command/command.generator.js.map +0 -1
  268. package/dist/src/generators/controller/controller.generator.d.ts.map +0 -1
  269. package/dist/src/generators/controller/controller.generator.js.map +0 -1
  270. package/dist/src/generators/dto/dto.generator.d.ts.map +0 -1
  271. package/dist/src/generators/dto/dto.generator.js.map +0 -1
  272. package/dist/src/generators/dto/index.d.ts.map +0 -1
  273. package/dist/src/generators/dto/index.js.map +0 -1
  274. package/dist/src/generators/event/event.generator.d.ts.map +0 -1
  275. package/dist/src/generators/event/event.generator.js.map +0 -1
  276. package/dist/src/generators/event/index.d.ts.map +0 -1
  277. package/dist/src/generators/event/index.js.map +0 -1
  278. package/dist/src/generators/frontend/frontendGenerator.core.d.ts.map +0 -1
  279. package/dist/src/generators/frontend/frontendGenerator.core.js.map +0 -1
  280. package/dist/src/generators/frontend/index.d.ts.map +0 -1
  281. package/dist/src/generators/frontend/index.js.map +0 -1
  282. package/dist/src/generators/fullstack/fullstackComposer.core.d.ts.map +0 -1
  283. package/dist/src/generators/fullstack/fullstackComposer.core.js.map +0 -1
  284. package/dist/src/generators/fullstack/index.d.ts.map +0 -1
  285. package/dist/src/generators/fullstack/index.js.map +0 -1
  286. package/dist/src/generators/index.d.ts.map +0 -1
  287. package/dist/src/generators/index.js.map +0 -1
  288. package/dist/src/generators/infrastructure/index.d.ts.map +0 -1
  289. package/dist/src/generators/infrastructure/index.js.map +0 -1
  290. package/dist/src/generators/infrastructure/infrastructure.generator.d.ts.map +0 -1
  291. package/dist/src/generators/infrastructure/infrastructure.generator.js.map +0 -1
  292. package/dist/src/generators/integration/index.d.ts.map +0 -1
  293. package/dist/src/generators/integration/index.js.map +0 -1
  294. package/dist/src/generators/integration/integrationGenerator.core.d.ts.map +0 -1
  295. package/dist/src/generators/integration/integrationGenerator.core.js.map +0 -1
  296. package/dist/src/generators/job/index.d.ts.map +0 -1
  297. package/dist/src/generators/job/index.js.map +0 -1
  298. package/dist/src/generators/job/job.generator.d.ts.map +0 -1
  299. package/dist/src/generators/job/job.generator.js.map +0 -1
  300. package/dist/src/generators/middleware/index.d.ts.map +0 -1
  301. package/dist/src/generators/middleware/index.js.map +0 -1
  302. package/dist/src/generators/middleware/middleware.generator.d.ts.map +0 -1
  303. package/dist/src/generators/middleware/middleware.generator.js.map +0 -1
  304. package/dist/src/generators/model/index.d.ts.map +0 -1
  305. package/dist/src/generators/model/index.js.map +0 -1
  306. package/dist/src/generators/model/model.generator.d.ts.map +0 -1
  307. package/dist/src/generators/model/model.generator.js.map +0 -1
  308. package/dist/src/generators/module/module.generator.d.ts.map +0 -1
  309. package/dist/src/generators/module/module.generator.js.map +0 -1
  310. package/dist/src/generators/project/project.generator.d.ts.map +0 -1
  311. package/dist/src/generators/project/project.generator.js.map +0 -1
  312. package/dist/src/generators/query/query.generator.d.ts.map +0 -1
  313. package/dist/src/generators/query/query.generator.js.map +0 -1
  314. package/dist/src/generators/repository/repository.generator.d.ts.map +0 -1
  315. package/dist/src/generators/repository/repository.generator.js.map +0 -1
  316. package/dist/src/generators/route/index.d.ts.map +0 -1
  317. package/dist/src/generators/route/index.js.map +0 -1
  318. package/dist/src/generators/route/route.generator.d.ts.map +0 -1
  319. package/dist/src/generators/route/route.generator.js.map +0 -1
  320. package/dist/src/generators/service/service.generator.d.ts.map +0 -1
  321. package/dist/src/generators/service/service.generator.js.map +0 -1
  322. package/dist/src/generators/validator/index.d.ts.map +0 -1
  323. package/dist/src/generators/validator/index.js.map +0 -1
  324. package/dist/src/generators/validator/validator.generator.d.ts.map +0 -1
  325. package/dist/src/generators/validator/validator.generator.js.map +0 -1
  326. package/dist/src/index.d.ts.map +0 -1
  327. package/dist/src/index.js.map +0 -1
  328. package/dist/src/installers/dependency.installer.d.ts.map +0 -1
  329. package/dist/src/installers/dependency.installer.js.map +0 -1
  330. package/dist/src/installers/index.d.ts.map +0 -1
  331. package/dist/src/installers/index.js.map +0 -1
  332. package/dist/src/manifest/index.d.ts.map +0 -1
  333. package/dist/src/manifest/index.js.map +0 -1
  334. package/dist/src/manifest/manifestManager.core.d.ts.map +0 -1
  335. package/dist/src/manifest/manifestManager.core.js.map +0 -1
  336. package/dist/src/prompts/backend/api-style.prompt.d.ts.map +0 -1
  337. package/dist/src/prompts/backend/api-style.prompt.js.map +0 -1
  338. package/dist/src/prompts/backend/backend-architecture.prompt.d.ts.map +0 -1
  339. package/dist/src/prompts/backend/backend-architecture.prompt.js.map +0 -1
  340. package/dist/src/prompts/backend/database.prompt.d.ts.map +0 -1
  341. package/dist/src/prompts/backend/database.prompt.js.map +0 -1
  342. package/dist/src/prompts/backend/index.d.ts.map +0 -1
  343. package/dist/src/prompts/backend/index.js.map +0 -1
  344. package/dist/src/prompts/capabilities/capabilities.prompt.d.ts.map +0 -1
  345. package/dist/src/prompts/capabilities/capabilities.prompt.js.map +0 -1
  346. package/dist/src/prompts/capabilities/index.d.ts.map +0 -1
  347. package/dist/src/prompts/capabilities/index.js.map +0 -1
  348. package/dist/src/prompts/frontend/framework.prompt.d.ts.map +0 -1
  349. package/dist/src/prompts/frontend/framework.prompt.js.map +0 -1
  350. package/dist/src/prompts/frontend/frontend-architecture.prompt.d.ts.map +0 -1
  351. package/dist/src/prompts/frontend/frontend-architecture.prompt.js.map +0 -1
  352. package/dist/src/prompts/frontend/index.d.ts.map +0 -1
  353. package/dist/src/prompts/frontend/index.js.map +0 -1
  354. package/dist/src/prompts/index.d.ts.map +0 -1
  355. package/dist/src/prompts/index.js.map +0 -1
  356. package/dist/src/prompts/project/confirmation.prompt.d.ts.map +0 -1
  357. package/dist/src/prompts/project/confirmation.prompt.js.map +0 -1
  358. package/dist/src/prompts/project/index.d.ts.map +0 -1
  359. package/dist/src/prompts/project/index.js.map +0 -1
  360. package/dist/src/prompts/project/project-name.prompt.d.ts.map +0 -1
  361. package/dist/src/prompts/project/project-name.prompt.js.map +0 -1
  362. package/dist/src/prompts/project/project-type.prompt.d.ts.map +0 -1
  363. package/dist/src/prompts/project/project-type.prompt.js.map +0 -1
  364. package/dist/src/prompts/prompts.createProject.d.ts +0 -33
  365. package/dist/src/prompts/prompts.createProject.d.ts.map +0 -1
  366. package/dist/src/prompts/prompts.createProject.js +0 -150
  367. package/dist/src/prompts/prompts.createProject.js.map +0 -1
  368. package/dist/src/prompts/workspace/index.d.ts.map +0 -1
  369. package/dist/src/prompts/workspace/index.js.map +0 -1
  370. package/dist/src/prompts/workspace/package-manager.prompt.d.ts.map +0 -1
  371. package/dist/src/prompts/workspace/package-manager.prompt.js.map +0 -1
  372. package/dist/src/registries/adapter/frontendAdapterRegistry.core.d.ts.map +0 -1
  373. package/dist/src/registries/adapter/frontendAdapterRegistry.core.js.map +0 -1
  374. package/dist/src/registries/adapter/packageManagerRegistry.core.d.ts.map +0 -1
  375. package/dist/src/registries/adapter/packageManagerRegistry.core.js.map +0 -1
  376. package/dist/src/registries/dependency/dependencyRegistry.core.d.ts.map +0 -1
  377. package/dist/src/registries/dependency/dependencyRegistry.core.js.map +0 -1
  378. package/dist/src/registries/dependency/index.d.ts.map +0 -1
  379. package/dist/src/registries/dependency/index.js.map +0 -1
  380. package/dist/src/registries/generator/generatorRegistry.core.d.ts.map +0 -1
  381. package/dist/src/registries/generator/generatorRegistry.core.js.map +0 -1
  382. package/dist/src/registries/generator/index.d.ts.map +0 -1
  383. package/dist/src/registries/generator/index.js.map +0 -1
  384. package/dist/src/registries/index.d.ts.map +0 -1
  385. package/dist/src/registries/index.js.map +0 -1
  386. package/dist/src/resolvers/architecture.resolver.d.ts.map +0 -1
  387. package/dist/src/resolvers/architecture.resolver.js.map +0 -1
  388. package/dist/src/resolvers/capability/capabilityResolver.core.d.ts.map +0 -1
  389. package/dist/src/resolvers/capability/capabilityResolver.core.js.map +0 -1
  390. package/dist/src/resolvers/capability/index.d.ts.map +0 -1
  391. package/dist/src/resolvers/capability/index.js.map +0 -1
  392. package/dist/src/resolvers/configuration/configurationResolver.core.d.ts.map +0 -1
  393. package/dist/src/resolvers/configuration/configurationResolver.core.js.map +0 -1
  394. package/dist/src/resolvers/configuration/index.d.ts.map +0 -1
  395. package/dist/src/resolvers/configuration/index.js.map +0 -1
  396. package/dist/src/resolvers/dependency/dependencyResolver.core.d.ts.map +0 -1
  397. package/dist/src/resolvers/dependency/dependencyResolver.core.js.map +0 -1
  398. package/dist/src/resolvers/dependency/index.d.ts.map +0 -1
  399. package/dist/src/resolvers/dependency/index.js.map +0 -1
  400. package/dist/src/resolvers/index.d.ts.map +0 -1
  401. package/dist/src/resolvers/index.js.map +0 -1
  402. package/dist/src/resolvers/project.resolver.d.ts.map +0 -1
  403. package/dist/src/resolvers/project.resolver.js.map +0 -1
  404. package/dist/src/rollback/index.d.ts.map +0 -1
  405. package/dist/src/rollback/index.js.map +0 -1
  406. package/dist/src/rollback/rollbackManager.core.d.ts.map +0 -1
  407. package/dist/src/rollback/rollbackManager.core.js.map +0 -1
  408. package/dist/src/runners/package-manager/index.d.ts.map +0 -1
  409. package/dist/src/runners/package-manager/index.js.map +0 -1
  410. package/dist/src/runners/package-manager/packageManagerRunner.core.d.ts.map +0 -1
  411. package/dist/src/runners/package-manager/packageManagerRunner.core.js.map +0 -1
  412. package/dist/src/runners/process/index.d.ts.map +0 -1
  413. package/dist/src/runners/process/index.js.map +0 -1
  414. package/dist/src/runners/process/processRunner.core.d.ts.map +0 -1
  415. package/dist/src/runners/process/processRunner.core.js.map +0 -1
  416. package/dist/src/runners/task/index.d.ts.map +0 -1
  417. package/dist/src/runners/task/index.js.map +0 -1
  418. package/dist/src/runners/task/taskRunner.core.d.ts.map +0 -1
  419. package/dist/src/runners/task/taskRunner.core.js.map +0 -1
  420. package/dist/src/scaffolders/framework.scaffolder.d.ts.map +0 -1
  421. package/dist/src/scaffolders/framework.scaffolder.js.map +0 -1
  422. package/dist/src/scaffolders/index.d.ts.map +0 -1
  423. package/dist/src/scaffolders/index.js.map +0 -1
  424. package/dist/src/scaffolders/scaffolder.helper.d.ts.map +0 -1
  425. package/dist/src/scaffolders/scaffolder.helper.js.map +0 -1
  426. package/dist/src/scripts/postinstall.cjs +0 -56
  427. package/dist/src/templates/microservice/index.d.ts.map +0 -1
  428. package/dist/src/templates/microservice/index.js.map +0 -1
  429. package/dist/src/templates/microservice/microservice.template.d.ts.map +0 -1
  430. package/dist/src/templates/microservice/microservice.template.js.map +0 -1
  431. package/dist/src/templates/modular-monolith/index.d.ts.map +0 -1
  432. package/dist/src/templates/modular-monolith/index.js.map +0 -1
  433. package/dist/src/templates/modular-monolith/modularMonolith.template.d.ts.map +0 -1
  434. package/dist/src/templates/modular-monolith/modularMonolith.template.js.map +0 -1
  435. package/dist/src/templates/monolith/index.d.ts.map +0 -1
  436. package/dist/src/templates/monolith/index.js.map +0 -1
  437. package/dist/src/templates/monolith/monolith.template.d.ts.map +0 -1
  438. package/dist/src/templates/monolith/monolith.template.js.map +0 -1
  439. package/dist/src/types/index.d.ts.map +0 -1
  440. package/dist/src/types/index.js.map +0 -1
  441. package/dist/src/types/projectConfiguration.type.d.ts.map +0 -1
  442. package/dist/src/types/projectConfiguration.type.js.map +0 -1
  443. package/dist/src/types/scaffold.type.d.ts.map +0 -1
  444. package/dist/src/types/scaffold.type.js.map +0 -1
  445. package/dist/src/utils/index.d.ts.map +0 -1
  446. package/dist/src/utils/index.js.map +0 -1
  447. package/dist/src/utils/utils.detect.d.ts.map +0 -1
  448. package/dist/src/utils/utils.detect.js.map +0 -1
  449. package/dist/src/utils/utils.exec.d.ts.map +0 -1
  450. package/dist/src/utils/utils.exec.js.map +0 -1
  451. package/dist/src/utils/utils.fileSystem.d.ts.map +0 -1
  452. package/dist/src/utils/utils.fileSystem.js.map +0 -1
  453. package/dist/src/utils/utils.name.d.ts.map +0 -1
  454. package/dist/src/utils/utils.name.js.map +0 -1
  455. package/dist/src/validators/compatibility/compatibilityValidator.core.d.ts.map +0 -1
  456. package/dist/src/validators/compatibility/compatibilityValidator.core.js.map +0 -1
  457. package/dist/src/validators/compatibility/index.d.ts.map +0 -1
  458. package/dist/src/validators/compatibility/index.js.map +0 -1
  459. package/dist/src/validators/environment/environmentValidator.core.d.ts.map +0 -1
  460. package/dist/src/validators/environment/environmentValidator.core.js.map +0 -1
  461. package/dist/src/validators/environment/index.d.ts.map +0 -1
  462. package/dist/src/validators/environment/index.js.map +0 -1
  463. package/dist/src/validators/index.d.ts.map +0 -1
  464. package/dist/src/validators/index.js.map +0 -1
  465. package/dist/src/validators/project/index.d.ts.map +0 -1
  466. package/dist/src/validators/project/index.js.map +0 -1
  467. package/dist/src/validators/project/projectValidator.core.d.ts.map +0 -1
  468. package/dist/src/validators/project/projectValidator.core.js.map +0 -1
  469. package/src/scripts/postinstall.cjs +0 -56
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * @module generators/integration
5
5
  */
6
+ import { existsSync } from "node:fs";
7
+ import { join } from "node:path";
6
8
  import { writeFileTree } from "../../utils/utils.fileSystem.js";
7
9
  /**
8
10
  * Generates integration files between frontend and backend.
@@ -21,12 +23,22 @@ export class IntegrationGenerator {
21
23
  const apiPath = this.getApiClientPath(context);
22
24
  files[apiPath] = apiClient;
23
25
  }
24
- // CORS configuration for backend
25
- files["config/cors.ts"] = this.generateCorsConfig(context);
26
- // Development proxy configuration
26
+ // CORS configuration, written next to the backend it configures. In a
27
+ // fullstack workspace the backend lives in apps/api; writing it at the
28
+ // workspace root left it where nothing could import it.
29
+ files[`${this.getBackendPath(context)}config/cors.ts`] =
30
+ this.generateCorsConfig(context);
31
+ // Development proxy configuration (belongs to the frontend app). The
32
+ // frontend adapter has already written a vite.config.ts carrying the
33
+ // framework plugin and path aliases; overwriting it with this minimal
34
+ // proxy-only config silently destroyed that work, so only create the
35
+ // file when the adapter did not.
27
36
  if (context.project.frontend?.framework === "react" ||
28
37
  context.project.frontend?.framework === "vue") {
29
- files["vite.config.ts"] = this.generateViteProxy(context);
38
+ const viteConfigPath = "apps/web/vite.config.ts";
39
+ if (!existsSync(join(context.projectPath, viteConfigPath))) {
40
+ files[viteConfigPath] = this.generateViteProxy(context);
41
+ }
30
42
  }
31
43
  await writeFileTree(context.projectPath, files);
32
44
  }
@@ -38,6 +50,10 @@ export class IntegrationGenerator {
38
50
  `API_URL=http://localhost:${backendPort}`,
39
51
  "",
40
52
  "# Frontend",
53
+ // The frontend dev-server port was accepted, defaulted and then never
54
+ // written anywhere, so nothing downstream could agree with the CORS
55
+ // origins generated from the same value.
56
+ `FRONTEND_PORT=${frontendPort}`,
41
57
  `VITE_API_URL=http://localhost:${backendPort}`,
42
58
  "",
43
59
  "# Database",
@@ -51,6 +67,14 @@ export class IntegrationGenerator {
51
67
  }
52
68
  return lines.join("\n");
53
69
  }
70
+ /**
71
+ * Path prefix (relative to projectPath) of the backend application.
72
+ *
73
+ * Ends with a "/" when non-empty so it can be prefixed directly.
74
+ */
75
+ getBackendPath(context) {
76
+ return context.project.type === "fullstack" ? "apps/api/" : "";
77
+ }
54
78
  generateApiClient(context) {
55
79
  const backendPort = context.backendPort ?? 3000;
56
80
  const isNext = context.project.frontend?.framework === "next";
@@ -153,11 +177,16 @@ export const corsConfig = {
153
177
  }
154
178
  generateViteProxy(context) {
155
179
  const backendPort = context.backendPort ?? 3000;
180
+ const isVue = context.project.frontend?.framework === "vue";
181
+ const pluginImport = isVue
182
+ ? `import vue from "@vitejs/plugin-vue";`
183
+ : `import react from "@vitejs/plugin-react";`;
184
+ const pluginCall = isVue ? "vue()" : "react()";
156
185
  return `import { defineConfig } from "vite";
157
- import react from "@vitejs/plugin-react";
186
+ ${pluginImport}
158
187
 
159
188
  export default defineConfig({
160
- plugins: [react()],
189
+ plugins: [${pluginCall}],
161
190
  server: {
162
191
  proxy: {
163
192
  "/api": {
@@ -6,6 +6,7 @@
6
6
  export interface GenerateJobOptions {
7
7
  readonly name: string;
8
8
  readonly basePath: string;
9
+ readonly dryRun?: boolean;
9
10
  }
10
11
  export declare function generateJob(options: GenerateJobOptions, cwd: string): Promise<string[]>;
11
12
  //# sourceMappingURL=job.generator.d.ts.map
@@ -4,17 +4,23 @@
4
4
  * Generates job files.
5
5
  */
6
6
  import { writeFileTree } from "../../utils/utils.fileSystem.js";
7
+ import { normalizeName, toCamelCase } from "../../utils/utils.name.js";
7
8
  export async function generateJob(options, cwd) {
9
+ const name = normalizeName(options.name);
10
+ const nameCamel = toCamelCase(options.name);
8
11
  const files = {
9
- [`${options.basePath}/jobs/${options.name}.job.ts`]: `/**
10
- * ${options.name} job.
12
+ [`${options.basePath}/jobs/${name}.job.ts`]: `/**
13
+ * ${name} job.
11
14
  */
12
15
 
13
- export async function ${options.name}Job() {
16
+ export async function ${nameCamel}Job() {
14
17
  // Job implementation
15
18
  }
16
19
  `,
17
20
  };
21
+ if (options.dryRun) {
22
+ return Object.keys(files);
23
+ }
18
24
  await writeFileTree(cwd, files);
19
25
  return Object.keys(files);
20
26
  }
@@ -6,6 +6,7 @@
6
6
  export interface GenerateMiddlewareOptions {
7
7
  readonly name: string;
8
8
  readonly basePath: string;
9
+ readonly dryRun?: boolean;
9
10
  }
10
11
  export declare function generateMiddleware(options: GenerateMiddlewareOptions, cwd: string): Promise<string[]>;
11
12
  //# sourceMappingURL=middleware.generator.d.ts.map
@@ -4,19 +4,25 @@
4
4
  * Generates middleware files.
5
5
  */
6
6
  import { writeFileTree } from "../../utils/utils.fileSystem.js";
7
+ import { normalizeName, toCamelCase } from "../../utils/utils.name.js";
7
8
  export async function generateMiddleware(options, cwd) {
9
+ const name = normalizeName(options.name);
10
+ const nameCamel = toCamelCase(options.name);
8
11
  const files = {
9
- [`${options.basePath}/middlewares/${options.name}.middleware.ts`]: `/**
10
- * ${options.name} middleware.
12
+ [`${options.basePath}/middlewares/${name}.middleware.ts`]: `/**
13
+ * ${name} middleware.
11
14
  */
12
15
 
13
- export function ${options.name}Middleware() {
14
- return async (ctx: any, next: () => Promise<void>) => {
16
+ export function ${nameCamel}Middleware() {
17
+ return async (ctx: unknown, next: () => Promise<void>) => {
15
18
  await next();
16
19
  };
17
20
  }
18
21
  `,
19
22
  };
23
+ if (options.dryRun) {
24
+ return Object.keys(files);
25
+ }
20
26
  await writeFileTree(cwd, files);
21
27
  return Object.keys(files);
22
28
  }
@@ -6,6 +6,7 @@
6
6
  export interface GenerateModelOptions {
7
7
  readonly name: string;
8
8
  readonly basePath: string;
9
+ readonly dryRun?: boolean;
9
10
  }
10
11
  export declare function generateModel(options: GenerateModelOptions, cwd: string): Promise<string[]>;
11
12
  //# sourceMappingURL=model.generator.d.ts.map
@@ -4,19 +4,25 @@
4
4
  * Generates model files.
5
5
  */
6
6
  import { writeFileTree } from "../../utils/utils.fileSystem.js";
7
+ import { normalizeName, toPascalCase } from "../../utils/utils.name.js";
7
8
  export async function generateModel(options, cwd) {
9
+ const name = normalizeName(options.name);
10
+ const namePascal = toPascalCase(options.name);
8
11
  const files = {
9
- [`${options.basePath}/models/${options.name}.model.ts`]: `/**
10
- * ${options.name} model.
12
+ [`${options.basePath}/models/${name}.model.ts`]: `/**
13
+ * ${name} model.
11
14
  */
12
15
 
13
- export interface ${options.name}Model {
16
+ export interface ${namePascal}Model {
14
17
  readonly id: string;
15
18
  readonly createdAt: Date;
16
19
  readonly updatedAt: Date;
17
20
  }
18
21
  `,
19
22
  };
23
+ if (options.dryRun) {
24
+ return Object.keys(files);
25
+ }
20
26
  await writeFileTree(cwd, files);
21
27
  return Object.keys(files);
22
28
  }
@@ -7,6 +7,7 @@ export interface GenerateModuleOptions {
7
7
  readonly name: string;
8
8
  readonly feature?: boolean;
9
9
  readonly basePath?: string;
10
+ readonly dryRun?: boolean;
10
11
  }
11
12
  export declare function generateModule(options: GenerateModuleOptions, cwd: string): Promise<string[]>;
12
13
  //# sourceMappingURL=module.generator.d.ts.map
@@ -3,21 +3,17 @@
3
3
  *
4
4
  * Generates a new feature module within a Zudojs project.
5
5
  */
6
- import { mkdir } from "node:fs/promises";
7
- import { join } from "node:path";
8
6
  import { writeFileTree } from "../../utils/utils.fileSystem.js";
9
- import { CLIGenerationError, CLINotInProjectError, } from "../../errors/index.js";
7
+ import { CLIGenerationError } from "../../errors/index.js";
8
+ import { assertGeneratableName, toPascalCase } from "../../utils/utils.name.js";
10
9
  export async function generateModule(options, cwd) {
11
10
  const basePath = options.basePath ?? "modules";
12
- const name = options.name.toLowerCase().replace(/[^a-z0-9-]/g, "-");
11
+ const name = assertGeneratableName(options.name, "module name");
12
+ const namePascal = toPascalCase(name);
13
13
  const files = {
14
14
  [`${basePath}/${name}/${name}.module.ts`]: `import { createLogger } from "@zudojs/logger";
15
15
 
16
- export class ${name
17
- .replace(/-([a-z])/g, (_, c) => c.toUpperCase())
18
- .charAt(0)
19
- .toUpperCase() +
20
- name.replace(/-([a-z])/g, (_, c) => c.toUpperCase()).slice(1)}Module {
16
+ export class ${namePascal}Module {
21
17
  private readonly logger = createLogger({ name: "${name}-module" });
22
18
 
23
19
  id = "${name}-module";
@@ -27,11 +23,7 @@ export class ${name
27
23
  }
28
24
  }
29
25
  `,
30
- [`${basePath}/${name}/index.ts`]: `export { ${name
31
- .replace(/-([a-z])/g, (_, c) => c.toUpperCase())
32
- .charAt(0)
33
- .toUpperCase() +
34
- name.replace(/-([a-z])/g, (_, c) => c.toUpperCase()).slice(1)}Module } from "./${name}.module.js";
26
+ [`${basePath}/${name}/index.ts`]: `export { ${namePascal}Module } from "./${name}.module.js";
35
27
  `,
36
28
  };
37
29
  if (options.feature) {
@@ -39,21 +31,16 @@ export class ${name
39
31
  files[`${basePath}/${name}/features/${featureName}.ts`] =
40
32
  `import { createLogger } from "@zudojs/logger";
41
33
 
42
- export class ${name
43
- .replace(/-([a-z])/g, (_, c) => c.toUpperCase())
44
- .charAt(0)
45
- .toUpperCase() +
46
- name.replace(/-([a-z])/g, (_, c) => c.toUpperCase()).slice(1)}Feature {
34
+ export class ${namePascal}Feature {
47
35
  private readonly logger = createLogger({ name: "${name}-feature" });
48
36
  }
49
37
  `;
50
- files[`${basePath}/${name}/features/index.ts`] = `export { ${name
51
- .replace(/-([a-z])/g, (_, c) => c.toUpperCase())
52
- .charAt(0)
53
- .toUpperCase() +
54
- name.replace(/-([a-z])/g, (_, c) => c.toUpperCase()).slice(1)}Feature } from "./${featureName}.js";
38
+ files[`${basePath}/${name}/features/index.ts`] = `export { ${namePascal}Feature } from "./${featureName}.js";
55
39
  `;
56
40
  }
41
+ if (options.dryRun) {
42
+ return Object.keys(files);
43
+ }
57
44
  try {
58
45
  await writeFileTree(cwd, files);
59
46
  return Object.keys(files);
@@ -1,12 +1,10 @@
1
1
  import { mkdir } from "node:fs/promises";
2
2
  import { writeFileTree } from "../../utils/utils.fileSystem.js";
3
- import { execCommand } from "../../utils/utils.exec.js";
4
3
  import { CLI_VERSION } from "../../constants/index.js";
5
4
  import { generateMonolithFiles } from "../../templates/monolith/index.js";
6
5
  import { generateModularMonolithFiles } from "../../templates/modular-monolith/index.js";
7
6
  import { generateMicroserviceFiles } from "../../templates/microservice/index.js";
8
7
  import { CLIGenerationError } from "../../errors/index.js";
9
- import { getInstallCommand } from "../../installers/dependency.installer.js";
10
8
  export async function generateProject(options, basePath = ".") {
11
9
  let templateFiles;
12
10
  switch (options.architecture) {
@@ -36,27 +34,8 @@ export async function generateProject(options, basePath = ".") {
36
34
  throw new CLIGenerationError(`Failed to write project files:`, error);
37
35
  }
38
36
  const filesCreated = Object.keys(templateFiles);
39
- if (options.initGit) {
40
- try {
41
- await execCommand("git", ["init"], projectPath);
42
- await execCommand("git", ["config", "user.name", "Zudojs CLI"], projectPath);
43
- await execCommand("git", ["config", "user.email", "cli@zudojs.dev"], projectPath);
44
- await execCommand("git", ["add", "-A"], projectPath);
45
- await execCommand("git", ["commit", "-m", "chore: initial commit from Zudojs CLI"], projectPath);
46
- }
47
- catch {
48
- // Git operations are best-effort; non-fatal
49
- }
50
- }
51
- if (options.installDeps) {
52
- try {
53
- const [installFile, ...installArgs] = getInstallCommand(options.packageManager);
54
- await execCommand(installFile, installArgs, projectPath);
55
- }
56
- catch {
57
- // Best-effort: project files are already created.
58
- }
59
- }
37
+ // Note: git initialization and dependency installation are orchestrated by
38
+ // the create command — this generator only writes project files.
60
39
  return {
61
40
  projectPath,
62
41
  filesCreated,
@@ -7,6 +7,7 @@ export interface GenerateQueryOptions {
7
7
  readonly name: string;
8
8
  readonly service?: string;
9
9
  readonly basePath?: string;
10
+ readonly dryRun?: boolean;
10
11
  }
11
12
  export declare function generateQuery(options: GenerateQueryOptions, cwd: string): Promise<string[]>;
12
13
  //# sourceMappingURL=query.generator.d.ts.map
@@ -4,16 +4,19 @@
4
4
  * Generates a CQRS query with handler.
5
5
  */
6
6
  import { writeFileTree } from "../../utils/utils.fileSystem.js";
7
- import { CLIGenerationError, CLIValidationError } from "../../errors/index.js";
7
+ import { CLIGenerationError } from "../../errors/index.js";
8
8
  import { normalizeName } from "../../utils/utils.name.js";
9
9
  export async function generateQuery(options, cwd) {
10
10
  const name = normalizeName(options.name);
11
11
  const nameCamel = name
12
12
  .replace(/-([a-z])/g, (_m, c) => c.toUpperCase())
13
13
  .replace(/^./, (c) => c.toUpperCase());
14
- const service = options.service ?? "default";
14
+ const service = options.service;
15
15
  const basePath = options.basePath ?? "services";
16
- const servicePath = `${basePath}/${service}`;
16
+ // When no service grouping is given the schematic is written directly under
17
+ // basePath. Callers that resolved the owning app into basePath (the
18
+ // microservice layout) pass no service, so the path is not nested twice.
19
+ const servicePath = service ? `${basePath}/${service}` : basePath;
17
20
  const files = {
18
21
  [`${servicePath}/queries/${name}/${name}.query.ts`]: `import type { BaseQuery } from "@zudojs/cqrs";
19
22
 
@@ -48,12 +51,15 @@ export class ${nameCamel}QueryHandler implements QueryHandler<${nameCamel}Query>
48
51
  export { ${nameCamel}QueryHandler } from "./${name}.handler.js";
49
52
  `,
50
53
  };
54
+ if (options.dryRun) {
55
+ return Object.keys(files);
56
+ }
51
57
  try {
52
58
  await writeFileTree(cwd, files);
53
59
  return Object.keys(files);
54
60
  }
55
61
  catch (error) {
56
- throw new CLIGenerationError(`Failed to generate query: ${name} for service: ${service}`, error);
62
+ throw new CLIGenerationError(`Failed to generate query: ${name} in ${servicePath}`, error);
57
63
  }
58
64
  }
59
65
  //# sourceMappingURL=query.generator.js.map
@@ -4,6 +4,7 @@
4
4
  export interface GenerateRepositoryOptions {
5
5
  readonly name: string;
6
6
  readonly basePath?: string;
7
+ readonly dryRun?: boolean;
7
8
  }
8
9
  export declare function generateRepository(options: GenerateRepositoryOptions, cwd: string): Promise<string[]>;
9
10
  //# sourceMappingURL=repository.generator.d.ts.map
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * zudojs-cli — Repository Generator
3
3
  */
4
- import { writeFileTree } from "../../utils/utils.fileSystem.js";
5
- import { CLIGenerationError, CLIValidationError } from "../../errors/index.js";
6
- import { normalizeName } from "../../utils/utils.name.js";
4
+ import { writeFileTree, mergeBarrelExport, } from "../../utils/utils.fileSystem.js";
5
+ import { CLIGenerationError } from "../../errors/index.js";
6
+ import { normalizeName, toPascalCase } from "../../utils/utils.name.js";
7
7
  export async function generateRepository(options, cwd) {
8
8
  const name = normalizeName(options.name);
9
- const nameCamel = name
10
- .replace(/-([a-z])/g, (_m, c) => c.toUpperCase())
11
- .replace(/^./, (c) => c.toUpperCase());
9
+ const nameCamel = toPascalCase(options.name);
12
10
  const basePath = options.basePath ?? "";
11
+ const prefix = basePath ? `${basePath}/` : "";
12
+ const indexPath = `${prefix}repositories/index.ts`;
13
13
  const files = {
14
- [`${basePath ? `${basePath}/` : ""}repositories/${name}.repository.ts`]: `import { createLogger } from "@zudojs/logger";
14
+ [`${prefix}repositories/${name}.repository.ts`]: `import { createLogger } from "@zudojs/logger";
15
15
 
16
16
  export interface ${nameCamel}Entity {
17
17
  readonly id: string;
@@ -63,9 +63,12 @@ export class ${nameCamel}Repository {
63
63
  }
64
64
  }
65
65
  `,
66
- [`${basePath ? `${basePath}/` : ""}repositories/index.ts`]: `export { ${nameCamel}Repository } from "./${name}.repository.js";
67
- `,
66
+ // Merge with any existing barrel content instead of overwriting it.
67
+ [indexPath]: mergeBarrelExport(cwd, indexPath, `export { ${nameCamel}Repository } from "./${name}.repository.js";`),
68
68
  };
69
+ if (options.dryRun) {
70
+ return Object.keys(files);
71
+ }
69
72
  try {
70
73
  await writeFileTree(cwd, files);
71
74
  return Object.keys(files);
@@ -6,6 +6,7 @@
6
6
  export interface GenerateRouteOptions {
7
7
  readonly name: string;
8
8
  readonly basePath: string;
9
+ readonly dryRun?: boolean;
9
10
  }
10
11
  export declare function generateRoute(options: GenerateRouteOptions, cwd: string): Promise<string[]>;
11
12
  //# sourceMappingURL=route.generator.d.ts.map
@@ -4,21 +4,27 @@
4
4
  * Generates route files.
5
5
  */
6
6
  import { writeFileTree } from "../../utils/utils.fileSystem.js";
7
+ import { normalizeName, toCamelCase } from "../../utils/utils.name.js";
7
8
  export async function generateRoute(options, cwd) {
9
+ const name = normalizeName(options.name);
10
+ const nameCamel = toCamelCase(options.name);
8
11
  const files = {
9
- [`${options.basePath}/routes/${options.name}.route.ts`]: `/**
10
- * ${options.name} route.
12
+ [`${options.basePath}/routes/${name}.route.ts`]: `/**
13
+ * ${name} route.
11
14
  */
12
15
 
13
- export const ${options.name}Route = {
14
- path: "/${options.name.toLowerCase()}",
16
+ export const ${nameCamel}Route = {
17
+ path: "/${name}",
15
18
  method: "GET",
16
19
  handler: async () => {
17
- return { message: "${options.name}" };
20
+ return { message: "${name}" };
18
21
  },
19
22
  };
20
23
  `,
21
24
  };
25
+ if (options.dryRun) {
26
+ return Object.keys(files);
27
+ }
22
28
  await writeFileTree(cwd, files);
23
29
  return Object.keys(files);
24
30
  }
@@ -6,6 +6,7 @@
6
6
  export interface GenerateServiceOptions {
7
7
  readonly name: string;
8
8
  readonly basePath?: string;
9
+ readonly dryRun?: boolean;
9
10
  }
10
11
  export declare function generateService(options: GenerateServiceOptions, cwd: string): Promise<string[]>;
11
12
  //# sourceMappingURL=service.generator.d.ts.map
@@ -3,14 +3,13 @@
3
3
  *
4
4
  * Generates a new service with CQRS structure.
5
5
  */
6
- import { writeFileTree } from "../../utils/utils.fileSystem.js";
6
+ import { writeFileTree, mergeBarrelExport, } from "../../utils/utils.fileSystem.js";
7
7
  import { CLIGenerationError } from "../../errors/index.js";
8
+ import { assertGeneratableName, toPascalCase } from "../../utils/utils.name.js";
8
9
  export async function generateService(options, cwd) {
9
10
  const basePath = options.basePath ?? "services";
10
- const name = options.name.toLowerCase().replace(/[^a-z0-9-]/g, "-");
11
- const namePascal = name
12
- .replace(/-([a-z])/g, (_, c) => c.toUpperCase())
13
- .replace(/^./, (c) => c.toUpperCase());
11
+ const name = assertGeneratableName(options.name, "service name");
12
+ const namePascal = toPascalCase(name);
14
13
  const files = {
15
14
  [`${basePath}/${name}/${name}.service.ts`]: `import { createLogger } from "@zudojs/logger";
16
15
 
@@ -22,11 +21,15 @@ export class ${namePascal}Service {
22
21
  }
23
22
  }
24
23
  `,
25
- [`${basePath}/${name}/index.ts`]: `export { ${namePascal}Service } from "./${name}.service.js";
26
- `,
27
- [`${basePath}/${name}/commands/index.ts`]: ``,
28
- [`${basePath}/${name}/queries/index.ts`]: ``,
24
+ // Merge with any existing barrel content instead of overwriting it.
25
+ [`${basePath}/${name}/index.ts`]: mergeBarrelExport(cwd, `${basePath}/${name}/index.ts`, `export { ${namePascal}Service } from "./${name}.service.js";`),
26
+ // Preserve any existing content in the CQRS barrels.
27
+ [`${basePath}/${name}/commands/index.ts`]: mergeBarrelExport(cwd, `${basePath}/${name}/commands/index.ts`, ""),
28
+ [`${basePath}/${name}/queries/index.ts`]: mergeBarrelExport(cwd, `${basePath}/${name}/queries/index.ts`, ""),
29
29
  };
30
+ if (options.dryRun) {
31
+ return Object.keys(files);
32
+ }
30
33
  try {
31
34
  await writeFileTree(cwd, files);
32
35
  return Object.keys(files);
@@ -6,6 +6,7 @@
6
6
  export interface GenerateValidatorOptions {
7
7
  readonly name: string;
8
8
  readonly basePath: string;
9
+ readonly dryRun?: boolean;
9
10
  }
10
11
  export declare function generateValidator(options: GenerateValidatorOptions, cwd: string): Promise<string[]>;
11
12
  //# sourceMappingURL=validator.generator.d.ts.map
@@ -4,17 +4,23 @@
4
4
  * Generates validator files.
5
5
  */
6
6
  import { writeFileTree } from "../../utils/utils.fileSystem.js";
7
+ import { normalizeName, toPascalCase } from "../../utils/utils.name.js";
7
8
  export async function generateValidator(options, cwd) {
9
+ const name = normalizeName(options.name);
10
+ const namePascal = toPascalCase(options.name);
8
11
  const files = {
9
- [`${options.basePath}/validators/${options.name}.validator.ts`]: `/**
10
- * ${options.name} validator.
12
+ [`${options.basePath}/validators/${name}.validator.ts`]: `/**
13
+ * ${name} validator.
11
14
  */
12
15
 
13
- export function validate${options.name}(input: unknown): boolean {
16
+ export function validate${namePascal}(input: unknown): boolean {
14
17
  return true;
15
18
  }
16
19
  `,
17
20
  };
21
+ if (options.dryRun) {
22
+ return Object.keys(files);
23
+ }
18
24
  await writeFileTree(cwd, files);
19
25
  return Object.keys(files);
20
26
  }
@@ -23,8 +23,8 @@ export { CLI_NAME, CLI_DEFAULTS, CLI_COMMANDS, CLI_ALIASES, CLI_OPTION_PREFIXES,
23
23
  export { CLIError, isCLIError, normalizeCLIError, getCLIExitCode, getCLIErrorCode, type CLIErrorOptions, CommandNotFoundError, DuplicateCommandError, InvalidCommandNameError, InvalidArgumentsError, MissingArgumentError, InvalidOptionError, InvalidOptionNameError, MissingOptionValueError, DuplicateOptionError, CLIExecutionError, CLIPermissionError, CLIInterruptedError, CLIConfigurationError, } from "./cliError/index.js";
24
24
  export { CLICommandRegistry, CLICommandBuilder, createCommand, command, executeCommand, validateCommand, isCLICommand, sortCommands, } from "./cliCommand/index.js";
25
25
  export { CLIParser, type CLIParserOptions, parseCLIArguments, parseOptionValue, parseBoolean, isOption, isLongOption, isShortOption, resolveCommand, normalizeCLIValue, } from "./cliParser/index.js";
26
- export { ZudojsCLI, createCLI, createCLIWriter, registerCLIInterruptHandler, } from "./cliApplication/index.js";
27
- export { getCLIVersion, formatCLIVersion, getVersionString, isValidVersion, compareVersions, parseVersion, isCompatibleVersion, type CLIVersionInfo, } from "./cliVersion/index.js";
26
+ export { ZudojsCLI, createCLI, createCLIWriter, createCLILogger, formatCLILogLine, registerCLIInterruptHandler, type CLILoggerOptions, } from "./cliApplication/index.js";
27
+ export { getCLIVersion, formatCLIVersion, getVersionString, isValidVersion, compareVersions, parseVersion, isCompatibleVersion, checkForNewerVersion, isUpdateCheckDisabled, type CLIVersionInfo, type UpdateCheckOptions, type UpdateCheckResult, } from "./cliVersion/index.js";
28
28
  export type { FrontendAdapter, FrontendGenerationContext, FrontendFeatures, DependencyRequirement, ValidationResult, } from "./adapters/frontend/index.js";
29
29
  export { ReactAdapter, NextAdapter, VueAdapter, NuxtAdapter, AngularAdapter, SvelteAdapter, SvelteKitAdapter, AstroAdapter, VanillaAdapter, FlutterAdapter, ReactNativeAdapter, } from "./adapters/frontend/index.js";
30
30
  export { PnpmAdapter, NpmAdapter, YarnAdapter, BunAdapter, } from "./adapters/package-managers/index.js";
@@ -34,6 +34,7 @@ export { detectArchitecture } from "./resolvers/index.js";
34
34
  export { resolveProjectPath, findProjectRoot, } from "./resolvers/project.resolver.js";
35
35
  export { CapabilityResolver, type CapabilityDependency, type CapabilityResolutionResult, } from "./resolvers/capability/index.js";
36
36
  export { ConfigurationResolver, type ResolvedConfiguration, } from "./resolvers/configuration/index.js";
37
+ export { resolveProjectLayout, detectPackageManager, type ProjectLayout, type ProjectLayoutType, type ProjectLayoutSource, } from "./resolvers/layout/index.js";
37
38
  export { EnvironmentValidator, type EnvironmentCheck, type EnvironmentValidationResult, } from "./validators/index.js";
38
39
  export { ProjectValidator, type ProjectCheck, type ProjectValidationResult, } from "./validators/index.js";
39
40
  export { CompatibilityValidator, type CompatibilityCheck, type CompatibilityResult, } from "./validators/compatibility/index.js";
package/dist/src/index.js CHANGED
@@ -27,9 +27,9 @@ export { CLICommandRegistry, CLICommandBuilder, createCommand, command, executeC
27
27
  // Parser
28
28
  export { CLIParser, parseCLIArguments, parseOptionValue, parseBoolean, isOption, isLongOption, isShortOption, resolveCommand, normalizeCLIValue, } from "./cliParser/index.js";
29
29
  // Application
30
- export { ZudojsCLI, createCLI, createCLIWriter, registerCLIInterruptHandler, } from "./cliApplication/index.js";
30
+ export { ZudojsCLI, createCLI, createCLIWriter, createCLILogger, formatCLILogLine, registerCLIInterruptHandler, } from "./cliApplication/index.js";
31
31
  // Version
32
- export { getCLIVersion, formatCLIVersion, getVersionString, isValidVersion, compareVersions, parseVersion, isCompatibleVersion, } from "./cliVersion/index.js";
32
+ export { getCLIVersion, formatCLIVersion, getVersionString, isValidVersion, compareVersions, parseVersion, isCompatibleVersion, checkForNewerVersion, isUpdateCheckDisabled, } from "./cliVersion/index.js";
33
33
  export { ReactAdapter, NextAdapter, VueAdapter, NuxtAdapter, AngularAdapter, SvelteAdapter, SvelteKitAdapter, AstroAdapter, VanillaAdapter, FlutterAdapter, ReactNativeAdapter, } from "./adapters/frontend/index.js";
34
34
  export { PnpmAdapter, NpmAdapter, YarnAdapter, BunAdapter, } from "./adapters/package-managers/index.js";
35
35
  export { PostgresAdapter, MySqlAdapter, SqliteAdapter, } from "./adapters/databases/index.js";
@@ -39,6 +39,7 @@ export { detectArchitecture } from "./resolvers/index.js";
39
39
  export { resolveProjectPath, findProjectRoot, } from "./resolvers/project.resolver.js";
40
40
  export { CapabilityResolver, } from "./resolvers/capability/index.js";
41
41
  export { ConfigurationResolver, } from "./resolvers/configuration/index.js";
42
+ export { resolveProjectLayout, detectPackageManager, } from "./resolvers/layout/index.js";
42
43
  // Validators
43
44
  export { EnvironmentValidator, } from "./validators/index.js";
44
45
  export { ProjectValidator, } from "./validators/index.js";
@@ -1,5 +1,14 @@
1
1
  import type { PackageManager } from "../types/index.js";
2
2
  export declare function getInstallCommand(packageManager: PackageManager): [string, ...string[]];
3
3
  export declare function getAddCommand(packageManager: PackageManager, pkg: string): [string, ...string[]];
4
+ /**
5
+ * The command that runs a `package.json` script with the given manager.
6
+ *
7
+ * Generated projects declare their dev/build tooling (`tsx`, `vite`, `ng`)
8
+ * as devDependencies, so the binaries live in `node_modules/.bin` and are
9
+ * not on the user's PATH. Running the script through the package manager is
10
+ * what puts them there.
11
+ */
12
+ export declare function getRunScriptCommand(packageManager: PackageManager, script: string): [string, ...string[]];
4
13
  export declare function installDependencies(packageManager: PackageManager, cwd: string): Promise<void>;
5
14
  //# sourceMappingURL=dependency.installer.d.ts.map