@warlock.js/core 5.34.3 → 5.36.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 (281) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/esm/cli/cli-commands.manager.mjs +1 -1
  3. package/esm/cli/cli-commands.manager.mjs.map +1 -1
  4. package/esm/cli/commands/add.command.mjs +1 -0
  5. package/esm/cli/commands/add.command.mjs.map +1 -1
  6. package/esm/cli/commands/build.command.mjs +30 -3
  7. package/esm/cli/commands/build.command.mjs.map +1 -1
  8. package/esm/cli/commands/check/check-command.action.mjs +1 -0
  9. package/esm/cli/commands/check/check-command.action.mjs.map +1 -1
  10. package/esm/cli/commands/check.command.mjs +5 -0
  11. package/esm/cli/commands/check.command.mjs.map +1 -1
  12. package/esm/cli/commands/explain/explain-command.action.mjs +21 -0
  13. package/esm/cli/commands/explain/explain-command.action.mjs.map +1 -1
  14. package/esm/cli/commands/explain.command.mjs +14 -4
  15. package/esm/cli/commands/explain.command.mjs.map +1 -1
  16. package/esm/cli/commands/generate/generate.command.mjs +19 -1
  17. package/esm/cli/commands/generate/generate.command.mjs.map +1 -1
  18. package/esm/cli/commands/generate/generators/endpoint.generator.mjs +1 -1
  19. package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -1
  20. package/esm/cli/commands/generate/generators/web.generator.mjs +169 -0
  21. package/esm/cli/commands/generate/generators/web.generator.mjs.map +1 -0
  22. package/esm/cli/commands/generate/templates/web-stubs.mjs +231 -0
  23. package/esm/cli/commands/generate/templates/web-stubs.mjs.map +1 -0
  24. package/esm/cli/commands/inspect/inspect-command.action.mjs +4 -3
  25. package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -1
  26. package/esm/cli/commands/inspect.command.mjs +13 -8
  27. package/esm/cli/commands/inspect.command.mjs.map +1 -1
  28. package/esm/cli/commands/mcp/mcp-command.action.mjs +1 -1
  29. package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -1
  30. package/esm/config/config-loader.d.mts.map +1 -1
  31. package/esm/config/config-loader.mjs +2 -0
  32. package/esm/config/config-loader.mjs.map +1 -1
  33. package/esm/config/load-config-files.mjs +4 -0
  34. package/esm/config/load-config-files.mjs.map +1 -1
  35. package/esm/dev-server/file-event-handler.mjs +11 -1
  36. package/esm/dev-server/file-event-handler.mjs.map +1 -1
  37. package/esm/dev-server/file-manager.d.mts +1 -1
  38. package/esm/dev-server/file-manager.d.mts.map +1 -1
  39. package/esm/dev-server/file-manager.mjs.map +1 -1
  40. package/esm/dev-server/files-orchestrator.mjs +16 -1
  41. package/esm/dev-server/files-orchestrator.mjs.map +1 -1
  42. package/esm/dev-server/files-watcher.mjs +13 -4
  43. package/esm/dev-server/files-watcher.mjs.map +1 -1
  44. package/esm/dev-server/loader/loader-port-acks.mjs +21 -9
  45. package/esm/dev-server/loader/loader-port-acks.mjs.map +1 -1
  46. package/esm/dev-server/loader/register-loader.mjs +31 -12
  47. package/esm/dev-server/loader/register-loader.mjs.map +1 -1
  48. package/esm/dev-server/module-loader.mjs +15 -1
  49. package/esm/dev-server/module-loader.mjs.map +1 -1
  50. package/esm/dev-server/parse-imports.mjs +1 -1
  51. package/esm/dev-server/special-file-patterns.mjs +4 -1
  52. package/esm/dev-server/special-file-patterns.mjs.map +1 -1
  53. package/esm/dev-server/type-generator.mjs +1 -1
  54. package/esm/e2e/cdp.d.mts.map +1 -1
  55. package/esm/e2e/cdp.mjs +9 -2
  56. package/esm/e2e/cdp.mjs.map +1 -1
  57. package/esm/e2e/index.d.mts +2 -2
  58. package/esm/e2e/page.d.mts +14 -1
  59. package/esm/e2e/page.d.mts.map +1 -1
  60. package/esm/e2e/page.mjs +81 -8
  61. package/esm/e2e/page.mjs.map +1 -1
  62. package/esm/e2e/types.d.mts +49 -0
  63. package/esm/e2e/types.d.mts.map +1 -1
  64. package/esm/e2e/types.mjs.map +1 -1
  65. package/esm/errors/error-codes.d.mts +72 -0
  66. package/esm/errors/error-codes.d.mts.map +1 -1
  67. package/esm/errors/error-codes.mjs +72 -0
  68. package/esm/errors/error-codes.mjs.map +1 -1
  69. package/esm/errors/index.d.mts +2 -2
  70. package/esm/errors/index.mjs +2 -2
  71. package/esm/generations/add-command.action.mjs +2 -0
  72. package/esm/generations/add-command.action.mjs.map +1 -1
  73. package/esm/generations/design-system-payload.mjs +53 -0
  74. package/esm/generations/design-system-payload.mjs.map +1 -0
  75. package/esm/generations/features/design-system.feature.mjs +38 -0
  76. package/esm/generations/features/design-system.feature.mjs.map +1 -0
  77. package/esm/generations/features/index.mjs +3 -1
  78. package/esm/generations/features/index.mjs.map +1 -1
  79. package/esm/generations/features/notifications.feature.mjs +13 -2
  80. package/esm/generations/features/notifications.feature.mjs.map +1 -1
  81. package/esm/generations/features/test.feature.mjs +48 -13
  82. package/esm/generations/features/test.feature.mjs.map +1 -1
  83. package/esm/generations/features/web.feature.mjs +3 -3
  84. package/esm/generations/features/web.feature.mjs.map +1 -1
  85. package/esm/generations/stubs.mjs +9 -5
  86. package/esm/generations/stubs.mjs.map +1 -1
  87. package/esm/http/error-mapper.d.mts +1 -1
  88. package/esm/http/error-mapper.mjs +3 -3
  89. package/esm/http/error-mapper.mjs.map +1 -1
  90. package/esm/http/error-response.d.mts +3 -0
  91. package/esm/http/error-response.d.mts.map +1 -1
  92. package/esm/http/error-response.mjs +8 -2
  93. package/esm/http/error-response.mjs.map +1 -1
  94. package/esm/http/errors/errors.d.mts +8 -0
  95. package/esm/http/errors/errors.d.mts.map +1 -1
  96. package/esm/http/errors/errors.mjs +13 -1
  97. package/esm/http/errors/errors.mjs.map +1 -1
  98. package/esm/http/index.d.mts +3 -2
  99. package/esm/http/index.mjs +3 -2
  100. package/esm/http/list-endpoint.d.mts +35 -0
  101. package/esm/http/list-endpoint.d.mts.map +1 -0
  102. package/esm/http/list-endpoint.mjs +28 -0
  103. package/esm/http/list-endpoint.mjs.map +1 -0
  104. package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
  105. package/esm/http/middleware/inject-request-context.mjs +12 -2
  106. package/esm/http/middleware/inject-request-context.mjs.map +1 -1
  107. package/esm/http/server.mjs +1 -1
  108. package/esm/index.d.mts +10 -6
  109. package/esm/index.mjs +5 -2
  110. package/esm/localization/index.mjs +3 -1
  111. package/esm/localization/translation-usage-graph.d.mts +49 -0
  112. package/esm/localization/translation-usage-graph.d.mts.map +1 -0
  113. package/esm/localization/translation-usage-graph.mjs +128 -0
  114. package/esm/localization/translation-usage-graph.mjs.map +1 -0
  115. package/esm/localization/translation-usage.d.mts +85 -0
  116. package/esm/localization/translation-usage.d.mts.map +1 -0
  117. package/esm/localization/translation-usage.mjs +307 -0
  118. package/esm/localization/translation-usage.mjs.map +1 -0
  119. package/esm/openapi/security.mjs +12 -4
  120. package/esm/openapi/security.mjs.map +1 -1
  121. package/esm/openapi/types.d.mts +2 -0
  122. package/esm/openapi/types.d.mts.map +1 -1
  123. package/esm/production/build-budgets.d.mts +64 -0
  124. package/esm/production/build-budgets.d.mts.map +1 -0
  125. package/esm/production/build-budgets.mjs +109 -0
  126. package/esm/production/build-budgets.mjs.map +1 -0
  127. package/esm/production/production-builder.mjs +13 -1
  128. package/esm/production/production-builder.mjs.map +1 -1
  129. package/esm/production/resolve-build-config.d.mts +1 -1
  130. package/esm/production/resolve-build-config.d.mts.map +1 -1
  131. package/esm/production/resolve-build-config.mjs.map +1 -1
  132. package/esm/production/route-registration-snapshot.mjs +5 -3
  133. package/esm/production/route-registration-snapshot.mjs.map +1 -1
  134. package/esm/restful/restful.d.mts +1 -1
  135. package/esm/router/router.d.mts +2 -0
  136. package/esm/router/router.d.mts.map +1 -1
  137. package/esm/router/router.mjs +4 -1
  138. package/esm/router/router.mjs.map +1 -1
  139. package/esm/router/types.d.mts +19 -0
  140. package/esm/router/types.d.mts.map +1 -1
  141. package/esm/tests/fakes/storage-fake.d.mts +3 -1
  142. package/esm/tests/fakes/storage-fake.d.mts.map +1 -1
  143. package/esm/tests/fakes/storage-fake.mjs +3 -3
  144. package/esm/tests/fakes/storage-fake.mjs.map +1 -1
  145. package/esm/tests/fakes/test-fakes.d.mts +3 -1
  146. package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
  147. package/esm/tests/fakes/test-fakes.mjs +3 -2
  148. package/esm/tests/fakes/test-fakes.mjs.map +1 -1
  149. package/esm/tests/index.d.mts +4 -2
  150. package/esm/tests/index.mjs +3 -1
  151. package/esm/tests/load-unit-config.mjs +24 -0
  152. package/esm/tests/load-unit-config.mjs.map +1 -0
  153. package/esm/tests/response-contract.d.mts +32 -0
  154. package/esm/tests/response-contract.d.mts.map +1 -0
  155. package/esm/tests/response-contract.mjs +116 -0
  156. package/esm/tests/response-contract.mjs.map +1 -0
  157. package/esm/tests/start-http-development-server.d.mts.map +1 -1
  158. package/esm/tests/start-http-development-server.mjs +10 -2
  159. package/esm/tests/start-http-development-server.mjs.map +1 -1
  160. package/esm/tests/test-lifecycle-state.mjs.map +1 -1
  161. package/esm/tests/test-locales.mjs +33 -0
  162. package/esm/tests/test-locales.mjs.map +1 -0
  163. package/esm/tests/test-runtime-scope.d.mts +15 -0
  164. package/esm/tests/test-runtime-scope.d.mts.map +1 -0
  165. package/esm/tests/test-runtime-scope.mjs +80 -0
  166. package/esm/tests/test-runtime-scope.mjs.map +1 -0
  167. package/esm/tests/vitest-setup.d.mts +13 -3
  168. package/esm/tests/vitest-setup.d.mts.map +1 -1
  169. package/esm/tests/vitest-setup.mjs +146 -18
  170. package/esm/tests/vitest-setup.mjs.map +1 -1
  171. package/esm/tooling/check/affected-files.d.mts +5 -0
  172. package/esm/tooling/check/affected-files.d.mts.map +1 -0
  173. package/esm/tooling/check/affected-files.mjs +56 -0
  174. package/esm/tooling/check/affected-files.mjs.map +1 -0
  175. package/esm/tooling/check/api-route-references.d.mts +16 -0
  176. package/esm/tooling/check/api-route-references.d.mts.map +1 -0
  177. package/esm/tooling/check/api-route-references.mjs +146 -0
  178. package/esm/tooling/check/api-route-references.mjs.map +1 -0
  179. package/esm/tooling/check/changed-files.d.mts +2 -0
  180. package/esm/tooling/check/changed-files.d.mts.map +1 -1
  181. package/esm/tooling/check/changed-files.mjs +2 -2
  182. package/esm/tooling/check/changed-files.mjs.map +1 -1
  183. package/esm/tooling/check/conventions-step.d.mts +7 -3
  184. package/esm/tooling/check/conventions-step.d.mts.map +1 -1
  185. package/esm/tooling/check/conventions-step.mjs +59 -8
  186. package/esm/tooling/check/conventions-step.mjs.map +1 -1
  187. package/esm/tooling/check/fixes.d.mts +8 -0
  188. package/esm/tooling/check/fixes.d.mts.map +1 -0
  189. package/esm/tooling/check/fixes.mjs +31 -0
  190. package/esm/tooling/check/fixes.mjs.map +1 -0
  191. package/esm/tooling/check/index.d.mts +12 -0
  192. package/esm/tooling/check/index.mjs +3 -2
  193. package/esm/tooling/check/run-check.d.mts +2 -0
  194. package/esm/tooling/check/run-check.d.mts.map +1 -1
  195. package/esm/tooling/check/run-check.mjs +23 -5
  196. package/esm/tooling/check/run-check.mjs.map +1 -1
  197. package/esm/tooling/check/run-tests.mjs +1 -1
  198. package/esm/tooling/check/source-ast.d.mts +1 -0
  199. package/esm/tooling/check/translation-conventions.mjs +32 -0
  200. package/esm/tooling/check/translation-conventions.mjs.map +1 -0
  201. package/esm/tooling/check/web-conventions.d.mts +10 -0
  202. package/esm/tooling/check/web-conventions.d.mts.map +1 -0
  203. package/esm/tooling/check/web-conventions.mjs +126 -0
  204. package/esm/tooling/check/web-conventions.mjs.map +1 -0
  205. package/esm/tooling/index.d.mts +7 -2
  206. package/esm/tooling/index.mjs +4 -2
  207. package/esm/tooling/inspect/collect-files.mjs +172 -0
  208. package/esm/tooling/inspect/collect-files.mjs.map +1 -0
  209. package/esm/tooling/inspect/collect-pages.mjs +3 -2
  210. package/esm/tooling/inspect/collect-pages.mjs.map +1 -1
  211. package/esm/tooling/inspect/collect-routes.mjs +1 -1
  212. package/esm/tooling/inspect/collect-routes.mjs.map +1 -1
  213. package/esm/tooling/inspect/explain-file.d.mts +12 -0
  214. package/esm/tooling/inspect/explain-file.d.mts.map +1 -0
  215. package/esm/tooling/inspect/explain-file.mjs +45 -0
  216. package/esm/tooling/inspect/explain-file.mjs.map +1 -0
  217. package/esm/tooling/inspect/index.d.mts +3 -2
  218. package/esm/tooling/inspect/index.mjs +2 -1
  219. package/esm/tooling/inspect/inspect-app.d.mts.map +1 -1
  220. package/esm/tooling/inspect/inspect-app.mjs +9 -3
  221. package/esm/tooling/inspect/inspect-app.mjs.map +1 -1
  222. package/esm/tooling/inspect/inspect-report.schema.mjs +34 -1
  223. package/esm/tooling/inspect/inspect-report.schema.mjs.map +1 -1
  224. package/esm/tooling/inspect/inspect-report.types.d.mts +17 -1
  225. package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -1
  226. package/esm/tooling/inspect/inspect-report.types.mjs +2 -1
  227. package/esm/tooling/inspect/inspect-report.types.mjs.map +1 -1
  228. package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -1
  229. package/esm/tooling/mcp/mcp-tools.mjs +8 -2
  230. package/esm/tooling/mcp/mcp-tools.mjs.map +1 -1
  231. package/esm/tooling/problem.d.mts +4 -0
  232. package/esm/tooling/problem.d.mts.map +1 -1
  233. package/esm/tooling/problem.mjs +1 -0
  234. package/esm/tooling/problem.mjs.map +1 -1
  235. package/esm/tooling/syntax/ast.d.mts +2 -0
  236. package/esm/tooling/typecheck/run-typecheck.mjs +5 -1
  237. package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -1
  238. package/esm/upgrade/codemods/index.mjs +2 -0
  239. package/esm/upgrade/codemods/index.mjs.map +1 -1
  240. package/esm/upgrade/codemods/vite-vitest.mjs +170 -0
  241. package/esm/upgrade/codemods/vite-vitest.mjs.map +1 -0
  242. package/esm/upgrade/notes.mjs +4 -0
  243. package/esm/upgrade/notes.mjs.map +1 -1
  244. package/esm/vite/index.d.mts +3 -1
  245. package/esm/vite/index.mjs +3 -1
  246. package/esm/vite/test-setup-reporter.d.mts +16 -0
  247. package/esm/vite/test-setup-reporter.d.mts.map +1 -0
  248. package/esm/vite/test-setup-reporter.mjs +55 -0
  249. package/esm/vite/test-setup-reporter.mjs.map +1 -0
  250. package/esm/vite/test-workers.d.mts +5 -0
  251. package/esm/vite/test-workers.d.mts.map +1 -0
  252. package/esm/vite/test-workers.mjs +38 -0
  253. package/esm/vite/test-workers.mjs.map +1 -0
  254. package/esm/warlock-config/index.d.mts +2 -1
  255. package/esm/warlock-config/types.d.mts +3 -0
  256. package/esm/warlock-config/types.d.mts.map +1 -1
  257. package/llms-full.txt +874 -9
  258. package/llms.txt +2 -0
  259. package/package.json +15 -14
  260. package/schemas/inspect-report.schema.json +47 -1
  261. package/skills/build-budgets/SKILL.md +51 -0
  262. package/skills/build-restful/SKILL.md +56 -0
  263. package/skills/configure-app/SKILL.md +7 -0
  264. package/skills/create-module/SKILL.md +9 -0
  265. package/skills/generate-web-ui/SKILL.md +71 -0
  266. package/skills/index.md +2 -2
  267. package/skills/register-route/SKILL.md +13 -0
  268. package/skills/run-app/SKILL.md +1 -1
  269. package/skills/send-mail/SKILL.md +25 -0
  270. package/skills/send-response/SKILL.md +50 -0
  271. package/skills/test-browser/SKILL.md +53 -0
  272. package/skills/test-http/SKILL.md +91 -0
  273. package/skills/test-service/SKILL.md +161 -3
  274. package/skills/upgrade-from-5-29/SKILL.md +109 -0
  275. package/skills/use-localization/SKILL.md +25 -0
  276. package/skills/warlock-check/SKILL.md +75 -1
  277. package/skills/warlock-inspect/SKILL.md +45 -2
  278. package/skills/warlock-mcp/SKILL.md +4 -0
  279. package/skills/write-cli-command/SKILL.md +18 -0
  280. package/esm/production/build-app-production.mjs +0 -14
  281. package/esm/production/build-app-production.mjs.map +0 -1
@@ -609,6 +609,70 @@ export declare const ERROR_CODES: {
609
609
  readonly fix: "Rename the discriminator to `type` and update the code that narrows on it.";
610
610
  readonly skill: "warlock-conventions";
611
611
  };
612
+ readonly WL9013: {
613
+ readonly code: "WL9013";
614
+ readonly area: "convention";
615
+ readonly category: "code";
616
+ readonly title: "Component file exceeds the configured line limit";
617
+ readonly fix: "Split the component file; the default limit is 150 lines.";
618
+ readonly skill: "warlock-check";
619
+ };
620
+ readonly WL9014: {
621
+ readonly code: "WL9014";
622
+ readonly area: "convention";
623
+ readonly category: "code";
624
+ readonly title: "A file defines more than one web component";
625
+ readonly fix: "Move each component to its own TSX file.";
626
+ readonly skill: "warlock-check";
627
+ };
628
+ readonly WL9015: {
629
+ readonly code: "WL9015";
630
+ readonly area: "convention";
631
+ readonly category: "code";
632
+ readonly title: "Component state, effects or event handlers live in a component file";
633
+ readonly fix: "Move state, effects and event handlers into a use-*.ts hook.";
634
+ readonly skill: "warlock-check";
635
+ };
636
+ readonly WL9016: {
637
+ readonly code: "WL9016";
638
+ readonly area: "convention";
639
+ readonly category: "code";
640
+ readonly title: "App code uses a native form control";
641
+ readonly fix: "Use a design-system control; native controls are allowed in src/web/design-system/.";
642
+ readonly skill: "warlock-check";
643
+ };
644
+ readonly WL9017: {
645
+ readonly code: "WL9017";
646
+ readonly area: "convention";
647
+ readonly category: "code";
648
+ readonly title: "A DOM form element declares native validation";
649
+ readonly fix: "Use the shared validation schema and field error controls.";
650
+ readonly skill: "warlock-check";
651
+ };
652
+ readonly WL9018: {
653
+ readonly code: "WL9018";
654
+ readonly area: "convention";
655
+ readonly category: "code";
656
+ readonly title: "An exported controller has no response schema";
657
+ readonly fix: "Assign controller.responseSchema with a contract for each response status.";
658
+ readonly skill: "warlock-check";
659
+ };
660
+ readonly WL9019: {
661
+ readonly code: "WL9019";
662
+ readonly area: "convention";
663
+ readonly category: "code";
664
+ readonly title: "A browser route call takes a name that cannot be read statically";
665
+ readonly fix: 'Pass a string literal (or a template with a static prefix), or declare the names the page uses with `config.apiRoutes` in its setup file (`"orders.*"` covers a prefix).';
666
+ readonly skill: "warlock-check";
667
+ };
668
+ readonly WL9020: {
669
+ readonly code: "WL9020";
670
+ readonly area: "convention";
671
+ readonly category: "code";
672
+ readonly title: "Browser code references a named API route that is clientVisible: false";
673
+ readonly fix: "Call the endpoint from the server instead, or remove `clientVisible: false` from the route if the browser must reach it.";
674
+ readonly skill: "warlock-check";
675
+ };
612
676
  readonly WL9101: {
613
677
  readonly code: "WL9101";
614
678
  readonly area: "convention";
@@ -633,6 +697,14 @@ export declare const ERROR_CODES: {
633
697
  readonly fix: "Add a CHANGELOG.md with a `## x.y.z` heading for the current version.";
634
698
  readonly skill: "warlock-doctor";
635
699
  };
700
+ readonly WL9104: {
701
+ readonly code: "WL9104";
702
+ readonly area: "convention";
703
+ readonly category: "code";
704
+ readonly title: "Translation key is computed at runtime, so the page cannot ship only the keys it uses";
705
+ readonly fix: 'Declare the keys or prefixes the page renders in its setup file, for example `export const config = { translations: ["statuses.*", "members.title"] }`. Until then the page ships every translation group.';
706
+ readonly skill: "use-localization";
707
+ };
636
708
  };
637
709
  /** Every registered code, as a union. */
638
710
  export type WarlockErrorCode = keyof typeof ERROR_CODES;
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/errors/error-codes.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoCY;;;;;YAeA;;YAGA;;WAED;;WAEA,MAAM;;WAEN,UAAU;;WAEV;;WAEA;;WAEA;;WAEA;;WAEA;;;qBAIE;;qBAGA;;aAGT;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;;YAKQ,gCAAgC;;wBAG5B,mBAAmB,iBAAiB,SAAS;;;;;wBAQ7C,iBAAiB,eAAe;;wBAOhC,iBAAiB,MAAM;;;;;;;;;;;wBA8BvB,YAAY,iBAAiB"}
1
+ {"version":3,"file":"error-codes.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/errors/error-codes.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoCY;;;;;YAeA;;YAGA;;WAED;;WAEA,MAAM;;WAEN,UAAU;;WAEV;;WAEA;;WAEA;;WAEA;;WAEA;;;qBAIE;;qBAGA;;aAGT;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAKA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;aAGA;aACA;aACA;aACA;aACA;aACA;;;;YAKQ,gCAAgC;;wBAG5B,mBAAmB,iBAAiB,SAAS;;;;;wBAQ7C,iBAAiB,eAAe;;wBAOhC,iBAAiB,MAAM;;;;;;;;;;;wBA8BvB,YAAY,iBAAiB"}
@@ -549,6 +549,70 @@ const ERROR_CODES = {
549
549
  fix: "Rename the discriminator to `type` and update the code that narrows on it.",
550
550
  skill: "warlock-conventions"
551
551
  },
552
+ WL9013: {
553
+ code: "WL9013",
554
+ area: "convention",
555
+ category: "code",
556
+ title: "Component file exceeds the configured line limit",
557
+ fix: "Split the component file; the default limit is 150 lines.",
558
+ skill: "warlock-check"
559
+ },
560
+ WL9014: {
561
+ code: "WL9014",
562
+ area: "convention",
563
+ category: "code",
564
+ title: "A file defines more than one web component",
565
+ fix: "Move each component to its own TSX file.",
566
+ skill: "warlock-check"
567
+ },
568
+ WL9015: {
569
+ code: "WL9015",
570
+ area: "convention",
571
+ category: "code",
572
+ title: "Component state, effects or event handlers live in a component file",
573
+ fix: "Move state, effects and event handlers into a use-*.ts hook.",
574
+ skill: "warlock-check"
575
+ },
576
+ WL9016: {
577
+ code: "WL9016",
578
+ area: "convention",
579
+ category: "code",
580
+ title: "App code uses a native form control",
581
+ fix: "Use a design-system control; native controls are allowed in src/web/design-system/.",
582
+ skill: "warlock-check"
583
+ },
584
+ WL9017: {
585
+ code: "WL9017",
586
+ area: "convention",
587
+ category: "code",
588
+ title: "A DOM form element declares native validation",
589
+ fix: "Use the shared validation schema and field error controls.",
590
+ skill: "warlock-check"
591
+ },
592
+ WL9018: {
593
+ code: "WL9018",
594
+ area: "convention",
595
+ category: "code",
596
+ title: "An exported controller has no response schema",
597
+ fix: "Assign controller.responseSchema with a contract for each response status.",
598
+ skill: "warlock-check"
599
+ },
600
+ WL9019: {
601
+ code: "WL9019",
602
+ area: "convention",
603
+ category: "code",
604
+ title: "A browser route call takes a name that cannot be read statically",
605
+ fix: "Pass a string literal (or a template with a static prefix), or declare the names the page uses with `config.apiRoutes` in its setup file (`\"orders.*\"` covers a prefix).",
606
+ skill: "warlock-check"
607
+ },
608
+ WL9020: {
609
+ code: "WL9020",
610
+ area: "convention",
611
+ category: "code",
612
+ title: "Browser code references a named API route that is clientVisible: false",
613
+ fix: "Call the endpoint from the server instead, or remove `clientVisible: false` from the route if the browser must reach it.",
614
+ skill: "warlock-check"
615
+ },
552
616
  WL9101: {
553
617
  code: "WL9101",
554
618
  area: "convention",
@@ -572,6 +636,14 @@ const ERROR_CODES = {
572
636
  title: "CHANGELOG.md is missing or has no version heading",
573
637
  fix: "Add a CHANGELOG.md with a `## x.y.z` heading for the current version.",
574
638
  skill: "warlock-doctor"
639
+ },
640
+ WL9104: {
641
+ code: "WL9104",
642
+ area: "convention",
643
+ category: "code",
644
+ title: "Translation key is computed at runtime, so the page cannot ship only the keys it uses",
645
+ fix: "Declare the keys or prefixes the page renders in its setup file, for example `export const config = { translations: [\"statuses.*\", \"members.title\"] }`. Until then the page ships every translation group.",
646
+ skill: "use-localization"
575
647
  }
576
648
  };
577
649
  /** Whether `value` is a registered code. */
@@ -1 +1 @@
1
- {"version":3,"file":"error-codes.mjs","names":[],"sources":["../../../../../../../../packages/core/src/errors/error-codes.ts"],"sourcesContent":["/**\n * The registry of stable Warlock error codes.\n *\n * Every framework error core throws, every `warlock doctor` finding and every\n * `warlock check` problem carries one of these codes, so a person or an agent\n * can look the code up instead of interpreting the message. `warlock explain\n * <CODE>` prints an entry; the docs page `cli/error-codes` lists all of them.\n *\n * THE SCHEME: `WL` followed by four digits. The first digit is the area:\n *\n * | Range | Area | Meaning |\n * | ------ | ----------- | ---------------------------------------------------- |\n * | WL1xxx | config | a configuration value is missing or invalid |\n * | WL2xxx | boot | the app could not boot: modules, connectors, services |\n * | WL3xxx | routing | route registration and lookup |\n * | WL4xxx | validation | request validation schemas |\n * | WL5xxx | http | the HTTP layer at runtime |\n * | WL6xxx | database | migrations, seeders and database code |\n * | WL7xxx | cli | CLI usage, and problems `warlock check` finds in code |\n * | WL8xxx | environment | this machine: Node, tools, services, ports |\n * | WL9xxx | convention | framework conventions and release hygiene |\n *\n * STABILITY: a code, once released, keeps its meaning forever. Its `title`,\n * `fix` and links may be reworded; a code is never reused for a different\n * problem and never renumbered. A retired code stays in this table with\n * `retired: true`.\n *\n * `category` splits \"your code\" from \"this machine\": `environment` problems are\n * the ones `warlock check` reports with exit code 2, so an agent stops editing\n * code to fix a missing Redis server.\n *\n * This module is part of the side-effect-free `@warlock.js/core/errors` entry:\n * it imports nothing.\n */\n\n/** The area a code belongs to, matching its first digit. */\nexport type ErrorCodeArea =\n | \"config\"\n | \"boot\"\n | \"routing\"\n | \"validation\"\n | \"http\"\n | \"database\"\n | \"cli\"\n | \"environment\"\n | \"convention\";\n\n/**\n * Who has to act: `code` problems are fixed in the project's source or config,\n * `environment` problems on the machine running it.\n */\nexport type ErrorCodeCategory = \"code\" | \"environment\";\n\n/** One registry entry. */\nexport type ErrorCodeDefinition = {\n /** The stable code, e.g. `\"WL3001\"`. */\n readonly code: string;\n /** The area, matching the first digit. */\n readonly area: ErrorCodeArea;\n /** Whether the project or the machine has to change. */\n readonly category: ErrorCodeCategory;\n /** One-line name of the problem. */\n readonly title: string;\n /** One-line \"what to do\". */\n readonly fix: string;\n /** Slug of the skill that explains the fix (`packages/<pkg>/skills/<slug>/SKILL.md`). */\n readonly skill: string;\n /** Names of the error classes that carry this code, when an error class does. */\n readonly errorNames?: readonly string[];\n /** Set when the code is no longer emitted. Retired codes are never reused. */\n readonly retired?: true;\n};\n\n/** Base URL of the error-code reference; each code is an anchor on that page. */\nexport const ERROR_CODES_DOCS_URL = \"https://warlock.js.org/v/latest/core/cli/error-codes/\";\n\n/** The registry, keyed by code. */\nexport const ERROR_CODES = {\n // ── WL1xxx config ────────────────────────────────────────────────────────\n WL1001: {\n code: \"WL1001\",\n area: \"config\",\n category: \"code\",\n title: \"A required config section is missing\",\n fix: \"Add the missing file under src/config/ (for example src/config/app.ts) exporting the section.\",\n skill: \"configure-app\",\n },\n WL1002: {\n code: \"WL1002\",\n area: \"config\",\n category: \"code\",\n title: \"No JWT signing secret is configured\",\n fix: \"Run `warlock jwt.generate` (writes JWT_SECRET to .env) and read it as auth.accessToken.secret in src/config/auth.ts.\",\n skill: \"configure-app\",\n },\n WL1003: {\n code: \"WL1003\",\n area: \"config\",\n category: \"code\",\n title: \"The rate-limit store cannot use the configured cache driver\",\n fix: 'Use a redis, pg or memory cache driver for http.rateLimit store \"cache\", or set store: \"memory\".',\n skill: \"configure-app\",\n errorNames: [\"UnsupportedRateLimitDriverError\"],\n },\n WL1004: {\n code: \"WL1004\",\n area: \"config\",\n category: \"code\",\n title: \"An http.csp directive value is invalid\",\n fix: \"Fix the directive value named in the message in your http config; quotes must balance and values may not contain ';'.\",\n skill: \"configure-app\",\n errorNames: [\"InvalidCspDirectiveError\"],\n },\n WL1005: {\n code: \"WL1005\",\n area: \"config\",\n category: \"code\",\n title: \"The uploads.images configuration is invalid\",\n fix: \"Correct the uploads.images variant settings named in the message.\",\n skill: \"upload-file\",\n errorNames: [\"ImageVariantsConfigError\"],\n },\n WL1006: {\n code: \"WL1006\",\n area: \"config\",\n category: \"code\",\n title: \"warlock.config.ts sets a build option the builder refuses\",\n fix: \"Remove the named option from the build block of warlock.config.ts; change tsconfig.json instead.\",\n skill: \"run-app\",\n errorNames: [\"ForbiddenBuildOptionError\"],\n },\n WL1007: {\n code: \"WL1007\",\n area: \"config\",\n category: \"code\",\n title: \"A locale dictionary file cannot be parsed\",\n fix: \"Fix the key named in the message in the locales.json file it names.\",\n skill: \"use-localization\",\n errorNames: [\"LocaleDictionaryError\"],\n },\n WL1008: {\n code: \"WL1008\",\n area: \"config\",\n category: \"code\",\n title: \"A locale outside app.localeCodes was requested\",\n fix: \"Add the locale to app.localeCodes in src/config/app.ts, or pass a configured locale.\",\n skill: \"use-localization\",\n errorNames: [\"UnknownLocaleError\"],\n },\n WL1009: {\n code: \"WL1009\",\n area: \"config\",\n category: \"code\",\n title: \"warlock.config.ts > connectors was refused\",\n fix: \"Give every connector in warlock.config.ts a unique name that is not a built-in connector name.\",\n skill: \"add-connector\",\n },\n\n // ── WL2xxx boot ──────────────────────────────────────────────────────────\n WL2001: {\n code: \"WL2001\",\n area: \"boot\",\n category: \"code\",\n title: \"An app module failed to load\",\n fix: \"Open the file named in the message and fix the error it throws on import; its routes and listeners are missing until then.\",\n skill: \"warlock-doctor\",\n errorNames: [\"ModuleLoadError\"],\n },\n WL2002: {\n code: \"WL2002\",\n area: \"boot\",\n category: \"code\",\n title: \"The app's source files could not be discovered\",\n fix: \"Run the command from the project root and check that src/ exists and is readable.\",\n skill: \"warlock-doctor\",\n },\n WL2003: {\n code: \"WL2003\",\n area: \"boot\",\n category: \"code\",\n title: \"A connector failed to boot\",\n fix: \"Read the connector's message; it usually names the config value or package it needs.\",\n skill: \"add-connector\",\n },\n WL2004: {\n code: \"WL2004\",\n area: \"boot\",\n category: \"code\",\n title: \"A container key was read before it was registered\",\n fix: \"Register the key (container.set) before reading it, or read it after the connector that sets it has booted.\",\n skill: \"use-app-context\",\n errorNames: [\"ContainerKeyMissingError\"],\n },\n WL2005: {\n code: \"WL2005\",\n area: \"boot\",\n category: \"code\",\n title: \"A boot precondition failed\",\n fix: \"Fix the condition named in the message; restarting does not help until it changes.\",\n skill: \"run-app\",\n errorNames: [\"BootPreconditionError\"],\n },\n WL2006: {\n code: \"WL2006\",\n area: \"boot\",\n category: \"code\",\n title: \"Storage was used before the storage connector ran\",\n fix: 'Add src/config/storage.ts; in a custom command add \"storage\" to preload.connectors.',\n skill: \"store-file\",\n errorNames: [\"StorageNotInitializedError\"],\n },\n WL2007: {\n code: \"WL2007\",\n area: \"boot\",\n category: \"code\",\n title: \"A configured driver's package is not installed\",\n fix: \"Install the package named in the message (for example `pnpm add sharp`), or stop configuring the driver.\",\n skill: \"update-packages\",\n },\n\n // ── WL3xxx routing ───────────────────────────────────────────────────────\n WL3001: {\n code: \"WL3001\",\n area: \"routing\",\n category: \"code\",\n title: \"A route name is already taken\",\n fix: 'Rename one of the two routes with the \"name\" route option; pages and API routes share one namespace.',\n skill: \"register-route\",\n errorNames: [\"RouteNameTakenError\"],\n },\n WL3002: {\n code: \"WL3002\",\n area: \"routing\",\n category: \"code\",\n title: \"A route points at a controller method that does not exist\",\n fix: \"Fix the [controller, action] pair: the action must be a method on the controller.\",\n skill: \"register-route\",\n },\n WL3003: {\n code: \"WL3003\",\n area: \"routing\",\n category: \"code\",\n title: \"A URL was built for a route name that is not registered\",\n fix: \"Check the name passed to router.route(); `warlock routes --name <part>` lists the registered names.\",\n skill: \"warlock-routes\",\n },\n WL3004: {\n code: \"WL3004\",\n area: \"routing\",\n category: \"code\",\n title: \"A URL was built without one of the route's path parameters\",\n fix: \"Pass every :param of the route path when building the URL.\",\n skill: \"warlock-routes\",\n },\n WL3005: {\n code: \"WL3005\",\n area: \"routing\",\n category: \"code\",\n title: \"Route modules loaded but registered no routes\",\n fix: \"Make sure routes.ts calls router.get/post/... at module level and is not wrapped in an unused function.\",\n skill: \"register-route\",\n },\n WL3006: {\n code: \"WL3006\",\n area: \"routing\",\n category: \"code\",\n title: \"A handler uses the v4 (request, response) signature\",\n fix: \"Rewrite the handler as async ({ request, response }) => { ... }.\",\n skill: \"create-controller\",\n },\n\n // ── WL4xxx validation ────────────────────────────────────────────────────\n WL4001: {\n code: \"WL4001\",\n area: \"validation\",\n category: \"code\",\n title: \"A validation schema cannot be described as JSON Schema\",\n fix: \"Use Seal validators with a static shape for validation.schema/params; custom validate middleware is not described.\",\n skill: \"validate-input\",\n },\n\n // ── WL5xxx http ──────────────────────────────────────────────────────────\n WL5001: {\n code: \"WL5001\",\n area: \"http\",\n category: \"code\",\n title: \"A cookie was read but the cookie plugin is not registered\",\n fix: \"Register @fastify/cookie on the server before reading cookies by name.\",\n skill: \"send-response\",\n errorNames: [\"CookieJarUnavailableError\"],\n },\n WL5002: {\n code: \"WL5002\",\n area: \"http\",\n category: \"code\",\n title: \"An app route claims a health-probe path\",\n fix: \"Move the app route, or rename the probe with http.health.path / http.health.readinessPath.\",\n skill: \"health-checks\",\n },\n WL5003: {\n code: \"WL5003\",\n area: \"http\",\n category: \"code\",\n title: \"Health probes are enabled but not registered\",\n fix: \"Check that the http connector booted and that nothing removed the probe routes.\",\n skill: \"health-checks\",\n },\n WL5004: {\n code: \"WL5004\",\n area: \"http\",\n category: \"code\",\n title: \"Devtools recorded no timeline for the traced request\",\n fix: \"Keep http.requestId enabled (its echoed header is how the request is found) and retry; a path under the devtools prefix is never recorded.\",\n skill: \"warlock-trace\",\n },\n\n // ── WL6xxx database ──────────────────────────────────────────────────────\n WL6001: {\n code: \"WL6001\",\n area: \"database\",\n category: \"code\",\n title: \"A seeder depends on a seeder that is not registered\",\n fix: \"Fix the dependsOn name, or register the missing seeder.\",\n skill: \"write-seeder\",\n errorNames: [\"UnknownSeederDependencyError\"],\n },\n WL6002: {\n code: \"WL6002\",\n area: \"database\",\n category: \"code\",\n title: \"Seeder dependencies form a cycle\",\n fix: \"Remove one dependsOn edge from the cycle printed in the message.\",\n skill: \"write-seeder\",\n errorNames: [\"SeederDependencyCycleError\"],\n },\n\n // ── WL7xxx cli and checked code ──────────────────────────────────────────\n WL7001: {\n code: \"WL7001\",\n area: \"cli\",\n category: \"code\",\n title: \"A boolean CLI option received a value it cannot read\",\n fix: \"Pass true/false/1/0/yes/no, or the flag on its own for true.\",\n skill: \"write-cli-command\",\n errorNames: [\"CliOptionValueError\"],\n },\n WL7002: {\n code: \"WL7002\",\n area: \"cli\",\n category: \"code\",\n title: \"Generated code imports a package the app does not declare\",\n fix: \"Add the named package to the app's dependencies, or import it through @warlock.js/core.\",\n skill: \"run-app\",\n errorNames: [\"UndeclaredGeneratedImportError\"],\n },\n WL7003: {\n code: \"WL7003\",\n area: \"cli\",\n category: \"code\",\n title: \"A command needs an optional package that is not installed\",\n fix: \"Install the packages named in the message as dev dependencies (warlock mcp needs @warlock.js/ai-tools and @warlock.js/ai).\",\n skill: \"warlock-mcp\",\n },\n WL7004: {\n code: \"WL7004\",\n area: \"cli\",\n category: \"code\",\n title: \"warlock mcp was asked to listen off loopback without a token\",\n fix: \"Pass --token (or set WARLOCK_MCP_TOKEN) when --host is not 127.0.0.1, ::1 or localhost, or keep the default loopback host.\",\n skill: \"warlock-mcp\",\n },\n WL7005: {\n code: \"WL7005\",\n area: \"cli\",\n category: \"code\",\n title: \"An MCP tool that writes files was called on a read-only server\",\n fix: \"Restart the server with --allow-writes to let generate tools write; without it they only return the diff.\",\n skill: \"warlock-mcp\",\n },\n WL7101: {\n code: \"WL7101\",\n area: \"cli\",\n category: \"code\",\n title: \"TypeScript reports a type error\",\n fix: \"Fix the type error at the reported position; the TypeScript code (TS1234) is in `rule`.\",\n skill: \"warlock-check\",\n },\n WL7102: {\n code: \"WL7102\",\n area: \"cli\",\n category: \"code\",\n title: \"tsconfig.json is missing or invalid\",\n fix: \"Fix tsconfig.json at the project root; the message names the problem.\",\n skill: \"warlock-check\",\n },\n WL7201: {\n code: \"WL7201\",\n area: \"cli\",\n category: \"code\",\n title: \"The linter reports an error\",\n fix: \"Fix the lint error at the reported position; the rule id is in `rule`.\",\n skill: \"warlock-check\",\n },\n WL7202: {\n code: \"WL7202\",\n area: \"cli\",\n category: \"code\",\n title: \"The linter reports a warning\",\n fix: \"Fix the warning, or change the rule's severity in the lint config if it does not apply.\",\n skill: \"warlock-check\",\n },\n WL7301: {\n code: \"WL7301\",\n area: \"cli\",\n category: \"code\",\n title: \"A test failed\",\n fix: \"Run the test file alone, read the assertion message and fix the code or the test.\",\n skill: \"warlock-check\",\n },\n WL7302: {\n code: \"WL7302\",\n area: \"cli\",\n category: \"code\",\n title: \"A test file failed before its tests ran\",\n fix: \"Fix the import or setup error named in the message; none of the file's tests ran.\",\n skill: \"warlock-check\",\n },\n WL7401: {\n code: \"WL7401\",\n area: \"cli\",\n category: \"code\",\n title: \"The agent board is not initialized\",\n fix: \"Run `warlock board init` at the project root first.\",\n skill: \"warlock-board\",\n },\n WL7402: {\n code: \"WL7402\",\n area: \"cli\",\n category: \"code\",\n title: \"A board item does not exist\",\n fix: \"Run `warlock board status` to list the item ids.\",\n skill: \"warlock-board\",\n },\n WL7403: {\n code: \"WL7403\",\n area: \"cli\",\n category: \"code\",\n title: \"A board item cannot move to the requested state\",\n fix: \"Use one of the next states listed in the message; `warlock board status <id>` shows the item's current state.\",\n skill: \"warlock-board\",\n },\n WL7404: {\n code: \"WL7404\",\n area: \"cli\",\n category: \"code\",\n title: \"No board message arrived before the watch timed out\",\n fix: \"Run `warlock board watch` again, or raise --timeout.\",\n skill: \"warlock-board\",\n },\n WL7501: {\n code: \"WL7501\",\n area: \"cli\",\n category: \"code\",\n title: \"AGENTS.md has malformed generated-section markers\",\n fix: \"Keep one `<!-- warlock:generated:start -->` line followed by one `<!-- warlock:generated:end -->` line, or remove both.\",\n skill: \"warlock-agents-md\",\n },\n\n // ── WL8xxx environment ───────────────────────────────────────────────────\n WL8001: {\n code: \"WL8001\",\n area: \"environment\",\n category: \"environment\",\n title: \"The Node.js version is not supported\",\n fix: \"Switch to a Node.js version that satisfies the engines range in the message (for example with nvm).\",\n skill: \"update-packages\",\n },\n WL8002: {\n code: \"WL8002\",\n area: \"environment\",\n category: \"environment\",\n title: \"A tool the project is configured to use is not installed\",\n fix: \"Install the tool named in the message (pnpm install), or remove its config file.\",\n skill: \"warlock-check\",\n },\n WL8003: {\n code: \"WL8003\",\n area: \"environment\",\n category: \"environment\",\n title: \"A service the code needs is unreachable\",\n fix: \"Start the service named in the message (database, Redis, ...) or point the config at a running one.\",\n skill: \"warlock-check\",\n },\n WL8004: {\n code: \"WL8004\",\n area: \"environment\",\n category: \"environment\",\n title: \"A port is already in use\",\n fix: \"Stop whatever listens on the port, or use another port (port 0 in tests).\",\n skill: \"run-app\",\n errorNames: [\"PortInUseError\"],\n },\n WL8005: {\n code: \"WL8005\",\n area: \"environment\",\n category: \"environment\",\n title: \"esbuild's native binary is not installed\",\n fix: \"Run `pnpm approve-builds`, then reinstall dependencies without skipping install scripts.\",\n skill: \"run-app\",\n errorNames: [\"EsbuildBinaryMissingError\"],\n },\n WL8006: {\n code: \"WL8006\",\n area: \"environment\",\n category: \"environment\",\n title: \"Git cannot list the changed files\",\n fix: \"Run inside a git repository with git on PATH, or run the command without --changed.\",\n skill: \"warlock-check\",\n },\n WL8007: {\n code: \"WL8007\",\n area: \"environment\",\n category: \"environment\",\n title: \"A tool crashed, timed out or ran out of memory\",\n fix: \"Re-run the step; if it repeats, raise the memory limit (NODE_OPTIONS=--max-old-space-size) or use --changed.\",\n skill: \"warlock-check\",\n },\n WL8008: {\n code: \"WL8008\",\n area: \"environment\",\n category: \"environment\",\n title: \"The dev server is not running\",\n fix: \"Start `warlock dev` in this project, or pass --url with the address of a running dev server.\",\n skill: \"warlock-trace\",\n },\n WL8009: {\n code: \"WL8009\",\n area: \"environment\",\n category: \"environment\",\n title: \"Devtools is not running in the dev server\",\n fix: \"Install it with `warlock add devtools` and restart `warlock dev`; devtools answers loopback requests in development only.\",\n skill: \"warlock-trace\",\n },\n\n // ── WL9xxx conventions and hygiene ───────────────────────────────────────\n WL9001: {\n code: \"WL9001\",\n area: \"convention\",\n category: \"code\",\n title: \"An auto-loaded file is imported\",\n fix: \"Remove the import: routes.ts, main.ts, worker.ts and events/ files are loaded by the framework.\",\n skill: \"warlock-conventions\",\n },\n WL9002: {\n code: \"WL9002\",\n area: \"convention\",\n category: \"code\",\n title: \"An import path ends in .js\",\n fix: \"Drop the .js extension from the import path.\",\n skill: \"warlock-conventions\",\n },\n WL9003: {\n code: \"WL9003\",\n area: \"convention\",\n category: \"code\",\n title: \"A relative import reaches into another module\",\n fix: \"Import across modules through the app/<module>/... alias instead of ../../.\",\n skill: \"warlock-conventions\",\n },\n WL9004: {\n code: \"WL9004\",\n area: \"convention\",\n category: \"code\",\n title: \"tsconfig.json enables legacy experimentalDecorators\",\n fix: 'Remove \"experimentalDecorators\": true from tsconfig.json; Cascade uses standard decorators.',\n skill: \"lower-stage3-decorators\",\n },\n WL9005: {\n code: \"WL9005\",\n area: \"convention\",\n category: \"code\",\n title: \"`request.all()` is passed to a query, a service or inApp()\",\n fix: \"Give the route a validation schema and pass `request.validated()`, which holds only the fields the schema accepted (mass assignment otherwise).\",\n skill: \"warlock-conventions\",\n },\n WL9006: {\n code: \"WL9006\",\n area: \"convention\",\n category: \"code\",\n title: \"A mutating route has no auth guard and is not marked public\",\n fix: \"Register the POST/PUT/PATCH/DELETE route inside `guarded()` (or with auth middleware), or pass `{ public: true }` if it is meant to be open.\",\n skill: \"warlock-conventions\",\n },\n WL9007: {\n code: \"WL9007\",\n area: \"convention\",\n category: \"code\",\n title: \"A redirect or link target comes from request input\",\n fix: \"Wrap the target in `safeRedirect()` (server, @warlock.js/core) or `safeRedirectTarget()` (pages, @warlock.js/web), or check it with `isSafeRedirect()` first.\",\n skill: \"warlock-conventions\",\n },\n WL9008: {\n code: \"WL9008\",\n area: \"convention\",\n category: \"code\",\n title: \"A raw email, credential or request body is logged\",\n fix: \"Pass the value through `maskEmail()`, `redact()`, `escapeLogValue()` or `request.toLogSnapshot()`, or log it under a key the logger censors (`token`, `password`, ...).\",\n skill: \"warlock-conventions\",\n },\n WL9009: {\n code: \"WL9009\",\n area: \"convention\",\n category: \"code\",\n title: \"A regex with an unbounded quantifier runs on request input\",\n fix: \"Bound the repetition (`{1,256}` instead of `+` or `*`) or cap the input length before matching.\",\n skill: \"warlock-conventions\",\n },\n WL9010: {\n code: \"WL9010\",\n area: \"convention\",\n category: \"code\",\n title: \"`await` on a synchronous log call\",\n fix: \"Remove the `await`: `log.info()` and its siblings return the logger; `await log.flush()` waits for delivery.\",\n skill: \"warlock-conventions\",\n },\n WL9011: {\n code: \"WL9011\",\n area: \"convention\",\n category: \"code\",\n title: \"A file defines more than one controller\",\n fix: \"Move each extra controller into its own `<name>.controller.ts` file.\",\n skill: \"warlock-conventions\",\n },\n WL9012: {\n code: \"WL9012\",\n area: \"convention\",\n category: \"code\",\n title: \"A tagged union uses `kind` as its discriminator\",\n fix: \"Rename the discriminator to `type` and update the code that narrows on it.\",\n skill: \"warlock-conventions\",\n },\n WL9101: {\n code: \"WL9101\",\n area: \"convention\",\n category: \"code\",\n title: \"A module still uses the deprecated utils/locales.ts\",\n fix: \"Run `warlock doctor --fix` to convert it to locales.json, or convert it by hand.\",\n skill: \"use-localization\",\n },\n WL9102: {\n code: \"WL9102\",\n area: \"convention\",\n category: \"code\",\n title: \"package.json version and CHANGELOG.md disagree\",\n fix: \"Add a CHANGELOG.md heading for the package.json version, or fix the version.\",\n skill: \"warlock-doctor\",\n },\n WL9103: {\n code: \"WL9103\",\n area: \"convention\",\n category: \"code\",\n title: \"CHANGELOG.md is missing or has no version heading\",\n fix: \"Add a CHANGELOG.md with a `## x.y.z` heading for the current version.\",\n skill: \"warlock-doctor\",\n },\n} as const satisfies Record<string, ErrorCodeDefinition>;\n\n/** Every registered code, as a union. */\nexport type WarlockErrorCode = keyof typeof ERROR_CODES;\n\n/** Whether `value` is a registered code. */\nexport function isWarlockErrorCode(value: unknown): value is WarlockErrorCode {\n return typeof value === \"string\" && Object.prototype.hasOwnProperty.call(ERROR_CODES, value);\n}\n\n/**\n * The registry entry for a code, or `undefined` for an unknown one. Case and\n * surrounding whitespace are ignored, so `explainErrorCode(\" wl3001 \")` works.\n */\nexport function explainErrorCode(code: string): ErrorCodeDefinition | undefined {\n const normalized = code.trim().toUpperCase();\n\n return isWarlockErrorCode(normalized) ? ERROR_CODES[normalized] : undefined;\n}\n\n/** The docs URL of a code: the reference page with the code as its anchor. */\nexport function errorCodeDocsUrl(code: WarlockErrorCode): string {\n return `${ERROR_CODES_DOCS_URL}#${code.toLowerCase()}`;\n}\n\n/** Node errno codes that mean \"the machine\", mapped to the Warlock code. */\nconst SYSTEM_ERROR_CODES: Readonly<Record<string, WarlockErrorCode>> = {\n ECONNREFUSED: \"WL8003\",\n ENOTFOUND: \"WL8003\",\n EHOSTUNREACH: \"WL8003\",\n ETIMEDOUT: \"WL8003\",\n EADDRINUSE: \"WL8004\",\n ERR_OUT_OF_MEMORY: \"WL8007\",\n};\n\nfunction readStringProperty(value: object, key: string): string | undefined {\n const property = Reflect.get(value, key);\n\n return typeof property === \"string\" ? property : undefined;\n}\n\n/**\n * The Warlock code of a thrown value, or `undefined` when it has none.\n *\n * Reads, in order: a registered `code` property (framework errors carry one);\n * the error's `name`, for classes whose `code` property already means\n * something else (`PortInUseError.code` is Node's `\"EADDRINUSE\"`); a Node\n * system errno such as `ECONNREFUSED`; then the same checks on `cause`. Reading\n * by name rather than `instanceof` keeps the answer right when two copies of\n * core are loaded.\n */\nexport function errorCodeOf(error: unknown): WarlockErrorCode | undefined {\n const seen = new Set<unknown>();\n let current: unknown = error;\n\n while (typeof current === \"object\" && current !== null && !seen.has(current)) {\n seen.add(current);\n\n const code = readStringProperty(current, \"code\");\n\n if (isWarlockErrorCode(code)) {\n return code;\n }\n\n const name = readStringProperty(current, \"name\");\n\n if (name) {\n for (const definition of Object.values(ERROR_CODES) as ErrorCodeDefinition[]) {\n if (definition.errorNames?.includes(name) && isWarlockErrorCode(definition.code)) {\n return definition.code;\n }\n }\n }\n\n if (code && SYSTEM_ERROR_CODES[code]) {\n return SYSTEM_ERROR_CODES[code];\n }\n\n current = Reflect.get(current, \"cause\");\n }\n\n return undefined;\n}\n"],"mappings":";;AA0EA,MAAa,uBAAuB;;AAGpC,MAAa,cAAc;CAEzB,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;EACP,YAAY,CAAC,iCAAiC;CAChD;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;EACP,YAAY,CAAC,0BAA0B;CACzC;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,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AAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;EACP,YAAY,CAAC,gCAAgC;CAC/C;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;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AAmB,OAAe,KAAiC;CAC1E,MAAM,WAAW,QAAQ,IAAI,OAAO,GAAG;CAEvC,OAAO,OAAO,aAAa,WAAW,WAAW;AACnD;;;;;;;;;;;AAYA,SAAgB,YAAY,OAA8C;CACxE,MAAM,uBAAO,IAAI,IAAa;CAC9B,IAAI,UAAmB;CAEvB,OAAO,OAAO,YAAY,YAAY,YAAY,QAAQ,CAAC,KAAK,IAAI,OAAO,GAAG;EAC5E,KAAK,IAAI,OAAO;EAEhB,MAAM,OAAO,mBAAmB,SAAS,MAAM;EAE/C,IAAI,mBAAmB,IAAI,GACzB,OAAO;EAGT,MAAM,OAAO,mBAAmB,SAAS,MAAM;EAE/C,IAAI,MACF;QAAK,MAAM,cAAc,OAAO,OAAO,WAAW,GAChD,IAAI,WAAW,YAAY,SAAS,IAAI,KAAK,mBAAmB,WAAW,IAAI,GAC7E,OAAO,WAAW;EAEtB;EAGF,IAAI,QAAQ,mBAAmB,OAC7B,OAAO,mBAAmB;EAG5B,UAAU,QAAQ,IAAI,SAAS,OAAO;CACxC;AAGF"}
1
+ {"version":3,"file":"error-codes.mjs","names":[],"sources":["../../../../../../../../packages/core/src/errors/error-codes.ts"],"sourcesContent":["/**\n * The registry of stable Warlock error codes.\n *\n * Every framework error core throws, every `warlock doctor` finding and every\n * `warlock check` problem carries one of these codes, so a person or an agent\n * can look the code up instead of interpreting the message. `warlock explain\n * <CODE>` prints an entry; the docs page `cli/error-codes` lists all of them.\n *\n * THE SCHEME: `WL` followed by four digits. The first digit is the area:\n *\n * | Range | Area | Meaning |\n * | ------ | ----------- | ---------------------------------------------------- |\n * | WL1xxx | config | a configuration value is missing or invalid |\n * | WL2xxx | boot | the app could not boot: modules, connectors, services |\n * | WL3xxx | routing | route registration and lookup |\n * | WL4xxx | validation | request validation schemas |\n * | WL5xxx | http | the HTTP layer at runtime |\n * | WL6xxx | database | migrations, seeders and database code |\n * | WL7xxx | cli | CLI usage, and problems `warlock check` finds in code |\n * | WL8xxx | environment | this machine: Node, tools, services, ports |\n * | WL9xxx | convention | framework conventions and release hygiene |\n *\n * STABILITY: a code, once released, keeps its meaning forever. Its `title`,\n * `fix` and links may be reworded; a code is never reused for a different\n * problem and never renumbered. A retired code stays in this table with\n * `retired: true`.\n *\n * `category` splits \"your code\" from \"this machine\": `environment` problems are\n * the ones `warlock check` reports with exit code 2, so an agent stops editing\n * code to fix a missing Redis server.\n *\n * This module is part of the side-effect-free `@warlock.js/core/errors` entry:\n * it imports nothing.\n */\n\n/** The area a code belongs to, matching its first digit. */\nexport type ErrorCodeArea =\n | \"config\"\n | \"boot\"\n | \"routing\"\n | \"validation\"\n | \"http\"\n | \"database\"\n | \"cli\"\n | \"environment\"\n | \"convention\";\n\n/**\n * Who has to act: `code` problems are fixed in the project's source or config,\n * `environment` problems on the machine running it.\n */\nexport type ErrorCodeCategory = \"code\" | \"environment\";\n\n/** One registry entry. */\nexport type ErrorCodeDefinition = {\n /** The stable code, e.g. `\"WL3001\"`. */\n readonly code: string;\n /** The area, matching the first digit. */\n readonly area: ErrorCodeArea;\n /** Whether the project or the machine has to change. */\n readonly category: ErrorCodeCategory;\n /** One-line name of the problem. */\n readonly title: string;\n /** One-line \"what to do\". */\n readonly fix: string;\n /** Slug of the skill that explains the fix (`packages/<pkg>/skills/<slug>/SKILL.md`). */\n readonly skill: string;\n /** Names of the error classes that carry this code, when an error class does. */\n readonly errorNames?: readonly string[];\n /** Set when the code is no longer emitted. Retired codes are never reused. */\n readonly retired?: true;\n};\n\n/** Base URL of the error-code reference; each code is an anchor on that page. */\nexport const ERROR_CODES_DOCS_URL = \"https://warlock.js.org/v/latest/core/cli/error-codes/\";\n\n/** The registry, keyed by code. */\nexport const ERROR_CODES = {\n // ── WL1xxx config ────────────────────────────────────────────────────────\n WL1001: {\n code: \"WL1001\",\n area: \"config\",\n category: \"code\",\n title: \"A required config section is missing\",\n fix: \"Add the missing file under src/config/ (for example src/config/app.ts) exporting the section.\",\n skill: \"configure-app\",\n },\n WL1002: {\n code: \"WL1002\",\n area: \"config\",\n category: \"code\",\n title: \"No JWT signing secret is configured\",\n fix: \"Run `warlock jwt.generate` (writes JWT_SECRET to .env) and read it as auth.accessToken.secret in src/config/auth.ts.\",\n skill: \"configure-app\",\n },\n WL1003: {\n code: \"WL1003\",\n area: \"config\",\n category: \"code\",\n title: \"The rate-limit store cannot use the configured cache driver\",\n fix: 'Use a redis, pg or memory cache driver for http.rateLimit store \"cache\", or set store: \"memory\".',\n skill: \"configure-app\",\n errorNames: [\"UnsupportedRateLimitDriverError\"],\n },\n WL1004: {\n code: \"WL1004\",\n area: \"config\",\n category: \"code\",\n title: \"An http.csp directive value is invalid\",\n fix: \"Fix the directive value named in the message in your http config; quotes must balance and values may not contain ';'.\",\n skill: \"configure-app\",\n errorNames: [\"InvalidCspDirectiveError\"],\n },\n WL1005: {\n code: \"WL1005\",\n area: \"config\",\n category: \"code\",\n title: \"The uploads.images configuration is invalid\",\n fix: \"Correct the uploads.images variant settings named in the message.\",\n skill: \"upload-file\",\n errorNames: [\"ImageVariantsConfigError\"],\n },\n WL1006: {\n code: \"WL1006\",\n area: \"config\",\n category: \"code\",\n title: \"warlock.config.ts sets a build option the builder refuses\",\n fix: \"Remove the named option from the build block of warlock.config.ts; change tsconfig.json instead.\",\n skill: \"run-app\",\n errorNames: [\"ForbiddenBuildOptionError\"],\n },\n WL1007: {\n code: \"WL1007\",\n area: \"config\",\n category: \"code\",\n title: \"A locale dictionary file cannot be parsed\",\n fix: \"Fix the key named in the message in the locales.json file it names.\",\n skill: \"use-localization\",\n errorNames: [\"LocaleDictionaryError\"],\n },\n WL1008: {\n code: \"WL1008\",\n area: \"config\",\n category: \"code\",\n title: \"A locale outside app.localeCodes was requested\",\n fix: \"Add the locale to app.localeCodes in src/config/app.ts, or pass a configured locale.\",\n skill: \"use-localization\",\n errorNames: [\"UnknownLocaleError\"],\n },\n WL1009: {\n code: \"WL1009\",\n area: \"config\",\n category: \"code\",\n title: \"warlock.config.ts > connectors was refused\",\n fix: \"Give every connector in warlock.config.ts a unique name that is not a built-in connector name.\",\n skill: \"add-connector\",\n },\n\n // ── WL2xxx boot ──────────────────────────────────────────────────────────\n WL2001: {\n code: \"WL2001\",\n area: \"boot\",\n category: \"code\",\n title: \"An app module failed to load\",\n fix: \"Open the file named in the message and fix the error it throws on import; its routes and listeners are missing until then.\",\n skill: \"warlock-doctor\",\n errorNames: [\"ModuleLoadError\"],\n },\n WL2002: {\n code: \"WL2002\",\n area: \"boot\",\n category: \"code\",\n title: \"The app's source files could not be discovered\",\n fix: \"Run the command from the project root and check that src/ exists and is readable.\",\n skill: \"warlock-doctor\",\n },\n WL2003: {\n code: \"WL2003\",\n area: \"boot\",\n category: \"code\",\n title: \"A connector failed to boot\",\n fix: \"Read the connector's message; it usually names the config value or package it needs.\",\n skill: \"add-connector\",\n },\n WL2004: {\n code: \"WL2004\",\n area: \"boot\",\n category: \"code\",\n title: \"A container key was read before it was registered\",\n fix: \"Register the key (container.set) before reading it, or read it after the connector that sets it has booted.\",\n skill: \"use-app-context\",\n errorNames: [\"ContainerKeyMissingError\"],\n },\n WL2005: {\n code: \"WL2005\",\n area: \"boot\",\n category: \"code\",\n title: \"A boot precondition failed\",\n fix: \"Fix the condition named in the message; restarting does not help until it changes.\",\n skill: \"run-app\",\n errorNames: [\"BootPreconditionError\"],\n },\n WL2006: {\n code: \"WL2006\",\n area: \"boot\",\n category: \"code\",\n title: \"Storage was used before the storage connector ran\",\n fix: 'Add src/config/storage.ts; in a custom command add \"storage\" to preload.connectors.',\n skill: \"store-file\",\n errorNames: [\"StorageNotInitializedError\"],\n },\n WL2007: {\n code: \"WL2007\",\n area: \"boot\",\n category: \"code\",\n title: \"A configured driver's package is not installed\",\n fix: \"Install the package named in the message (for example `pnpm add sharp`), or stop configuring the driver.\",\n skill: \"update-packages\",\n },\n\n // ── WL3xxx routing ───────────────────────────────────────────────────────\n WL3001: {\n code: \"WL3001\",\n area: \"routing\",\n category: \"code\",\n title: \"A route name is already taken\",\n fix: 'Rename one of the two routes with the \"name\" route option; pages and API routes share one namespace.',\n skill: \"register-route\",\n errorNames: [\"RouteNameTakenError\"],\n },\n WL3002: {\n code: \"WL3002\",\n area: \"routing\",\n category: \"code\",\n title: \"A route points at a controller method that does not exist\",\n fix: \"Fix the [controller, action] pair: the action must be a method on the controller.\",\n skill: \"register-route\",\n },\n WL3003: {\n code: \"WL3003\",\n area: \"routing\",\n category: \"code\",\n title: \"A URL was built for a route name that is not registered\",\n fix: \"Check the name passed to router.route(); `warlock routes --name <part>` lists the registered names.\",\n skill: \"warlock-routes\",\n },\n WL3004: {\n code: \"WL3004\",\n area: \"routing\",\n category: \"code\",\n title: \"A URL was built without one of the route's path parameters\",\n fix: \"Pass every :param of the route path when building the URL.\",\n skill: \"warlock-routes\",\n },\n WL3005: {\n code: \"WL3005\",\n area: \"routing\",\n category: \"code\",\n title: \"Route modules loaded but registered no routes\",\n fix: \"Make sure routes.ts calls router.get/post/... at module level and is not wrapped in an unused function.\",\n skill: \"register-route\",\n },\n WL3006: {\n code: \"WL3006\",\n area: \"routing\",\n category: \"code\",\n title: \"A handler uses the v4 (request, response) signature\",\n fix: \"Rewrite the handler as async ({ request, response }) => { ... }.\",\n skill: \"create-controller\",\n },\n\n // ── WL4xxx validation ────────────────────────────────────────────────────\n WL4001: {\n code: \"WL4001\",\n area: \"validation\",\n category: \"code\",\n title: \"A validation schema cannot be described as JSON Schema\",\n fix: \"Use Seal validators with a static shape for validation.schema/params; custom validate middleware is not described.\",\n skill: \"validate-input\",\n },\n\n // ── WL5xxx http ──────────────────────────────────────────────────────────\n WL5001: {\n code: \"WL5001\",\n area: \"http\",\n category: \"code\",\n title: \"A cookie was read but the cookie plugin is not registered\",\n fix: \"Register @fastify/cookie on the server before reading cookies by name.\",\n skill: \"send-response\",\n errorNames: [\"CookieJarUnavailableError\"],\n },\n WL5002: {\n code: \"WL5002\",\n area: \"http\",\n category: \"code\",\n title: \"An app route claims a health-probe path\",\n fix: \"Move the app route, or rename the probe with http.health.path / http.health.readinessPath.\",\n skill: \"health-checks\",\n },\n WL5003: {\n code: \"WL5003\",\n area: \"http\",\n category: \"code\",\n title: \"Health probes are enabled but not registered\",\n fix: \"Check that the http connector booted and that nothing removed the probe routes.\",\n skill: \"health-checks\",\n },\n WL5004: {\n code: \"WL5004\",\n area: \"http\",\n category: \"code\",\n title: \"Devtools recorded no timeline for the traced request\",\n fix: \"Keep http.requestId enabled (its echoed header is how the request is found) and retry; a path under the devtools prefix is never recorded.\",\n skill: \"warlock-trace\",\n },\n\n // ── WL6xxx database ──────────────────────────────────────────────────────\n WL6001: {\n code: \"WL6001\",\n area: \"database\",\n category: \"code\",\n title: \"A seeder depends on a seeder that is not registered\",\n fix: \"Fix the dependsOn name, or register the missing seeder.\",\n skill: \"write-seeder\",\n errorNames: [\"UnknownSeederDependencyError\"],\n },\n WL6002: {\n code: \"WL6002\",\n area: \"database\",\n category: \"code\",\n title: \"Seeder dependencies form a cycle\",\n fix: \"Remove one dependsOn edge from the cycle printed in the message.\",\n skill: \"write-seeder\",\n errorNames: [\"SeederDependencyCycleError\"],\n },\n\n // ── WL7xxx cli and checked code ──────────────────────────────────────────\n WL7001: {\n code: \"WL7001\",\n area: \"cli\",\n category: \"code\",\n title: \"A boolean CLI option received a value it cannot read\",\n fix: \"Pass true/false/1/0/yes/no, or the flag on its own for true.\",\n skill: \"write-cli-command\",\n errorNames: [\"CliOptionValueError\"],\n },\n WL7002: {\n code: \"WL7002\",\n area: \"cli\",\n category: \"code\",\n title: \"Generated code imports a package the app does not declare\",\n fix: \"Add the named package to the app's dependencies, or import it through @warlock.js/core.\",\n skill: \"run-app\",\n errorNames: [\"UndeclaredGeneratedImportError\"],\n },\n WL7003: {\n code: \"WL7003\",\n area: \"cli\",\n category: \"code\",\n title: \"A command needs an optional package that is not installed\",\n fix: \"Install the packages named in the message as dev dependencies (warlock mcp needs @warlock.js/ai-tools and @warlock.js/ai).\",\n skill: \"warlock-mcp\",\n },\n WL7004: {\n code: \"WL7004\",\n area: \"cli\",\n category: \"code\",\n title: \"warlock mcp was asked to listen off loopback without a token\",\n fix: \"Pass --token (or set WARLOCK_MCP_TOKEN) when --host is not 127.0.0.1, ::1 or localhost, or keep the default loopback host.\",\n skill: \"warlock-mcp\",\n },\n WL7005: {\n code: \"WL7005\",\n area: \"cli\",\n category: \"code\",\n title: \"An MCP tool that writes files was called on a read-only server\",\n fix: \"Restart the server with --allow-writes to let generate tools write; without it they only return the diff.\",\n skill: \"warlock-mcp\",\n },\n WL7101: {\n code: \"WL7101\",\n area: \"cli\",\n category: \"code\",\n title: \"TypeScript reports a type error\",\n fix: \"Fix the type error at the reported position; the TypeScript code (TS1234) is in `rule`.\",\n skill: \"warlock-check\",\n },\n WL7102: {\n code: \"WL7102\",\n area: \"cli\",\n category: \"code\",\n title: \"tsconfig.json is missing or invalid\",\n fix: \"Fix tsconfig.json at the project root; the message names the problem.\",\n skill: \"warlock-check\",\n },\n WL7201: {\n code: \"WL7201\",\n area: \"cli\",\n category: \"code\",\n title: \"The linter reports an error\",\n fix: \"Fix the lint error at the reported position; the rule id is in `rule`.\",\n skill: \"warlock-check\",\n },\n WL7202: {\n code: \"WL7202\",\n area: \"cli\",\n category: \"code\",\n title: \"The linter reports a warning\",\n fix: \"Fix the warning, or change the rule's severity in the lint config if it does not apply.\",\n skill: \"warlock-check\",\n },\n WL7301: {\n code: \"WL7301\",\n area: \"cli\",\n category: \"code\",\n title: \"A test failed\",\n fix: \"Run the test file alone, read the assertion message and fix the code or the test.\",\n skill: \"warlock-check\",\n },\n WL7302: {\n code: \"WL7302\",\n area: \"cli\",\n category: \"code\",\n title: \"A test file failed before its tests ran\",\n fix: \"Fix the import or setup error named in the message; none of the file's tests ran.\",\n skill: \"warlock-check\",\n },\n WL7401: {\n code: \"WL7401\",\n area: \"cli\",\n category: \"code\",\n title: \"The agent board is not initialized\",\n fix: \"Run `warlock board init` at the project root first.\",\n skill: \"warlock-board\",\n },\n WL7402: {\n code: \"WL7402\",\n area: \"cli\",\n category: \"code\",\n title: \"A board item does not exist\",\n fix: \"Run `warlock board status` to list the item ids.\",\n skill: \"warlock-board\",\n },\n WL7403: {\n code: \"WL7403\",\n area: \"cli\",\n category: \"code\",\n title: \"A board item cannot move to the requested state\",\n fix: \"Use one of the next states listed in the message; `warlock board status <id>` shows the item's current state.\",\n skill: \"warlock-board\",\n },\n WL7404: {\n code: \"WL7404\",\n area: \"cli\",\n category: \"code\",\n title: \"No board message arrived before the watch timed out\",\n fix: \"Run `warlock board watch` again, or raise --timeout.\",\n skill: \"warlock-board\",\n },\n WL7501: {\n code: \"WL7501\",\n area: \"cli\",\n category: \"code\",\n title: \"AGENTS.md has malformed generated-section markers\",\n fix: \"Keep one `<!-- warlock:generated:start -->` line followed by one `<!-- warlock:generated:end -->` line, or remove both.\",\n skill: \"warlock-agents-md\",\n },\n\n // ── WL8xxx environment ───────────────────────────────────────────────────\n WL8001: {\n code: \"WL8001\",\n area: \"environment\",\n category: \"environment\",\n title: \"The Node.js version is not supported\",\n fix: \"Switch to a Node.js version that satisfies the engines range in the message (for example with nvm).\",\n skill: \"update-packages\",\n },\n WL8002: {\n code: \"WL8002\",\n area: \"environment\",\n category: \"environment\",\n title: \"A tool the project is configured to use is not installed\",\n fix: \"Install the tool named in the message (pnpm install), or remove its config file.\",\n skill: \"warlock-check\",\n },\n WL8003: {\n code: \"WL8003\",\n area: \"environment\",\n category: \"environment\",\n title: \"A service the code needs is unreachable\",\n fix: \"Start the service named in the message (database, Redis, ...) or point the config at a running one.\",\n skill: \"warlock-check\",\n },\n WL8004: {\n code: \"WL8004\",\n area: \"environment\",\n category: \"environment\",\n title: \"A port is already in use\",\n fix: \"Stop whatever listens on the port, or use another port (port 0 in tests).\",\n skill: \"run-app\",\n errorNames: [\"PortInUseError\"],\n },\n WL8005: {\n code: \"WL8005\",\n area: \"environment\",\n category: \"environment\",\n title: \"esbuild's native binary is not installed\",\n fix: \"Run `pnpm approve-builds`, then reinstall dependencies without skipping install scripts.\",\n skill: \"run-app\",\n errorNames: [\"EsbuildBinaryMissingError\"],\n },\n WL8006: {\n code: \"WL8006\",\n area: \"environment\",\n category: \"environment\",\n title: \"Git cannot list the changed files\",\n fix: \"Run inside a git repository with git on PATH, or run the command without --changed.\",\n skill: \"warlock-check\",\n },\n WL8007: {\n code: \"WL8007\",\n area: \"environment\",\n category: \"environment\",\n title: \"A tool crashed, timed out or ran out of memory\",\n fix: \"Re-run the step; if it repeats, raise the memory limit (NODE_OPTIONS=--max-old-space-size) or use --changed.\",\n skill: \"warlock-check\",\n },\n WL8008: {\n code: \"WL8008\",\n area: \"environment\",\n category: \"environment\",\n title: \"The dev server is not running\",\n fix: \"Start `warlock dev` in this project, or pass --url with the address of a running dev server.\",\n skill: \"warlock-trace\",\n },\n WL8009: {\n code: \"WL8009\",\n area: \"environment\",\n category: \"environment\",\n title: \"Devtools is not running in the dev server\",\n fix: \"Install it with `warlock add devtools` and restart `warlock dev`; devtools answers loopback requests in development only.\",\n skill: \"warlock-trace\",\n },\n\n // ── WL9xxx conventions and hygiene ───────────────────────────────────────\n WL9001: {\n code: \"WL9001\",\n area: \"convention\",\n category: \"code\",\n title: \"An auto-loaded file is imported\",\n fix: \"Remove the import: routes.ts, main.ts, worker.ts and events/ files are loaded by the framework.\",\n skill: \"warlock-conventions\",\n },\n WL9002: {\n code: \"WL9002\",\n area: \"convention\",\n category: \"code\",\n title: \"An import path ends in .js\",\n fix: \"Drop the .js extension from the import path.\",\n skill: \"warlock-conventions\",\n },\n WL9003: {\n code: \"WL9003\",\n area: \"convention\",\n category: \"code\",\n title: \"A relative import reaches into another module\",\n fix: \"Import across modules through the app/<module>/... alias instead of ../../.\",\n skill: \"warlock-conventions\",\n },\n WL9004: {\n code: \"WL9004\",\n area: \"convention\",\n category: \"code\",\n title: \"tsconfig.json enables legacy experimentalDecorators\",\n fix: 'Remove \"experimentalDecorators\": true from tsconfig.json; Cascade uses standard decorators.',\n skill: \"lower-stage3-decorators\",\n },\n WL9005: {\n code: \"WL9005\",\n area: \"convention\",\n category: \"code\",\n title: \"`request.all()` is passed to a query, a service or inApp()\",\n fix: \"Give the route a validation schema and pass `request.validated()`, which holds only the fields the schema accepted (mass assignment otherwise).\",\n skill: \"warlock-conventions\",\n },\n WL9006: {\n code: \"WL9006\",\n area: \"convention\",\n category: \"code\",\n title: \"A mutating route has no auth guard and is not marked public\",\n fix: \"Register the POST/PUT/PATCH/DELETE route inside `guarded()` (or with auth middleware), or pass `{ public: true }` if it is meant to be open.\",\n skill: \"warlock-conventions\",\n },\n WL9007: {\n code: \"WL9007\",\n area: \"convention\",\n category: \"code\",\n title: \"A redirect or link target comes from request input\",\n fix: \"Wrap the target in `safeRedirect()` (server, @warlock.js/core) or `safeRedirectTarget()` (pages, @warlock.js/web), or check it with `isSafeRedirect()` first.\",\n skill: \"warlock-conventions\",\n },\n WL9008: {\n code: \"WL9008\",\n area: \"convention\",\n category: \"code\",\n title: \"A raw email, credential or request body is logged\",\n fix: \"Pass the value through `maskEmail()`, `redact()`, `escapeLogValue()` or `request.toLogSnapshot()`, or log it under a key the logger censors (`token`, `password`, ...).\",\n skill: \"warlock-conventions\",\n },\n WL9009: {\n code: \"WL9009\",\n area: \"convention\",\n category: \"code\",\n title: \"A regex with an unbounded quantifier runs on request input\",\n fix: \"Bound the repetition (`{1,256}` instead of `+` or `*`) or cap the input length before matching.\",\n skill: \"warlock-conventions\",\n },\n WL9010: {\n code: \"WL9010\",\n area: \"convention\",\n category: \"code\",\n title: \"`await` on a synchronous log call\",\n fix: \"Remove the `await`: `log.info()` and its siblings return the logger; `await log.flush()` waits for delivery.\",\n skill: \"warlock-conventions\",\n },\n WL9011: {\n code: \"WL9011\",\n area: \"convention\",\n category: \"code\",\n title: \"A file defines more than one controller\",\n fix: \"Move each extra controller into its own `<name>.controller.ts` file.\",\n skill: \"warlock-conventions\",\n },\n WL9012: {\n code: \"WL9012\",\n area: \"convention\",\n category: \"code\",\n title: \"A tagged union uses `kind` as its discriminator\",\n fix: \"Rename the discriminator to `type` and update the code that narrows on it.\",\n skill: \"warlock-conventions\",\n },\n WL9013: {\n code: \"WL9013\",\n area: \"convention\",\n category: \"code\",\n title: \"Component file exceeds the configured line limit\",\n fix: \"Split the component file; the default limit is 150 lines.\",\n skill: \"warlock-check\",\n },\n WL9014: {\n code: \"WL9014\",\n area: \"convention\",\n category: \"code\",\n title: \"A file defines more than one web component\",\n fix: \"Move each component to its own TSX file.\",\n skill: \"warlock-check\",\n },\n WL9015: {\n code: \"WL9015\",\n area: \"convention\",\n category: \"code\",\n title: \"Component state, effects or event handlers live in a component file\",\n fix: \"Move state, effects and event handlers into a use-*.ts hook.\",\n skill: \"warlock-check\",\n },\n WL9016: {\n code: \"WL9016\",\n area: \"convention\",\n category: \"code\",\n title: \"App code uses a native form control\",\n fix: \"Use a design-system control; native controls are allowed in src/web/design-system/.\",\n skill: \"warlock-check\",\n },\n WL9017: {\n code: \"WL9017\",\n area: \"convention\",\n category: \"code\",\n title: \"A DOM form element declares native validation\",\n fix: \"Use the shared validation schema and field error controls.\",\n skill: \"warlock-check\",\n },\n WL9018: {\n code: \"WL9018\",\n area: \"convention\",\n category: \"code\",\n title: \"An exported controller has no response schema\",\n fix: \"Assign controller.responseSchema with a contract for each response status.\",\n skill: \"warlock-check\",\n },\n WL9019: {\n code: \"WL9019\",\n area: \"convention\",\n category: \"code\",\n title: \"A browser route call takes a name that cannot be read statically\",\n fix: 'Pass a string literal (or a template with a static prefix), or declare the names the page uses with `config.apiRoutes` in its setup file (`\"orders.*\"` covers a prefix).',\n skill: \"warlock-check\",\n },\n WL9020: {\n code: \"WL9020\",\n area: \"convention\",\n category: \"code\",\n title: \"Browser code references a named API route that is clientVisible: false\",\n fix: \"Call the endpoint from the server instead, or remove `clientVisible: false` from the route if the browser must reach it.\",\n skill: \"warlock-check\",\n },\n WL9101: {\n code: \"WL9101\",\n area: \"convention\",\n category: \"code\",\n title: \"A module still uses the deprecated utils/locales.ts\",\n fix: \"Run `warlock doctor --fix` to convert it to locales.json, or convert it by hand.\",\n skill: \"use-localization\",\n },\n WL9102: {\n code: \"WL9102\",\n area: \"convention\",\n category: \"code\",\n title: \"package.json version and CHANGELOG.md disagree\",\n fix: \"Add a CHANGELOG.md heading for the package.json version, or fix the version.\",\n skill: \"warlock-doctor\",\n },\n WL9103: {\n code: \"WL9103\",\n area: \"convention\",\n category: \"code\",\n title: \"CHANGELOG.md is missing or has no version heading\",\n fix: \"Add a CHANGELOG.md with a `## x.y.z` heading for the current version.\",\n skill: \"warlock-doctor\",\n },\n WL9104: {\n code: \"WL9104\",\n area: \"convention\",\n category: \"code\",\n title: \"Translation key is computed at runtime, so the page cannot ship only the keys it uses\",\n fix: 'Declare the keys or prefixes the page renders in its setup file, for example `export const config = { translations: [\"statuses.*\", \"members.title\"] }`. Until then the page ships every translation group.',\n skill: \"use-localization\",\n },\n} as const satisfies Record<string, ErrorCodeDefinition>;\n\n/** Every registered code, as a union. */\nexport type WarlockErrorCode = keyof typeof ERROR_CODES;\n\n/** Whether `value` is a registered code. */\nexport function isWarlockErrorCode(value: unknown): value is WarlockErrorCode {\n return typeof value === \"string\" && Object.prototype.hasOwnProperty.call(ERROR_CODES, value);\n}\n\n/**\n * The registry entry for a code, or `undefined` for an unknown one. Case and\n * surrounding whitespace are ignored, so `explainErrorCode(\" wl3001 \")` works.\n */\nexport function explainErrorCode(code: string): ErrorCodeDefinition | undefined {\n const normalized = code.trim().toUpperCase();\n\n return isWarlockErrorCode(normalized) ? ERROR_CODES[normalized] : undefined;\n}\n\n/** The docs URL of a code: the reference page with the code as its anchor. */\nexport function errorCodeDocsUrl(code: WarlockErrorCode): string {\n return `${ERROR_CODES_DOCS_URL}#${code.toLowerCase()}`;\n}\n\n/** Node errno codes that mean \"the machine\", mapped to the Warlock code. */\nconst SYSTEM_ERROR_CODES: Readonly<Record<string, WarlockErrorCode>> = {\n ECONNREFUSED: \"WL8003\",\n ENOTFOUND: \"WL8003\",\n EHOSTUNREACH: \"WL8003\",\n ETIMEDOUT: \"WL8003\",\n EADDRINUSE: \"WL8004\",\n ERR_OUT_OF_MEMORY: \"WL8007\",\n};\n\nfunction readStringProperty(value: object, key: string): string | undefined {\n const property = Reflect.get(value, key);\n\n return typeof property === \"string\" ? property : undefined;\n}\n\n/**\n * The Warlock code of a thrown value, or `undefined` when it has none.\n *\n * Reads, in order: a registered `code` property (framework errors carry one);\n * the error's `name`, for classes whose `code` property already means\n * something else (`PortInUseError.code` is Node's `\"EADDRINUSE\"`); a Node\n * system errno such as `ECONNREFUSED`; then the same checks on `cause`. Reading\n * by name rather than `instanceof` keeps the answer right when two copies of\n * core are loaded.\n */\nexport function errorCodeOf(error: unknown): WarlockErrorCode | undefined {\n const seen = new Set<unknown>();\n let current: unknown = error;\n\n while (typeof current === \"object\" && current !== null && !seen.has(current)) {\n seen.add(current);\n\n const code = readStringProperty(current, \"code\");\n\n if (isWarlockErrorCode(code)) {\n return code;\n }\n\n const name = readStringProperty(current, \"name\");\n\n if (name) {\n for (const definition of Object.values(ERROR_CODES) as ErrorCodeDefinition[]) {\n if (definition.errorNames?.includes(name) && isWarlockErrorCode(definition.code)) {\n return definition.code;\n }\n }\n }\n\n if (code && SYSTEM_ERROR_CODES[code]) {\n return SYSTEM_ERROR_CODES[code];\n }\n\n current = Reflect.get(current, \"cause\");\n }\n\n return undefined;\n}\n"],"mappings":";;AA0EA,MAAa,uBAAuB;;AAGpC,MAAa,cAAc;CAEzB,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;EACP,YAAY,CAAC,iCAAiC;CAChD;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;E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,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAA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,MACF;QAAK,MAAM,cAAc,OAAO,OAAO,WAAW,GAChD,IAAI,WAAW,YAAY,SAAS,IAAI,KAAK,mBAAmB,WAAW,IAAI,GAC7E,OAAO,WAAW;EAEtB;EAGF,IAAI,QAAQ,mBAAmB,OAC7B,OAAO,mBAAmB;EAG5B,UAAU,QAAQ,IAAI,SAAS,OAAO;CACxC;AAGF"}
@@ -1,4 +1,4 @@
1
- import { BadRequestError, ConflictError, CookieJarUnavailableError, ForbiddenError, HttpError, NotAcceptableError, NotAllowedError, ResourceNotFoundError, ServerError, UnAuthorizedError } from "../http/errors/errors.mjs";
1
+ import { AppError, BadRequestError, ConflictError, CookieJarUnavailableError, ForbiddenError, HttpError, NotAcceptableError, NotAllowedError, ResourceNotFoundError, ServerError, UnAuthorizedError } from "../http/errors/errors.mjs";
2
2
  import { ERROR_CODES, ERROR_CODES_DOCS_URL, ErrorCodeArea, ErrorCodeCategory, ErrorCodeDefinition, WarlockErrorCode, errorCodeDocsUrl, errorCodeOf, explainErrorCode, isWarlockErrorCode } from "./error-codes.mjs";
3
3
  import { WarlockError } from "./warlock-error.mjs";
4
- export { BadRequestError, ConflictError, CookieJarUnavailableError, ERROR_CODES, ERROR_CODES_DOCS_URL, ErrorCodeArea, ErrorCodeCategory, ErrorCodeDefinition, ForbiddenError, HttpError, NotAcceptableError, NotAllowedError, ResourceNotFoundError, ServerError, UnAuthorizedError, WarlockError, WarlockErrorCode, errorCodeDocsUrl, errorCodeOf, explainErrorCode, isWarlockErrorCode };
4
+ export { AppError, BadRequestError, ConflictError, CookieJarUnavailableError, ERROR_CODES, ERROR_CODES_DOCS_URL, ErrorCodeArea, ErrorCodeCategory, ErrorCodeDefinition, ForbiddenError, HttpError, NotAcceptableError, NotAllowedError, ResourceNotFoundError, ServerError, UnAuthorizedError, WarlockError, WarlockErrorCode, errorCodeDocsUrl, errorCodeOf, explainErrorCode, isWarlockErrorCode };
@@ -1,5 +1,5 @@
1
- import { BadRequestError, ConflictError, CookieJarUnavailableError, ForbiddenError, HttpError, NotAcceptableError, NotAllowedError, ResourceNotFoundError, ServerError, UnAuthorizedError } from "../http/errors/errors.mjs";
1
+ import { AppError, BadRequestError, ConflictError, CookieJarUnavailableError, ForbiddenError, HttpError, NotAcceptableError, NotAllowedError, ResourceNotFoundError, ServerError, UnAuthorizedError } from "../http/errors/errors.mjs";
2
2
  import { WarlockError } from "./warlock-error.mjs";
3
3
  import { ERROR_CODES, ERROR_CODES_DOCS_URL, errorCodeDocsUrl, errorCodeOf, explainErrorCode, isWarlockErrorCode } from "./error-codes.mjs";
4
4
 
5
- export { BadRequestError, ConflictError, CookieJarUnavailableError, ERROR_CODES, ERROR_CODES_DOCS_URL, ForbiddenError, HttpError, NotAcceptableError, NotAllowedError, ResourceNotFoundError, ServerError, UnAuthorizedError, WarlockError, errorCodeDocsUrl, errorCodeOf, explainErrorCode, isWarlockErrorCode };
5
+ export { AppError, BadRequestError, ConflictError, CookieJarUnavailableError, ERROR_CODES, ERROR_CODES_DOCS_URL, ForbiddenError, HttpError, NotAcceptableError, NotAllowedError, ResourceNotFoundError, ServerError, UnAuthorizedError, WarlockError, errorCodeDocsUrl, errorCodeOf, explainErrorCode, isWarlockErrorCode };
@@ -4,6 +4,7 @@ import { getWarlockVersion } from "../utils/framework-vesion.mjs";
4
4
  import { isGenerationDryRun, recordSkippedFile, setGenerationDetail } from "./generation-run.mjs";
5
5
  import { fileExistsAsync, getFileAsync, getJsonFileAsync, putFileAsync, putJsonFileAsync } from "./generation-fs.mjs";
6
6
  import { detectPackageManager, getAddCommand, getExactAddCommand } from "../updater/package-manager.mjs";
7
+ import { assertDesignSystemTailwind } from "./features/design-system.feature.mjs";
7
8
  import { featuresMap } from "./features/index.mjs";
8
9
  import { getPnpmVersion, isInsideParentPnpmWorkspace, mergeOnlyBuiltDependencies, mergePackageJsonBuildApprovals, mergePnpmSharpApproval, pnpmBuildApprovalLayout } from "./pnpm-build-approvals.mjs";
9
10
  import { colors } from "@mongez/copper";
@@ -52,6 +53,7 @@ async function addCommandAction(options) {
52
53
  }
53
54
  validateFeatures(features);
54
55
  const resolvedFeatures = resolveFeatures(features);
56
+ if (resolvedFeatures.includes("design-system") && !resolvedFeatures.includes("tailwind")) await assertDesignSystemTailwind();
55
57
  const dependencies = {};
56
58
  const devDependencies = {};
57
59
  const ejectConfigs = {};
@@ -1 +1 @@
1
- {"version":3,"file":"add-command.action.mjs","names":[],"sources":["../../../../../../../../packages/core/src/generations/add-command.action.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport {\n fileExistsAsync,\n getFileAsync,\n getJsonFileAsync,\n putFileAsync,\n putJsonFileAsync,\n recordSkippedFile,\n} from \"./generation-fs\";\nimport { isGenerationDryRun, setGenerationDetail } from \"./generation-run\";\nimport { execSync } from \"node:child_process\";\nimport type { CommandActionData } from \"../commands/types\";\nimport {\n detectPackageManager,\n getAddCommand,\n getExactAddCommand,\n type PackageManager,\n} from \"../updater/package-manager\";\nimport { rootPath, srcPath } from \"../utils\";\nimport { getWarlockVersion } from \"../utils/framework-vesion\";\nimport { featuresMap } from \"./features\";\nimport {\n getPnpmVersion,\n isInsideParentPnpmWorkspace,\n mergeOnlyBuiltDependencies,\n mergePackageJsonBuildApprovals,\n mergePnpmSharpApproval,\n pnpmBuildApprovalLayout,\n} from \"./pnpm-build-approvals\";\n\nexport { featuresMap };\nexport type { FeatureDefinition } from \"./features\";\n\n/**\n * The parts of a project `package.json` this action reads or writes. Deliberately\n * partial — it describes what we touch, not the whole manifest.\n */\ntype ProjectPackageJson = {\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n scripts?: Record<string, string>;\n};\n\nexport const allowedFeatures = Object.keys(featuresMap);\n\nfunction isWarlockPackage(packageName: string): boolean {\n return packageName.startsWith(\"@warlock.js/\");\n}\n\n/**\n * Resolve the internal feature-map placeholder to the version of Core that is\n * actually executing the command. Every @warlock.js package is lockstep, so\n * Core is the single source of truth; non-Warlock dependencies are untouched.\n */\nexport function resolveWarlockDependencyVersions(\n dependencies: Record<string, string>,\n frameworkVersion: string,\n): void {\n for (const dependency of Object.keys(dependencies)) {\n if (isWarlockPackage(dependency)) {\n dependencies[dependency] = frameworkVersion;\n }\n }\n}\n\nfunction resolveFeatures(features: string[], visited = new Set<string>()): string[] {\n const resolved: string[] = [];\n\n for (const feature of features) {\n if (visited.has(feature)) continue;\n visited.add(feature);\n\n const def = featuresMap[feature];\n\n // `addCommandAction` runs `validateFeatures()` before calling this, and the\n // recursive calls below pass `requires` entries that come out of the map\n // itself — so every lookup resolves. Skipping an unresolvable one keeps a\n // typo from crashing the command with `Cannot read properties of\n // undefined`, which names neither the feature nor the fact that it was the\n // ARGUMENT that was wrong.\n if (def === undefined) continue;\n\n if (def.requires?.length) {\n resolved.push(...resolveFeatures(def.requires, visited));\n }\n\n resolved.push(feature);\n }\n\n return resolved;\n}\n\nexport async function addCommandAction(options: CommandActionData) {\n const features = options.args;\n const { packageManager, list, noInstall } = options.options;\n\n if (list) {\n setGenerationDetail(\n \"features\",\n allowedFeatures.map((feature) => ({\n name: feature,\n description: featuresMap[feature]?.description ?? \"\",\n })),\n );\n\n console.log(\"Available Features:\");\n\n for (const feature of allowedFeatures) {\n const definition = featuresMap[feature];\n\n // `allowedFeatures` is derived from this same map, so this resolves.\n if (definition === undefined) continue;\n\n console.log(`- ${colors.yellowBright(feature)}: ${colors.green(definition.description)}`);\n }\n\n process.exit(0);\n }\n\n validateFeatures(features);\n\n const resolvedFeatures = resolveFeatures(features);\n\n const dependencies: Record<string, string> = {};\n const devDependencies: Record<string, string> = {};\n const ejectConfigs: Record<string, { content: string; name: string }> = {};\n const scripts: Record<string, string> = {};\n\n for (const feature of resolvedFeatures) {\n const featurePackages = featuresMap[feature as keyof typeof featuresMap];\n\n // Validated upstream; see the note in resolveFeatures above.\n if (featurePackages === undefined) continue;\n\n Object.assign(dependencies, featurePackages.dependencies);\n if (featurePackages.devDependencies) {\n Object.assign(devDependencies, featurePackages.devDependencies);\n }\n\n if (featurePackages.ejectConfig) {\n ejectConfigs[featurePackages.ejectConfig.name] = featurePackages.ejectConfig;\n }\n\n if (featurePackages.script) {\n Object.assign(scripts, featurePackages.script);\n }\n }\n\n // Pin every @warlock.js/* feature package to the INSTALLED framework version so\n // a scaffolded project's features match its core version instead of drifting to\n // the feature map's static range.\n const frameworkVersion = await getWarlockVersion();\n resolveWarlockDependencyVersions(dependencies, frameworkVersion);\n resolveWarlockDependencyVersions(devDependencies, frameworkVersion);\n\n const currentPackageJson = await getJsonFileAsync<ProjectPackageJson>(rootPath(\"package.json\"));\n\n // Fresh templates may omit one of the maps — guard before reading.\n currentPackageJson.dependencies = currentPackageJson.dependencies ?? {};\n currentPackageJson.devDependencies = currentPackageJson.devDependencies ?? {};\n\n // Skip anything already present so we never downgrade an existing pin.\n for (const dependency of Object.keys(dependencies)) {\n if (currentPackageJson.dependencies[dependency]) {\n console.log(`${colors.yellowBright(dependency)} is already installed, skipping...`);\n delete dependencies[dependency];\n }\n }\n\n for (const devDependency of Object.keys(devDependencies)) {\n if (currentPackageJson.devDependencies[devDependency]) {\n console.log(`${colors.yellowBright(devDependency)} is already installed, skipping...`);\n delete devDependencies[devDependency];\n }\n }\n\n setGenerationDetail(\"features\", resolvedFeatures);\n setGenerationDetail(\"dependencies\", { ...dependencies });\n setGenerationDetail(\"devDependencies\", { ...devDependencies });\n\n if (isGenerationDryRun()) {\n // A preview installs nothing; package.json is \"edited\" in the overlay so\n // the report lists it, and later steps read the previewed manifest.\n console.log(\n `Dry run: would install ${colors.magenta(Object.keys({ ...dependencies, ...devDependencies }).join(\", \") || \"nothing\")}`,\n );\n await recordDependencies(dependencies, devDependencies);\n } else if (noInstall) {\n await recordDependencies(dependencies, devDependencies);\n } else {\n const resolvedPackageManager =\n (packageManager as PackageManager | undefined) ?? (await detectPackageManager());\n if (resolvedPackageManager === \"pnpm\" && dependencies.sharp !== undefined) {\n await approvePnpmSharpBuild();\n }\n await installDependencies(\n packageManager as PackageManager | undefined,\n dependencies,\n devDependencies,\n );\n }\n\n for (const [name, config] of Object.entries(ejectConfigs)) {\n if (await fileExistsAsync(srcPath(`config/${name}.ts`))) {\n recordSkippedFile(srcPath(`config/${name}.ts`), \"exists\");\n console.log(`${colors.yellowBright(name)} config already exists, skipping...`);\n continue;\n }\n\n console.log(`Creating ${colors.magenta(name)} config...`);\n\n await putFileAsync(srcPath(`config/${name}.ts`), config.content);\n\n console.log(`${colors.green(name)} config created successfully`);\n }\n\n // now loop again over features to execute onExecuting\n for (const feature of resolvedFeatures) {\n const featurePackages = featuresMap[feature as keyof typeof featuresMap];\n\n if (featurePackages?.onExecuting) {\n await featurePackages.onExecuting(options);\n }\n }\n\n setGenerationDetail(\"scripts\", { ...scripts });\n\n if (Object.keys(scripts).length > 0) {\n console.log(`Adding scripts ${colors.magenta(Object.keys(scripts).join(\", \"))}`);\n const packageJsonPath = rootPath(\"package.json\");\n const packageJson = await getJsonFileAsync<ProjectPackageJson>(packageJsonPath);\n packageJson.scripts = { ...(packageJson.scripts ?? {}), ...scripts };\n await putJsonFileAsync(packageJsonPath, packageJson);\n\n console.log(`Scripts added successfully ${colors.green(Object.keys(scripts).join(\", \"))}`);\n }\n}\n\n/**\n * Let pnpm run sharp's install script, written where the INSTALLED pnpm reads\n * approvals (see `pnpmBuildApprovalLayout`). pnpm 9 and 10.0–10.4 reject a\n * settings-only `pnpm-workspace.yaml`, so for them the approval goes into\n * package.json and no workspace file is created.\n *\n * An app inside a parent pnpm workspace gets no per-app policy: the parent's\n * workspace owns it, and a nested workspace file would make a second root.\n */\nasync function approvePnpmSharpBuild(): Promise<void> {\n const workspacePath = rootPath(\"pnpm-workspace.yaml\");\n const hasWorkspaceFile = await fileExistsAsync(workspacePath);\n\n if (!hasWorkspaceFile && isInsideParentPnpmWorkspace(rootPath())) {\n console.log(\n `${colors.yellowBright(\"sharp\")} needs its install script approved in the parent pnpm workspace's settings.`,\n );\n return;\n }\n\n const layout = pnpmBuildApprovalLayout(getPnpmVersion(rootPath()));\n\n if (layout === \"packageJson\") {\n const packageJsonPath = rootPath(\"package.json\");\n const packageJson = await getJsonFileAsync<ProjectPackageJson>(packageJsonPath);\n\n await putJsonFileAsync(packageJsonPath, mergePackageJsonBuildApprovals(packageJson, [\"sharp\"]));\n return;\n }\n\n const current = hasWorkspaceFile ? await getFileAsync(workspacePath) : \"\";\n const updated =\n layout === \"onlyBuiltDependencies\"\n ? mergeOnlyBuiltDependencies(current, [\"sharp\"])\n : mergePnpmSharpApproval(current);\n\n if (updated !== current) await putFileAsync(workspacePath, updated);\n}\n\n/**\n * Install the resolved dependency sets through the project's package manager.\n * Runs two passes (prod then dev) so each lands in the correct section.\n */\nexport async function installDependencies(\n packageManager: PackageManager | undefined,\n dependencies: Record<string, string>,\n devDependencies: Record<string, string>,\n exec: (command: string, options: { cwd: string; stdio: \"inherit\" }) => unknown = execSync,\n) {\n // `--package-manager` is optional; without it, fall back to the lockfile.\n const resolvedPackageManager = packageManager ?? (await detectPackageManager());\n const packageManagerCommand = getAddCommand(resolvedPackageManager);\n const exactPackageManagerCommand = getExactAddCommand(resolvedPackageManager);\n\n const installDependencySet = (dependencySet: Record<string, string>, development: boolean) => {\n const regularSpecs: string[] = [];\n const exactWarlockSpecs: string[] = [];\n\n for (const [name, version] of Object.entries(dependencySet)) {\n const spec = `${name}@${version}`;\n (isWarlockPackage(name) ? exactWarlockSpecs : regularSpecs).push(spec);\n }\n\n const developmentFlag = development ? \" -D\" : \"\";\n const runInstall = (command: string, specs: string[]) => {\n if (specs.length === 0) return;\n\n exec(`${command} ${specs.join(\" \")}${developmentFlag}`, {\n cwd: process.cwd(),\n stdio: \"inherit\",\n });\n };\n\n runInstall(packageManagerCommand, regularSpecs);\n runInstall(exactPackageManagerCommand, exactWarlockSpecs);\n };\n\n if (Object.keys(dependencies).length > 0) {\n console.log(`Installing dependencies ${colors.magenta(Object.keys(dependencies).join(\", \"))}`);\n\n installDependencySet(dependencies, false);\n\n console.log(\n `Dependencies installed successfully ${colors.green(Object.keys(dependencies).join(\", \"))}`,\n );\n }\n\n if (Object.keys(devDependencies).length > 0) {\n console.log(\n `Installing dev dependencies ${colors.magenta(Object.keys(devDependencies).join(\", \"))}`,\n );\n\n installDependencySet(devDependencies, true);\n\n console.log(\n `Dev dependencies installed successfully ${colors.green(Object.keys(devDependencies).join(\", \"))}`,\n );\n }\n}\n\n/**\n * Write the resolved dependency sets into package.json without installing.\n * Used by `--no-install` so a scaffolder can batch every feature into one\n * install pass after the command returns. Versions come from the feature map.\n */\nasync function recordDependencies(\n dependencies: Record<string, string>,\n devDependencies: Record<string, string>,\n) {\n if (Object.keys(dependencies).length === 0 && Object.keys(devDependencies).length === 0) {\n return;\n }\n\n const packageJsonPath = rootPath(\"package.json\");\n const packageJson = await getJsonFileAsync<ProjectPackageJson>(packageJsonPath);\n\n packageJson.dependencies = packageJson.dependencies ?? {};\n packageJson.devDependencies = packageJson.devDependencies ?? {};\n\n Object.assign(packageJson.dependencies, dependencies);\n Object.assign(packageJson.devDependencies, devDependencies);\n\n await putJsonFileAsync(packageJsonPath, packageJson);\n\n const recorded = [...Object.keys(dependencies), ...Object.keys(devDependencies)];\n\n console.log(\n `Recorded ${colors.green(recorded.join(\", \"))} in package.json (${isGenerationDryRun() ? \"dry run: nothing installed\" : \"install skipped via --no-install\"})`,\n );\n}\n\nfunction validateFeatures(features: string[]) {\n for (const feature of features) {\n if (!allowedFeatures.includes(feature)) {\n console.log(\n `Feature ${colors.redBright(feature)} is not allowed, allowed features are: ${colors.green(allowedFeatures.join(\", \"))}`,\n );\n process.exit(1);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;AA2CA,MAAa,kBAAkB,OAAO,KAAK,WAAW;AAEtD,SAAS,iBAAiB,aAA8B;CACtD,OAAO,YAAY,WAAW,cAAc;AAC9C;;;;;;AAOA,SAAgB,iCACd,cACA,kBACM;CACN,KAAK,MAAM,cAAc,OAAO,KAAK,YAAY,GAC/C,IAAI,iBAAiB,UAAU,GAC7B,aAAa,cAAc;AAGjC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action.mjs","names":[],"sources":["../../../../../../../../packages/core/src/generations/add-command.action.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport {\n fileExistsAsync,\n getFileAsync,\n getJsonFileAsync,\n putFileAsync,\n putJsonFileAsync,\n recordSkippedFile,\n} from \"./generation-fs\";\nimport { isGenerationDryRun, setGenerationDetail } from \"./generation-run\";\nimport { execSync } from \"node:child_process\";\nimport type { CommandActionData } from \"../commands/types\";\nimport {\n detectPackageManager,\n getAddCommand,\n getExactAddCommand,\n type PackageManager,\n} from \"../updater/package-manager\";\nimport { rootPath, srcPath } from \"../utils\";\nimport { getWarlockVersion } from \"../utils/framework-vesion\";\nimport { featuresMap } from \"./features\";\nimport { assertDesignSystemTailwind } from \"./features/design-system.feature\";\nimport {\n getPnpmVersion,\n isInsideParentPnpmWorkspace,\n mergeOnlyBuiltDependencies,\n mergePackageJsonBuildApprovals,\n mergePnpmSharpApproval,\n pnpmBuildApprovalLayout,\n} from \"./pnpm-build-approvals\";\n\nexport { featuresMap };\nexport type { FeatureDefinition } from \"./features\";\n\n/**\n * The parts of a project `package.json` this action reads or writes. Deliberately\n * partial — it describes what we touch, not the whole manifest.\n */\ntype ProjectPackageJson = {\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n scripts?: Record<string, string>;\n};\n\nexport const allowedFeatures = Object.keys(featuresMap);\n\nfunction isWarlockPackage(packageName: string): boolean {\n return packageName.startsWith(\"@warlock.js/\");\n}\n\n/**\n * Resolve the internal feature-map placeholder to the version of Core that is\n * actually executing the command. Every @warlock.js package is lockstep, so\n * Core is the single source of truth; non-Warlock dependencies are untouched.\n */\nexport function resolveWarlockDependencyVersions(\n dependencies: Record<string, string>,\n frameworkVersion: string,\n): void {\n for (const dependency of Object.keys(dependencies)) {\n if (isWarlockPackage(dependency)) {\n dependencies[dependency] = frameworkVersion;\n }\n }\n}\n\nfunction resolveFeatures(features: string[], visited = new Set<string>()): string[] {\n const resolved: string[] = [];\n\n for (const feature of features) {\n if (visited.has(feature)) continue;\n visited.add(feature);\n\n const def = featuresMap[feature];\n\n // `addCommandAction` runs `validateFeatures()` before calling this, and the\n // recursive calls below pass `requires` entries that come out of the map\n // itself — so every lookup resolves. Skipping an unresolvable one keeps a\n // typo from crashing the command with `Cannot read properties of\n // undefined`, which names neither the feature nor the fact that it was the\n // ARGUMENT that was wrong.\n if (def === undefined) continue;\n\n if (def.requires?.length) {\n resolved.push(...resolveFeatures(def.requires, visited));\n }\n\n resolved.push(feature);\n }\n\n return resolved;\n}\n\nexport async function addCommandAction(options: CommandActionData) {\n const features = options.args;\n const { packageManager, list, noInstall } = options.options;\n\n if (list) {\n setGenerationDetail(\n \"features\",\n allowedFeatures.map((feature) => ({\n name: feature,\n description: featuresMap[feature]?.description ?? \"\",\n })),\n );\n\n console.log(\"Available Features:\");\n\n for (const feature of allowedFeatures) {\n const definition = featuresMap[feature];\n\n // `allowedFeatures` is derived from this same map, so this resolves.\n if (definition === undefined) continue;\n\n console.log(`- ${colors.yellowBright(feature)}: ${colors.green(definition.description)}`);\n }\n\n process.exit(0);\n }\n\n validateFeatures(features);\n\n const resolvedFeatures = resolveFeatures(features);\n\n if (resolvedFeatures.includes(\"design-system\") && !resolvedFeatures.includes(\"tailwind\")) {\n await assertDesignSystemTailwind();\n }\n\n const dependencies: Record<string, string> = {};\n const devDependencies: Record<string, string> = {};\n const ejectConfigs: Record<string, { content: string; name: string }> = {};\n const scripts: Record<string, string> = {};\n\n for (const feature of resolvedFeatures) {\n const featurePackages = featuresMap[feature as keyof typeof featuresMap];\n\n // Validated upstream; see the note in resolveFeatures above.\n if (featurePackages === undefined) continue;\n\n Object.assign(dependencies, featurePackages.dependencies);\n if (featurePackages.devDependencies) {\n Object.assign(devDependencies, featurePackages.devDependencies);\n }\n\n if (featurePackages.ejectConfig) {\n ejectConfigs[featurePackages.ejectConfig.name] = featurePackages.ejectConfig;\n }\n\n if (featurePackages.script) {\n Object.assign(scripts, featurePackages.script);\n }\n }\n\n // Pin every @warlock.js/* feature package to the INSTALLED framework version so\n // a scaffolded project's features match its core version instead of drifting to\n // the feature map's static range.\n const frameworkVersion = await getWarlockVersion();\n resolveWarlockDependencyVersions(dependencies, frameworkVersion);\n resolveWarlockDependencyVersions(devDependencies, frameworkVersion);\n\n const currentPackageJson = await getJsonFileAsync<ProjectPackageJson>(rootPath(\"package.json\"));\n\n // Fresh templates may omit one of the maps — guard before reading.\n currentPackageJson.dependencies = currentPackageJson.dependencies ?? {};\n currentPackageJson.devDependencies = currentPackageJson.devDependencies ?? {};\n\n // Skip anything already present so we never downgrade an existing pin.\n for (const dependency of Object.keys(dependencies)) {\n if (currentPackageJson.dependencies[dependency]) {\n console.log(`${colors.yellowBright(dependency)} is already installed, skipping...`);\n delete dependencies[dependency];\n }\n }\n\n for (const devDependency of Object.keys(devDependencies)) {\n if (currentPackageJson.devDependencies[devDependency]) {\n console.log(`${colors.yellowBright(devDependency)} is already installed, skipping...`);\n delete devDependencies[devDependency];\n }\n }\n\n setGenerationDetail(\"features\", resolvedFeatures);\n setGenerationDetail(\"dependencies\", { ...dependencies });\n setGenerationDetail(\"devDependencies\", { ...devDependencies });\n\n if (isGenerationDryRun()) {\n // A preview installs nothing; package.json is \"edited\" in the overlay so\n // the report lists it, and later steps read the previewed manifest.\n console.log(\n `Dry run: would install ${colors.magenta(Object.keys({ ...dependencies, ...devDependencies }).join(\", \") || \"nothing\")}`,\n );\n await recordDependencies(dependencies, devDependencies);\n } else if (noInstall) {\n await recordDependencies(dependencies, devDependencies);\n } else {\n const resolvedPackageManager =\n (packageManager as PackageManager | undefined) ?? (await detectPackageManager());\n if (resolvedPackageManager === \"pnpm\" && dependencies.sharp !== undefined) {\n await approvePnpmSharpBuild();\n }\n await installDependencies(\n packageManager as PackageManager | undefined,\n dependencies,\n devDependencies,\n );\n }\n\n for (const [name, config] of Object.entries(ejectConfigs)) {\n if (await fileExistsAsync(srcPath(`config/${name}.ts`))) {\n recordSkippedFile(srcPath(`config/${name}.ts`), \"exists\");\n console.log(`${colors.yellowBright(name)} config already exists, skipping...`);\n continue;\n }\n\n console.log(`Creating ${colors.magenta(name)} config...`);\n\n await putFileAsync(srcPath(`config/${name}.ts`), config.content);\n\n console.log(`${colors.green(name)} config created successfully`);\n }\n\n // now loop again over features to execute onExecuting\n for (const feature of resolvedFeatures) {\n const featurePackages = featuresMap[feature as keyof typeof featuresMap];\n\n if (featurePackages?.onExecuting) {\n await featurePackages.onExecuting(options);\n }\n }\n\n setGenerationDetail(\"scripts\", { ...scripts });\n\n if (Object.keys(scripts).length > 0) {\n console.log(`Adding scripts ${colors.magenta(Object.keys(scripts).join(\", \"))}`);\n const packageJsonPath = rootPath(\"package.json\");\n const packageJson = await getJsonFileAsync<ProjectPackageJson>(packageJsonPath);\n packageJson.scripts = { ...(packageJson.scripts ?? {}), ...scripts };\n await putJsonFileAsync(packageJsonPath, packageJson);\n\n console.log(`Scripts added successfully ${colors.green(Object.keys(scripts).join(\", \"))}`);\n }\n}\n\n/**\n * Let pnpm run sharp's install script, written where the INSTALLED pnpm reads\n * approvals (see `pnpmBuildApprovalLayout`). pnpm 9 and 10.0–10.4 reject a\n * settings-only `pnpm-workspace.yaml`, so for them the approval goes into\n * package.json and no workspace file is created.\n *\n * An app inside a parent pnpm workspace gets no per-app policy: the parent's\n * workspace owns it, and a nested workspace file would make a second root.\n */\nasync function approvePnpmSharpBuild(): Promise<void> {\n const workspacePath = rootPath(\"pnpm-workspace.yaml\");\n const hasWorkspaceFile = await fileExistsAsync(workspacePath);\n\n if (!hasWorkspaceFile && isInsideParentPnpmWorkspace(rootPath())) {\n console.log(\n `${colors.yellowBright(\"sharp\")} needs its install script approved in the parent pnpm workspace's settings.`,\n );\n return;\n }\n\n const layout = pnpmBuildApprovalLayout(getPnpmVersion(rootPath()));\n\n if (layout === \"packageJson\") {\n const packageJsonPath = rootPath(\"package.json\");\n const packageJson = await getJsonFileAsync<ProjectPackageJson>(packageJsonPath);\n\n await putJsonFileAsync(packageJsonPath, mergePackageJsonBuildApprovals(packageJson, [\"sharp\"]));\n return;\n }\n\n const current = hasWorkspaceFile ? await getFileAsync(workspacePath) : \"\";\n const updated =\n layout === \"onlyBuiltDependencies\"\n ? mergeOnlyBuiltDependencies(current, [\"sharp\"])\n : mergePnpmSharpApproval(current);\n\n if (updated !== current) await putFileAsync(workspacePath, updated);\n}\n\n/**\n * Install the resolved dependency sets through the project's package manager.\n * Runs two passes (prod then dev) so each lands in the correct section.\n */\nexport async function installDependencies(\n packageManager: PackageManager | undefined,\n dependencies: Record<string, string>,\n devDependencies: Record<string, string>,\n exec: (command: string, options: { cwd: string; stdio: \"inherit\" }) => unknown = execSync,\n) {\n // `--package-manager` is optional; without it, fall back to the lockfile.\n const resolvedPackageManager = packageManager ?? (await detectPackageManager());\n const packageManagerCommand = getAddCommand(resolvedPackageManager);\n const exactPackageManagerCommand = getExactAddCommand(resolvedPackageManager);\n\n const installDependencySet = (dependencySet: Record<string, string>, development: boolean) => {\n const regularSpecs: string[] = [];\n const exactWarlockSpecs: string[] = [];\n\n for (const [name, version] of Object.entries(dependencySet)) {\n const spec = `${name}@${version}`;\n (isWarlockPackage(name) ? exactWarlockSpecs : regularSpecs).push(spec);\n }\n\n const developmentFlag = development ? \" -D\" : \"\";\n const runInstall = (command: string, specs: string[]) => {\n if (specs.length === 0) return;\n\n exec(`${command} ${specs.join(\" \")}${developmentFlag}`, {\n cwd: process.cwd(),\n stdio: \"inherit\",\n });\n };\n\n runInstall(packageManagerCommand, regularSpecs);\n runInstall(exactPackageManagerCommand, exactWarlockSpecs);\n };\n\n if (Object.keys(dependencies).length > 0) {\n console.log(`Installing dependencies ${colors.magenta(Object.keys(dependencies).join(\", \"))}`);\n\n installDependencySet(dependencies, false);\n\n console.log(\n `Dependencies installed successfully ${colors.green(Object.keys(dependencies).join(\", \"))}`,\n );\n }\n\n if (Object.keys(devDependencies).length > 0) {\n console.log(\n `Installing dev dependencies ${colors.magenta(Object.keys(devDependencies).join(\", \"))}`,\n );\n\n installDependencySet(devDependencies, true);\n\n console.log(\n `Dev dependencies installed successfully ${colors.green(Object.keys(devDependencies).join(\", \"))}`,\n );\n }\n}\n\n/**\n * Write the resolved dependency sets into package.json without installing.\n * Used by `--no-install` so a scaffolder can batch every feature into one\n * install pass after the command returns. Versions come from the feature map.\n */\nasync function recordDependencies(\n dependencies: Record<string, string>,\n devDependencies: Record<string, string>,\n) {\n if (Object.keys(dependencies).length === 0 && Object.keys(devDependencies).length === 0) {\n return;\n }\n\n const packageJsonPath = rootPath(\"package.json\");\n const packageJson = await getJsonFileAsync<ProjectPackageJson>(packageJsonPath);\n\n packageJson.dependencies = packageJson.dependencies ?? {};\n packageJson.devDependencies = packageJson.devDependencies ?? {};\n\n Object.assign(packageJson.dependencies, dependencies);\n Object.assign(packageJson.devDependencies, devDependencies);\n\n await putJsonFileAsync(packageJsonPath, packageJson);\n\n const recorded = [...Object.keys(dependencies), ...Object.keys(devDependencies)];\n\n console.log(\n `Recorded ${colors.green(recorded.join(\", \"))} in package.json (${isGenerationDryRun() ? \"dry run: nothing installed\" : \"install skipped via --no-install\"})`,\n );\n}\n\nfunction validateFeatures(features: string[]) {\n for (const feature of features) {\n if (!allowedFeatures.includes(feature)) {\n console.log(\n `Feature ${colors.redBright(feature)} is not allowed, allowed features are: ${colors.green(allowedFeatures.join(\", \"))}`,\n );\n process.exit(1);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AA4CA,MAAa,kBAAkB,OAAO,KAAK,WAAW;AAEtD,SAAS,iBAAiB,aAA8B;CACtD,OAAO,YAAY,WAAW,cAAc;AAC9C;;;;;;AAOA,SAAgB,iCACd,cACA,kBACM;CACN,KAAK,MAAM,cAAc,OAAO,KAAK,YAAY,GAC/C,IAAI,iBAAiB,UAAU,GAC7B,aAAa,cAAc;AAGjC;AAEA,SAAS,gBAAgB,UAAoB,0BAAU,IAAI,IAAY,GAAa;CAClF,MAAM,WAAqB,CAAC;CAE5B,KAAK,MAAM,WAAW,UAAU;EAC9B,IAAI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