@warlock.js/core 5.31.0 → 5.33.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 (1097) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/esm/application/app.d.mts +3 -3
  3. package/esm/application/app.d.mts.map +1 -1
  4. package/esm/application/application-config-types.d.mts +9 -2
  5. package/esm/application/application-config-types.d.mts.map +1 -1
  6. package/esm/application/application.d.mts +5 -7
  7. package/esm/application/application.d.mts.map +1 -1
  8. package/esm/application/application.mjs +3 -1
  9. package/esm/application/application.mjs.map +1 -1
  10. package/esm/application/boot-signal.d.mts +22 -20
  11. package/esm/application/boot-signal.d.mts.map +1 -1
  12. package/esm/application/boot-signal.mjs +15 -9
  13. package/esm/application/boot-signal.mjs.map +1 -1
  14. package/esm/application/index.d.mts +2 -1
  15. package/esm/application/index.mjs +1 -1
  16. package/esm/application/public-url.d.mts +1 -2
  17. package/esm/application/public-url.d.mts.map +1 -1
  18. package/esm/application/roles.d.mts +10 -11
  19. package/esm/application/roles.d.mts.map +1 -1
  20. package/esm/benchmark/benchmark-snapshots.d.mts +1 -3
  21. package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
  22. package/esm/benchmark/benchmark.d.mts +1 -3
  23. package/esm/benchmark/benchmark.d.mts.map +1 -1
  24. package/esm/benchmark/channels/console.channel.d.mts +1 -3
  25. package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
  26. package/esm/benchmark/channels/noop.channel.d.mts +1 -3
  27. package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
  28. package/esm/benchmark/index.mjs +1 -1
  29. package/esm/benchmark/profiler.d.mts +1 -3
  30. package/esm/benchmark/profiler.d.mts.map +1 -1
  31. package/esm/benchmark/profiler.mjs +2 -1
  32. package/esm/benchmark/profiler.mjs.map +1 -1
  33. package/esm/benchmark/types.d.mts +22 -17
  34. package/esm/benchmark/types.d.mts.map +1 -1
  35. package/esm/bootstrap/setup.d.mts +1 -2
  36. package/esm/bootstrap/setup.d.mts.map +1 -1
  37. package/esm/bootstrap.d.mts +1 -2
  38. package/esm/bootstrap.d.mts.map +1 -1
  39. package/esm/cache/database-cache-driver.d.mts +3 -5
  40. package/esm/cache/database-cache-driver.d.mts.map +1 -1
  41. package/esm/cache/database-cache-driver.mjs +1 -1
  42. package/esm/cache/index.d.mts +2 -1
  43. package/esm/cache/index.mjs +1 -1
  44. package/esm/cli/cli-commands.manager.mjs +6 -3
  45. package/esm/cli/cli-commands.manager.mjs.map +1 -1
  46. package/esm/cli/commands/agents-md/agents-md-command.action.mjs +3 -2
  47. package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -1
  48. package/esm/cli/commands/ai/ai-command.action.mjs +140 -0
  49. package/esm/cli/commands/ai/ai-command.action.mjs.map +1 -0
  50. package/esm/cli/commands/ai.command.mjs +50 -0
  51. package/esm/cli/commands/ai.command.mjs.map +1 -0
  52. package/esm/cli/commands/board/board-command.action.mjs +1 -1
  53. package/esm/cli/commands/check/check-command.action.mjs +4 -1
  54. package/esm/cli/commands/check/check-command.action.mjs.map +1 -1
  55. package/esm/cli/commands/check/child-typecheck.mjs +1 -1
  56. package/esm/cli/commands/check/child-typecheck.mjs.map +1 -1
  57. package/esm/cli/commands/check/format-problems.mjs +1 -1
  58. package/esm/cli/commands/check.command.mjs +6 -1
  59. package/esm/cli/commands/check.command.mjs.map +1 -1
  60. package/esm/cli/commands/dev-server.command.mjs +3 -2
  61. package/esm/cli/commands/dev-server.command.mjs.map +1 -1
  62. package/esm/cli/commands/doctor/check.types.d.mts +29 -16
  63. package/esm/cli/commands/doctor/check.types.d.mts.map +1 -1
  64. package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +22 -27
  65. package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
  66. package/esm/cli/commands/doctor/doctor-command.action.mjs +2 -1
  67. package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
  68. package/esm/cli/commands/explain/explain-command.action.mjs +1 -1
  69. package/esm/cli/commands/generate/generators/controller.generator.mjs +5 -2
  70. package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
  71. package/esm/cli/commands/generate/generators/endpoint.generator.mjs +5 -3
  72. package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -1
  73. package/esm/cli/commands/generate/generators/model.generator.mjs +3 -2
  74. package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
  75. package/esm/cli/commands/generate/generators/repository.generator.mjs +3 -1
  76. package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
  77. package/esm/cli/commands/generate/generators/resource.generator.mjs +3 -1
  78. package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
  79. package/esm/cli/commands/generate/generators/service.generator.mjs +3 -1
  80. package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
  81. package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +2 -2
  82. package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -1
  83. package/esm/cli/commands/generate/utils/endpoint-schema.mjs +1 -2
  84. package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -1
  85. package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
  86. package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
  87. package/esm/cli/commands/inspect/inspect-command.action.mjs +3 -2
  88. package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -1
  89. package/esm/cli/commands/issue/collect-environment.mjs +187 -0
  90. package/esm/cli/commands/issue/collect-environment.mjs.map +1 -0
  91. package/esm/cli/commands/issue/issue-command.action.mjs +70 -0
  92. package/esm/cli/commands/issue/issue-command.action.mjs.map +1 -0
  93. package/esm/cli/commands/issue.command.mjs +31 -0
  94. package/esm/cli/commands/issue.command.mjs.map +1 -0
  95. package/esm/cli/commands/mcp/mcp-command.action.mjs +15 -14
  96. package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -1
  97. package/esm/cli/commands/openapi-generator.action.mjs +1 -1
  98. package/esm/cli/commands/pm2/pm2-command.action.mjs +91 -0
  99. package/esm/cli/commands/pm2/pm2-command.action.mjs.map +1 -0
  100. package/esm/cli/commands/pm2/pm2-config.mjs +115 -0
  101. package/esm/cli/commands/pm2/pm2-config.mjs.map +1 -0
  102. package/esm/cli/commands/pm2.command.mjs +53 -0
  103. package/esm/cli/commands/pm2.command.mjs.map +1 -0
  104. package/esm/cli/commands/postman-generator.action.mjs +1 -1
  105. package/esm/cli/commands/routes/format-routes-table.mjs +1 -1
  106. package/esm/cli/commands/routes/route-row.mjs +1 -1
  107. package/esm/cli/commands/routes/routes-diff.action.mjs +2 -2
  108. package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
  109. package/esm/cli/commands/test.command.mjs +1 -1
  110. package/esm/cli/commands/trace/trace-command.action.mjs +1 -1
  111. package/esm/cli/commands-loader.mjs +1 -1
  112. package/esm/cli/framework-cli-commands.mjs +6 -0
  113. package/esm/cli/framework-cli-commands.mjs.map +1 -1
  114. package/esm/cli/parse-cli-args.mjs +2 -2
  115. package/esm/cli/parse-cli-args.mjs.map +1 -1
  116. package/esm/cli/start.d.mts +1 -1
  117. package/esm/cli/string-similarity.mjs +1 -1
  118. package/esm/commands/cli-command.d.mts +2 -4
  119. package/esm/commands/cli-command.d.mts.map +1 -1
  120. package/esm/commands/index.d.mts +2 -1
  121. package/esm/commands/index.mjs +1 -1
  122. package/esm/commands/types.d.mts +8 -8
  123. package/esm/commands/types.d.mts.map +1 -1
  124. package/esm/config/config-getter.d.mts +2 -3
  125. package/esm/config/config-getter.d.mts.map +1 -1
  126. package/esm/config/config-getter.mjs +5 -5
  127. package/esm/config/config-getter.mjs.map +1 -1
  128. package/esm/config/config-handlers.d.mts +1 -3
  129. package/esm/config/config-handlers.d.mts.map +1 -1
  130. package/esm/config/config-loader.d.mts +1 -2
  131. package/esm/config/config-loader.d.mts.map +1 -1
  132. package/esm/config/config-loader.mjs +3 -3
  133. package/esm/config/config-loader.mjs.map +1 -1
  134. package/esm/config/config-manager.mjs +1 -1
  135. package/esm/config/config-schema.d.mts +19 -16
  136. package/esm/config/config-schema.d.mts.map +1 -1
  137. package/esm/config/config-setter.d.mts +2 -4
  138. package/esm/config/config-setter.d.mts.map +1 -1
  139. package/esm/config/config-setter.mjs +2 -2
  140. package/esm/config/config-setter.mjs.map +1 -1
  141. package/esm/config/config-special-handlers.d.mts +2 -4
  142. package/esm/config/config-special-handlers.d.mts.map +1 -1
  143. package/esm/config/index.d.mts +2 -1
  144. package/esm/config/index.mjs +1 -1
  145. package/esm/config/types.d.mts +4 -5
  146. package/esm/config/types.d.mts.map +1 -1
  147. package/esm/connectors/access-connector.d.mts +1 -3
  148. package/esm/connectors/access-connector.d.mts.map +1 -1
  149. package/esm/connectors/access-connector.mjs +2 -2
  150. package/esm/connectors/access-connector.mjs.map +1 -1
  151. package/esm/connectors/ai-connector.d.mts +1 -3
  152. package/esm/connectors/ai-connector.d.mts.map +1 -1
  153. package/esm/connectors/ai-connector.mjs +2 -2
  154. package/esm/connectors/ai-connector.mjs.map +1 -1
  155. package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -3
  156. package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
  157. package/esm/connectors/assert-unique-connector-names.d.mts +1 -3
  158. package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
  159. package/esm/connectors/assert-unique-connector-names.mjs +2 -1
  160. package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
  161. package/esm/connectors/base-connector.d.mts +1 -3
  162. package/esm/connectors/base-connector.d.mts.map +1 -1
  163. package/esm/connectors/cache-connector.d.mts +1 -3
  164. package/esm/connectors/cache-connector.d.mts.map +1 -1
  165. package/esm/connectors/cache-connector.mjs +3 -3
  166. package/esm/connectors/cache-connector.mjs.map +1 -1
  167. package/esm/connectors/connectors-manager.d.mts +2 -4
  168. package/esm/connectors/connectors-manager.d.mts.map +1 -1
  169. package/esm/connectors/connectors-manager.mjs +3 -6
  170. package/esm/connectors/connectors-manager.mjs.map +1 -1
  171. package/esm/connectors/database-connector.d.mts +1 -3
  172. package/esm/connectors/database-connector.d.mts.map +1 -1
  173. package/esm/connectors/database-connector.mjs +2 -2
  174. package/esm/connectors/database-connector.mjs.map +1 -1
  175. package/esm/connectors/describe-server-address.mjs +4 -4
  176. package/esm/connectors/describe-server-address.mjs.map +1 -1
  177. package/esm/connectors/herald-connector.d.mts +1 -3
  178. package/esm/connectors/herald-connector.d.mts.map +1 -1
  179. package/esm/connectors/herald-connector.mjs +2 -2
  180. package/esm/connectors/herald-connector.mjs.map +1 -1
  181. package/esm/connectors/http-connector.d.mts +1 -3
  182. package/esm/connectors/http-connector.d.mts.map +1 -1
  183. package/esm/connectors/http-connector.mjs +8 -7
  184. package/esm/connectors/http-connector.mjs.map +1 -1
  185. package/esm/connectors/index.d.mts +2 -1
  186. package/esm/connectors/index.mjs +1 -1
  187. package/esm/connectors/logger-connector.d.mts +1 -3
  188. package/esm/connectors/logger-connector.d.mts.map +1 -1
  189. package/esm/connectors/logger-connector.mjs +2 -2
  190. package/esm/connectors/logger-connector.mjs.map +1 -1
  191. package/esm/connectors/mail-connector.d.mts +1 -3
  192. package/esm/connectors/mail-connector.d.mts.map +1 -1
  193. package/esm/connectors/mail-connector.mjs +2 -2
  194. package/esm/connectors/mail-connector.mjs.map +1 -1
  195. package/esm/connectors/notifications-connector.d.mts +1 -3
  196. package/esm/connectors/notifications-connector.d.mts.map +1 -1
  197. package/esm/connectors/notifications-connector.mjs +2 -2
  198. package/esm/connectors/notifications-connector.mjs.map +1 -1
  199. package/esm/connectors/register-configured-connectors.d.mts +2 -4
  200. package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
  201. package/esm/connectors/shutdown-timeout.mjs +7 -0
  202. package/esm/connectors/shutdown-timeout.mjs.map +1 -0
  203. package/esm/connectors/socket-connector.d.mts +1 -3
  204. package/esm/connectors/socket-connector.d.mts.map +1 -1
  205. package/esm/connectors/socket-connector.mjs +20 -11
  206. package/esm/connectors/socket-connector.mjs.map +1 -1
  207. package/esm/connectors/storage.connector.d.mts +1 -3
  208. package/esm/connectors/storage.connector.d.mts.map +1 -1
  209. package/esm/connectors/storage.connector.mjs +2 -2
  210. package/esm/connectors/storage.connector.mjs.map +1 -1
  211. package/esm/connectors/types.d.mts +17 -14
  212. package/esm/connectors/types.d.mts.map +1 -1
  213. package/esm/container/container-instance-registry.mjs.map +1 -1
  214. package/esm/container/development-app-modules.d.mts +7 -5
  215. package/esm/container/development-app-modules.d.mts.map +1 -1
  216. package/esm/container/development-model-modules.d.mts +6 -5
  217. package/esm/container/development-model-modules.d.mts.map +1 -1
  218. package/esm/container/index.d.mts +4 -4
  219. package/esm/container/index.d.mts.map +1 -1
  220. package/esm/database/index.d.mts +3 -1
  221. package/esm/database/index.mjs +1 -1
  222. package/esm/database/migrate-action.mjs +1 -1
  223. package/esm/database/models/database-log/database-log.d.mts +2 -3
  224. package/esm/database/models/database-log/database-log.d.mts.map +1 -1
  225. package/esm/database/models/database-log/index.d.mts +2 -1
  226. package/esm/database/models/database-log/index.mjs +1 -1
  227. package/esm/database/seed-command-action.mjs +1 -1
  228. package/esm/database/seeds/seeder.d.mts +2 -4
  229. package/esm/database/seeds/seeder.d.mts.map +1 -1
  230. package/esm/database/seeds/seeder.errors.d.mts +2 -3
  231. package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
  232. package/esm/database/seeds/seeders.manager.mjs +2 -1
  233. package/esm/database/seeds/seeders.manager.mjs.map +1 -1
  234. package/esm/database/seeds/types.d.mts +7 -8
  235. package/esm/database/seeds/types.d.mts.map +1 -1
  236. package/esm/database/utils.d.mts +4 -5
  237. package/esm/database/utils.d.mts.map +1 -1
  238. package/esm/dev-server/app-module-registry.mjs +1 -1
  239. package/esm/dev-server/create-worker.mjs +5 -3
  240. package/esm/dev-server/create-worker.mjs.map +1 -1
  241. package/esm/dev-server/dependency-graph.d.mts +1 -3
  242. package/esm/dev-server/dependency-graph.d.mts.map +1 -1
  243. package/esm/dev-server/dependency-graph.mjs +1 -1
  244. package/esm/dev-server/dependency-graph.mjs.map +1 -1
  245. package/esm/dev-server/extract-translation-keys.mjs +16 -17
  246. package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
  247. package/esm/dev-server/file-manager.d.mts +3 -7
  248. package/esm/dev-server/file-manager.d.mts.map +1 -1
  249. package/esm/dev-server/file-operations.d.mts +1 -3
  250. package/esm/dev-server/file-operations.d.mts.map +1 -1
  251. package/esm/dev-server/files-watcher.mjs +12 -11
  252. package/esm/dev-server/files-watcher.mjs.map +1 -1
  253. package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +6 -8
  254. package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
  255. package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +36 -115
  256. package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs.map +1 -1
  257. package/esm/dev-server/health-checker/default-health-checkers.mjs +6 -15
  258. package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -1
  259. package/esm/dev-server/health-checker/eslint-support.mjs +27 -0
  260. package/esm/dev-server/health-checker/eslint-support.mjs.map +1 -0
  261. package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +7 -6
  262. package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
  263. package/esm/dev-server/health-checker/file-health-result.d.mts +2 -2
  264. package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
  265. package/esm/dev-server/health-checker/files-healthcare.manager.mjs +1 -0
  266. package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
  267. package/esm/dev-server/health-checker/oxlint-runner.mjs +6 -5
  268. package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -1
  269. package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +1 -1
  270. package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs +2 -11
  271. package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs.map +1 -1
  272. package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -1
  273. package/esm/dev-server/health-checker/workers/ts-health.worker.d.mts +1 -1
  274. package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +40 -174
  275. package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
  276. package/esm/dev-server/loader/hook-thread.d.mts +4 -8
  277. package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
  278. package/esm/dev-server/loader/load-hook.d.mts +10 -6
  279. package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
  280. package/esm/dev-server/loader/load-hook.mjs +4 -3
  281. package/esm/dev-server/loader/load-hook.mjs.map +1 -1
  282. package/esm/dev-server/loader/own-resolver.mjs +1 -1
  283. package/esm/dev-server/loader/register-loader.mjs +3 -2
  284. package/esm/dev-server/loader/register-loader.mjs.map +1 -1
  285. package/esm/dev-server/loader/resolve-hook.d.mts +2 -2
  286. package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
  287. package/esm/dev-server/loader/resolve-hook.mjs +2 -1
  288. package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
  289. package/esm/dev-server/loader/transpile-cache.mjs +2 -1
  290. package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
  291. package/esm/dev-server/manifest-manager.d.mts +1 -3
  292. package/esm/dev-server/manifest-manager.d.mts.map +1 -1
  293. package/esm/dev-server/model-module-registry.mjs +3 -3
  294. package/esm/dev-server/model-module-registry.mjs.map +1 -1
  295. package/esm/dev-server/model-resource-typings.mjs +40 -47
  296. package/esm/dev-server/model-resource-typings.mjs.map +1 -1
  297. package/esm/dev-server/module-loader.mjs +2 -2
  298. package/esm/dev-server/module-loader.mjs.map +1 -1
  299. package/esm/dev-server/package-json-manager.mjs +1 -1
  300. package/esm/dev-server/parse-imports.mjs +6 -38
  301. package/esm/dev-server/parse-imports.mjs.map +1 -1
  302. package/esm/dev-server/read-config-ast.mjs +3 -33
  303. package/esm/dev-server/read-config-ast.mjs.map +1 -1
  304. package/esm/dev-server/ready-block.mjs +1 -1
  305. package/esm/dev-server/shortcuts.mjs +1 -1
  306. package/esm/dev-server/special-files-collector.d.mts +2 -4
  307. package/esm/dev-server/special-files-collector.d.mts.map +1 -1
  308. package/esm/dev-server/supervisor.mjs +1 -1
  309. package/esm/dev-server/tsconfig-manager.mjs +3 -3
  310. package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
  311. package/esm/dev-server/type-generator.mjs +28 -35
  312. package/esm/dev-server/type-generator.mjs.map +1 -1
  313. package/esm/dev-server/types.d.mts +3 -4
  314. package/esm/dev-server/types.d.mts.map +1 -1
  315. package/esm/dev-server/update-check-cache.mjs +2 -2
  316. package/esm/dev-server/update-check-cache.mjs.map +1 -1
  317. package/esm/encryption/encrypt.d.mts +2 -3
  318. package/esm/encryption/encrypt.d.mts.map +1 -1
  319. package/esm/encryption/hash.d.mts +1 -2
  320. package/esm/encryption/hash.d.mts.map +1 -1
  321. package/esm/encryption/index.mjs +1 -1
  322. package/esm/encryption/password.d.mts +2 -3
  323. package/esm/encryption/password.d.mts.map +1 -1
  324. package/esm/encryption/types.d.mts +2 -3
  325. package/esm/encryption/types.d.mts.map +1 -1
  326. package/esm/errors/error-codes.d.mts +29 -22
  327. package/esm/errors/error-codes.d.mts.map +1 -1
  328. package/esm/errors/warlock-error.d.mts +1 -3
  329. package/esm/errors/warlock-error.d.mts.map +1 -1
  330. package/esm/generations/add-command.action.mjs +3 -2
  331. package/esm/generations/add-command.action.mjs.map +1 -1
  332. package/esm/generations/features/bull-board.feature.mjs +2 -1
  333. package/esm/generations/features/bull-board.feature.mjs.map +1 -1
  334. package/esm/generations/features/index.mjs +2 -0
  335. package/esm/generations/features/index.mjs.map +1 -1
  336. package/esm/generations/features/notifications.feature.mjs +2 -1
  337. package/esm/generations/features/notifications.feature.mjs.map +1 -1
  338. package/esm/generations/features/process.feature.mjs +65 -0
  339. package/esm/generations/features/process.feature.mjs.map +1 -0
  340. package/esm/generations/features/shared/merge-web-sitemap-config.mjs +16 -23
  341. package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
  342. package/esm/generations/features/shared/patch-tsconfig-include.mjs +1 -1
  343. package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
  344. package/esm/generations/features/sitemap.feature.mjs +2 -1
  345. package/esm/generations/features/sitemap.feature.mjs.map +1 -1
  346. package/esm/generations/generation-fs.mjs +1 -1
  347. package/esm/generations/generation-run.mjs +1 -1
  348. package/esm/generations/stubs.mjs +1 -1
  349. package/esm/generations/stubs.mjs.map +1 -1
  350. package/esm/http/boot-port-preflight.d.mts +4 -5
  351. package/esm/http/boot-port-preflight.d.mts.map +1 -1
  352. package/esm/http/boot-port-preflight.mjs +2 -2
  353. package/esm/http/boot-port-preflight.mjs.map +1 -1
  354. package/esm/http/bounded-stream-queue.d.mts +4 -4
  355. package/esm/http/bounded-stream-queue.d.mts.map +1 -1
  356. package/esm/http/bounded-stream-queue.mjs +1 -1
  357. package/esm/http/bounded-stream-queue.mjs.map +1 -1
  358. package/esm/http/build-cors-options.mjs +2 -2
  359. package/esm/http/build-cors-options.mjs.map +1 -1
  360. package/esm/http/build-rate-limit-options.d.mts +2 -3
  361. package/esm/http/build-rate-limit-options.d.mts.map +1 -1
  362. package/esm/http/build-rate-limit-options.mjs +1 -1
  363. package/esm/http/build-rate-limit-options.mjs.map +1 -1
  364. package/esm/http/conditional-request.d.mts +14 -13
  365. package/esm/http/conditional-request.d.mts.map +1 -1
  366. package/esm/http/config.d.mts +2 -4
  367. package/esm/http/config.d.mts.map +1 -1
  368. package/esm/http/config.mjs +2 -2
  369. package/esm/http/config.mjs.map +1 -1
  370. package/esm/http/context/request-context.d.mts +6 -7
  371. package/esm/http/context/request-context.d.mts.map +1 -1
  372. package/esm/http/context/request-memo.d.mts +1 -2
  373. package/esm/http/context/request-memo.d.mts.map +1 -1
  374. package/esm/http/createHttpApplication.d.mts +2 -3
  375. package/esm/http/createHttpApplication.d.mts.map +1 -1
  376. package/esm/http/createHttpApplication.mjs +2 -2
  377. package/esm/http/createHttpApplication.mjs.map +1 -1
  378. package/esm/http/csp.d.mts +10 -12
  379. package/esm/http/csp.d.mts.map +1 -1
  380. package/esm/http/csp.mjs +2 -2
  381. package/esm/http/csp.mjs.map +1 -1
  382. package/esm/http/csrf-default-guard.d.mts +2 -4
  383. package/esm/http/csrf-default-guard.d.mts.map +1 -1
  384. package/esm/http/csrf-default-guard.mjs +1 -1
  385. package/esm/http/csrf-default-guard.mjs.map +1 -1
  386. package/esm/http/csrf-origin-policy.d.mts +7 -9
  387. package/esm/http/csrf-origin-policy.d.mts.map +1 -1
  388. package/esm/http/csrf-origin-policy.mjs +2 -2
  389. package/esm/http/csrf-origin-policy.mjs.map +1 -1
  390. package/esm/http/database/RequestLog.d.mts +2 -3
  391. package/esm/http/database/RequestLog.d.mts.map +1 -1
  392. package/esm/http/error-codes.d.mts +1 -2
  393. package/esm/http/error-codes.d.mts.map +1 -1
  394. package/esm/http/error-mapper.d.mts +2 -4
  395. package/esm/http/error-mapper.d.mts.map +1 -1
  396. package/esm/http/error-mapper.mjs +2 -2
  397. package/esm/http/error-mapper.mjs.map +1 -1
  398. package/esm/http/errors/errors.d.mts +28 -29
  399. package/esm/http/errors/errors.d.mts.map +1 -1
  400. package/esm/http/escape-header-value.d.mts +1 -2
  401. package/esm/http/escape-header-value.d.mts.map +1 -1
  402. package/esm/http/events.d.mts +2 -4
  403. package/esm/http/events.d.mts.map +1 -1
  404. package/esm/http/health.d.mts +4 -4
  405. package/esm/http/health.d.mts.map +1 -1
  406. package/esm/http/index.d.mts +4 -1
  407. package/esm/http/index.mjs +1 -1
  408. package/esm/http/middleware/cache-response-middleware.d.mts +2 -4
  409. package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
  410. package/esm/http/middleware/concurrency-limit.middleware.d.mts +3 -3
  411. package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
  412. package/esm/http/middleware/idempotency.middleware.d.mts +3 -3
  413. package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
  414. package/esm/http/middleware/idempotency.middleware.mjs +6 -6
  415. package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
  416. package/esm/http/middleware/index.d.mts +3 -1
  417. package/esm/http/middleware/index.mjs +1 -1
  418. package/esm/http/middleware/inject-request-context.d.mts +2 -4
  419. package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
  420. package/esm/http/middleware/inject-request-context.mjs +3 -3
  421. package/esm/http/middleware/inject-request-context.mjs.map +1 -1
  422. package/esm/http/middleware/ip-filter.middleware.d.mts +3 -3
  423. package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
  424. package/esm/http/middleware/maintenance.middleware.d.mts +3 -3
  425. package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
  426. package/esm/http/middleware/maintenance.middleware.mjs +4 -4
  427. package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
  428. package/esm/http/middleware/max-body-size.middleware.d.mts +2 -2
  429. package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
  430. package/esm/http/middleware/middleware-list.d.mts +1 -3
  431. package/esm/http/middleware/middleware-list.d.mts.map +1 -1
  432. package/esm/http/middleware/rate-limit.middleware.d.mts +3 -3
  433. package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
  434. package/esm/http/middleware/rate-limit.middleware.mjs +2 -2
  435. package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
  436. package/esm/http/middleware/utils/cidr-match.d.mts +2 -3
  437. package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
  438. package/esm/http/middleware/utils/idempotency-key.d.mts +3 -5
  439. package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
  440. package/esm/http/middleware/utils/index.d.mts +2 -1
  441. package/esm/http/middleware/utils/parse-size.d.mts +1 -2
  442. package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
  443. package/esm/http/middleware/utils/parse-size.mjs +2 -2
  444. package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
  445. package/esm/http/plugins.d.mts +2 -4
  446. package/esm/http/plugins.d.mts.map +1 -1
  447. package/esm/http/plugins.mjs +10 -10
  448. package/esm/http/plugins.mjs.map +1 -1
  449. package/esm/http/port-preflight.d.mts +3 -4
  450. package/esm/http/port-preflight.d.mts.map +1 -1
  451. package/esm/http/port-preflight.mjs +2 -0
  452. package/esm/http/port-preflight.mjs.map +1 -1
  453. package/esm/http/rate-limit-cache-store.mjs +4 -3
  454. package/esm/http/rate-limit-cache-store.mjs.map +1 -1
  455. package/esm/http/ready-report.d.mts +15 -10
  456. package/esm/http/ready-report.d.mts.map +1 -1
  457. package/esm/http/request-controller.d.mts +1 -3
  458. package/esm/http/request-controller.d.mts.map +1 -1
  459. package/esm/http/request-log-snapshot.d.mts +20 -16
  460. package/esm/http/request-log-snapshot.d.mts.map +1 -1
  461. package/esm/http/request-log-snapshot.mjs +3 -3
  462. package/esm/http/request-log-snapshot.mjs.map +1 -1
  463. package/esm/http/request.d.mts +8 -7
  464. package/esm/http/request.d.mts.map +1 -1
  465. package/esm/http/request.mjs +8 -7
  466. package/esm/http/request.mjs.map +1 -1
  467. package/esm/http/response.d.mts +12 -11
  468. package/esm/http/response.d.mts.map +1 -1
  469. package/esm/http/response.mjs +7 -7
  470. package/esm/http/response.mjs.map +1 -1
  471. package/esm/http/safe-redirect.d.mts +3 -4
  472. package/esm/http/safe-redirect.d.mts.map +1 -1
  473. package/esm/http/serialized.d.mts +12 -13
  474. package/esm/http/serialized.d.mts.map +1 -1
  475. package/esm/http/server-rebuilt.d.mts +3 -5
  476. package/esm/http/server-rebuilt.d.mts.map +1 -1
  477. package/esm/http/server.d.mts +9 -9
  478. package/esm/http/server.d.mts.map +1 -1
  479. package/esm/http/server.mjs +4 -4
  480. package/esm/http/server.mjs.map +1 -1
  481. package/esm/http/stream-react-response.d.mts +7 -7
  482. package/esm/http/stream-react-response.d.mts.map +1 -1
  483. package/esm/http/tracing/index.mjs +1 -1
  484. package/esm/http/tracing/trace-id.d.mts +2 -3
  485. package/esm/http/tracing/trace-id.d.mts.map +1 -1
  486. package/esm/http/tracing/tracing-dispatcher.d.mts +10 -11
  487. package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
  488. package/esm/http/tracing/tracing-dispatcher.mjs +2 -2
  489. package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
  490. package/esm/http/tracing/tracing.type.d.mts +11 -9
  491. package/esm/http/tracing/tracing.type.d.mts.map +1 -1
  492. package/esm/http/types.d.mts +49 -43
  493. package/esm/http/types.d.mts.map +1 -1
  494. package/esm/http/uploaded-file.d.mts +6 -5
  495. package/esm/http/uploaded-file.d.mts.map +1 -1
  496. package/esm/http/uploads/generate-image-variants.d.mts +6 -6
  497. package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
  498. package/esm/http/uploads/generate-image-variants.mjs +1 -1
  499. package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
  500. package/esm/http/uploads/image-variant-cache-entries.mjs +1 -1
  501. package/esm/http/uploads/image-variant-cache.mjs +8 -8
  502. package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
  503. package/esm/http/uploads/image-variant-types.d.mts +7 -9
  504. package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
  505. package/esm/http/uploads/image-variants-config-error.d.mts +1 -2
  506. package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
  507. package/esm/http/uploads/index.d.mts +2 -1
  508. package/esm/http/uploads/index.mjs +1 -1
  509. package/esm/http/uploads/parse-uploaded-file-query.mjs +1 -1
  510. package/esm/http/uploads/parse-uploaded-file-query.mjs.map +1 -1
  511. package/esm/http/uploads/purge-image-variants.d.mts +2 -4
  512. package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
  513. package/esm/http/uploads/resolve-image-variant.d.mts +3 -5
  514. package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
  515. package/esm/http/uploads/resolve-image-variants-config.mjs +4 -4
  516. package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
  517. package/esm/http/uploads/resolve-original-content-type.mjs +1 -1
  518. package/esm/http/uploads/resolve-original-content-type.mjs.map +1 -1
  519. package/esm/http/uploads/trim-image-variant-cache.mjs +3 -3
  520. package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -1
  521. package/esm/http/uploads/uploaded-file.controller.d.mts +6 -5
  522. package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
  523. package/esm/http/uploads/uploaded-file.controller.mjs +2 -1
  524. package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
  525. package/esm/http/uploads/variant-cache-key.mjs +1 -1
  526. package/esm/http/uploads-config.d.mts +2 -4
  527. package/esm/http/uploads-config.d.mts.map +1 -1
  528. package/esm/http/uploads-types.d.mts +19 -17
  529. package/esm/http/uploads-types.d.mts.map +1 -1
  530. package/esm/http/xmlable.d.mts +1 -2
  531. package/esm/http/xmlable.d.mts.map +1 -1
  532. package/esm/image/image.d.mts +6 -7
  533. package/esm/image/image.d.mts.map +1 -1
  534. package/esm/image/image.mjs.map +1 -1
  535. package/esm/image/index.d.mts +2 -1
  536. package/esm/image/index.mjs +1 -1
  537. package/esm/index.d.mts +28 -2
  538. package/esm/index.mjs +7 -2
  539. package/esm/loader/app-module-importer.d.mts +1 -2
  540. package/esm/loader/app-module-importer.d.mts.map +1 -1
  541. package/esm/localization/index.mjs +1 -1
  542. package/esm/localization/parse-locale-dictionary.d.mts +4 -5
  543. package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
  544. package/esm/localization/parse-locale-dictionary.mjs +1 -1
  545. package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
  546. package/esm/localization/register-locale-dictionary.d.mts +3 -4
  547. package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
  548. package/esm/localization/register-locale-dictionary.mjs +2 -2
  549. package/esm/localization/register-locale-dictionary.mjs.map +1 -1
  550. package/esm/logger/fatal-visibility.d.mts +1 -2
  551. package/esm/logger/fatal-visibility.d.mts.map +1 -1
  552. package/esm/logger/index.d.mts +2 -1
  553. package/esm/logger/index.mjs +1 -1
  554. package/esm/logger/logger.d.mts +1 -3
  555. package/esm/logger/logger.d.mts.map +1 -1
  556. package/esm/logger/types.d.mts +2 -3
  557. package/esm/logger/types.d.mts.map +1 -1
  558. package/esm/mail/config.d.mts +12 -14
  559. package/esm/mail/config.d.mts.map +1 -1
  560. package/esm/mail/events.d.mts +4 -6
  561. package/esm/mail/events.d.mts.map +1 -1
  562. package/esm/mail/index.d.mts +2 -1
  563. package/esm/mail/index.mjs +1 -1
  564. package/esm/mail/mail.d.mts +1 -3
  565. package/esm/mail/mail.d.mts.map +1 -1
  566. package/esm/mail/mailer-pool.d.mts +5 -7
  567. package/esm/mail/mailer-pool.d.mts.map +1 -1
  568. package/esm/mail/react-mail.d.mts +1 -3
  569. package/esm/mail/react-mail.d.mts.map +1 -1
  570. package/esm/mail/send-mail.d.mts +1 -3
  571. package/esm/mail/send-mail.d.mts.map +1 -1
  572. package/esm/mail/send-mail.mjs +2 -1
  573. package/esm/mail/send-mail.mjs.map +1 -1
  574. package/esm/mail/test-mailbox.d.mts +11 -13
  575. package/esm/mail/test-mailbox.d.mts.map +1 -1
  576. package/esm/mail/types.d.mts +17 -18
  577. package/esm/mail/types.d.mts.map +1 -1
  578. package/esm/manifest/manifest-manager.mjs +1 -1
  579. package/esm/openapi/build-openapi-document.d.mts +2 -4
  580. package/esm/openapi/build-openapi-document.d.mts.map +1 -1
  581. package/esm/openapi/cast-schema.mjs +1 -1
  582. package/esm/openapi/development-openapi-provider.d.mts +5 -6
  583. package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
  584. package/esm/openapi/index.d.mts +3 -1
  585. package/esm/openapi/index.mjs +1 -1
  586. package/esm/openapi/openapi-child-output.mjs +2 -2
  587. package/esm/openapi/openapi-child-output.mjs.map +1 -1
  588. package/esm/openapi/postman/build-request-url.mjs +1 -1
  589. package/esm/openapi/postman/example-from-schema.d.mts +1 -3
  590. package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
  591. package/esm/openapi/postman/index.d.mts +2 -1
  592. package/esm/openapi/postman/openapi-to-postman-collection.d.mts +3 -5
  593. package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
  594. package/esm/openapi/postman/postman-types.d.mts +19 -18
  595. package/esm/openapi/postman/postman-types.d.mts.map +1 -1
  596. package/esm/openapi/postman/schema-refs.d.mts +1 -3
  597. package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
  598. package/esm/openapi/postman/uuid-v5.mjs +1 -1
  599. package/esm/openapi/schema-registry.d.mts +1 -1
  600. package/esm/openapi/security.mjs +1 -1
  601. package/esm/openapi/types.d.mts +23 -21
  602. package/esm/openapi/types.d.mts.map +1 -1
  603. package/esm/production/assert-generated-imports.mjs +1 -1
  604. package/esm/production/build-contributions.mjs +1 -1
  605. package/esm/production/bundle-framework-dependencies.mjs +1 -1
  606. package/esm/production/dist-build-manifest.mjs +1 -1
  607. package/esm/production/esbuild-plugins.mjs.map +1 -1
  608. package/esm/production/esbuild-preflight.mjs +1 -1
  609. package/esm/production/production-builder.mjs +2 -1
  610. package/esm/production/production-builder.mjs.map +1 -1
  611. package/esm/production/production-supervisor.mjs +1 -1
  612. package/esm/production/registration-child-runner.mjs +4 -3
  613. package/esm/production/registration-child-runner.mjs.map +1 -1
  614. package/esm/production/resolve-build-config.d.mts +4 -4
  615. package/esm/production/resolve-build-config.d.mts.map +1 -1
  616. package/esm/production/resolve-build-config.mjs +1 -1
  617. package/esm/production/route-registration-child.d.mts +1 -1
  618. package/esm/production/route-registration-child.mjs +8 -7
  619. package/esm/production/route-registration-child.mjs.map +1 -1
  620. package/esm/production/tsconfig-path-aliases.mjs +1 -1
  621. package/esm/react/index.d.mts +1 -3
  622. package/esm/react/index.d.mts.map +1 -1
  623. package/esm/react/index.mjs.map +1 -1
  624. package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +3 -4
  625. package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
  626. package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +2 -3
  627. package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
  628. package/esm/repositories/adapters/cascade/filter-applicator.mjs +10 -9
  629. package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
  630. package/esm/repositories/adapters/cascade/index.d.mts +2 -1
  631. package/esm/repositories/adapters/cascade/index.mjs +1 -1
  632. package/esm/repositories/contracts/index.d.mts +2 -1
  633. package/esm/repositories/contracts/query-builder.contract.d.mts +4 -6
  634. package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
  635. package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -3
  636. package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
  637. package/esm/repositories/contracts/types.d.mts +23 -25
  638. package/esm/repositories/contracts/types.d.mts.map +1 -1
  639. package/esm/repositories/index.d.mts +4 -1
  640. package/esm/repositories/index.mjs +1 -1
  641. package/esm/repositories/repository.manager.d.mts +2 -3
  642. package/esm/repositories/repository.manager.d.mts.map +1 -1
  643. package/esm/repositories/repository.manager.mjs +2 -2
  644. package/esm/repositories/repository.manager.mjs.map +1 -1
  645. package/esm/resource/define-resource.d.mts +3 -5
  646. package/esm/resource/define-resource.d.mts.map +1 -1
  647. package/esm/resource/index.d.mts +2 -1
  648. package/esm/resource/index.mjs +1 -1
  649. package/esm/resource/nullable-resource.d.mts +5 -7
  650. package/esm/resource/nullable-resource.d.mts.map +1 -1
  651. package/esm/resource/register-resource.d.mts +1 -3
  652. package/esm/resource/register-resource.d.mts.map +1 -1
  653. package/esm/resource/resource-field-builder.d.mts +1 -3
  654. package/esm/resource/resource-field-builder.d.mts.map +1 -1
  655. package/esm/resource/resource.d.mts +3 -5
  656. package/esm/resource/resource.d.mts.map +1 -1
  657. package/esm/resource/resource.mjs +4 -2
  658. package/esm/resource/resource.mjs.map +1 -1
  659. package/esm/resource/types.d.mts +21 -21
  660. package/esm/resource/types.d.mts.map +1 -1
  661. package/esm/restful/index.d.mts +2 -1
  662. package/esm/restful/index.mjs +1 -1
  663. package/esm/restful/restful.d.mts +12 -32
  664. package/esm/restful/restful.d.mts.map +1 -1
  665. package/esm/router/index.d.mts +2 -1
  666. package/esm/router/index.mjs +1 -1
  667. package/esm/router/named-api-routes-with-responses.mjs +2 -1
  668. package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
  669. package/esm/router/normalize-request-path.d.mts +1 -2
  670. package/esm/router/normalize-request-path.d.mts.map +1 -1
  671. package/esm/router/normalize-route-path.d.mts +1 -2
  672. package/esm/router/normalize-route-path.d.mts.map +1 -1
  673. package/esm/router/positional-handler-diagnostics.d.mts +15 -13
  674. package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
  675. package/esm/router/resolve-route-rate-limit.mjs +3 -3
  676. package/esm/router/resolve-route-rate-limit.mjs.map +1 -1
  677. package/esm/router/route-builder.d.mts +1 -3
  678. package/esm/router/route-builder.d.mts.map +1 -1
  679. package/esm/router/route-guard-names.mjs +1 -1
  680. package/esm/router/route-guard-names.mjs.map +1 -1
  681. package/esm/router/route-name-method-suffix.d.mts +2 -3
  682. package/esm/router/route-name-method-suffix.d.mts.map +1 -1
  683. package/esm/router/route-name-taken-error.d.mts +1 -3
  684. package/esm/router/route-name-taken-error.d.mts.map +1 -1
  685. package/esm/router/route-registry.d.mts +1 -3
  686. package/esm/router/route-registry.d.mts.map +1 -1
  687. package/esm/router/router.d.mts +2 -4
  688. package/esm/router/router.d.mts.map +1 -1
  689. package/esm/router/router.mjs +8 -6
  690. package/esm/router/router.mjs.map +1 -1
  691. package/esm/router/types.d.mts +25 -26
  692. package/esm/router/types.d.mts.map +1 -1
  693. package/esm/router/unguarded-route-diagnostics.d.mts +6 -8
  694. package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -1
  695. package/esm/secrets/errors.d.mts +9 -0
  696. package/esm/secrets/errors.d.mts.map +1 -0
  697. package/esm/secrets/errors.mjs +22 -0
  698. package/esm/secrets/errors.mjs.map +1 -0
  699. package/esm/secrets/file-backend.mjs +167 -0
  700. package/esm/secrets/file-backend.mjs.map +1 -0
  701. package/esm/secrets/index.d.mts +6 -0
  702. package/esm/secrets/index.mjs +6 -0
  703. package/esm/secrets/keyring-backend.mjs +50 -0
  704. package/esm/secrets/keyring-backend.mjs.map +1 -0
  705. package/esm/secrets/memory-backend.d.mts +12 -0
  706. package/esm/secrets/memory-backend.d.mts.map +1 -0
  707. package/esm/secrets/memory-backend.mjs +28 -0
  708. package/esm/secrets/memory-backend.mjs.map +1 -0
  709. package/esm/secrets/secret-store.d.mts +25 -0
  710. package/esm/secrets/secret-store.d.mts.map +1 -0
  711. package/esm/secrets/secret-store.mjs +117 -0
  712. package/esm/secrets/secret-store.mjs.map +1 -0
  713. package/esm/secrets/secrets.d.mts +11 -0
  714. package/esm/secrets/secrets.d.mts.map +1 -0
  715. package/esm/secrets/secrets.mjs +63 -0
  716. package/esm/secrets/secrets.mjs.map +1 -0
  717. package/esm/secrets/types.d.mts +22 -0
  718. package/esm/secrets/types.d.mts.map +1 -0
  719. package/esm/socket/index.d.mts +2 -1
  720. package/esm/socket/index.mjs +2 -2
  721. package/esm/socket/types.d.mts +2 -4
  722. package/esm/socket/types.d.mts.map +1 -1
  723. package/esm/socket/utils.d.mts +8 -3
  724. package/esm/socket/utils.d.mts.map +1 -1
  725. package/esm/socket/utils.mjs +12 -1
  726. package/esm/socket/utils.mjs.map +1 -1
  727. package/esm/storage/config.d.mts +4 -6
  728. package/esm/storage/config.d.mts.map +1 -1
  729. package/esm/storage/context/storage-driver-context.d.mts +3 -4
  730. package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
  731. package/esm/storage/drivers/cloud-driver.d.mts +2 -4
  732. package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
  733. package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
  734. package/esm/storage/drivers/do-spaces-driver.d.mts +1 -3
  735. package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
  736. package/esm/storage/drivers/local-driver.d.mts +2 -3
  737. package/esm/storage/drivers/local-driver.d.mts.map +1 -1
  738. package/esm/storage/drivers/local-driver.mjs +8 -3
  739. package/esm/storage/drivers/local-driver.mjs.map +1 -1
  740. package/esm/storage/drivers/r2-driver.d.mts +1 -3
  741. package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
  742. package/esm/storage/drivers/s3-driver.d.mts +1 -3
  743. package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
  744. package/esm/storage/index.d.mts +2 -1
  745. package/esm/storage/index.mjs +1 -1
  746. package/esm/storage/local-disk-roots.mjs +2 -2
  747. package/esm/storage/local-disk-roots.mjs.map +1 -1
  748. package/esm/storage/scoped-storage.d.mts +2 -3
  749. package/esm/storage/scoped-storage.d.mts.map +1 -1
  750. package/esm/storage/storage-file.d.mts +1 -3
  751. package/esm/storage/storage-file.d.mts.map +1 -1
  752. package/esm/storage/storage.d.mts +3 -4
  753. package/esm/storage/storage.d.mts.map +1 -1
  754. package/esm/storage/types.d.mts +36 -36
  755. package/esm/storage/types.d.mts.map +1 -1
  756. package/esm/storage/utils/classify-ip-address.d.mts +1 -2
  757. package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
  758. package/esm/storage/utils/contain-path.d.mts +1 -2
  759. package/esm/storage/utils/contain-path.d.mts.map +1 -1
  760. package/esm/storage/utils/mime.d.mts +2 -3
  761. package/esm/storage/utils/mime.d.mts.map +1 -1
  762. package/esm/storage/utils/safe-fetch.d.mts +6 -6
  763. package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
  764. package/esm/storage/utils/safe-fetch.mjs +3 -3
  765. package/esm/storage/utils/safe-fetch.mjs.map +1 -1
  766. package/esm/storage/utils/storage-capability-error.d.mts +1 -3
  767. package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
  768. package/esm/storage/utils/storage-error.d.mts +2 -3
  769. package/esm/storage/utils/storage-error.d.mts.map +1 -1
  770. package/esm/storage/utils/storage-not-initialized-error.d.mts +1 -2
  771. package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
  772. package/esm/tests/authenticated-test-client.d.mts +5 -6
  773. package/esm/tests/authenticated-test-client.d.mts.map +1 -1
  774. package/esm/tests/factories.d.mts +38 -23
  775. package/esm/tests/factories.d.mts.map +1 -1
  776. package/esm/tests/fakes/cache-fake.d.mts +14 -9
  777. package/esm/tests/fakes/cache-fake.d.mts.map +1 -1
  778. package/esm/tests/fakes/clock-fake.d.mts +13 -8
  779. package/esm/tests/fakes/clock-fake.d.mts.map +1 -1
  780. package/esm/tests/fakes/fake-assertion-error.d.mts +2 -3
  781. package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -1
  782. package/esm/tests/fakes/ids-fake.d.mts +5 -4
  783. package/esm/tests/fakes/ids-fake.d.mts.map +1 -1
  784. package/esm/tests/fakes/index.d.mts +3 -1
  785. package/esm/tests/fakes/index.mjs +2 -1
  786. package/esm/tests/fakes/mail-fake.d.mts +21 -13
  787. package/esm/tests/fakes/mail-fake.d.mts.map +1 -1
  788. package/esm/tests/fakes/queue-fake.d.mts +21 -13
  789. package/esm/tests/fakes/queue-fake.d.mts.map +1 -1
  790. package/esm/tests/fakes/secrets-fake.d.mts +13 -0
  791. package/esm/tests/fakes/secrets-fake.d.mts.map +1 -0
  792. package/esm/tests/fakes/secrets-fake.mjs +50 -0
  793. package/esm/tests/fakes/secrets-fake.mjs.map +1 -0
  794. package/esm/tests/fakes/storage-fake.d.mts +12 -8
  795. package/esm/tests/fakes/storage-fake.d.mts.map +1 -1
  796. package/esm/tests/fakes/storage-fake.mjs +1 -1
  797. package/esm/tests/fakes/test-fakes.d.mts +9 -10
  798. package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
  799. package/esm/tests/fakes/test-fakes.mjs +6 -3
  800. package/esm/tests/fakes/test-fakes.mjs.map +1 -1
  801. package/esm/tests/index.d.mts +3 -1
  802. package/esm/tests/index.mjs +2 -1
  803. package/esm/tests/snapshot-response.d.mts +4 -5
  804. package/esm/tests/snapshot-response.d.mts.map +1 -1
  805. package/esm/tests/start-http-development-server.d.mts +4 -6
  806. package/esm/tests/start-http-development-server.d.mts.map +1 -1
  807. package/esm/tests/start-http-development-server.mjs +5 -5
  808. package/esm/tests/start-http-development-server.mjs.map +1 -1
  809. package/esm/tests/test-connectors-selection.d.mts +2 -2
  810. package/esm/tests/test-connectors-selection.d.mts.map +1 -1
  811. package/esm/tests/test-connectors-selection.mjs +1 -1
  812. package/esm/tests/test-helpers.d.mts +11 -12
  813. package/esm/tests/test-helpers.d.mts.map +1 -1
  814. package/esm/tests/test-http-server.d.mts +14 -10
  815. package/esm/tests/test-http-server.d.mts.map +1 -1
  816. package/esm/tests/test-lifecycle-state.mjs +1 -1
  817. package/esm/tests/vitest-setup.d.mts +7 -8
  818. package/esm/tests/vitest-setup.d.mts.map +1 -1
  819. package/esm/tests/vitest-setup.mjs.map +1 -1
  820. package/esm/tooling/agents-md/agents-md-markers.d.mts +4 -5
  821. package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -1
  822. package/esm/tooling/agents-md/agents-md-markers.mjs +2 -1
  823. package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -1
  824. package/esm/tooling/agents-md/agents-md-refresher.d.mts +19 -12
  825. package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -1
  826. package/esm/tooling/agents-md/installed-skills.d.mts +13 -9
  827. package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -1
  828. package/esm/tooling/agents-md/render-agents-md.d.mts +8 -7
  829. package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -1
  830. package/esm/tooling/agents-md/render-agents-md.mjs +2 -2
  831. package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -1
  832. package/esm/tooling/agents-md/write-agents-md.d.mts +17 -12
  833. package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -1
  834. package/esm/tooling/board/board-message.d.mts +4 -6
  835. package/esm/tooling/board/board-message.d.mts.map +1 -1
  836. package/esm/tooling/board/board.d.mts +50 -38
  837. package/esm/tooling/board/board.d.mts.map +1 -1
  838. package/esm/tooling/board/board.mjs +4 -3
  839. package/esm/tooling/board/board.mjs.map +1 -1
  840. package/esm/tooling/board/board.types.d.mts +32 -23
  841. package/esm/tooling/board/board.types.d.mts.map +1 -1
  842. package/esm/tooling/check/changed-files.d.mts +4 -6
  843. package/esm/tooling/check/changed-files.d.mts.map +1 -1
  844. package/esm/tooling/check/changed-files.mjs +2 -2
  845. package/esm/tooling/check/changed-files.mjs.map +1 -1
  846. package/esm/tooling/check/check-report.types.d.mts +22 -17
  847. package/esm/tooling/check/check-report.types.d.mts.map +1 -1
  848. package/esm/tooling/check/code-style-conventions.mjs +25 -25
  849. package/esm/tooling/check/code-style-conventions.mjs.map +1 -1
  850. package/esm/tooling/check/conventions-step.d.mts +4 -6
  851. package/esm/tooling/check/conventions-step.d.mts.map +1 -1
  852. package/esm/tooling/check/conventions-step.mjs +7 -18
  853. package/esm/tooling/check/conventions-step.mjs.map +1 -1
  854. package/esm/tooling/check/environment-step.d.mts +2 -4
  855. package/esm/tooling/check/environment-step.d.mts.map +1 -1
  856. package/esm/tooling/check/environment-step.mjs +1 -1
  857. package/esm/tooling/check/index.mjs +1 -1
  858. package/esm/tooling/check/lint-step.d.mts +5 -12
  859. package/esm/tooling/check/lint-step.d.mts.map +1 -1
  860. package/esm/tooling/check/lint-step.mjs +16 -12
  861. package/esm/tooling/check/lint-step.mjs.map +1 -1
  862. package/esm/tooling/check/request-input.mjs +15 -15
  863. package/esm/tooling/check/request-input.mjs.map +1 -1
  864. package/esm/tooling/check/run-check.d.mts +24 -14
  865. package/esm/tooling/check/run-check.d.mts.map +1 -1
  866. package/esm/tooling/check/run-check.mjs +2 -2
  867. package/esm/tooling/check/run-check.mjs.map +1 -1
  868. package/esm/tooling/check/run-tests.d.mts +22 -15
  869. package/esm/tooling/check/run-tests.d.mts.map +1 -1
  870. package/esm/tooling/check/security-conventions.mjs +133 -131
  871. package/esm/tooling/check/security-conventions.mjs.map +1 -1
  872. package/esm/tooling/check/source-ast.mjs +92 -132
  873. package/esm/tooling/check/source-ast.mjs.map +1 -1
  874. package/esm/tooling/check/tests-step.d.mts +7 -8
  875. package/esm/tooling/check/tests-step.d.mts.map +1 -1
  876. package/esm/tooling/check/tests-step.mjs +3 -3
  877. package/esm/tooling/check/tests-step.mjs.map +1 -1
  878. package/esm/tooling/dev-state/dev-server-state.d.mts +17 -13
  879. package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -1
  880. package/esm/tooling/devtools/devtools-client.d.mts +29 -20
  881. package/esm/tooling/devtools/devtools-client.d.mts.map +1 -1
  882. package/esm/tooling/generate/generation.d.mts +34 -22
  883. package/esm/tooling/generate/generation.d.mts.map +1 -1
  884. package/esm/tooling/generate/generation.mjs +9 -5
  885. package/esm/tooling/generate/generation.mjs.map +1 -1
  886. package/esm/tooling/generate/generator-spec.d.mts +9 -9
  887. package/esm/tooling/generate/generator-spec.d.mts.map +1 -1
  888. package/esm/tooling/generate/index.mjs +1 -1
  889. package/esm/tooling/generate/project-files.mjs +3 -3
  890. package/esm/tooling/generate/project-files.mjs.map +1 -1
  891. package/esm/tooling/generate/run-cli.d.mts +14 -11
  892. package/esm/tooling/generate/run-cli.d.mts.map +1 -1
  893. package/esm/tooling/generate/run-cli.mjs +2 -2
  894. package/esm/tooling/generate/run-cli.mjs.map +1 -1
  895. package/esm/tooling/generate/unified-diff.d.mts +10 -7
  896. package/esm/tooling/generate/unified-diff.d.mts.map +1 -1
  897. package/esm/tooling/index.d.mts +1 -0
  898. package/esm/tooling/inspect/boot-for-inspect.d.mts +7 -7
  899. package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -1
  900. package/esm/tooling/inspect/collect-config.mjs +3 -3
  901. package/esm/tooling/inspect/collect-config.mjs.map +1 -1
  902. package/esm/tooling/inspect/collect-models.d.mts +4 -3
  903. package/esm/tooling/inspect/collect-models.d.mts.map +1 -1
  904. package/esm/tooling/inspect/collect-models.mjs +1 -1
  905. package/esm/tooling/inspect/collect-packages.d.mts +1 -2
  906. package/esm/tooling/inspect/collect-packages.d.mts.map +1 -1
  907. package/esm/tooling/inspect/collect-pages.mjs +10 -10
  908. package/esm/tooling/inspect/collect-pages.mjs.map +1 -1
  909. package/esm/tooling/inspect/collect-routes.mjs +1 -1
  910. package/esm/tooling/inspect/event-recorder.d.mts +7 -7
  911. package/esm/tooling/inspect/event-recorder.d.mts.map +1 -1
  912. package/esm/tooling/inspect/index.d.mts +2 -1
  913. package/esm/tooling/inspect/index.mjs +1 -1
  914. package/esm/tooling/inspect/inspect-app.d.mts +25 -16
  915. package/esm/tooling/inspect/inspect-app.d.mts.map +1 -1
  916. package/esm/tooling/inspect/inspect-report.schema.d.mts +1 -2
  917. package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -1
  918. package/esm/tooling/inspect/inspect-report.types.d.mts +86 -54
  919. package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -1
  920. package/esm/tooling/mcp/create-mcp-context.d.mts +11 -8
  921. package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -1
  922. package/esm/tooling/mcp/db-schema.d.mts +10 -9
  923. package/esm/tooling/mcp/db-schema.d.mts.map +1 -1
  924. package/esm/tooling/mcp/docs-search.d.mts +20 -15
  925. package/esm/tooling/mcp/docs-search.d.mts.map +1 -1
  926. package/esm/tooling/mcp/index.mjs +1 -1
  927. package/esm/tooling/mcp/load-ai-tools.d.mts +7 -8
  928. package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -1
  929. package/esm/tooling/mcp/load-ai-tools.mjs +2 -1
  930. package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -1
  931. package/esm/tooling/mcp/mcp-tools.d.mts +29 -19
  932. package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -1
  933. package/esm/tooling/mcp/mcp-tools.mjs +3 -2
  934. package/esm/tooling/mcp/mcp-tools.mjs.map +1 -1
  935. package/esm/tooling/mcp/start-mcp-server.d.mts +24 -17
  936. package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -1
  937. package/esm/tooling/mcp/start-mcp-server.mjs +1 -1
  938. package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -1
  939. package/esm/tooling/mcp/tool-input.d.mts +7 -7
  940. package/esm/tooling/mcp/tool-input.d.mts.map +1 -1
  941. package/esm/tooling/problem.d.mts +27 -17
  942. package/esm/tooling/problem.d.mts.map +1 -1
  943. package/esm/tooling/syntax/ast.mjs +230 -0
  944. package/esm/tooling/syntax/ast.mjs.map +1 -0
  945. package/esm/tooling/syntax/imports.mjs +34 -0
  946. package/esm/tooling/syntax/imports.mjs.map +1 -0
  947. package/esm/tooling/trace/trace-report.types.d.mts +36 -22
  948. package/esm/tooling/trace/trace-report.types.d.mts.map +1 -1
  949. package/esm/tooling/trace/trace-request.d.mts +27 -20
  950. package/esm/tooling/trace/trace-request.d.mts.map +1 -1
  951. package/esm/tooling/trace/trace-request.mjs +2 -2
  952. package/esm/tooling/trace/trace-request.mjs.map +1 -1
  953. package/esm/tooling/typecheck/index.mjs +1 -1
  954. package/esm/tooling/typecheck/run-typecheck.d.mts +15 -48
  955. package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -1
  956. package/esm/tooling/typecheck/run-typecheck.mjs +42 -105
  957. package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -1
  958. package/esm/tooling/typescript/compiler.d.mts +31 -0
  959. package/esm/tooling/typescript/compiler.d.mts.map +1 -0
  960. package/esm/tooling/typescript/compiler.mjs +120 -0
  961. package/esm/tooling/typescript/compiler.mjs.map +1 -0
  962. package/esm/updater/update-warlock-packages.mjs +3 -2
  963. package/esm/updater/update-warlock-packages.mjs.map +1 -1
  964. package/esm/upgrade/codemods/index.mjs +3 -1
  965. package/esm/upgrade/codemods/index.mjs.map +1 -1
  966. package/esm/upgrade/codemods/logger-sync-calls.mjs +1 -1
  967. package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -1
  968. package/esm/upgrade/codemods/oxc-toolchain.mjs +142 -0
  969. package/esm/upgrade/codemods/oxc-toolchain.mjs.map +1 -0
  970. package/esm/upgrade/codemods/request-log-snapshot.mjs +1 -1
  971. package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -1
  972. package/esm/upgrade/codemods/toolchain-templates.mjs +244 -0
  973. package/esm/upgrade/codemods/toolchain-templates.mjs.map +1 -0
  974. package/esm/upgrade/diff.mjs +1 -1
  975. package/esm/upgrade/diff.mjs.map +1 -1
  976. package/esm/upgrade/load-ts-morph.mjs +3 -2
  977. package/esm/upgrade/load-ts-morph.mjs.map +1 -1
  978. package/esm/upgrade/run-upgrade.mjs +26 -7
  979. package/esm/upgrade/run-upgrade.mjs.map +1 -1
  980. package/esm/use-cases/index.d.mts +2 -1
  981. package/esm/use-cases/index.mjs +1 -1
  982. package/esm/use-cases/types.d.mts +116 -63
  983. package/esm/use-cases/types.d.mts.map +1 -1
  984. package/esm/use-cases/use-case-broadcast.d.mts +1 -3
  985. package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
  986. package/esm/use-cases/use-case-events.d.mts +3 -5
  987. package/esm/use-cases/use-case-events.d.mts.map +1 -1
  988. package/esm/use-cases/use-case-pipeline.d.mts +6 -6
  989. package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
  990. package/esm/use-cases/use-case.d.mts +2 -4
  991. package/esm/use-cases/use-case.d.mts.map +1 -1
  992. package/esm/use-cases/use-case.errors.d.mts +1 -3
  993. package/esm/use-cases/use-case.errors.d.mts.map +1 -1
  994. package/esm/use-cases/use-cases-registry.d.mts +8 -10
  995. package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
  996. package/esm/utils/app-log.d.mts +1 -2
  997. package/esm/utils/app-log.d.mts.map +1 -1
  998. package/esm/utils/clock.d.mts +8 -6
  999. package/esm/utils/clock.d.mts.map +1 -1
  1000. package/esm/utils/database-log.d.mts +3 -4
  1001. package/esm/utils/database-log.d.mts.map +1 -1
  1002. package/esm/utils/environment.d.mts +4 -5
  1003. package/esm/utils/environment.d.mts.map +1 -1
  1004. package/esm/utils/framework-vesion.mjs.map +1 -1
  1005. package/esm/utils/get-localized.d.mts +2 -3
  1006. package/esm/utils/get-localized.d.mts.map +1 -1
  1007. package/esm/utils/ids.d.mts +9 -6
  1008. package/esm/utils/ids.d.mts.map +1 -1
  1009. package/esm/utils/index.d.mts +2 -1
  1010. package/esm/utils/index.mjs +1 -1
  1011. package/esm/utils/normalized-path.d.mts +1 -2
  1012. package/esm/utils/normalized-path.d.mts.map +1 -1
  1013. package/esm/utils/npm-registry.d.mts +1 -2
  1014. package/esm/utils/npm-registry.d.mts.map +1 -1
  1015. package/esm/utils/paths.d.mts +13 -14
  1016. package/esm/utils/paths.d.mts.map +1 -1
  1017. package/esm/utils/paths.mjs +2 -2
  1018. package/esm/utils/paths.mjs.map +1 -1
  1019. package/esm/utils/promise-all-object.d.mts +1 -2
  1020. package/esm/utils/promise-all-object.d.mts.map +1 -1
  1021. package/esm/utils/queue.d.mts +1 -2
  1022. package/esm/utils/queue.d.mts.map +1 -1
  1023. package/esm/utils/runtime.d.mts +11 -10
  1024. package/esm/utils/runtime.d.mts.map +1 -1
  1025. package/esm/utils/sleep.d.mts +1 -2
  1026. package/esm/utils/sleep.d.mts.map +1 -1
  1027. package/esm/utils/sluggable.d.mts +1 -3
  1028. package/esm/utils/sluggable.d.mts.map +1 -1
  1029. package/esm/utils/to-json.d.mts +1 -2
  1030. package/esm/utils/to-json.d.mts.map +1 -1
  1031. package/esm/utils/types.d.mts +1 -2
  1032. package/esm/utils/types.d.mts.map +1 -1
  1033. package/esm/utils/urls.d.mts +5 -6
  1034. package/esm/utils/urls.d.mts.map +1 -1
  1035. package/esm/utils/version-compare.d.mts +1 -2
  1036. package/esm/utils/version-compare.d.mts.map +1 -1
  1037. package/esm/validation/database/exists-except-current-id.d.mts +2 -3
  1038. package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
  1039. package/esm/validation/database/exists-except-current-user.d.mts +2 -3
  1040. package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
  1041. package/esm/validation/database/index.d.mts +2 -1
  1042. package/esm/validation/database/index.mjs +1 -1
  1043. package/esm/validation/database/types.d.mts +14 -10
  1044. package/esm/validation/database/types.d.mts.map +1 -1
  1045. package/esm/validation/database/unique-except-current-id.d.mts +2 -3
  1046. package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
  1047. package/esm/validation/database/unique-except-current-user.d.mts +2 -3
  1048. package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
  1049. package/esm/validation/file/file.d.mts +4 -6
  1050. package/esm/validation/file/file.d.mts.map +1 -1
  1051. package/esm/validation/file/index.d.mts +2 -1
  1052. package/esm/validation/file/index.mjs +1 -1
  1053. package/esm/validation/index.d.mts +5 -1
  1054. package/esm/validation/index.mjs +1 -1
  1055. package/esm/validation/plugins/index.mjs +1 -1
  1056. package/esm/validation/types.d.mts +6 -4
  1057. package/esm/validation/types.d.mts.map +1 -1
  1058. package/esm/validation/validateAll.mjs +2 -2
  1059. package/esm/validation/validateAll.mjs.map +1 -1
  1060. package/esm/validation/validation-failure-status.mjs +2 -2
  1061. package/esm/validation/validation-failure-status.mjs.map +1 -1
  1062. package/esm/validation/validators/file-validator.d.mts +2 -4
  1063. package/esm/validation/validators/file-validator.d.mts.map +1 -1
  1064. package/esm/validation/validators/index.d.mts +2 -1
  1065. package/esm/validation/validators/index.mjs +1 -1
  1066. package/esm/vite/lower-stage3-decorators.d.mts +2 -3
  1067. package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
  1068. package/esm/warlock-config/define-config.d.mts +1 -3
  1069. package/esm/warlock-config/define-config.d.mts.map +1 -1
  1070. package/esm/warlock-config/define-config.mjs +3 -2
  1071. package/esm/warlock-config/define-config.mjs.map +1 -1
  1072. package/esm/warlock-config/index.d.mts +2 -1
  1073. package/esm/warlock-config/index.mjs +1 -1
  1074. package/esm/warlock-config/types.d.mts +8 -6
  1075. package/esm/warlock-config/types.d.mts.map +1 -1
  1076. package/esm/warlock-config/warlock-config.manager.d.mts +5 -7
  1077. package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
  1078. package/esm/warlock-config/warlock-config.manager.mjs +2 -1
  1079. package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
  1080. package/esm/warlock-config/warn-deprecated-config.mjs +1 -1
  1081. package/llms-full.txt +379 -22
  1082. package/llms.txt +3 -2
  1083. package/package.json +27 -15
  1084. package/skills/README.md +2 -1
  1085. package/skills/create-module/SKILL.md +7 -0
  1086. package/skills/index.md +3 -1
  1087. package/skills/report-framework-issue.md +154 -0
  1088. package/skills/run-app/SKILL.md +120 -10
  1089. package/skills/store-secrets/SKILL.md +102 -0
  1090. package/skills/test-fakes/SKILL.md +13 -11
  1091. package/skills/upgrade-from-5-29/SKILL.md +78 -0
  1092. package/skills/warlock-check/SKILL.md +6 -1
  1093. package/skills/warlock-doctor/SKILL.md +9 -0
  1094. package/skills/wire-socket/SKILL.md +19 -0
  1095. package/skills/write-cli-command/SKILL.md +21 -0
  1096. package/esm/tooling/check/index.d.mts +0 -8
  1097. package/esm/tooling/typecheck/index.d.mts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"production-builder.mjs","names":[],"sources":["../../../../../../../../packages/core/src/production/production-builder.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport {\n ensureDirectoryAsync,\n fileExistsAsync,\n getFileAsync,\n getJsonFileAsync,\n putFileAsync,\n removeDirectoryAsync,\n} from \"@warlock.js/fs\";\nimport esbuild from \"esbuild\";\nimport glob from \"fast-glob\";\nimport path from \"path\";\nimport { assertNoReservedConnectorNames } from \"../connectors/assert-no-reserved-connector-names\";\nimport { assertUniqueConnectorNames } from \"../connectors/assert-unique-connector-names\";\nimport type { Connector, ConnectorBuildContext, ConnectorEsbuildPatch } from \"../connectors/types\";\nimport { configKeyFromPath } from \"../config/config-key-from-path\";\nimport {\n isConfigFile,\n isEventFile,\n isLocaleFile,\n isMainFile,\n isRouteFile,\n isWorkerFile,\n} from \"../dev-server/special-file-patterns\";\nimport { tsconfigManager } from \"../dev-server/tsconfig-manager\";\nimport { appPath, rootPath, warlockPath } from \"../utils\";\nimport { warlockConfigManager } from \"../warlock-config/warlock-config.manager\";\nimport { assertGeneratedImportsAreDeclared } from \"./assert-generated-imports\";\nimport { bundleFrameworkDependencies } from \"./bundle-framework-dependencies\";\nimport { dedupe, runEmitContributions, runGenerateContributions } from \"./build-contributions\";\nimport { writeDistBuildManifestAsync } from \"./dist-build-manifest\";\nimport { nativeNodeModulesPlugin } from \"./esbuild-plugins\";\nimport { assertEsbuildBinaryIsLinked } from \"./esbuild-preflight\";\nimport { collectRouteRegistrationSnapshot } from \"./route-registration-snapshot\";\nimport { clearOwnedRouteTypes } from \"../dev-server/route-types-publisher\";\nimport {\n commitDistAsync,\n createTempOutputDir,\n rollbackDistAsync,\n stageDistAsync,\n type StagedDist,\n} from \"./promote-dist\";\nimport { resolveBuildConfig, type ResolvedBuildConfig } from \"./resolve-build-config\";\nimport { tsconfigPathAliases } from \"./tsconfig-path-aliases\";\n\n/**\n * Recreates `require`, `__filename` and `__dirname` at the top of an ESM bundle.\n *\n * Bundled CommonJS dependencies call `require(\"node:assert\")` and read\n * `__dirname` to locate their own assets. Neither exists in an ES module, so\n * esbuild substitutes a stub that throws — **after the build has reported\n * success**. `Dynamic require of \"node:assert\" is not supported` is that stub\n * firing, and it is the defect this shim removes.\n *\n * `__dirname` matters as much as `require`: without it a dependency resolving\n * an asset path silently gets `undefined` and fails later, further from the\n * cause.\n *\n * Written as one line because esbuild inserts a banner verbatim above the\n * bundle and a multi-line string here would shift every mapped line.\n */\nconst ESM_INTEROP_SHIM =\n \"import{createRequire as __wlCreateRequire}from'node:module';\" +\n \"import{fileURLToPath as __wlFileURLToPath}from'node:url';\" +\n \"import{dirname as __wlDirname}from'node:path';\" +\n \"const require=__wlCreateRequire(import.meta.url);\" +\n \"const __filename=__wlFileURLToPath(import.meta.url);\" +\n \"const __dirname=__wlDirname(__filename);\";\n\n/**\n * Combine the framework's banner with the user's, keeping both.\n *\n * esbuild's `banner` is an object keyed by output type, and every merge in the\n * path to it — the config merge and the options spread — REPLACES that object\n * rather than merging it. So whichever is applied second silently deletes the\n * other. This is the only place the two can coexist.\n *\n * The shim goes first: it defines `require`, which a user banner may use.\n *\n * @param userBanner banner from `warlock.config.ts`, if any\n * @param shim the interop shim, or undefined when it does not apply\n */\nfunction mergeBanner(\n userBanner: Record<string, string> | undefined,\n shim: string | undefined,\n): Record<string, string> | undefined {\n if (!shim) return userBanner;\n\n const userJs = userBanner?.js;\n\n return {\n ...userBanner,\n js: userJs ? `${shim}${userJs}` : shim,\n };\n}\n\n/**\n * Prefix every generated file uses to reach the app root.\n *\n * Generated sources are written into `.warlock/production/`, two levels below\n * the app root, so `../../` lands back on it — the same hop already spelled\n * out in the `../../src/app/…` and `../../src/config/…` imports the module and\n * config-loader generators emit. Named once so a generator that needs a new\n * app-root file (`warlock.config`) cannot pick a different depth.\n */\nconst APP_ROOT_FROM_PRODUCTION_DIR = \"../../\";\n\n/**\n * Production Builder\n * Generates production-ready files and bundles them for deployment\n * Build options are loaded from warlock.config.ts\n */\nexport class ProductionBuilder {\n private options!: ResolvedBuildConfig;\n private readonly productionDir = warlockPath(\"production\");\n\n /**\n * Connectors declared in `warlock.config.ts`. Read statically — `build`\n * never calls `boot()`/`start()` on them; it only\n * drains their `build` contributions.\n */\n private connectors: readonly Connector[] = [];\n\n /**\n * The contributors' merged esbuild patch, produced by the `generate` pass\n * and consumed by {@link bundle}.\n */\n private contributedEsbuild: ConnectorEsbuildPatch = {};\n\n /** Browser-safe API metadata captured in a fresh registration-only child. */\n private namedApiRoutes?: readonly import(\"../router/types\").NamedApiRoute[];\n\n /**\n * Main build entry point\n *\n * The esbuild bundle is written into a TEMP directory next to the real\n * output directory, never into it, and that directory is renamed over\n * `outdir` as one filesystem operation — so `outdir` is never observed as\n * a mix of the old build and the new one, and a build that fails before\n * that rename never touches `outdir` at all.\n *\n * `this.options.outdir` is NOT repointed at the temp directory while that\n * happens, and must never be. It is not merely a write target: consumers\n * BAKE it into runtime output — `web`'s build contribution derives the\n * `clientDir` recorded in its pages manifest from it\n * (`web/src/build/contribution.ts`) — so a temp path reaching them\n * produces an artifact whose browser paths point at a directory promotion\n * has since renamed away. The temp path is passed explicitly, as a\n * parameter, to the one operation that writes into it ({@link bundle});\n * everything else, `buildContext()` included, keeps reading the final\n * destination.\n *\n * That is also why promotion is STAGED rather than done at the very end.\n * Connector `emit` hooks write real artifacts (the web client bundle) and\n * see the final `outdir`, so they must run when `outdir` genuinely holds\n * this build — after the rename, not before it, or promotion would replace\n * the directory they just wrote into. The previous build is kept parked\n * aside until they finish: `emit` throwing rolls the whole promotion back,\n * and the build-success marker `warlock start` checks is written last of\n * all, so a failure at any point leaves no `dist` that start will boot.\n */\n public async build(): Promise<void> {\n console.log(colors.cyan(\"Building for production...\\n\"));\n\n // Step 0: Fail fast when esbuild's native binary never got linked (the\n // state pnpm leaves a project in when its build-script approval gate\n // blocked esbuild's postinstall) rather than let bundling die on esbuild's\n // own cryptic \"package could not be found\" error several steps from now.\n assertEsbuildBinaryIsLinked();\n\n // Step 1: Initialize options from config\n await this.initializeOptions();\n\n const finalOutDir = this.options.outdir!;\n const tempOutDir = createTempOutputDir(finalOutDir);\n\n // Set once the temp directory has been renamed onto `finalOutDir`. Its\n // presence is what tells the catch below whether a failure has a\n // promotion to undo or only a temp directory to discard.\n let staged: StagedDist | undefined;\n\n try {\n // Step 2: Generate combined files\n await this.generateCombinedFiles();\n\n // Step 3: Generate entry point\n await this.generateEntryPoint();\n\n // Step 4: Refuse to bundle code the app could not resolve at runtime\n await this.assertGeneratedImports();\n\n // Step 4.5: Drain the connectors' `generate` contributions\n await this.captureNamedApiRoutesForWeb();\n const contributed = await this.runGenerateContributions();\n\n // Step 4.6: Re-assert over what the contributors just wrote.\n //\n // Step 4 only saw core's own generated files; a contributor writes its\n // code (a pages barrel, say) AFTER that assertion, so an undeclared bare\n // specifier in it reaches the bundle unchecked. Under\n // `packages: \"external\"` that specifier survives verbatim into the\n // artifact and dies as ERR_MODULE_NOT_FOUND at runtime — the same failure\n // step 4 exists to prevent. Skipped when nothing contributed: re-globbing\n // and re-reading the production dir is pure cost in the common case.\n if (contributed) {\n await this.assertGeneratedImports();\n }\n\n // Step 5: Bundle with esbuild into the temp directory. The ONLY\n // operation handed that path — it is a write target, not config.\n await this.bundle(tempOutDir);\n\n // Step 5.5: Promote the bundle into `outdir`, keeping the previous\n // build parked aside. `outdir` now holds exactly this build, so the\n // steps below write into — and record — the real destination.\n staged = await stageDistAsync(tempOutDir, finalOutDir);\n\n // Step 5.6: Drain the connectors' `emit` contributions — after the\n // bundle is in place (so what they write survives promotion and the\n // paths they bake in resolve), and BEFORE step 6 deletes the\n // production directory they may still read.\n await runEmitContributions(this.connectors, this.buildContext());\n\n // Step 5.7: Mark `dist` as a genuine, complete build — the one thing\n // `warlock start` trusts. Written LAST on purpose: every earlier step\n // can still fail, and until this file exists nothing will boot what\n // they left behind.\n await writeDistBuildManifestAsync(finalOutDir);\n\n // Step 5.8: Commit — drop the parked previous build. Cannot throw.\n await commitDistAsync(staged);\n } catch (error) {\n if (staged) {\n // The promotion already happened; put the previous build back and\n // take this half-finished one out of `outdir`.\n await rollbackDistAsync(staged);\n } else {\n // Nothing this build produced ever reached `outdir` — discard the\n // temp directory and leave `outdir` exactly as it was.\n await removeDirectoryAsync(tempOutDir).catch(() => undefined);\n }\n\n throw error;\n }\n\n // Step 6: Remove production folder\n await removeDirectoryAsync(this.productionDir);\n\n console.log(colors.green(\"Build complete!\"));\n console.log(`Start production server by running ${colors.cyan(\"warlock start\")}`);\n }\n\n /**\n * Initialize options from warlock.config.ts\n */\n private async initializeOptions(): Promise<void> {\n this.options = resolveBuildConfig();\n // Same config object `resolveBuildConfig` just read — `warlock build`\n // preloads warlock.config.ts, so no additional load happens here.\n const connectors = warlockConfigManager.get(\"connectors\") ?? [];\n\n // Checked here, where the array is first read, so nothing downstream has\n // drained anything yet: the `generate` and `emit` passes run per ENTRY, so\n // a name listed twice would write its files and merge its esbuild options\n // twice into an artifact the runtime then boots that name only once from.\n // A build that half-applied a connector and reported success is worse than\n // one that never started.\n assertUniqueConnectorNames([...connectors]);\n\n // And here rather than only at boot, for the same reason: a name a built-in\n // already owns is skipped by the runtime, so an artifact built from it\n // carries the custom connector's generated files and esbuild patches while\n // the server boots the built-in instead. Refusing it at boot alone would\n // mean the build had already emitted that artifact — the failure has to\n // land on the developer running `warlock build`, not on whoever starts the\n // server. Same assertion the registration half calls, over the same names.\n assertNoReservedConnectorNames([...connectors]);\n\n this.connectors = connectors;\n\n // Ensure production directory exists\n await ensureDirectoryAsync(this.productionDir);\n }\n\n /**\n * The context handed to every build contribution.\n */\n private buildContext(): ConnectorBuildContext {\n return {\n productionDir: this.productionDir,\n appRoot: rootPath(),\n options: this.options,\n namedApiRoutes: this.namedApiRoutes,\n };\n }\n\n /**\n * Web route declarations need application API registration, which cannot be\n * inferred from generated files. Capture it once in a disposable child before\n * contributors write build artifacts; no connector lifecycle runs there.\n */\n private async captureNamedApiRoutesForWeb(): Promise<void> {\n if (!this.connectors.some((connector) => connector.name === \"web\")) {\n await clearOwnedRouteTypes(rootPath());\n return;\n }\n\n this.namedApiRoutes = (\n await collectRouteRegistrationSnapshot({\n cwd: rootPath(),\n timeoutMs: this.options.routeRegistrationTimeoutMs,\n })\n ).routes;\n }\n\n /**\n * Drain the `generate` hooks and fold what they returned back into the\n * build.\n *\n * The entry point is REGENERATED here rather than generated later. The\n * contribution slot is fixed — after `assertGeneratedImports` (so nothing\n * bundles that the app could not resolve) and before `bundle` — while\n * `generateEntryPoint` must stay at step 3, because `app.ts` is itself\n * generated code the assertion has to see; moving it past the assertion\n * would silently drop the entry from that check. Rewriting one small file\n * is cheaper than losing either guarantee, and the write is pure\n * (`generatedFiles` + these imports), so doing it twice is not a\n * correctness risk.\n *\n * @returns whether any connector ran a `generate` hook — the caller uses it\n * to decide if the import assertion is worth a second pass. Keyed on the\n * hook EXISTING, not on what it returned: a hook that returns nothing may\n * still have written files into `productionDir`, and those are exactly the\n * files the second pass is there to read.\n */\n private async runGenerateContributions(): Promise<boolean> {\n const contributed = this.connectors.some((connector) => Boolean(connector.build?.generate));\n\n const { entryImports, esbuild } = await runGenerateContributions(\n this.connectors,\n this.buildContext(),\n );\n\n this.contributedEsbuild = esbuild;\n\n if (entryImports.length > 0) {\n await this.generateEntryPoint(entryImports);\n }\n\n return contributed;\n }\n\n /**\n * Track which special files were generated\n */\n private generatedFiles = {\n locales: false,\n events: false,\n main: false,\n routes: false,\n workers: false,\n };\n\n /**\n * Generate all combined files\n */\n private async generateCombinedFiles(): Promise<void> {\n console.log(colors.yellow(\" Generating production files...\"));\n\n // Generate bootstrap.ts file\n await this.generateBootstrap();\n\n // Generate config loader\n await this.generateConfigLoader();\n\n // Generate special files and track which ones have content\n const [locales, events, main, routes, workers] = await Promise.all([\n this.generateLocales(),\n this.generateEvents(),\n this.generateMain(),\n this.generateRoutes(),\n this.generateWorkers(),\n ]);\n\n this.generatedFiles = { locales, events, main, routes, workers };\n }\n\n /**\n * Generate bootstrap.ts - ensures bootstrap() runs first and sets production environment\n */\n private async generateBootstrap(): Promise<void> {\n // ESM hoists imports, so the app bootstrap must be the first import to run first\n const appBootstrapImport = (await fileExistsAsync(appPath(\"bootstrap.ts\")))\n ? \"import './../../src/app/bootstrap';\\n\"\n : \"\";\n\n const content = `${appBootstrapImport}import { bootstrap, Application } from \"@warlock.js/core\";\n\n// Production runtime; NODE_ENV is only defaulted so an explicit value (e.g. staging) wins\nApplication.setRuntimeStrategy(\"production\");\nif (!process.env.NODE_ENV) {\n Application.setEnvironment(\"production\");\n}\n\n// Bootstrap the application\nbootstrap();\n`;\n\n await putFileAsync(path.join(this.productionDir, \"bootstrap.ts\"), content);\n }\n\n /**\n * Fail the build when generated code imports a package the app does not\n * declare.\n *\n * The bundler is configured `packages: \"external\"`, so every bare specifier\n * written above survives verbatim into an artifact that resolves against the\n * **consuming app's** node_modules. A framework-internal dependency imported\n * there resolves by accident under npm/yarn hoisting and dies under pnpm —\n * which is how a production app shipped that could not boot. Rewriting the\n * offending import fixes today's bundle; this check is what stops the next\n * change to the generator from quietly reintroducing it.\n */\n private async assertGeneratedImports(): Promise<void> {\n const generatedPaths = await glob(\"**/*.{ts,tsx,js,mjs}\", {\n cwd: this.productionDir,\n absolute: false,\n });\n\n const [files, appPackage] = await Promise.all([\n Promise.all(\n generatedPaths.map(async (file) => ({\n file,\n content: await getFileAsync(path.join(this.productionDir, file)),\n })),\n ),\n getJsonFileAsync<{ dependencies?: Record<string, string> }>(rootPath(\"package.json\")),\n ]);\n\n assertGeneratedImportsAreDeclared(files, Object.keys(appPackage.dependencies ?? {}));\n }\n\n /**\n * Glob `src/app` and keep the files the shared dev-server predicate accepts,\n * so production discovers exactly what the dev collector does.\n * Returns relative paths from .warlock/production/ to src/app/\n */\n private async globModule(matches: (relativePath: string) => boolean): Promise<string[]> {\n const files = await glob(\"**/*.{ts,tsx,json}\", {\n cwd: appPath(),\n absolute: false,\n });\n\n // e.g., \"users/main.ts\" -> \"../../src/app/users/main\"\n return files\n .filter((file) => matches(\"src/app/\" + file))\n .sort()\n .map((file) => \"../../src/app/\" + file.replace(/\\.(ts|tsx)$/, \"\"));\n }\n\n /**\n * Generate config-loader.ts\n */\n private async generateConfigLoader(): Promise<void> {\n const configDirectory = path.join(process.cwd(), \"src/config\");\n\n const files = await glob(\"**/*.{ts,tsx}\", {\n cwd: configDirectory,\n absolute: false,\n });\n\n // Same key rule as the dev config loader: the raw path, never camel-cased\n const configNames = files\n .filter((f) => isConfigFile(\"src/config/\" + f))\n .map((f) => ({\n path: f.replace(/\\.(ts|tsx)$/, \"\"),\n key: configKeyFromPath(\"src/config/\" + f),\n }))\n .filter((entry): entry is { path: string; key: string } => entry.key !== undefined)\n .sort((a, b) => a.path.localeCompare(b.path));\n\n // Only `@warlock.js/core` — the one package the app itself declares. See\n // `assertGeneratedImportsAreDeclared`: `@mongez/config` is core's own\n // dependency, so a bare import of it resolved by luck under npm/yarn\n // hoisting and died under pnpm's strict layout.\n const imports: string[] = [\n 'import { assertValidConfigModules, configSpecialHandlers, setConfig } from \"@warlock.js/core\";',\n ];\n const configImports: string[] = [];\n const configSetCalls: string[] = [];\n const validations: string[] = [];\n const executors: string[] = [];\n\n configNames.forEach(({ path: configPath, key }, index) => {\n // Index-based identifier: keys like \"rate-limit\" or \"mail/smtp\" are not valid names.\n // A namespace import, so a file's optional `configSchema` export travels with it.\n const varName = `config${index}`;\n const name = JSON.stringify(key);\n configImports.push(`import * as ${varName} from \"../../src/config/${configPath}\";`);\n configSetCalls.push(`setConfig(${name}, ${varName}.default);`);\n validations.push(` { name: ${name}, module: ${varName} },`);\n executors.push(`await configSpecialHandlers.execute(${name}, ${varName}.default);`);\n });\n\n // ESM hoists imports, so prestart must be the first import to run first\n const prestartImports = (await fileExistsAsync(appPath(\"prestart.ts\")))\n ? [\"import './../../src/app/prestart';\"]\n : [];\n\n const content = [\n ...prestartImports,\n ...imports,\n \"\",\n \"// Config imports\",\n ...configImports,\n \"\",\n \"// Register configs\",\n ...configSetCalls,\n \"\",\n \"// Refuse to start when a config file's `configSchema` is not satisfied\",\n \"await assertValidConfigModules([\",\n ...validations,\n \"]);\",\n \"\",\n \"// Special handlers\",\n ...executors,\n \"\",\n ].join(\"\\n\");\n\n await putFileAsync(path.join(this.productionDir, \"config-loader.ts\"), content);\n }\n\n /**\n * Generate locales.ts (only if there are locale files)\n * @returns true if file was generated with content\n */\n private async generateLocales(): Promise<boolean> {\n const files = await this.globModule(isLocaleFile);\n if (files.length === 0) return false;\n const content = files\n .map((file, index) => {\n if (!file.endsWith(\".json\")) return `import \"${file}\";`;\n const moduleFolder = file.split(\"/\").at(-3)!;\n return [\n `import dictionary${index} from \"${file}\";`,\n 'import { registerLocaleDictionary } from \"@warlock.js/core\";',\n `registerLocaleDictionary({ sourceFile: ${JSON.stringify(file)}, source: JSON.stringify(dictionary${index}), defaultNamespace: ${JSON.stringify(moduleFolder)} });`,\n ].join(\"\\n\");\n })\n .join(\"\\n\");\n await putFileAsync(path.join(this.productionDir, \"locales.ts\"), content + \"\\n\");\n return true;\n }\n\n /**\n * Generate events.ts (only if there are event files)\n * @returns true if file was generated with content\n */\n private async generateEvents(): Promise<boolean> {\n const files = await this.globModule(isEventFile);\n if (files.length === 0) return false;\n await this.generateImportsFile(files, \"events.ts\");\n return true;\n }\n\n /**\n * Generate main.ts (only if there are main files)\n * @returns true if file was generated with content\n */\n private async generateMain(): Promise<boolean> {\n const files = await this.globModule(isMainFile);\n if (files.length === 0) return false;\n await this.generateImportsFile(files, \"main.ts\");\n return true;\n }\n\n /**\n * Generate routes.ts (only if there are route files)\n * @returns true if file was generated with content\n */\n private async generateRoutes(): Promise<boolean> {\n const files = await this.globModule(isRouteFile);\n if (files.length === 0) return false;\n await this.generateImportsFile(files, \"routes.ts\");\n return true;\n }\n\n /**\n * Generate workers.ts (only if there are worker files)\n * @returns true if file was generated with content\n */\n private async generateWorkers(): Promise<boolean> {\n const files = await this.globModule(isWorkerFile);\n if (files.length === 0) return false;\n await this.generateImportsFile(files, \"workers.ts\");\n return true;\n }\n\n /**\n * Generate a file with imports from all given files\n */\n private async generateImportsFile(importPaths: string[], outputFile: string): Promise<void> {\n const imports = importPaths.map((importPath) => `import \"${importPath}\";`);\n const content = imports.join(\"\\n\") + \"\\n\";\n await putFileAsync(path.join(this.productionDir, outputFile), content);\n }\n\n /**\n * Generate the main entry point (app.ts)\n *\n * @param contributedImports lines from connector `generate` hooks, appended\n * to section 4 after `./routes`\n */\n private async generateEntryPoint(contributedImports: string[] = []): Promise<void> {\n console.log(colors.yellow(\" Generating entry point...\"));\n\n // The names this build resolved, baked in as a literal. The entry imports\n // the config source, and that source is re-evaluated at startup — an\n // env-conditional `connectors` array can hand the boot a different list\n // than the one drained here. A literal is the only part of the array that\n // survives into the artifact unchanged, so it is what the boot compares\n // against.\n const expectedNames = this.connectors\n .map((connector) => JSON.stringify(connector.name))\n .join(\", \");\n\n // Build imports based on which files were generated\n const imports: string[] = [\n \"// 1. Bootstrap (loads .env, initializes framework)\",\n 'import \"./bootstrap\";',\n \"\",\n \"// 2. Load configs\",\n 'import \"./config-loader\";',\n \"\",\n // Registration has to sit between the config being available and the\n // first phase starting: the connectors listed in `connectors` are the\n // same ones this build drained contributions from, so the bundle boots\n // exactly what it was built for. Register any later and an early-phase\n // connector would miss its own start.\n \"// 2.5 Register connectors declared in warlock.config (the same array this\",\n \"// build read its contributions from, so built-for and boots-with match).\",\n \"// The config is imported STATICALLY so esbuild bakes it into the bundle\",\n \"// and the array is handed over explicitly — an artifact has no\",\n \"// warlock.config.ts beside it to read at runtime, and a registration\",\n \"// that quietly found nothing to register is the exact drift this\",\n \"// section exists to prevent.\",\n \"// `expectedNames` is the list this build resolved, in order — boot\",\n \"// refuses to start when the config hands over a different set or order.\",\n 'import { registerConfiguredConnectors } from \"@warlock.js/core\";',\n `import warlockConfig from \"${APP_ROOT_FROM_PRODUCTION_DIR}warlock.config\";`,\n `registerConfiguredConnectors(warlockConfig.connectors ?? [], { expectedNames: [${expectedNames}] });`,\n \"\",\n \"// 2.6 Fail fast on a busy port. `http` is a LATE-phase connector, so its\",\n \"// own preflight is not reached until the database and cache have\",\n \"// connected and every app module has been imported — seconds of work\",\n \"// thrown away before anyone learns the port was taken. This probe is\",\n \"// a bind-and-release on a socket that is never served, and it reports\",\n \"// on stderr because no log channel is configured this early.\",\n 'import { Application, connectorsManager, ConnectorLifecyclePhase, preflightConfiguredHttpPort } from \"@warlock.js/core\";',\n 'if (Application.hasRole(\"api\") || Application.hasRole(\"web\")) {',\n \" await preflightConfiguredHttpPort();\",\n \"}\",\n \"\",\n \"// 3. Start early-phase connectors (database, cache, logger, ...)\",\n \"// so data sources, cache, etc. are ready before app code runs\",\n \"await connectorsManager.startPhase(ConnectorLifecyclePhase.Early);\",\n ];\n\n // App code uses dynamic `await import(...)` so each module's side\n // effects fire at THIS point in execution. Static imports would be\n // hoisted to module-instantiation time (before the early-phase await\n // resolves), which is exactly the bug this split is meant to fix.\n //\n // The guarantee comes from the imports being DYNAMIC — esbuild wraps a\n // dynamically-imported module in its `__esm(() => {…})` helper and runs\n // it at the await, not at instantiation. It does NOT come from\n // `splitting: true`, which only decides one-file-vs-chunks. This\n // previously said splitting was required; it is not, and `singleBundle`\n // (splitting: false) preserves the ordering.\n imports.push(\"\", \"// 4. Load app code (events, locales, main, routes)\");\n\n if (this.generatedFiles.events) {\n imports.push('await import(\"./events\");');\n }\n if (this.generatedFiles.locales) {\n imports.push('await import(\"./locales\");');\n }\n if (this.generatedFiles.main) {\n imports.push('await import(\"./main\");');\n }\n if (this.generatedFiles.routes) {\n imports.push('if (Application.hasRole(\"api\")) {', ' await import(\"./routes\");', \"}\");\n }\n if (this.generatedFiles.workers) {\n imports.push('if (Application.hasRole(\"worker\")) {', ' await import(\"./workers\");', \"}\");\n }\n\n // Contributor imports come AFTER `./routes`, never before: a connector\n // that registers pages needs the routes app code already collected —\n // the same ordering dev uses (routes first, then the connector installs\n // on top of them). Emitted verbatim; the contributor writes the whole\n // statement (e.g. `await import(\"./pages\");`).\n imports.push(...contributedImports);\n\n // A rejecting validator (Application.onValidateBoot) must abort boot\n // before late-phase connectors bind a port.\n imports.push(\n \"\",\n \"// 5. Run startup validators registered via Application.onValidateBoot(...)\",\n \"await Application.runStartupValidators();\",\n );\n\n // Start late-phase connectors after app code registers routes/listeners\n imports.push(\n \"\",\n \"// 6. Start late-phase connectors (http, socket) — routes and\",\n \"// listeners registered by app code are now ready to bind\",\n \"await connectorsManager.startPhase(ConnectorLifecyclePhase.Late);\",\n \"\",\n \"// 7. Signal a complete boot so `Application.onceBooted(...)` listeners fire\",\n \"Application.markBooted({ environment: Application.environment, runtimeStrategy: Application.runtimeStrategy });\",\n \"connectorsManager.shutdownOnProcessKill();\",\n );\n\n const content = imports.join(\"\\n\") + \"\\n\";\n await putFileAsync(path.join(this.productionDir, \"app.ts\"), content);\n }\n\n /**\n * Bundle with esbuild\n *\n * @param writeOutDir the directory esbuild writes into — the build's\n * private temp directory, NOT `options.outdir`. Taken as a parameter\n * rather than read off `this.options` because the two are different paths\n * with different meanings: `options.outdir` is the final destination every\n * consumer bakes into the artifact, and this is only where bytes land\n * before promotion moves them there.\n */\n private async bundle(writeOutDir: string): Promise<void> {\n console.log(colors.magenta(\" Bundling with esbuild...\"));\n\n const entryPoint = path.join(this.productionDir, \"app.ts\");\n const outFileName = this.options.outFile!;\n // Strip extension so entryNames produces \"<base>.js\" via esbuild\n const entryName = path.basename(outFileName, path.extname(outFileName));\n\n // `singleBundle` and `esmShim` are ours, not esbuild's — it throws on\n // unknown keys, and the user options are spread into its call verbatim.\n const singleBundle = this.options.singleBundle === true;\n const esmShim = this.options.esmShim !== false;\n // Read before deleting: the merged banner is applied AFTER the user\n // spread, so a user banner must not be lost to it or clobber the shim.\n const userBanner = this.options.banner;\n\n // `outFile` and `entryPath` are REQUIRED on ResolvedBuildConfig on purpose:\n // resolve-build-config.ts documents that widening them pushed a lie downstream\n // into start-production.command.ts, which then could not trust its own config.\n // This is the one place they must be absent - the object is spread into esbuild's\n // call verbatim and esbuild throws on unknown keys.\n //\n // Stripped off a LOCAL COPY of `this.options`, never off `this.options`\n // itself: `buildContext()` hands `this.options` to every `generate`/`emit`\n // contribution hook, including the `emit` pass that runs AFTER this method\n // returns (`build()` step 5.6). Deleting these keys from the shared object\n // used to leave those hooks reading `undefined` for `outFile`, `entryPath`,\n // `singleBundle`, `esmShim` and `banner` even though `ConnectorBuildContext`\n // types them as present. A shallow copy is enough — every field this method\n // reads off it is either scalar or already re-merged below (`define`,\n // `external`, `loader`, `banner`), so nothing here needs a deep clone.\n const esbuildOptions: Partial<ResolvedBuildConfig> = { ...this.options };\n\n delete esbuildOptions.outFile;\n delete esbuildOptions.entryPath;\n delete esbuildOptions.singleBundle;\n delete esbuildOptions.esmShim;\n delete esbuildOptions.banner;\n delete esbuildOptions.routeRegistrationTimeoutMs;\n\n await ensureDirectoryAsync(writeOutDir);\n\n const alias = this.buildAliasMapFromTsconfig();\n\n // Whether this build decides externality per import EDGE\n // (`bundle-framework-dependencies.ts`, which explains the rule at\n // length) or keeps the blunt `packages: \"external\"`.\n //\n // Not in `singleBundle` mode: that bundles everything by definition, and\n // a plugin that can only ever ADD an external would silently narrow it.\n // Not when the user set `packages` themselves: their value has always\n // won over the default below, and it must keep winning — the plugin is\n // the default's implementation, not a new policy layered on top.\n const perEdgeExternals = !singleBundle && (esbuildOptions as any).packages === undefined;\n\n // The user can override `format`, so gate the shim on the EFFECTIVE\n // format rather than on the default below. A CJS build already has\n // `require` and friends; injecting them there would be a redefinition.\n const isEsm = (esbuildOptions.format ?? \"esm\") === \"esm\";\n const banner = mergeBanner(userBanner, esmShim && isEsm ? ESM_INTEROP_SHIM : undefined);\n\n // Contributor patch, split into the part that can ride the spread order\n // and the three keys that cannot. `jsx` and `jsxImportSource` are placed\n // BEFORE the user spread below, which gives the ruled precedence for\n // free: builder defaults < contributor < user config.\n //\n // `define`, `external` and `loader` are pulled out because a spread\n // REPLACES them wholesale — the same trap `banner` documents. Two\n // contributors' env defines, a contributor's optional peers plus the\n // user's, or a contributor's `.svg` loader alongside the user's `.png`,\n // must both survive, so they are merged by key/by set and re-applied\n // after the spread with the user still winning per key.\n const {\n define: contributedDefine,\n external: contributedExternal,\n loader: contributedLoader,\n plugins: contributedPlugins,\n ...contributedOptions\n } = this.contributedEsbuild;\n\n const userDefine: Record<string, string> | undefined = esbuildOptions.define;\n const userExternal: string[] | undefined = esbuildOptions.external;\n const userLoader: ConnectorEsbuildPatch[\"loader\"] = esbuildOptions.loader;\n\n const define =\n contributedDefine || userDefine ? { ...contributedDefine, ...userDefine } : undefined;\n\n const loader =\n contributedLoader || userLoader ? { ...contributedLoader, ...userLoader } : undefined;\n\n const external =\n contributedExternal || userExternal\n ? dedupe([...(contributedExternal ?? []), ...(userExternal ?? [])])\n : undefined;\n\n if (singleBundle) {\n console.log(\n colors.magenta(\n \" Single-bundle mode — one JS file\" +\n (esmShim && isEsm ? \" with the ESM interop shim\" : \"\") +\n \". Native .node addons are still emitted alongside it.\",\n ),\n );\n }\n\n try {\n await esbuild.build({\n platform: \"node\",\n entryPoints: [entryPoint],\n bundle: true,\n // Both are DEFAULTS the user can override — they sit before the\n // `...esbuildOptions` spread deliberately. `singleBundle` moves them,\n // an explicit `splitting`/`packages` in warlock.config.ts beats both.\n //\n // Phase ordering does not depend on `splitting`: it comes from the\n // generated app.ts using dynamic `await import(...)` (see\n // generateAppEntry above), which esbuild defers to the call site in\n // either mode. Splitting only decides one file vs chunks.\n splitting: !singleBundle,\n // `\"bundle\"` under `perEdgeExternals` is not \"bundle everything\":\n // the plugin below returns `external: true` for every bare specifier\n // this build must not bundle, which is all of them bar the framework's\n // own declared dependencies. Saying `\"external\"` here instead would\n // externalise them before the plugin could rule.\n packages: singleBundle || perEdgeExternals ? \"bundle\" : \"external\",\n minify: esbuildOptions.minify,\n sourcemap: esbuildOptions.sourcemap === true ? \"linked\" : esbuildOptions.sourcemap,\n format: \"esm\",\n // Targeting a concrete Node version (not \"esnext\") so esbuild\n // transpiles TC39 stage 3 decorators into helpers — Node does not\n // implement them natively yet.\n target: [\"node22\"],\n entryNames: entryName,\n alias,\n plugins: [\n nativeNodeModulesPlugin,\n // BEFORE the framework-dependency plugin, and the order is\n // load-bearing: the first `onResolve` callback to answer wins, and\n // `app/users/...` is a bare specifier the other one would rule\n // external.\n tsconfigPathAliases(this.tsconfigPathAliasConfig()),\n ...(perEdgeExternals\n ? [bundleFrameworkDependencies({ appRoot: rootPath(), aliasKeys: Object.keys(alias) })]\n : []),\n // Contributor plugins run last: they load their own file types and\n // must not shadow the resolvers above.\n ...(contributedPlugins ?? []),\n ],\n // Between the defaults and the user spread — the ruled precedence.\n ...contributedOptions,\n ...(esbuildOptions as any),\n // AFTER the spread, and NOT overridable: `esbuildOptions.outdir` rides\n // that spread carrying the FINAL destination, which is exactly where\n // this build must not write yet. The final path is the user's setting\n // and stays authoritative for everyone reading the config — it is only\n // this one esbuild call that is redirected, and only until promotion\n // moves the result onto that very path.\n outdir: writeOutDir,\n // AFTER the spread for the same reason `banner` is: a spread replaces\n // these objects instead of merging them, so the merged values are\n // re-applied here. The user still wins — they were merged in last.\n ...(define ? { define } : {}),\n ...(external ? { external } : {}),\n ...(loader ? { loader } : {}),\n // AFTER the spread, and intentionally so: `banner` is an object, and\n // both the config merge and this spread REPLACE it wholesale rather\n // than merging. Left as a default above, any user banner would delete\n // the shim; left to the spread, the shim would delete theirs. The\n // merge is the only form that keeps both.\n ...(banner ? { banner } : {}),\n });\n } catch (e) {\n console.log(e);\n throw e;\n }\n }\n\n /**\n * The WILDCARD half of the same tsconfig `paths` map that\n * {@link ProductionBuilder.buildAliasMapFromTsconfig} reads the exact half\n * of. `tsconfig-path-aliases.ts` explains why the two halves need different\n * mechanisms — in short, esbuild's `alias` option cannot express a wildcard,\n * so the entries it skips have to be resolved by a plugin instead of being\n * left to no one.\n */\n private tsconfigPathAliasConfig(): { baseUrl: string; paths: Record<string, string[]> } {\n tsconfigManager.init();\n\n return {\n baseUrl: path.resolve(process.cwd(), tsconfigManager.baseUrl),\n paths: tsconfigManager.aliases as Record<string, string[]>,\n };\n }\n\n /**\n * Build an alias map from tsconfig `paths` so esbuild resolves local\n * source aliases (e.g. `@warlock.js/cascade`) to their on-disk source\n * folders during bundling. Without this, `packages: \"external\"` would\n * leave those bare specifiers as raw imports and Node would fail to\n * resolve them at runtime (they aren't installed in node_modules).\n *\n * Only exact (non-wildcard) aliases are included — esbuild's `alias`\n * option doesn't support glob-style mappings. The wildcard half is not\n * dropped, it is handled elsewhere: see\n * {@link ProductionBuilder.tsconfigPathAliasConfig}.\n */\n private buildAliasMapFromTsconfig(): Record<string, string> {\n tsconfigManager.init();\n\n const alias: Record<string, string> = {};\n const baseUrl = path.resolve(process.cwd(), tsconfigManager.baseUrl);\n\n for (const [from, to] of Object.entries(tsconfigManager.aliases)) {\n if (from.endsWith(\"/*\") || !Array.isArray(to) || to.length === 0) {\n continue;\n }\n\n const target = to[0];\n\n if (target === undefined) {\n continue;\n }\n\n alias[from] = path.resolve(baseUrl, target);\n }\n\n return alias;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAM,mBACJ;;;;;;;;;;;;;;AAoBF,SAAS,YACP,YACA,MACoC;CACpC,IAAI,CAAC,MAAM,OAAO;CAElB,MAAM,SAAS,YAAY;CAE3B,OAAO;EACL,GAAG;EACH,IAAI,SAAS,GAAG,OAAO,WAAW;CACpC;AACF;;;;;;;;;;AAWA,MAAM,+BAA+B;;;;;;AAOrC,IAAa,oBAAb,MAA+B;;uBAEI,YAAY,YAAY;oBAOd,CAAC;4BAMQ,CAAC;wBAoO5B;GACvB,SAAS;GACT,QAAQ;GACR,MAAM;GACN,QAAQ;GACR,SAAS;EACX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAxMA,MAAa,QAAuB;EAClC,QAAQ,IAAI,OAAO,KAAK,8BAA8B,CAAC;EAMvD,4BAA4B;EAG5B,MAAM,KAAK,kBAAkB;EAE7B,MAAM,cAAc,KAAK,QAAQ;EACjC,MAAM,aAAa,oBAAoB,WAAW;EAKlD,IAAI;EAEJ,IAAI;GAEF,MAAM,KAAK,sBAAsB;GAGjC,MAAM,KAAK,mBAAmB;GAG9B,MAAM,KAAK,uBAAuB;GAGlC,MAAM,KAAK,4BAA4B;GAYvC,IAAI,MAXsB,KAAK,yBAAyB,GAYtD,MAAM,KAAK,uBAAuB;GAKpC,MAAM,KAAK,OAAO,UAAU;GAK5B,SAAS,MAAM,eAAe,YAAY,WAAW;GAMrD,MAAM,qBAAqB,KAAK,YAAY,KAAK,aAAa,CAAC;GAM/D,MAAM,4BAA4B,WAAW;GAG7C,MAAM,gBAAgB,MAAM;EAC9B,SAAS,OAAO;GACd,IAAI,QAG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;KAClD,GAAI,mBACA,CAAC,4BAA4B;MAAE,SAAS,SAAS;MAAG,WAAW,OAAO,KAAK,KAAK;KAAE,CAAC,CAAC,IACpF,CAAC;KAGL,GAAI,sBAAsB,CAAC;IAC7B;IAEA,GAAG;IACH,GAAI;IAOJ,QAAQ;IAIR,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;IAC3B,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;IAC/B,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;IAM3B,GAAI,SAAS,EAAE,OAAO,IAAI,CAAC;GAC7B,CAAC;EACH,SAAS,GAAG;GACV,QAAQ,IAAI,CAAC;GACb,MAAM;EACR;CACF;;;;;;;;;CAUA,AAAQ,0BAAgF;EACtF,gBAAgB,KAAK;EAErB,OAAO;GACL,SAAS,KAAK,QAAQ,QAAQ,IAAI,GAAG,gBAAgB,OAAO;GAC5D,OAAO,gBAAgB;EACzB;CACF;;;;;;;;;;;;;CAcA,AAAQ,4BAAoD;EAC1D,gBAAgB,KAAK;EAErB,MAAM,QAAgC,CAAC;EACvC,MAAM,UAAU,KAAK,QAAQ,QAAQ,IAAI,GAAG,gBAAgB,OAAO;EAEnE,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,gBAAgB,OAAO,GAAG;GAChE,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,QAAQ,EAAE,KAAK,GAAG,WAAW,GAC7D;GAGF,MAAM,SAAS,GAAG;GAElB,IAAI,WAAW,QACb;GAGF,MAAM,QAAQ,KAAK,QAAQ,SAAS,MAAM;EAC5C;EAEA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"production-builder.mjs","names":[],"sources":["../../../../../../../../packages/core/src/production/production-builder.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport {\n ensureDirectoryAsync,\n fileExistsAsync,\n getFileAsync,\n getJsonFileAsync,\n putFileAsync,\n removeDirectoryAsync,\n} from \"@warlock.js/fs\";\nimport esbuild from \"esbuild\";\nimport glob from \"fast-glob\";\nimport path from \"path\";\nimport { assertNoReservedConnectorNames } from \"../connectors/assert-no-reserved-connector-names\";\nimport { assertUniqueConnectorNames } from \"../connectors/assert-unique-connector-names\";\nimport type { Connector, ConnectorBuildContext, ConnectorEsbuildPatch } from \"../connectors/types\";\nimport { configKeyFromPath } from \"../config/config-key-from-path\";\nimport {\n isConfigFile,\n isEventFile,\n isLocaleFile,\n isMainFile,\n isRouteFile,\n isWorkerFile,\n} from \"../dev-server/special-file-patterns\";\nimport { tsconfigManager } from \"../dev-server/tsconfig-manager\";\nimport { appPath, rootPath, warlockPath } from \"../utils\";\nimport { warlockConfigManager } from \"../warlock-config/warlock-config.manager\";\nimport { assertGeneratedImportsAreDeclared } from \"./assert-generated-imports\";\nimport { bundleFrameworkDependencies } from \"./bundle-framework-dependencies\";\nimport { dedupe, runEmitContributions, runGenerateContributions } from \"./build-contributions\";\nimport { writeDistBuildManifestAsync } from \"./dist-build-manifest\";\nimport { nativeNodeModulesPlugin } from \"./esbuild-plugins\";\nimport { assertEsbuildBinaryIsLinked } from \"./esbuild-preflight\";\nimport { collectRouteRegistrationSnapshot } from \"./route-registration-snapshot\";\nimport { clearOwnedRouteTypes } from \"../dev-server/route-types-publisher\";\nimport {\n commitDistAsync,\n createTempOutputDir,\n rollbackDistAsync,\n stageDistAsync,\n type StagedDist,\n} from \"./promote-dist\";\nimport { resolveBuildConfig, type ResolvedBuildConfig } from \"./resolve-build-config\";\nimport { tsconfigPathAliases } from \"./tsconfig-path-aliases\";\n\n/**\n * Recreates `require`, `__filename` and `__dirname` at the top of an ESM bundle.\n *\n * Bundled CommonJS dependencies call `require(\"node:assert\")` and read\n * `__dirname` to locate their own assets. Neither exists in an ES module, so\n * esbuild substitutes a stub that throws — **after the build has reported\n * success**. `Dynamic require of \"node:assert\" is not supported` is that stub\n * firing, and it is the defect this shim removes.\n *\n * `__dirname` matters as much as `require`: without it a dependency resolving\n * an asset path silently gets `undefined` and fails later, further from the\n * cause.\n *\n * Written as one line because esbuild inserts a banner verbatim above the\n * bundle and a multi-line string here would shift every mapped line.\n */\nconst ESM_INTEROP_SHIM =\n \"import{createRequire as __wlCreateRequire}from'node:module';\" +\n \"import{fileURLToPath as __wlFileURLToPath}from'node:url';\" +\n \"import{dirname as __wlDirname}from'node:path';\" +\n \"const require=__wlCreateRequire(import.meta.url);\" +\n \"const __filename=__wlFileURLToPath(import.meta.url);\" +\n \"const __dirname=__wlDirname(__filename);\";\n\n/**\n * Combine the framework's banner with the user's, keeping both.\n *\n * esbuild's `banner` is an object keyed by output type, and every merge in the\n * path to it — the config merge and the options spread — REPLACES that object\n * rather than merging it. So whichever is applied second silently deletes the\n * other. This is the only place the two can coexist.\n *\n * The shim goes first: it defines `require`, which a user banner may use.\n *\n * @param userBanner banner from `warlock.config.ts`, if any\n * @param shim the interop shim, or undefined when it does not apply\n */\nfunction mergeBanner(\n userBanner: Record<string, string> | undefined,\n shim: string | undefined,\n): Record<string, string> | undefined {\n if (!shim) return userBanner;\n\n const userJs = userBanner?.js;\n\n return {\n ...userBanner,\n js: userJs ? `${shim}${userJs}` : shim,\n };\n}\n\n/**\n * Prefix every generated file uses to reach the app root.\n *\n * Generated sources are written into `.warlock/production/`, two levels below\n * the app root, so `../../` lands back on it — the same hop already spelled\n * out in the `../../src/app/…` and `../../src/config/…` imports the module and\n * config-loader generators emit. Named once so a generator that needs a new\n * app-root file (`warlock.config`) cannot pick a different depth.\n */\nconst APP_ROOT_FROM_PRODUCTION_DIR = \"../../\";\n\n/**\n * Production Builder\n * Generates production-ready files and bundles them for deployment\n * Build options are loaded from warlock.config.ts\n */\nexport class ProductionBuilder {\n private options!: ResolvedBuildConfig;\n private readonly productionDir = warlockPath(\"production\");\n\n /**\n * Connectors declared in `warlock.config.ts`. Read statically — `build`\n * never calls `boot()`/`start()` on them; it only\n * drains their `build` contributions.\n */\n private connectors: readonly Connector[] = [];\n\n /**\n * The contributors' merged esbuild patch, produced by the `generate` pass\n * and consumed by {@link bundle}.\n */\n private contributedEsbuild: ConnectorEsbuildPatch = {};\n\n /** Browser-safe API metadata captured in a fresh registration-only child. */\n private namedApiRoutes?: readonly import(\"../router/types\").NamedApiRoute[];\n\n /**\n * Main build entry point\n *\n * The esbuild bundle is written into a TEMP directory next to the real\n * output directory, never into it, and that directory is renamed over\n * `outdir` as one filesystem operation — so `outdir` is never observed as\n * a mix of the old build and the new one, and a build that fails before\n * that rename never touches `outdir` at all.\n *\n * `this.options.outdir` is NOT repointed at the temp directory while that\n * happens, and must never be. It is not merely a write target: consumers\n * BAKE it into runtime output — `web`'s build contribution derives the\n * `clientDir` recorded in its pages manifest from it\n * (`web/src/build/contribution.ts`) — so a temp path reaching them\n * produces an artifact whose browser paths point at a directory promotion\n * has since renamed away. The temp path is passed explicitly, as a\n * parameter, to the one operation that writes into it ({@link bundle});\n * everything else, `buildContext()` included, keeps reading the final\n * destination.\n *\n * That is also why promotion is STAGED rather than done at the very end.\n * Connector `emit` hooks write real artifacts (the web client bundle) and\n * see the final `outdir`, so they must run when `outdir` genuinely holds\n * this build — after the rename, not before it, or promotion would replace\n * the directory they just wrote into. The previous build is kept parked\n * aside until they finish: `emit` throwing rolls the whole promotion back,\n * and the build-success marker `warlock start` checks is written last of\n * all, so a failure at any point leaves no `dist` that start will boot.\n */\n public async build(): Promise<void> {\n console.log(colors.cyan(\"Building for production...\\n\"));\n\n // Step 0: Fail fast when esbuild's native binary never got linked (the\n // state pnpm leaves a project in when its build-script approval gate\n // blocked esbuild's postinstall) rather than let bundling die on esbuild's\n // own cryptic \"package could not be found\" error several steps from now.\n assertEsbuildBinaryIsLinked();\n\n // Step 1: Initialize options from config\n await this.initializeOptions();\n\n const finalOutDir = this.options.outdir!;\n const tempOutDir = createTempOutputDir(finalOutDir);\n\n // Set once the temp directory has been renamed onto `finalOutDir`. Its\n // presence is what tells the catch below whether a failure has a\n // promotion to undo or only a temp directory to discard.\n let staged: StagedDist | undefined;\n\n try {\n // Step 2: Generate combined files\n await this.generateCombinedFiles();\n\n // Step 3: Generate entry point\n await this.generateEntryPoint();\n\n // Step 4: Refuse to bundle code the app could not resolve at runtime\n await this.assertGeneratedImports();\n\n // Step 4.5: Drain the connectors' `generate` contributions\n await this.captureNamedApiRoutesForWeb();\n const contributed = await this.runGenerateContributions();\n\n // Step 4.6: Re-assert over what the contributors just wrote.\n //\n // Step 4 only saw core's own generated files; a contributor writes its\n // code (a pages barrel, say) AFTER that assertion, so an undeclared bare\n // specifier in it reaches the bundle unchecked. Under\n // `packages: \"external\"` that specifier survives verbatim into the\n // artifact and dies as ERR_MODULE_NOT_FOUND at runtime — the same failure\n // step 4 exists to prevent. Skipped when nothing contributed: re-globbing\n // and re-reading the production dir is pure cost in the common case.\n if (contributed) {\n await this.assertGeneratedImports();\n }\n\n // Step 5: Bundle with esbuild into the temp directory. The ONLY\n // operation handed that path — it is a write target, not config.\n await this.bundle(tempOutDir);\n\n // Step 5.5: Promote the bundle into `outdir`, keeping the previous\n // build parked aside. `outdir` now holds exactly this build, so the\n // steps below write into — and record — the real destination.\n staged = await stageDistAsync(tempOutDir, finalOutDir);\n\n // Step 5.6: Drain the connectors' `emit` contributions — after the\n // bundle is in place (so what they write survives promotion and the\n // paths they bake in resolve), and BEFORE step 6 deletes the\n // production directory they may still read.\n await runEmitContributions(this.connectors, this.buildContext());\n\n // Step 5.7: Mark `dist` as a genuine, complete build — the one thing\n // `warlock start` trusts. Written LAST on purpose: every earlier step\n // can still fail, and until this file exists nothing will boot what\n // they left behind.\n await writeDistBuildManifestAsync(finalOutDir);\n\n // Step 5.8: Commit — drop the parked previous build. Cannot throw.\n await commitDistAsync(staged);\n } catch (error) {\n if (staged) {\n // The promotion already happened; put the previous build back and\n // take this half-finished one out of `outdir`.\n await rollbackDistAsync(staged);\n } else {\n // Nothing this build produced ever reached `outdir` — discard the\n // temp directory and leave `outdir` exactly as it was.\n await removeDirectoryAsync(tempOutDir).catch(() => undefined);\n }\n\n throw error;\n }\n\n // Step 6: Remove production folder\n await removeDirectoryAsync(this.productionDir);\n\n console.log(colors.green(\"Build complete!\"));\n console.log(`Start production server by running ${colors.cyan(\"warlock start\")}`);\n }\n\n /**\n * Initialize options from warlock.config.ts\n */\n private async initializeOptions(): Promise<void> {\n this.options = resolveBuildConfig();\n // Same config object `resolveBuildConfig` just read — `warlock build`\n // preloads warlock.config.ts, so no additional load happens here.\n const connectors = warlockConfigManager.get(\"connectors\") ?? [];\n\n // Checked here, where the array is first read, so nothing downstream has\n // drained anything yet: the `generate` and `emit` passes run per ENTRY, so\n // a name listed twice would write its files and merge its esbuild options\n // twice into an artifact the runtime then boots that name only once from.\n // A build that half-applied a connector and reported success is worse than\n // one that never started.\n assertUniqueConnectorNames([...connectors]);\n\n // And here rather than only at boot, for the same reason: a name a built-in\n // already owns is skipped by the runtime, so an artifact built from it\n // carries the custom connector's generated files and esbuild patches while\n // the server boots the built-in instead. Refusing it at boot alone would\n // mean the build had already emitted that artifact — the failure has to\n // land on the developer running `warlock build`, not on whoever starts the\n // server. Same assertion the registration half calls, over the same names.\n assertNoReservedConnectorNames([...connectors]);\n\n this.connectors = connectors;\n\n // Ensure production directory exists\n await ensureDirectoryAsync(this.productionDir);\n }\n\n /**\n * The context handed to every build contribution.\n */\n private buildContext(): ConnectorBuildContext {\n return {\n productionDir: this.productionDir,\n appRoot: rootPath(),\n options: this.options,\n namedApiRoutes: this.namedApiRoutes,\n };\n }\n\n /**\n * Web route declarations need application API registration, which cannot be\n * inferred from generated files. Capture it once in a disposable child before\n * contributors write build artifacts; no connector lifecycle runs there.\n */\n private async captureNamedApiRoutesForWeb(): Promise<void> {\n if (!this.connectors.some((connector) => connector.name === \"web\")) {\n await clearOwnedRouteTypes(rootPath());\n return;\n }\n\n this.namedApiRoutes = (\n await collectRouteRegistrationSnapshot({\n cwd: rootPath(),\n timeoutMs: this.options.routeRegistrationTimeoutMs,\n })\n ).routes;\n }\n\n /**\n * Drain the `generate` hooks and fold what they returned back into the\n * build.\n *\n * The entry point is REGENERATED here rather than generated later. The\n * contribution slot is fixed — after `assertGeneratedImports` (so nothing\n * bundles that the app could not resolve) and before `bundle` — while\n * `generateEntryPoint` must stay at step 3, because `app.ts` is itself\n * generated code the assertion has to see; moving it past the assertion\n * would silently drop the entry from that check. Rewriting one small file\n * is cheaper than losing either guarantee, and the write is pure\n * (`generatedFiles` + these imports), so doing it twice is not a\n * correctness risk.\n *\n * @returns whether any connector ran a `generate` hook — the caller uses it\n * to decide if the import assertion is worth a second pass. Keyed on the\n * hook EXISTING, not on what it returned: a hook that returns nothing may\n * still have written files into `productionDir`, and those are exactly the\n * files the second pass is there to read.\n */\n private async runGenerateContributions(): Promise<boolean> {\n const contributed = this.connectors.some((connector) => Boolean(connector.build?.generate));\n\n const { entryImports, esbuild } = await runGenerateContributions(\n this.connectors,\n this.buildContext(),\n );\n\n this.contributedEsbuild = esbuild;\n\n if (entryImports.length > 0) {\n await this.generateEntryPoint(entryImports);\n }\n\n return contributed;\n }\n\n /**\n * Track which special files were generated\n */\n private generatedFiles = {\n locales: false,\n events: false,\n main: false,\n routes: false,\n workers: false,\n };\n\n /**\n * Generate all combined files\n */\n private async generateCombinedFiles(): Promise<void> {\n console.log(colors.yellow(\" Generating production files...\"));\n\n // Generate bootstrap.ts file\n await this.generateBootstrap();\n\n // Generate config loader\n await this.generateConfigLoader();\n\n // Generate special files and track which ones have content\n const [locales, events, main, routes, workers] = await Promise.all([\n this.generateLocales(),\n this.generateEvents(),\n this.generateMain(),\n this.generateRoutes(),\n this.generateWorkers(),\n ]);\n\n this.generatedFiles = { locales, events, main, routes, workers };\n }\n\n /**\n * Generate bootstrap.ts - ensures bootstrap() runs first and sets production environment\n */\n private async generateBootstrap(): Promise<void> {\n // ESM hoists imports, so the app bootstrap must be the first import to run first\n const appBootstrapImport = (await fileExistsAsync(appPath(\"bootstrap.ts\")))\n ? \"import './../../src/app/bootstrap';\\n\"\n : \"\";\n\n const content = `${appBootstrapImport}import { bootstrap, Application } from \"@warlock.js/core\";\n\n// Production runtime; NODE_ENV is only defaulted so an explicit value (e.g. staging) wins\nApplication.setRuntimeStrategy(\"production\");\nif (!process.env.NODE_ENV) {\n Application.setEnvironment(\"production\");\n}\n\n// Bootstrap the application\nbootstrap();\n`;\n\n await putFileAsync(path.join(this.productionDir, \"bootstrap.ts\"), content);\n }\n\n /**\n * Fail the build when generated code imports a package the app does not\n * declare.\n *\n * The bundler is configured `packages: \"external\"`, so every bare specifier\n * written above survives verbatim into an artifact that resolves against the\n * **consuming app's** node_modules. A framework-internal dependency imported\n * there resolves by accident under npm/yarn hoisting and dies under pnpm —\n * which is how a production app shipped that could not boot. Rewriting the\n * offending import fixes today's bundle; this check is what stops the next\n * change to the generator from quietly reintroducing it.\n */\n private async assertGeneratedImports(): Promise<void> {\n const generatedPaths = await glob(\"**/*.{ts,tsx,js,mjs}\", {\n cwd: this.productionDir,\n absolute: false,\n });\n\n const [files, appPackage] = await Promise.all([\n Promise.all(\n generatedPaths.map(async (file) => ({\n file,\n content: await getFileAsync(path.join(this.productionDir, file)),\n })),\n ),\n getJsonFileAsync<{ dependencies?: Record<string, string> }>(rootPath(\"package.json\")),\n ]);\n\n assertGeneratedImportsAreDeclared(files, Object.keys(appPackage.dependencies ?? {}));\n }\n\n /**\n * Glob `src/app` and keep the files the shared dev-server predicate accepts,\n * so production discovers exactly what the dev collector does.\n * Returns relative paths from .warlock/production/ to src/app/\n */\n private async globModule(matches: (relativePath: string) => boolean): Promise<string[]> {\n const files = await glob(\"**/*.{ts,tsx,json}\", {\n cwd: appPath(),\n absolute: false,\n });\n\n // e.g., \"users/main.ts\" -> \"../../src/app/users/main\"\n return files\n .filter((file) => matches(\"src/app/\" + file))\n .sort()\n .map((file) => \"../../src/app/\" + file.replace(/\\.(ts|tsx)$/, \"\"));\n }\n\n /**\n * Generate config-loader.ts\n */\n private async generateConfigLoader(): Promise<void> {\n const configDirectory = path.join(process.cwd(), \"src/config\");\n\n const files = await glob(\"**/*.{ts,tsx}\", {\n cwd: configDirectory,\n absolute: false,\n });\n\n // Same key rule as the dev config loader: the raw path, never camel-cased\n const configNames = files\n .filter((f) => isConfigFile(\"src/config/\" + f))\n .map((f) => ({\n path: f.replace(/\\.(ts|tsx)$/, \"\"),\n key: configKeyFromPath(\"src/config/\" + f),\n }))\n .filter((entry): entry is { path: string; key: string } => entry.key !== undefined)\n .sort((a, b) => a.path.localeCompare(b.path));\n\n // Only `@warlock.js/core` — the one package the app itself declares. See\n // `assertGeneratedImportsAreDeclared`: `@mongez/config` is core's own\n // dependency, so a bare import of it resolved by luck under npm/yarn\n // hoisting and died under pnpm's strict layout.\n const imports: string[] = [\n 'import { assertValidConfigModules, configSpecialHandlers, setConfig } from \"@warlock.js/core\";',\n ];\n const configImports: string[] = [];\n const configSetCalls: string[] = [];\n const validations: string[] = [];\n const executors: string[] = [];\n\n configNames.forEach(({ path: configPath, key }, index) => {\n // Index-based identifier: keys like \"rate-limit\" or \"mail/smtp\" are not valid names.\n // A namespace import, so a file's optional `configSchema` export travels with it.\n const varName = `config${index}`;\n const name = JSON.stringify(key);\n configImports.push(`import * as ${varName} from \"../../src/config/${configPath}\";`);\n configSetCalls.push(`setConfig(${name}, ${varName}.default);`);\n validations.push(` { name: ${name}, module: ${varName} },`);\n executors.push(`await configSpecialHandlers.execute(${name}, ${varName}.default);`);\n });\n\n // ESM hoists imports, so prestart must be the first import to run first\n const prestartImports = (await fileExistsAsync(appPath(\"prestart.ts\")))\n ? [\"import './../../src/app/prestart';\"]\n : [];\n\n const content = [\n ...prestartImports,\n ...imports,\n \"\",\n \"// Config imports\",\n ...configImports,\n \"\",\n \"// Register configs\",\n ...configSetCalls,\n \"\",\n \"// Refuse to start when a config file's `configSchema` is not satisfied\",\n \"await assertValidConfigModules([\",\n ...validations,\n \"]);\",\n \"\",\n \"// Special handlers\",\n ...executors,\n \"\",\n ].join(\"\\n\");\n\n await putFileAsync(path.join(this.productionDir, \"config-loader.ts\"), content);\n }\n\n /**\n * Generate locales.ts (only if there are locale files)\n * @returns true if file was generated with content\n */\n private async generateLocales(): Promise<boolean> {\n const files = await this.globModule(isLocaleFile);\n if (files.length === 0) return false;\n const content = files\n .map((file, index) => {\n if (!file.endsWith(\".json\")) return `import \"${file}\";`;\n const moduleFolder = file.split(\"/\").at(-3)!;\n return [\n `import dictionary${index} from \"${file}\";`,\n 'import { registerLocaleDictionary } from \"@warlock.js/core\";',\n `registerLocaleDictionary({ sourceFile: ${JSON.stringify(file)}, source: JSON.stringify(dictionary${index}), defaultNamespace: ${JSON.stringify(moduleFolder)} });`,\n ].join(\"\\n\");\n })\n .join(\"\\n\");\n await putFileAsync(path.join(this.productionDir, \"locales.ts\"), content + \"\\n\");\n return true;\n }\n\n /**\n * Generate events.ts (only if there are event files)\n * @returns true if file was generated with content\n */\n private async generateEvents(): Promise<boolean> {\n const files = await this.globModule(isEventFile);\n if (files.length === 0) return false;\n await this.generateImportsFile(files, \"events.ts\");\n return true;\n }\n\n /**\n * Generate main.ts (only if there are main files)\n * @returns true if file was generated with content\n */\n private async generateMain(): Promise<boolean> {\n const files = await this.globModule(isMainFile);\n if (files.length === 0) return false;\n await this.generateImportsFile(files, \"main.ts\");\n return true;\n }\n\n /**\n * Generate routes.ts (only if there are route files)\n * @returns true if file was generated with content\n */\n private async generateRoutes(): Promise<boolean> {\n const files = await this.globModule(isRouteFile);\n if (files.length === 0) return false;\n await this.generateImportsFile(files, \"routes.ts\");\n return true;\n }\n\n /**\n * Generate workers.ts (only if there are worker files)\n * @returns true if file was generated with content\n */\n private async generateWorkers(): Promise<boolean> {\n const files = await this.globModule(isWorkerFile);\n if (files.length === 0) return false;\n await this.generateImportsFile(files, \"workers.ts\");\n return true;\n }\n\n /**\n * Generate a file with imports from all given files\n */\n private async generateImportsFile(importPaths: string[], outputFile: string): Promise<void> {\n const imports = importPaths.map((importPath) => `import \"${importPath}\";`);\n const content = imports.join(\"\\n\") + \"\\n\";\n await putFileAsync(path.join(this.productionDir, outputFile), content);\n }\n\n /**\n * Generate the main entry point (app.ts)\n *\n * @param contributedImports lines from connector `generate` hooks, appended\n * to section 4 after `./routes`\n */\n private async generateEntryPoint(contributedImports: string[] = []): Promise<void> {\n console.log(colors.yellow(\" Generating entry point...\"));\n\n // The names this build resolved, baked in as a literal. The entry imports\n // the config source, and that source is re-evaluated at startup — an\n // env-conditional `connectors` array can hand the boot a different list\n // than the one drained here. A literal is the only part of the array that\n // survives into the artifact unchanged, so it is what the boot compares\n // against.\n const expectedNames = this.connectors\n .map((connector) => JSON.stringify(connector.name))\n .join(\", \");\n\n // Build imports based on which files were generated\n const imports: string[] = [\n \"// 1. Bootstrap (loads .env, initializes framework)\",\n 'import \"./bootstrap\";',\n \"\",\n \"// 2. Load configs\",\n 'import \"./config-loader\";',\n \"\",\n // Registration has to sit between the config being available and the\n // first phase starting: the connectors listed in `connectors` are the\n // same ones this build drained contributions from, so the bundle boots\n // exactly what it was built for. Register any later and an early-phase\n // connector would miss its own start.\n \"// 2.5 Register connectors declared in warlock.config (the same array this\",\n \"// build read its contributions from, so built-for and boots-with match).\",\n \"// The config is imported STATICALLY so esbuild bakes it into the bundle\",\n \"// and the array is handed over explicitly — an artifact has no\",\n \"// warlock.config.ts beside it to read at runtime, and a registration\",\n \"// that quietly found nothing to register is the exact drift this\",\n \"// section exists to prevent.\",\n \"// `expectedNames` is the list this build resolved, in order — boot\",\n \"// refuses to start when the config hands over a different set or order.\",\n 'import { registerConfiguredConnectors } from \"@warlock.js/core\";',\n `import warlockConfig from \"${APP_ROOT_FROM_PRODUCTION_DIR}warlock.config\";`,\n `registerConfiguredConnectors(warlockConfig.connectors ?? [], { expectedNames: [${expectedNames}] });`,\n \"\",\n \"// 2.6 Fail fast on a busy port. `http` is a LATE-phase connector, so its\",\n \"// own preflight is not reached until the database and cache have\",\n \"// connected and every app module has been imported — seconds of work\",\n \"// thrown away before anyone learns the port was taken. This probe is\",\n \"// a bind-and-release on a socket that is never served, and it reports\",\n \"// on stderr because no log channel is configured this early.\",\n 'import { Application, connectorsManager, ConnectorLifecyclePhase, preflightConfiguredHttpPort } from \"@warlock.js/core\";',\n 'if (Application.hasRole(\"api\") || Application.hasRole(\"web\")) {',\n \" await preflightConfiguredHttpPort();\",\n \"}\",\n \"\",\n \"// 3. Start early-phase connectors (database, cache, logger, ...)\",\n \"// so data sources, cache, etc. are ready before app code runs\",\n \"await connectorsManager.startPhase(ConnectorLifecyclePhase.Early);\",\n ];\n\n // App code uses dynamic `await import(...)` so each module's side\n // effects fire at THIS point in execution. Static imports would be\n // hoisted to module-instantiation time (before the early-phase await\n // resolves), which is exactly the bug this split is meant to fix.\n //\n // The guarantee comes from the imports being DYNAMIC — esbuild wraps a\n // dynamically-imported module in its `__esm(() => {…})` helper and runs\n // it at the await, not at instantiation. It does NOT come from\n // `splitting: true`, which only decides one-file-vs-chunks. This\n // previously said splitting was required; it is not, and `singleBundle`\n // (splitting: false) preserves the ordering.\n imports.push(\"\", \"// 4. Load app code (events, locales, main, routes)\");\n\n if (this.generatedFiles.events) {\n imports.push('await import(\"./events\");');\n }\n if (this.generatedFiles.locales) {\n imports.push('await import(\"./locales\");');\n }\n if (this.generatedFiles.main) {\n imports.push('await import(\"./main\");');\n }\n if (this.generatedFiles.routes) {\n imports.push('if (Application.hasRole(\"api\")) {', ' await import(\"./routes\");', \"}\");\n }\n if (this.generatedFiles.workers) {\n imports.push('if (Application.hasRole(\"worker\")) {', ' await import(\"./workers\");', \"}\");\n }\n\n // Contributor imports come AFTER `./routes`, never before: a connector\n // that registers pages needs the routes app code already collected —\n // the same ordering dev uses (routes first, then the connector installs\n // on top of them). Emitted verbatim; the contributor writes the whole\n // statement (e.g. `await import(\"./pages\");`).\n imports.push(...contributedImports);\n\n // A rejecting validator (Application.onValidateBoot) must abort boot\n // before late-phase connectors bind a port.\n imports.push(\n \"\",\n \"// 5. Run startup validators registered via Application.onValidateBoot(...)\",\n \"await Application.runStartupValidators();\",\n );\n\n // Start late-phase connectors after app code registers routes/listeners\n imports.push(\n \"\",\n \"// 6. Start late-phase connectors (http, socket) — routes and\",\n \"// listeners registered by app code are now ready to bind\",\n \"await connectorsManager.startPhase(ConnectorLifecyclePhase.Late);\",\n \"\",\n \"// 7. Signal a complete boot so `Application.onceBooted(...)` listeners fire\",\n \"Application.markBooted({ environment: Application.environment, runtimeStrategy: Application.runtimeStrategy });\",\n \"connectorsManager.shutdownOnProcessKill();\",\n );\n\n const content = imports.join(\"\\n\") + \"\\n\";\n await putFileAsync(path.join(this.productionDir, \"app.ts\"), content);\n }\n\n /**\n * Bundle with esbuild\n *\n * @param writeOutDir the directory esbuild writes into — the build's\n * private temp directory, NOT `options.outdir`. Taken as a parameter\n * rather than read off `this.options` because the two are different paths\n * with different meanings: `options.outdir` is the final destination every\n * consumer bakes into the artifact, and this is only where bytes land\n * before promotion moves them there.\n */\n private async bundle(writeOutDir: string): Promise<void> {\n console.log(colors.magenta(\" Bundling with esbuild...\"));\n\n const entryPoint = path.join(this.productionDir, \"app.ts\");\n const outFileName = this.options.outFile!;\n // Strip extension so entryNames produces \"<base>.js\" via esbuild\n const entryName = path.basename(outFileName, path.extname(outFileName));\n\n // `singleBundle` and `esmShim` are ours, not esbuild's — it throws on\n // unknown keys, and the user options are spread into its call verbatim.\n const singleBundle = this.options.singleBundle === true;\n const esmShim = this.options.esmShim !== false;\n // Read before deleting: the merged banner is applied AFTER the user\n // spread, so a user banner must not be lost to it or clobber the shim.\n const userBanner = this.options.banner;\n\n // `outFile` and `entryPath` are REQUIRED on ResolvedBuildConfig on purpose:\n // resolve-build-config.ts documents that widening them pushed a lie downstream\n // into start-production.command.ts, which then could not trust its own config.\n // This is the one place they must be absent - the object is spread into esbuild's\n // call verbatim and esbuild throws on unknown keys.\n //\n // Stripped off a LOCAL COPY of `this.options`, never off `this.options`\n // itself: `buildContext()` hands `this.options` to every `generate`/`emit`\n // contribution hook, including the `emit` pass that runs AFTER this method\n // returns (`build()` step 5.6). Deleting these keys from the shared object\n // used to leave those hooks reading `undefined` for `outFile`, `entryPath`,\n // `singleBundle`, `esmShim` and `banner` even though `ConnectorBuildContext`\n // types them as present. A shallow copy is enough — every field this method\n // reads off it is either scalar or already re-merged below (`define`,\n // `external`, `loader`, `banner`), so nothing here needs a deep clone.\n const esbuildOptions: Partial<ResolvedBuildConfig> = { ...this.options };\n\n delete esbuildOptions.outFile;\n delete esbuildOptions.entryPath;\n delete esbuildOptions.singleBundle;\n delete esbuildOptions.esmShim;\n delete esbuildOptions.banner;\n delete esbuildOptions.routeRegistrationTimeoutMs;\n\n await ensureDirectoryAsync(writeOutDir);\n\n const alias = this.buildAliasMapFromTsconfig();\n\n // Whether this build decides externality per import EDGE\n // (`bundle-framework-dependencies.ts`, which explains the rule at\n // length) or keeps the blunt `packages: \"external\"`.\n //\n // Not in `singleBundle` mode: that bundles everything by definition, and\n // a plugin that can only ever ADD an external would silently narrow it.\n // Not when the user set `packages` themselves: their value has always\n // won over the default below, and it must keep winning — the plugin is\n // the default's implementation, not a new policy layered on top.\n const perEdgeExternals = !singleBundle && (esbuildOptions as any).packages === undefined;\n\n // The user can override `format`, so gate the shim on the EFFECTIVE\n // format rather than on the default below. A CJS build already has\n // `require` and friends; injecting them there would be a redefinition.\n const isEsm = (esbuildOptions.format ?? \"esm\") === \"esm\";\n const banner = mergeBanner(userBanner, esmShim && isEsm ? ESM_INTEROP_SHIM : undefined);\n\n // Contributor patch, split into the part that can ride the spread order\n // and the three keys that cannot. `jsx` and `jsxImportSource` are placed\n // BEFORE the user spread below, which gives the ruled precedence for\n // free: builder defaults < contributor < user config.\n //\n // `define`, `external` and `loader` are pulled out because a spread\n // REPLACES them wholesale — the same trap `banner` documents. Two\n // contributors' env defines, a contributor's optional peers plus the\n // user's, or a contributor's `.svg` loader alongside the user's `.png`,\n // must both survive, so they are merged by key/by set and re-applied\n // after the spread with the user still winning per key.\n const {\n define: contributedDefine,\n external: contributedExternal,\n loader: contributedLoader,\n plugins: contributedPlugins,\n ...contributedOptions\n } = this.contributedEsbuild;\n\n const userDefine: Record<string, string> | undefined = esbuildOptions.define;\n const userExternal: string[] | undefined = esbuildOptions.external;\n const userLoader: ConnectorEsbuildPatch[\"loader\"] = esbuildOptions.loader;\n\n const define =\n contributedDefine || userDefine ? { ...contributedDefine, ...userDefine } : undefined;\n\n const loader =\n contributedLoader || userLoader ? { ...contributedLoader, ...userLoader } : undefined;\n\n const external =\n contributedExternal || userExternal\n ? dedupe([...(contributedExternal ?? []), ...(userExternal ?? [])])\n : undefined;\n\n if (singleBundle) {\n console.log(\n colors.magenta(\n \" Single-bundle mode — one JS file\" +\n (esmShim && isEsm ? \" with the ESM interop shim\" : \"\") +\n \". Native .node addons are still emitted alongside it.\",\n ),\n );\n }\n\n try {\n await esbuild.build({\n platform: \"node\",\n entryPoints: [entryPoint],\n bundle: true,\n // Both are DEFAULTS the user can override — they sit before the\n // `...esbuildOptions` spread deliberately. `singleBundle` moves them,\n // an explicit `splitting`/`packages` in warlock.config.ts beats both.\n //\n // Phase ordering does not depend on `splitting`: it comes from the\n // generated app.ts using dynamic `await import(...)` (see\n // generateAppEntry above), which esbuild defers to the call site in\n // either mode. Splitting only decides one file vs chunks.\n splitting: !singleBundle,\n // `\"bundle\"` under `perEdgeExternals` is not \"bundle everything\":\n // the plugin below returns `external: true` for every bare specifier\n // this build must not bundle, which is all of them bar the framework's\n // own declared dependencies. Saying `\"external\"` here instead would\n // externalise them before the plugin could rule.\n packages: singleBundle || perEdgeExternals ? \"bundle\" : \"external\",\n minify: esbuildOptions.minify,\n sourcemap: esbuildOptions.sourcemap === true ? \"linked\" : esbuildOptions.sourcemap,\n format: \"esm\",\n // Targeting a concrete Node version (not \"esnext\") so esbuild\n // transpiles TC39 stage 3 decorators into helpers — Node does not\n // implement them natively yet.\n target: [\"node22\"],\n entryNames: entryName,\n alias,\n plugins: [\n nativeNodeModulesPlugin,\n // BEFORE the framework-dependency plugin, and the order is\n // load-bearing: the first `onResolve` callback to answer wins, and\n // `app/users/...` is a bare specifier the other one would rule\n // external.\n tsconfigPathAliases(this.tsconfigPathAliasConfig()),\n ...(perEdgeExternals\n ? [bundleFrameworkDependencies({ appRoot: rootPath(), aliasKeys: Object.keys(alias) })]\n : []),\n // Contributor plugins run last: they load their own file types and\n // must not shadow the resolvers above.\n ...(contributedPlugins ?? []),\n ],\n // Between the defaults and the user spread — the ruled precedence.\n ...contributedOptions,\n ...(esbuildOptions as any),\n // AFTER the spread, and NOT overridable: `esbuildOptions.outdir` rides\n // that spread carrying the FINAL destination, which is exactly where\n // this build must not write yet. The final path is the user's setting\n // and stays authoritative for everyone reading the config — it is only\n // this one esbuild call that is redirected, and only until promotion\n // moves the result onto that very path.\n outdir: writeOutDir,\n // AFTER the spread for the same reason `banner` is: a spread replaces\n // these objects instead of merging them, so the merged values are\n // re-applied here. The user still wins — they were merged in last.\n ...(define ? { define } : {}),\n ...(external ? { external } : {}),\n ...(loader ? { loader } : {}),\n // AFTER the spread, and intentionally so: `banner` is an object, and\n // both the config merge and this spread REPLACE it wholesale rather\n // than merging. Left as a default above, any user banner would delete\n // the shim; left to the spread, the shim would delete theirs. The\n // merge is the only form that keeps both.\n ...(banner ? { banner } : {}),\n });\n } catch (e) {\n console.log(e);\n throw e;\n }\n }\n\n /**\n * The WILDCARD half of the same tsconfig `paths` map that\n * {@link ProductionBuilder.buildAliasMapFromTsconfig} reads the exact half\n * of. `tsconfig-path-aliases.ts` explains why the two halves need different\n * mechanisms — in short, esbuild's `alias` option cannot express a wildcard,\n * so the entries it skips have to be resolved by a plugin instead of being\n * left to no one.\n */\n private tsconfigPathAliasConfig(): { baseUrl: string; paths: Record<string, string[]> } {\n tsconfigManager.init();\n\n return {\n baseUrl: path.resolve(process.cwd(), tsconfigManager.baseUrl),\n paths: tsconfigManager.aliases as Record<string, string[]>,\n };\n }\n\n /**\n * Build an alias map from tsconfig `paths` so esbuild resolves local\n * source aliases (e.g. `@warlock.js/cascade`) to their on-disk source\n * folders during bundling. Without this, `packages: \"external\"` would\n * leave those bare specifiers as raw imports and Node would fail to\n * resolve them at runtime (they aren't installed in node_modules).\n *\n * Only exact (non-wildcard) aliases are included — esbuild's `alias`\n * option doesn't support glob-style mappings. The wildcard half is not\n * dropped, it is handled elsewhere: see\n * {@link ProductionBuilder.tsconfigPathAliasConfig}.\n */\n private buildAliasMapFromTsconfig(): Record<string, string> {\n tsconfigManager.init();\n\n const alias: Record<string, string> = {};\n const baseUrl = path.resolve(process.cwd(), tsconfigManager.baseUrl);\n\n for (const [from, to] of Object.entries(tsconfigManager.aliases)) {\n if (from.endsWith(\"/*\") || !Array.isArray(to) || to.length === 0) {\n continue;\n }\n\n const target = to[0];\n\n if (target === undefined) {\n continue;\n }\n\n alias[from] = path.resolve(baseUrl, target);\n }\n\n return alias;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAM,mBACJ;;;;;;;;;;;;;;AAoBF,SAAS,YACP,YACA,MACoC;CACpC,IAAI,CAAC,MAAM,OAAO;CAElB,MAAM,SAAS,YAAY;CAE3B,OAAO;EACL,GAAG;EACH,IAAI,SAAS,GAAG,OAAO,WAAW;CACpC;AACF;;;;;;;;;;AAWA,MAAM,+BAA+B;;;;;;AAOrC,IAAa,oBAAb,MAA+B;;uBAEI,YAAY,YAAY;oBAOd,CAAC;4BAMQ,CAAC;wBAoO5B;GACvB,SAAS;GACT,QAAQ;GACR,MAAM;GACN,QAAQ;GACR,SAAS;EACX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAxMA,MAAa,QAAuB;EAClC,QAAQ,IAAI,OAAO,KAAK,8BAA8B,CAAC;EAMvD,4BAA4B;EAG5B,MAAM,KAAK,kBAAkB;EAE7B,MAAM,cAAc,KAAK,QAAQ;EACjC,MAAM,aAAa,oBAAoB,WAAW;EAKlD,IAAI;EAEJ,IAAI;GAEF,MAAM,KAAK,sBAAsB;GAGjC,MAAM,KAAK,mBAAmB;GAG9B,MAAM,KAAK,uBAAuB;GAGlC,MAAM,KAAK,4BAA4B;GAYvC,IAAI,M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KAAK,QAAQ,SAAS,MAAM;EAC5C;EAEA,OAAO;CACT;AACF"}
@@ -129,5 +129,5 @@ function superviseProductionProcess({ nodeArgs, cwd = process.cwd(), env = proce
129
129
  }
130
130
 
131
131
  //#endregion
132
- export { superviseProductionProcess };
132
+ export { DEFAULT_READINESS_NOTICE_DELAY_MS, superviseProductionProcess };
133
133
  //# sourceMappingURL=production-supervisor.mjs.map
@@ -95,7 +95,7 @@ function runRegistrationChild(options) {
95
95
  });
96
96
  }
97
97
  function defaultForkProcess(entry, options) {
98
- return fork(entry, [], {
98
+ const forkOptions = {
99
99
  cwd: options.cwd,
100
100
  stdio: [
101
101
  "ignore",
@@ -104,7 +104,8 @@ function defaultForkProcess(entry, options) {
104
104
  "ipc"
105
105
  ],
106
106
  windowsHide: true
107
- });
107
+ };
108
+ return fork(entry, [], forkOptions);
108
109
  }
109
110
  /** Resolve from Core's package root, not an assumed bundler-preserved dirname. */
110
111
  function resolveCompiledChildEntry() {
@@ -135,5 +136,5 @@ function formatDiagnostics(stdout, stderr) {
135
136
  }
136
137
 
137
138
  //#endregion
138
- export { runRegistrationChild };
139
+ export { REGISTRATION_ERROR_MESSAGE, REGISTRATION_PROGRESS_MESSAGE, runRegistrationChild };
139
140
  //# sourceMappingURL=registration-child-runner.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"registration-child-runner.mjs","names":[],"sources":["../../../../../../../../packages/core/src/production/registration-child-runner.ts"],"sourcesContent":["import { fork, type ChildProcess, type Serializable } from \"node:child_process\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst DEFAULT_TIMEOUT_MS = 30_000;\nconst MAX_DIAGNOSTIC_BYTES = 16_384;\n\n/** Message a registration child sends when it fails. Shared by every result kind. */\nexport const REGISTRATION_ERROR_MESSAGE = \"route-registration:error\";\n\n/** Message a registration child sends before it imports each module. Shared by every result kind. */\nexport const REGISTRATION_PROGRESS_MESSAGE = \"route-registration:progress\";\n\nexport type RegistrationChildProcess = Pick<\n ChildProcess,\n \"send\" | \"kill\" | \"disconnect\" | \"on\" | \"stdout\" | \"stderr\" | \"connected\"\n>;\n\nexport type RegistrationChildForker = (\n entry: string,\n options: { cwd: string },\n) => RegistrationChildProcess;\n\nexport type RegistrationChildRunOptions<TResult> = Readonly<{\n cwd: string;\n timeoutMs?: number;\n childEntry?: string;\n /**\n * Test seam. An injected fork is a protocol seam, not an installation check, so the\n * compiled child is not resolved when it is set.\n */\n forkProcess?: RegistrationChildForker;\n /** The single IPC request the child receives after it starts. */\n request: Serializable;\n /** `type` of the one message that carries the result (for example `route-registration:snapshot`). */\n resultMessageType: string;\n /** What the result is called in error messages (\"snapshot\", \"document\"). */\n resultNoun: string;\n /**\n * Validate and freeze the result message. Throw to reject the run with that error.\n */\n readResult: (message: Record<string, unknown>) => TResult;\n}>;\n\n/**\n * Run the compiled registration child in a fresh process and wait for its result.\n *\n * This is the fork / IPC / timeout / diagnostics plumbing shared by the route snapshot and\n * the OpenAPI document: the child is forked, sent one request, and must answer with exactly\n * one result message (or an error message) and exit 0. The timeout names the module the\n * child was still importing; the last 16 KiB of child stdout/stderr are attached to failures.\n */\nexport function runRegistrationChild<TResult>(\n options: RegistrationChildRunOptions<TResult>,\n): Promise<TResult> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n const startedAt = Date.now();\n const forkProcess = options.forkProcess ?? defaultForkProcess;\n const entry =\n options.childEntry ??\n (options.forkProcess ? \"<injected-route-registration-child>\" : resolveCompiledChildEntry());\n\n return new Promise<TResult>((resolve, reject) => {\n const child = forkProcess(entry, { cwd: options.cwd });\n let settled = false;\n let received: { value: TResult } | undefined;\n let stdout = \"\";\n let stderr = \"\";\n let pendingModule: string | undefined;\n\n const append = (current: string, chunk: Buffer) => {\n const remaining = MAX_DIAGNOSTIC_BYTES - Buffer.byteLength(current);\n\n return remaining <= 0 ? current : current + chunk.toString(\"utf8\", 0, remaining);\n };\n\n const finish = (error?: Error, result?: TResult) => {\n if (settled) {\n return;\n }\n\n settled = true;\n clearTimeout(timeout);\n\n if (child.connected) {\n child.disconnect?.();\n }\n\n if (error) {\n child.kill?.();\n reject(error);\n } else {\n resolve(result as TResult);\n }\n };\n\n child.stdout?.on(\"data\", (chunk: Buffer) => {\n stdout = append(stdout, chunk);\n });\n child.stderr?.on(\"data\", (chunk: Buffer) => {\n stderr = append(stderr, chunk);\n });\n\n const timeout = setTimeout(() => {\n const elapsedMs = Date.now() - startedAt;\n\n finish(\n new Error(\n `Route registration child timed out after ${elapsedMs}ms${pendingModule ? ` while registering ${pendingModule}` : \"\"}.${formatDiagnostics(stdout, stderr)}`,\n ),\n );\n }, timeoutMs);\n timeout.unref?.();\n\n child.on(\"error\", (error) => {\n finish(\n new Error(\n `Could not start route registration child: ${error.message}${formatDiagnostics(stdout, stderr)}`,\n ),\n );\n });\n\n child.on(\"message\", (message: unknown) => {\n if (!isChildMessage(message, options.resultMessageType)) {\n return;\n }\n\n if (message.type === REGISTRATION_ERROR_MESSAGE) {\n finish(\n new Error(\n `Route registration child failed: ${String(message.message)}${formatDiagnostics(stdout, stderr)}`,\n ),\n );\n\n return;\n }\n\n if (message.type === REGISTRATION_PROGRESS_MESSAGE) {\n pendingModule = String(message.module);\n\n return;\n }\n\n try {\n const result = options.readResult(message);\n\n if (received) {\n finish(new Error(`Route registration child sent more than one ${options.resultNoun}.`));\n\n return;\n }\n\n received = { value: result };\n } catch (error) {\n finish(error as Error);\n }\n });\n\n child.on(\"close\", (code) => {\n if (settled) {\n return;\n }\n\n if (code === 0 && received) {\n finish(undefined, received.value);\n\n return;\n }\n\n finish(\n new Error(\n `Route registration child exited ${code ?? \"by signal\"} without a valid ${options.resultNoun}.${formatDiagnostics(stdout, stderr)}`,\n ),\n );\n });\n\n if (!child.send) {\n finish(new Error(\"Route registration child did not provide an IPC send channel.\"));\n\n return;\n }\n\n child.send(options.request);\n });\n}\n\nfunction defaultForkProcess(entry: string, options: { cwd: string }): RegistrationChildProcess {\n const forkOptions: NonNullable<Parameters<typeof fork>[2]> & { windowsHide?: boolean } = {\n cwd: options.cwd,\n stdio: [\"ignore\", \"pipe\", \"pipe\", \"ipc\"],\n windowsHide: true,\n };\n\n return fork(entry, [], forkOptions);\n}\n\n/** Resolve from Core's package root, not an assumed bundler-preserved dirname. */\nfunction resolveCompiledChildEntry(): string {\n let directory = path.dirname(fileURLToPath(import.meta.url));\n\n while (directory !== path.dirname(directory)) {\n const packageJson = path.join(directory, \"package.json\");\n\n if (existsSync(packageJson)) {\n try {\n if (JSON.parse(readFileSync(packageJson, \"utf8\")).name === \"@warlock.js/core\") {\n const child = path.join(directory, \"esm\", \"production\", \"route-registration-child.mjs\");\n\n if (existsSync(child)) {\n return child;\n }\n\n throw new Error(\n `@warlock.js/core is missing its compiled route-registration child at ${child}. Reinstall a complete package.`,\n );\n }\n } catch (error) {\n if (error instanceof Error && error.message.includes(\"route-registration child\")) {\n throw error;\n }\n }\n }\n\n directory = path.dirname(directory);\n }\n\n throw new Error(\n \"Could not locate @warlock.js/core package root for the route-registration child.\",\n );\n}\n\nfunction isChildMessage(\n value: unknown,\n resultMessageType: string,\n): value is Record<string, unknown> & { type: string } {\n if (typeof value !== \"object\" || value === null || !(\"type\" in value)) {\n return false;\n }\n\n const type = (value as { type?: unknown }).type;\n\n return (\n type === resultMessageType ||\n type === REGISTRATION_ERROR_MESSAGE ||\n type === REGISTRATION_PROGRESS_MESSAGE\n );\n}\n\nfunction formatDiagnostics(stdout: string, stderr: string): string {\n if (!stdout && !stderr) {\n return \"\";\n }\n\n return `\\nChild stdout:\\n${stdout}\\nChild stderr:\\n${stderr}`;\n}\n"],"mappings":";;;;;;AAKA,MAAM,qBAAqB;AAC3B,MAAM,uBAAuB;;AAG7B,MAAa,6BAA6B;;AAG1C,MAAa,gCAAgC;;;;;;;;;AAyC7C,SAAgB,qBACd,SACkB;CAClB,MAAM,YAAY,QAAQ,aAAa;CACvC,MAAM,YAAY,KAAK,IAAI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K,KAAK,WAAW,OAAO,cAAc,8BAA8B;IAEtF,IAAI,WAAW,KAAK,GAClB,OAAO;IAGT,MAAM,IAAI,MACR,wEAAwE,MAAM,gCAChF;GACF;EACF,SAAS,OAAO;GACd,IAAI,iBAAiB,SAAS,MAAM,QAAQ,SAAS,0BAA0B,GAC7E,MAAM;EAEV;EAGF,YAAY,KAAK,QAAQ,SAAS;CACpC;CAEA,MAAM,IAAI,MACR,kFACF;AACF;AAEA,SAAS,eACP,OACA,mBACqD;CACrD,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,EAAE,UAAU,QAC7D,OAAO;CAGT,MAAM,OAAQ,MAA6B;CAE3C,OACE,SAAS,qBACT,uCACA;AAEJ;AAEA,SAAS,kBAAkB,QAAgB,QAAwB;CACjE,IAAI,CAAC,UAAU,CAAC,QACd,OAAO;CAGT,OAAO,oBAAoB,OAAO,mBAAmB;AACvD"}
1
+ {"version":3,"file":"registration-child-runner.mjs","names":[],"sources":["../../../../../../../../packages/core/src/production/registration-child-runner.ts"],"sourcesContent":["import { fork, type ChildProcess, type Serializable } from \"node:child_process\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst DEFAULT_TIMEOUT_MS = 30_000;\nconst MAX_DIAGNOSTIC_BYTES = 16_384;\n\n/** Message a registration child sends when it fails. Shared by every result kind. */\nexport const REGISTRATION_ERROR_MESSAGE = \"route-registration:error\";\n\n/** Message a registration child sends before it imports each module. Shared by every result kind. */\nexport const REGISTRATION_PROGRESS_MESSAGE = \"route-registration:progress\";\n\nexport type RegistrationChildProcess = Pick<\n ChildProcess,\n \"send\" | \"kill\" | \"disconnect\" | \"on\" | \"stdout\" | \"stderr\" | \"connected\"\n>;\n\nexport type RegistrationChildForker = (\n entry: string,\n options: { cwd: string },\n) => RegistrationChildProcess;\n\nexport type RegistrationChildRunOptions<TResult> = Readonly<{\n cwd: string;\n timeoutMs?: number;\n childEntry?: string;\n /**\n * Test seam. An injected fork is a protocol seam, not an installation check, so the\n * compiled child is not resolved when it is set.\n */\n forkProcess?: RegistrationChildForker;\n /** The single IPC request the child receives after it starts. */\n request: Serializable;\n /** `type` of the one message that carries the result (for example `route-registration:snapshot`). */\n resultMessageType: string;\n /** What the result is called in error messages (\"snapshot\", \"document\"). */\n resultNoun: string;\n /**\n * Validate and freeze the result message. Throw to reject the run with that error.\n */\n readResult: (message: Record<string, unknown>) => TResult;\n}>;\n\n/**\n * Run the compiled registration child in a fresh process and wait for its result.\n *\n * This is the fork / IPC / timeout / diagnostics plumbing shared by the route snapshot and\n * the OpenAPI document: the child is forked, sent one request, and must answer with exactly\n * one result message (or an error message) and exit 0. The timeout names the module the\n * child was still importing; the last 16 KiB of child stdout/stderr are attached to failures.\n */\nexport function runRegistrationChild<TResult>(\n options: RegistrationChildRunOptions<TResult>,\n): Promise<TResult> {\n const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n const startedAt = Date.now();\n const forkProcess = options.forkProcess ?? defaultForkProcess;\n const entry =\n options.childEntry ??\n (options.forkProcess ? \"<injected-route-registration-child>\" : resolveCompiledChildEntry());\n\n return new Promise<TResult>((resolve, reject) => {\n const child = forkProcess(entry, { cwd: options.cwd });\n let settled = false;\n let received: { value: TResult } | undefined;\n let stdout = \"\";\n let stderr = \"\";\n let pendingModule: string | undefined;\n\n const append = (current: string, chunk: Buffer) => {\n const remaining = MAX_DIAGNOSTIC_BYTES - Buffer.byteLength(current);\n\n return remaining <= 0 ? current : current + chunk.toString(\"utf8\", 0, remaining);\n };\n\n const finish = (error?: Error, result?: TResult) => {\n if (settled) {\n return;\n }\n\n settled = true;\n clearTimeout(timeout);\n\n if (child.connected) {\n child.disconnect?.();\n }\n\n if (error) {\n child.kill?.();\n reject(error);\n } else {\n resolve(result as TResult);\n }\n };\n\n child.stdout?.on(\"data\", (chunk: Buffer) => {\n stdout = append(stdout, chunk);\n });\n child.stderr?.on(\"data\", (chunk: Buffer) => {\n stderr = append(stderr, chunk);\n });\n\n const timeout = setTimeout(() => {\n const elapsedMs = Date.now() - startedAt;\n\n finish(\n new Error(\n `Route registration child timed out after ${elapsedMs}ms${pendingModule ? ` while registering ${pendingModule}` : \"\"}.${formatDiagnostics(stdout, stderr)}`,\n ),\n );\n }, timeoutMs);\n timeout.unref?.();\n\n child.on(\"error\", (error) => {\n finish(\n new Error(\n `Could not start route registration child: ${error.message}${formatDiagnostics(stdout, stderr)}`,\n ),\n );\n });\n\n child.on(\"message\", (message: unknown) => {\n if (!isChildMessage(message, options.resultMessageType)) {\n return;\n }\n\n if (message.type === REGISTRATION_ERROR_MESSAGE) {\n finish(\n new Error(\n `Route registration child failed: ${String(message.message)}${formatDiagnostics(stdout, stderr)}`,\n ),\n );\n\n return;\n }\n\n if (message.type === REGISTRATION_PROGRESS_MESSAGE) {\n pendingModule = String(message.module);\n\n return;\n }\n\n try {\n const result = options.readResult(message);\n\n if (received) {\n finish(new Error(`Route registration child sent more than one ${options.resultNoun}.`));\n\n return;\n }\n\n received = { value: result };\n } catch (error) {\n finish(error as Error);\n }\n });\n\n child.on(\"close\", (code) => {\n if (settled) {\n return;\n }\n\n if (code === 0 && received) {\n finish(undefined, received.value);\n\n return;\n }\n\n finish(\n new Error(\n `Route registration child exited ${code ?? \"by signal\"} without a valid ${options.resultNoun}.${formatDiagnostics(stdout, stderr)}`,\n ),\n );\n });\n\n if (!child.send) {\n finish(new Error(\"Route registration child did not provide an IPC send channel.\"));\n\n return;\n }\n\n child.send(options.request);\n });\n}\n\nfunction defaultForkProcess(entry: string, options: { cwd: string }): RegistrationChildProcess {\n const forkOptions: NonNullable<Parameters<typeof fork>[2]> & { windowsHide?: boolean } = {\n cwd: options.cwd,\n stdio: [\"ignore\", \"pipe\", \"pipe\", \"ipc\"],\n windowsHide: true,\n };\n\n return fork(entry, [], forkOptions);\n}\n\n/** Resolve from Core's package root, not an assumed bundler-preserved dirname. */\nfunction resolveCompiledChildEntry(): string {\n let directory = path.dirname(fileURLToPath(import.meta.url));\n\n while (directory !== path.dirname(directory)) {\n const packageJson = path.join(directory, \"package.json\");\n\n if (existsSync(packageJson)) {\n try {\n if (JSON.parse(readFileSync(packageJson, \"utf8\")).name === \"@warlock.js/core\") {\n const child = path.join(directory, \"esm\", \"production\", \"route-registration-child.mjs\");\n\n if (existsSync(child)) {\n return child;\n }\n\n throw new Error(\n `@warlock.js/core is missing its compiled route-registration child at ${child}. Reinstall a complete package.`,\n );\n }\n } catch (error) {\n if (error instanceof Error && error.message.includes(\"route-registration child\")) {\n throw error;\n }\n }\n }\n\n directory = path.dirname(directory);\n }\n\n throw new Error(\n \"Could not locate @warlock.js/core package root for the route-registration child.\",\n );\n}\n\nfunction isChildMessage(\n value: unknown,\n resultMessageType: string,\n): value is Record<string, unknown> & { type: string } {\n if (typeof value !== \"object\" || value === null || !(\"type\" in value)) {\n return false;\n }\n\n const type = (value as { type?: unknown }).type;\n\n return (\n type === resultMessageType ||\n type === REGISTRATION_ERROR_MESSAGE ||\n type === REGISTRATION_PROGRESS_MESSAGE\n );\n}\n\nfunction formatDiagnostics(stdout: string, stderr: string): string {\n if (!stdout && !stderr) {\n return \"\";\n }\n\n return `\\nChild stdout:\\n${stdout}\\nChild stderr:\\n${stderr}`;\n}\n"],"mappings":";;;;;;AAKA,MAAM,qBAAqB;AAC3B,MAAM,uBAAuB;;AAG7B,MAAa,6BAA6B;;AAG1C,MAAa,gCAAgC;;;;;;;;;AAyC7C,SAAgB,qBACd,SACkB;CAClB,MAAM,YAAY,QAAQ,aAAa;CACvC,MAAM,YAAY,KAAK,IAAI;CAC3B,MAAM,cAAc,QAAQ,eAAe;CAC3C,MAAM,QACJ,QAAQ,eACP,QAAQ,cAAc,wCAAwC,0BAA0B;CAE3F,OAAO,IAAI,SAAkB,SAAS,WAAW;EAC/C,MAAM,QAAQ,YAAY,OAAO,EAAE,KAAK,QAAQ,IAAI,CAAC;EACrD,IAAI,UAAU;EACd,IAAI;EACJ,IAAI,SAAS;EACb,I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S;CACpC;CAEA,MAAM,IAAI,MACR,kFACF;AACF;AAEA,SAAS,eACP,OACA,mBACqD;CACrD,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,EAAE,UAAU,QAC7D,OAAO;CAGT,MAAM,OAAQ,MAA6B;CAE3C,OACE,SAAS,qBACT,uCACA;AAEJ;AAEA,SAAS,kBAAkB,QAAgB,QAAwB;CACjE,IAAI,CAAC,UAAU,CAAC,QACd,OAAO;CAGT,OAAO,oBAAoB,OAAO,mBAAmB;AACvD"}
@@ -1,5 +1,4 @@
1
1
  import { WarlockConfig } from "../warlock-config/types.mjs";
2
-
3
2
  //#region ../../packages/core/src/production/resolve-build-config.d.ts
4
3
  /**
5
4
  * Keys the builder deletes before handing the options to esbuild — ours
@@ -17,9 +16,10 @@ import { WarlockConfig } from "../warlock-config/types.mjs";
17
16
  * `start-production.command.ts`, which then could not trust its own config.
18
17
  */
19
18
  type BuilderStrippedKeys = "singleBundle" | "esmShim" | "banner" | "routeRegistrationTimeoutMs";
20
- type ResolvedBuildConfig = Required<Omit<NonNullable<WarlockConfig["build"]>, "outDirectory" | BuilderStrippedKeys>> & Partial<Pick<NonNullable<WarlockConfig["build"]>, BuilderStrippedKeys>> & {
21
- /** Absolute path to the bundled entry file (`{outdir}/{outFile}`) */entryPath: string;
19
+ export type ResolvedBuildConfig = Required<Omit<NonNullable<WarlockConfig["build"]>, "outDirectory" | BuilderStrippedKeys>> & Partial<Pick<NonNullable<WarlockConfig["build"]>, BuilderStrippedKeys>> & {
20
+ /** Absolute path to the bundled entry file (`{outdir}/{outFile}`) */
21
+ entryPath: string;
22
22
  };
23
23
  //#endregion
24
- export { ResolvedBuildConfig };
24
+ export {};
25
25
  //# sourceMappingURL=resolve-build-config.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-build-config.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/production/resolve-build-config.ts"],"mappings":";;;;;AAG6D;;;;AAkBrC;AAExB;;;;;;;;KAFK,mBAAA;AAAA,KAEO,mBAAA,GAAsB,QAAA,CAChC,IAAA,CAAK,WAAA,CAAY,aAAA,6BAA0C,mBAAA,KAE3D,OAAA,CAAQ,IAAA,CAAK,WAAA,CAAY,aAAA,YAAyB,mBAAA;EAAA,qEAEhD,SAAA;AAAA"}
1
+ {"version":3,"file":"resolve-build-config.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/production/resolve-build-config.ts"],"mappings":";;;;;;;;;;;;;;;;;KAqBK;YAEO,sBAAsB,SAChC,KAAK,YAAY,0CAA0C,wBAE3D,QAAQ,KAAK,YAAY,yBAAyB;;EAEhD"}
@@ -83,5 +83,5 @@ function resolveRouteRegistrationTimeoutMs(configured) {
83
83
  }
84
84
 
85
85
  //#endregion
86
- export { resolveBuildConfig };
86
+ export { ForbiddenBuildOptionError, resolveBuildConfig };
87
87
  //# sourceMappingURL=resolve-build-config.mjs.map
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -50,17 +50,18 @@ process.once("message", async (message) => {
50
50
  }
51
51
  });
52
52
  }
53
+ const routes = await collectNamedApiRoutesWithResponses({
54
+ appRoot: request.cwd,
55
+ files: filesOrchestrator.files.values(),
56
+ onWarn: (warning) => {
57
+ process.stderr.write(`[warlock] ${warning}\n`);
58
+ }
59
+ });
53
60
  await sendAndExit({
54
61
  type: "route-registration:snapshot",
55
62
  snapshot: {
56
63
  version: PROTOCOL_VERSION,
57
- routes: await collectNamedApiRoutesWithResponses({
58
- appRoot: request.cwd,
59
- files: filesOrchestrator.files.values(),
60
- onWarn: (warning) => {
61
- process.stderr.write(`[warlock] ${warning}\n`);
62
- }
63
- })
64
+ routes
64
65
  }
65
66
  });
66
67
  } catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"route-registration-child.mjs","names":[],"sources":["../../../../../../../../packages/core/src/production/route-registration-child.ts"],"sourcesContent":["import { fileExistsAsync } from \"@warlock.js/fs\";\nimport { Application } from \"../application\";\nimport { bootstrap } from \"../bootstrap\";\nimport { loadConfigFiles } from \"../config/load-config-files\";\nimport { filesOrchestrator } from \"../dev-server/files-orchestrator\";\nimport { buildOpenApiForChild } from \"../openapi/openapi-child-output\";\nimport {\n OPENAPI_PROTOCOL_VERSION,\n OPENAPI_RESULT_MESSAGE,\n parseOpenApiChildOptions,\n type OpenApiChildRequestOptions,\n} from \"../openapi/openapi-protocol\";\nimport { collectNamedApiRoutesWithResponses } from \"../router/named-api-routes-with-responses\";\nimport { loadEnvironmentFiles } from \"../utils/load-environment\";\nimport { appPath } from \"../utils/paths\";\nimport type { Environment, RuntimeStrategy } from \"../utils/environment\";\nimport { warlockConfigManager } from \"../warlock-config/warlock-config.manager\";\n\nconst PROTOCOL_VERSION = 1;\n\ntype RequestMessage = Readonly<{\n version: typeof PROTOCOL_VERSION;\n cwd: string;\n environment?: Environment;\n runtimeStrategy?: RuntimeStrategy;\n /**\n * Present for `warlock generate.openapi`: build the OpenAPI document in this process and\n * send it instead of the route snapshot. The loading above is identical for both.\n */\n openapi?: OpenApiChildRequestOptions;\n}>;\n\nprocess.once(\"message\", async (message: unknown) => {\n try {\n const request = validateRequest(message);\n process.chdir(request.cwd);\n\n if (request.environment) Application.setEnvironment(request.environment);\n if (request.runtimeStrategy) Application.setRuntimeStrategy(request.runtimeStrategy);\n\n await loadEnvironmentFiles();\n await warlockConfigManager.load();\n await filesOrchestrator.init();\n await bootstrap();\n\n if (await fileExistsAsync(appPath(\"bootstrap.ts\"))) {\n await filesOrchestrator.load(\"src/app/bootstrap.ts\");\n }\n\n await filesOrchestrator.initializeAll();\n filesOrchestrator.specialFilesCollector.collect(filesOrchestrator.getFiles());\n await loadConfigFiles(true);\n\n for (const file of filesOrchestrator.files.values()) {\n if (file.type === \"model\") {\n await sendProgress(file.relativePath);\n await filesOrchestrator.moduleLoader.loadModule(file, \"model\");\n }\n }\n\n await filesOrchestrator.moduleLoader.loadAll({\n onBeforeLoad: (file) => sendProgress(file.relativePath),\n });\n\n if (request.openapi) {\n const { document, warnings } = await buildOpenApiForChild({\n cwd: request.cwd,\n files: filesOrchestrator.files.values(),\n request: request.openapi,\n onWarn: (warning) => {\n process.stderr.write(`[warlock] ${warning}\\n`);\n },\n });\n\n await sendAndExit({\n type: OPENAPI_RESULT_MESSAGE,\n result: { version: OPENAPI_PROTOCOL_VERSION, document, warnings },\n });\n }\n\n const routes = await collectNamedApiRoutesWithResponses({\n appRoot: request.cwd,\n files: filesOrchestrator.files.values(),\n onWarn: (warning) => {\n process.stderr.write(`[warlock] ${warning}\\n`);\n },\n });\n\n await sendAndExit({\n type: \"route-registration:snapshot\",\n snapshot: { version: PROTOCOL_VERSION, routes },\n });\n } catch (error) {\n const message = error instanceof Error ? error.stack || error.message : String(error);\n await sendAndExit({ type: \"route-registration:error\", message }, 1);\n }\n});\n\nfunction validateRequest(value: unknown): RequestMessage {\n if (\n typeof value !== \"object\" ||\n value === null ||\n (value as { version?: unknown }).version !== PROTOCOL_VERSION ||\n typeof (value as { cwd?: unknown }).cwd !== \"string\" ||\n !isOptionalEnvironment((value as { environment?: unknown }).environment) ||\n !isOptionalRuntimeStrategy((value as { runtimeStrategy?: unknown }).runtimeStrategy)\n ) {\n throw new Error(\"Route registration child received an invalid protocol request.\");\n }\n\n const openapi = (value as { openapi?: unknown }).openapi;\n\n if (openapi !== undefined) {\n parseOpenApiChildOptions(openapi);\n }\n\n return value as RequestMessage;\n}\n\nfunction isOptionalEnvironment(value: unknown): value is Environment | undefined {\n return (\n value === undefined || value === \"development\" || value === \"production\" || value === \"test\"\n );\n}\n\nfunction isOptionalRuntimeStrategy(value: unknown): value is RuntimeStrategy | undefined {\n return value === undefined || value === \"development\" || value === \"production\";\n}\n\nasync function sendAndExit(message: unknown, exitCode = 0): Promise<never> {\n if (typeof process.send !== \"function\") {\n throw new Error(\"Route registration child requires an IPC channel.\");\n }\n\n await new Promise<void>((resolve, reject) => {\n process.send!(message, (error) => (error ? reject(error) : resolve()));\n });\n process.disconnect?.();\n process.exit(exitCode);\n}\n\nasync function sendProgress(module: string): Promise<void> {\n if (typeof process.send !== \"function\") return;\n await new Promise<void>((resolve, reject) => {\n process.send!({ type: \"route-registration:progress\", module }, (error) =>\n error ? reject(error) : resolve(),\n );\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAM,mBAAmB;AAczB,QAAQ,KAAK,WAAW,OAAO,YAAqB;CAClD,IAAI;EACF,MAAM,UAAU,gBAAgB,OAAO;EACvC,QAAQ,MAAM,QAAQ,GAAG;EAEzB,IAAI,QAAQ,aAAa,YAAY,eAAe,QAAQ,WAAW;EACvE,IAAI,QAAQ,iBAAiB,YAAY,mBAAmB,QAAQ,eAAe;EAEnF,MAAM,qBAAqB;EAC3B,MAAM,qBAAqB,KAAK;EAChC,MAAM,kBAAkB,KAAK;EAC7B,MAAM,UAAU;EAEhB,IAAI,MAAM,gBAAgB,QAAQ,cAAc,CAAC,GAC/C,MAAM,kBAAkB,KAAK,sBAAsB;EAGrD,MAAM,kBAAkB,cAAc;EACtC,kBAAkB,sBAAsB,QAAQ,kBAAkB,SAAS,CAAC;EAC5E,MAAM,gBAAgB,IAAI;EAE1B,KAAK,MAAM,QAAQ,kBAAkB,MAAM,OAAO,GAChD,IAAI,KAAK,SAAS,SAAS;GACzB,MAAM,aAAa,KAAK,YAAY;GACpC,MAAM,kBAAkB,aAAa,WAAW,MAAM,OAAO;EAC/D;EAGF,MAAM,kBAAkB,aAAa,QAAQ,EAC3C,eAAe,SAAS,aAAa,KAAK,YAAY,EACxD,CAAC;EAED,IAAI,QAAQ,SAAS;GACnB,MAAM,EAAE,UAAU,aAAa,MAAM,qBAAqB;IACxD,KAAK,QAAQ;IACb,OAAO,kBAAkB,MAAM,OAAO;IACtC,SAAS,QAAQ;IACjB,SAAS,YAAY;KACnB,QAAQ,OAAO,MAAM,aAAa,QAAQ,GAAG;IAC/C;GACF,CAAC;GAED,MAAM,YAAY;IAChB,MAAM;IACN,QAAQ;KAAE;KAAmC;KAAU;IAAS;GAClE,CAAC;EACH;EAUA,MAAM,YAA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AA+B;EAAO,IAAI,UAC9D,QAAQ,OAAO,KAAK,IAAI,QAAQ,CAClC;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"route-registration-child.mjs","names":[],"sources":["../../../../../../../../packages/core/src/production/route-registration-child.ts"],"sourcesContent":["import { fileExistsAsync } from \"@warlock.js/fs\";\nimport { Application } from \"../application\";\nimport { bootstrap } from \"../bootstrap\";\nimport { loadConfigFiles } from \"../config/load-config-files\";\nimport { filesOrchestrator } from \"../dev-server/files-orchestrator\";\nimport { buildOpenApiForChild } from \"../openapi/openapi-child-output\";\nimport {\n OPENAPI_PROTOCOL_VERSION,\n OPENAPI_RESULT_MESSAGE,\n parseOpenApiChildOptions,\n type OpenApiChildRequestOptions,\n} from \"../openapi/openapi-protocol\";\nimport { collectNamedApiRoutesWithResponses } from \"../router/named-api-routes-with-responses\";\nimport { loadEnvironmentFiles } from \"../utils/load-environment\";\nimport { appPath } from \"../utils/paths\";\nimport type { Environment, RuntimeStrategy } from \"../utils/environment\";\nimport { warlockConfigManager } from \"../warlock-config/warlock-config.manager\";\n\nconst PROTOCOL_VERSION = 1;\n\ntype RequestMessage = Readonly<{\n version: typeof PROTOCOL_VERSION;\n cwd: string;\n environment?: Environment;\n runtimeStrategy?: RuntimeStrategy;\n /**\n * Present for `warlock generate.openapi`: build the OpenAPI document in this process and\n * send it instead of the route snapshot. The loading above is identical for both.\n */\n openapi?: OpenApiChildRequestOptions;\n}>;\n\nprocess.once(\"message\", async (message: unknown) => {\n try {\n const request = validateRequest(message);\n process.chdir(request.cwd);\n\n if (request.environment) Application.setEnvironment(request.environment);\n if (request.runtimeStrategy) Application.setRuntimeStrategy(request.runtimeStrategy);\n\n await loadEnvironmentFiles();\n await warlockConfigManager.load();\n await filesOrchestrator.init();\n await bootstrap();\n\n if (await fileExistsAsync(appPath(\"bootstrap.ts\"))) {\n await filesOrchestrator.load(\"src/app/bootstrap.ts\");\n }\n\n await filesOrchestrator.initializeAll();\n filesOrchestrator.specialFilesCollector.collect(filesOrchestrator.getFiles());\n await loadConfigFiles(true);\n\n for (const file of filesOrchestrator.files.values()) {\n if (file.type === \"model\") {\n await sendProgress(file.relativePath);\n await filesOrchestrator.moduleLoader.loadModule(file, \"model\");\n }\n }\n\n await filesOrchestrator.moduleLoader.loadAll({\n onBeforeLoad: (file) => sendProgress(file.relativePath),\n });\n\n if (request.openapi) {\n const { document, warnings } = await buildOpenApiForChild({\n cwd: request.cwd,\n files: filesOrchestrator.files.values(),\n request: request.openapi,\n onWarn: (warning) => {\n process.stderr.write(`[warlock] ${warning}\\n`);\n },\n });\n\n await sendAndExit({\n type: OPENAPI_RESULT_MESSAGE,\n result: { version: OPENAPI_PROTOCOL_VERSION, document, warnings },\n });\n }\n\n const routes = await collectNamedApiRoutesWithResponses({\n appRoot: request.cwd,\n files: filesOrchestrator.files.values(),\n onWarn: (warning) => {\n process.stderr.write(`[warlock] ${warning}\\n`);\n },\n });\n\n await sendAndExit({\n type: \"route-registration:snapshot\",\n snapshot: { version: PROTOCOL_VERSION, routes },\n });\n } catch (error) {\n const message = error instanceof Error ? error.stack || error.message : String(error);\n await sendAndExit({ type: \"route-registration:error\", message }, 1);\n }\n});\n\nfunction validateRequest(value: unknown): RequestMessage {\n if (\n typeof value !== \"object\" ||\n value === null ||\n (value as { version?: unknown }).version !== PROTOCOL_VERSION ||\n typeof (value as { cwd?: unknown }).cwd !== \"string\" ||\n !isOptionalEnvironment((value as { environment?: unknown }).environment) ||\n !isOptionalRuntimeStrategy((value as { runtimeStrategy?: unknown }).runtimeStrategy)\n ) {\n throw new Error(\"Route registration child received an invalid protocol request.\");\n }\n\n const openapi = (value as { openapi?: unknown }).openapi;\n\n if (openapi !== undefined) {\n parseOpenApiChildOptions(openapi);\n }\n\n return value as RequestMessage;\n}\n\nfunction isOptionalEnvironment(value: unknown): value is Environment | undefined {\n return (\n value === undefined || value === \"development\" || value === \"production\" || value === \"test\"\n );\n}\n\nfunction isOptionalRuntimeStrategy(value: unknown): value is RuntimeStrategy | undefined {\n return value === undefined || value === \"development\" || value === \"production\";\n}\n\nasync function sendAndExit(message: unknown, exitCode = 0): Promise<never> {\n if (typeof process.send !== \"function\") {\n throw new Error(\"Route registration child requires an IPC channel.\");\n }\n\n await new Promise<void>((resolve, reject) => {\n process.send!(message, (error) => (error ? reject(error) : resolve()));\n });\n process.disconnect?.();\n process.exit(exitCode);\n}\n\nasync function sendProgress(module: string): Promise<void> {\n if (typeof process.send !== \"function\") return;\n await new Promise<void>((resolve, reject) => {\n process.send!({ type: \"route-registration:progress\", module }, (error) =>\n error ? reject(error) : resolve(),\n );\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAM,mBAAmB;AAczB,QAAQ,KAAK,WAAW,OAAO,YAAqB;CAClD,IAAI;EACF,MAAM,UAAU,gBAAgB,OAAO;EACvC,QAAQ,MAAM,QAAQ,GAAG;EAEzB,IAAI,QAAQ,aAAa,YAAY,eAAe,QAAQ,WAAW;EACvE,IAAI,QAAQ,iBAAiB,YAAY,mBAAmB,QAAQ,eAAe;EAEnF,MAAM,qBAAqB;EAC3B,MAAM,qBAAqB,KAAK;EAChC,MAAM,kBAAkB,KAAK;EAC7B,MAAM,UAAU;EAEhB,IAAI,MAAM,gBAAgB,QAAQ,cAAc,CAAC,GAC/C,MAAM,kBAAkB,KAAK,sBAAsB;EAGrD,MAAM,kBAAkB,cAAc;EACtC,kBAAkB,sBAAsB,QAAQ,kBAAkB,SAAS,CAAC;EAC5E,MAAM,gBAAgB,IAAI;EAE1B,KAAK,MAAM,QAAQ,kBAAkB,MAAM,OAAO,GAChD,IAAI,KAAK,SAAS,SAAS;GACzB,MAAM,aAAa,KAAK,YAAY;GACpC,MAAM,kBAAkB,aAAa,WAAW,MAAM,OAAO;EAC/D;EAGF,MAAM,kBAAkB,aAAa,QAAQ,EAC3C,eAAe,SAAS,aAAa,KAAK,YAAY,EACxD,CAAC;EAED,IAAI,QAAQ,SAAS;GACnB,MAAM,EAAE,UAAU,aAAa,MAAM,q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AAW;EAC3C,QAAQ,KAAM,UAAU,UAAW,QAAQ,OAAO,KAAK,IAAI,QAAQ,CAAE;CACvE,CAAC;CACD,QAAQ,aAAa;CACrB,QAAQ,KAAK,QAAQ;AACvB;AAEA,eAAe,aAAa,QAA+B;CACzD,IAAI,OAAO,QAAQ,SAAS,YAAY;CACxC,MAAM,IAAI,SAAe,SAAS,WAAW;EAC3C,QAAQ,KAAM;GAAE,MAAM;GAA+B;EAAO,IAAI,UAC9D,QAAQ,OAAO,KAAK,IAAI,QAAQ,CAClC;CACF,CAAC;AACH"}
@@ -95,5 +95,5 @@ function tsconfigPathAliases(options) {
95
95
  }
96
96
 
97
97
  //#endregion
98
- export { tsconfigPathAliases };
98
+ export { collectWildcardPathAliases, substituteWildcard, tsconfigPathAliases };
99
99
  //# sourceMappingURL=tsconfig-path-aliases.mjs.map
@@ -1,5 +1,4 @@
1
1
  import { ComponentType, ReactElement, ReactNode } from "react";
2
-
3
2
  //#region ../../packages/core/src/react/index.d.ts
4
3
  /**
5
4
  * Render a React element/component to HTML string
@@ -16,7 +15,6 @@ import { ComponentType, ReactElement, ReactNode } from "react";
16
15
  * const html = renderReact(<WelcomeEmail name="John" />);
17
16
  * ```
18
17
  */
19
- declare function renderReact(reactElement: ReactElement | ComponentType | ReactNode): string;
18
+ export declare function renderReact(reactElement: ReactElement | ComponentType | ReactNode): string;
20
19
  //#endregion
21
- export { renderReact };
22
20
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/react/index.ts"],"mappings":";;;;;AAwKA;;;;;;;;;;;;;iBAAgB,WAAA,CAAY,YAAA,EAAc,YAAA,GAAe,aAAA,GAAgB,SAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/react/index.ts"],"mappings":";;;;;;;;;;;;;;;;;wBAwKgB,YAAY,cAAc,eAAe,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../packages/core/src/react/index.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport type { ComponentType, ReactElement, ReactNode } from \"react\";\n\n// ============================================================\n// Lazily Resolved React Modules\n// ============================================================\n\n/**\n * Installation instructions for React\n */\nconst REACT_INSTALL_INSTRUCTIONS = `\nReact SSR functionality requires React packages.\nInstall them with:\n\n warlock add react\n\nOr manually:\n\n npm install react react-dom\n pnpm add react react-dom\n yarn add react react-dom\n`.trim();\n\n/**\n * Cached React modules, populated by the first `resolveReactModules()` call\n */\nlet react: typeof import(\"react\") | null = null;\nlet reactDomServer: typeof import(\"react-dom/server\") | null = null;\n\n/**\n * Whether the resolution attempt already ran (success or failure)\n */\nlet reactResolved = false;\n\n/**\n * Why the resolution failed, when it failed.\n *\n * Cached and re-thrown on every later call: the resolution attempt runs exactly\n * once, so without this the second `renderReact()` would skip the attempt and\n * fall through to the \"not installed\" branch, reporting a different, wrong\n * cause one call after the accurate one.\n */\nlet reactLoadError: Error | null = null;\n\n/**\n * `new Error(message, { cause })` is ES2022, and this package still compiles\n * against the ES2020 lib (see #16), where `Error` is typed as taking a message\n * only. Node has supported the option since v16, so this is the type layer\n * catching up with the runtime, not a change in what the code does.\n */\ntype ErrorWithCauseConstructor = new (message: string, options: { cause: unknown }) => Error;\n\nconst ErrorWithCause = Error as ErrorWithCauseConstructor;\n\n/**\n * Whether `error` says `specifier` itself is absent, as opposed to present but\n * broken.\n *\n * Both halves are load-bearing. `MODULE_NOT_FOUND` alone is not enough: a\n * dependency missing *inside* react raises the very same code (`Cannot find\n * module 'scheduler'`), and treating that as absence would tell the operator to\n * install a package they already have. So the message has to name the specifier\n * exactly — quoted, which is also what stops `'react-dom'` from matching a\n * check for `'react'`.\n */\nfunction isModuleMissing(error: unknown, specifier: string): boolean {\n if (!(error instanceof Error)) return false;\n\n return (\n (error as NodeJS.ErrnoException).code === \"MODULE_NOT_FOUND\" &&\n error.message.includes(`Cannot find module '${specifier}'`)\n );\n}\n\n/**\n * Require one module, translating its failure into a message that names the\n * specifier that actually failed.\n *\n * The two specifiers are resolved separately and reported separately: a broken\n * `react-dom/server` must never be announced as \"react is not installed\", since\n * that sends the operator to fix a package that is already fine.\n */\nfunction requireModule<T>(require: NodeRequire, specifier: string): T {\n try {\n const module = require(specifier);\n\n return (module.default ?? module) as T;\n } catch (error) {\n if (isModuleMissing(error, specifier)) {\n throw new Error(`${specifier} is not installed.\\n\\n${REACT_INSTALL_INSTRUCTIONS}`);\n }\n\n // The package is there, it just would not load. Its own error names the\n // real cause, so it is inlined *and* chained: a terminal that never prints\n // `cause` must still show the text that actually helps.\n throw new ErrorWithCause(`Failed to load \"${specifier}\": ${(error as Error).message}`, {\n cause: error,\n });\n }\n}\n\n/**\n * Resolve the React modules synchronously, on first use.\n *\n * Resolution is deliberately *lazy* and *synchronous*:\n *\n * - Lazy, because a top-level require would drag react and react-dom into every\n * `import \"@warlock.js/core\"`, including apps that never render a component.\n * - Synchronous, because `renderReact()` is synchronous. An async import kicked\n * off at module load leaves a window in which the modules are neither loaded\n * nor known to be missing, and a render running inside that window has no\n * correct answer to give — it used to read `createElement` off `undefined`.\n *\n * `createRequire` gives an ESM-safe `require`, and the outcome — modules,\n * absence or load failure — is cached, so resolution runs exactly once per\n * process. The failure *reason* is cached too, not just the fact of it: every\n * call after a failed load has to report the same cause as the first one.\n *\n * @throws when react or react-dom is not installed, or cannot be loaded\n */\nfunction resolveReactModules() {\n if (!reactResolved) {\n reactResolved = true;\n\n try {\n const require = createRequire(import.meta.url);\n react = requireModule<typeof import(\"react\")>(require, \"react\");\n reactDomServer = requireModule<typeof import(\"react-dom/server\")>(\n require,\n \"react-dom/server\",\n );\n } catch (error) {\n react = null;\n reactDomServer = null;\n reactLoadError = error as Error;\n }\n }\n\n if (reactLoadError) {\n throw reactLoadError;\n }\n\n if (!react || !reactDomServer) {\n throw new Error(`react is not installed.\\n\\n${REACT_INSTALL_INSTRUCTIONS}`);\n }\n\n return { react, reactDomServer };\n}\n\n// ============================================================\n// Render Function\n// ============================================================\n\n/**\n * Render a React element/component to HTML string\n *\n * **Important:** This function requires React packages to be installed.\n * Install them with: `warlock add react` or `yarn add react react-dom`\n *\n * React is resolved synchronously on the first call that needs it, so this\n * function stays synchronous and missing packages throw here rather than\n * surfacing later as a read off an undefined module.\n *\n * @example\n * ```typescript\n * const html = renderReact(<WelcomeEmail name=\"John\" />);\n * ```\n */\nexport function renderReact(reactElement: ReactElement | ComponentType | ReactNode): string {\n const { react, reactDomServer } = resolveReactModules();\n\n if (typeof reactElement === \"function\") {\n reactElement = react.createElement(reactElement);\n }\n\n return reactDomServer.renderToString(reactElement);\n}\n"],"mappings":";;;;;;AAUA,MAAM,6BAA6B;;;;;;;;;;;EAWjC,KAAK;;;;AAKP,IAAI,QAAuC;AAC3C,IAAI,iBAA2D;;;;AAK/D,IAAI,gBAAgB;;;;;;;;;AAUpB,IAAI,iBAA+B;AAUnC,MAAM,iBAAiB;;;;;;;;;;;;AAavB,SAAS,gBAAgB,OAAgB,WAA4B;CACnE,IAAI,EAAE,iBAAiB,QAAQ,OAAO;CAEtC,OACG,MAAgC,SAAS,sBAC1C,MAAM,QAAQ,SAAS,uBAAuB,UAAU,EAAE;AAE9D;;;;;;;;;AAUA,SAAS,cAAiB,SAAsB,WAAsB;CACpE,IAAI;EACF,MAAM,SAAS,QAAQ,SAAS;EAEhC,OAAQ,OAAO,WAAW;CAC5B,SAAS,OAAO;EACd,IAAI,gBAAgB,OAAO,SAAS,GAClC,MAAM,IAAI,MAAM,GAAG,UAAU,wBAAwB,4BAA4B;EAMnF,MAAM,IAAI,eAAe,mBAAmB,UAAU,KAAM,MAAgB,WAAW,EACrF,OAAO,MACT,CAAC;CACH;AACF;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,sBAAsB;CAC7B,IAAI,CAAC,eAAe;EAClB,gBAAgB;EAEhB,IAAI;GACF,MAAM,UAAU,cAAc,OAAO,KAAK,GAAG;GAC7C,QAAQ,cAAsC,SAAS,OAAO;GAC9D,iBAAiB,cACf,SACA,kBACF;EACF,SAAS,OAAO;GACd,QAAQ;GACR,iBAAiB;GACjB,iBAAiB;EACnB;CACF;CAEA,IAAI,gBACF,MAAM;CAGR,IAAI,CAAC,SAAS,CAAC,gBACb,MAAM,IAAI,MAAM,8BAA8B,4BAA4B;CAG5E,OAAO;EAAE;EAAO;CAAe;AACjC;;;;;;;;;;;;;;;;AAqBA,SAAgB,YAAY,cAAgE;CAC1F,MAAM,EAAE,OAAO,mBAAmB,oBAAoB;CAEtD,IAAI,OAAO,iBAAiB,YAC1B,eAAe,MAAM,cAAc,YAAY;CAGjD,OAAO,eAAe,eAAe,YAAY;AACnD"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../packages/core/src/react/index.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport type { ComponentType, ReactElement, ReactNode } from \"react\";\n\n// ============================================================\n// Lazily Resolved React Modules\n// ============================================================\n\n/**\n * Installation instructions for React\n */\nconst REACT_INSTALL_INSTRUCTIONS = `\nReact SSR functionality requires React packages.\nInstall them with:\n\n warlock add react\n\nOr manually:\n\n npm install react react-dom\n pnpm add react react-dom\n yarn add react react-dom\n`.trim();\n\n/**\n * Cached React modules, populated by the first `resolveReactModules()` call\n */\nlet react: typeof import(\"react\") | null = null;\nlet reactDomServer: typeof import(\"react-dom/server\") | null = null;\n\n/**\n * Whether the resolution attempt already ran (success or failure)\n */\nlet reactResolved = false;\n\n/**\n * Why the resolution failed, when it failed.\n *\n * Cached and re-thrown on every later call: the resolution attempt runs exactly\n * once, so without this the second `renderReact()` would skip the attempt and\n * fall through to the \"not installed\" branch, reporting a different, wrong\n * cause one call after the accurate one.\n */\nlet reactLoadError: Error | null = null;\n\n/**\n * `new Error(message, { cause })` is ES2022, and this package still compiles\n * against the ES2020 lib (see #16), where `Error` is typed as taking a message\n * only. Node has supported the option since v16, so this is the type layer\n * catching up with the runtime, not a change in what the code does.\n */\ntype ErrorWithCauseConstructor = new (message: string, options: { cause: unknown }) => Error;\n\nconst ErrorWithCause = Error as ErrorWithCauseConstructor;\n\n/**\n * Whether `error` says `specifier` itself is absent, as opposed to present but\n * broken.\n *\n * Both halves are load-bearing. `MODULE_NOT_FOUND` alone is not enough: a\n * dependency missing *inside* react raises the very same code (`Cannot find\n * module 'scheduler'`), and treating that as absence would tell the operator to\n * install a package they already have. So the message has to name the specifier\n * exactly — quoted, which is also what stops `'react-dom'` from matching a\n * check for `'react'`.\n */\nfunction isModuleMissing(error: unknown, specifier: string): boolean {\n if (!(error instanceof Error)) return false;\n\n return (\n (error as NodeJS.ErrnoException).code === \"MODULE_NOT_FOUND\" &&\n error.message.includes(`Cannot find module '${specifier}'`)\n );\n}\n\n/**\n * Require one module, translating its failure into a message that names the\n * specifier that actually failed.\n *\n * The two specifiers are resolved separately and reported separately: a broken\n * `react-dom/server` must never be announced as \"react is not installed\", since\n * that sends the operator to fix a package that is already fine.\n */\nfunction requireModule<T>(require: NodeRequire, specifier: string): T {\n try {\n const module = require(specifier);\n\n return (module.default ?? module) as T;\n } catch (error) {\n if (isModuleMissing(error, specifier)) {\n throw new Error(`${specifier} is not installed.\\n\\n${REACT_INSTALL_INSTRUCTIONS}`);\n }\n\n // The package is there, it just would not load. Its own error names the\n // real cause, so it is inlined *and* chained: a terminal that never prints\n // `cause` must still show the text that actually helps.\n throw new ErrorWithCause(`Failed to load \"${specifier}\": ${(error as Error).message}`, {\n cause: error,\n });\n }\n}\n\n/**\n * Resolve the React modules synchronously, on first use.\n *\n * Resolution is deliberately *lazy* and *synchronous*:\n *\n * - Lazy, because a top-level require would drag react and react-dom into every\n * `import \"@warlock.js/core\"`, including apps that never render a component.\n * - Synchronous, because `renderReact()` is synchronous. An async import kicked\n * off at module load leaves a window in which the modules are neither loaded\n * nor known to be missing, and a render running inside that window has no\n * correct answer to give — it used to read `createElement` off `undefined`.\n *\n * `createRequire` gives an ESM-safe `require`, and the outcome — modules,\n * absence or load failure — is cached, so resolution runs exactly once per\n * process. The failure *reason* is cached too, not just the fact of it: every\n * call after a failed load has to report the same cause as the first one.\n *\n * @throws when react or react-dom is not installed, or cannot be loaded\n */\nfunction resolveReactModules() {\n if (!reactResolved) {\n reactResolved = true;\n\n try {\n const require = createRequire(import.meta.url);\n react = requireModule<typeof import(\"react\")>(require, \"react\");\n reactDomServer = requireModule<typeof import(\"react-dom/server\")>(\n require,\n \"react-dom/server\",\n );\n } catch (error) {\n react = null;\n reactDomServer = null;\n reactLoadError = error as Error;\n }\n }\n\n if (reactLoadError) {\n throw reactLoadError;\n }\n\n if (!react || !reactDomServer) {\n throw new Error(`react is not installed.\\n\\n${REACT_INSTALL_INSTRUCTIONS}`);\n }\n\n return { react, reactDomServer };\n}\n\n// ============================================================\n// Render Function\n// ============================================================\n\n/**\n * Render a React element/component to HTML string\n *\n * **Important:** This function requires React packages to be installed.\n * Install them with: `warlock add react` or `yarn add react react-dom`\n *\n * React is resolved synchronously on the first call that needs it, so this\n * function stays synchronous and missing packages throw here rather than\n * surfacing later as a read off an undefined module.\n *\n * @example\n * ```typescript\n * const html = renderReact(<WelcomeEmail name=\"John\" />);\n * ```\n */\nexport function renderReact(reactElement: ReactElement | ComponentType | ReactNode): string {\n const { react, reactDomServer } = resolveReactModules();\n\n if (typeof reactElement === \"function\") {\n reactElement = react.createElement(reactElement);\n }\n\n return reactDomServer.renderToString(reactElement);\n}\n"],"mappings":";;;;;;AAUA,MAAM,6BAA6B;;;;;;;;;;;EAWjC,KAAK;;;;AAKP,IAAI,QAAuC;AAC3C,IAAI,iBAA2D;;;;AAK/D,IAAI,gBAAgB;;;;;;;;;AAUpB,IAAI,iBAA+B;AAUnC,MAAM,iBAAiB;;;;;;;;;;;;AAavB,SAAS,gBAAgB,OAAgB,WAA4B;CACnE,IAAI,EAAE,iBAAiB,QAAQ,OAAO;CAEtC,OACG,MAAgC,SAAS,sBAC1C,MAAM,QAAQ,SAAS,uBAAuB,UAAU,EAAE;AAE9D;;;;;;;;;AAUA,SAAS,cAAiB,SAAsB,WAAsB;CACpE,IAAI;EACF,MAAM,SAAS,QAAQ,SAAS;EAEhC,OAAQ,OAAO,WAAW;CAC5B,SAAS,OAAO;EACd,IAAI,gBAAgB,OAAO,SAAS,GAClC,MAAM,IAAI,MAAM,GAAG,UAAU,wBAAwB,4BAA4B;EAMnF,MAAM,IAAI,eAAe,mBAAmB,UAAU,KAAM,MAAgB,WAAW,EACrF,OAAO,MACT,CAAC;CACH;AACF;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,sBAAsB;CAC7B,IAAI,CAAC,eAAe;EAClB,gBAAgB;EAEhB,IAAI;GACF,MAAM,UAAU,cAAc,YAAY,GAAG;GAC7C,QAAQ,cAAsC,SAAS,OAAO;GAC9D,iBAAiB,cACf,SACA,kBACF;EACF,SAAS,OAAO;GACd,QAAQ;GACR,iBAAiB;GACjB,iBAAiB;EACnB;CACF;CAEA,IAAI,gBACF,MAAM;CAGR,IAAI,CAAC,SAAS,CAAC,gBACb,MAAM,IAAI,MAAM,8BAA8B,4BAA4B;CAG5E,OAAO;EAAE;EAAO;CAAe;AACjC;;;;;;;;;;;;;;;;AAqBA,SAAgB,YAAY,cAAgE;CAC1F,MAAM,EAAE,OAAO,mBAAmB,oBAAoB;CAEtD,IAAI,OAAO,iBAAiB,YAC1B,eAAe,MAAM,cAAc,YAAY;CAGjD,OAAO,eAAe,eAAe,YAAY;AACnD"}
@@ -1,18 +1,18 @@
1
1
  import { RepositoryAdapterContract } from "../../contracts/repository-adapter.contract.mjs";
2
2
  import { ChunkCallback, CursorPaginationOptions, CursorPaginationResult, PaginationResult } from "../../contracts/types.mjs";
3
3
  import { QueryBuilderContract as QueryBuilderContract$1 } from "../../contracts/query-builder.contract.mjs";
4
+ import "../../contracts/index.mjs";
4
5
  import { ChildModel, Model } from "@warlock.js/cascade";
5
-
6
6
  //#region ../../packages/core/src/repositories/adapters/cascade/cascade-adapter.d.ts
7
7
  /** Records loaded and written per `updateMany` batch. */
8
- declare const UPDATE_MANY_BATCH_SIZE = 500;
8
+ export declare const UPDATE_MANY_BATCH_SIZE = 500;
9
9
  /**
10
10
  * Cascade adapter for Cascade-Next ORM
11
11
  * Implements RepositoryAdapterContract for @warlock.js/cascade
12
12
  *
13
13
  * @template T - The model instance type
14
14
  */
15
- declare class CascadeAdapter<T extends Model<any>> implements RepositoryAdapterContract<T> {
15
+ export declare class CascadeAdapter<T extends Model<any>> implements RepositoryAdapterContract<T> {
16
16
  private model;
17
17
  /**
18
18
  * Constructor
@@ -89,5 +89,4 @@ declare class CascadeAdapter<T extends Model<any>> implements RepositoryAdapterC
89
89
  createModel(data: any): T;
90
90
  }
91
91
  //#endregion
92
- export { CascadeAdapter, UPDATE_MANY_BATCH_SIZE };
93
92
  //# sourceMappingURL=cascade-adapter.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cascade-adapter.d.mts","names":[],"sources":["../../../../../../../../../../packages/core/src/repositories/adapters/cascade/cascade-adapter.ts"],"mappings":";;;;;;;cAYa,sBAAA;;;;AAAb;;;cAQa,cAAA,WAAyB,KAAA,kBAAuB,yBAAA,CAA0B,CAAA;EAAA,QAK1D,KAAA;EALhB;;;;cAKgB,KAAA,EAAO,UAAA,CAAW,CAAA;EAAA;;;EAStC,KAAA,IAAS,sBAAA,CAAqB,CAAA;EAoCD;;;EA7B7B,cAAA,CAAe,cAAA;EA2CO;;;EAdhB,IAAA,CAAK,EAAA,QAAU,OAAA,CAAQ,CAAA;EA0Ca;;;EAnCpC,MAAA,CAAO,MAAA,UAAgB,KAAA,QAAa,OAAA,CAAQ,CAAA;EAoGnB;;;EA7F/B,cAAA,CAAe,KAAA,EAAO,CAAA;EAwIuB;;;EAjI7C,gBAAA,CAAiB,IAAA,QAAY,CAAA;EA0IjC;;;EAnII,qBAAA;EAyJwB;;;EAlJlB,MAAA,CAAO,IAAA,QAAY,OAAA,CAAQ,CAAA;EArFd;;;EA4Fb,MAAA,CAAO,EAAA,OAAS,IAAA,QAAY,OAAA,CAAQ,CAAA;EAvFtB;;;EAoGd,MAAA,CAAO,EAAA,QAAU,OAAA;EApGH;;;EAoHd,UAAA,CAAW,MAAA,OAAa,IAAA,QAAY,OAAA;EApG1C;;;EAwIM,UAAA,CAAW,MAAA,QAAc,OAAA;EA3GV;;;EAqIf,KAAA,CAAM,MAAA,SAAe,OAAA;EA9HE;;;EA+IvB,QAAA,CAAS,IAAA,UAAc,KAAA,WAAgB,OAAA,CAAQ,gBAAA,CAAiB,CAAA;EAxIhD;;;EA+IhB,cAAA,CACX,OAAA,EAAS,uBAAA,GACR,OAAA,CAAQ,sBAAA,CAAuB,CAAA;EA1IE;;;EAqJvB,KAAA,CAAM,IAAA,UAAc,QAAA,EAAU,aAAA,CAAc,CAAA,IAAK,OAAA;EAvI9B;;;EAkJzB,WAAA,CAAY,IAAA,QAAY,CAAA;AAAA"}
1
+ {"version":3,"file":"cascade-adapter.d.mts","names":["QueryBuilderContract"],"sources":["../../../../../../../../../../packages/core/src/repositories/adapters/cascade/cascade-adapter.ts"],"mappings":";;;;;;;qBAYa;;;;;;;qBAQA,eAAe,UAAU,uBAAuB,0BAA0B;UAK1D;;;;;EAA3B,YAA2B,OAAO,WAAW;;;;EAStC,SAASA,uBAAqB;;;;EAO9B,eAAe;;;;EA6BT,KAAK,UAAU,QAAQ;;;;EAOvB,OAAO,gBAAgB,aAAa,QAAQ;;;;EAOlD,eAAe,OAAO;;;;EAOtB,iBAAiB,YAAY;;;;EAO7B;;;;EAOM,OAAO,YAAY,QAAQ;;;;EAO3B,OAAO,SAAS,YAAY,QAAQ;;;;EAapC,OAAO,UAAU;;;;EAgBjB,WAAW,aAAa,YAAY;;;;EAoCpC,WAAW,cAAc;;;;EA0BzB,MAAM,eAAe;;;;EAiBrB,SAAS,cAAc,gBAAgB,QAAQ,iBAAiB;;;;EAOhE,eACX,SAAS,0BACR,QAAQ,uBAAuB;;;;EAWrB,MAAM,cAAc,UAAU,cAAc,KAAK;;;;EAWvD,YAAY,YAAY"}
@@ -1,7 +1,7 @@
1
1
  import { ChunkCallback, CursorPaginationOptions, CursorPaginationResult, FilterOptions, FilterRules, PaginationResult, WhereOperator } from "../../contracts/types.mjs";
2
2
  import { AggregateExpressions, GroupByFields, QueryBuilderContract as QueryBuilderContract$1 } from "../../contracts/query-builder.contract.mjs";
3
+ import "../../contracts/index.mjs";
3
4
  import { Model, QueryBuilderContract } from "@warlock.js/cascade";
4
-
5
5
  //#region ../../packages/core/src/repositories/adapters/cascade/cascade-query-builder.d.ts
6
6
  /**
7
7
  * Cascade query builder wrapper
@@ -9,7 +9,7 @@ import { Model, QueryBuilderContract } from "@warlock.js/cascade";
9
9
  *
10
10
  * @template T - The model instance type
11
11
  */
12
- declare class CascadeQueryBuilder<T extends Model> implements QueryBuilderContract$1<T> {
12
+ export declare class CascadeQueryBuilder<T extends Model> implements QueryBuilderContract$1<T> {
13
13
  private query;
14
14
  /**
15
15
  * Constructor
@@ -178,5 +178,4 @@ declare class CascadeQueryBuilder<T extends Model> implements QueryBuilderContra
178
178
  clone(): this;
179
179
  }
180
180
  //#endregion
181
- export { CascadeQueryBuilder };
182
181
  //# sourceMappingURL=cascade-query-builder.d.mts.map