@warlock.js/core 4.12.0 → 4.14.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 (189) hide show
  1. package/CHANGELOG.md +214 -0
  2. package/esm/cli/cli-commands.manager.mjs.map +1 -1
  3. package/esm/cli/commands/add.command.mjs +1 -1
  4. package/esm/cli/commands/add.command.mjs.map +1 -1
  5. package/esm/cli/commands/build.command.mjs +1 -1
  6. package/esm/cli/commands/build.command.mjs.map +1 -1
  7. package/esm/cli/commands/create-database.command.mjs +1 -1
  8. package/esm/cli/commands/create-database.command.mjs.map +1 -1
  9. package/esm/cli/commands/dev-server.command.mjs +1 -1
  10. package/esm/cli/commands/dev-server.command.mjs.map +1 -1
  11. package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
  12. package/esm/cli/commands/doctor.command.mjs +1 -1
  13. package/esm/cli/commands/doctor.command.mjs.map +1 -1
  14. package/esm/cli/commands/drop-tables.command.mjs +1 -1
  15. package/esm/cli/commands/drop-tables.command.mjs.map +1 -1
  16. package/esm/cli/commands/generate/generate.command.mjs +1 -1
  17. package/esm/cli/commands/generate/generate.command.mjs.map +1 -1
  18. package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
  19. package/esm/cli/commands/generate/generators/migration.generator.mjs +1 -1
  20. package/esm/cli/commands/generate/generators/migration.generator.mjs.map +1 -1
  21. package/esm/cli/commands/generate/generators/model.generator.mjs +1 -1
  22. package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
  23. package/esm/cli/commands/generate/generators/module.generator.mjs +1 -1
  24. package/esm/cli/commands/generate/generators/module.generator.mjs.map +1 -1
  25. package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
  26. package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
  27. package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
  28. package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
  29. package/esm/cli/commands/generate/utils/writer.mjs +1 -1
  30. package/esm/cli/commands/migrate.command.mjs +1 -1
  31. package/esm/cli/commands/migrate.command.mjs.map +1 -1
  32. package/esm/cli/commands/routes/routes-command.action.mjs.map +1 -1
  33. package/esm/cli/commands/routes.command.mjs +1 -1
  34. package/esm/cli/commands/routes.command.mjs.map +1 -1
  35. package/esm/cli/commands/seed.command.mjs +1 -1
  36. package/esm/cli/commands/seed.command.mjs.map +1 -1
  37. package/esm/cli/commands/start-production.command.mjs +1 -1
  38. package/esm/cli/commands/start-production.command.mjs.map +1 -1
  39. package/esm/cli/commands/storage-put.action.mjs.map +1 -1
  40. package/esm/cli/commands/storage-put.command.mjs +1 -1
  41. package/esm/cli/commands/storage-put.command.mjs.map +1 -1
  42. package/esm/cli/commands/typings-generator.command.mjs +2 -2
  43. package/esm/cli/commands/typings-generator.command.mjs.map +1 -1
  44. package/esm/cli/commands/update.command.mjs +1 -1
  45. package/esm/cli/commands/update.command.mjs.map +1 -1
  46. package/esm/cli/commands-loader.mjs +1 -1
  47. package/esm/cli/commands-loader.mjs.map +1 -1
  48. package/esm/{cli → commands}/cli-command.d.mts +1 -1
  49. package/esm/commands/cli-command.d.mts.map +1 -0
  50. package/esm/{cli → commands}/cli-command.mjs +1 -1
  51. package/esm/commands/cli-command.mjs.map +1 -0
  52. package/esm/{cli → commands}/types.d.mts +1 -1
  53. package/esm/commands/types.d.mts.map +1 -0
  54. package/esm/config/load-config-files.mjs +1 -1
  55. package/esm/config/load-config-files.mjs.map +1 -1
  56. package/esm/connectors/base-connector.mjs +1 -1
  57. package/esm/connectors/base-connector.mjs.map +1 -1
  58. package/esm/connectors/connectors-manager.d.mts.map +1 -1
  59. package/esm/connectors/connectors-manager.mjs +5 -3
  60. package/esm/connectors/connectors-manager.mjs.map +1 -1
  61. package/esm/connectors/http-connector.d.mts.map +1 -1
  62. package/esm/connectors/http-connector.mjs +0 -2
  63. package/esm/connectors/http-connector.mjs.map +1 -1
  64. package/esm/database/create-database-action.mjs.map +1 -1
  65. package/esm/database/drop-tables-action.mjs.map +1 -1
  66. package/esm/database/migrate-action.mjs +1 -1
  67. package/esm/database/migrate-action.mjs.map +1 -1
  68. package/esm/database/seed-command-action.mjs +1 -1
  69. package/esm/database/seed-command-action.mjs.map +1 -1
  70. package/esm/dev-server/dev-logger.mjs +1 -1
  71. package/esm/dev-server/dev-logger.mjs.map +1 -1
  72. package/esm/dev-server/development-server.mjs +2 -2
  73. package/esm/dev-server/file-event-handler.mjs +1 -1
  74. package/esm/dev-server/file-event-handler.mjs.map +1 -1
  75. package/esm/dev-server/file-manager.mjs +1 -1
  76. package/esm/dev-server/file-manager.mjs.map +1 -1
  77. package/esm/dev-server/file-operations.mjs +1 -1
  78. package/esm/dev-server/file-operations.mjs.map +1 -1
  79. package/esm/dev-server/files-orchestrator.mjs +3 -18
  80. package/esm/dev-server/files-orchestrator.mjs.map +1 -1
  81. package/esm/dev-server/files-watcher.mjs +1 -1
  82. package/esm/dev-server/files-watcher.mjs.map +1 -1
  83. package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +1 -1
  84. package/esm/dev-server/layer-executor.mjs +1 -1
  85. package/esm/dev-server/loader/register-loader.mjs +1 -1
  86. package/esm/dev-server/package-json-manager.mjs +1 -1
  87. package/esm/dev-server/package-json-manager.mjs.map +1 -1
  88. package/esm/dev-server/parse-imports.mjs +2 -2
  89. package/esm/dev-server/parse-imports.mjs.map +1 -1
  90. package/esm/dev-server/tsconfig-manager.mjs +1 -1
  91. package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
  92. package/esm/dev-server/type-generator.mjs +1 -1
  93. package/esm/dev-server/type-generator.mjs.map +1 -1
  94. package/esm/dev-server/utils.mjs +1 -1
  95. package/esm/dev-server/utils.mjs.map +1 -1
  96. package/esm/generations/add-command.action.mjs +20 -8
  97. package/esm/generations/add-command.action.mjs.map +1 -1
  98. package/esm/http/build-cors-options.mjs +32 -0
  99. package/esm/http/build-cors-options.mjs.map +1 -0
  100. package/esm/http/middleware/max-body-size.middleware.d.mts +13 -5
  101. package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
  102. package/esm/http/middleware/max-body-size.middleware.mjs +13 -5
  103. package/esm/http/middleware/max-body-size.middleware.mjs.map +1 -1
  104. package/esm/http/plugins.d.mts.map +1 -1
  105. package/esm/http/plugins.mjs +2 -9
  106. package/esm/http/plugins.mjs.map +1 -1
  107. package/esm/http/server.d.mts.map +1 -1
  108. package/esm/http/server.mjs +3 -8
  109. package/esm/http/server.mjs.map +1 -1
  110. package/esm/index.d.mts +9 -17
  111. package/esm/index.mjs +4 -15
  112. package/esm/production/production-builder.mjs +51 -3
  113. package/esm/production/production-builder.mjs.map +1 -1
  114. package/esm/production/resolve-build-config.mjs +1 -1
  115. package/esm/production/resolve-build-config.mjs.map +1 -1
  116. package/esm/router/router.d.mts +9 -0
  117. package/esm/router/router.d.mts.map +1 -1
  118. package/esm/router/router.mjs +58 -5
  119. package/esm/router/router.mjs.map +1 -1
  120. package/esm/router/types.d.mts +24 -1
  121. package/esm/router/types.d.mts.map +1 -1
  122. package/esm/tests/index.d.mts +3 -2
  123. package/esm/tests/index.mjs +2 -3
  124. package/esm/tests/start-http-development-server.d.mts.map +1 -1
  125. package/esm/tests/start-http-development-server.mjs +38 -15
  126. package/esm/tests/start-http-development-server.mjs.map +1 -1
  127. package/esm/tests/test-connectors-selection.d.mts +14 -0
  128. package/esm/tests/test-connectors-selection.d.mts.map +1 -0
  129. package/esm/tests/test-connectors-selection.mjs +72 -0
  130. package/esm/tests/test-connectors-selection.mjs.map +1 -0
  131. package/esm/tests/test-helpers.d.mts.map +1 -1
  132. package/esm/tests/test-helpers.mjs +34 -13
  133. package/esm/tests/test-helpers.mjs.map +1 -1
  134. package/esm/tests/test-lifecycle-state.mjs +27 -0
  135. package/esm/tests/test-lifecycle-state.mjs.map +1 -0
  136. package/esm/tests/test-setup-timeout.mjs +53 -0
  137. package/esm/tests/test-setup-timeout.mjs.map +1 -0
  138. package/esm/tests/vitest-setup.d.mts +64 -8
  139. package/esm/tests/vitest-setup.d.mts.map +1 -1
  140. package/esm/tests/vitest-setup.mjs +317 -11
  141. package/esm/tests/vitest-setup.mjs.map +1 -1
  142. package/esm/utils/framework-vesion.mjs +1 -1
  143. package/esm/utils/index.d.mts +1 -0
  144. package/esm/utils/index.mjs +1 -0
  145. package/esm/utils/normalized-path.d.mts +55 -0
  146. package/esm/utils/normalized-path.d.mts.map +1 -0
  147. package/esm/{dev-server/path.mjs → utils/normalized-path.mjs} +15 -2
  148. package/esm/utils/normalized-path.mjs.map +1 -0
  149. package/esm/vite/index.d.mts +2 -0
  150. package/esm/vite/index.mjs +1 -1
  151. package/esm/vite/lower-stage3-decorators.d.mts +1 -1
  152. package/esm/vite/lower-stage3-decorators.mjs +1 -1
  153. package/esm/vite/lower-stage3-decorators.mjs.map +1 -1
  154. package/esm/warlock-config/index.mjs +1 -1
  155. package/esm/warlock-config/types.d.mts +34 -1
  156. package/esm/warlock-config/types.d.mts.map +1 -1
  157. package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
  158. package/esm/warlock-config/warlock-config.manager.mjs +1 -2
  159. package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
  160. package/llms-full.txt +78 -23
  161. package/llms.txt +3 -3
  162. package/package.json +24 -12
  163. package/skills/lower-stage3-decorators/SKILL.md +4 -2
  164. package/skills/run-app/SKILL.md +6 -0
  165. package/skills/test-http/SKILL.md +37 -12
  166. package/skills/test-service/SKILL.md +167 -24
  167. package/skills/use-middleware/SKILL.md +5 -1
  168. package/esm/cli/cli-command.d.mts.map +0 -1
  169. package/esm/cli/cli-command.mjs.map +0 -1
  170. package/esm/cli/types.d.mts.map +0 -1
  171. package/esm/dev-server/files-orchestrator.d.mts +0 -89
  172. package/esm/dev-server/files-orchestrator.d.mts.map +0 -1
  173. package/esm/dev-server/files-watcher.d.mts +0 -69
  174. package/esm/dev-server/files-watcher.d.mts.map +0 -1
  175. package/esm/dev-server/health-checker/checkers/base-health-checker.d.mts +0 -55
  176. package/esm/dev-server/health-checker/checkers/base-health-checker.d.mts.map +0 -1
  177. package/esm/dev-server/health-checker/checkers/eslint-health-checker.d.mts +0 -44
  178. package/esm/dev-server/health-checker/checkers/eslint-health-checker.d.mts.map +0 -1
  179. package/esm/dev-server/health-checker/checkers/typescript-health-checker.d.mts +0 -60
  180. package/esm/dev-server/health-checker/checkers/typescript-health-checker.d.mts.map +0 -1
  181. package/esm/dev-server/health-checker/files-healthcare.manager.d.mts +0 -119
  182. package/esm/dev-server/health-checker/files-healthcare.manager.d.mts.map +0 -1
  183. package/esm/dev-server/health-checker/index.mjs +0 -7
  184. package/esm/dev-server/module-loader.d.mts +0 -63
  185. package/esm/dev-server/module-loader.d.mts.map +0 -1
  186. package/esm/dev-server/path.mjs.map +0 -1
  187. package/esm/tests/test-server-port-channel.d.mts +0 -27
  188. package/esm/tests/test-server-port-channel.d.mts.map +0 -1
  189. /package/esm/{cli → commands}/index.d.mts +0 -0
@@ -4,8 +4,8 @@ import { migrationAlterStub, migrationStub } from "../templates/stubs.mjs";
4
4
  import { parseName } from "../utils/name-parser.mjs";
5
5
  import { ensureDirectoryAsync, putFileAsync, setDryRun } from "../utils/writer.mjs";
6
6
  import { parseColumnDsl } from "./column-dsl-parser.mjs";
7
- import { colors } from "@mongez/copper";
8
7
  import path from "node:path";
8
+ import { colors } from "@mongez/copper";
9
9
 
10
10
  //#region ../core/src/cli/commands/generate/generators/migration.generator.ts
11
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"migration.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/migration.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport { appPath } from \"../../../../utils\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { migrationAlterStub, migrationStub } from \"../templates/stubs\";\r\nimport { parseColumnDsl } from \"./column-dsl-parser\";\r\nimport { parseName } from \"../utils/name-parser\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\n\r\n/**\r\n * Generate a migration file for a model\r\n */\r\n/**\r\n * Create a migration file for a model\r\n */\r\nexport async function createMigrationFile(moduleName: string, entityName: string, options: any = {}) {\r\n const entity = parseName(entityName);\r\n\r\n // Generate timestamp: MM-DD-YYYY_HH-MM-SS\r\n const now = new Date();\r\n const timestamp = `${String(now.getMonth() + 1).padStart(2, \"0\")}-${String(now.getDate()).padStart(2, \"0\")}-${now.getFullYear()}_${String(now.getHours()).padStart(2, \"0\")}-${String(now.getMinutes()).padStart(2, \"0\")}-${String(now.getSeconds()).padStart(2, \"0\")}`;\r\n\r\n const migrationFileName = `${timestamp}-${entity.kebab}.migration.ts`;\r\n const migrationsPath = path.join(appPath(), moduleName, \"models\", entity.kebab, \"migrations\");\r\n\r\n // Ensure migrations directory exists\r\n await ensureDirectoryAsync(migrationsPath);\r\n\r\n const addParams = options.add as string;\r\n const dropParams = options.drop as string;\r\n const renameParams = options.rename as string;\r\n const timestamps = options.timestamps !== \"false\" && options.timestamps !== false;\r\n\r\n let migrationContent = \"\";\r\n\r\n if (addParams || dropParams || renameParams) {\r\n // Generate alter stub\r\n const parsedAdd = parseColumnDsl(addParams || \"\");\r\n const helpersSet = new Set<string>();\r\n \r\n const addLines = parsedAdd.map((col) => {\r\n helpersSet.add(col.helper);\r\n return ` ${col.name}: ${col.helper}()${col.modifiers.join(\"\")},`;\r\n });\r\n\r\n let formattedDrop: string | undefined = undefined;\r\n if (dropParams) {\r\n formattedDrop = JSON.stringify(dropParams.split(\",\").map((s) => s.trim()));\r\n }\r\n\r\n let formattedRename: string | undefined = undefined;\r\n if (renameParams) {\r\n const obj: Record<string, string> = {};\r\n renameParams.split(\",\").map((s) => s.trim()).forEach((p) => {\r\n const [oldN, newN] = p.split(\":\").map((s) => s.trim());\r\n if (oldN && newN) obj[oldN] = newN;\r\n });\r\n formattedRename = JSON.stringify(obj, null, 2).replace(/\\n/g, '\\n ');\r\n }\r\n\r\n migrationContent = migrationAlterStub(entity, {\r\n add: addLines.length > 0 ? addLines.join(\"\\n\") : undefined,\r\n drop: formattedDrop,\r\n rename: formattedRename,\r\n imports: Array.from(helpersSet),\r\n });\r\n } else {\r\n // Generate create stub\r\n migrationContent = migrationStub(entity, {\r\n timestamps,\r\n });\r\n }\r\n\r\n // Create migration file\r\n const migrationFilePath = path.join(migrationsPath, migrationFileName);\r\n await putFileAsync(migrationFilePath, migrationContent);\r\n\r\n return migrationFilePath;\r\n}\r\n\r\n/**\r\n * Generate a migration file for a model\r\n */\r\nexport async function generateMigration(data: CommandActionData) {\r\n const modelPath = data.args[0] as string;\r\n\r\n if (!modelPath) {\r\n console.log(colors.red(\"Error: Model path is required\"));\r\n console.log(colors.gray(\"Usage: warlock gen.migration <model-path>\"));\r\n console.log(colors.gray(\"Example: warlock gen.migration products/product\"));\r\n return;\r\n }\r\n\r\n // Parse model path (e.g., \"products/product\")\r\n const [moduleName, entityName] = modelPath.split(\"/\");\r\n\r\n if (!moduleName || !entityName) {\r\n console.log(colors.red(\"Error: Invalid model path format. Expected: <module>/<entity>\"));\r\n console.log(colors.gray(\"Example: warlock gen.migration products/product\"));\r\n return;\r\n }\r\n\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n const migrationFilePath = await createMigrationFile(moduleName, entityName, data.options);\r\n\r\n console.log(\r\n colors.cyan(`\\n✨ Migration file created at: ${path.relative(appPath(), migrationFilePath)}`),\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,eAAsB,oBAAoB,YAAoB,YAAoB,UAAe,CAAC,GAAG;CACnG,MAAM,SAAS,UAAU,UAAU;CAGnC,MAAM,sBAAM,IAAI,KAAK;CAGrB,MAAM,oBAAoB,GAAG,GAFR,OAAO,IAAI,SAAS,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,IAAI,Y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,OAAO,MAAM;EACtE;EAEA,mBAAmB,mBAAmB,QAAQ;GAC5C,KAAK,SAAS,SAAS,IAAI,SAAS,KAAK,IAAI,IAAI;GACjD,MAAM;GACN,QAAQ;GACR,SAAS,MAAM,KAAK,UAAU;EAChC,CAAC;CACH,OAEE,mBAAmB,cAAc,QAAQ,EACvC,WACF,CAAC;CAIH,MAAM,oBAAoB,KAAK,KAAK,gBAAgB,iBAAiB;CACrE,MAAM,aAAa,mBAAmB,gBAAgB;CAEtD,OAAO;AACT;;;;AAKA,eAAsB,kBAAkB,MAAyB;CAC/D,MAAM,YAAY,KAAK,KAAK;CAE5B,IAAI,CAAC,WAAW;EACd,QAAQ,IAAI,OAAO,IAAI,+BAA+B,CAAC;EACvD,QAAQ,IAAI,OAAO,KAAK,2CAA2C,CAAC;EACpE,QAAQ,IAAI,OAAO,KAAK,iDAAiD,CAAC;EAC1E;CACF;CAGA,MAAM,CAAC,YAAY,cAAc,UAAU,MAAM,GAAG;CAEpD,IAAI,CAAC,cAAc,CAAC,YAAY;EAC9B,QAAQ,IAAI,OAAO,IAAI,+DAA+D,CAAC;EACvF,QAAQ,IAAI,OAAO,KAAK,iDAAiD,CAAC;EAC1E;CACF;CAEA,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAEtC,MAAM,oBAAoB,MAAM,oBAAoB,YAAY,YAAY,KAAK,OAAO;CAExF,QAAQ,IACN,OAAO,KAAK,oCAAoC,KAAK,SAAS,QAAQ,GAAG,iBAAiB,GAAG,CAC/F;AACF"}
1
+ {"version":3,"file":"migration.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/migration.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport { appPath } from \"../../../../utils\";\r\nimport type { CommandActionData } from \"../../../../commands/types\";\r\nimport { migrationAlterStub, migrationStub } from \"../templates/stubs\";\r\nimport { parseColumnDsl } from \"./column-dsl-parser\";\r\nimport { parseName } from \"../utils/name-parser\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\n\r\n/**\r\n * Generate a migration file for a model\r\n */\r\n/**\r\n * Create a migration file for a model\r\n */\r\nexport async function createMigrationFile(moduleName: string, entityName: string, options: any = {}) {\r\n const entity = parseName(entityName);\r\n\r\n // Generate timestamp: MM-DD-YYYY_HH-MM-SS\r\n const now = new Date();\r\n const timestamp = `${String(now.getMonth() + 1).padStart(2, \"0\")}-${String(now.getDate()).padStart(2, \"0\")}-${now.getFullYear()}_${String(now.getHours()).padStart(2, \"0\")}-${String(now.getMinutes()).padStart(2, \"0\")}-${String(now.getSeconds()).padStart(2, \"0\")}`;\r\n\r\n const migrationFileName = `${timestamp}-${entity.kebab}.migration.ts`;\r\n const migrationsPath = path.join(appPath(), moduleName, \"models\", entity.kebab, \"migrations\");\r\n\r\n // Ensure migrations directory exists\r\n await ensureDirectoryAsync(migrationsPath);\r\n\r\n const addParams = options.add as string;\r\n const dropParams = options.drop as string;\r\n const renameParams = options.rename as string;\r\n const timestamps = options.timestamps !== \"false\" && options.timestamps !== false;\r\n\r\n let migrationContent = \"\";\r\n\r\n if (addParams || dropParams || renameParams) {\r\n // Generate alter stub\r\n const parsedAdd = parseColumnDsl(addParams || \"\");\r\n const helpersSet = new Set<string>();\r\n \r\n const addLines = parsedAdd.map((col) => {\r\n helpersSet.add(col.helper);\r\n return ` ${col.name}: ${col.helper}()${col.modifiers.join(\"\")},`;\r\n });\r\n\r\n let formattedDrop: string | undefined = undefined;\r\n if (dropParams) {\r\n formattedDrop = JSON.stringify(dropParams.split(\",\").map((s) => s.trim()));\r\n }\r\n\r\n let formattedRename: string | undefined = undefined;\r\n if (renameParams) {\r\n const obj: Record<string, string> = {};\r\n renameParams.split(\",\").map((s) => s.trim()).forEach((p) => {\r\n const [oldN, newN] = p.split(\":\").map((s) => s.trim());\r\n if (oldN && newN) obj[oldN] = newN;\r\n });\r\n formattedRename = JSON.stringify(obj, null, 2).replace(/\\n/g, '\\n ');\r\n }\r\n\r\n migrationContent = migrationAlterStub(entity, {\r\n add: addLines.length > 0 ? addLines.join(\"\\n\") : undefined,\r\n drop: formattedDrop,\r\n rename: formattedRename,\r\n imports: Array.from(helpersSet),\r\n });\r\n } else {\r\n // Generate create stub\r\n migrationContent = migrationStub(entity, {\r\n timestamps,\r\n });\r\n }\r\n\r\n // Create migration file\r\n const migrationFilePath = path.join(migrationsPath, migrationFileName);\r\n await putFileAsync(migrationFilePath, migrationContent);\r\n\r\n return migrationFilePath;\r\n}\r\n\r\n/**\r\n * Generate a migration file for a model\r\n */\r\nexport async function generateMigration(data: CommandActionData) {\r\n const modelPath = data.args[0] as string;\r\n\r\n if (!modelPath) {\r\n console.log(colors.red(\"Error: Model path is required\"));\r\n console.log(colors.gray(\"Usage: warlock gen.migration <model-path>\"));\r\n console.log(colors.gray(\"Example: warlock gen.migration products/product\"));\r\n return;\r\n }\r\n\r\n // Parse model path (e.g., \"products/product\")\r\n const [moduleName, entityName] = modelPath.split(\"/\");\r\n\r\n if (!moduleName || !entityName) {\r\n console.log(colors.red(\"Error: Invalid model path format. Expected: <module>/<entity>\"));\r\n console.log(colors.gray(\"Example: warlock gen.migration products/product\"));\r\n return;\r\n }\r\n\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n const migrationFilePath = await createMigrationFile(moduleName, entityName, data.options);\r\n\r\n console.log(\r\n colors.cyan(`\\n✨ Migration file created at: ${path.relative(appPath(), migrationFilePath)}`),\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,eAAsB,oBAAoB,YAAoB,YAAoB,UAAe,CAAC,GAAG;CACnG,MAAM,SAAS,UAAU,UAAU;CAGnC,MAAM,sBAAM,IAAI,KAAK;CAGrB,MAAM,oBAAoB,GAAG,GAFR,OAAO,IAAI,SAAS,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,GA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MAAM,CAAC,CAAC,CAAC,QAAQ,OAAO,MAAM;EACtE;EAEA,mBAAmB,mBAAmB,QAAQ;GAC5C,KAAK,SAAS,SAAS,IAAI,SAAS,KAAK,IAAI,IAAI;GACjD,MAAM;GACN,QAAQ;GACR,SAAS,MAAM,KAAK,UAAU;EAChC,CAAC;CACH,OAEE,mBAAmB,cAAc,QAAQ,EACvC,WACF,CAAC;CAIH,MAAM,oBAAoB,KAAK,KAAK,gBAAgB,iBAAiB;CACrE,MAAM,aAAa,mBAAmB,gBAAgB;CAEtD,OAAO;AACT;;;;AAKA,eAAsB,kBAAkB,MAAyB;CAC/D,MAAM,YAAY,KAAK,KAAK;CAE5B,IAAI,CAAC,WAAW;EACd,QAAQ,IAAI,OAAO,IAAI,+BAA+B,CAAC;EACvD,QAAQ,IAAI,OAAO,KAAK,2CAA2C,CAAC;EACpE,QAAQ,IAAI,OAAO,KAAK,iDAAiD,CAAC;EAC1E;CACF;CAGA,MAAM,CAAC,YAAY,cAAc,UAAU,MAAM,GAAG;CAEpD,IAAI,CAAC,cAAc,CAAC,YAAY;EAC9B,QAAQ,IAAI,OAAO,IAAI,+DAA+D,CAAC;EACvF,QAAQ,IAAI,OAAO,KAAK,iDAAiD,CAAC;EAC1E;CACF;CAEA,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAEtC,MAAM,oBAAoB,MAAM,oBAAoB,YAAY,YAAY,KAAK,OAAO;CAExF,QAAQ,IACN,OAAO,KAAK,oCAAoC,KAAK,SAAS,QAAQ,GAAG,iBAAiB,GAAG,CAC/F;AACF"}
@@ -2,8 +2,8 @@ import { migrationStub, modelStub } from "../templates/stubs.mjs";
2
2
  import { parseModulePath, singularName } from "../utils/name-parser.mjs";
3
3
  import { ensureDirectoryAsync, putFileAsync, setDryRun } from "../utils/writer.mjs";
4
4
  import { componentExists, moduleExists, resolveModulePath } from "../utils/path-resolver.mjs";
5
- import { colors } from "@mongez/copper";
6
5
  import path from "node:path";
6
+ import { colors } from "@mongez/copper";
7
7
 
8
8
  //#region ../core/src/cli/commands/generate/generators/model.generator.ts
9
9
  async function generateModel(data) {
@@ -1 +1 @@
1
- {"version":3,"file":"model.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/model.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { migrationStub, modelStub } from \"../templates/stubs\";\r\nimport { parseModulePath, singularName } from \"../utils/name-parser\";\r\nimport { componentExists, moduleExists, resolveModulePath } from \"../utils/path-resolver\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\n\r\nexport async function generateModel(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Model name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.model <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.model users/user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.model <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = singularName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n const withResource = data.options.withResource || data.options.rs;\r\n const tableName = (data.options.table as string) || name.plural.snake;\r\n\r\n // Check if model already exists\r\n const modelDir = path.join(resolveModulePath(module), \"models\", name.kebab);\r\n const modelPath = path.join(modelDir, `${name.kebab}.model.ts`);\r\n\r\n if ((await componentExists(module, `models/${name.kebab}`, `${name.kebab}.model`)) && !force) {\r\n console.log(colors.red(`Error: Model \"${name.kebab}\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureDirectoryAsync(modelDir);\r\n await ensureDirectoryAsync(path.join(modelDir, \"migrations\"));\r\n\r\n // Generate model\r\n const modelContent = modelStub(name, { tableName, withResource: !!withResource });\r\n await putFileAsync(modelPath, modelContent);\r\n\r\n // Generate index.ts\r\n const indexContent = `export * from \"./${name.kebab}.model\";\r\n`;\r\n await putFileAsync(path.join(modelDir, \"index.ts\"), indexContent);\r\n\r\n // Generate migration\r\n const timestamp = new Date().toISOString().replace(/[-:T]/g, \"_\").split(\".\")[0];\r\n const migrationPath = path.join(\r\n modelDir,\r\n \"migrations\",\r\n `${timestamp}_${name.kebab}.migration.ts`,\r\n );\r\n\r\n const migrationContent = migrationStub(name, {\r\n timestamps: data.options.timestamps !== \"false\" && data.options.timestamps !== false,\r\n });\r\n\r\n await putFileAsync(migrationPath, migrationContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Model \"${name.pascal}\" generated successfully!`));\r\n console.log(colors.gray(`\\nNext steps:`));\r\n console.log(colors.gray(` 1. Update model schema in ${name.kebab}.model.ts`));\r\n console.log(\r\n colors.gray(` 2. Update migration in migrations/${timestamp}_${name.kebab}.migration.ts`),\r\n );\r\n console.log(colors.gray(` 3. Run migration: warlock migrate`));\r\n}\r\n"],"mappings":";;;;;;;;AAQA,eAAsB,cAAc,MAAwC;CAC1E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,+BAA+B,CAAC;EACvD,QAAQ,IAAI,OAAO,OAAO,6CAA6C,CAAC;EACxE,QAAQ,IAAI,OAAO,OAAO,0CAA0C,CAAC;EACrE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IA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AC,MAAM,GAAG,CAAC,CAAC;CAW7E,MAAM,aAVgB,KAAK,KACzB,UACA,cACA,GAAG,UAAU,GAAG,KAAK,MAAM,cAOE,GAJN,cAAc,MAAM,EAC3C,YAAY,KAAK,QAAQ,eAAe,WAAW,KAAK,QAAQ,eAAe,MACjF,CAEiD,CAAC;CAElD,QAAQ,IAAI,OAAO,KAAK,gBAAgB,KAAK,OAAO,0BAA0B,CAAC;CAC/E,QAAQ,IAAI,OAAO,KAAK,eAAe,CAAC;CACxC,QAAQ,IAAI,OAAO,KAAK,+BAA+B,KAAK,MAAM,UAAU,CAAC;CAC7E,QAAQ,IACN,OAAO,KAAK,uCAAuC,UAAU,GAAG,KAAK,MAAM,cAAc,CAC3F;CACA,QAAQ,IAAI,OAAO,KAAK,qCAAqC,CAAC;AAChE"}
1
+ {"version":3,"file":"model.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/model.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport type { CommandActionData } from \"../../../../commands/types\";\r\nimport { migrationStub, modelStub } from \"../templates/stubs\";\r\nimport { parseModulePath, singularName } from \"../utils/name-parser\";\r\nimport { componentExists, moduleExists, resolveModulePath } from \"../utils/path-resolver\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\n\r\nexport async function generateModel(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Model name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.model <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.model users/user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.model <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = singularName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n const withResource = data.options.withResource || data.options.rs;\r\n const tableName = (data.options.table as string) || name.plural.snake;\r\n\r\n // Check if model already exists\r\n const modelDir = path.join(resolveModulePath(module), \"models\", name.kebab);\r\n const modelPath = path.join(modelDir, `${name.kebab}.model.ts`);\r\n\r\n if ((await componentExists(module, `models/${name.kebab}`, `${name.kebab}.model`)) && !force) {\r\n console.log(colors.red(`Error: Model \"${name.kebab}\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureDirectoryAsync(modelDir);\r\n await ensureDirectoryAsync(path.join(modelDir, \"migrations\"));\r\n\r\n // Generate model\r\n const modelContent = modelStub(name, { tableName, withResource: !!withResource });\r\n await putFileAsync(modelPath, modelContent);\r\n\r\n // Generate index.ts\r\n const indexContent = `export * from \"./${name.kebab}.model\";\r\n`;\r\n await putFileAsync(path.join(modelDir, \"index.ts\"), indexContent);\r\n\r\n // Generate migration\r\n const timestamp = new Date().toISOString().replace(/[-:T]/g, \"_\").split(\".\")[0];\r\n const migrationPath = path.join(\r\n modelDir,\r\n \"migrations\",\r\n `${timestamp}_${name.kebab}.migration.ts`,\r\n );\r\n\r\n const migrationContent = migrationStub(name, {\r\n timestamps: data.options.timestamps !== \"false\" && data.options.timestamps !== false,\r\n });\r\n\r\n await putFileAsync(migrationPath, migrationContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Model \"${name.pascal}\" generated successfully!`));\r\n console.log(colors.gray(`\\nNext steps:`));\r\n console.log(colors.gray(` 1. Update model schema in ${name.kebab}.model.ts`));\r\n console.log(\r\n colors.gray(` 2. Update migration in migrations/${timestamp}_${name.kebab}.migration.ts`),\r\n );\r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,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,qBAAqB,QAAQ;CACnC,MAAM,qBAAqB,KAAK,KAAK,UAAU,YAAY,CAAC;CAI5D,MAAM,aAAa,WADE,UAAU,MAAM;EAAE;EAAW,cAAc,CAAC,CAAC;CAAa,CACtC,CAAC;CAG1C,MAAM,eAAe,oBAAoB,KAAK,MAAM;;CAEpD,MAAM,aAAa,KAAK,KAAK,UAAU,UAAU,GAAG,YAAY;CAGhE,MAAM,6BAAY,IAAI,KAAK,EAAC,CAAC,YAAY,CAAC,CAAC,QAAQ,UAAU,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;CAW7E,MAAM,aAVgB,KAAK,KACzB,UACA,cACA,GAAG,UAAU,GAAG,KAAK,MAAM,cAOE,GAJN,cAAc,MAAM,EAC3C,YAAY,KAAK,QAAQ,eAAe,WAAW,KAAK,QAAQ,eAAe,MACjF,CAEiD,CAAC;CAElD,QAAQ,IAAI,OAAO,KAAK,gBAAgB,KAAK,OAAO,0BAA0B,CAAC;CAC/E,QAAQ,IAAI,OAAO,KAAK,eAAe,CAAC;CACxC,QAAQ,IAAI,OAAO,KAAK,+BAA+B,KAAK,MAAM,UAAU,CAAC;CAC7E,QAAQ,IACN,OAAO,KAAK,uCAAuC,UAAU,GAAG,KAAK,MAAM,cAAc,CAC3F;CACA,QAAQ,IAAI,OAAO,KAAK,qCAAqC,CAAC;AAChE"}
@@ -5,8 +5,8 @@ import { pluralName, singularName } from "../utils/name-parser.mjs";
5
5
  import { ensureDirectoryAsync, putFileAsync, setDryRun } from "../utils/writer.mjs";
6
6
  import { moduleExists } from "../utils/path-resolver.mjs";
7
7
  import { createMigrationFile } from "./migration.generator.mjs";
8
- import { colors } from "@mongez/copper";
9
8
  import path from "node:path";
9
+ import { colors } from "@mongez/copper";
10
10
 
11
11
  //#region ../core/src/cli/commands/generate/generators/module.generator.ts
12
12
  async function generateModule(data) {
@@ -1 +1 @@
1
- {"version":3,"file":"module.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/module.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport { appPath } from \"../../../../utils\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport {\r\n crudCreateControllerStub,\r\n crudCreateSchemaStub,\r\n crudCreateServiceStub,\r\n crudDeleteControllerStub,\r\n crudDeleteServiceStub,\r\n crudGetServiceStub,\r\n crudListControllerStub,\r\n crudListServiceStub,\r\n crudModelStub,\r\n crudRepositoryStub,\r\n crudResourceStub,\r\n crudRoutesStub,\r\n crudSeedStub,\r\n crudShowControllerStub,\r\n crudUpdateControllerStub,\r\n crudUpdateSchemaStub,\r\n crudUpdateServiceStub,\r\n} from \"../templates/stubs\";\r\nimport { pluralName, singularName } from \"../utils/name-parser\";\r\nimport { moduleExists } from \"../utils/path-resolver\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { createMigrationFile } from \"./migration.generator\";\r\n\r\nexport async function generateModule(data: CommandActionData): Promise<void> {\r\n const moduleName = data.args[0];\r\n\r\n if (!moduleName) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock generate.module <name> [options]\"));\r\n console.log(colors.yellow(\"Example: warlock generate.module products\"));\r\n console.log(colors.yellow(\" warlock generate.module products --minimal\"));\r\n process.exit(1);\r\n }\r\n\r\n const name = pluralName(moduleName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Full CRUD is the default; --minimal (-m) opts down to a bare skeleton.\r\n const minimal = data.options.minimal || data.options.m;\r\n const withCrud = !minimal;\r\n\r\n // Check if module already exists\r\n if ((await moduleExists(name.kebab)) && !force) {\r\n console.log(colors.red(`Error: Module \"${name.kebab}\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n const modulePath = appPath(name.kebab);\r\n\r\n // Create module directory structure\r\n const directories = [\r\n \"controllers\",\r\n \"services\",\r\n \"models\",\r\n \"repositories\",\r\n \"schema\",\r\n \"resources\",\r\n \"events\",\r\n \"types\",\r\n \"utils\",\r\n ];\r\n\r\n for (const dir of directories) {\r\n await ensureDirectoryAsync(path.join(modulePath, dir));\r\n }\r\n\r\n // Create main.ts\r\n const mainContent = `// You may use this file as a custom entry point to be executed when the app starts.\r\n// it runs only once, and you don't need to import the routes.ts file, it will be imported automatically.\r\n// Use it to regsiter or boot up any custom logic for this module.\r\n`;\r\n await putFileAsync(path.join(modulePath, \"main.ts\"), mainContent);\r\n\r\n // Create routes.ts\r\n const routesContent = withCrud\r\n ? crudRoutesStub(name)\r\n : `import { router } from \"@warlock.js/core\";\r\nimport { guarded } from \"app/shared/utils/router\";\r\n\r\n// Define your routes here\r\n// Example:\r\n// router.get(\"/${name.kebab}\", listController);\r\n`;\r\n await putFileAsync(path.join(modulePath, \"routes.ts\"), routesContent);\r\n\r\n // Create utils/locales.ts\r\n const localesContent = `import { groupedTranslations } from \"@warlock.js/core\";\r\n\r\ngroupedTranslations(\"${name.camel}\", {\r\n // Add your translations here\r\n // Example:\r\n // welcome: {\r\n // en: \"Welcome\",\r\n // ar: \"مرحبا\",\r\n // },\r\n});\r\n`;\r\n await putFileAsync(path.join(modulePath, \"utils\", \"locales.ts\"), localesContent);\r\n\r\n // Full CRUD scaffold (the default) unless --minimal was passed\r\n if (withCrud) {\r\n const entity = singularName(moduleName);\r\n\r\n // Create controllers\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `create-${entity.kebab}.controller.ts`),\r\n crudCreateControllerStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `update-${entity.kebab}.controller.ts`),\r\n crudUpdateControllerStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `list-${name.kebab}.controller.ts`),\r\n crudListControllerStub(name),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `get-${entity.kebab}.controller.ts`),\r\n crudShowControllerStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `delete-${entity.kebab}.controller.ts`),\r\n crudDeleteControllerStub(entity),\r\n );\r\n\r\n // Create schema files — each exports both the schema value and its\r\n // inferred type; controllers import them directly (no requests/ alias).\r\n await putFileAsync(\r\n path.join(modulePath, \"schema\", `create-${entity.kebab}.schema.ts`),\r\n crudCreateSchemaStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"schema\", `update-${entity.kebab}.schema.ts`),\r\n crudUpdateSchemaStub(entity),\r\n );\r\n\r\n // Create model\r\n await ensureDirectoryAsync(path.join(modulePath, \"models\", entity.kebab));\r\n await putFileAsync(\r\n path.join(modulePath, \"models\", entity.kebab, `${entity.kebab}.model.ts`),\r\n crudModelStub(entity),\r\n );\r\n\r\n // Create model index\r\n await putFileAsync(\r\n path.join(modulePath, \"models\", entity.kebab, \"index.ts\"),\r\n `export * from \"./${entity.kebab}.model\";\\n`,\r\n );\r\n\r\n // Create migrations folder\r\n await ensureDirectoryAsync(path.join(modulePath, \"models\", entity.kebab, \"migrations\"));\r\n\r\n // Create resource\r\n await putFileAsync(\r\n path.join(modulePath, \"resources\", `${entity.kebab}.resource.ts`),\r\n crudResourceStub(name),\r\n );\r\n\r\n // Create repository\r\n await putFileAsync(\r\n path.join(modulePath, \"repositories\", `${name.kebab}.repository.ts`),\r\n crudRepositoryStub(name),\r\n );\r\n\r\n // Create services\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `create-${entity.kebab}.service.ts`),\r\n crudCreateServiceStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `update-${entity.kebab}.service.ts`),\r\n crudUpdateServiceStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `list-${name.kebab}.service.ts`),\r\n crudListServiceStub(name),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `get-${entity.kebab}.service.ts`),\r\n crudGetServiceStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `delete-${entity.kebab}.service.ts`),\r\n crudDeleteServiceStub(entity),\r\n );\r\n\r\n // Create seeds\r\n await ensureDirectoryAsync(path.join(modulePath, \"seeds\"));\r\n await putFileAsync(path.join(modulePath, \"seeds\", `${name.kebab}.seed.ts`), crudSeedStub(name));\r\n\r\n // Create migration\r\n await createMigrationFile(name.kebab, entity.kebab);\r\n }\r\n\r\n console.log(colors.cyan(`\\n✨ Module \"${name.kebab}\" generated successfully!`));\r\n\r\n if (withCrud) {\r\n console.log(colors.gray(`\\n📦 CRUD scaffold created with:`));\r\n console.log(colors.gray(` - List, Get, Create, Update & Delete controllers`));\r\n console.log(colors.gray(` - Repository`));\r\n console.log(colors.gray(` - Validation schemas in schema/`));\r\n console.log(colors.gray(` - Model with resource`));\r\n console.log(colors.gray(` - Routes configured`));\r\n console.log(colors.gray(`\\nNext steps:`));\r\n console.log(\r\n colors.gray(` 1. Update model schema in models/${name.kebab}/${name.kebab}.model.ts`),\r\n );\r\n console.log(colors.gray(` 2. Update schema rules in schema/*.schema.ts`));\r\n console.log(\r\n colors.gray(` 3. Create migration: warlock generate.model ${name.kebab}/${name.kebab}`),\r\n );\r\n } else {\r\n console.log(colors.gray(`\\nNext steps:`));\r\n console.log(colors.gray(` 1. Define routes in ${name.kebab}/routes.ts`));\r\n console.log(\r\n colors.gray(` 2. Create controllers: warlock generate.controller ${name.kebab}/<name>`),\r\n );\r\n console.log(colors.gray(` 3. Create models: warlock generate.model ${name.kebab}/<name>`));\r\n console.log(colors.gray(`\\nTip: omit --minimal to generate a full CRUD scaffold`));\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;AA4BA,eAAsB,eAAe,MAAwC;CAC3E,MAAM,aAAa,KAAK,KAAK;CAE7B,IAAI,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,OAAO,KAAK,wDAAwD,KAAK,MAAM,QAAQ,CACzF;EACA,QAAQ,IAAI,OAAO,KAAK,8CAA8C,KAAK,MAAM,QAAQ,CAAC;EAC1F,QAAQ,IAAI,OAAO,KAAK,wDAAwD,CAAC;CACnF;AACF"}
1
+ {"version":3,"file":"module.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/module.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport { appPath } from \"../../../../utils\";\r\nimport type { CommandActionData } from \"../../../../commands/types\";\r\nimport {\r\n crudCreateControllerStub,\r\n crudCreateSchemaStub,\r\n crudCreateServiceStub,\r\n crudDeleteControllerStub,\r\n crudDeleteServiceStub,\r\n crudGetServiceStub,\r\n crudListControllerStub,\r\n crudListServiceStub,\r\n crudModelStub,\r\n crudRepositoryStub,\r\n crudResourceStub,\r\n crudRoutesStub,\r\n crudSeedStub,\r\n crudShowControllerStub,\r\n crudUpdateControllerStub,\r\n crudUpdateSchemaStub,\r\n crudUpdateServiceStub,\r\n} from \"../templates/stubs\";\r\nimport { pluralName, singularName } from \"../utils/name-parser\";\r\nimport { moduleExists } from \"../utils/path-resolver\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { createMigrationFile } from \"./migration.generator\";\r\n\r\nexport async function generateModule(data: CommandActionData): Promise<void> {\r\n const moduleName = data.args[0];\r\n\r\n if (!moduleName) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock generate.module <name> [options]\"));\r\n console.log(colors.yellow(\"Example: warlock generate.module products\"));\r\n console.log(colors.yellow(\" warlock generate.module products --minimal\"));\r\n process.exit(1);\r\n }\r\n\r\n const name = pluralName(moduleName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Full CRUD is the default; --minimal (-m) opts down to a bare skeleton.\r\n const minimal = data.options.minimal || data.options.m;\r\n const withCrud = !minimal;\r\n\r\n // Check if module already exists\r\n if ((await moduleExists(name.kebab)) && !force) {\r\n console.log(colors.red(`Error: Module \"${name.kebab}\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n const modulePath = appPath(name.kebab);\r\n\r\n // Create module directory structure\r\n const directories = [\r\n \"controllers\",\r\n \"services\",\r\n \"models\",\r\n \"repositories\",\r\n \"schema\",\r\n \"resources\",\r\n \"events\",\r\n \"types\",\r\n \"utils\",\r\n ];\r\n\r\n for (const dir of directories) {\r\n await ensureDirectoryAsync(path.join(modulePath, dir));\r\n }\r\n\r\n // Create main.ts\r\n const mainContent = `// You may use this file as a custom entry point to be executed when the app starts.\r\n// it runs only once, and you don't need to import the routes.ts file, it will be imported automatically.\r\n// Use it to regsiter or boot up any custom logic for this module.\r\n`;\r\n await putFileAsync(path.join(modulePath, \"main.ts\"), mainContent);\r\n\r\n // Create routes.ts\r\n const routesContent = withCrud\r\n ? crudRoutesStub(name)\r\n : `import { router } from \"@warlock.js/core\";\r\nimport { guarded } from \"app/shared/utils/router\";\r\n\r\n// Define your routes here\r\n// Example:\r\n// router.get(\"/${name.kebab}\", listController);\r\n`;\r\n await putFileAsync(path.join(modulePath, \"routes.ts\"), routesContent);\r\n\r\n // Create utils/locales.ts\r\n const localesContent = `import { groupedTranslations } from \"@warlock.js/core\";\r\n\r\ngroupedTranslations(\"${name.camel}\", {\r\n // Add your translations here\r\n // Example:\r\n // welcome: {\r\n // en: \"Welcome\",\r\n // ar: \"مرحبا\",\r\n // },\r\n});\r\n`;\r\n await putFileAsync(path.join(modulePath, \"utils\", \"locales.ts\"), localesContent);\r\n\r\n // Full CRUD scaffold (the default) unless --minimal was passed\r\n if (withCrud) {\r\n const entity = singularName(moduleName);\r\n\r\n // Create controllers\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `create-${entity.kebab}.controller.ts`),\r\n crudCreateControllerStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `update-${entity.kebab}.controller.ts`),\r\n crudUpdateControllerStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `list-${name.kebab}.controller.ts`),\r\n crudListControllerStub(name),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `get-${entity.kebab}.controller.ts`),\r\n crudShowControllerStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `delete-${entity.kebab}.controller.ts`),\r\n crudDeleteControllerStub(entity),\r\n );\r\n\r\n // Create schema files — each exports both the schema value and its\r\n // inferred type; controllers import them directly (no requests/ alias).\r\n await putFileAsync(\r\n path.join(modulePath, \"schema\", `create-${entity.kebab}.schema.ts`),\r\n crudCreateSchemaStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"schema\", `update-${entity.kebab}.schema.ts`),\r\n crudUpdateSchemaStub(entity),\r\n );\r\n\r\n // Create model\r\n await ensureDirectoryAsync(path.join(modulePath, \"models\", entity.kebab));\r\n await putFileAsync(\r\n path.join(modulePath, \"models\", entity.kebab, `${entity.kebab}.model.ts`),\r\n crudModelStub(entity),\r\n );\r\n\r\n // Create model index\r\n await putFileAsync(\r\n path.join(modulePath, \"models\", entity.kebab, \"index.ts\"),\r\n `export * from \"./${entity.kebab}.model\";\\n`,\r\n );\r\n\r\n // Create migrations folder\r\n await ensureDirectoryAsync(path.join(modulePath, \"models\", entity.kebab, \"migrations\"));\r\n\r\n // Create resource\r\n await putFileAsync(\r\n path.join(modulePath, \"resources\", `${entity.kebab}.resource.ts`),\r\n crudResourceStub(name),\r\n );\r\n\r\n // Create repository\r\n await putFileAsync(\r\n path.join(modulePath, \"repositories\", `${name.kebab}.repository.ts`),\r\n crudRepositoryStub(name),\r\n );\r\n\r\n // Create services\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `create-${entity.kebab}.service.ts`),\r\n crudCreateServiceStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `update-${entity.kebab}.service.ts`),\r\n crudUpdateServiceStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `list-${name.kebab}.service.ts`),\r\n crudListServiceStub(name),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `get-${entity.kebab}.service.ts`),\r\n crudGetServiceStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `delete-${entity.kebab}.service.ts`),\r\n crudDeleteServiceStub(entity),\r\n );\r\n\r\n // Create seeds\r\n await ensureDirectoryAsync(path.join(modulePath, \"seeds\"));\r\n await putFileAsync(path.join(modulePath, \"seeds\", `${name.kebab}.seed.ts`), crudSeedStub(name));\r\n\r\n // Create migration\r\n await createMigrationFile(name.kebab, entity.kebab);\r\n }\r\n\r\n console.log(colors.cyan(`\\n✨ Module \"${name.kebab}\" generated successfully!`));\r\n\r\n if (withCrud) {\r\n console.log(colors.gray(`\\n📦 CRUD scaffold created with:`));\r\n console.log(colors.gray(` - List, Get, Create, Update & Delete controllers`));\r\n console.log(colors.gray(` - Repository`));\r\n console.log(colors.gray(` - Validation schemas in schema/`));\r\n console.log(colors.gray(` - Model with resource`));\r\n console.log(colors.gray(` - Routes configured`));\r\n console.log(colors.gray(`\\nNext steps:`));\r\n console.log(\r\n colors.gray(` 1. Update model schema in models/${name.kebab}/${name.kebab}.model.ts`),\r\n );\r\n console.log(colors.gray(` 2. Update schema rules in schema/*.schema.ts`));\r\n console.log(\r\n colors.gray(` 3. Create migration: warlock generate.model ${name.kebab}/${name.kebab}`),\r\n );\r\n } else {\r\n console.log(colors.gray(`\\nNext steps:`));\r\n console.log(colors.gray(` 1. Define routes in ${name.kebab}/routes.ts`));\r\n console.log(\r\n colors.gray(` 2. Create controllers: warlock generate.controller ${name.kebab}/<name>`),\r\n );\r\n console.log(colors.gray(` 3. Create models: warlock generate.model ${name.kebab}/<name>`));\r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,GAAG,KAAK,OAAO,CACzF;CACF,OAAO;EACL,QAAQ,IAAI,OAAO,KAAK,eAAe,CAAC;EACxC,QAAQ,IAAI,OAAO,KAAK,yBAAyB,KAAK,MAAM,WAAW,CAAC;EACxE,QAAQ,IACN,OAAO,KAAK,wDAAwD,KAAK,MAAM,QAAQ,CACzF;EACA,QAAQ,IAAI,OAAO,KAAK,8CAA8C,KAAK,MAAM,QAAQ,CAAC;EAC1F,QAAQ,IAAI,OAAO,KAAK,wDAAwD,CAAC;CACnF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"repository.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/repository.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { repositoryStub } from \"../templates/stubs\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\n\r\nexport async function generateRepository(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Repository name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.repository <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.repository users/user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.repository <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if repository already exists\r\n if ((await componentExists(module, \"repositories\", `${name.kebab}.repository`)) && !force) {\r\n console.log(colors.red(`Error: Repository \"${name.kebab}.repository.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"repositories\");\r\n\r\n // Generate repository\r\n const repositoryPath = resolveComponentPath(module, \"repositories\", `${name.kebab}.repository`);\r\n const repositoryContent = repositoryStub(name);\r\n\r\n await putFileAsync(repositoryPath, repositoryContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Repository \"${name.pascal}Repository\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,mBAAmB,MAAwC;CAC/E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,oCAAoC,CAAC;EAC5D,QAAQ,IAAI,OAAO,OAAO,kDAAkD,CAAC;EAC7E,QAAQ,IAAI,OAAO,OAAO,+CAA+C,CAAC;EAC1E,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,kDAAkD,CAAC;EAC7E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,IAAK,MAAM,gBAAgB,QAAQ,gBAAgB,GAAG,KAAK,MAAM,YAAY,KAAM,CAAC,OAAO;EACzF,QAAQ,IAAI,OAAO,IAAI,sBAAsB,KAAK,MAAM,+BAA+B,CAAC;EACxF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,cAAc;CAMrD,MAAM,aAHiB,qBAAqB,QAAQ,gBAAgB,GAAG,KAAK,MAAM,YAGlD,GAFN,eAAe,IAEU,CAAC;CAEpD,QAAQ,IAAI,OAAO,KAAK,qBAAqB,KAAK,OAAO,oCAAoC,CAAC;AAChG"}
1
+ {"version":3,"file":"repository.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/repository.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../../commands/types\";\r\nimport { repositoryStub } from \"../templates/stubs\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\n\r\nexport async function generateRepository(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Repository name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.repository <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.repository users/user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.repository <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if repository already exists\r\n if ((await componentExists(module, \"repositories\", `${name.kebab}.repository`)) && !force) {\r\n console.log(colors.red(`Error: Repository \"${name.kebab}.repository.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"repositories\");\r\n\r\n // Generate repository\r\n const repositoryPath = resolveComponentPath(module, \"repositories\", `${name.kebab}.repository`);\r\n const repositoryContent = repositoryStub(name);\r\n\r\n await putFileAsync(repositoryPath, repositoryContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Repository \"${name.pascal}Repository\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,mBAAmB,MAAwC;CAC/E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,oCAAoC,CAAC;EAC5D,QAAQ,IAAI,OAAO,OAAO,kDAAkD,CAAC;EAC7E,QAAQ,IAAI,OAAO,OAAO,+CAA+C,CAAC;EAC1E,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,kDAAkD,CAAC;EAC7E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,IAAK,MAAM,gBAAgB,QAAQ,gBAAgB,GAAG,KAAK,MAAM,YAAY,KAAM,CAAC,OAAO;EACzF,QAAQ,IAAI,OAAO,IAAI,sBAAsB,KAAK,MAAM,+BAA+B,CAAC;EACxF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,cAAc;CAMrD,MAAM,aAHiB,qBAAqB,QAAQ,gBAAgB,GAAG,KAAK,MAAM,YAGlD,GAFN,eAAe,IAEU,CAAC;CAEpD,QAAQ,IAAI,OAAO,KAAK,qBAAqB,KAAK,OAAO,oCAAoC,CAAC;AAChG"}
@@ -1 +1 @@
1
- {"version":3,"file":"resource.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/resource.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { resourceStub } from \"../templates/stubs\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\n\r\nexport async function generateResource(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Resource name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.resource <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.resource users/user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.resource <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if resource already exists\r\n if ((await componentExists(module, \"resources\", `${name.kebab}.resource`)) && !force) {\r\n console.log(colors.red(`Error: Resource \"${name.kebab}.resource.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"resources\");\r\n\r\n // Generate resource\r\n const resourcePath = resolveComponentPath(module, \"resources\", `${name.kebab}.resource`);\r\n const resourceContent = resourceStub(name);\r\n\r\n await putFileAsync(resourcePath, resourceContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Resource \"${name.pascal}Resource\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,iBAAiB,MAAwC;CAC7E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,kCAAkC,CAAC;EAC1D,QAAQ,IAAI,OAAO,OAAO,gDAAgD,CAAC;EAC3E,QAAQ,IAAI,OAAO,OAAO,6CAA6C,CAAC;EACxE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,gDAAgD,CAAC;EAC3E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,IAAK,MAAM,gBAAgB,QAAQ,aAAa,GAAG,KAAK,MAAM,UAAU,KAAM,CAAC,OAAO;EACpF,QAAQ,IAAI,OAAO,IAAI,oBAAoB,KAAK,MAAM,6BAA6B,CAAC;EACpF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,WAAW;CAMlD,MAAM,aAHe,qBAAqB,QAAQ,aAAa,GAAG,KAAK,MAAM,UAG/C,GAFN,aAAa,IAEU,CAAC;CAEhD,QAAQ,IAAI,OAAO,KAAK,mBAAmB,KAAK,OAAO,kCAAkC,CAAC;AAC5F"}
1
+ {"version":3,"file":"resource.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/resource.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../../commands/types\";\r\nimport { resourceStub } from \"../templates/stubs\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\n\r\nexport async function generateResource(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Resource name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.resource <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.resource users/user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.resource <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if resource already exists\r\n if ((await componentExists(module, \"resources\", `${name.kebab}.resource`)) && !force) {\r\n console.log(colors.red(`Error: Resource \"${name.kebab}.resource.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"resources\");\r\n\r\n // Generate resource\r\n const resourcePath = resolveComponentPath(module, \"resources\", `${name.kebab}.resource`);\r\n const resourceContent = resourceStub(name);\r\n\r\n await putFileAsync(resourcePath, resourceContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Resource \"${name.pascal}Resource\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,iBAAiB,MAAwC;CAC7E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,kCAAkC,CAAC;EAC1D,QAAQ,IAAI,OAAO,OAAO,gDAAgD,CAAC;EAC3E,QAAQ,IAAI,OAAO,OAAO,6CAA6C,CAAC;EACxE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,gDAAgD,CAAC;EAC3E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,IAAK,MAAM,gBAAgB,QAAQ,aAAa,GAAG,KAAK,MAAM,UAAU,KAAM,CAAC,OAAO;EACpF,QAAQ,IAAI,OAAO,IAAI,oBAAoB,KAAK,MAAM,6BAA6B,CAAC;EACpF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,WAAW;CAMlD,MAAM,aAHe,qBAAqB,QAAQ,aAAa,GAAG,KAAK,MAAM,UAG/C,GAFN,aAAa,IAEU,CAAC;CAEhD,QAAQ,IAAI,OAAO,KAAK,mBAAmB,KAAK,OAAO,kCAAkC,CAAC;AAC5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"service.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/service.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { serviceStub } from \"../templates/stubs\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\n\r\nexport async function generateService(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Service name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.service <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.service users/create-user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.service <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if service already exists\r\n if ((await componentExists(module, \"services\", `${name.kebab}.service`)) && !force) {\r\n console.log(colors.red(`Error: Service \"${name.kebab}.service.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"services\");\r\n\r\n // Generate service\r\n const servicePath = resolveComponentPath(module, \"services\", `${name.kebab}.service`);\r\n const serviceContent = serviceStub(name);\r\n\r\n await putFileAsync(servicePath, serviceContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Service \"${name.camel}\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,gBAAgB,MAAwC;CAC5E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,iCAAiC,CAAC;EACzD,QAAQ,IAAI,OAAO,OAAO,+CAA+C,CAAC;EAC1E,QAAQ,IAAI,OAAO,OAAO,mDAAmD,CAAC;EAC9E,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,+CAA+C,CAAC;EAC1E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,IAAK,MAAM,gBAAgB,QAAQ,YAAY,GAAG,KAAK,MAAM,SAAS,KAAM,CAAC,OAAO;EAClF,QAAQ,IAAI,OAAO,IAAI,mBAAmB,KAAK,MAAM,4BAA4B,CAAC;EAClF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,UAAU;CAMjD,MAAM,aAHc,qBAAqB,QAAQ,YAAY,GAAG,KAAK,MAAM,SAG9C,GAFN,YAAY,IAEU,CAAC;CAE9C,QAAQ,IAAI,OAAO,KAAK,kBAAkB,KAAK,MAAM,0BAA0B,CAAC;AAClF"}
1
+ {"version":3,"file":"service.generator.mjs","names":[],"sources":["../../../../../../../../../../core/src/cli/commands/generate/generators/service.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../../commands/types\";\r\nimport { serviceStub } from \"../templates/stubs\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\n\r\nexport async function generateService(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Service name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.service <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.service users/create-user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.service <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if service already exists\r\n if ((await componentExists(module, \"services\", `${name.kebab}.service`)) && !force) {\r\n console.log(colors.red(`Error: Service \"${name.kebab}.service.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"services\");\r\n\r\n // Generate service\r\n const servicePath = resolveComponentPath(module, \"services\", `${name.kebab}.service`);\r\n const serviceContent = serviceStub(name);\r\n\r\n await putFileAsync(servicePath, serviceContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Service \"${name.camel}\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,gBAAgB,MAAwC;CAC5E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,iCAAiC,CAAC;EACzD,QAAQ,IAAI,OAAO,OAAO,+CAA+C,CAAC;EAC1E,QAAQ,IAAI,OAAO,OAAO,mDAAmD,CAAC;EAC9E,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,+CAA+C,CAAC;EAC1E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,IAAK,MAAM,gBAAgB,QAAQ,YAAY,GAAG,KAAK,MAAM,SAAS,KAAM,CAAC,OAAO;EAClF,QAAQ,IAAI,OAAO,IAAI,mBAAmB,KAAK,MAAM,4BAA4B,CAAC;EAClF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,UAAU;CAMjD,MAAM,aAHc,qBAAqB,QAAQ,YAAY,GAAG,KAAK,MAAM,SAG9C,GAFN,YAAY,IAEU,CAAC;CAE9C,QAAQ,IAAI,OAAO,KAAK,kBAAkB,KAAK,MAAM,0BAA0B,CAAC;AAClF"}
@@ -1,8 +1,8 @@
1
1
  import { appPath } from "../../../../utils/paths.mjs";
2
2
  import "../../../../utils/index.mjs";
3
3
  import { ensureDirectoryAsync as ensureDirectoryAsync$1 } from "./writer.mjs";
4
- import { directoryExistsAsync, fileExistsAsync } from "@warlock.js/fs";
5
4
  import path from "node:path";
5
+ import { directoryExistsAsync, fileExistsAsync } from "@warlock.js/fs";
6
6
 
7
7
  //#region ../core/src/cli/commands/generate/utils/path-resolver.ts
8
8
  /**
@@ -1,6 +1,6 @@
1
+ import path from "node:path";
1
2
  import { colors } from "@mongez/copper";
2
3
  import { ensureDirectoryAsync, putFileAsync } from "@warlock.js/fs";
3
- import path from "node:path";
4
4
 
5
5
  //#region ../core/src/cli/commands/generate/utils/writer.ts
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { command } from "../cli-command.mjs";
1
+ import { command } from "../../commands/cli-command.mjs";
2
2
  import { migrateAction } from "../../database/migrate-action.mjs";
3
3
 
4
4
  //#region ../core/src/cli/commands/migrate.command.ts
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/migrate.command.ts"],"sourcesContent":["import { migrateAction } from \"../../database/migrate-action\";\nimport { command } from \"../cli-command\";\n\nexport const migrateCommand = command({\n action: migrateAction,\n name: \"migrate\",\n description: \"Run database migrations\",\n preload: {\n config: [\"database\", \"log\"],\n connectors: [\"database\", \"logger\"],\n },\n options: [\n {\n text: \"--fresh, -f\",\n description: \"Drop all tables and re-run migrations\",\n type: \"boolean\",\n },\n {\n text: \"--rollback, -r\",\n description: \"Rollback migrations, drop all tables\",\n type: \"boolean\",\n },\n {\n text: \"--path, -p\",\n description: \"Migration file path, if not provided, all migrations will be wroking\",\n type: \"string\",\n },\n {\n text: \"--list, -l\",\n description: \"Show migration state: executed migrations, then what will run next\",\n type: \"boolean\",\n },\n {\n text: \"--pending\",\n description:\n \"List only what will run next, in execution order. Exits 0 if nothing is pending, 1 if something is, 2 if it could not be determined\",\n type: \"boolean\",\n },\n {\n text: \"--all, -a\",\n description: \"List all migrations files in the app\",\n type: \"boolean\",\n },\n {\n text: \"--sql, -s\",\n description: \"Export all migrations as phase-ordered SQL files instead of executing them\",\n type: \"boolean\",\n },\n {\n text: \"--pending-only\",\n description: \"When used with --sql, exports only pending migrations instead of all\",\n type: \"boolean\",\n },\n {\n text: \"--compact, -c\",\n description:\n \"When used with --sql, strips out generated comments and blank lines to reduce file size\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;AAGA,MAAa,iBAAiB,QAAQ;CACpC,QAAQ;CACR,MAAM;CACN,aAAa;CACb,SAAS;EACP,QAAQ,CAAC,YAAY,KAAK;EAC1B,YAAY,CAAC,YAAY,QAAQ;CACnC;CACA,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"migrate.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/migrate.command.ts"],"sourcesContent":["import { migrateAction } from \"../../database/migrate-action\";\r\nimport { command } from \"../../commands/cli-command\";\r\n\r\nexport const migrateCommand = command({\r\n action: migrateAction,\r\n name: \"migrate\",\r\n description: \"Run database migrations\",\r\n preload: {\r\n config: [\"database\", \"log\"],\r\n connectors: [\"database\", \"logger\"],\r\n },\r\n options: [\r\n {\r\n text: \"--fresh, -f\",\r\n description: \"Drop all tables and re-run migrations\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--rollback, -r\",\r\n description: \"Rollback migrations, drop all tables\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--path, -p\",\r\n description: \"Migration file path, if not provided, all migrations will be wroking\",\r\n type: \"string\",\r\n },\r\n {\r\n text: \"--list, -l\",\r\n description: \"Show migration state: executed migrations, then what will run next\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--pending\",\r\n description:\r\n \"List only what will run next, in execution order. Exits 0 if nothing is pending, 1 if something is, 2 if it could not be determined\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--all, -a\",\r\n description: \"List all migrations files in the app\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--sql, -s\",\r\n description: \"Export all migrations as phase-ordered SQL files instead of executing them\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--pending-only\",\r\n description: \"When used with --sql, exports only pending migrations instead of all\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--compact, -c\",\r\n description:\r\n \"When used with --sql, strips out generated comments and blank lines to reduce file size\",\r\n type: \"boolean\",\r\n },\r\n ],\r\n});\r\n"],"mappings":";;;;AAGA,MAAa,iBAAiB,QAAQ;CACpC,QAAQ;CACR,MAAM;CACN,aAAa;CACb,SAAS;EACP,QAAQ,CAAC,YAAY,KAAK;EAC1B,YAAY,CAAC,YAAY,QAAQ;CACnC;CACA,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"routes-command.action.mjs","names":[],"sources":["../../../../../../../../../core/src/cli/commands/routes/routes-command.action.ts"],"sourcesContent":["import { router } from \"../../../router/router\";\nimport type { CommandActionData } from \"../../types\";\nimport { printRoutesTable } from \"./format-routes-table\";\nimport { filterRouteRows, sortRouteRows, toRouteRow } from \"./route-row\";\n\n/**\n * Read the active option as a trimmed string, or `undefined` when it is absent\n * or not a string (a bare boolean flag).\n *\n * @param value - The parsed option value\n * @returns The string value, or `undefined`\n */\nfunction stringOption(value: string | number | boolean | undefined): string | undefined {\n return typeof value === \"string\" && value.trim().length > 0 ? value.trim() : undefined;\n}\n\n/**\n * Action behind `warlock routes`. Reads the registered routes from the router\n * singleton (populated by the `bootstrap` preload, with no connectors started),\n * applies the `--method` / `--path` / `--name` filters, sorts them, and either\n * prints a verb-colored table or — with `--json` — emits the normalized rows as\n * JSON for piping into scripts/CI.\n *\n * Read-only: it never opens a database/cache/socket connection and never\n * mutates the router.\n *\n * @param data - Parsed CLI args (`options.method` / `path` / `name` / `json`).\n */\nexport function routesCommandAction({ options }: CommandActionData): void {\n const rows = sortRouteRows(\n filterRouteRows(router.list().map(toRouteRow), {\n method: stringOption(options.method),\n path: stringOption(options.path),\n name: stringOption(options.name),\n }),\n );\n\n if (options.json) {\n console.log(JSON.stringify(rows, null, 2));\n return;\n }\n\n printRoutesTable(rows);\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAS,aAAa,OAAkE;CACtF,OAAO,OAAO,UAAU,YAAY,MAAM,KAAK,CAAC,CAAC,SAAS,IAAI,MAAM,KAAK,IAAI;AAC/E;;;;;;;;;;;;;AAcA,SAAgB,oBAAoB,EAAE,WAAoC;CACxE,MAAM,OAAO,cACX,gBAAgB,OAAO,KAAK,CAAC,CAAC,IAAI,UAAU,GAAG;EAC7C,QAAQ,aAAa,QAAQ,MAAM;EACnC,MAAM,aAAa,QAAQ,IAAI;EAC/B,MAAM,aAAa,QAAQ,IAAI;CACjC,CAAC,CACH;CAEA,IAAI,QAAQ,MAAM;EAChB,QAAQ,IAAI,KAAK,UAAU,MAAM,MAAM,CAAC,CAAC;EACzC;CACF;CAEA,iBAAiB,IAAI;AACvB"}
1
+ {"version":3,"file":"routes-command.action.mjs","names":[],"sources":["../../../../../../../../../core/src/cli/commands/routes/routes-command.action.ts"],"sourcesContent":["import { router } from \"../../../router/router\";\r\nimport type { CommandActionData } from \"../../../commands/types\";\r\nimport { printRoutesTable } from \"./format-routes-table\";\r\nimport { filterRouteRows, sortRouteRows, toRouteRow } from \"./route-row\";\r\n\r\n/**\r\n * Read the active option as a trimmed string, or `undefined` when it is absent\r\n * or not a string (a bare boolean flag).\r\n *\r\n * @param value - The parsed option value\r\n * @returns The string value, or `undefined`\r\n */\r\nfunction stringOption(value: string | number | boolean | undefined): string | undefined {\r\n return typeof value === \"string\" && value.trim().length > 0 ? value.trim() : undefined;\r\n}\r\n\r\n/**\r\n * Action behind `warlock routes`. Reads the registered routes from the router\r\n * singleton (populated by the `bootstrap` preload, with no connectors started),\r\n * applies the `--method` / `--path` / `--name` filters, sorts them, and either\r\n * prints a verb-colored table or — with `--json` — emits the normalized rows as\r\n * JSON for piping into scripts/CI.\r\n *\r\n * Read-only: it never opens a database/cache/socket connection and never\r\n * mutates the router.\r\n *\r\n * @param data - Parsed CLI args (`options.method` / `path` / `name` / `json`).\r\n */\r\nexport function routesCommandAction({ options }: CommandActionData): void {\r\n const rows = sortRouteRows(\r\n filterRouteRows(router.list().map(toRouteRow), {\r\n method: stringOption(options.method),\r\n path: stringOption(options.path),\r\n name: stringOption(options.name),\r\n }),\r\n );\r\n\r\n if (options.json) {\r\n console.log(JSON.stringify(rows, null, 2));\r\n return;\r\n }\r\n\r\n printRoutesTable(rows);\r\n}\r\n"],"mappings":";;;;;;;;;;;;AAYA,SAAS,aAAa,OAAkE;CACtF,OAAO,OAAO,UAAU,YAAY,MAAM,KAAK,CAAC,CAAC,SAAS,IAAI,MAAM,KAAK,IAAI;AAC/E;;;;;;;;;;;;;AAcA,SAAgB,oBAAoB,EAAE,WAAoC;CACxE,MAAM,OAAO,cACX,gBAAgB,OAAO,KAAK,CAAC,CAAC,IAAI,UAAU,GAAG;EAC7C,QAAQ,aAAa,QAAQ,MAAM;EACnC,MAAM,aAAa,QAAQ,IAAI;EAC/B,MAAM,aAAa,QAAQ,IAAI;CACjC,CAAC,CACH;CAEA,IAAI,QAAQ,MAAM;EAChB,QAAQ,IAAI,KAAK,UAAU,MAAM,MAAM,CAAC,CAAC;EACzC;CACF;CAEA,iBAAiB,IAAI;AACvB"}
@@ -1,4 +1,4 @@
1
- import { command } from "../cli-command.mjs";
1
+ import { command } from "../../commands/cli-command.mjs";
2
2
  import { routesCommandAction } from "./routes/routes-command.action.mjs";
3
3
 
4
4
  //#region ../core/src/cli/commands/routes.command.ts
@@ -1 +1 @@
1
- {"version":3,"file":"routes.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/routes.command.ts"],"sourcesContent":["import { command } from \"../cli-command\";\nimport { routesCommandAction } from \"./routes/routes-command.action\";\n\n/**\n * `warlock routes` — list every registered HTTP route as a table (a read-only\n * sibling of `warlock doctor`). Filter with `--method` / `--path` / `--name`,\n * or emit the normalized rows as JSON with `--json`.\n *\n * Preload plan: load config + bootstrap app code so route modules register on\n * the router singleton, but start NO connectors — listing routes must never\n * open a database/cache/socket connection. Because the route-module loader is\n * fail-loud, a route file that throws on import surfaces here instead of being\n * silently omitted from the table.\n */\nexport const routesCommand = command({\n name: \"routes\",\n description:\n \"List the registered HTTP routes as a table (read-only); filter with --method / --path / --name, or emit JSON with --json\",\n action: routesCommandAction,\n preload: {\n config: true,\n env: true,\n bootstrap: true,\n },\n options: [\n {\n text: \"--method, -m\",\n description: \"Filter by HTTP method (case-insensitive, e.g. GET, POST)\",\n type: \"string\",\n },\n {\n text: \"--path, -p\",\n description: \"Filter by a case-insensitive path substring\",\n type: \"string\",\n },\n {\n text: \"--name, -n\",\n description: \"Filter by a case-insensitive route-name substring\",\n type: \"string\",\n },\n {\n text: \"--json, -j\",\n description: \"Output the routes as JSON instead of a table\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,aACE;CACF,QAAQ;CACR,SAAS;EACP,QAAQ;EACR,KAAK;EACL,WAAW;CACb;CACA,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"routes.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/routes.command.ts"],"sourcesContent":["import { command } from \"../../commands/cli-command\";\r\nimport { routesCommandAction } from \"./routes/routes-command.action\";\r\n\r\n/**\r\n * `warlock routes` — list every registered HTTP route as a table (a read-only\r\n * sibling of `warlock doctor`). Filter with `--method` / `--path` / `--name`,\r\n * or emit the normalized rows as JSON with `--json`.\r\n *\r\n * Preload plan: load config + bootstrap app code so route modules register on\r\n * the router singleton, but start NO connectors — listing routes must never\r\n * open a database/cache/socket connection. Because the route-module loader is\r\n * fail-loud, a route file that throws on import surfaces here instead of being\r\n * silently omitted from the table.\r\n */\r\nexport const routesCommand = command({\r\n name: \"routes\",\r\n description:\r\n \"List the registered HTTP routes as a table (read-only); filter with --method / --path / --name, or emit JSON with --json\",\r\n action: routesCommandAction,\r\n preload: {\r\n config: true,\r\n env: true,\r\n bootstrap: true,\r\n },\r\n options: [\r\n {\r\n text: \"--method, -m\",\r\n description: \"Filter by HTTP method (case-insensitive, e.g. GET, POST)\",\r\n type: \"string\",\r\n },\r\n {\r\n text: \"--path, -p\",\r\n description: \"Filter by a case-insensitive path substring\",\r\n type: \"string\",\r\n },\r\n {\r\n text: \"--name, -n\",\r\n description: \"Filter by a case-insensitive route-name substring\",\r\n type: \"string\",\r\n },\r\n {\r\n text: \"--json, -j\",\r\n description: \"Output the routes as JSON instead of a table\",\r\n type: \"boolean\",\r\n },\r\n ],\r\n});\r\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,aACE;CACF,QAAQ;CACR,SAAS;EACP,QAAQ;EACR,KAAK;EACL,WAAW;CACb;CACA,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;CACF;AACF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { command } from "../cli-command.mjs";
1
+ import { command } from "../../commands/cli-command.mjs";
2
2
  import { seedCommandAction } from "../../database/seed-command-action.mjs";
3
3
 
4
4
  //#region ../core/src/cli/commands/seed.command.ts
@@ -1 +1 @@
1
- {"version":3,"file":"seed.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/seed.command.ts"],"sourcesContent":["import { seedCommandAction } from \"../../database/seed-command-action\";\nimport { command } from \"../cli-command\";\n\nexport const seedCommand = command({\n action: seedCommandAction,\n name: \"seed\",\n description: \"Run database seeds\",\n preload: {\n config: true,\n env: true,\n bootstrap: true,\n connectors: [\"database\", \"cache\", \"logger\"],\n },\n options: [\n {\n text: \"--fresh, -f\",\n description: \"Drop all tables records and run seeds\",\n type: \"boolean\",\n },\n {\n text: \"--list, -l\",\n description: \"Display the seeds list in order without execution\",\n type: \"boolean\",\n },\n {\n text: \"--transaction, -t\",\n description: \"Run seeds in a transaction\",\n type: \"boolean\",\n defaultValue: true,\n },\n {\n text: \"--drop, -d\",\n description:\n 'Undo seeded data — delete tracked records (reverse order) and reset the seed log; scope to one seeder with --drop=\"Seed Name\"',\n type: \"string\",\n },\n ],\n});\n"],"mappings":";;;;AAGA,MAAa,cAAc,QAAQ;CACjC,QAAQ;CACR,MAAM;CACN,aAAa;CACb,SAAS;EACP,QAAQ;EACR,KAAK;EACL,WAAW;EACX,YAAY;GAAC;GAAY;GAAS;EAAQ;CAC5C;CACA,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;GACN,cAAc;EAChB;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"seed.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/seed.command.ts"],"sourcesContent":["import { seedCommandAction } from \"../../database/seed-command-action\";\r\nimport { command } from \"../../commands/cli-command\";\r\n\r\nexport const seedCommand = command({\r\n action: seedCommandAction,\r\n name: \"seed\",\r\n description: \"Run database seeds\",\r\n preload: {\r\n config: true,\r\n env: true,\r\n bootstrap: true,\r\n connectors: [\"database\", \"cache\", \"logger\"],\r\n },\r\n options: [\r\n {\r\n text: \"--fresh, -f\",\r\n description: \"Drop all tables records and run seeds\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--list, -l\",\r\n description: \"Display the seeds list in order without execution\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--transaction, -t\",\r\n description: \"Run seeds in a transaction\",\r\n type: \"boolean\",\r\n defaultValue: true,\r\n },\r\n {\r\n text: \"--drop, -d\",\r\n description:\r\n 'Undo seeded data — delete tracked records (reverse order) and reset the seed log; scope to one seeder with --drop=\"Seed Name\"',\r\n type: \"string\",\r\n },\r\n ],\r\n});\r\n"],"mappings":";;;;AAGA,MAAa,cAAc,QAAQ;CACjC,QAAQ;CACR,MAAM;CACN,aAAa;CACb,SAAS;EACP,QAAQ;EACR,KAAK;EACL,WAAW;EACX,YAAY;GAAC;GAAY;GAAS;EAAQ;CAC5C;CACA,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;GACN,cAAc;EAChB;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;AACF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { command } from "../cli-command.mjs";
1
+ import { command } from "../../commands/cli-command.mjs";
2
2
  import { resolveBuildConfig } from "../../production/resolve-build-config.mjs";
3
3
  import { superviseProductionProcess } from "../../production/production-supervisor.mjs";
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"start-production.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/start-production.command.ts"],"sourcesContent":["import { superviseProductionProcess } from \"../../production/production-supervisor\";\nimport { resolveBuildConfig } from \"../../production/resolve-build-config\";\nimport { command } from \"../cli-command\";\n\nexport const startProductionCommand = command({\n name: \"start\",\n description: \"Start production server\",\n persistent: true,\n preload: {\n warlockConfig: true,\n },\n action: async () => {\n const { entryPath, sourcemap } = resolveBuildConfig();\n\n // Build node args\n const nodeArgs: string[] = [];\n\n // Enable source maps if configured\n if (sourcemap !== false) {\n nodeArgs.push(\"--enable-source-maps\");\n }\n\n // Add entry file\n nodeArgs.push(entryPath);\n\n // Pass through any additional flags after \"start\" command\n // process.argv = [node, cli.ts, start, ...extra]\n const startIndex = process.argv.findIndex((arg) => arg === \"start\");\n if (startIndex !== -1 && startIndex < process.argv.length - 1) {\n const extraArgs = process.argv.slice(startIndex + 1);\n nodeArgs.push(...extraArgs);\n }\n\n // Progress goes to stderr, never stdout. Stdout carries exactly one claim —\n // \"started\" — so that whatever greps it cannot mistake an intention for an\n // outcome. The banner that used to print here, in `preAction`, printed\n // before the child had even been spawned.\n console.error(`🚀 Starting production server...\\n`);\n\n const { exitCode } = await superviseProductionProcess({ nodeArgs });\n\n process.exit(exitCode);\n },\n});\n"],"mappings":";;;;;AAIA,MAAa,yBAAyB,QAAQ;CAC5C,MAAM;CACN,aAAa;CACb,YAAY;CACZ,SAAS,EACP,eAAe,KACjB;CACA,QAAQ,YAAY;EAClB,MAAM,EAAE,WAAW,cAAc,mBAAmB;EAGpD,MAAM,WAAqB,CAAC;EAG5B,IAAI,cAAc,OAChB,SAAS,KAAK,sBAAsB;EAItC,SAAS,KAAK,SAAS;EAIvB,MAAM,aAAa,QAAQ,KAAK,WAAW,QAAQ,QAAQ,OAAO;EAClE,IAAI,eAAe,MAAM,aAAa,QAAQ,KAAK,SAAS,GAAG;GAC7D,MAAM,YAAY,QAAQ,KAAK,MAAM,aAAa,CAAC;GACnD,SAAS,KAAK,GAAG,SAAS;EAC5B;EAMA,QAAQ,MAAM,oCAAoC;EAElD,MAAM,EAAE,aAAa,MAAM,2BAA2B,EAAE,SAAS,CAAC;EAElE,QAAQ,KAAK,QAAQ;CACvB;AACF,CAAC"}
1
+ {"version":3,"file":"start-production.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/start-production.command.ts"],"sourcesContent":["import { superviseProductionProcess } from \"../../production/production-supervisor\";\r\nimport { resolveBuildConfig } from \"../../production/resolve-build-config\";\r\nimport { command } from \"../../commands/cli-command\";\r\n\r\nexport const startProductionCommand = command({\r\n name: \"start\",\r\n description: \"Start production server\",\r\n persistent: true,\r\n preload: {\r\n warlockConfig: true,\r\n },\r\n action: async () => {\r\n const { entryPath, sourcemap } = resolveBuildConfig();\r\n\r\n // Build node args\r\n const nodeArgs: string[] = [];\r\n\r\n // Enable source maps if configured\r\n if (sourcemap !== false) {\r\n nodeArgs.push(\"--enable-source-maps\");\r\n }\r\n\r\n // Add entry file\r\n nodeArgs.push(entryPath);\r\n\r\n // Pass through any additional flags after \"start\" command\r\n // process.argv = [node, cli.ts, start, ...extra]\r\n const startIndex = process.argv.findIndex((arg) => arg === \"start\");\r\n if (startIndex !== -1 && startIndex < process.argv.length - 1) {\r\n const extraArgs = process.argv.slice(startIndex + 1);\r\n nodeArgs.push(...extraArgs);\r\n }\r\n\r\n // Progress goes to stderr, never stdout. Stdout carries exactly one claim —\r\n // \"started\" — so that whatever greps it cannot mistake an intention for an\r\n // outcome. The banner that used to print here, in `preAction`, printed\r\n // before the child had even been spawned.\r\n console.error(`🚀 Starting production server...\\n`);\r\n\r\n const { exitCode } = await superviseProductionProcess({ nodeArgs });\r\n\r\n process.exit(exitCode);\r\n },\r\n});\r\n"],"mappings":";;;;;AAIA,MAAa,yBAAyB,QAAQ;CAC5C,MAAM;CACN,aAAa;CACb,YAAY;CACZ,SAAS,EACP,eAAe,KACjB;CACA,QAAQ,YAAY;EAClB,MAAM,EAAE,WAAW,cAAc,mBAAmB;EAGpD,MAAM,WAAqB,CAAC;EAG5B,IAAI,cAAc,OAChB,SAAS,KAAK,sBAAsB;EAItC,SAAS,KAAK,SAAS;EAIvB,MAAM,aAAa,QAAQ,KAAK,WAAW,QAAQ,QAAQ,OAAO;EAClE,IAAI,eAAe,MAAM,aAAa,QAAQ,KAAK,SAAS,GAAG;GAC7D,MAAM,YAAY,QAAQ,KAAK,MAAM,aAAa,CAAC;GACnD,SAAS,KAAK,GAAG,SAAS;EAC5B;EAMA,QAAQ,MAAM,oCAAoC;EAElD,MAAM,EAAE,aAAa,MAAM,2BAA2B,EAAE,SAAS,CAAC;EAElE,QAAQ,KAAK,QAAQ;CACvB;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"storage-put.action.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/storage-put.action.ts"],"sourcesContent":["import fs from \"fs/promises\";\nimport path from \"path\";\nimport { config } from \"../../config\";\nimport { storage } from \"../../storage\";\nimport type { CommandActionData } from \"../types\";\n\n/**\n * Action for `warlock storage.put <localPath> [destination] [--driver <name>] [--concurrency <n>]`\n *\n * Uploads a local file or directory into any configured storage driver.\n * Auto-detects whether <localPath> is a file or directory and calls the\n * appropriate storage method.\n *\n * @example\n * # Upload entire uploads directory to R2 (root of bucket)\n * warlock storage.put ./uploads --driver r2\n *\n * @example\n * # Upload to a specific destination prefix\n * warlock storage.put ./uploads backups/2026 --driver r2\n *\n * @example\n * # Single file upload with custom concurrency\n * warlock storage.put ./public/logo.png assets/logo.png --driver s3\n */\nexport async function storagePutAction({ args, options }: CommandActionData): Promise<void> {\n const [localPath, destination = \"\"] = args;\n\n if (!localPath) {\n console.error(\"✖ Missing required argument: <localPath>\");\n console.error(\" Usage: warlock storage.put <localPath> [destination] [--driver <name>]\");\n process.exit(1);\n }\n\n // Resolve to absolute path relative to CWD\n const absolutePath = path.resolve(process.cwd(), localPath);\n const driverName = options.driver as string | undefined;\n const concurrency = options.concurrency ? Number(options.concurrency) : 5;\n\n // Verify the local path exists\n let stat: Awaited<ReturnType<typeof fs.stat>>;\n try {\n stat = await fs.stat(absolutePath);\n } catch {\n console.error(`✖ Path not found: ${absolutePath}`);\n process.exit(1);\n }\n\n // Select the driver — use named driver or fall back to default\n const store = driverName ? storage.use(driverName) : storage;\n const driverLabel = driverName ?? config.get(\"storage.default\");\n\n console.log(`\\n Driver : ${driverLabel}`);\n console.log(` Source : ${absolutePath}`);\n console.log(` Dest : ${destination || \"(root)\"}\\n`);\n\n if (stat.isDirectory()) {\n // ── Directory upload ────────────────────────────────────────────────────\n const result = await store.putDirectory(absolutePath, destination, {\n concurrency,\n // Skip hidden files (e.g. .DS_Store) by default\n filter: (_, rel) => !path.basename(rel).startsWith(\".\"),\n onProgress: (done, total, file) => {\n process.stdout.write(`\\r Progress : ${done}/${total} ${file.path}`);\n },\n });\n\n // Clear the progress line and print summary\n process.stdout.write(\"\\n\");\n console.log(`\\n ✔ ${result.uploaded.length} file(s) uploaded`);\n\n if (result.failed.length > 0) {\n console.warn(`\\n ⚠ ${result.failed.length} file(s) failed:`);\n for (const { localPath: fp, error } of result.failed) {\n console.warn(` - ${fp}: ${error.message}`);\n }\n }\n } else {\n // ── Single file upload ──────────────────────────────────────────────────\n // Destination is used as the storage path; if empty, fall back to filename\n const storagePath = destination || path.basename(absolutePath);\n\n console.log(` Uploading : ${path.basename(absolutePath)} → ${storagePath}`);\n\n const file = await store.put(absolutePath, storagePath);\n\n console.log(`\\n ✔ Uploaded: ${file.url}`);\n }\n\n console.log();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,eAAsB,iBAAiB,EAAE,MAAM,WAA6C;CAC1F,MAAM,CAAC,WAAW,cAAc,MAAM;CAEtC,IAAI,CAAC,WAAW;EACd,QAAQ,MAAM,2CAA2C;EACzD,QAAQ,MAAM,2EAA2E;EACzF,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,eAAe,KAAK,QAAQ,QAAQ,IAAI,GAAG,SAAS;CAC1D,MAAM,aAAa,QAAQ;CAC3B,MAAM,cAAc,QAAQ,cAAc,OAAO,QAAQ,WAAW,IAAI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":["import fs from \"fs/promises\";\r\nimport path from \"path\";\r\nimport { config } from \"../../config\";\r\nimport { storage } from \"../../storage\";\r\nimport type { CommandActionData } from \"../../commands/types\";\r\n\r\n/**\r\n * Action for `warlock storage.put <localPath> [destination] [--driver <name>] [--concurrency <n>]`\r\n *\r\n * Uploads a local file or directory into any configured storage driver.\r\n * Auto-detects whether <localPath> is a file or directory and calls the\r\n * appropriate storage method.\r\n *\r\n * @example\r\n * # Upload entire uploads directory to R2 (root of bucket)\r\n * warlock storage.put ./uploads --driver r2\r\n *\r\n * @example\r\n * # Upload to a specific destination prefix\r\n * warlock storage.put ./uploads backups/2026 --driver r2\r\n *\r\n * @example\r\n * # Single file upload with custom concurrency\r\n * warlock storage.put ./public/logo.png assets/logo.png --driver s3\r\n */\r\nexport async function storagePutAction({ args, options }: CommandActionData): Promise<void> {\r\n const [localPath, destination = \"\"] = args;\r\n\r\n if (!localPath) {\r\n console.error(\"✖ Missing required argument: <localPath>\");\r\n console.error(\" Usage: warlock storage.put <localPath> [destination] [--driver <name>]\");\r\n process.exit(1);\r\n }\r\n\r\n // Resolve to absolute path relative to CWD\r\n const absolutePath = path.resolve(process.cwd(), localPath);\r\n const driverName = options.driver as string | undefined;\r\n const concurrency = options.concurrency ? Number(options.concurrency) : 5;\r\n\r\n // Verify the local path exists\r\n let stat: Awaited<ReturnType<typeof fs.stat>>;\r\n try {\r\n stat = await fs.stat(absolutePath);\r\n } catch {\r\n console.error(`✖ Path not found: ${absolutePath}`);\r\n process.exit(1);\r\n }\r\n\r\n // Select the driver — use named driver or fall back to default\r\n const store = driverName ? storage.use(driverName) : storage;\r\n const driverLabel = driverName ?? config.get(\"storage.default\");\r\n\r\n console.log(`\\n Driver : ${driverLabel}`);\r\n console.log(` Source : ${absolutePath}`);\r\n console.log(` Dest : ${destination || \"(root)\"}\\n`);\r\n\r\n if (stat.isDirectory()) {\r\n // ── Directory upload ────────────────────────────────────────────────────\r\n const result = await store.putDirectory(absolutePath, destination, {\r\n concurrency,\r\n // Skip hidden files (e.g. .DS_Store) by default\r\n filter: (_, rel) => !path.basename(rel).startsWith(\".\"),\r\n onProgress: (done, total, file) => {\r\n process.stdout.write(`\\r Progress : ${done}/${total} ${file.path}`);\r\n },\r\n });\r\n\r\n // Clear the progress line and print summary\r\n process.stdout.write(\"\\n\");\r\n console.log(`\\n ✔ ${result.uploaded.length} file(s) uploaded`);\r\n\r\n if (result.failed.length > 0) {\r\n console.warn(`\\n ⚠ ${result.failed.length} file(s) failed:`);\r\n for (const { localPath: fp, error } of result.failed) {\r\n console.warn(` - ${fp}: ${error.message}`);\r\n }\r\n }\r\n } else {\r\n // ── Single file upload ──────────────────────────────────────────────────\r\n // Destination is used as the storage path; if empty, fall back to filename\r\n const storagePath = destination || path.basename(absolutePath);\r\n\r\n console.log(` Uploading : ${path.basename(absolutePath)} → ${storagePath}`);\r\n\r\n const file = await store.put(absolutePath, storagePath);\r\n\r\n console.log(`\\n ✔ Uploaded: ${file.url}`);\r\n }\r\n\r\n console.log();\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,eAAsB,iBAAiB,EAAE,MAAM,WAA6C;CAC1F,MAAM,CAAC,WAAW,cAAc,MAAM;CAEtC,IAAI,CAAC,WAAW;EACd,QAAQ,MAAM,2CAA2C;EACzD,QAAQ,MAAM,2EAA2E;EACzF,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,eAAe,KAAK,QAAQ,QAAQ,IAAI,GAAG,SAAS;CAC1D,MAAM,aAAa,QAAQ;CAC3B,MAAM,cAAc,QAAQ,cAAc,OAAO,QAAQ,WAAW,IAAI;CAGxE,IAAI;CACJ,IAAI;EACF,OAAO,MAAM,GAAG,KAAK,YAAY;CACnC,QAAQ;EACN,QAAQ,MAAM,sBAAsB,cAAc;EAClD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,QAAQ,aAAa,QAAQ,IAAI,UAAU,IAAI;CACrD,MAAM,cAAc,cAAc,OAAO,IAAI,iBAAiB;CAE9D,QAAQ,IAAI,mBAAmB,aAAa;CAC5C,QAAQ,IAAI,iBAAiB,cAAc;CAC3C,QAAQ,IAAI,iBAAiB,eAAe,SAAS,GAAG;CAExD,IAAI,KAAK,YAAY,GAAG;EAEtB,MAAM,SAAS,MAAM,MAAM,aAAa,cAAc,aAAa;GACjE;GAEA,SAAS,GAAG,QAAQ,CAAC,KAAK,SAAS,GAAG,CAAC,CAAC,WAAW,GAAG;GACtD,aAAa,MAAM,OAAO,SAAS;IACjC,QAAQ,OAAO,MAAM,mBAAmB,KAAK,GAAG,MAAM,IAAI,KAAK,MAAM;GACvE;EACF,CAAC;EAGD,QAAQ,OAAO,MAAM,IAAI;EACzB,QAAQ,IAAI,UAAU,OAAO,SAAS,OAAO,kBAAkB;EAE/D,IAAI,OAAO,OAAO,SAAS,GAAG;GAC5B,QAAQ,KAAK,UAAU,OAAO,OAAO,OAAO,iBAAiB;GAC7D,KAAK,MAAM,EAAE,WAAW,IAAI,WAAW,OAAO,QAC5C,QAAQ,KAAK,UAAU,GAAG,IAAI,MAAM,SAAS;EAEjD;CACF,OAAO;EAGL,MAAM,cAAc,eAAe,KAAK,SAAS,YAAY;EAE7D,QAAQ,IAAI,iBAAiB,KAAK,SAAS,YAAY,EAAE,KAAK,aAAa;EAE3E,MAAM,OAAO,MAAM,MAAM,IAAI,cAAc,WAAW;EAEtD,QAAQ,IAAI,oBAAoB,KAAK,KAAK;CAC5C;CAEA,QAAQ,IAAI;AACd"}
@@ -1,4 +1,4 @@
1
- import { command } from "../cli-command.mjs";
1
+ import { command } from "../../commands/cli-command.mjs";
2
2
  import { storagePutAction } from "./storage-put.action.mjs";
3
3
 
4
4
  //#region ../core/src/cli/commands/storage-put.command.ts
@@ -1 +1 @@
1
- {"version":3,"file":"storage-put.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/storage-put.command.ts"],"sourcesContent":["import { command } from \"../cli-command\";\nimport { storagePutAction } from \"./storage-put.action\";\n\n/**\n * `storage.put` CLI command\n *\n * Uploads a local file or directory to any configured storage driver.\n * Auto-detects file vs directory and streams each file (no full buffer in memory).\n *\n * @example\n * # Upload full uploads/ directory to R2 (migrating from local to cloud)\n * warlock storage.put ./uploads --driver r2\n *\n * @example\n * # Upload under a specific prefix\n * warlock storage.put ./uploads backups/2026 --driver r2\n *\n * @example\n * # Single file upload to default driver\n * warlock storage.put ./public/logo.png assets/logo.png\n */\nexport const storagePutCommand = command({\n name: \"storage.put <localPath> [destination]\",\n alias: \"sput\",\n action: storagePutAction,\n description: \"Upload a local file or directory to storage\",\n preload: {\n env: true,\n config: [\"storage\"],\n connectors: [\"storage\"],\n },\n options: [\n {\n text: \"--driver, -d\",\n description:\n \"Storage driver name (as defined in config). Defaults to the configured default driver.\",\n },\n {\n text: \"--concurrency, -c\",\n description: \"Number of concurrent uploads when uploading a directory\",\n type: \"number\",\n defaultValue: 5,\n },\n ],\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,oBAAoB,QAAQ;CACvC,MAAM;CACN,OAAO;CACP,QAAQ;CACR,aAAa;CACb,SAAS;EACP,KAAK;EACL,QAAQ,CAAC,SAAS;EAClB,YAAY,CAAC,SAAS;CACxB;CACA,SAAS,CACP;EACE,MAAM;EACN,aACE;CACJ,GACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;EACN,cAAc;CAChB,CACF;AACF,CAAC"}
1
+ {"version":3,"file":"storage-put.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/storage-put.command.ts"],"sourcesContent":["import { command } from \"../../commands/cli-command\";\r\nimport { storagePutAction } from \"./storage-put.action\";\r\n\r\n/**\r\n * `storage.put` CLI command\r\n *\r\n * Uploads a local file or directory to any configured storage driver.\r\n * Auto-detects file vs directory and streams each file (no full buffer in memory).\r\n *\r\n * @example\r\n * # Upload full uploads/ directory to R2 (migrating from local to cloud)\r\n * warlock storage.put ./uploads --driver r2\r\n *\r\n * @example\r\n * # Upload under a specific prefix\r\n * warlock storage.put ./uploads backups/2026 --driver r2\r\n *\r\n * @example\r\n * # Single file upload to default driver\r\n * warlock storage.put ./public/logo.png assets/logo.png\r\n */\r\nexport const storagePutCommand = command({\r\n name: \"storage.put <localPath> [destination]\",\r\n alias: \"sput\",\r\n action: storagePutAction,\r\n description: \"Upload a local file or directory to storage\",\r\n preload: {\r\n env: true,\r\n config: [\"storage\"],\r\n connectors: [\"storage\"],\r\n },\r\n options: [\r\n {\r\n text: \"--driver, -d\",\r\n description:\r\n \"Storage driver name (as defined in config). Defaults to the configured default driver.\",\r\n },\r\n {\r\n text: \"--concurrency, -c\",\r\n description: \"Number of concurrent uploads when uploading a directory\",\r\n type: \"number\",\r\n defaultValue: 5,\r\n },\r\n ],\r\n});\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,oBAAoB,QAAQ;CACvC,MAAM;CACN,OAAO;CACP,QAAQ;CACR,aAAa;CACb,SAAS;EACP,KAAK;EACL,QAAQ,CAAC,SAAS;EAClB,YAAY,CAAC,SAAS;CACxB;CACA,SAAS,CACP;EACE,MAAM;EACN,aACE;CACJ,GACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;EACN,cAAc;CAChB,CACF;AACF,CAAC"}
@@ -1,7 +1,7 @@
1
+ import { Path } from "../../utils/normalized-path.mjs";
1
2
  import { srcPath } from "../../utils/paths.mjs";
2
3
  import "../../utils/index.mjs";
3
- import { command } from "../cli-command.mjs";
4
- import { Path } from "../../dev-server/path.mjs";
4
+ import { command } from "../../commands/cli-command.mjs";
5
5
  import { getFilesFromDirectory } from "../../dev-server/utils.mjs";
6
6
  import { filesOrchestrator } from "../../dev-server/files-orchestrator.mjs";
7
7
  import { typeGenerator } from "../../dev-server/type-generator.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"typings-generator.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/typings-generator.command.ts"],"sourcesContent":["import { filesOrchestrator } from \"../../dev-server/files-orchestrator\";\nimport { Path } from \"../../dev-server/path\";\nimport { typeGenerator } from \"../../dev-server/type-generator\";\nimport { getFilesFromDirectory } from \"../../dev-server/utils\";\nimport { srcPath } from \"../../utils\";\nimport { command } from \"../cli-command\";\n\nexport const typingsGeneratorCommand = command({\n name: \"generate.typings\",\n description: \"Generate type definitions for the project\",\n options: [\n {\n text: \"--files, -f\",\n description:\n \"Files to generate typings for, if not passed, it will generate typings for all files\",\n },\n ],\n action: async ({ options }) => {\n const configFilesPaths: string[] = [];\n if (options.files) {\n const files = String(options.files)\n .split(\",\")\n .map((file) => {\n if (file.startsWith(\"./\")) {\n return Path.toAbsolute(file);\n }\n\n return file;\n });\n\n if (files?.length) {\n configFilesPaths.push(...files);\n }\n }\n\n if (configFilesPaths.length === 0) {\n // grab all config files\n const configFiles = await getFilesFromDirectory(srcPath(\"config\"));\n configFilesPaths.push(...configFiles);\n }\n\n const results = await Promise.allSettled(\n configFilesPaths.map((path) => filesOrchestrator.add(Path.toRelative(path))),\n );\n\n const failed = results.filter((r) => r.status === \"rejected\");\n\n if (failed.length) {\n console.warn(`Failed to process ${failed.length} files`);\n }\n\n await typeGenerator.generateAll();\n },\n});\n"],"mappings":";;;;;;;;;AAOA,MAAa,0BAA0B,QAAQ;CAC7C,MAAM;CACN,aAAa;CACb,SAAS,CACP;EACE,MAAM;EACN,aACE;CACJ,CACF;CACA,QAAQ,OAAO,EAAE,cAAc;EAC7B,MAAM,mBAA6B,CAAC;EACpC,IAAI,QAAQ,OAAO;GACjB,MAAM,QAAQ,OAAO,QAAQ,KAAK,CAAC,CAChC,MAAM,GAAG,CAAC,CACV,KAAK,SAAS;IACb,IAAI,KAAK,WAAW,IAAI,GACtB,OAAO,KAAK,WAAW,IAAI;IAG7B,OAAO;GACT,CAAC;GAEH,IAAI,OAAO,QACT,iBAAiB,KAAK,GAAG,KAAK;EAElC;EAEA,IAAI,iBAAiB,WAAW,GAAG;GAEjC,MAAM,cAAc,MAAM,sBAAsB,QAAQ,QAAQ,CAAC;GACjE,iBAAiB,KAAK,GAAG,WAAW;EACtC;EAMA,MAAM,UAAS,MAJO,QAAQ,WAC5B,iBAAiB,KAAK,SAAS,kBAAkB,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,CAC7E,EAEsB,CAAC,QAAQ,MAAM,EAAE,WAAW,UAAU;EAE5D,IAAI,OAAO,QACT,QAAQ,KAAK,qBAAqB,OAAO,OAAO,OAAO;EAGzD,MAAM,cAAc,YAAY;CAClC;AACF,CAAC"}
1
+ {"version":3,"file":"typings-generator.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/typings-generator.command.ts"],"sourcesContent":["import { filesOrchestrator } from \"../../dev-server/files-orchestrator\";\r\nimport { Path } from \"../../utils/normalized-path\";\r\nimport { typeGenerator } from \"../../dev-server/type-generator\";\r\nimport { getFilesFromDirectory } from \"../../dev-server/utils\";\r\nimport { srcPath } from \"../../utils\";\r\nimport { command } from \"../../commands/cli-command\";\r\n\r\nexport const typingsGeneratorCommand = command({\r\n name: \"generate.typings\",\r\n description: \"Generate type definitions for the project\",\r\n options: [\r\n {\r\n text: \"--files, -f\",\r\n description:\r\n \"Files to generate typings for, if not passed, it will generate typings for all files\",\r\n },\r\n ],\r\n action: async ({ options }) => {\r\n const configFilesPaths: string[] = [];\r\n if (options.files) {\r\n const files = String(options.files)\r\n .split(\",\")\r\n .map((file) => {\r\n if (file.startsWith(\"./\")) {\r\n return Path.toAbsolute(file);\r\n }\r\n\r\n return file;\r\n });\r\n\r\n if (files?.length) {\r\n configFilesPaths.push(...files);\r\n }\r\n }\r\n\r\n if (configFilesPaths.length === 0) {\r\n // grab all config files\r\n const configFiles = await getFilesFromDirectory(srcPath(\"config\"));\r\n configFilesPaths.push(...configFiles);\r\n }\r\n\r\n const results = await Promise.allSettled(\r\n configFilesPaths.map((path) => filesOrchestrator.add(Path.toRelative(path))),\r\n );\r\n\r\n const failed = results.filter((r) => r.status === \"rejected\");\r\n\r\n if (failed.length) {\r\n console.warn(`Failed to process ${failed.length} files`);\r\n }\r\n\r\n await typeGenerator.generateAll();\r\n },\r\n});\r\n"],"mappings":";;;;;;;;;AAOA,MAAa,0BAA0B,QAAQ;CAC7C,MAAM;CACN,aAAa;CACb,SAAS,CACP;EACE,MAAM;EACN,aACE;CACJ,CACF;CACA,QAAQ,OAAO,EAAE,cAAc;EAC7B,MAAM,mBAA6B,CAAC;EACpC,IAAI,QAAQ,OAAO;GACjB,MAAM,QAAQ,OAAO,QAAQ,KAAK,CAAC,CAChC,MAAM,GAAG,CAAC,CACV,KAAK,SAAS;IACb,IAAI,KAAK,WAAW,IAAI,GACtB,OAAO,KAAK,WAAW,IAAI;IAG7B,OAAO;GACT,CAAC;GAEH,IAAI,OAAO,QACT,iBAAiB,KAAK,GAAG,KAAK;EAElC;EAEA,IAAI,iBAAiB,WAAW,GAAG;GAEjC,MAAM,cAAc,MAAM,sBAAsB,QAAQ,QAAQ,CAAC;GACjE,iBAAiB,KAAK,GAAG,WAAW;EACtC;EAMA,MAAM,UAAS,MAJO,QAAQ,WAC5B,iBAAiB,KAAK,SAAS,kBAAkB,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,CAC7E,EAEsB,CAAC,QAAQ,MAAM,EAAE,WAAW,UAAU;EAE5D,IAAI,OAAO,QACT,QAAQ,KAAK,qBAAqB,OAAO,OAAO,OAAO;EAGzD,MAAM,cAAc,YAAY;CAClC;AACF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { command } from "../cli-command.mjs";
1
+ import { command } from "../../commands/cli-command.mjs";
2
2
  import { updateWarlockPackages } from "../../updater/update-warlock-packages.mjs";
3
3
  import { colors } from "@mongez/copper";
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"update.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/update.command.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { updateWarlockPackages } from \"../../updater/update-warlock-packages\";\nimport { command } from \"../cli-command\";\n\nexport const updateCommand = command({\n name: \"update\",\n description: \"Update all @warlock.js packages in this project to their latest version\",\n action: async (data) => {\n // `parseCliArgs` camelCases every flag, so `--no-install` arrives as\n // `options.noInstall` (not `options[\"no-install\"]`).\n const check = Boolean(data.options.check);\n const dryRun = check || Boolean(data.options.dryRun);\n\n const result = await updateWarlockPackages({\n install: !data.options.noInstall,\n dryRun,\n });\n\n // `updateWarlockPackages` resolves on a failed install so the dev-server\n // shortcut can survive it; a one-shot CLI run must still exit non-zero.\n if (result.outcome === \"install-failed\") {\n throw result.error ?? new Error(\"Package manager install failed.\");\n }\n\n // `--check` is a gate, so its exit code carries the answer: 0 current,\n // 1 behind. `--dry-run` only reports, and always succeeds.\n if (check && result.outcome === \"outdated\") {\n console.log(\n colors.dim(\"Run \") +\n colors.cyan(\"warlock update\") +\n colors.dim(\" to apply these, or --dry-run to preview without a gate.\"),\n );\n process.exit(1);\n }\n },\n options: [\n {\n text: \"--no-install\",\n description:\n \"Rewrite the @warlock.js versions in package.json without running the package manager install\",\n type: \"boolean\",\n },\n {\n text: \"--dry-run\",\n description: \"Show which packages would be updated without changing package.json\",\n type: \"boolean\",\n },\n {\n text: \"--check\",\n description:\n \"Like --dry-run, but exits 1 when any package is behind — a CI gate for staying current\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;;AAIA,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,aAAa;CACb,QAAQ,OAAO,SAAS;EAGtB,MAAM,QAAQ,QAAQ,KAAK,QAAQ,KAAK;EACxC,MAAM,SAAS,SAAS,QAAQ,KAAK,QAAQ,MAAM;EAEnD,MAAM,SAAS,MAAM,sBAAsB;GACzC,SAAS,CAAC,KAAK,QAAQ;GACvB;EACF,CAAC;EAID,IAAI,OAAO,YAAY,kBACrB,MAAM,OAAO,yBAAS,IAAI,MAAM,iCAAiC;EAKnE,IAAI,SAAS,OAAO,YAAY,YAAY;GAC1C,QAAQ,IACN,OAAO,IAAI,MAAM,IACf,OAAO,KAAK,gBAAgB,IAC5B,OAAO,IAAI,0DAA0D,CACzE;GACA,QAAQ,KAAK,CAAC;EAChB;CACF;CACA,SAAS;EACP;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"update.command.mjs","names":[],"sources":["../../../../../../../../core/src/cli/commands/update.command.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport { updateWarlockPackages } from \"../../updater/update-warlock-packages\";\r\nimport { command } from \"../../commands/cli-command\";\r\n\r\nexport const updateCommand = command({\r\n name: \"update\",\r\n description: \"Update all @warlock.js packages in this project to their latest version\",\r\n action: async (data) => {\r\n // `parseCliArgs` camelCases every flag, so `--no-install` arrives as\r\n // `options.noInstall` (not `options[\"no-install\"]`).\r\n const check = Boolean(data.options.check);\r\n const dryRun = check || Boolean(data.options.dryRun);\r\n\r\n const result = await updateWarlockPackages({\r\n install: !data.options.noInstall,\r\n dryRun,\r\n });\r\n\r\n // `updateWarlockPackages` resolves on a failed install so the dev-server\r\n // shortcut can survive it; a one-shot CLI run must still exit non-zero.\r\n if (result.outcome === \"install-failed\") {\r\n throw result.error ?? new Error(\"Package manager install failed.\");\r\n }\r\n\r\n // `--check` is a gate, so its exit code carries the answer: 0 current,\r\n // 1 behind. `--dry-run` only reports, and always succeeds.\r\n if (check && result.outcome === \"outdated\") {\r\n console.log(\r\n colors.dim(\"Run \") +\r\n colors.cyan(\"warlock update\") +\r\n colors.dim(\" to apply these, or --dry-run to preview without a gate.\"),\r\n );\r\n process.exit(1);\r\n }\r\n },\r\n options: [\r\n {\r\n text: \"--no-install\",\r\n description:\r\n \"Rewrite the @warlock.js versions in package.json without running the package manager install\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--dry-run\",\r\n description: \"Show which packages would be updated without changing package.json\",\r\n type: \"boolean\",\r\n },\r\n {\r\n text: \"--check\",\r\n description:\r\n \"Like --dry-run, but exits 1 when any package is behind — a CI gate for staying current\",\r\n type: \"boolean\",\r\n },\r\n ],\r\n});\r\n"],"mappings":";;;;;AAIA,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,aAAa;CACb,QAAQ,OAAO,SAAS;EAGtB,MAAM,QAAQ,QAAQ,KAAK,QAAQ,KAAK;EACxC,MAAM,SAAS,SAAS,QAAQ,KAAK,QAAQ,MAAM;EAEnD,MAAM,SAAS,MAAM,sBAAsB;GACzC,SAAS,CAAC,KAAK,QAAQ;GACvB;EACF,CAAC;EAID,IAAI,OAAO,YAAY,kBACrB,MAAM,OAAO,yBAAS,IAAI,MAAM,iCAAiC;EAKnE,IAAI,SAAS,OAAO,YAAY,YAAY;GAC1C,QAAQ,IACN,OAAO,IAAI,MAAM,IACf,OAAO,KAAK,gBAAgB,IAC5B,OAAO,IAAI,0DAA0D,CACzE;GACA,QAAQ,KAAK,CAAC;EAChB;CACF;CACA,SAAS;EACP;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;CACF;AACF,CAAC"}
@@ -1,6 +1,6 @@
1
+ import { Path } from "../utils/normalized-path.mjs";
1
2
  import { srcPath } from "../utils/paths.mjs";
2
3
  import "../utils/index.mjs";
3
- import { Path } from "../dev-server/path.mjs";
4
4
  import { getFilesFromDirectory } from "../dev-server/utils.mjs";
5
5
  import { filesOrchestrator } from "../dev-server/files-orchestrator.mjs";
6
6
  import { isMatchingCommandName } from "./cli-commands.utils.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"commands-loader.mjs","names":[],"sources":["../../../../../../../core/src/cli/commands-loader.ts"],"sourcesContent":["import { filesOrchestrator } from \"../dev-server/files-orchestrator\";\nimport { Path } from \"../dev-server/path\";\nimport { getFilesFromDirectory } from \"../dev-server/utils\";\nimport { srcPath } from \"../utils\";\nimport { CLICommand } from \"./cli-command\";\nimport { isMatchingCommandName } from \"./cli-commands.utils\";\n\nexport class CLICommandsLoader {\n /**\n * Locate command by name\n */\n public async locate(commandName: string): Promise<CLICommand | undefined> {\n const files = await getFilesFromDirectory(srcPath(\"app\"), \"**/commands/*.{ts,tsx}\");\n // now convert them into relative paths\n const relativeFiles = files.map((path) => Path.toRelative(path));\n\n for (const relativeFile of relativeFiles) {\n const command = await this.load(relativeFile);\n if (command) {\n command.$relativePath(relativeFile);\n if (isMatchingCommandName(command.name, commandName)) {\n return command;\n }\n }\n }\n\n return;\n }\n\n /**\n * Scan all project commands and return them\n * Used for warm cache functionality\n */\n public async scanAll(): Promise<CLICommand[]> {\n const files = await getFilesFromDirectory(srcPath(\"app\"), \"**/commands/*.{ts,tsx}\");\n const relativeFiles = files.map((path) => Path.toRelative(path));\n const commands: CLICommand[] = [];\n\n for (const relativeFile of relativeFiles) {\n const command = await this.load(relativeFile);\n if (command) {\n command.$relativePath(relativeFile);\n commands.push(command);\n }\n }\n\n return commands;\n }\n\n /**\n * Load command from a relative path\n */\n public async load(relativePath: string): Promise<CLICommand | undefined> {\n const output = await filesOrchestrator.load<{ default: CLICommand }>(relativePath);\n\n return output?.default;\n }\n}\n\nexport const cliCommandsLoader = new CLICommandsLoader();\n"],"mappings":";;;;;;;;AAOA,IAAa,oBAAb,MAA+B;;;;CAI7B,MAAa,OAAO,aAAsD;EAGxE,MAAM,iBAAgB,MAFF,sBAAsB,QAAQ,KAAK,GAAG,wBAAwB,EAEvD,CAAC,KAAK,SAAS,KAAK,WAAW,IAAI,CAAC;EAE/D,KAAK,MAAM,gBAAgB,eAAe;GACxC,MAAM,UAAU,MAAM,KAAK,KAAK,YAAY;GAC5C,IAAI,SAAS;IACX,QAAQ,cAAc,YAAY;IAClC,IAAI,sBAAsB,QAAQ,MAAM,WAAW,GACjD,OAAO;GAEX;EACF;CAGF;;;;;CAMA,MAAa,UAAiC;EAE5C,MAAM,iBAAgB,MADF,sBAAsB,QAAQ,KAAK,GAAG,wBAAwB,EACvD,CAAC,KAAK,SAAS,KAAK,WAAW,IAAI,CAAC;EAC/D,MAAM,WAAyB,CAAC;EAEhC,KAAK,MAAM,gBAAgB,eAAe;GACxC,MAAM,UAAU,MAAM,KAAK,KAAK,YAAY;GAC5C,IAAI,SAAS;IACX,QAAQ,cAAc,YAAY;IAClC,SAAS,KAAK,OAAO;GACvB;EACF;EAEA,OAAO;CACT;;;;CAKA,MAAa,KAAK,cAAuD;EAGvE,QAAO,MAFc,kBAAkB,KAA8B,YAAY,EAEpE,EAAE;CACjB;AACF;AAEA,MAAa,oBAAoB,IAAI,kBAAkB"}
1
+ {"version":3,"file":"commands-loader.mjs","names":[],"sources":["../../../../../../../core/src/cli/commands-loader.ts"],"sourcesContent":["import { filesOrchestrator } from \"../dev-server/files-orchestrator\";\r\nimport { Path } from \"../utils/normalized-path\";\r\nimport { getFilesFromDirectory } from \"../dev-server/utils\";\r\nimport { srcPath } from \"../utils\";\r\nimport { CLICommand } from \"../commands/cli-command\";\r\nimport { isMatchingCommandName } from \"./cli-commands.utils\";\r\n\r\nexport class CLICommandsLoader {\r\n /**\r\n * Locate command by name\r\n */\r\n public async locate(commandName: string): Promise<CLICommand | undefined> {\r\n const files = await getFilesFromDirectory(srcPath(\"app\"), \"**/commands/*.{ts,tsx}\");\r\n // now convert them into relative paths\r\n const relativeFiles = files.map((path) => Path.toRelative(path));\r\n\r\n for (const relativeFile of relativeFiles) {\r\n const command = await this.load(relativeFile);\r\n if (command) {\r\n command.$relativePath(relativeFile);\r\n if (isMatchingCommandName(command.name, commandName)) {\r\n return command;\r\n }\r\n }\r\n }\r\n\r\n return;\r\n }\r\n\r\n /**\r\n * Scan all project commands and return them\r\n * Used for warm cache functionality\r\n */\r\n public async scanAll(): Promise<CLICommand[]> {\r\n const files = await getFilesFromDirectory(srcPath(\"app\"), \"**/commands/*.{ts,tsx}\");\r\n const relativeFiles = files.map((path) => Path.toRelative(path));\r\n const commands: CLICommand[] = [];\r\n\r\n for (const relativeFile of relativeFiles) {\r\n const command = await this.load(relativeFile);\r\n if (command) {\r\n command.$relativePath(relativeFile);\r\n commands.push(command);\r\n }\r\n }\r\n\r\n return commands;\r\n }\r\n\r\n /**\r\n * Load command from a relative path\r\n */\r\n public async load(relativePath: string): Promise<CLICommand | undefined> {\r\n const output = await filesOrchestrator.load<{ default: CLICommand }>(relativePath);\r\n\r\n return output?.default;\r\n }\r\n}\r\n\r\nexport const cliCommandsLoader = new CLICommandsLoader();\r\n"],"mappings":";;;;;;;;AAOA,IAAa,oBAAb,MAA+B;;;;CAI7B,MAAa,OAAO,aAAsD;EAGxE,MAAM,iBAAgB,MAFF,sBAAsB,QAAQ,KAAK,GAAG,wBAAwB,EAEvD,CAAC,KAAK,SAAS,KAAK,WAAW,IAAI,CAAC;EAE/D,KAAK,MAAM,gBAAgB,eAAe;GACxC,MAAM,UAAU,MAAM,KAAK,KAAK,YAAY;GAC5C,IAAI,SAAS;IACX,QAAQ,cAAc,YAAY;IAClC,IAAI,sBAAsB,QAAQ,MAAM,WAAW,GACjD,OAAO;GAEX;EACF;CAGF;;;;;CAMA,MAAa,UAAiC;EAE5C,MAAM,iBAAgB,MADF,sBAAsB,QAAQ,KAAK,GAAG,wBAAwB,EACvD,CAAC,KAAK,SAAS,KAAK,WAAW,IAAI,CAAC;EAC/D,MAAM,WAAyB,CAAC;EAEhC,KAAK,MAAM,gBAAgB,eAAe;GACxC,MAAM,UAAU,MAAM,KAAK,KAAK,YAAY;GAC5C,IAAI,SAAS;IACX,QAAQ,cAAc,YAAY;IAClC,SAAS,KAAK,OAAO;GACvB;EACF;EAEA,OAAO;CACT;;;;CAKA,MAAa,KAAK,cAAuD;EAGvE,QAAO,MAFc,kBAAkB,KAA8B,YAAY,EAEpE,EAAE;CACjB;AACF;AAEA,MAAa,oBAAoB,IAAI,kBAAkB"}
@@ -1,6 +1,6 @@
1
1
  import { CLICommandAction, CLICommandOption, CLICommandOptions, CLICommandPreload, CLICommandSource, CommandActionData, ResolvedCLICommandOption } from "./types.mjs";
2
2
 
3
- //#region ../core/src/cli/cli-command.d.ts
3
+ //#region ../core/src/commands/cli-command.d.ts
4
4
  declare class CLICommand {
5
5
  name: string;
6
6
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-command.d.mts","names":[],"sources":["../../../../../../../core/src/commands/cli-command.ts"],"mappings":";;;cAUa,UAAA;EAqDF,IAAA;EArDE;;;EAIJ,aAAA,GAAgB,gBAAA;EAKA;;;EAAhB,aAAA,GAAgB,gBAAA;EAyDD;;;;EAnDf,gBAAA,GAAmB,gBAAA;EAuHuC;;;EAlH1D,cAAA,GAAiB,iBAAA;EAoNA;;;EA/MjB,kBAAA;EAuNqC;;;EAlNrC,cAAA,EAAgB,wBAAA;EArBhB;;;;;EA4BA,mBAAA;EAZA;;;EAiBA,YAAA;EAAA;;;EAKA,YAAA;EAOL;;;cADO,IAAA,UACP,WAAA;EAoBK;;;EARA,MAAA,CAAO,MAAA,EAAQ,gBAAA;EAyBf;;;EAjBA,WAAA,CAAY,WAAA;EAyBL;;;EAjBP,UAAA,CAAW,YAAA;EAkCX;;;;EAzBA,KAAA,CAAM,KAAA;EA0CN;;;EAlCA,MAAA,CAAO,MAAA,EAAQ,gBAAA;EAmCR;;;;EA1BP,SAAA,CAAU,MAAA,EAAQ,gBAAA;EAwDf;;;EAhDH,OAAA,CAAQ,OAAA,EAAS,gBAAA;EA8FhB;;;EArFD,aAAA,CAAc,YAAA;EAmHR;;;EA3GN,MAAA,CAAO,MAAA,EAAQ,gBAAA;EACf,MAAA,CAAO,IAAA,UAAc,WAAA,WAAsB,OAAA,GAAU,IAAA,CAAK,gBAAA;EA0GrB;AAS9C;;;;;;;;EAT8C,UA5ElC,WAAA,CAAY,MAAA,EAAQ,gBAAA,GAAmB,wBAAA;;;;;;;;;UA8CzC,iBAAA;;;;EAsBD,OAAA,CAAQ,OAAA,EAAS,iBAAA;;;;EAQX,OAAA,CAAQ,IAAA,EAAM,iBAAA,GAAiB,OAAA;AAAA;AAAA,iBAS9B,OAAA,CAAQ,OAAA,EAAS,iBAAA,GAAiB,UAAA"}
@@ -1,4 +1,4 @@
1
- //#region ../core/src/cli/cli-command.ts
1
+ //#region ../core/src/commands/cli-command.ts
2
2
  var CLICommand = class {
3
3
  /**
4
4
  * Constructor
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-command.mjs","names":[],"sources":["../../../../../../../core/src/commands/cli-command.ts"],"sourcesContent":["import type {\n CLICommandAction,\n CLICommandOption,\n CLICommandOptions,\n CLICommandPreload,\n CLICommandSource,\n CommandActionData,\n ResolvedCLICommandOption,\n} from \"./types\";\n\nexport class CLICommand {\n /**\n * Command source\n */\n public commandSource?: CLICommandSource;\n\n /**\n * Command action\n */\n public commandAction?: CLICommandAction;\n\n /**\n * Command pre action\n * This will be executed before loading preloaders\n */\n public commandPreAction?: CLICommandAction;\n\n /**\n * Command preload\n */\n public commandPreload?: CLICommandPreload;\n\n /**\n * Command description\n */\n public commandDescription?: string;\n\n /**\n * Command options\n */\n public commandOptions: ResolvedCLICommandOption[] = [];\n\n /**\n * Command relative path\n * Available only for project commands\n * Auto injected by the framework itself\n */\n public commandRelativePath?: string;\n\n /**\n * Determine if the command is persistent\n */\n public isPersistent: boolean = false;\n\n /**\n * Command alias (short name)\n */\n public commandAlias?: string;\n\n /**\n * Constructor\n */\n public constructor(\n public name: string,\n description?: string,\n ) {\n if (description) {\n this.commandDescription = description;\n }\n\n return this;\n }\n\n /**\n * Add command source\n */\n public source(source: CLICommandSource): this {\n this.commandSource = source;\n return this;\n }\n\n /**\n * Set command description\n */\n public description(description: string): this {\n this.commandDescription = description;\n return this;\n }\n\n /**\n * Determine if the command is persistent\n */\n public persistent(isPersistent = true): this {\n this.isPersistent = isPersistent;\n return this;\n }\n\n /**\n * Set command alias (short name)\n * @example .alias(\"m\") for \"migrate\"\n */\n public alias(alias: string): this {\n this.commandAlias = alias;\n return this;\n }\n\n /**\n * Command action\n */\n public action(action: CLICommandAction): this {\n this.commandAction = action;\n return this;\n }\n\n /**\n * Command pre action\n * This will be executed before loading preloaders\n */\n public preAction(action: CLICommandAction): this {\n this.commandPreAction = action;\n return this;\n }\n\n /**\n * Add command options\n */\n public options(options: CLICommandOption[]): this {\n options.map((option) => this.option(option));\n\n return this;\n }\n\n /**\n * Add command relative path\n */\n public $relativePath(relativePath: string) {\n this.commandRelativePath = relativePath;\n return this;\n }\n\n /**\n * Add command option\n */\n public option(option: CLICommandOption): this;\n public option(name: string, description?: string, options?: Omit<CLICommandOption, \"name\">): this;\n public option(\n ...args: [CLICommandOption] | [string, string?, Omit<CLICommandOption, \"name\">?]\n ): this {\n let option: CLICommandOption;\n if (args.length === 1) {\n option = args[0] as CLICommandOption;\n } else {\n option = {\n text: args[0],\n description: args[1],\n ...args[2],\n name: \"\",\n };\n }\n\n this.commandOptions.push(this.parseOption(option));\n\n return this;\n }\n\n /**\n * Parse option name and alias if exists\n *\n * Supports formats:\n * - \"--port, -p\" → name: \"port\", alias: \"p\"\n * - \"-p, --port\" → name: \"port\", alias: \"p\"\n * - \"--port\" → name: \"port\", alias: undefined\n * - \"-p\" → name: \"p\", alias: undefined\n */\n protected parseOption(option: CLICommandOption): ResolvedCLICommandOption {\n const text = option.text.trim();\n\n // Split by comma to check for alias\n const parts = text.split(\",\").map((part) => part.trim());\n\n let name = \"\";\n let alias = \"\";\n\n if (parts.length === 1) {\n // Single option: \"--port\" or \"-p\"\n name = this.extractOptionName(parts[0]);\n } else if (parts.length === 2) {\n // Two options: \"--port, -p\" or \"-p, --port\"\n const first = parts[0];\n const second = parts[1];\n\n // Determine which is the long form (name) and which is short (alias)\n if (first.startsWith(\"--\")) {\n name = this.extractOptionName(first);\n alias = this.extractOptionName(second);\n } else {\n name = this.extractOptionName(second);\n alias = this.extractOptionName(first);\n }\n }\n\n if (alias === \"h\" || name === \"help\") {\n throw new Error(\"Help option is not allowed, it's reserved for displaying command help\");\n }\n\n return {\n ...option,\n name,\n alias,\n };\n }\n\n /**\n * Extract option name from text (removes -- or -)\n *\n * @example\n * extractOptionName(\"--port\") → \"port\"\n * extractOptionName(\"-p\") → \"p\"\n * extractOptionName(\"--port=3000\") → \"port\"\n */\n private extractOptionName(text: string): string {\n // Remove leading dashes\n let name = text.replace(/^-+/, \"\");\n\n // Remove value assignment if exists (e.g., \"--port=3000\" → \"port\")\n const equalIndex = name.indexOf(\"=\");\n if (equalIndex !== -1) {\n name = name.slice(0, equalIndex);\n }\n\n // Remove angle brackets if exists (e.g., \"--port <number>\" → \"port\")\n const spaceIndex = name.indexOf(\" \");\n if (spaceIndex !== -1) {\n name = name.slice(0, spaceIndex);\n }\n\n return name.trim();\n }\n\n /**\n * Command preload\n */\n public preload(options: CLICommandPreload) {\n this.commandPreload = options;\n return this;\n }\n\n /**\n * Execute the command\n */\n public async execute(data: CommandActionData) {\n if (!this.commandAction) {\n throw new Error(`Command \"${this.name}\" has no action defined`);\n }\n\n await this.commandAction(data);\n }\n}\n\nexport function command(options: CLICommandOptions) {\n const commandInstnace = new CLICommand(options.name, options.description);\n\n if (options.preload) {\n commandInstnace.preload(options.preload);\n }\n\n if (options.persistent) {\n commandInstnace.persistent(options.persistent);\n }\n\n if (options.alias) {\n commandInstnace.alias(options.alias);\n }\n\n commandInstnace.action(options.action);\n\n if (options.options) {\n commandInstnace.options(options.options);\n }\n\n if (options.preAction) {\n commandInstnace.preAction(options.preAction);\n }\n\n return commandInstnace;\n}\n"],"mappings":";AAUA,IAAa,aAAb,MAAwB;;;;CAoDtB,AAAO,YACL,AAAO,MACP,aACA;EAFO;wBAvB2C,CAAC;sBAYtB;EAc7B,IAAI,aACF,KAAK,qBAAqB;EAG5B,OAAO;CACT;;;;CAKA,AAAO,OAAO,QAAgC;EAC5C,KAAK,gBAAgB;EACrB,OAAO;CACT;;;;CAKA,AAAO,YAAY,aAA2B;EAC5C,KAAK,qBAAqB;EAC1B,OAAO;CACT;;;;CAKA,AAAO,WAAW,eAAe,MAAY;EAC3C,KAAK,eAAe;EACpB,OAAO;CACT;;;;;CAMA,AA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MAAsB;EAE9C,IAAI,OAAO,KAAK,QAAQ,OAAO,EAAE;EAGjC,MAAM,aAAa,KAAK,QAAQ,GAAG;EACnC,IAAI,eAAe,IACjB,OAAO,KAAK,MAAM,GAAG,UAAU;EAIjC,MAAM,aAAa,KAAK,QAAQ,GAAG;EACnC,IAAI,eAAe,IACjB,OAAO,KAAK,MAAM,GAAG,UAAU;EAGjC,OAAO,KAAK,KAAK;CACnB;;;;CAKA,AAAO,QAAQ,SAA4B;EACzC,KAAK,iBAAiB;EACtB,OAAO;CACT;;;;CAKA,MAAa,QAAQ,MAAyB;EAC5C,IAAI,CAAC,KAAK,eACR,MAAM,IAAI,MAAM,YAAY,KAAK,KAAK,wBAAwB;EAGhE,MAAM,KAAK,cAAc,IAAI;CAC/B;AACF;AAEA,SAAgB,QAAQ,SAA4B;CAClD,MAAM,kBAAkB,IAAI,WAAW,QAAQ,MAAM,QAAQ,WAAW;CAExE,IAAI,QAAQ,SACV,gBAAgB,QAAQ,QAAQ,OAAO;CAGzC,IAAI,QAAQ,YACV,gBAAgB,WAAW,QAAQ,UAAU;CAG/C,IAAI,QAAQ,OACV,gBAAgB,MAAM,QAAQ,KAAK;CAGrC,gBAAgB,OAAO,QAAQ,MAAM;CAErC,IAAI,QAAQ,SACV,gBAAgB,QAAQ,QAAQ,OAAO;CAGzC,IAAI,QAAQ,WACV,gBAAgB,UAAU,QAAQ,SAAS;CAG7C,OAAO;AACT"}
@@ -1,6 +1,6 @@
1
1
  import { RuntimeStrategy } from "../utils/environment.mjs";
2
2
  import { ConnectorName } from "../connectors/types.mjs";
3
- //#region ../core/src/cli/types.d.ts
3
+ //#region ../core/src/commands/types.d.ts
4
4
  /**
5
5
  * Indicates the origin/source of a CLI command.
6
6
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../core/src/commands/types.ts"],"mappings":";;;;;AAgB4B;AAY5B;;;;KAZY,gBAAA;;;;AAwBK;AAsBjB;;;;;;KAlCY,iBAAA;EAuDV;;;;EAlDA,IAAA;EAiFA;;;AAA0B;AAgB5B;EA1FE,OAAA,EAAS,MAAM;AAAA;;;;;;;;;;AAiIP;AAGV;;;;;;;;;KA9GY,iBAAA;EAuHA;;;;;EAjHV,MAAA;EAiHiE;;AAAO;EA5GxE,QAAA;EAkI2B;;;EA7H3B,aAAA;EAsKQ;;;EAjKR,eAAA,GAAkB,eAAA;EA6HlB;;;EAxHA,WAAA;EAyIU;;;;;;;;;EA9HV,GAAA;;;;;EAMA,SAAA;;;;;;;;EASA,UAAA,GAAa,aAAa;AAAA;;;;;;;;;;;;;;KAgBhB,gBAAA;;;;;EAKV,IAAA;;;;;EAMA,IAAA;;;;;EAMA,KAAA;;;;EAKA,WAAA;;;;;EAMA,IAAA;;;;EAKA,YAAA;;;;;EAMA,QAAA;AAAA;AAAA,KAGU,wBAAA,GAA2B,IAAI,CAAC,gBAAA;EAC1C,IAAA;EACA,KAAA;AAAA;;;;;KAOU,gBAAA,IAAoB,IAAA,EAAM,iBAAA,YAA6B,OAAO;;;;;;;;;;;;;;;;;;;;;KAsB9D,iBAAA;;;;;EAKV,IAAA;;;;;EAMA,KAAA;;;;EAKA,WAAA;;;;;EAMA,OAAA,GAAU,iBAAA;;;;;;EAOV,UAAA;;;;;EAMA,SAAA,GAAY,gBAAA;;;;;EAMZ,MAAA,EAAQ,gBAAA;;;;;EAMR,OAAA,GAAU,gBAAA;AAAA"}
@@ -1,6 +1,6 @@
1
+ import { Path } from "../utils/normalized-path.mjs";
1
2
  import { srcPath } from "../utils/paths.mjs";
2
3
  import "../utils/index.mjs";
3
- import { Path } from "../dev-server/path.mjs";
4
4
  import { getCertainFilesFromDirectory, getFilesFromDirectory } from "../dev-server/utils.mjs";
5
5
  import { filesOrchestrator } from "../dev-server/files-orchestrator.mjs";
6
6
  import { configManager } from "./config-manager.mjs";