@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":"module-loader.mjs","names":[],"sources":["../../../../../../../../packages/core/src/dev-server/module-loader.ts"],"sourcesContent":["import { pathToFileURL } from \"node:url\";\nimport ts from \"typescript\";\nimport { importAppModule } from \"../loader/app-module-importer\";\nimport { registerGroupedTranslationKeys, registerLocaleDictionary } from \"../localization\";\nimport { router } from \"../router/router\";\nimport { devLogError, formatModuleNotFoundError } from \"./dev-logger\";\nimport { extractTranslationKeys } from \"./extract-translation-keys\";\nimport type { CleanupFunction, FileManager } from \"./file-manager\";\nimport { warnForLegacyLocales } from \"./legacy-locales-warning\";\nimport { getDevelopmentModelModuleRegistry } from \"./model-module-registry\";\nimport type { SpecialFileType, SpecialFilesCollector } from \"./special-files-collector\";\n\ndeclare global {\n var __currentModuleFile: FileManager | undefined;\n}\n\n/**\n * Thrown when a special file (route/event/main/locale) fails to import or\n * register. Carries the file that failed and the original cause so a broken\n * module surfaces with its origin instead of vanishing into a 404.\n */\nexport class ModuleLoadError extends Error {\n /** Stable Warlock error code; `warlock explain WL2001` prints the fix. */\n public readonly code = \"WL2001\";\n\n public constructor(\n public readonly type: string,\n public readonly file: FileManager,\n public readonly cause: unknown,\n ) {\n const reason = cause instanceof Error ? cause.message : String(cause);\n super(`Failed to load ${type}: ${file.relativePath} - ${reason}`);\n this.name = \"ModuleLoadError\";\n }\n}\n\n/**\n * The \"special\" file kinds that the dev server eagerly imports at boot.\n * Order matters: locales first (used by everything), events before main so\n * listeners are registered when main runs, routes after main so handlers are\n * bound, worker last so scheduled jobs and queue definitions see routes\n * already registered. Dev always loads worker files since dev runs every role.\n */\nconst SPECIAL_TYPES: readonly SpecialFileType[] = [\n \"locale\",\n \"event\",\n \"main\",\n \"route\",\n \"worker\",\n] as const;\n\n/**\n * Loads application modules through the ESM loader hook. The hook stamps\n * `?v=N` on every import, so each reload is a fresh module without any\n * userland cache-busting plumbing.\n */\nexport class ModuleLoader {\n private readonly loadedModules = new Map<string, unknown>();\n\n public constructor(private readonly specialFilesCollector: SpecialFilesCollector) {\n // Web creates its Vite bridge after Core's development orchestration has\n // constructed ModuleLoader. Create the carrier now so a zero-model app can\n // subscribe before a model is added later through HMR.\n getDevelopmentModelModuleRegistry();\n }\n\n /**\n * Eagerly load every special file at boot, in the canonical order so\n * later phases (e.g. routes) see state earlier phases registered.\n *\n * A failing module no longer vanishes silently: each failure is collected\n * (so one broken file doesn't hide the others) and, once every file has been\n * attempted, an aggregate error is thrown. The boot callers\n * (`DevelopmentServer.start`, the HTTP test bootstrap) already wrap this in a\n * try/catch that logs and aborts the boot — so a broken route module aborts\n * boot loudly rather than booting into a surface that 404s.\n */\n public async loadAll(\n options: { onBeforeLoad?: (file: FileManager) => void | Promise<void> } = {},\n ): Promise<void> {\n const failures: ModuleLoadError[] = [];\n\n for (const type of SPECIAL_TYPES) {\n for (const file of this.specialFilesCollector.getFilesByType(type)) {\n try {\n await options.onBeforeLoad?.(file);\n await this.loadModule(file, type);\n } catch (error) {\n failures.push(\n error instanceof ModuleLoadError ? error : new ModuleLoadError(type, file, error),\n );\n }\n }\n }\n\n if (failures.length > 0) {\n throw new AggregateError(\n failures,\n `${failures.length} module(s) failed to load during boot:\\n` +\n failures.map((failure) => ` - ${failure.message}`).join(\"\\n\"),\n );\n }\n }\n\n /**\n * Import a file through the loader hook. For routes, scopes the import in\n * `router.withSourceFile()` so the added routes carry their origin.\n */\n public async loadModule<T = unknown>(file: FileManager, type: string): Promise<T | undefined> {\n if (file.relativePath.endsWith(\".env\")) return undefined;\n\n if (type === \"locale\" && /\\/utils\\/locales\\.(ts|tsx)$/.test(file.relativePath)) {\n warnForLegacyLocales(\n this.specialFilesCollector.getFilesByType(\"locale\").map((locale) => locale.relativePath),\n );\n }\n\n if (type === \"locale\" && file.relativePath.endsWith(\".json\")) {\n const cleanup = registerLocaleDictionary({\n sourceFile: file.relativePath,\n source: file.source,\n defaultNamespace: file.relativePath.split(\"/\")[2]!,\n });\n file.addCleanup(cleanup);\n return undefined;\n }\n\n if (type === \"locale\") {\n registerGroupedTranslationKeys(\n file.relativePath,\n extractTranslationKeys(\n ts.createSourceFile(file.relativePath, file.source, ts.ScriptTarget.Latest),\n ),\n );\n }\n\n globalThis.__currentModuleFile = file;\n\n try {\n const fileUrl = pathToFileURL(file.absolutePath).href;\n\n const load = async () => {\n const module = (await importAppModule(fileUrl)) as Record<string, unknown>;\n this.loadedModules.set(file.absolutePath, module);\n this.registerCleanup(file, module);\n if (type === \"model\") {\n getDevelopmentModelModuleRegistry().publish(file.absolutePath, fileUrl, module);\n }\n return module as T;\n };\n\n return type === \"route\" ? await router.withSourceFile(file.relativePath, load) : await load();\n } catch (error: any) {\n if (error.code === \"ERR_MODULE_NOT_FOUND\") {\n devLogError(formatModuleNotFoundError(error));\n } else {\n // Pass the error through so devLogError prints the stack. With dev\n // source maps enabled, frames remap to the original `.ts` line/col\n // (e.g. the actual call site of an undefined symbol) instead of\n // vanishing — a one-line \"x is not defined\" is undebuggable.\n devLogError(\n `Failed to load ${type}: ${file.relativePath} - ${error?.message || error}`,\n error,\n );\n }\n\n // RETHROW after logging. Previously this returned undefined, so a route\n // file that threw on import or registration disappeared with no boot\n // error — the whole surface 404'd silently. Boot callers abort on the\n // throw; the HMR batch-reload handler catches it, keeps the server\n // alive, and shows it loudly.\n throw error instanceof ModuleLoadError ? error : new ModuleLoadError(type, file, error);\n } finally {\n globalThis.__currentModuleFile = undefined;\n }\n }\n\n /**\n * Reload a previously-loaded special file. The version-bump that makes the\n * import fresh is done by the caller (layer-executor) before invoking this.\n * Routes are removed from the registry first so re-registration is clean.\n */\n public async reloadModule(file: FileManager): Promise<void> {\n const moduleType = this.specialFilesCollector.getFileType(file.relativePath);\n if (!moduleType) return;\n\n this.runCleanup(file);\n\n if (moduleType === \"route\") {\n router.removeRoutesBySourceFile(file.relativePath);\n }\n\n this.loadedModules.delete(file.absolutePath);\n await this.loadModule(file, moduleType);\n }\n\n /**\n * Run every cleanup hook the file registered (or `$cleanup` on its exports)\n * and reset the list. Called once per HMR reload.\n */\n public runCleanup(file: FileManager): void {\n for (const hook of file.cleanup) {\n try {\n if (typeof hook === \"function\") {\n hook();\n } else if (\n hook &&\n typeof (hook as { unsubscribe?: () => void }).unsubscribe === \"function\"\n ) {\n (hook as { unsubscribe: () => void }).unsubscribe();\n }\n } catch {\n // Cleanup errors shouldn't break HMR.\n }\n }\n file.resetCleanup();\n }\n\n /**\n * Clean up after a file whose source was deleted from disk.\n */\n public cleanupDeletedModule(file: FileManager): void {\n this.loadedModules.delete(file.absolutePath);\n\n if (file.type === \"model\") {\n getDevelopmentModelModuleRegistry().remove(file.absolutePath);\n }\n\n if (file.type === \"route\") {\n router.removeRoutesBySourceFile(file.relativePath);\n }\n\n this.runCleanup(file);\n }\n\n /**\n * Scan a freshly-loaded module for cleanup handlers and register them on\n * the FileManager so they run before the next reload. Priority: explicit\n * `export function cleanup()` → `.$cleanup` on any exported value.\n */\n private registerCleanup(file: FileManager, module: Record<string, unknown>): void {\n if (typeof module.cleanup === \"function\") {\n file.addCleanup(module.cleanup as CleanupFunction);\n return;\n }\n\n const cleanups: CleanupFunction[] = [];\n\n for (const exportedValue of Object.values(module)) {\n const cleanup = (exportedValue as { $cleanup?: unknown })?.$cleanup;\n if (typeof cleanup === \"function\") {\n cleanups.push(cleanup.bind(exportedValue) as CleanupFunction);\n }\n }\n\n if (cleanups.length > 0) {\n file.addCleanup(cleanups);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,IAAa,kBAAb,cAAqC,MAAM;CAIzC,AAAO,YACL,AAAgB,MAChB,AAAgB,MAChB,AAAgB,OAChB;EACA,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACpE,MAAM,kBAAkB,KAAK,IAAI,KAAK,aAAa,KAAK,QAAQ;EALhD;EACA;EACA;cALK;EASrB,KAAK,OAAO;CACd;AACF;;;;;;;;AASA,MAAM,gBAA4C;CAChD;CACA;CACA;CACA;CACA;AACF;;;;;;AAOA,IAAa,eAAb,MAA0B;CAGxB,AAAO,YAAY,AAAiB,uBAA8C;EAA9C;uCAFH,IAAI,IAAqB;EAMxD,kCAAkC;CACpC;;;;;;;;;;;;CAaA,MAAa,QACX,UAA0E,CAAC,GAC5D;EACf,MAAM,WAA8B,CAAC;EAErC,KAAK,MAAM,QAAQ,eACjB,KAAK,MAAM,QAAQ,KAAK,sBAAsB,eAAe,IAAI,GAC/D,IAAI;GACF,MAAM,QAAQ,eAAe,IAAI;GACjC,MAAM,KAAK,WAAW,MAAM,IAAI;EAClC,SAAS,OAAO;GACd,SAAS,KACP,iBAAiB,kBAAkB,QAAQ,IAAI,gBAAgB,MAAM,MAAM,KAAK,CAClF;EACF;EAIJ,IAAI,SAAS,SAAS,GACpB,MAAM,IAAI,eACR,UACA,G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I,gBAAgB,MAAM,MAAM,KAAK;EACxF,UAAU;GACR,WAAW,sBAAsB;EACnC;CACF;;;;;;CAOA,MAAa,aAAa,MAAkC;EAC1D,MAAM,aAAa,KAAK,sBAAsB,YAAY,KAAK,YAAY;EAC3E,IAAI,CAAC,YAAY;EAEjB,KAAK,WAAW,IAAI;EAEpB,IAAI,eAAe,SACjB,OAAO,yBAAyB,KAAK,YAAY;EAGnD,KAAK,cAAc,OAAO,KAAK,YAAY;EAC3C,MAAM,KAAK,WAAW,MAAM,UAAU;CACxC;;;;;CAMA,AAAO,WAAW,MAAyB;EACzC,KAAK,MAAM,QAAQ,KAAK,SACtB,IAAI;GACF,IAAI,OAAO,SAAS,YAClB,KAAK;QACA,IACL,QACA,OAAQ,KAAsC,gBAAgB,YAE9D,AAAC,KAAqC,YAAY;EAEtD,QAAQ,CAER;EAEF,KAAK,aAAa;CACpB;;;;CAKA,AAAO,qBAAqB,MAAyB;EACnD,KAAK,cAAc,OAAO,KAAK,YAAY;EAE3C,IAAI,KAAK,SAAS,SAChB,kCAAkC,CAAC,CAAC,OAAO,KAAK,YAAY;EAG9D,IAAI,KAAK,SAAS,SAChB,OAAO,yBAAyB,KAAK,YAAY;EAGnD,KAAK,WAAW,IAAI;CACtB;;;;;;CAOA,AAAQ,gBAAgB,MAAmB,QAAuC;EAChF,IAAI,OAAO,OAAO,YAAY,YAAY;GACxC,KAAK,WAAW,OAAO,OAA0B;GACjD;EACF;EAEA,MAAM,WAA8B,CAAC;EAErC,KAAK,MAAM,iBAAiB,OAAO,OAAO,MAAM,GAAG;GACjD,MAAM,UAAW,eAA0C;GAC3D,IAAI,OAAO,YAAY,YACrB,SAAS,KAAK,QAAQ,KAAK,aAAa,CAAoB;EAEhE;EAEA,IAAI,SAAS,SAAS,GACpB,KAAK,WAAW,QAAQ;CAE5B;AACF"}
1
+ {"version":3,"file":"module-loader.mjs","names":[],"sources":["../../../../../../../../packages/core/src/dev-server/module-loader.ts"],"sourcesContent":["import { pathToFileURL } from \"node:url\";\nimport { parseSourceFile } from \"../tooling/syntax/ast\";\nimport { importAppModule } from \"../loader/app-module-importer\";\nimport { registerGroupedTranslationKeys, registerLocaleDictionary } from \"../localization\";\nimport { router } from \"../router/router\";\nimport { devLogError, formatModuleNotFoundError } from \"./dev-logger\";\nimport { extractTranslationKeys } from \"./extract-translation-keys\";\nimport type { CleanupFunction, FileManager } from \"./file-manager\";\nimport { warnForLegacyLocales } from \"./legacy-locales-warning\";\nimport { getDevelopmentModelModuleRegistry } from \"./model-module-registry\";\nimport type { SpecialFileType, SpecialFilesCollector } from \"./special-files-collector\";\n\ndeclare global {\n var __currentModuleFile: FileManager | undefined;\n}\n\n/**\n * Thrown when a special file (route/event/main/locale) fails to import or\n * register. Carries the file that failed and the original cause so a broken\n * module surfaces with its origin instead of vanishing into a 404.\n */\nexport class ModuleLoadError extends Error {\n /** Stable Warlock error code; `warlock explain WL2001` prints the fix. */\n public readonly code = \"WL2001\";\n\n public constructor(\n public readonly type: string,\n public readonly file: FileManager,\n public readonly cause: unknown,\n ) {\n const reason = cause instanceof Error ? cause.message : String(cause);\n super(`Failed to load ${type}: ${file.relativePath} - ${reason}`);\n this.name = \"ModuleLoadError\";\n }\n}\n\n/**\n * The \"special\" file kinds that the dev server eagerly imports at boot.\n * Order matters: locales first (used by everything), events before main so\n * listeners are registered when main runs, routes after main so handlers are\n * bound, worker last so scheduled jobs and queue definitions see routes\n * already registered. Dev always loads worker files since dev runs every role.\n */\nconst SPECIAL_TYPES: readonly SpecialFileType[] = [\n \"locale\",\n \"event\",\n \"main\",\n \"route\",\n \"worker\",\n] as const;\n\n/**\n * Loads application modules through the ESM loader hook. The hook stamps\n * `?v=N` on every import, so each reload is a fresh module without any\n * userland cache-busting plumbing.\n */\nexport class ModuleLoader {\n private readonly loadedModules = new Map<string, unknown>();\n\n public constructor(private readonly specialFilesCollector: SpecialFilesCollector) {\n // Web creates its Vite bridge after Core's development orchestration has\n // constructed ModuleLoader. Create the carrier now so a zero-model app can\n // subscribe before a model is added later through HMR.\n getDevelopmentModelModuleRegistry();\n }\n\n /**\n * Eagerly load every special file at boot, in the canonical order so\n * later phases (e.g. routes) see state earlier phases registered.\n *\n * A failing module no longer vanishes silently: each failure is collected\n * (so one broken file doesn't hide the others) and, once every file has been\n * attempted, an aggregate error is thrown. The boot callers\n * (`DevelopmentServer.start`, the HTTP test bootstrap) already wrap this in a\n * try/catch that logs and aborts the boot — so a broken route module aborts\n * boot loudly rather than booting into a surface that 404s.\n */\n public async loadAll(\n options: { onBeforeLoad?: (file: FileManager) => void | Promise<void> } = {},\n ): Promise<void> {\n const failures: ModuleLoadError[] = [];\n\n for (const type of SPECIAL_TYPES) {\n for (const file of this.specialFilesCollector.getFilesByType(type)) {\n try {\n await options.onBeforeLoad?.(file);\n await this.loadModule(file, type);\n } catch (error) {\n failures.push(\n error instanceof ModuleLoadError ? error : new ModuleLoadError(type, file, error),\n );\n }\n }\n }\n\n if (failures.length > 0) {\n throw new AggregateError(\n failures,\n `${failures.length} module(s) failed to load during boot:\\n` +\n failures.map((failure) => ` - ${failure.message}`).join(\"\\n\"),\n );\n }\n }\n\n /**\n * Import a file through the loader hook. For routes, scopes the import in\n * `router.withSourceFile()` so the added routes carry their origin.\n */\n public async loadModule<T = unknown>(file: FileManager, type: string): Promise<T | undefined> {\n if (file.relativePath.endsWith(\".env\")) return undefined;\n\n if (type === \"locale\" && /\\/utils\\/locales\\.(ts|tsx)$/.test(file.relativePath)) {\n warnForLegacyLocales(\n this.specialFilesCollector.getFilesByType(\"locale\").map((locale) => locale.relativePath),\n );\n }\n\n if (type === \"locale\" && file.relativePath.endsWith(\".json\")) {\n const cleanup = registerLocaleDictionary({\n sourceFile: file.relativePath,\n source: file.source,\n defaultNamespace: file.relativePath.split(\"/\")[2]!,\n });\n file.addCleanup(cleanup);\n return undefined;\n }\n\n if (type === \"locale\") {\n registerGroupedTranslationKeys(\n file.relativePath,\n extractTranslationKeys(parseSourceFile(file.relativePath, file.source)),\n );\n }\n\n globalThis.__currentModuleFile = file;\n\n try {\n const fileUrl = pathToFileURL(file.absolutePath).href;\n\n const load = async () => {\n const module = (await importAppModule(fileUrl)) as Record<string, unknown>;\n this.loadedModules.set(file.absolutePath, module);\n this.registerCleanup(file, module);\n if (type === \"model\") {\n getDevelopmentModelModuleRegistry().publish(file.absolutePath, fileUrl, module);\n }\n return module as T;\n };\n\n return type === \"route\" ? await router.withSourceFile(file.relativePath, load) : await load();\n } catch (error: any) {\n if (error.code === \"ERR_MODULE_NOT_FOUND\") {\n devLogError(formatModuleNotFoundError(error));\n } else {\n // Pass the error through so devLogError prints the stack. With dev\n // source maps enabled, frames remap to the original `.ts` line/col\n // (e.g. the actual call site of an undefined symbol) instead of\n // vanishing — a one-line \"x is not defined\" is undebuggable.\n devLogError(\n `Failed to load ${type}: ${file.relativePath} - ${error?.message || error}`,\n error,\n );\n }\n\n // RETHROW after logging. Previously this returned undefined, so a route\n // file that threw on import or registration disappeared with no boot\n // error — the whole surface 404'd silently. Boot callers abort on the\n // throw; the HMR batch-reload handler catches it, keeps the server\n // alive, and shows it loudly.\n throw error instanceof ModuleLoadError ? error : new ModuleLoadError(type, file, error);\n } finally {\n globalThis.__currentModuleFile = undefined;\n }\n }\n\n /**\n * Reload a previously-loaded special file. The version-bump that makes the\n * import fresh is done by the caller (layer-executor) before invoking this.\n * Routes are removed from the registry first so re-registration is clean.\n */\n public async reloadModule(file: FileManager): Promise<void> {\n const moduleType = this.specialFilesCollector.getFileType(file.relativePath);\n if (!moduleType) return;\n\n this.runCleanup(file);\n\n if (moduleType === \"route\") {\n router.removeRoutesBySourceFile(file.relativePath);\n }\n\n this.loadedModules.delete(file.absolutePath);\n await this.loadModule(file, moduleType);\n }\n\n /**\n * Run every cleanup hook the file registered (or `$cleanup` on its exports)\n * and reset the list. Called once per HMR reload.\n */\n public runCleanup(file: FileManager): void {\n for (const hook of file.cleanup) {\n try {\n if (typeof hook === \"function\") {\n hook();\n } else if (\n hook &&\n typeof (hook as { unsubscribe?: () => void }).unsubscribe === \"function\"\n ) {\n (hook as { unsubscribe: () => void }).unsubscribe();\n }\n } catch {\n // Cleanup errors shouldn't break HMR.\n }\n }\n file.resetCleanup();\n }\n\n /**\n * Clean up after a file whose source was deleted from disk.\n */\n public cleanupDeletedModule(file: FileManager): void {\n this.loadedModules.delete(file.absolutePath);\n\n if (file.type === \"model\") {\n getDevelopmentModelModuleRegistry().remove(file.absolutePath);\n }\n\n if (file.type === \"route\") {\n router.removeRoutesBySourceFile(file.relativePath);\n }\n\n this.runCleanup(file);\n }\n\n /**\n * Scan a freshly-loaded module for cleanup handlers and register them on\n * the FileManager so they run before the next reload. Priority: explicit\n * `export function cleanup()` → `.$cleanup` on any exported value.\n */\n private registerCleanup(file: FileManager, module: Record<string, unknown>): void {\n if (typeof module.cleanup === \"function\") {\n file.addCleanup(module.cleanup as CleanupFunction);\n return;\n }\n\n const cleanups: CleanupFunction[] = [];\n\n for (const exportedValue of Object.values(module)) {\n const cleanup = (exportedValue as { $cleanup?: unknown })?.$cleanup;\n if (typeof cleanup === \"function\") {\n cleanups.push(cleanup.bind(exportedValue) as CleanupFunction);\n }\n }\n\n if (cleanups.length > 0) {\n file.addCleanup(cleanups);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAqBA,IAAa,kBAAb,cAAqC,MAAM;CAIzC,AAAO,YACL,AAAgB,MAChB,AAAgB,MAChB,AAAgB,OAChB;EACA,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;EACpE,MAAM,kBAAkB,KAAK,IAAI,KAAK,aAAa,KAAK,QAAQ;EALhD;EACA;EACA;cALK;EASrB,KAAK,OAAO;CACd;AACF;;;;;;;;AASA,MAAM,gBAA4C;CAChD;CACA;CACA;CACA;CACA;AACF;;;;;;AAOA,IAAa,eAAb,MAA0B;CAGxB,AAAO,YAAY,AAAiB,uBAA8C;EAA9C;uCAFH,IAAI,IAAqB;EAMxD,kCAAkC;CACpC;;;;;;;;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AO,OAA0B;GACjD;EACF;EAEA,MAAM,WAA8B,CAAC;EAErC,KAAK,MAAM,iBAAiB,OAAO,OAAO,MAAM,GAAG;GACjD,MAAM,UAAW,eAA0C;GAC3D,IAAI,OAAO,YAAY,YACrB,SAAS,KAAK,QAAQ,KAAK,aAAa,CAAoB;EAEhE;EAEA,IAAI,SAAS,SAAS,GACpB,KAAK,WAAW,QAAQ;CAE5B;AACF"}
@@ -22,5 +22,5 @@ var PackageJsonManager = class {
22
22
  const packageJsonManager = new PackageJsonManager();
23
23
 
24
24
  //#endregion
25
- export { packageJsonManager };
25
+ export { PackageJsonManager, packageJsonManager };
26
26
  //# sourceMappingURL=package-json-manager.mjs.map
@@ -3,7 +3,7 @@ import { tsconfigManager } from "./tsconfig-manager.mjs";
3
3
  import path from "node:path";
4
4
  import { directoryExistsAsync, fileExistsAsync } from "@warlock.js/fs";
5
5
  import { parse } from "es-module-lexer";
6
- import ts from "typescript";
6
+ import { parseSync } from "oxc-parser";
7
7
 
8
8
  //#region ../../packages/core/src/dev-server/parse-imports.ts
9
9
  /**
@@ -209,7 +209,7 @@ function isSameFile(first, second) {
209
209
  * line-based matches keep their lines). Only the regex fallback needs it; the
210
210
  * lexer already skips comments.
211
211
  *
212
- * Comment ranges come from a real TypeScript parse, never from scanning
212
+ * Comment ranges come from an OXC parse, never from scanning
213
213
  * characters: only the parser can tell a regex literal (`/\/*$/`), a template
214
214
  * literal or JSX text (`<p>// not a comment</p>`) from a comment. A character
215
215
  * scanner read the `/*` in `p.replace(/\/*$/, "")` as a block comment and
@@ -219,48 +219,16 @@ function isSameFile(first, second) {
219
219
  * source is parsed as TSX.
220
220
  */
221
221
  function stripComments(source, filePath = "source.tsx") {
222
- const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, false, scriptKindFor(filePath));
223
- const ranges = [];
224
- const seen = /* @__PURE__ */ new Set();
225
- const collect = (node) => {
226
- if (node.kind >= ts.SyntaxKind.FirstJSDocNode && node.kind <= ts.SyntaxKind.LastJSDocNode) return;
227
- const children = node.getChildren(sourceFile);
228
- if (children.length > 0) {
229
- for (const child of children) collect(child);
230
- return;
231
- }
232
- if (node.kind === ts.SyntaxKind.JsxText || node.kind === ts.SyntaxKind.JsxTextAllWhiteSpaces) return;
233
- const tokenStart = node.getStart(sourceFile);
234
- const trivia = [...ts.getTrailingCommentRanges(source, node.pos) ?? [], ...ts.getLeadingCommentRanges(source, node.pos) ?? []];
235
- for (const range of trivia) if (range.end <= tokenStart && !seen.has(range.pos)) {
236
- seen.add(range.pos);
237
- ranges.push(range);
238
- }
239
- };
240
- collect(sourceFile);
241
- ranges.sort((first, second) => first.pos - second.pos);
222
+ const ranges = parseSync(filePath, source).comments;
242
223
  let output = "";
243
224
  let cursor = 0;
244
225
  for (const range of ranges) {
245
- output += source.slice(cursor, range.pos);
246
- output += source.slice(range.pos, range.end).replace(/[^\n]/g, "");
226
+ output += source.slice(cursor, range.start);
227
+ output += source.slice(range.start, range.end).replace(/[^\n]/g, "");
247
228
  cursor = range.end;
248
229
  }
249
230
  return output + source.slice(cursor);
250
231
  }
251
- /** The parse dialect for a file: JSX only where the extension allows it. */
252
- function scriptKindFor(filePath) {
253
- switch (path.extname(filePath).toLowerCase()) {
254
- case ".ts":
255
- case ".mts":
256
- case ".cts": return ts.ScriptKind.TS;
257
- case ".js":
258
- case ".mjs":
259
- case ".cjs": return ts.ScriptKind.JS;
260
- case ".jsx": return ts.ScriptKind.JSX;
261
- default: return ts.ScriptKind.TSX;
262
- }
263
- }
264
232
  /**
265
233
  * Merge a resolved import into the output map, preserving the type-only rule:
266
234
  * a path is type-only iff every statement that references it is type-only.
@@ -434,5 +402,5 @@ function isNodeBuiltin(importPath) {
434
402
  }
435
403
 
436
404
  //#endregion
437
- export { clearFileExistsCache, isTypeOnlyFile, parseImports };
405
+ export { clearFileExistsCache, isTypeOnlyFile, parseImports, stripComments };
438
406
  //# sourceMappingURL=parse-imports.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-imports.mjs","names":[],"sources":["../../../../../../../../packages/core/src/dev-server/parse-imports.ts"],"sourcesContent":["import { fileExistsAsync, directoryExistsAsync } from \"@warlock.js/fs\";\nimport { type ImportSpecifier, parse } from \"es-module-lexer\";\nimport path from \"node:path\";\nimport ts from \"typescript\";\nimport { Path } from \"../utils/normalized-path\";\nimport { tsconfigManager } from \"./tsconfig-manager\";\n\n/**\n * Detect if a file contains only type definitions (no runtime code)\n *\n * A file is considered type-only if ALL its exports are:\n * - interface declarations\n * - type alias declarations\n * - export type { ... } statements\n * - export type { ... } from \"...\" statements\n *\n * Files with any of these are NOT type-only:\n * - export const/let/var\n * - export function\n * - export class\n * - export default (non-type)\n * - export { ... } (without type keyword)\n * - export * from (without type keyword)\n *\n * @param source - The source code to analyze\n * @returns true if the file exports only types\n */\nexport function isTypeOnlyFile(source: string): boolean {\n // Remove comments to avoid false positives\n const withoutComments = source\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, \"\") // block comments\n .replace(/\\/\\/.*$/gm, \"\"); // line comments\n\n // Remove string literals to avoid false positives\n const withoutStrings = withoutComments\n .replace(/'(?:[^'\\\\]|\\\\.)*'/g, \"''\")\n .replace(/\"(?:[^\"\\\\]|\\\\.)*\"/g, '\"\"')\n .replace(/`(?:[^`\\\\]|\\\\.)*`/g, \"``\");\n\n // Patterns for type-only exports (these are safe)\n const typeOnlyPatterns = [\n /export\\s+type\\s+\\{[^}]*\\}/g, // export type { Foo, Bar }\n /export\\s+type\\s+\\{[^}]*\\}\\s+from\\s+['\"]/g, // export type { Foo } from \"...\"\n /export\\s+interface\\s+\\w+/g, // export interface Foo\n /export\\s+type\\s+\\w+\\s*=/g, // export type Foo =\n ];\n\n // Remove all type-only exports from consideration\n let remaining = withoutStrings;\n for (const pattern of typeOnlyPatterns) {\n remaining = remaining.replace(pattern, \"\");\n }\n\n // Patterns for runtime exports (these make the file NOT type-only)\n const runtimeExportPatterns = [\n /export\\s+(?:const|let|var)\\s+\\w+/g, // export const/let/var foo\n /export\\s+function\\s+\\w+/g, // export function foo\n /export\\s+async\\s+function\\s+\\w+/g, // export async function foo\n /export\\s+class\\s+\\w+/g, // export class Foo\n /export\\s+enum\\s+\\w+/g, // export enum Foo (enums have runtime value)\n /export\\s+default\\s+(?!type\\s)/g, // export default (not type)\n /export\\s+\\{[^}]*\\}(?!\\s+from)/g, // export { foo } (local re-export without type)\n /export\\s+\\{[^}]*\\}\\s+from\\s+['\"][^'\"]+['\"]/g, // export { foo } from (without type)\n /export\\s+\\*\\s+from\\s+['\"][^'\"]+['\"]/g, // export * from (re-exports everything)\n /export\\s+\\*\\s+as\\s+\\w+/g, // export * as namespace\n ];\n\n for (const pattern of runtimeExportPatterns) {\n if (pattern.test(remaining)) {\n // Reset regex lastIndex for subsequent tests\n pattern.lastIndex = 0;\n\n // Special case: check if export { } contains only type exports\n if (pattern.source.includes(\"export\\\\s+\\\\{\")) {\n const matches = remaining.match(/export\\s+\\{([^}]*)\\}(?:\\s+from\\s+['\"][^'\"]+['\"])?/g);\n if (matches) {\n for (const match of matches) {\n // Skip if it's already a type export\n if (/^export\\s+type\\s+/.test(match)) continue;\n\n // Extract the specifiers\n const specifiersMatch = match.match(/export\\s+\\{([^}]*)\\}/);\n if (specifiersMatch) {\n // Capture group 1 exists whenever the pattern matched. `?? \"\"`\n // yields an empty specifier list, which `some()` below reads as\n // \"no runtime specifier\" — the same answer an empty `{}` gives.\n const specifiers = specifiersMatch[1] ?? \"\";\n const items = specifiers\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n\n // If any specifier is NOT prefixed with \"type \", this is a runtime export\n const hasRuntimeSpecifier = items.some((item) => !item.startsWith(\"type \"));\n if (hasRuntimeSpecifier) {\n return false;\n }\n }\n }\n }\n continue;\n }\n\n return false;\n }\n }\n\n // If we get here, no runtime exports were found\n // But we should also verify the file has at least some type exports\n // (an empty file or file with only imports is not really \"type-only\")\n const hasTypeExports = typeOnlyPatterns.some((pattern) => {\n pattern.lastIndex = 0;\n return pattern.test(withoutStrings);\n });\n\n return hasTypeExports;\n}\n\n/**\n * Check if an import statement is a pure `import type` (the keyword sits\n * immediately after `import`, covering `import type { X }`, `import type Foo`,\n * and `import type * as Ns`).\n */\nfunction isTypeOnlyImport(line: string): boolean {\n const trimmed = line.trim();\n\n return trimmed.startsWith(\"import type \") || !!trimmed.match(/^import\\s+type\\s+[{*]/);\n}\n\n/**\n * Decide whether an `import ... from \"m\"` statement contributes any runtime\n * binding. Returns false for pure `import type` and for destructured imports\n * where every specifier is prefixed with the `type` keyword.\n */\nfunction hasRuntimeImports(line: string): boolean {\n const trimmed = line.trim();\n\n if (isTypeOnlyImport(trimmed)) {\n return false;\n }\n\n const specifiersMatch = trimmed.match(/import\\s+(?:type\\s+)?\\{([^}]+)\\}/);\n\n if (!specifiersMatch) {\n return true;\n }\n\n const items = (specifiersMatch[1] ?? \"\")\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n\n return !items.every((item) => /^type\\s+\\w+/.test(item));\n}\n\n/**\n * Decide whether an `export ... from \"m\"` statement re-exports only types.\n * Covers `export type { X } from`, `export type * from`, and\n * `export { type X, type Y } from`.\n */\nfunction isExportTypeOnlyStatement(line: string): boolean {\n const trimmed = line.trim();\n\n if (/^export\\s+type\\s+/.test(trimmed)) {\n return true;\n }\n\n const specifiersMatch = trimmed.match(/export\\s+\\{([^}]+)\\}/);\n\n if (!specifiersMatch) {\n return false;\n }\n\n const items = (specifiersMatch[1] ?? \"\")\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n\n return items.every((item) => /^type\\s+\\w+/.test(item));\n}\n\n/**\n * Extract import paths using regex (more reliable for TypeScript).\n * Each entry carries an `isTypeOnly` flag: true when every occurrence of the\n * path in the source is a type-only statement (no runtime binding).\n * A single runtime occurrence makes the path runtime.\n */\nfunction extractImportPathsWithRegex(\n source: string,\n): Array<{ path: string; originalLine: string; isTypeOnly: boolean }> {\n const imports: Array<{ path: string; originalLine: string; isTypeOnly: boolean }> = [];\n const seenPaths = new Map<string, number>();\n\n /**\n * Record an import path with its type-only flag.\n * If the same path appears in multiple statements, the edge is type-only\n * iff every occurrence is type-only — a single runtime statement makes it runtime.\n */\n const record = (importPath: string, originalLine: string, isTypeOnly: boolean): void => {\n if (!importPath) {\n return;\n }\n\n const existingIndex = seenPaths.get(importPath);\n\n if (existingIndex === undefined) {\n seenPaths.set(importPath, imports.length);\n imports.push({ path: importPath, originalLine, isTypeOnly });\n\n return;\n }\n\n if (!isTypeOnly) {\n const existing = imports[existingIndex];\n\n // `existingIndex` came from findIndex on this same array, so it is in\n // range; the compiler does not carry that here.\n if (existing) existing.isTypeOnly = false;\n }\n };\n\n // Pattern 1: Standard ES module imports (handles multiline)\n // Matches: import { ... } from \"path\", import Foo from \"path\", import Foo, { ... } from \"path\"\n const importRegex =\n /import\\s+(?:type\\s+)?(\\{[\\s\\S]*?\\}|\\*\\s+as\\s+\\w+|\\w+(?:\\s*,\\s*\\{[\\s\\S]*?\\})?)\\s+from\\s+['\"]([^'\"]+)['\"]/g;\n\n let match;\n\n while ((match = importRegex.exec(source)) !== null) {\n const fullMatch = match[0];\n const importPath = match[2];\n\n // Each pattern here captures its path in a group, so a match always carries\n // one. Skipping rather than recording keeps a malformed match out of the\n // dependency graph entirely — recording `undefined` would add an import\n // edge to a module named \"undefined\", which the dev server would then\n // watch, fail to resolve, and report against the wrong file.\n if (importPath === undefined) continue;\n\n const isTypeOnly = !hasRuntimeImports(fullMatch);\n\n record(importPath, fullMatch, isTypeOnly);\n }\n\n // Pattern 1b: Side-effect imports - import \"path\" — always runtime\n const sideEffectRegex = /import\\s+['\"]([^'\"]+)['\"]/g;\n\n while ((match = sideEffectRegex.exec(source)) !== null) {\n const sideEffectPath = match[1];\n\n if (sideEffectPath === undefined) continue;\n\n record(sideEffectPath, match[0], false);\n }\n\n // Pattern 2: Dynamic imports - import(\"path\") — always runtime\n const dynamicImportPattern = /import\\s*\\(\\s*['\"]([^'\"]+)['\"]\\s*\\)/g;\n\n while ((match = dynamicImportPattern.exec(source)) !== null) {\n const dynamicPath = match[1];\n\n if (dynamicPath === undefined) continue;\n\n record(dynamicPath, match[0], false);\n }\n\n // Pattern 3: Export from - export ... from \"path\"\n // A pure `export type { A } from` / `export type * from` re-export is matched\n // and then skipped: it is erased at compile time, so it is no dependency\n // edge. That keeps this fallback in line with the lexer path, which never\n // reports the form, so the graph no longer depends on which path ran.\n // `export { type A } from` (reported by the lexer) stays a type-only edge.\n const exportFromPattern =\n /export\\s+(?:type\\s+)?(?:\\{[^}]*\\}|\\*(?:\\s+as\\s+\\w+)?|\\w+)\\s+from\\s+['\"]([^'\"]+)['\"]/g;\n\n while ((match = exportFromPattern.exec(source)) !== null) {\n const fullMatch = match[0];\n const exportPath = match[1];\n\n if (exportPath === undefined) continue;\n\n if (/^export\\s+type\\s/.test(fullMatch)) continue;\n\n record(exportPath, fullMatch, isExportTypeOnlyStatement(fullMatch));\n }\n\n return imports;\n}\n\n/**\n * Metadata for a single resolved import edge.\n * `isTypeOnly` is true iff every import/export statement that references this\n * path is type-only (pure `import type`, `export type`, or destructured lists\n * where every specifier carries the `type` keyword). A single runtime\n * occurrence flips the flag to false — that's what matters for cycle detection.\n */\nexport type ResolvedImport = {\n absolutePath: string;\n isTypeOnly: boolean;\n};\n\n/**\n * Parse import/export statements in a TS/JS source file and return the\n * resolved dependency edges keyed by the original import path. Includes\n * type-only edges (flagged) so downstream consumers can distinguish runtime\n * cycles from type-only ones.\n *\n * @example\n * const importMap = await parseImports(source, \"/abs/path/to/file.ts\");\n * for (const [importPath, { absolutePath, isTypeOnly }] of importMap) {\n * // ...\n * }\n */\nexport async function parseImports(\n source: string,\n filePath: string,\n): Promise<Map<string, ResolvedImport>> {\n try {\n // Skip .d.ts files - they're type declarations, not runtime code\n if (filePath.endsWith(\".d.ts\")) {\n return new Map();\n }\n\n // es-module-lexer first: it reads the real statements and skips comments.\n try {\n const [imports] = await parse(source);\n\n if (imports && imports.length > 0) {\n return await resolveImports(imports as ImportSpecifier[], source, filePath);\n }\n } catch {\n // The lexer rejects some TypeScript syntax; the regex below covers it.\n }\n\n // Fallback: regex extraction, for files the lexer rejects and for files\n // where it finds nothing (it does not report `export type { A } from`).\n // It runs over the source without comments: scanning them turned a doc\n // comment such as `(await import(\"./query-testing\"))` in a file with no\n // imports into a self edge and a false \"circular dependency\".\n const regexImports = extractImportPathsWithRegex(stripComments(source, filePath));\n const resolvedImports = new Map<string, ResolvedImport>();\n\n for (const { path: importPath, isTypeOnly } of regexImports) {\n if (isNodeBuiltin(importPath)) {\n continue;\n }\n\n if (!importPath.startsWith(\".\") && !tsconfigManager.isAlias(importPath)) {\n continue;\n }\n\n let resolvedPath: string | null = null;\n\n if (tsconfigManager.isAlias(importPath)) {\n resolvedPath = await resolveAliasImport(importPath);\n } else if (importPath.startsWith(\".\")) {\n resolvedPath = await resolveRelativeImport(importPath, filePath);\n }\n\n if (resolvedPath && !isSameFile(resolvedPath, filePath)) {\n mergeResolvedImport(resolvedImports, importPath, resolvedPath, isTypeOnly);\n }\n }\n\n return resolvedImports;\n } catch (error) {\n console.error(`Error parsing imports for ${filePath}:`, error);\n\n return new Map();\n }\n}\n\n/** True when both paths name the same file (case-insensitively on Windows). */\nfunction isSameFile(first: string, second: string): boolean {\n const normalize = (filePath: string) => {\n const resolved = Path.normalize(path.resolve(filePath));\n return process.platform === \"win32\" ? resolved.toLowerCase() : resolved;\n };\n\n return normalize(first) === normalize(second);\n}\n\n/**\n * Remove `//` and `/* *\\/` comments, keeping every newline in place (so\n * line-based matches keep their lines). Only the regex fallback needs it; the\n * lexer already skips comments.\n *\n * Comment ranges come from a real TypeScript parse, never from scanning\n * characters: only the parser can tell a regex literal (`/\\/*$/`), a template\n * literal or JSX text (`<p>// not a comment</p>`) from a comment. A character\n * scanner read the `/*` in `p.replace(/\\/*$/, \"\")` as a block comment and\n * erased every import after it.\n *\n * `filePath` picks the dialect (`.tsx`/`.jsx` parse JSX); without it the\n * source is parsed as TSX.\n */\nexport function stripComments(source: string, filePath = \"source.tsx\"): string {\n const sourceFile = ts.createSourceFile(\n filePath,\n source,\n ts.ScriptTarget.Latest,\n false,\n scriptKindFor(filePath),\n );\n const ranges: ts.CommentRange[] = [];\n const seen = new Set<number>();\n\n const collect = (node: ts.Node): void => {\n // A JSDoc node is itself a comment, already reported as trivia of the\n // token that follows it; its inner tokens are not code.\n if (node.kind >= ts.SyntaxKind.FirstJSDocNode && node.kind <= ts.SyntaxKind.LastJSDocNode) {\n return;\n }\n\n const children = node.getChildren(sourceFile);\n\n if (children.length > 0) {\n for (const child of children) collect(child);\n\n return;\n }\n\n // JSX text has no trivia: its content starts at `pos` and may contain `//`.\n if (node.kind === ts.SyntaxKind.JsxText || node.kind === ts.SyntaxKind.JsxTextAllWhiteSpaces) {\n return;\n }\n\n const tokenStart = node.getStart(sourceFile);\n\n // Trivia before a token holds trailing comments of the previous line\n // (`a; // x`) and leading comments of this one; collect both.\n const trivia = [\n ...(ts.getTrailingCommentRanges(source, node.pos) ?? []),\n ...(ts.getLeadingCommentRanges(source, node.pos) ?? []),\n ];\n\n for (const range of trivia) {\n if (range.end <= tokenStart && !seen.has(range.pos)) {\n seen.add(range.pos);\n ranges.push(range);\n }\n }\n };\n\n collect(sourceFile);\n ranges.sort((first, second) => first.pos - second.pos);\n\n let output = \"\";\n let cursor = 0;\n\n for (const range of ranges) {\n output += source.slice(cursor, range.pos);\n output += source.slice(range.pos, range.end).replace(/[^\\n]/g, \"\");\n cursor = range.end;\n }\n\n return output + source.slice(cursor);\n}\n\n/** The parse dialect for a file: JSX only where the extension allows it. */\nfunction scriptKindFor(filePath: string): ts.ScriptKind {\n const extension = path.extname(filePath).toLowerCase();\n\n switch (extension) {\n case \".ts\":\n case \".mts\":\n case \".cts\":\n return ts.ScriptKind.TS;\n case \".js\":\n case \".mjs\":\n case \".cjs\":\n return ts.ScriptKind.JS;\n case \".jsx\":\n return ts.ScriptKind.JSX;\n default:\n return ts.ScriptKind.TSX;\n }\n}\n\n/**\n * Merge a resolved import into the output map, preserving the type-only rule:\n * a path is type-only iff every statement that references it is type-only.\n */\nfunction mergeResolvedImport(\n target: Map<string, ResolvedImport>,\n importPath: string,\n absolutePath: string,\n isTypeOnly: boolean,\n): void {\n const existing = target.get(importPath);\n\n if (!existing) {\n target.set(importPath, { absolutePath, isTypeOnly });\n\n return;\n }\n\n if (!isTypeOnly) {\n existing.isTypeOnly = false;\n }\n}\n\n/**\n * Resolve imports from `es-module-lexer` output. For each specifier, slice the\n * raw statement (`ss..se`) and re-run the type-only heuristic so we can flag\n * the edge correctly — the lexer itself does not distinguish `import type`.\n */\nasync function resolveImports(\n imports: ImportSpecifier[],\n source: string,\n filePath: string,\n): Promise<Map<string, ResolvedImport>> {\n const resolvedImports = new Map<string, ResolvedImport>();\n\n for (const imp of imports) {\n const importPath = imp.n;\n\n if (!importPath) {\n continue;\n }\n\n if (isNodeBuiltin(importPath)) {\n continue;\n }\n\n if (!importPath.startsWith(\".\") && !tsconfigManager.isAlias(importPath)) {\n continue;\n }\n\n let resolvedPath: string | null = null;\n\n if (tsconfigManager.isAlias(importPath)) {\n resolvedPath = await resolveAliasImport(importPath);\n } else if (importPath.startsWith(\".\")) {\n resolvedPath = await resolveRelativeImport(importPath, filePath);\n }\n\n // A file importing itself is no dependency edge, and as one it reads as\n // a one-file \"cycle\".\n if (!resolvedPath || isSameFile(resolvedPath, filePath)) {\n continue;\n }\n\n const isTypeOnly = isLexerStatementTypeOnly(imp, source);\n\n mergeResolvedImport(resolvedImports, importPath, resolvedPath, isTypeOnly);\n }\n\n return resolvedImports;\n}\n\n/**\n * Classify a single lexer-reported statement as type-only or runtime.\n * Dynamic imports (`import(...)`) are always runtime. For static\n * imports/export-from we slice the raw source and apply the same heuristic\n * the regex fallback uses.\n */\nfunction isLexerStatementTypeOnly(imp: ImportSpecifier, source: string): boolean {\n // Dynamic imports always execute — they cannot be type-only.\n // es-module-lexer reports dynamic with a.n === undefined typically, but\n // we guard by checking the statement prefix too.\n const statementStart = imp.ss;\n const statementEnd = imp.se;\n\n if (\n typeof statementStart !== \"number\" ||\n typeof statementEnd !== \"number\" ||\n statementEnd <= statementStart\n ) {\n return false;\n }\n\n const statement = source.slice(statementStart, statementEnd);\n const trimmed = statement.trim();\n\n if (trimmed.startsWith(\"import(\") || /^\\bimport\\s*\\(/.test(trimmed)) {\n return false;\n }\n\n if (trimmed.startsWith(\"export\")) {\n return isExportTypeOnlyStatement(statement);\n }\n\n return !hasRuntimeImports(statement);\n}\n\n/**\n * Resolve alias imports to actual file paths with extensions\n * Example: app/users/services/get-users.service -> /absolute/path/to/src/app/users/services/get-users.service.ts\n */\nasync function resolveAliasImport(importPath: string): Promise<string | null> {\n // Use tsconfig manager to resolve the alias to an absolute path\n const resolvedBase = tsconfigManager.resolveAliasToAbsolute(importPath);\n\n if (!resolvedBase) return null;\n\n // Try to resolve with extensions\n const resolvedPath = await tryResolveWithExtensions(resolvedBase);\n\n return resolvedPath;\n}\n\n/**\n * Resolve relative imports to actual file paths\n * Example: ./../services/get-user.service -> /absolute/path/to/services/get-user.service.ts\n */\nasync function resolveRelativeImport(\n importPath: string,\n currentFilePath: string,\n): Promise<string | null> {\n const dir = path.dirname(currentFilePath);\n // Use path.resolve to handle .. and . properly, then normalize to forward slashes\n const resolvedBase = Path.normalize(path.resolve(dir, importPath));\n\n // Try to resolve with extensions\n const resolvedPath = await tryResolveWithExtensions(resolvedBase);\n\n return resolvedPath;\n}\n\n/**\n * Try to resolve a file path by checking different extensions\n * TypeScript/JavaScript files can be imported without extensions\n *\n * @TODO: For better performance, we need to check the files in files orchestrator\n * instead of using the file system as we will be fetching all project files anyway.\n */\n// Cache for file existence checks to avoid redundant filesystem calls\nconst fileExistsCache = new Map<string, boolean>();\n\n/**\n * Clear the file exists cache\n * Should be called when new files are created to ensure fresh lookups\n */\nexport function clearFileExistsCache(): void {\n fileExistsCache.clear();\n}\n\nasync function cachedFileExists(filePath: string): Promise<boolean> {\n if (fileExistsCache.has(filePath)) {\n return fileExistsCache.get(filePath)!;\n }\n const exists = (await fileExistsAsync(filePath)) as boolean;\n\n // Cache ONLY positive results. A negative (\"does not exist\") answer is the\n // exact case that flips moments later: the \"add a new controller/route\" flow\n // references a file, then creates it. Caching that negative for the whole\n // process lifetime (it was cleared only on a multi-file watcher batch) left\n // a routes.ts import unresolvable after its target was created — the dep\n // edge never formed and the route module import failed, so the new API route\n // 404'd until an unrelated multi-file batch cleared the cache. That is\n // finding 60721e35 (\"backend route HMR needs a second edit\"). A file that\n // exists does not stop existing mid-resolve, so caching the hit is safe;\n // re-probing a still-missing path costs only a handful of stat calls.\n if (exists) {\n fileExistsCache.set(filePath, exists);\n }\n\n return exists;\n}\n\nasync function tryResolveWithExtensions(basePath: string): Promise<string | null> {\n // Normalize the base path first (handle Windows paths)\n const normalizedBase = Path.normalize(basePath);\n\n // List of extensions to try, in order of preference\n const extensions = [\".ts\", \".tsx\", \".js\", \".jsx\", \".mjs\", \".cjs\"];\n const validExtensions = new Set(extensions);\n\n // If the path already has a VALID code file extension, check if it exists\n const ext = path.extname(normalizedBase);\n if (ext && validExtensions.has(ext)) {\n // NodeNext style: `./x.js` is written, `x.ts`/`x.tsx` is on disk. The\n // loader rewrites it the same way (own-resolver `probeFile`), and a\n // co-located source wins over the literal .js.\n if ([\".js\", \".jsx\", \".mjs\", \".cjs\"].includes(ext)) {\n const stem = normalizedBase.slice(0, -ext.length);\n for (const sourceExt of [\".ts\", \".tsx\"]) {\n if (await cachedFileExists(stem + sourceExt)) {\n return stem + sourceExt;\n }\n }\n }\n if (await cachedFileExists(normalizedBase)) {\n return normalizedBase;\n }\n // If explicit extension doesn't exist, return null\n return null;\n }\n\n // Try all extensions in parallel for better performance\n const pathsToCheck = extensions.map((extension) => normalizedBase + extension);\n const results = await Promise.all(\n pathsToCheck.map(async (p) => ({ path: p, exists: await cachedFileExists(p) })),\n );\n\n // Return the first one that exists (in order of preference)\n for (const result of results) {\n if (result.exists) {\n return result.path;\n }\n }\n\n // Try index files in directory\n if (await directoryExistsAsync(normalizedBase)) {\n const indexPaths = extensions.map((extension) =>\n Path.join(normalizedBase, `index${extension}`),\n );\n const indexResults = await Promise.all(\n indexPaths.map(async (p) => ({ path: p, exists: await cachedFileExists(p) })),\n );\n\n for (const result of indexResults) {\n if (result.exists) {\n return result.path;\n }\n }\n }\n\n return null;\n}\n\n/**\n * Check if import is a Node.js built-in module\n */\nfunction isNodeBuiltin(importPath: string): boolean {\n const builtins = [\n \"fs\",\n \"path\",\n \"http\",\n \"https\",\n \"crypto\",\n \"stream\",\n \"util\",\n \"events\",\n \"buffer\",\n \"child_process\",\n \"os\",\n \"url\",\n \"querystring\",\n \"zlib\",\n \"net\",\n \"tls\",\n \"dns\",\n \"dgram\",\n \"cluster\",\n \"worker_threads\",\n \"perf_hooks\",\n \"async_hooks\",\n \"timers\",\n \"readline\",\n \"repl\",\n \"vm\",\n \"assert\",\n \"console\",\n \"process\",\n \"v8\",\n ];\n\n // Check for node: prefix or direct builtin name\n if (importPath.startsWith(\"node:\")) return true;\n\n // `split` always yields a first element. Falling back to the whole path\n // keeps the builtin check answering about a real name rather than undefined.\n const moduleName = importPath.split(\"/\")[0] ?? importPath;\n\n return builtins.includes(moduleName);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,eAAe,QAAyB;CAOtD,MAAM,iBALkB,OACrB,QAAQ,qBAAqB,EAAE,CAAC,CAChC,QAAQ,aAAa,EAGa,CAAC,CACnC,QAAQ,sBAAsB,IAAI,CAAC,CACnC,QAAQ,sBAAsB,MAAI,CAAC,CACnC,QAAQ,sBAAsB,IAAI;CAGrC,MAAM,mBAAmB;EACvB;EACA;EACA;EACA;CACF;CAGA,IAAI,YAAY;CAChB,KAAK,MAAM,WAAW,kBACpB,YAAY,UAAU,QAAQ,SAAS,EAAE;CAiB3C,KAAK,MAAM,WAAW;EAZpB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAGwC,GACxC,IAAI,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AAM,aAAa,CAAC,OAAO,MAAM,GACpC,IAAI,MAAM,iBAAiB,OAAO,SAAS,GACzC,OAAO,OAAO;EAGpB;EACA,IAAI,MAAM,iBAAiB,cAAc,GACvC,OAAO;EAGT,OAAO;CACT;CAGA,MAAM,eAAe,WAAW,KAAK,cAAc,iBAAiB,SAAS;CAC7E,MAAM,UAAU,MAAM,QAAQ,IAC5B,aAAa,IAAI,OAAO,OAAO;EAAE,MAAM;EAAG,QAAQ,MAAM,iBAAiB,CAAC;CAAE,EAAE,CAChF;CAGA,KAAK,MAAM,UAAU,SACnB,IAAI,OAAO,QACT,OAAO,OAAO;CAKlB,IAAI,MAAM,qBAAqB,cAAc,GAAG;EAC9C,MAAM,aAAa,WAAW,KAAK,cACjC,KAAK,KAAK,gBAAgB,QAAQ,WAAW,CAC/C;EACA,MAAM,eAAe,MAAM,QAAQ,IACjC,WAAW,IAAI,OAAO,OAAO;GAAE,MAAM;GAAG,QAAQ,MAAM,iBAAiB,CAAC;EAAE,EAAE,CAC9E;EAEA,KAAK,MAAM,UAAU,cACnB,IAAI,OAAO,QACT,OAAO,OAAO;CAGpB;CAEA,OAAO;AACT;;;;AAKA,SAAS,cAAc,YAA6B;CAClD,MAAM,WAAW;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAGA,IAAI,WAAW,WAAW,OAAO,GAAG,OAAO;CAI3C,MAAM,aAAa,WAAW,MAAM,GAAG,CAAC,CAAC,MAAM;CAE/C,OAAO,SAAS,SAAS,UAAU;AACrC"}
1
+ {"version":3,"file":"parse-imports.mjs","names":[],"sources":["../../../../../../../../packages/core/src/dev-server/parse-imports.ts"],"sourcesContent":["import { fileExistsAsync, directoryExistsAsync } from \"@warlock.js/fs\";\nimport { type ImportSpecifier, parse } from \"es-module-lexer\";\nimport path from \"node:path\";\nimport { parseSync } from \"oxc-parser\";\nimport { Path } from \"../utils/normalized-path\";\nimport { tsconfigManager } from \"./tsconfig-manager\";\n\n/**\n * Detect if a file contains only type definitions (no runtime code)\n *\n * A file is considered type-only if ALL its exports are:\n * - interface declarations\n * - type alias declarations\n * - export type { ... } statements\n * - export type { ... } from \"...\" statements\n *\n * Files with any of these are NOT type-only:\n * - export const/let/var\n * - export function\n * - export class\n * - export default (non-type)\n * - export { ... } (without type keyword)\n * - export * from (without type keyword)\n *\n * @param source - The source code to analyze\n * @returns true if the file exports only types\n */\nexport function isTypeOnlyFile(source: string): boolean {\n // Remove comments to avoid false positives\n const withoutComments = source\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, \"\") // block comments\n .replace(/\\/\\/.*$/gm, \"\"); // line comments\n\n // Remove string literals to avoid false positives\n const withoutStrings = withoutComments\n .replace(/'(?:[^'\\\\]|\\\\.)*'/g, \"''\")\n .replace(/\"(?:[^\"\\\\]|\\\\.)*\"/g, '\"\"')\n .replace(/`(?:[^`\\\\]|\\\\.)*`/g, \"``\");\n\n // Patterns for type-only exports (these are safe)\n const typeOnlyPatterns = [\n /export\\s+type\\s+\\{[^}]*\\}/g, // export type { Foo, Bar }\n /export\\s+type\\s+\\{[^}]*\\}\\s+from\\s+['\"]/g, // export type { Foo } from \"...\"\n /export\\s+interface\\s+\\w+/g, // export interface Foo\n /export\\s+type\\s+\\w+\\s*=/g, // export type Foo =\n ];\n\n // Remove all type-only exports from consideration\n let remaining = withoutStrings;\n for (const pattern of typeOnlyPatterns) {\n remaining = remaining.replace(pattern, \"\");\n }\n\n // Patterns for runtime exports (these make the file NOT type-only)\n const runtimeExportPatterns = [\n /export\\s+(?:const|let|var)\\s+\\w+/g, // export const/let/var foo\n /export\\s+function\\s+\\w+/g, // export function foo\n /export\\s+async\\s+function\\s+\\w+/g, // export async function foo\n /export\\s+class\\s+\\w+/g, // export class Foo\n /export\\s+enum\\s+\\w+/g, // export enum Foo (enums have runtime value)\n /export\\s+default\\s+(?!type\\s)/g, // export default (not type)\n /export\\s+\\{[^}]*\\}(?!\\s+from)/g, // export { foo } (local re-export without type)\n /export\\s+\\{[^}]*\\}\\s+from\\s+['\"][^'\"]+['\"]/g, // export { foo } from (without type)\n /export\\s+\\*\\s+from\\s+['\"][^'\"]+['\"]/g, // export * from (re-exports everything)\n /export\\s+\\*\\s+as\\s+\\w+/g, // export * as namespace\n ];\n\n for (const pattern of runtimeExportPatterns) {\n if (pattern.test(remaining)) {\n // Reset regex lastIndex for subsequent tests\n pattern.lastIndex = 0;\n\n // Special case: check if export { } contains only type exports\n if (pattern.source.includes(\"export\\\\s+\\\\{\")) {\n const matches = remaining.match(/export\\s+\\{([^}]*)\\}(?:\\s+from\\s+['\"][^'\"]+['\"])?/g);\n if (matches) {\n for (const match of matches) {\n // Skip if it's already a type export\n if (/^export\\s+type\\s+/.test(match)) continue;\n\n // Extract the specifiers\n const specifiersMatch = match.match(/export\\s+\\{([^}]*)\\}/);\n if (specifiersMatch) {\n // Capture group 1 exists whenever the pattern matched. `?? \"\"`\n // yields an empty specifier list, which `some()` below reads as\n // \"no runtime specifier\" — the same answer an empty `{}` gives.\n const specifiers = specifiersMatch[1] ?? \"\";\n const items = specifiers\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n\n // If any specifier is NOT prefixed with \"type \", this is a runtime export\n const hasRuntimeSpecifier = items.some((item) => !item.startsWith(\"type \"));\n if (hasRuntimeSpecifier) {\n return false;\n }\n }\n }\n }\n continue;\n }\n\n return false;\n }\n }\n\n // If we get here, no runtime exports were found\n // But we should also verify the file has at least some type exports\n // (an empty file or file with only imports is not really \"type-only\")\n const hasTypeExports = typeOnlyPatterns.some((pattern) => {\n pattern.lastIndex = 0;\n return pattern.test(withoutStrings);\n });\n\n return hasTypeExports;\n}\n\n/**\n * Check if an import statement is a pure `import type` (the keyword sits\n * immediately after `import`, covering `import type { X }`, `import type Foo`,\n * and `import type * as Ns`).\n */\nfunction isTypeOnlyImport(line: string): boolean {\n const trimmed = line.trim();\n\n return trimmed.startsWith(\"import type \") || !!trimmed.match(/^import\\s+type\\s+[{*]/);\n}\n\n/**\n * Decide whether an `import ... from \"m\"` statement contributes any runtime\n * binding. Returns false for pure `import type` and for destructured imports\n * where every specifier is prefixed with the `type` keyword.\n */\nfunction hasRuntimeImports(line: string): boolean {\n const trimmed = line.trim();\n\n if (isTypeOnlyImport(trimmed)) {\n return false;\n }\n\n const specifiersMatch = trimmed.match(/import\\s+(?:type\\s+)?\\{([^}]+)\\}/);\n\n if (!specifiersMatch) {\n return true;\n }\n\n const items = (specifiersMatch[1] ?? \"\")\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n\n return !items.every((item) => /^type\\s+\\w+/.test(item));\n}\n\n/**\n * Decide whether an `export ... from \"m\"` statement re-exports only types.\n * Covers `export type { X } from`, `export type * from`, and\n * `export { type X, type Y } from`.\n */\nfunction isExportTypeOnlyStatement(line: string): boolean {\n const trimmed = line.trim();\n\n if (/^export\\s+type\\s+/.test(trimmed)) {\n return true;\n }\n\n const specifiersMatch = trimmed.match(/export\\s+\\{([^}]+)\\}/);\n\n if (!specifiersMatch) {\n return false;\n }\n\n const items = (specifiersMatch[1] ?? \"\")\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n\n return items.every((item) => /^type\\s+\\w+/.test(item));\n}\n\n/**\n * Extract import paths using regex (more reliable for TypeScript).\n * Each entry carries an `isTypeOnly` flag: true when every occurrence of the\n * path in the source is a type-only statement (no runtime binding).\n * A single runtime occurrence makes the path runtime.\n */\nfunction extractImportPathsWithRegex(\n source: string,\n): Array<{ path: string; originalLine: string; isTypeOnly: boolean }> {\n const imports: Array<{ path: string; originalLine: string; isTypeOnly: boolean }> = [];\n const seenPaths = new Map<string, number>();\n\n /**\n * Record an import path with its type-only flag.\n * If the same path appears in multiple statements, the edge is type-only\n * iff every occurrence is type-only — a single runtime statement makes it runtime.\n */\n const record = (importPath: string, originalLine: string, isTypeOnly: boolean): void => {\n if (!importPath) {\n return;\n }\n\n const existingIndex = seenPaths.get(importPath);\n\n if (existingIndex === undefined) {\n seenPaths.set(importPath, imports.length);\n imports.push({ path: importPath, originalLine, isTypeOnly });\n\n return;\n }\n\n if (!isTypeOnly) {\n const existing = imports[existingIndex];\n\n // `existingIndex` came from findIndex on this same array, so it is in\n // range; the compiler does not carry that here.\n if (existing) existing.isTypeOnly = false;\n }\n };\n\n // Pattern 1: Standard ES module imports (handles multiline)\n // Matches: import { ... } from \"path\", import Foo from \"path\", import Foo, { ... } from \"path\"\n const importRegex =\n /import\\s+(?:type\\s+)?(\\{[\\s\\S]*?\\}|\\*\\s+as\\s+\\w+|\\w+(?:\\s*,\\s*\\{[\\s\\S]*?\\})?)\\s+from\\s+['\"]([^'\"]+)['\"]/g;\n\n let match;\n\n while ((match = importRegex.exec(source)) !== null) {\n const fullMatch = match[0];\n const importPath = match[2];\n\n // Each pattern here captures its path in a group, so a match always carries\n // one. Skipping rather than recording keeps a malformed match out of the\n // dependency graph entirely — recording `undefined` would add an import\n // edge to a module named \"undefined\", which the dev server would then\n // watch, fail to resolve, and report against the wrong file.\n if (importPath === undefined) continue;\n\n const isTypeOnly = !hasRuntimeImports(fullMatch);\n\n record(importPath, fullMatch, isTypeOnly);\n }\n\n // Pattern 1b: Side-effect imports - import \"path\" — always runtime\n const sideEffectRegex = /import\\s+['\"]([^'\"]+)['\"]/g;\n\n while ((match = sideEffectRegex.exec(source)) !== null) {\n const sideEffectPath = match[1];\n\n if (sideEffectPath === undefined) continue;\n\n record(sideEffectPath, match[0], false);\n }\n\n // Pattern 2: Dynamic imports - import(\"path\") — always runtime\n const dynamicImportPattern = /import\\s*\\(\\s*['\"]([^'\"]+)['\"]\\s*\\)/g;\n\n while ((match = dynamicImportPattern.exec(source)) !== null) {\n const dynamicPath = match[1];\n\n if (dynamicPath === undefined) continue;\n\n record(dynamicPath, match[0], false);\n }\n\n // Pattern 3: Export from - export ... from \"path\"\n // A pure `export type { A } from` / `export type * from` re-export is matched\n // and then skipped: it is erased at compile time, so it is no dependency\n // edge. That keeps this fallback in line with the lexer path, which never\n // reports the form, so the graph no longer depends on which path ran.\n // `export { type A } from` (reported by the lexer) stays a type-only edge.\n const exportFromPattern =\n /export\\s+(?:type\\s+)?(?:\\{[^}]*\\}|\\*(?:\\s+as\\s+\\w+)?|\\w+)\\s+from\\s+['\"]([^'\"]+)['\"]/g;\n\n while ((match = exportFromPattern.exec(source)) !== null) {\n const fullMatch = match[0];\n const exportPath = match[1];\n\n if (exportPath === undefined) continue;\n\n if (/^export\\s+type\\s/.test(fullMatch)) continue;\n\n record(exportPath, fullMatch, isExportTypeOnlyStatement(fullMatch));\n }\n\n return imports;\n}\n\n/**\n * Metadata for a single resolved import edge.\n * `isTypeOnly` is true iff every import/export statement that references this\n * path is type-only (pure `import type`, `export type`, or destructured lists\n * where every specifier carries the `type` keyword). A single runtime\n * occurrence flips the flag to false — that's what matters for cycle detection.\n */\nexport type ResolvedImport = {\n absolutePath: string;\n isTypeOnly: boolean;\n};\n\n/**\n * Parse import/export statements in a TS/JS source file and return the\n * resolved dependency edges keyed by the original import path. Includes\n * type-only edges (flagged) so downstream consumers can distinguish runtime\n * cycles from type-only ones.\n *\n * @example\n * const importMap = await parseImports(source, \"/abs/path/to/file.ts\");\n * for (const [importPath, { absolutePath, isTypeOnly }] of importMap) {\n * // ...\n * }\n */\nexport async function parseImports(\n source: string,\n filePath: string,\n): Promise<Map<string, ResolvedImport>> {\n try {\n // Skip .d.ts files - they're type declarations, not runtime code\n if (filePath.endsWith(\".d.ts\")) {\n return new Map();\n }\n\n // es-module-lexer first: it reads the real statements and skips comments.\n try {\n const [imports] = await parse(source);\n\n if (imports && imports.length > 0) {\n return await resolveImports(imports as ImportSpecifier[], source, filePath);\n }\n } catch {\n // The lexer rejects some TypeScript syntax; the regex below covers it.\n }\n\n // Fallback: regex extraction, for files the lexer rejects and for files\n // where it finds nothing (it does not report `export type { A } from`).\n // It runs over the source without comments: scanning them turned a doc\n // comment such as `(await import(\"./query-testing\"))` in a file with no\n // imports into a self edge and a false \"circular dependency\".\n const regexImports = extractImportPathsWithRegex(stripComments(source, filePath));\n const resolvedImports = new Map<string, ResolvedImport>();\n\n for (const { path: importPath, isTypeOnly } of regexImports) {\n if (isNodeBuiltin(importPath)) {\n continue;\n }\n\n if (!importPath.startsWith(\".\") && !tsconfigManager.isAlias(importPath)) {\n continue;\n }\n\n let resolvedPath: string | null = null;\n\n if (tsconfigManager.isAlias(importPath)) {\n resolvedPath = await resolveAliasImport(importPath);\n } else if (importPath.startsWith(\".\")) {\n resolvedPath = await resolveRelativeImport(importPath, filePath);\n }\n\n if (resolvedPath && !isSameFile(resolvedPath, filePath)) {\n mergeResolvedImport(resolvedImports, importPath, resolvedPath, isTypeOnly);\n }\n }\n\n return resolvedImports;\n } catch (error) {\n console.error(`Error parsing imports for ${filePath}:`, error);\n\n return new Map();\n }\n}\n\n/** True when both paths name the same file (case-insensitively on Windows). */\nfunction isSameFile(first: string, second: string): boolean {\n const normalize = (filePath: string) => {\n const resolved = Path.normalize(path.resolve(filePath));\n return process.platform === \"win32\" ? resolved.toLowerCase() : resolved;\n };\n\n return normalize(first) === normalize(second);\n}\n\n/**\n * Remove `//` and `/* *\\/` comments, keeping every newline in place (so\n * line-based matches keep their lines). Only the regex fallback needs it; the\n * lexer already skips comments.\n *\n * Comment ranges come from an OXC parse, never from scanning\n * characters: only the parser can tell a regex literal (`/\\/*$/`), a template\n * literal or JSX text (`<p>// not a comment</p>`) from a comment. A character\n * scanner read the `/*` in `p.replace(/\\/*$/, \"\")` as a block comment and\n * erased every import after it.\n *\n * `filePath` picks the dialect (`.tsx`/`.jsx` parse JSX); without it the\n * source is parsed as TSX.\n */\nexport function stripComments(source: string, filePath = \"source.tsx\"): string {\n const ranges = parseSync(filePath, source).comments;\n\n let output = \"\";\n let cursor = 0;\n\n for (const range of ranges) {\n output += source.slice(cursor, range.start);\n output += source.slice(range.start, range.end).replace(/[^\\n]/g, \"\");\n cursor = range.end;\n }\n\n return output + source.slice(cursor);\n}\n\n/**\n * Merge a resolved import into the output map, preserving the type-only rule:\n * a path is type-only iff every statement that references it is type-only.\n */\nfunction mergeResolvedImport(\n target: Map<string, ResolvedImport>,\n importPath: string,\n absolutePath: string,\n isTypeOnly: boolean,\n): void {\n const existing = target.get(importPath);\n\n if (!existing) {\n target.set(importPath, { absolutePath, isTypeOnly });\n\n return;\n }\n\n if (!isTypeOnly) {\n existing.isTypeOnly = false;\n }\n}\n\n/**\n * Resolve imports from `es-module-lexer` output. For each specifier, slice the\n * raw statement (`ss..se`) and re-run the type-only heuristic so we can flag\n * the edge correctly — the lexer itself does not distinguish `import type`.\n */\nasync function resolveImports(\n imports: ImportSpecifier[],\n source: string,\n filePath: string,\n): Promise<Map<string, ResolvedImport>> {\n const resolvedImports = new Map<string, ResolvedImport>();\n\n for (const imp of imports) {\n const importPath = imp.n;\n\n if (!importPath) {\n continue;\n }\n\n if (isNodeBuiltin(importPath)) {\n continue;\n }\n\n if (!importPath.startsWith(\".\") && !tsconfigManager.isAlias(importPath)) {\n continue;\n }\n\n let resolvedPath: string | null = null;\n\n if (tsconfigManager.isAlias(importPath)) {\n resolvedPath = await resolveAliasImport(importPath);\n } else if (importPath.startsWith(\".\")) {\n resolvedPath = await resolveRelativeImport(importPath, filePath);\n }\n\n // A file importing itself is no dependency edge, and as one it reads as\n // a one-file \"cycle\".\n if (!resolvedPath || isSameFile(resolvedPath, filePath)) {\n continue;\n }\n\n const isTypeOnly = isLexerStatementTypeOnly(imp, source);\n\n mergeResolvedImport(resolvedImports, importPath, resolvedPath, isTypeOnly);\n }\n\n return resolvedImports;\n}\n\n/**\n * Classify a single lexer-reported statement as type-only or runtime.\n * Dynamic imports (`import(...)`) are always runtime. For static\n * imports/export-from we slice the raw source and apply the same heuristic\n * the regex fallback uses.\n */\nfunction isLexerStatementTypeOnly(imp: ImportSpecifier, source: string): boolean {\n // Dynamic imports always execute — they cannot be type-only.\n // es-module-lexer reports dynamic with a.n === undefined typically, but\n // we guard by checking the statement prefix too.\n const statementStart = imp.ss;\n const statementEnd = imp.se;\n\n if (\n typeof statementStart !== \"number\" ||\n typeof statementEnd !== \"number\" ||\n statementEnd <= statementStart\n ) {\n return false;\n }\n\n const statement = source.slice(statementStart, statementEnd);\n const trimmed = statement.trim();\n\n if (trimmed.startsWith(\"import(\") || /^\\bimport\\s*\\(/.test(trimmed)) {\n return false;\n }\n\n if (trimmed.startsWith(\"export\")) {\n return isExportTypeOnlyStatement(statement);\n }\n\n return !hasRuntimeImports(statement);\n}\n\n/**\n * Resolve alias imports to actual file paths with extensions\n * Example: app/users/services/get-users.service -> /absolute/path/to/src/app/users/services/get-users.service.ts\n */\nasync function resolveAliasImport(importPath: string): Promise<string | null> {\n // Use tsconfig manager to resolve the alias to an absolute path\n const resolvedBase = tsconfigManager.resolveAliasToAbsolute(importPath);\n\n if (!resolvedBase) return null;\n\n // Try to resolve with extensions\n const resolvedPath = await tryResolveWithExtensions(resolvedBase);\n\n return resolvedPath;\n}\n\n/**\n * Resolve relative imports to actual file paths\n * Example: ./../services/get-user.service -> /absolute/path/to/services/get-user.service.ts\n */\nasync function resolveRelativeImport(\n importPath: string,\n currentFilePath: string,\n): Promise<string | null> {\n const dir = path.dirname(currentFilePath);\n // Use path.resolve to handle .. and . properly, then normalize to forward slashes\n const resolvedBase = Path.normalize(path.resolve(dir, importPath));\n\n // Try to resolve with extensions\n const resolvedPath = await tryResolveWithExtensions(resolvedBase);\n\n return resolvedPath;\n}\n\n/**\n * Try to resolve a file path by checking different extensions\n * TypeScript/JavaScript files can be imported without extensions\n *\n * @TODO: For better performance, we need to check the files in files orchestrator\n * instead of using the file system as we will be fetching all project files anyway.\n */\n// Cache for file existence checks to avoid redundant filesystem calls\nconst fileExistsCache = new Map<string, boolean>();\n\n/**\n * Clear the file exists cache\n * Should be called when new files are created to ensure fresh lookups\n */\nexport function clearFileExistsCache(): void {\n fileExistsCache.clear();\n}\n\nasync function cachedFileExists(filePath: string): Promise<boolean> {\n if (fileExistsCache.has(filePath)) {\n return fileExistsCache.get(filePath)!;\n }\n const exists = (await fileExistsAsync(filePath)) as boolean;\n\n // Cache ONLY positive results. A negative (\"does not exist\") answer is the\n // exact case that flips moments later: the \"add a new controller/route\" flow\n // references a file, then creates it. Caching that negative for the whole\n // process lifetime (it was cleared only on a multi-file watcher batch) left\n // a routes.ts import unresolvable after its target was created — the dep\n // edge never formed and the route module import failed, so the new API route\n // 404'd until an unrelated multi-file batch cleared the cache. That is\n // finding 60721e35 (\"backend route HMR needs a second edit\"). A file that\n // exists does not stop existing mid-resolve, so caching the hit is safe;\n // re-probing a still-missing path costs only a handful of stat calls.\n if (exists) {\n fileExistsCache.set(filePath, exists);\n }\n\n return exists;\n}\n\nasync function tryResolveWithExtensions(basePath: string): Promise<string | null> {\n // Normalize the base path first (handle Windows paths)\n const normalizedBase = Path.normalize(basePath);\n\n // List of extensions to try, in order of preference\n const extensions = [\".ts\", \".tsx\", \".js\", \".jsx\", \".mjs\", \".cjs\"];\n const validExtensions = new Set(extensions);\n\n // If the path already has a VALID code file extension, check if it exists\n const ext = path.extname(normalizedBase);\n if (ext && validExtensions.has(ext)) {\n // NodeNext style: `./x.js` is written, `x.ts`/`x.tsx` is on disk. The\n // loader rewrites it the same way (own-resolver `probeFile`), and a\n // co-located source wins over the literal .js.\n if ([\".js\", \".jsx\", \".mjs\", \".cjs\"].includes(ext)) {\n const stem = normalizedBase.slice(0, -ext.length);\n for (const sourceExt of [\".ts\", \".tsx\"]) {\n if (await cachedFileExists(stem + sourceExt)) {\n return stem + sourceExt;\n }\n }\n }\n if (await cachedFileExists(normalizedBase)) {\n return normalizedBase;\n }\n // If explicit extension doesn't exist, return null\n return null;\n }\n\n // Try all extensions in parallel for better performance\n const pathsToCheck = extensions.map((extension) => normalizedBase + extension);\n const results = await Promise.all(\n pathsToCheck.map(async (p) => ({ path: p, exists: await cachedFileExists(p) })),\n );\n\n // Return the first one that exists (in order of preference)\n for (const result of results) {\n if (result.exists) {\n return result.path;\n }\n }\n\n // Try index files in directory\n if (await directoryExistsAsync(normalizedBase)) {\n const indexPaths = extensions.map((extension) =>\n Path.join(normalizedBase, `index${extension}`),\n );\n const indexResults = await Promise.all(\n indexPaths.map(async (p) => ({ path: p, exists: await cachedFileExists(p) })),\n );\n\n for (const result of indexResults) {\n if (result.exists) {\n return result.path;\n }\n }\n }\n\n return null;\n}\n\n/**\n * Check if import is a Node.js built-in module\n */\nfunction isNodeBuiltin(importPath: string): boolean {\n const builtins = [\n \"fs\",\n \"path\",\n \"http\",\n \"https\",\n \"crypto\",\n \"stream\",\n \"util\",\n \"events\",\n \"buffer\",\n \"child_process\",\n \"os\",\n \"url\",\n \"querystring\",\n \"zlib\",\n \"net\",\n \"tls\",\n \"dns\",\n \"dgram\",\n \"cluster\",\n \"worker_threads\",\n \"perf_hooks\",\n \"async_hooks\",\n \"timers\",\n \"readline\",\n \"repl\",\n \"vm\",\n \"assert\",\n \"console\",\n \"process\",\n \"v8\",\n ];\n\n // Check for node: prefix or direct builtin name\n if (importPath.startsWith(\"node:\")) return true;\n\n // `split` always yields a first element. Falling back to the whole path\n // keeps the builtin check answering about a real name rather than undefined.\n const moduleName = importPath.split(\"/\")[0] ?? importPath;\n\n return builtins.includes(moduleName);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,eAAe,QAAyB;CAOtD,MAAM,iBALkB,OACrB,QAAQ,qBAAqB,EAAE,CAAC,CAChC,QAAQ,aAAa,EAGa,CAAC,CACnC,QAAQ,sBAAsB,IAAI,CAAC,CACnC,QAAQ,sBAAsB,MAAI,CAAC,CACnC,QAAQ,sBAAsB,IAAI;CAGrC,MAAM,mBAAmB;EACvB;EACA;EACA;EACA;CACF;CAGA,IAAI,YAAY;CAChB,KAAK,MAAM,WAAW,kBACpB,YAAY,UAAU,QAAQ,SAAS,EAAE;CAiB3C,KAAK,MAAM,WAAW;EAZpB;EACA;EACA;EACA;EACA;EAC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AAS,UAAU;AACrC"}
@@ -1,38 +1,8 @@
1
+ import { parseSourceFile } from "../tooling/syntax/ast.mjs";
1
2
  import { readFile } from "node:fs/promises";
2
- import ts from "typescript";
3
3
 
4
4
  //#region ../../packages/core/src/dev-server/read-config-ast.ts
5
- /**
6
- * Parse one config file into an AST.
7
- *
8
- * ## Why this is not `ts.createProgram`
9
- *
10
- * It was. The typings generator built a whole TypeScript **Program** for each
11
- * config file just to call `program.getSourceFile(path)` on it. A Warlock
12
- * config imports `@warlock.js/core`, which in this monorepo resolves to
13
- * TypeScript **source**, so every one of those Programs resolved and parsed the
14
- * entire dependency graph behind it.
15
- *
16
- * Measured on the reference app's six configs, 2026-08-24:
17
- *
18
- * ```
19
- * ts.createProgram 82,996.00 ms 2,908 source files per program
20
- * ts.createSourceFile 5.12 ms
21
- * ratio 16,212x
22
- * ```
23
- *
24
- * And all of it was discarded. `getTypeChecker()` is never called anywhere in
25
- * the generator — every question it asks of the AST is syntactic
26
- * (`isImportDeclaration`, `isTypeAliasDeclaration`, `isVariableDeclaration`,
27
- * `isObjectLiteralExpression`). Resolving 2,908 files to answer a syntactic
28
- * question is 2,908 files of work thrown away.
29
- *
30
- * A previous pass had already noticed the cost and halved it, from two Programs
31
- * per file to one — an optimisation inside a premise that did not need to hold.
32
- *
33
- * **If a future change here needs a type checker, it needs a Program too, and
34
- * the cost comes back.** That is the one reason to reconsider this file.
35
- */
5
+ /** Parse config syntax without resolving or executing its dependency graph. */
36
6
  async function readConfigAst(filePath) {
37
7
  let contents;
38
8
  try {
@@ -40,7 +10,7 @@ async function readConfigAst(filePath) {
40
10
  } catch {
41
11
  return;
42
12
  }
43
- return ts.createSourceFile(filePath, contents, ts.ScriptTarget.ESNext, true);
13
+ return parseSourceFile(filePath, contents);
44
14
  }
45
15
 
46
16
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"read-config-ast.mjs","names":[],"sources":["../../../../../../../../packages/core/src/dev-server/read-config-ast.ts"],"sourcesContent":["/**\n * Parse one config file into an AST.\n *\n * ## Why this is not `ts.createProgram`\n *\n * It was. The typings generator built a whole TypeScript **Program** for each\n * config file just to call `program.getSourceFile(path)` on it. A Warlock\n * config imports `@warlock.js/core`, which in this monorepo resolves to\n * TypeScript **source**, so every one of those Programs resolved and parsed the\n * entire dependency graph behind it.\n *\n * Measured on the reference app's six configs, 2026-08-24:\n *\n * ```\n * ts.createProgram 82,996.00 ms 2,908 source files per program\n * ts.createSourceFile 5.12 ms\n * ratio 16,212x\n * ```\n *\n * And all of it was discarded. `getTypeChecker()` is never called anywhere in\n * the generator — every question it asks of the AST is syntactic\n * (`isImportDeclaration`, `isTypeAliasDeclaration`, `isVariableDeclaration`,\n * `isObjectLiteralExpression`). Resolving 2,908 files to answer a syntactic\n * question is 2,908 files of work thrown away.\n *\n * A previous pass had already noticed the cost and halved it, from two Programs\n * per file to one — an optimisation inside a premise that did not need to hold.\n *\n * **If a future change here needs a type checker, it needs a Program too, and\n * the cost comes back.** That is the one reason to reconsider this file.\n */\n\nimport { readFile } from \"node:fs/promises\";\nimport ts from \"typescript\";\n\nexport async function readConfigAst(filePath: string): Promise<ts.SourceFile | undefined> {\n let contents: string;\n\n try {\n contents = await readFile(filePath, \"utf-8\");\n } catch {\n // Callers already treat a missing config as \"nothing to generate\"; a throw\n // here would turn an absent optional file into a failed generation.\n return undefined;\n }\n\n return ts.createSourceFile(\n filePath,\n contents,\n ts.ScriptTarget.ESNext,\n // The generator's visitors read `node.parent`, which the Program-backed\n // source files provided for free.\n /* setParentNodes */ true,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,eAAsB,cAAc,UAAsD;CACxF,IAAI;CAEJ,IAAI;EACF,WAAW,MAAM,SAAS,UAAU,OAAO;CAC7C,QAAQ;EAGN;CACF;CAEA,OAAO,GAAG,iBACR,UACA,UACA,GAAG,aAAa,QAGK,IACvB;AACF"}
1
+ {"version":3,"file":"read-config-ast.mjs","names":[],"sources":["../../../../../../../../packages/core/src/dev-server/read-config-ast.ts"],"sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { parseSourceFile, type SourceFile } from \"../tooling/syntax/ast\";\n\n/** Parse config syntax without resolving or executing its dependency graph. */\nexport async function readConfigAst(filePath: string): Promise<SourceFile | undefined> {\n let contents: string;\n try {\n contents = await readFile(filePath, \"utf-8\");\n } catch {\n return undefined;\n }\n return parseSourceFile(filePath, contents);\n}\n"],"mappings":";;;;;AAIA,eAAsB,cAAc,UAAmD;CACrF,IAAI;CACJ,IAAI;EACF,WAAW,MAAM,SAAS,UAAU,OAAO;CAC7C,QAAQ;EACN;CACF;CACA,OAAO,gBAAgB,UAAU,QAAQ;AAC3C"}
@@ -58,5 +58,5 @@ function printReadyBlock(bootDurationMs) {
58
58
  }
59
59
 
60
60
  //#endregion
61
- export { printReadyBlock };
61
+ export { collectReadyBlockFacts, printReadyBlock, renderReadyBlock };
62
62
  //# sourceMappingURL=ready-block.mjs.map
@@ -138,5 +138,5 @@ function raiseInterrupt() {
138
138
  const devServerShortcuts = new DevServerShortcuts();
139
139
 
140
140
  //#endregion
141
- export { devServerShortcuts };
141
+ export { DevServerShortcuts, devServerShortcuts };
142
142
  //# sourceMappingURL=shortcuts.mjs.map
@@ -1,12 +1,11 @@
1
1
  import { FileManager } from "./file-manager.mjs";
2
-
3
2
  //#region ../../packages/core/src/dev-server/special-files-collector.d.ts
4
- type SpecialFileType = "config" | "main" | "route" | "event" | "locale" | "worker";
3
+ export type SpecialFileType = "config" | "main" | "route" | "event" | "locale" | "worker";
5
4
  /**
6
5
  * Categorises files into the kinds the dev server treats specially
7
6
  * (config / main / route / event / locale / worker) and exposes typed accessors.
8
7
  */
9
- declare class SpecialFilesCollector {
8
+ export declare class SpecialFilesCollector {
10
9
  private readonly buckets;
11
10
  collect(files: Map<string, FileManager>): void;
12
11
  addFile(fileManager: FileManager): void;
@@ -19,5 +18,4 @@ declare class SpecialFilesCollector {
19
18
  private categorise;
20
19
  }
21
20
  //#endregion
22
- export { SpecialFilesCollector };
23
21
  //# sourceMappingURL=special-files-collector.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"special-files-collector.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/dev-server/special-files-collector.ts"],"mappings":";;;KAUY,eAAA;;AAAZ;;;cAMa,qBAAA;EAAA,iBACM,OAAA;EASV,OAAA,CAAQ,KAAA,EAAO,GAAA,SAAY,WAAA;EAO3B,OAAA,CAAQ,WAAA,EAAa,WAAA;EAIrB,UAAA,CAAW,YAAA;EAIX,UAAA,CAAW,WAAA,EAAa,WAAA;EAKxB,WAAA,CAAY,YAAA,WAAuB,eAAA;EAUnC,cAAA,CAAe,IAAA,EAAM,eAAA,GAAkB,WAAA;EAUvC,QAAA,IAAY,MAAA,CAAO,eAAA;EAWnB,KAAA;EAAA,QAIC,UAAA;AAAA"}
1
+ {"version":3,"file":"special-files-collector.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/dev-server/special-files-collector.ts"],"mappings":";;YAUY;;;;;qBAMC;mBACM;EASV,QAAQ,OAAO,YAAY;EAO3B,QAAQ,aAAa;EAIrB,WAAW;EAIX,WAAW,aAAa;EAKxB,YAAY,uBAAuB;EAUnC,eAAe,MAAM,kBAAkB;EAUvC,YAAY,OAAO;EAWnB;UAIC"}
@@ -175,5 +175,5 @@ function releaseTerminal() {
175
175
  }
176
176
 
177
177
  //#endregion
178
- export { isDevWorker, superviseDevServer };
178
+ export { WORKER_BOOTED_MESSAGE, WORKER_ENV_FLAG, isDevWorker, superviseDevServer };
179
179
  //# sourceMappingURL=supervisor.mjs.map
@@ -1,6 +1,6 @@
1
1
  import { Path } from "../utils/normalized-path.mjs";
2
2
  import path from "node:path";
3
- import fs from "node:fs";
3
+ import fsSync from "node:fs";
4
4
  import { readTsconfig } from "get-tsconfig";
5
5
 
6
6
  //#region ../../packages/core/src/dev-server/tsconfig-manager.ts
@@ -12,7 +12,7 @@ var TSConfigManager = class {
12
12
  init() {
13
13
  if (this.tsconfig) return;
14
14
  const configPath = Path.toAbsolute("tsconfig.json");
15
- const parsed = fs.existsSync(configPath) ? readTsconfig(configPath, { typescriptVersion: false }).config : {};
15
+ const parsed = fsSync.existsSync(configPath) ? readTsconfig(configPath, { typescriptVersion: false }).config : {};
16
16
  const compilerOptions = parsed.compilerOptions ?? {};
17
17
  this.tsconfig = {
18
18
  ...parsed,
@@ -88,5 +88,5 @@ var TSConfigManager = class {
88
88
  const tsconfigManager = new TSConfigManager();
89
89
 
90
90
  //#endregion
91
- export { tsconfigManager };
91
+ export { TSConfigManager, tsconfigManager };
92
92
  //# sourceMappingURL=tsconfig-manager.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tsconfig-manager.mjs","names":[],"sources":["../../../../../../../../packages/core/src/dev-server/tsconfig-manager.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { readTsconfig } from \"get-tsconfig\";\nimport { Path } from \"../utils/normalized-path\";\n\nexport class TSConfigManager {\n /**\n * Aliases list (from tsconfig paths)\n */\n public aliases: Record<string, string[]> = {};\n\n /**\n * Base URL for resolving paths\n */\n public baseUrl: string = \".\";\n\n /**\n * TSConfig\n */\n public tsconfig: any;\n\n public init() {\n if (this.tsconfig) return;\n\n // `ts.readConfigFile` does not follow `extends`; `readTsconfig` resolves the\n // whole chain (paths, baseUrl, decorator flags) and keeps string enum values,\n // which is what esbuild's `tsconfigRaw` expects.\n const configPath = Path.toAbsolute(\"tsconfig.json\");\n const parsed = fs.existsSync(configPath)\n ? readTsconfig(configPath, { typescriptVersion: false }).config\n : {};\n const compilerOptions = parsed.compilerOptions ?? {};\n\n this.tsconfig = { ...parsed, compilerOptions };\n\n this.aliases = (compilerOptions.paths as Record<string, string[]> | undefined) || {};\n\n this.baseUrl = compilerOptions.baseUrl || \".\";\n }\n\n /**\n * Check if the given path is an alias\n * This checks if it's a REAL path alias (not an external package alias)\n *\n * Real aliases map to local paths (e.g., app/* -> src/app/*, src/* -> src/*)\n * External package aliases map to themselves with @ prefix (e.g., @warlock.js/core -> @warlock.js/core)\n */\n public isAlias(path: string) {\n if (!this.tsconfig) {\n this.init();\n }\n\n return Object.keys(this.aliases).some((alias) => {\n if (!this.matchesAliasPattern(alias, path)) {\n return false;\n }\n\n const aliasTargets = this.aliases[alias];\n if (!Array.isArray(aliasTargets) || aliasTargets.length === 0) {\n return false;\n }\n\n // A package mapped onto itself is an external package, not a local alias\n // Example: \"@warlock.js/core\" -> \"@warlock.js/core\"\n // (self-referencing local ones like src/* -> src/* are still aliases)\n if (!alias.endsWith(\"/*\") && aliasTargets.every((target) => target === alias)) {\n return false;\n }\n\n return true;\n });\n }\n\n /**\n * Check if an import path matches a tsconfig paths pattern\n * (exact match, or `prefix/*` matching anything under `prefix/`)\n */\n private matchesAliasPattern(alias: string, importPath: string): boolean {\n if (alias.endsWith(\"/*\")) {\n return importPath.startsWith(alias.slice(0, -1));\n }\n\n return importPath === alias;\n }\n\n /**\n * Get the alias key that matches the given import path\n */\n public getMatchingAlias(path: string): string | null {\n const aliasKey = Object.keys(this.aliases).find((alias) =>\n this.matchesAliasPattern(alias, path),\n );\n\n return aliasKey || null;\n }\n\n /**\n * Resolve an alias import path to a relative path based on tsconfig paths\n * Example: \"app/users/services/get-users.service\" -> \"src/app/users/services/get-users.service\"\n *\n * @param path - The import path with alias (e.g., \"app/users/services/get-users.service\")\n * @returns The resolved relative path or null if alias not found\n */\n public resolveAliasPath(checkingPath: string): string | null {\n // Find matching alias from tsconfig paths\n const aliasKey = this.getMatchingAlias(checkingPath);\n\n if (!aliasKey) return null;\n\n const aliasTargets = this.aliases[aliasKey];\n if (!Array.isArray(aliasTargets) || aliasTargets.length === 0) {\n return null;\n }\n\n // Get the first target path (usually there's only one)\n const targetPattern = aliasTargets[0];\n\n if (targetPattern === undefined) {\n return null;\n }\n\n // Replace alias pattern with target pattern\n const aliasPattern = aliasKey.replace(\"/*\", \"\");\n const targetBase = targetPattern.replace(\"/*\", \"\");\n // Remove any leading slash so path.join does not drop the base\n const relativePart = checkingPath.substring(aliasPattern.length).replace(/^[/\\\\]/, \"\");\n\n // Join the target base with the relative part\n const resolvedPath = path.join(targetBase, relativePart);\n\n return Path.normalize(resolvedPath);\n }\n\n /**\n * Resolve an alias import path to an absolute path\n * Example: \"app/users/services/get-users.service\" -> \"/absolute/path/to/src/app/users/services/get-users.service\"\n *\n * @param path - The import path with alias\n * @returns The resolved absolute path or null if alias not found\n */\n public resolveAliasToAbsolute(path: string): string | null {\n const relativePath = this.resolveAliasPath(path);\n\n if (!relativePath) return null;\n\n return Path.normalize(Path.toAbsolute(relativePath));\n }\n}\n\nexport const tsconfigManager = new TSConfigManager();\n"],"mappings":";;;;;;AAKA,IAAa,kBAAb,MAA6B;;iBAIgB,CAAC;iBAKnB;;CAOzB,AAAO,OAAO;EACZ,IAAI,KAAK,UAAU;EAKnB,MAAM,aAAa,KAAK,WAAW,eAAe;EAClD,MAAM,SAAS,GAAG,WAAW,UAAU,IACnC,aAAa,YAAY,EAAE,mBAAmB,MAAM,CAAC,CAAC,CAAC,SACvD,CAAC;EACL,MAAM,kBAAkB,OAAO,mBAAmB,CAAC;EAEnD,KAAK,WAAW;GAAE,GAAG;GAAQ;EAAgB;EAE7C,KAAK,UAAW,gBAAgB,SAAkD,CAAC;EAEnF,KAAK,UAAU,gBAAgB,WAAW;CAC5C;;;;;;;;CASA,AAAO,QAAQ,MAAc;EAC3B,IAAI,CAAC,KAAK,UACR,KAAK,KAAK;EAGZ,OAAO,OAAO,KAAK,KAAK,OAAO,CAAC,CAAC,MAAM,UAAU;GAC/C,IAAI,CAAC,KAAK,oBAAoB,OAAO,IAAI,GACvC,OAAO;GAGT,MAAM,eAAe,KAAK,QAAQ;GAClC,IAAI,CAAC,MAAM,QAAQ,YAAY,KAAK,aAAa,WAAW,GAC1D,OAAO;GAMT,IAAI,CAAC,MAAM,SAAS,IAAI,KAAK,aAAa,OAAO,WAAW,WAAW,KAAK,GAC1E,OAAO;GAGT,OAAO;EACT,CAAC;CACH;;;;;CAMA,AAAQ,oBAAoB,OAAe,YAA6B;EACtE,IAAI,MAAM,SAAS,IAAI,GACrB,OAAO,WAAW,WAAW,MAAM,MAAM,GAAG,EAAE,CAAC;EAGjD,OAAO,eAAe;CACxB;;;;CAKA,AAAO,iBAAiB,MAA6B;EAKnD,OAJiB,OAAO,KAAK,KAAK,OAAO,CAAC,CAAC,MAAM,UAC/C,KAAK,oBAAoB,OAAO,IAAI,CAGxB,KAAK;CACrB;;;;;;;;CASA,AAAO,iBAAiB,cAAqC;EAE3D,MAAM,WAAW,KAAK,iBAAiB,YAAY;EAEnD,IAAI,CAAC,UAAU,OAAO;EAEtB,MAAM,eAAe,KAAK,QAAQ;EAClC,IAAI,CAAC,MAAM,QAAQ,YAAY,KAAK,aAAa,WAAW,GAC1D,OAAO;EAIT,MAAM,gBAAgB,aAAa;EAEnC,IAAI,kBAAkB,QACpB,OAAO;EAIT,MAAM,eAAe,SAAS,QAAQ,MAAM,EAAE;EAC9C,MAAM,aAAa,cAAc,QAAQ,MAAM,EAAE;EAEjD,MAAM,eAAe,aAAa,UAAU,aAAa,MAAM,CAAC,CAAC,QAAQ,UAAU,EAAE;EAGrF,MAAM,eAAe,KAAK,KAAK,YAAY,YAAY;EAEvD,OAAO,KAAK,UAAU,YAAY;CACpC;;;;;;;;CASA,AAAO,uBAAuB,MAA6B;EACzD,MAAM,eAAe,KAAK,iBAAiB,IAAI;EAE/C,IAAI,CAAC,cAAc,OAAO;EAE1B,OAAO,KAAK,UAAU,KAAK,WAAW,YAAY,CAAC;CACrD;AACF;AAEA,MAAa,kBAAkB,IAAI,gBAAgB"}
1
+ {"version":3,"file":"tsconfig-manager.mjs","names":["fs"],"sources":["../../../../../../../../packages/core/src/dev-server/tsconfig-manager.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { readTsconfig } from \"get-tsconfig\";\nimport { Path } from \"../utils/normalized-path\";\n\nexport class TSConfigManager {\n /**\n * Aliases list (from tsconfig paths)\n */\n public aliases: Record<string, string[]> = {};\n\n /**\n * Base URL for resolving paths\n */\n public baseUrl: string = \".\";\n\n /**\n * TSConfig\n */\n public tsconfig: any;\n\n public init() {\n if (this.tsconfig) return;\n\n // `ts.readConfigFile` does not follow `extends`; `readTsconfig` resolves the\n // whole chain (paths, baseUrl, decorator flags) and keeps string enum values,\n // which is what esbuild's `tsconfigRaw` expects.\n const configPath = Path.toAbsolute(\"tsconfig.json\");\n const parsed = fs.existsSync(configPath)\n ? readTsconfig(configPath, { typescriptVersion: false }).config\n : {};\n const compilerOptions = parsed.compilerOptions ?? {};\n\n this.tsconfig = { ...parsed, compilerOptions };\n\n this.aliases = (compilerOptions.paths as Record<string, string[]> | undefined) || {};\n\n this.baseUrl = compilerOptions.baseUrl || \".\";\n }\n\n /**\n * Check if the given path is an alias\n * This checks if it's a REAL path alias (not an external package alias)\n *\n * Real aliases map to local paths (e.g., app/* -> src/app/*, src/* -> src/*)\n * External package aliases map to themselves with @ prefix (e.g., @warlock.js/core -> @warlock.js/core)\n */\n public isAlias(path: string) {\n if (!this.tsconfig) {\n this.init();\n }\n\n return Object.keys(this.aliases).some((alias) => {\n if (!this.matchesAliasPattern(alias, path)) {\n return false;\n }\n\n const aliasTargets = this.aliases[alias];\n if (!Array.isArray(aliasTargets) || aliasTargets.length === 0) {\n return false;\n }\n\n // A package mapped onto itself is an external package, not a local alias\n // Example: \"@warlock.js/core\" -> \"@warlock.js/core\"\n // (self-referencing local ones like src/* -> src/* are still aliases)\n if (!alias.endsWith(\"/*\") && aliasTargets.every((target) => target === alias)) {\n return false;\n }\n\n return true;\n });\n }\n\n /**\n * Check if an import path matches a tsconfig paths pattern\n * (exact match, or `prefix/*` matching anything under `prefix/`)\n */\n private matchesAliasPattern(alias: string, importPath: string): boolean {\n if (alias.endsWith(\"/*\")) {\n return importPath.startsWith(alias.slice(0, -1));\n }\n\n return importPath === alias;\n }\n\n /**\n * Get the alias key that matches the given import path\n */\n public getMatchingAlias(path: string): string | null {\n const aliasKey = Object.keys(this.aliases).find((alias) =>\n this.matchesAliasPattern(alias, path),\n );\n\n return aliasKey || null;\n }\n\n /**\n * Resolve an alias import path to a relative path based on tsconfig paths\n * Example: \"app/users/services/get-users.service\" -> \"src/app/users/services/get-users.service\"\n *\n * @param path - The import path with alias (e.g., \"app/users/services/get-users.service\")\n * @returns The resolved relative path or null if alias not found\n */\n public resolveAliasPath(checkingPath: string): string | null {\n // Find matching alias from tsconfig paths\n const aliasKey = this.getMatchingAlias(checkingPath);\n\n if (!aliasKey) return null;\n\n const aliasTargets = this.aliases[aliasKey];\n if (!Array.isArray(aliasTargets) || aliasTargets.length === 0) {\n return null;\n }\n\n // Get the first target path (usually there's only one)\n const targetPattern = aliasTargets[0];\n\n if (targetPattern === undefined) {\n return null;\n }\n\n // Replace alias pattern with target pattern\n const aliasPattern = aliasKey.replace(\"/*\", \"\");\n const targetBase = targetPattern.replace(\"/*\", \"\");\n // Remove any leading slash so path.join does not drop the base\n const relativePart = checkingPath.substring(aliasPattern.length).replace(/^[/\\\\]/, \"\");\n\n // Join the target base with the relative part\n const resolvedPath = path.join(targetBase, relativePart);\n\n return Path.normalize(resolvedPath);\n }\n\n /**\n * Resolve an alias import path to an absolute path\n * Example: \"app/users/services/get-users.service\" -> \"/absolute/path/to/src/app/users/services/get-users.service\"\n *\n * @param path - The import path with alias\n * @returns The resolved absolute path or null if alias not found\n */\n public resolveAliasToAbsolute(path: string): string | null {\n const relativePath = this.resolveAliasPath(path);\n\n if (!relativePath) return null;\n\n return Path.normalize(Path.toAbsolute(relativePath));\n }\n}\n\nexport const tsconfigManager = new TSConfigManager();\n"],"mappings":";;;;;;AAKA,IAAa,kBAAb,MAA6B;;iBAIgB,CAAC;iBAKnB;;CAOzB,AAAO,OAAO;EACZ,IAAI,KAAK,UAAU;EAKnB,MAAM,aAAa,KAAK,WAAW,eAAe;EAClD,MAAM,SAASA,OAAG,WAAW,UAAU,IACnC,aAAa,YAAY,EAAE,mBAAmB,MA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