@warlock.js/core 5.35.0 → 5.37.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 (133) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/esm/cli/commands/migrate.command.mjs +10 -0
  3. package/esm/cli/commands/migrate.command.mjs.map +1 -1
  4. package/esm/cli/commands/release/release-command.action.mjs +245 -0
  5. package/esm/cli/commands/release/release-command.action.mjs.map +1 -0
  6. package/esm/cli/commands/release.command.mjs +66 -0
  7. package/esm/cli/commands/release.command.mjs.map +1 -0
  8. package/esm/cli/framework-cli-commands.mjs +2 -0
  9. package/esm/cli/framework-cli-commands.mjs.map +1 -1
  10. package/esm/database/migrate-action.mjs +24 -2
  11. package/esm/database/migrate-action.mjs.map +1 -1
  12. package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
  13. package/esm/dev-server/loader/load-hook.mjs +6 -0
  14. package/esm/dev-server/loader/load-hook.mjs.map +1 -1
  15. package/esm/dev-server/module-loader.mjs +1 -1
  16. package/esm/dev-server/parse-imports.mjs +1 -1
  17. package/esm/dev-server/type-generator.mjs +1 -1
  18. package/esm/e2e/cdp.d.mts.map +1 -1
  19. package/esm/e2e/cdp.mjs +9 -2
  20. package/esm/e2e/cdp.mjs.map +1 -1
  21. package/esm/e2e/page.d.mts +9 -1
  22. package/esm/e2e/page.d.mts.map +1 -1
  23. package/esm/e2e/page.mjs +45 -7
  24. package/esm/e2e/page.mjs.map +1 -1
  25. package/esm/e2e/types.d.mts +18 -0
  26. package/esm/e2e/types.d.mts.map +1 -1
  27. package/esm/e2e/types.mjs.map +1 -1
  28. package/esm/errors/error-codes.d.mts +24 -0
  29. package/esm/errors/error-codes.d.mts.map +1 -1
  30. package/esm/errors/error-codes.mjs +24 -0
  31. package/esm/errors/error-codes.mjs.map +1 -1
  32. package/esm/generations/features/test.feature.mjs +7 -7
  33. package/esm/generations/features/test.feature.mjs.map +1 -1
  34. package/esm/generations/features/web.feature.mjs +3 -3
  35. package/esm/generations/features/web.feature.mjs.map +1 -1
  36. package/esm/index.d.mts +6 -3
  37. package/esm/index.mjs +4 -2
  38. package/esm/localization/index.mjs +3 -1
  39. package/esm/localization/translation-usage-graph.d.mts +49 -0
  40. package/esm/localization/translation-usage-graph.d.mts.map +1 -0
  41. package/esm/localization/translation-usage-graph.mjs +128 -0
  42. package/esm/localization/translation-usage-graph.mjs.map +1 -0
  43. package/esm/localization/translation-usage.d.mts +85 -0
  44. package/esm/localization/translation-usage.d.mts.map +1 -0
  45. package/esm/localization/translation-usage.mjs +307 -0
  46. package/esm/localization/translation-usage.mjs.map +1 -0
  47. package/esm/production/build-budgets.d.mts +18 -0
  48. package/esm/production/build-budgets.d.mts.map +1 -1
  49. package/esm/production/build-budgets.mjs.map +1 -1
  50. package/esm/production/route-registration-snapshot.mjs +12 -3
  51. package/esm/production/route-registration-snapshot.mjs.map +1 -1
  52. package/esm/release/activate.mjs +261 -0
  53. package/esm/release/activate.mjs.map +1 -0
  54. package/esm/release/candidate.mjs +107 -0
  55. package/esm/release/candidate.mjs.map +1 -0
  56. package/esm/release/cascade-migration-provider.mjs +32 -0
  57. package/esm/release/cascade-migration-provider.mjs.map +1 -0
  58. package/esm/release/config.mjs +60 -0
  59. package/esm/release/config.mjs.map +1 -0
  60. package/esm/release/gate.mjs +67 -0
  61. package/esm/release/gate.mjs.map +1 -0
  62. package/esm/release/migrations-proof.mjs +100 -0
  63. package/esm/release/migrations-proof.mjs.map +1 -0
  64. package/esm/release/prune.mjs +42 -0
  65. package/esm/release/prune.mjs.map +1 -0
  66. package/esm/release/report.mjs +25 -0
  67. package/esm/release/report.mjs.map +1 -0
  68. package/esm/release/runner.mjs +55 -0
  69. package/esm/release/runner.mjs.map +1 -0
  70. package/esm/release/semver.mjs +53 -0
  71. package/esm/release/semver.mjs.map +1 -0
  72. package/esm/release/stage.mjs +122 -0
  73. package/esm/release/stage.mjs.map +1 -0
  74. package/esm/release/store.mjs +131 -0
  75. package/esm/release/store.mjs.map +1 -0
  76. package/esm/release/types.d.mts +102 -0
  77. package/esm/release/types.d.mts.map +1 -0
  78. package/esm/release/verify.mjs +94 -0
  79. package/esm/release/verify.mjs.map +1 -0
  80. package/esm/router/index.d.mts +2 -2
  81. package/esm/router/index.mjs +2 -2
  82. package/esm/router/router.d.mts +4 -0
  83. package/esm/router/router.d.mts.map +1 -1
  84. package/esm/router/router.mjs +14 -3
  85. package/esm/router/router.mjs.map +1 -1
  86. package/esm/router/types.d.mts +45 -0
  87. package/esm/router/types.d.mts.map +1 -1
  88. package/esm/router/unguarded-route-diagnostics.d.mts +6 -0
  89. package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -1
  90. package/esm/router/unguarded-route-diagnostics.mjs +10 -2
  91. package/esm/router/unguarded-route-diagnostics.mjs.map +1 -1
  92. package/esm/tooling/check/api-route-references.d.mts +16 -0
  93. package/esm/tooling/check/api-route-references.d.mts.map +1 -0
  94. package/esm/tooling/check/api-route-references.mjs +146 -0
  95. package/esm/tooling/check/api-route-references.mjs.map +1 -0
  96. package/esm/tooling/check/conventions-step.d.mts +6 -3
  97. package/esm/tooling/check/conventions-step.d.mts.map +1 -1
  98. package/esm/tooling/check/conventions-step.mjs +19 -10
  99. package/esm/tooling/check/conventions-step.mjs.map +1 -1
  100. package/esm/tooling/check/run-check.d.mts.map +1 -1
  101. package/esm/tooling/check/run-check.mjs +4 -2
  102. package/esm/tooling/check/run-check.mjs.map +1 -1
  103. package/esm/tooling/check/security-conventions.mjs +19 -1
  104. package/esm/tooling/check/security-conventions.mjs.map +1 -1
  105. package/esm/tooling/check/translation-conventions.mjs +32 -0
  106. package/esm/tooling/check/translation-conventions.mjs.map +1 -0
  107. package/esm/tooling/inspect/collect-files.mjs +1 -1
  108. package/esm/tooling/inspect/collect-routes.mjs +3 -2
  109. package/esm/tooling/inspect/collect-routes.mjs.map +1 -1
  110. package/esm/upgrade/codemods/index.mjs +2 -0
  111. package/esm/upgrade/codemods/index.mjs.map +1 -1
  112. package/esm/upgrade/codemods/vite-vitest.mjs +170 -0
  113. package/esm/upgrade/codemods/vite-vitest.mjs.map +1 -0
  114. package/esm/upgrade/notes.mjs +4 -0
  115. package/esm/upgrade/notes.mjs.map +1 -1
  116. package/esm/validation/init.mjs +11 -4
  117. package/esm/validation/init.mjs.map +1 -1
  118. package/esm/validation/translate-rule.mjs +63 -0
  119. package/esm/validation/translate-rule.mjs.map +1 -0
  120. package/esm/warlock-config/index.d.mts +3 -2
  121. package/esm/warlock-config/types.d.mts +8 -0
  122. package/esm/warlock-config/types.d.mts.map +1 -1
  123. package/llms-full.txt +221 -18
  124. package/llms.txt +1 -0
  125. package/package.json +13 -13
  126. package/skills/deploy-release/SKILL.md +76 -0
  127. package/skills/index.md +1 -1
  128. package/skills/register-route/SKILL.md +25 -0
  129. package/skills/test-service/SKILL.md +8 -8
  130. package/skills/upgrade-from-5-29/SKILL.md +91 -0
  131. package/skills/use-localization/SKILL.md +4 -0
  132. package/skills/warlock-check/SKILL.md +11 -8
  133. package/skills/warlock-conventions/SKILL.md +1 -1
@@ -657,6 +657,22 @@ export declare const ERROR_CODES: {
657
657
  readonly fix: "Assign controller.responseSchema with a contract for each response status.";
658
658
  readonly skill: "warlock-check";
659
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
+ };
660
676
  readonly WL9101: {
661
677
  readonly code: "WL9101";
662
678
  readonly area: "convention";
@@ -681,6 +697,14 @@ export declare const ERROR_CODES: {
681
697
  readonly fix: "Add a CHANGELOG.md with a `## x.y.z` heading for the current version.";
682
698
  readonly skill: "warlock-doctor";
683
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
+ };
684
708
  };
685
709
  /** Every registered code, as a union. */
686
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;;;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"}
@@ -597,6 +597,22 @@ const ERROR_CODES = {
597
597
  fix: "Assign controller.responseSchema with a contract for each response status.",
598
598
  skill: "warlock-check"
599
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
+ },
600
616
  WL9101: {
601
617
  code: "WL9101",
602
618
  area: "convention",
@@ -620,6 +636,14 @@ const ERROR_CODES = {
620
636
  title: "CHANGELOG.md is missing or has no version heading",
621
637
  fix: "Add a CHANGELOG.md with a `## x.y.z` heading for the current version.",
622
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"
623
647
  }
624
648
  };
625
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 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 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,UAAU;EACV,OAAO;EACP,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ACV,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,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;AACF;;AAMA,SAAgB,mBAAmB,OAA2C;CAC5E,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU,eAAe,KAAK,aAAa,KAAK;AAC7F;;;;;AAMA,SAAgB,iBAAiB,MAA+C;CAC9E,MAAM,aAAa,KAAK,KAAK,CAAC,CAAC,YAAY;CAE3C,OAAO,mBAAmB,UAAU,IAAI,YAAY,cAAc;AACpE;;AAGA,SAAgB,iBAAiB,MAAgC;CAC/D,OAAO,GAAG,qBAAqB,GAAG,KAAK,YAAY;AACrD;;AAGA,MAAM,qBAAiE;CACrE,cAAc;CACd,WAAW;CACX,cAAc;CACd,WAAW;CACX,YAAY;CACZ,mBAAmB;AACrB;AAEA,SAAS,mBAAmB,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;EACP,YAAY,CAAC,0BAA0B;CACzC;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,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;EACP,YAAY,CAAC,2BAA2B;CAC1C;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;EACP,YAAY,CAAC,uBAAuB;CACtC;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;EACP,YAAY,CAAC,oBAAoB;CACnC;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CAGA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;EACP,YAAY,CAAC,iBAAiB;CAChC;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EAC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KAAK;EACL,OAAO;CACT;CACA,QAAQ;EACN,MAAM;EACN,MAAM;EACN,UAAU;EACV,OAAO;EACP,KAAK;EACL,OAAO;CACT;CAGA,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,KAA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,YAAY;CACZ,mBAAmB;AACrB;AAEA,SAAS,mBAAmB,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"}
@@ -63,15 +63,15 @@ afterAll(teardownTest);
63
63
  } else recordSkippedFile(testSetupPath, "exists");
64
64
  const runnerPath = srcPath("test-runner.ts");
65
65
  if (!await fileExistsAsync(runnerPath)) await putFileAsync(runnerPath, `import { configureTestWorker } from "@warlock.js/core/tests";
66
- import { VitestTestRunner } from "vitest/runners";
66
+ import { TestRunner } from "vitest";
67
67
 
68
- // Vitest 4.1 awaits onCleanupWorkerContext callbacks before recycling the fork.
69
- export default class WarlockTestRunner extends VitestTestRunner {
70
- public constructor(config: ConstructorParameters<typeof VitestTestRunner>[0]) {
68
+ // Vitest awaits onCleanupWorkerContext callbacks before recycling the fork.
69
+ export default class WarlockTestRunner extends TestRunner {
70
+ public constructor(config: ConstructorParameters<typeof TestRunner>[0]) {
71
71
  super(config);
72
72
  configureTestWorker(
73
73
  { pool: this.pool, watch: config.watch, isolate: config.isolate },
74
- (cleanup) => this.onCleanupWorkerContext(cleanup),
74
+ (cleanup) => this.onCleanupWorkerContext?.(cleanup),
75
75
  );
76
76
  }
77
77
  }
@@ -131,8 +131,8 @@ const testFeature = {
131
131
  devDependencies: {
132
132
  "@mongez/vite": "^2.0.4",
133
133
  vite: VITE_RANGE,
134
- vitest: "^4.1.10",
135
- "@vitest/coverage-v8": "^4.1.10"
134
+ vitest: "^5.0.3",
135
+ "@vitest/coverage-v8": "^5.0.3"
136
136
  }
137
137
  };
138
138
 
@@ -1 +1 @@
1
- {"version":3,"file":"test.feature.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/generations/features/test.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { fileExistsAsync, putFileAsync, recordSkippedFile } from \"../generation-fs\";\nimport type { CommandActionData } from \"../../commands/types\";\nimport { rootPath, srcPath } from \"../../utils\";\nimport type { FeatureDefinition } from \"./types\";\nimport { VITE_RANGE } from \"./web.feature\";\n\nasync function completeTestInstallation(options: CommandActionData) {\n // Create test-global-setup.ts (runs once before all tests)\n const testGlobalSetupPath = srcPath(\"test-global-setup.ts\");\n const testGlobalSetupExists = await fileExistsAsync(testGlobalSetupPath);\n\n if (!testGlobalSetupExists) {\n await putFileAsync(\n testGlobalSetupPath,\n `/**\n * Global Test Setup\n *\n * Runs ONCE before all test workers.\n * Starts the HTTP server for integration tests.\n *\n * port: 0 lets the OS pick a free port, so tests run while \\`warlock dev\\`\n * holds the configured one; the test helpers (testGet, actingAs, ...) are\n * told the bound port automatically.\n */\nimport { startHttpTestServer, stopHttpTestServer } from \"@warlock.js/core/tests\";\n\nexport async function setup() {\n await startHttpTestServer({ port: 0 });\n}\n\nexport async function teardown() {\n await stopHttpTestServer();\n}\n`,\n );\n console.log(`${colors.green(\"✓\")} Created src/test-global-setup.ts`);\n } else {\n recordSkippedFile(testGlobalSetupPath, \"exists\");\n }\n\n // Create test-setup.ts (runs before EVERY test file)\n const testSetupPath = srcPath(\"test-setup.ts\");\n const testSetupExists = await fileExistsAsync(testSetupPath);\n\n if (!testSetupExists) {\n await putFileAsync(\n testSetupPath,\n `/**\n * Test Setup - runs before EVERY test file\n *\n * Vitest runs setupFiles before each test file and rebuilds the module\n * registry with it, so this pair boots and closes the test runtime once per\n * test file.\n *\n * setupTest() gets no connectors option on purpose: an explicit connectors\n * value outranks tests.connectors from src/config/tests.ts, so passing one\n * here would erase your project config. Omitting it leaves the config in\n * charge.\n *\n * importModule makes Warlock load your app modules (config, routes, ...)\n * through THIS file's import(), which Vitest handles. Tests and the framework\n * then share one copy of every class, so \"owner instanceof User\" works.\n *\n * afterAll(teardownTest) is the other half of the pair: whoever calls\n * setupTest() owns closing it in the same runtime context.\n */\nimport { setupTest, teardownTest } from \"@warlock.js/core/tests\";\nimport { afterAll, expect } from \"vitest\";\n\nawait setupTest({ importModule: (file) => import(file), file: expect.getState().testPath });\n\nafterAll(teardownTest);\n`,\n );\n console.log(`${colors.green(\"✓\")} Created src/test-setup.ts`);\n } else {\n recordSkippedFile(testSetupPath, \"exists\");\n }\n\n const runnerPath = srcPath(\"test-runner.ts\");\n if (!(await fileExistsAsync(runnerPath))) {\n await putFileAsync(\n runnerPath,\n `import { configureTestWorker } from \"@warlock.js/core/tests\";\nimport { VitestTestRunner } from \"vitest/runners\";\n\n// Vitest 4.1 awaits onCleanupWorkerContext callbacks before recycling the fork.\nexport default class WarlockTestRunner extends VitestTestRunner {\n public constructor(config: ConstructorParameters<typeof VitestTestRunner>[0]) {\n super(config);\n configureTestWorker(\n { pool: this.pool, watch: config.watch, isolate: config.isolate },\n (cleanup) => this.onCleanupWorkerContext(cleanup),\n );\n }\n}\n`,\n );\n } else {\n recordSkippedFile(runnerPath, \"exists\");\n }\n\n // Create vite.config.ts\n const viteConfigPath = rootPath(\"vite.config.ts\");\n const viteConfigExists = await fileExistsAsync(viteConfigPath);\n\n if (!viteConfigExists) {\n await putFileAsync(\n viteConfigPath,\n `import { lowerStage3Decorators, recommendedTestWorkers, TestSetupReporter } from \"@warlock.js/core/vite\";\nimport mongezVite from \"@mongez/vite\";\nimport { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n plugins: [lowerStage3Decorators(), mongezVite()],\n test: {\n maxWorkers: recommendedTestWorkers(),\n reporters: [\"default\", new TestSetupReporter()],\n projects: [\n {\n extends: true,\n test: {\n name: \"unit\",\n environment: \"node\",\n include: [\"src/**/*.spec.ts\"],\n exclude: [\"src/**/tests/**\"],\n },\n },\n {\n extends: true,\n test: {\n name: \"integration\",\n environment: \"node\",\n pool: \"forks\",\n // Required only when opting into tests.lifetime: \"worker\".\n isolate: true,\n runner: \"./src/test-runner.ts\",\n globalSetup: \"./src/test-global-setup.ts\",\n setupFiles: [\"./src/test-setup.ts\"],\n include: [\"src/**/*.test.ts\", \"src/**/tests/**/*.{test,spec}.ts\", \"tests/**/*.{test,spec}.ts\"],\n },\n },\n ],\n },\n});\n`,\n );\n console.log(`${colors.green(\"✓\")} Created vite.config.ts`);\n } else {\n recordSkippedFile(viteConfigPath, \"exists\");\n }\n}\n\nexport const testFeature: FeatureDefinition = {\n description: \"Installs warlock test for testing\",\n onExecuting: completeTestInstallation,\n script: {\n test: \"vitest run\",\n \"test:coverage\": \"vitest run --coverage\",\n \"test:ui\": \"vitest --ui\",\n \"test:watch\": \"vitest --watch\",\n },\n devDependencies: {\n \"@mongez/vite\": \"^2.0.4\",\n vite: VITE_RANGE,\n vitest: \"^4.1.10\",\n \"@vitest/coverage-v8\": \"^4.1.10\",\n },\n};\n"],"mappings":";;;;;;;;AAOA,eAAe,yBAAyB,SAA4B;CAElE,MAAM,sBAAsB,QAAQ,sBAAsB;CAG1D,IAAI,CAAC,MAF+B,gBAAgB,mBAAmB,GAE3C;EAC1B,MAAM,aACJ,qBACA;;;;;;;;;;;;;;;;;;;CAoBF;EACA,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,kCAAkC;CACrE,OACE,kBAAkB,qBAAqB,QAAQ;CAIjD,MAAM,gBAAgB,QAAQ,eAAe;CAG7C,IAAI,CAAC,MAFyB,gBAAgB,aAAa,GAErC;EACpB,MAAM,aACJ,eACA;;;;;;;;;;;;;;;;;;;;;;;;;CA0BF;EACA,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,2BAA2B;CAC9D,OACE,kBAAkB,eAAe,QAAQ;CAG3C,MAAM,aAAa,QAAQ,gBAAgB;CAC3C,IAAI,CAAE,MAAM,gBAAgB,UAAU,GACpC,MAAM,aACJ,YACA;;;;;;;;;;;;;CAcF;MAEA,kBAAkB,YAAY,QAAQ;CAIxC,MAAM,iBAAiB,SAAS,gBAAgB;CAGhD,IAAI,CAAC,MAF0B,gBAAgB,cAAc,GAEtC;EACrB,MAAM,aACJ,gBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCF;EACA,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,wBAAwB;CAC3D,OACE,kBAAkB,gBAAgB,QAAQ;AAE9C;AAEA,MAAa,cAAiC;CAC5C,aAAa;CACb,aAAa;CACb,QAAQ;EACN,MAAM;EACN,iBAAiB;EACjB,WAAW;EACX,cAAc;CAChB;CACA,iBAAiB;EACf,gBAAgB;EAChB,MAAM;EACN,QAAQ;EACR,uBAAuB;CACzB;AACF"}
1
+ {"version":3,"file":"test.feature.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/generations/features/test.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { fileExistsAsync, putFileAsync, recordSkippedFile } from \"../generation-fs\";\nimport type { CommandActionData } from \"../../commands/types\";\nimport { rootPath, srcPath } from \"../../utils\";\nimport type { FeatureDefinition } from \"./types\";\nimport { VITE_RANGE } from \"./web.feature\";\n\nasync function completeTestInstallation(options: CommandActionData) {\n // Create test-global-setup.ts (runs once before all tests)\n const testGlobalSetupPath = srcPath(\"test-global-setup.ts\");\n const testGlobalSetupExists = await fileExistsAsync(testGlobalSetupPath);\n\n if (!testGlobalSetupExists) {\n await putFileAsync(\n testGlobalSetupPath,\n `/**\n * Global Test Setup\n *\n * Runs ONCE before all test workers.\n * Starts the HTTP server for integration tests.\n *\n * port: 0 lets the OS pick a free port, so tests run while \\`warlock dev\\`\n * holds the configured one; the test helpers (testGet, actingAs, ...) are\n * told the bound port automatically.\n */\nimport { startHttpTestServer, stopHttpTestServer } from \"@warlock.js/core/tests\";\n\nexport async function setup() {\n await startHttpTestServer({ port: 0 });\n}\n\nexport async function teardown() {\n await stopHttpTestServer();\n}\n`,\n );\n console.log(`${colors.green(\"✓\")} Created src/test-global-setup.ts`);\n } else {\n recordSkippedFile(testGlobalSetupPath, \"exists\");\n }\n\n // Create test-setup.ts (runs before EVERY test file)\n const testSetupPath = srcPath(\"test-setup.ts\");\n const testSetupExists = await fileExistsAsync(testSetupPath);\n\n if (!testSetupExists) {\n await putFileAsync(\n testSetupPath,\n `/**\n * Test Setup - runs before EVERY test file\n *\n * Vitest runs setupFiles before each test file and rebuilds the module\n * registry with it, so this pair boots and closes the test runtime once per\n * test file.\n *\n * setupTest() gets no connectors option on purpose: an explicit connectors\n * value outranks tests.connectors from src/config/tests.ts, so passing one\n * here would erase your project config. Omitting it leaves the config in\n * charge.\n *\n * importModule makes Warlock load your app modules (config, routes, ...)\n * through THIS file's import(), which Vitest handles. Tests and the framework\n * then share one copy of every class, so \"owner instanceof User\" works.\n *\n * afterAll(teardownTest) is the other half of the pair: whoever calls\n * setupTest() owns closing it in the same runtime context.\n */\nimport { setupTest, teardownTest } from \"@warlock.js/core/tests\";\nimport { afterAll, expect } from \"vitest\";\n\nawait setupTest({ importModule: (file) => import(file), file: expect.getState().testPath });\n\nafterAll(teardownTest);\n`,\n );\n console.log(`${colors.green(\"✓\")} Created src/test-setup.ts`);\n } else {\n recordSkippedFile(testSetupPath, \"exists\");\n }\n\n const runnerPath = srcPath(\"test-runner.ts\");\n if (!(await fileExistsAsync(runnerPath))) {\n await putFileAsync(\n runnerPath,\n `import { configureTestWorker } from \"@warlock.js/core/tests\";\nimport { TestRunner } from \"vitest\";\n\n// Vitest awaits onCleanupWorkerContext callbacks before recycling the fork.\nexport default class WarlockTestRunner extends TestRunner {\n public constructor(config: ConstructorParameters<typeof TestRunner>[0]) {\n super(config);\n configureTestWorker(\n { pool: this.pool, watch: config.watch, isolate: config.isolate },\n (cleanup) => this.onCleanupWorkerContext?.(cleanup),\n );\n }\n}\n`,\n );\n } else {\n recordSkippedFile(runnerPath, \"exists\");\n }\n\n // Create vite.config.ts\n const viteConfigPath = rootPath(\"vite.config.ts\");\n const viteConfigExists = await fileExistsAsync(viteConfigPath);\n\n if (!viteConfigExists) {\n await putFileAsync(\n viteConfigPath,\n `import { lowerStage3Decorators, recommendedTestWorkers, TestSetupReporter } from \"@warlock.js/core/vite\";\nimport mongezVite from \"@mongez/vite\";\nimport { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n plugins: [lowerStage3Decorators(), mongezVite()],\n test: {\n maxWorkers: recommendedTestWorkers(),\n reporters: [\"default\", new TestSetupReporter()],\n projects: [\n {\n extends: true,\n test: {\n name: \"unit\",\n environment: \"node\",\n include: [\"src/**/*.spec.ts\"],\n exclude: [\"src/**/tests/**\"],\n },\n },\n {\n extends: true,\n test: {\n name: \"integration\",\n environment: \"node\",\n pool: \"forks\",\n // Required only when opting into tests.lifetime: \"worker\".\n isolate: true,\n runner: \"./src/test-runner.ts\",\n globalSetup: \"./src/test-global-setup.ts\",\n setupFiles: [\"./src/test-setup.ts\"],\n include: [\"src/**/*.test.ts\", \"src/**/tests/**/*.{test,spec}.ts\", \"tests/**/*.{test,spec}.ts\"],\n },\n },\n ],\n },\n});\n`,\n );\n console.log(`${colors.green(\"✓\")} Created vite.config.ts`);\n } else {\n recordSkippedFile(viteConfigPath, \"exists\");\n }\n}\n\nexport const testFeature: FeatureDefinition = {\n description: \"Installs warlock test for testing\",\n onExecuting: completeTestInstallation,\n script: {\n test: \"vitest run\",\n \"test:coverage\": \"vitest run --coverage\",\n \"test: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ACR,uBAAuB;CACzB;AACF"}
@@ -9,8 +9,8 @@ import { resolveContactScaffold } from "./shared/resolve-contact-scaffold.mjs";
9
9
  import { colors } from "@mongez/copper";
10
10
 
11
11
  //#region ../../packages/core/src/generations/features/web.feature.ts
12
- /** The one vite range shared by every feature (web's peer range is `>=7.3.5 <8`). */
13
- const VITE_RANGE = "^7.3.5";
12
+ /** The one vite range shared by every feature (web's peer range is `^8.0.0`). */
13
+ const VITE_RANGE = "^8.3.3";
14
14
  /**
15
15
  * Register the WebConnector in `warlock.config.ts`, and ONLY there.
16
16
  *
@@ -111,7 +111,7 @@ const webFeature = {
111
111
  "@types/react": "^19.2.7",
112
112
  "@types/react-dom": "^19.2.3",
113
113
  vite: VITE_RANGE,
114
- "@vitejs/plugin-react": "^5.2.0"
114
+ "@vitejs/plugin-react": "^6.1.2"
115
115
  },
116
116
  onExecuting: completeWebInstallation
117
117
  };
@@ -1 +1 @@
1
- {"version":3,"file":"web.feature.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/generations/features/web.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport {\n ensureDirectoryAsync,\n fileExistsAsync,\n getFileAsync,\n putFileAsync,\n} from \"../generation-fs\";\nimport type { CommandActionData } from \"../../commands/types\";\nimport { rootPath, srcPath } from \"../../utils\";\nimport { insertConnectorEntry } from \"./shared/insert-connector-entry\";\nimport { relocateConflictingHomeRoute } from \"./shared/relocate-conflicting-home-route\";\nimport { resolveContactScaffold } from \"./shared/resolve-contact-scaffold\";\nimport {\n webContactControllerStub,\n webContactRoutesStub,\n webHomePageStub,\n webHomeSetupStub,\n webRootStub,\n webRootSetupStub,\n} from \"../stubs\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\n/** The one vite range shared by every feature (web's peer range is `>=7.3.5 <8`). */\nexport const VITE_RANGE = \"^7.3.5\";\n\n/**\n * Register the WebConnector in `warlock.config.ts`, and ONLY there.\n *\n * It belongs to the config array or to app code, never both. Both halves are\n * registered before app code loads — the CLI preloader in dev, the generated\n * entry in production — so also calling `connectorsManager.register(...)` in\n * `src/app/main.ts` boots the connector twice and installs every page route\n * twice. That surfaces at PRODUCTION boot as `Route name \"...\" is already\n * taken`, because pages and API routes share one route-name namespace.\n *\n * The config array is the half to prefer: `warlock build` reads the same array\n * to drain each connector's build contribution, so \"built for\" and \"boots with\"\n * cannot drift.\n *\n * String surgery rather than a TypeScript parse: `warlock.config.ts` is an\n * app-owned file that may carry any formatting, and a parse-and-print would\n * reformat the parts we did not come to change.\n */\nasync function registerWebConnector(): Promise<void> {\n const configPath = rootPath(\"warlock.config.ts\");\n\n if (!(await fileExistsAsync(configPath))) {\n console.log(\n `${colors.yellowBright(\"warlock.config.ts\")} not found — add this yourself:\\n` +\n ` import { webConnector } from \"@warlock.js/web/connector\";\\n` +\n ` export default defineConfig({ connectors: [webConnector()] });`,\n );\n\n return;\n }\n\n const current = await getFileAsync(configPath);\n\n if (current.includes(\"webConnector\")) {\n console.log(`${colors.yellowBright(\"webConnector\")} already registered, skipping...`);\n\n return;\n }\n\n const importLine = 'import { webConnector } from \"@warlock.js/web/connector\";';\n let next = current.includes(importLine) ? current : `${importLine}\\n${current}`;\n\n // An existing `connectors: [` gains one entry; otherwise the key is added to\n // the object `defineConfig` receives.\n const insertion = insertConnectorEntry(next, \"webConnector()\");\n\n if (insertion.status === \"already-present\") {\n return;\n }\n\n if (insertion.status === \"added\") {\n next = insertion.next;\n } else if (next.includes(\"defineConfig({\")) {\n next = next.replace(\"defineConfig({\", \"defineConfig({\\n connectors: [webConnector()],\");\n } else {\n console.log(\n `${colors.yellowBright(\"warlock.config.ts\")} has no recognisable defineConfig({...}) — ` +\n \"add `connectors: [webConnector()]` yourself.\",\n );\n\n return;\n }\n\n await putFileAsync(configPath, next);\n console.log(`${colors.green(\"✓\")} Registered webConnector in warlock.config.ts`);\n}\n\n/**\n * Scaffold the smallest page layer that renders, and register the connector.\n *\n * `src/web/root.tsx` is the sentinel for \"already scaffolded\" — the framework\n * ships a default root, so its presence means a human has been here.\n */\nasync function completeWebInstallation(_options: CommandActionData) {\n const rootFile = srcPath(\"web/root.tsx\");\n\n if (await fileExistsAsync(rootFile)) {\n console.log(`${colors.yellowBright(\"src/web\")} already scaffolded, skipping...`);\n } else {\n await ensureDirectoryAsync(srcPath(\"web\"));\n await putFileAsync(rootFile, webRootStub);\n const rootSetupFile = srcPath(\"web/root.setup.ts\");\n if (!(await fileExistsAsync(rootSetupFile))) {\n await putFileAsync(rootSetupFile, webRootSetupStub);\n }\n console.log(`${colors.green(\"✓\")} Created src/web/root.tsx`);\n\n const collision = await relocateConflictingHomeRoute();\n\n if (collision.outcome === \"relocated\") {\n console.log(\n `${colors.green(\"✓\")} Moved the existing ${colors.yellowBright('GET \"/\"')} route to ` +\n `${colors.yellowBright('\"/welcome\"')} in ${colors.yellowBright(`src/${collision.relativePath}`)} — ` +\n \"the new page owns `/` now, and the JSON welcome route still answers at /welcome.\",\n );\n }\n\n // The page is written ONLY when `/` is provably free. Writing it while\n // another handler holds `/` produces a homepage that 500s on first request,\n // which is precisely the outcome a scaffolder must never hand back.\n if (collision.outcome === \"conflict\" || collision.outcome === \"failed\") {\n const verb =\n collision.outcome === \"failed\" ? colors.redBright(\"✗\") : colors.yellowBright(\"!\");\n\n console.log(\n `${verb} Did not create src/web/index.page.tsx: ${collision.reason}.\\n` +\n ` The page setup declares ${colors.yellowBright('route.path = \"/\"')}, and two handlers on one ` +\n \"path is a 500 at request time, not a startup error.\\n\" +\n ` Free up ${colors.yellowBright('GET \"/\"')} under src/app — move it to a path of its own, ` +\n \"or remove it — then create src/web/index.page.tsx yourself. Giving the setup file a `config.route` other \" +\n \"than `/` works too.\",\n );\n\n // Non-zero on BOTH branches. The page layer this command exists to\n // scaffold was not scaffolded, and a 0 here is the exact \"looked like it\n // worked\" signal that put `/` in this state to begin with — a conflict we\n // declined to guess at is still an incomplete install, not a success.\n //\n // `exitCode` rather than `exit(1)`: the connector below still has to be\n // registered, and any other feature in the same `warlock add` invocation\n // still has to install, or the project is left half-wired on top of this.\n process.exitCode = 1;\n } else {\n await putFileAsync(srcPath(\"web/index.page.tsx\"), webHomePageStub);\n const homeSetupFile = srcPath(\"web/index.setup.ts\");\n if (!(await fileExistsAsync(homeSetupFile))) {\n await putFileAsync(homeSetupFile, webHomeSetupStub);\n }\n\n // Unlike root.tsx above, the contact controller and its routes file are\n // ordinary application files a project can already have — independently\n // of ever having run `warlock add web`. Each is guarded on its OWN\n // existence, not on the (already-consumed) root.tsx sentinel, so an\n // existing `contact` module is skipped rather than clobbered. See\n // resolveContactScaffold's doc comment for why.\n const contactPlan = resolveContactScaffold({\n controllerExists: await fileExistsAsync(\n srcPath(\"app/contact/controllers/contact.controller.ts\"),\n ),\n routesExists: await fileExistsAsync(srcPath(\"app/contact/routes.ts\")),\n });\n\n if (contactPlan.writeController) {\n await ensureDirectoryAsync(srcPath(\"app/contact/controllers\"));\n await putFileAsync(\n srcPath(\"app/contact/controllers/contact.controller.ts\"),\n webContactControllerStub,\n );\n }\n\n if (contactPlan.writeRoutes) {\n await ensureDirectoryAsync(srcPath(\"app/contact\"));\n await putFileAsync(srcPath(\"app/contact/routes.ts\"), webContactRoutesStub);\n }\n\n console.log(`${colors.green(\"✓\")} Created src/web/index.page.tsx`);\n\n for (const message of contactPlan.messages) {\n console.log(message);\n }\n }\n }\n\n await registerWebConnector();\n}\n\nexport const webFeature: FeatureDefinition = {\n description:\n \"Installs @warlock.js/web — SSR React pages served by the Warlock HTTP server. Scaffolds src/web (root.tsx + a home page) and registers the WebConnector in warlock.config.ts. Pages are opt-in: a Warlock app is an API until you add this.\",\n dependencies: {\n \"@warlock.js/web\": INSTALLED_WARLOCK_VERSION,\n \"@mongez/http\": \"^3.5.0\",\n \"@mongez/react-form\": \"^4.0.0\",\n \"@mongez/react-localization\": \"^3.4.7\",\n react: \"^19.2.3\",\n \"react-dom\": \"^19.2.3\",\n },\n devDependencies: {\n \"@types/react\": \"^19.2.7\",\n \"@types/react-dom\": \"^19.2.3\",\n // Loaded through `await import()` by the dev server only, so both are\n // optional peers of `web` rather than hard dependencies.\n vite: VITE_RANGE,\n \"@vitejs/plugin-react\": \"^5.2.0\",\n },\n onExecuting: completeWebInstallation,\n};\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAa,aAAa;;;;;;;;;;;;;;;;;;;AAoB1B,eAAe,uBAAsC;CACnD,MAAM,aAAa,SAAS,mBAAmB;CAE/C,IAAI,CAAE,MAAM,gBAAgB,UAAU,GAAI;EACxC,QAAQ,IACN,GAAG,OAAO,aAAa,mBAAmB,EAAE,+JAG9C;EAEA;CACF;CAEA,MAAM,UAAU,MAAM,aAAa,UAAU;CAE7C,IAAI,QAAQ,SAAS,cAAc,GAAG;EACpC,QAAQ,IAAI,GAAG,OAAO,aAAa,cAAc,EAAE,iCAAiC;EAEpF;CACF;CAEA,MAAM,aAAa;CACnB,IAAI,OAAO,QAAQ,SAAS,UAAU,IAAI,UAAU,GAAG,WAAW,IAAI;CAItE,MAAM,YAAY,qBAAqB,MAAM,gBAAgB;CAE7D,IAAI,UAAU,WAAW,mBACvB;CAGF,IAAI,UAAU,WAAW,SACvB,OAAO,UAAU;MACZ,IAAI,KAAK,SAAS,gBAAgB,GACvC,OAAO,KAAK,QAAQ,kBAAkB,iDAAiD;MAClF;EACL,QAAQ,IACN,GAAG,OAAO,aAAa,mBAAmB,EAAE,0FAE9C;EAEA;CACF;CAEA,MAAM,aAAa,YAAY,IAAI;CACnC,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG,EAAE,8CAA8C;AACjF;;;;;;;AAQA,eAAe,wBAAwB,UAA6B;CAClE,MAAM,WAAW,QAAQ,cAAc;CAEvC,IAAI,MAAM,gBAAgB,QAAQ,GAChC,QAAQ,IAAI,GAAG,OAAO,aAAa,SAAS,EAAE,iCAAiC;MAC1E;EACL,MAAM,qBAAqB,QAAQ,KAAK,CAAC;EACzC,MAAM,aAAa,UAAU,WAAW;EACxC,MAAM,g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AgC;GAEjE,KAAK,MAAM,WAAW,YAAY,UAChC,QAAQ,IAAI,OAAO;EAEvB;CACF;CAEA,MAAM,qBAAqB;AAC7B;AAEA,MAAa,aAAgC;CAC3C,aACE;CACF,cAAc;EACZ,mBAAmB;EACnB,gBAAgB;EAChB,sBAAsB;EACtB,8BAA8B;EAC9B,OAAO;EACP,aAAa;CACf;CACA,iBAAiB;EACf,gBAAgB;EAChB,oBAAoB;EAGpB,MAAM;EACN,wBAAwB;CAC1B;CACA,aAAa;AACf"}
1
+ {"version":3,"file":"web.feature.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/generations/features/web.feature.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport {\n ensureDirectoryAsync,\n fileExistsAsync,\n getFileAsync,\n putFileAsync,\n} from \"../generation-fs\";\nimport type { CommandActionData } from \"../../commands/types\";\nimport { rootPath, srcPath } from \"../../utils\";\nimport { insertConnectorEntry } from \"./shared/insert-connector-entry\";\nimport { relocateConflictingHomeRoute } from \"./shared/relocate-conflicting-home-route\";\nimport { resolveContactScaffold } from \"./shared/resolve-contact-scaffold\";\nimport {\n webContactControllerStub,\n webContactRoutesStub,\n webHomePageStub,\n webHomeSetupStub,\n webRootStub,\n webRootSetupStub,\n} from \"../stubs\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\n/** The one vite range shared by every feature (web's peer range is `^8.0.0`). */\nexport const VITE_RANGE = \"^8.3.3\";\n\n/**\n * Register the WebConnector in `warlock.config.ts`, and ONLY there.\n *\n * It belongs to the config array or to app code, never both. Both halves are\n * registered before app code loads — the CLI preloader in dev, the generated\n * entry in production — so also calling `connectorsManager.register(...)` in\n * `src/app/main.ts` boots the connector twice and installs every page route\n * twice. That surfaces at PRODUCTION boot as `Route name \"...\" is already\n * taken`, because pages and API routes share one route-name namespace.\n *\n * The config array is the half to prefer: `warlock build` reads the same array\n * to drain each connector's build contribution, so \"built for\" and \"boots with\"\n * cannot drift.\n *\n * String surgery rather than a TypeScript parse: `warlock.config.ts` is an\n * app-owned file that may carry any formatting, and a parse-and-print would\n * reformat the parts we did not come to change.\n */\nasync function registerWebConnector(): Promise<void> {\n const configPath = rootPath(\"warlock.config.ts\");\n\n if (!(await fileExistsAsync(configPath))) {\n console.log(\n `${colors.yellowBright(\"warlock.config.ts\")} not found — add this yourself:\\n` +\n ` import { webConnector } from \"@warlock.js/web/connector\";\\n` +\n ` export default defineConfig({ connectors: [webConnector()] });`,\n );\n\n return;\n }\n\n const current = await getFileAsync(configPath);\n\n if (current.includes(\"webConnector\")) {\n console.log(`${colors.yellowBright(\"webConnector\")} already registered, skipping...`);\n\n return;\n }\n\n const importLine = 'import { webConnector } from \"@warlock.js/web/connector\";';\n let next = current.includes(importLine) ? current : `${importLine}\\n${current}`;\n\n // An existing `connectors: [` gains one entry; otherwise the key is added to\n // the object `defineConfig` receives.\n const insertion = insertConnectorEntry(next, \"webConnector()\");\n\n if (insertion.status === \"already-present\") {\n return;\n }\n\n if (insertion.status === \"added\") {\n next = insertion.next;\n } else if (next.includes(\"defineConfig({\")) {\n next = next.replace(\"defineConfig({\", \"defineConfig({\\n connectors: [webConnector()],\");\n } else {\n console.log(\n `${colors.yellowBright(\"warlock.config.ts\")} has no recognisable defineConfig({...}) — ` +\n \"add `connectors: [webConnector()]` yourself.\",\n );\n\n return;\n }\n\n await putFileAsync(configPath, next);\n console.log(`${colors.green(\"✓\")} Registered webConnector in warlock.config.ts`);\n}\n\n/**\n * Scaffold the smallest page layer that renders, and register the connector.\n *\n * `src/web/root.tsx` is the sentinel for \"already scaffolded\" — the framework\n * ships a default root, so its presence means a human has been here.\n */\nasync function completeWebInstallation(_options: CommandActionData) {\n const rootFile = srcPath(\"web/root.tsx\");\n\n if (await fileExistsAsync(rootFile)) {\n console.log(`${colors.yellowBright(\"src/web\")} already scaffolded, skipping...`);\n } else {\n await ensureDirectoryAsync(srcPath(\"web\"));\n await putFileAsync(rootFile, webRootStub);\n const rootSetupFile = srcPath(\"web/root.setup.ts\");\n if (!(await fileExistsAsync(rootSetupFile))) {\n await putFileAsync(rootSetupFile, webRootSetupStub);\n }\n console.log(`${colors.green(\"✓\")} Created src/web/root.tsx`);\n\n const collision = await relocateConflictingHomeRoute();\n\n if (collision.outcome === \"relocated\") {\n console.log(\n `${colors.green(\"✓\")} Moved the existing ${colors.yellowBright('GET \"/\"')} route to ` +\n `${colors.yellowBright('\"/welcome\"')} in ${colors.yellowBright(`src/${collision.relativePath}`)} — ` +\n \"the new page owns `/` now, and the JSON welcome route still answers at /welcome.\",\n );\n }\n\n // The page is written ONLY when `/` is provably free. Writing it while\n // another handler holds `/` produces a homepage that 500s on first request,\n // which is precisely the outcome a scaffolder must never hand back.\n if (collision.outcome === \"conflict\" || collision.outcome === \"failed\") {\n const verb =\n collision.outcome === \"failed\" ? colors.redBright(\"✗\") : colors.yellowBright(\"!\");\n\n console.log(\n `${verb} Did not create src/web/index.page.tsx: ${collision.reason}.\\n` +\n ` The page setup declares ${colors.yellowBright('route.path = \"/\"')}, and two handlers on one ` +\n \"path is a 500 at request time, not a startup error.\\n\" +\n ` Free up ${colors.yellowBright('GET \"/\"')} under src/app — move it to a path of its own, ` +\n \"or remove it — then create src/web/index.page.tsx yourself. Giving the setup file a `config.route` other \" +\n \"than `/` works too.\",\n );\n\n // Non-zero on BOTH branches. The page layer this command exists to\n // scaffold was not scaffolded, and a 0 here is the exact \"looked like it\n // worked\" signal that put `/` in this state to begin with — a conflict we\n // declined to guess at is still an incomplete install, not a success.\n //\n // `exitCode` rather than `exit(1)`: the connector below still has to be\n // registered, and any other feature in the same `warlock add` invocation\n // still has to install, or the project is left half-wired on top of this.\n process.exitCode = 1;\n } else {\n await putFileAsync(srcPath(\"web/index.page.tsx\"), webHomePageStub);\n const homeSetupFile = srcPath(\"web/index.setup.ts\");\n if (!(await fileExistsAsync(homeSetupFile))) {\n await putFileAsync(homeSetupFile, webHomeSetupStub);\n }\n\n // Unlike root.tsx above, the contact controller and its routes file are\n // ordinary application files a project can already have — independently\n // of ever having run `warlock add web`. Each is guarded on its OWN\n // existence, not on the (already-consumed) root.tsx sentinel, so an\n // existing `contact` module is skipped rather than clobbered. See\n // resolveContactScaffold's doc comment for why.\n const contactPlan = resolveContactScaffold({\n controllerExists: await fileExistsAsync(\n srcPath(\"app/contact/controllers/contact.controller.ts\"),\n ),\n routesExists: await fileExistsAsync(srcPath(\"app/contact/routes.ts\")),\n });\n\n if (contactPlan.writeController) {\n await ensureDirectoryAsync(srcPath(\"app/contact/controllers\"));\n await putFileAsync(\n srcPath(\"app/contact/controllers/contact.controller.ts\"),\n webContactControllerStub,\n );\n }\n\n if (contactPlan.writeRoutes) {\n await ensureDirectoryAsync(srcPath(\"app/contact\"));\n await putFileAsync(srcPath(\"app/contact/routes.ts\"), webContactRoutesStub);\n }\n\n console.log(`${colors.green(\"✓\")} Created src/web/index.page.tsx`);\n\n for (const message of contactPlan.messages) {\n console.log(message);\n }\n }\n }\n\n await registerWebConnector();\n}\n\nexport const webFeature: FeatureDefinition = {\n description:\n \"Installs @warlock.js/web — SSR React pages served by the Warlock HTTP server. Scaffolds src/web (root.tsx + a home page) and registers the WebConnector in warlock.config.ts. Pages are opt-in: a Warlock app is an API until you add this.\",\n dependencies: {\n \"@warlock.js/web\": INSTALLED_WARLOCK_VERSION,\n \"@mongez/http\": \"^3.5.0\",\n \"@mongez/react-form\": \"^4.0.0\",\n \"@mongez/react-localization\": \"^3.4.7\",\n react: \"^19.2.3\",\n \"react-dom\": \"^19.2.3\",\n },\n devDependencies: {\n \"@types/react\": \"^19.2.7\",\n \"@types/react-dom\": \"^19.2.3\",\n // Loaded through `await import()` by the dev server only, so both are\n // optional peers of `web` rather than hard dependencies.\n vite: VITE_RANGE,\n \"@vitejs/plugin-react\": \"^6.1.2\",\n },\n onExecuting: completeWebInstallation,\n};\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAa,aAAa;;;;;;;;;;;;;;;;;;;AAoB1B,eAAe,uBAAsC;CACnD,MAA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AChB,oBAAoB;EAGpB,MAAM;EACN,wBAAwB;CAC1B;CACA,aAAa;AACf"}
package/esm/index.d.mts CHANGED
@@ -94,7 +94,7 @@ import { matchesDerivedRouteName, routeNameMethodSuffix } from "./router/route-n
94
94
  import { RouteNameTakenError } from "./router/route-name-taken-error.mjs";
95
95
  import { RouteRegistry } from "./router/route-registry.mjs";
96
96
  import { Router, router } from "./router/router.mjs";
97
- import { AUTH_GUARD_MARKER, isAuthGuardMiddleware, isUnguardedMutatingRoute, markAuthGuard, reportUnguardedMutatingRoutes, resetUnguardedRouteReports } from "./router/unguarded-route-diagnostics.mjs";
97
+ import { AUTH_GUARD_MARKER, isAuthGuardMiddleware, isRequiredGuardRoute, isUnguardedMutatingRoute, markAuthGuard, reportUnguardedMutatingRoutes, resetUnguardedRouteReports } from "./router/unguarded-route-diagnostics.mjs";
98
98
  import "./router/index.mjs";
99
99
  import { app } from "./application/app.mjs";
100
100
  import { Environment, RuntimeStrategy, environment, setEnvironment } from "./utils/environment.mjs";
@@ -121,7 +121,8 @@ import { ConfigIssue, ConfigModuleEntry, ConfigOf, ConfigSchema, ConfigSchemaOpt
121
121
  import { setConfig } from "./config/config-setter.mjs";
122
122
  import { ConfigSpecialHandlers, configSpecialHandlers } from "./config/config-special-handlers.mjs";
123
123
  import "./config/index.mjs";
124
- import { BudgetPage, BudgetViolation, BuildBudgetReport, BuildBudgets, PageBudget } from "./production/build-budgets.mjs";
124
+ import { BudgetPage, BudgetViolation, BuildBudgetReport, BuildBudgets, PageBudget, PayloadBudget } from "./production/build-budgets.mjs";
125
+ import { ReleaseCheck, ReleaseConfig } from "./release/types.mjs";
125
126
  import { WarlockConfig } from "./warlock-config/types.mjs";
126
127
  import { Connector, ConnectorBuildContext, ConnectorBuildContribution, ConnectorBuildGenerateResult, ConnectorEsbuildPatch, ConnectorLifecyclePhase, ConnectorName, ConnectorPriority } from "./connectors/types.mjs";
127
128
  import { BaseConnector } from "./connectors/base-connector.mjs";
@@ -168,6 +169,8 @@ import { setLogConfigurations } from "./logger/logger.mjs";
168
169
  import "./logger/index.mjs";
169
170
  import { LocaleDictionaryEntries, LocaleDictionaryError, ParsedLocaleDictionary, parseLocaleDictionary } from "./localization/parse-locale-dictionary.mjs";
170
171
  import { registerGroupedTranslationKeys, registerLocaleDictionary, unregisterLocaleDictionary } from "./localization/register-locale-dictionary.mjs";
172
+ import { EMPTY_TRANSLATION_USAGE, TranslationDynamicSite, TranslationSourceScan, TranslationUsage, isTranslationKeyUsed, mergeTranslationUsage, readTranslationDeclarations, scanTranslationSource, translationDeclarationUsage, usageOf } from "./localization/translation-usage.mjs";
173
+ import { TranslationGraphInput, TranslationGraphResult, analyzePageTranslationUsage, analyzeTranslationGraph, readSourceFile, resolveSourceImport } from "./localization/translation-usage-graph.mjs";
171
174
  import { CapturedMail, MailAddress, MailAttachment, MailConfigurations, MailError, MailErrorCode, MailEvents, MailMode, MailOptions, MailPriority, MailResult, MailersConfig, NormalizedMail, SESConfigurations, SMTPConfigurations } from "./mail/types.mjs";
172
175
  import { getDefaultMailConfig, getExplicitMailMode, getMailMode, getMailerConfig, isDevelopmentMode, isProductionMode, isTestMode, resetMailConfig, resetMailMode, resolveMailConfig, setMailConfigurations, setMailMode } from "./mail/config.mjs";
173
176
  import { MAIL_EVENTS, generateMailId, getMailEventName, mailEvents } from "./mail/events.mjs";
@@ -235,7 +238,7 @@ import "./warlock-config/index.mjs";
235
238
  import { env } from "@mongez/dotenv";
236
239
  import { colors } from "@mongez/copper";
237
240
  export * from "@mongez/localization";
238
- export { $registerUseCase, $unregisterUseCase, APP_ROLES, AUTH_GUARD_MARKER, AccessConnector, AggregateExpressionInput, AggregateExpressions, AiConnector, AllRepositoryOptions, AppConfigurations, AppError, AppRole, Application, AuthDescriptor, BOOT_SIGNAL_ENV_KEY, BOOT_SIGNAL_VERSION, BadRequestError, BadSchemaUseCaseError, BaseCastOutput, BaseConnector, type BenchmarkChannel, type BenchmarkConfigurations, type BenchmarkErrorResult, type BenchmarkOptions, BenchmarkProfiler, type BenchmarkProfilerOptions, type BenchmarkResult, BenchmarkSnapshots, type BenchmarkSnapshotsOptions, type BenchmarkStats, type BenchmarkSuccessResult, BootContext, BootListener, BootSignal, BootSignalType, BootValidator, type BudgetPage, type BudgetViolation, type BuildBudgetReport, type BuildBudgets, CLICommand, type CLICommandAction, type CLICommandOption, type CLICommandOptions, type CLICommandPreload, type CLICommandSource, CacheConnector, type CacheMiddlewareOptions, CachedRepositoryOptions, type CapturedMail, CascadeAdapter, CascadeQueryBuilder, CastOutput, ChunkCallback, ClockSource, ClosableServer, CloudDriver, CloudStorageDriverContract, CloudStorageDriverOptions, CloudStorageFileData, type CommandActionData, type ConcurrencyLimitOptions, ConditionalRequestInput, ConditionalRequestOutcome, ConfigIssue, ConfigKey, ConfigKeyRegistry, ConfigModuleEntry, ConfigName, ConfigOf, ConfigRegistry, ConfigSchema, ConfigSchemaOptions, ConfigSpecialHandlers, ConflictError, Connector, ConnectorBuildContext, ConnectorBuildContribution, ConnectorBuildGenerateResult, ConnectorEsbuildPatch, ConnectorLifecyclePhase, ConnectorName, ConnectorPriority, ConnectorsManager, ConsoleChannel, ContainerTypes, CookieJarUnavailableError, CookieOptions, CspConfig, CsrfOriginCheckReason, CsrfOriginVerdict, CursorPaginationOptions, CursorPaginationResult, DEFAULT_CSP_DIRECTIVES, DEFAULT_POSTMAN_BASE_URL, DOSpacesDriver, DatabaseCacheDriver, type DatabaseCacheOptions, DatabaseConnector, DatabaseLog, DatabaseLogModel, DatabaseLogOptions, DecodedAccessToken, DefineResourceOptions, DeleteManyResult, DetectedImageFormat, type DevelopmentAppModuleEntry, type DevelopmentAppModules, type DevelopmentModelModuleEntry, type DevelopmentModelModuleState, type DevelopmentModelModules, DevelopmentPostmanResult, ERROR_CODES, ERROR_CODES_DOCS_URL, EncryptionConfigurations, EncryptionPasswordConfigurations, EntityTag, Environment, ErrorCodeArea, ErrorCodeCategory, ErrorCodeDefinition, EventSubscription, ExistsExceptCurrentIdRuleOptions, ExistsExceptCurrentUserRuleOptions, FastifyInstance, FieldOutput, FileNamingStrategy, FileValidationOptions, FileValidator, FileVisibility, FilterFunction, FilterOperator, FilterOptions, FilterRule, FilterRules, ForbiddenError, GenerateImageVariantsOptions, GeneratedImageDescriptor, GeneratedImageVariant, GroupByFields, GroupedRoutesOptions, HealthCheck, HealthStatus, HeraldConnector, HttpConfigurations, HttpConnector, HttpContext, HttpError, HttpErrorCodes, type HttpErrorMapper, type HttpErrorMapping, type HttpErrorResponseContext, type HttpErrorResponseFormatter, HttpLoggingConfig, HttpReadyReport, HttpServerOptions, HttpServerRebuiltListener, HttpTracingConfig, type IdempotencyOptions, IdsSource, Image, ImageFormat, ImageInput, ImageTransformCallback, ImageTransformConfig, ImageTransformOptions, ImageVariantDefinition, ImageVariantFit, ImageVariantOutputFormat, ImageVariantsConfigError, InvalidConfigError, InvalidCspDirectiveError, type IpFilterOptions, JavaScriptRuntime, JavaScriptRuntimeName, ListEndpointBody, ListEndpointOptions, ListEndpointRepositoryOptions, ListOptions, ListQuery, LocalDriver, LocalStorageDriverOptions, LocaleDictionaryEntries, LocaleDictionaryError, LocalizedObject, LogConfigurations, LoggerConnector, MAIL_EVENTS, Mail, type MailAddress, type MailAttachment, type MailConfigurations, MailError, type MailErrorCode, type MailEvents, type MailMode, type MailOptions, type MailPriority, type MailResult, MailerConnector, type MailersConfig, type MaintenanceOptions, MemorySecretBackend, Middleware, MiddlewareResponse, MimeTypes, ModelResourceRegistry, NULLABLE_RESOURCE, NamedApiRoute, NamedApiRoutesOptions, NoopChannel, type NormalizedMail, NotAcceptableError, NotAllowedError, NotificationsConnector, NullableResource, NullableResourceTarget, OPENAPI_JSON_SCHEMA_DIALECT, OpenApiBuildResult, OpenApiComponents, OpenApiContext, OpenApiDocument, OpenApiOperation, OpenApiParameter, OpenApiRequestBody, OpenApiResponse, OpenApiRouteInput, OpenApiSchema, OpenApiSecurityRequirement, OpenApiSecurityScheme, OpenApiValidationResponseConfig, POSTMAN_COLLECTION_SCHEMA, type PageBudget, PaginationMode, PaginationResult, ParsedLocaleDictionary, PartialMiddleware, PartialPick, Path, PipeableReactStream, PipelineOptions, PortInUseError, PositionalHandlerSuspect, PostmanAuth, PostmanAuthEntry, PostmanBody, PostmanCollection, PostmanCollectionOptions, PostmanFolder, PostmanFormParam, PostmanHeader, PostmanItem, PostmanOriginalRequest, PostmanQueryParam, PostmanRequest, PostmanRequestItem, PostmanResponse, PostmanUrl, PostmanVariable, PrefixConfig, PrefixOptions, PresignedOptions, PresignedUploadOptions, PrivateRequestLoggingRule, PurgeImageVariantsOptions, PutDirectoryOptions, PutDirectoryResult, PutFromUrlOptions, PutOptions, QueryBuilderContract, Queue, R2Driver, R2StorageDriverOptions, type RateLimitOptions, RegisterConfiguredConnectorsOptions, RegisterResource, RegisteredUseCase, RepositoryAdapterContract, RepositoryConfigurations, RepositoryEvent, RepositoryManager, RepositoryOptions, RepositoryOptionsWithCursor, RepositoryOptionsWithPages, Request, RequestContextStore, RequestController, RequestControllerContract, RequestEvent, RequestHandler, RequestHandlerType, RequestHandlerValidation, RequestLocals, RequestLog, RequestLogSnapshot, RequestLogSource, RequestLoggingOptions, RequestMethod, RequestTranslator, ResolveImageVariantInput, type ResolvedCLICommandOption, ResolvedImageVariant, ResolvedImageVariantsConfig, Resource, ResourceArraySchema, ResourceCastType, ResourceConstructor, ResourceContract, ResourceFieldBuilder, ResourceFieldBuilderDateOutputOptions, ResourceFieldConfig, ResourceMethod, ResourceNotFoundError, ResourceOutput, ResourceOutputOf, ResourceOutputValueCastType, ResourceSchema, ResourceSelfReference, Response, ResponseBodyOutput, ResponseBodyValue, ResponseEvent, ResponseSSEController, ResponseSSEMessageOptions, ResponseSSEOptions, ResponseSchema, ResponseSchemaOutput, ResponseStatus, ResponseStreamController, ResponseStreamOptions, Restful, RestfulMiddleware, ReturnedResponse, Route, RouteNameTakenError, RouteOptions, RouteRateLimitOptions, RouteRegistry, RouteResource, Router, RouterGroupCallback, RouterStacks, RuntimeStrategy, S3Driver, type SESConfigurations, type SMTPConfigurations, SUPPORTED_RUNTIMES_DOCS_URL, SafeFetchOptions, SafeFetchResult, SafeRedirectOptions, SaveAsOptions, SaveMode, SaveOptions, ScopedStorage, ScopedStorageContract, type SecretBackend, type SecretBackendType, SecretStore, SecretStoreError, SecretStoreErrorCode, type SecretStoreOptions, type SecretsConfigurations, SeedClock, SeedContext, SeedRecordRef, SeedResult, Seeder, SeederDependencyCycleError, SeederMetadata, SendBufferOptions, SendFileOptions, Serialized, SerializedWire, ServerError, ShutdownListener, SocketAdapterFactory, SocketConnector, SocketOptions, StaticMountOptions, Storage, StorageCapabilityError, StorageConfigurations, StorageConnector, StorageCopyEventPayload, StorageDriverConfig, StorageDriverContextStore, StorageDriverContract, StorageDriverName, StorageDriverRegistry, StorageDriverType, StorageError, StorageErrorOptions, StorageEventHandler, StorageEventPayload, StorageEventType, StorageFile, StorageFileData, StorageFileInfo, StorageManagerContract, StorageNotInitializedError, StoragePutEventPayload, StreamReactResponseOptions, TemporaryTokenError, TemporaryTokenPayload, TemporaryTokenValidation, TracingContext, TracingContextSource, TracingHooks, TracingPhaseInfo, TracingRequestEndInfo, Track, TrackableModel, TypedAllRepositoryOptions, TypedRepositoryOptions, TypedRepositoryOptionsWithCursor, TypedRepositoryOptionsWithPages, UPDATE_MANY_BATCH_SIZE, UPLOADS_DEFAULTS, URL_CREDENTIAL_PARAMS, UnAuthorizedError, UniqueExceptCurrentIdRuleOptions, UniqueExceptCurrentUserRuleOptions, UnknownSeederDependencyError, UploadedFile, UploadedFileControllerOptions, UploadedFileImageOptions, UploadedFileJson, UploadedFileQuery, UploadsConfigurations, UploadsImagesConfigurations, UseCase, UseCaseAfterMiddleware, UseCaseBeforeMiddleware, UseCaseBroadcastChannel, UseCaseBroadcastEvent, UseCaseBroadcastOption, UseCaseConfigurations, UseCaseContext, UseCaseErrorResult, UseCaseEventsCallbacksMap, UseCaseGuard, UseCaseHandler, UseCaseOnExecutingContext, UseCaseResult, UseCaseRuntimeOptions, UseCaseWithSchema, ValidationConfiguration, ValidationFailureContext, ValidationFailureHandler, ValidationFailureResponse, ValidationResponseConfiguration, VariantOutputFormat, VariantSourceFormat, WarlockConfig, WarlockConfigManager, WarlockError, WarlockErrorCode, WarningSink, WatermarkConfig, WhereOperator, XMLable, addUseCaseHistory, anyMatch, app, appLog, appPath, applyCspHeader, assertConfiguredHttpPortIsFree, assertMailCount, assertMailSent, assertNoReservedConnectorNames, assertNodeOnlyCommand, assertPortIsAvailable, assertSitesRequireWebRole, assertUniqueConnectorNames, assertValidConfigModules, assetsUrl, beginHttpDrain, bootstrap, broadcastSocketEvent, broadcastUseCaseResult, buildCspHeaderValue, buildIdempotencyCacheKey, buildOpenApiDocument, buildRequestLogSnapshot, buildTracingContext, cachePath, captureMail, clearPositionalHandlerSuspects, clearTestMailbox, clock, closeAllMailers, closeMailer, closeServerWithTimeout, colors, command, config, configPath, configSpecialHandlers, connectorsManager, container, createHttpApplication, createRequestStore, createUploadedFileController, decrypt, defaultHttpConfigurations, defineConfig, defineConfigSchema, defineResource, deriveTraceId, describeJavaScriptRuntime, describePositionalHandlerSuspect, detectJavaScriptRuntime, dispatchPhase, dispatchRequestEnd, dispatchRequestStart, displayEnvironmentMode, encrypt, ensureFatalIsVisible, env, environment, errorCodeDocsUrl, errorCodeOf, escapeHeaderValue, evaluateConditionalRequest, exampleFromSchema, existsExceptCurrentIdRule, existsExceptCurrentUserRule, explainErrorCode, fetchLatestVersion, fileExtensionRule, fileRule, fileTypeRule, findMailsBySubject, findMailsTo, fireLifecycleEvent, forgetPositionalHandlerSuspects, formatConfigIssues, generateImageVariants, generateMailId, getDefaultMailConfig, getDevelopmentOpenApiDocument, getDevelopmentPostmanCollection, getExplicitMailMode, getHttpReadyReport, getHttpServer, getLastMail, getLocalized, getMailEventName, getMailMode, getMailboxSize, getMailer, getMailerConfig, getMimeType, getPoolStats, getPublicUrl, getRoles, getSites, getSocketServer, getTestMailbox, getUseCase, getUseCaseHistory, getUseCases, globalEventsCallbacksMap, globalUseCasesEvents, hasRole, hashBody, hashPassword, health, hmacHash, httpConfig, ids, imageRule, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls, inspectHandlerSignature, ipMatches, isAllowedCsrfOrigin, isAuthGuardMiddleware, isBootSignal, isConfigSchema, isDevelopmentMode, isNewerVersion, isNullableResource, isPortAvailable, isPrivateOrReservedIp, isProductionMode, isSafeRedirect, isTestMode, isTracingEnabled, isUnguardedMutatingRoute, isUnknownTsExtensionError, isUnresolvedConfigImportError, isUnsupportedTypeStrippingError, isValidIdempotencyKey, isWarlockErrorCode, listEndpoint, listPositionalHandlerSuspects, loadS3, logResponse, logsPath, looksLikePositionalHandler, mailEvents, markAuthGuard, matchesDerivedRouteName, matchesIfMatch, matchesIfNoneMatch, measure, mergeCspDirectives, middleware, nodeOnlyCommandError, normalizeOrigin, normalizeRequestPath, normalizeRoutePath, notifyHttpServerRebuilt, nullable, onHttpServerRebuilt, openApiToPostmanCollection, originOf, ownOrigin, parseEntityTag, parseEntityTagList, parseLocaleDictionary, parseRoles, parseSites, parseSize, parseTraceparentTraceId, paths, preflightConfiguredHttpPort, promiseAllObject, publicPath, publicUrl, purgeImageVariants, redactQueryCredentials, redactUrlCredentials, registerAppConfig, registerConfiguredConnectors, registerDevelopmentOpenApiProvider, registerGroupedTranslationKeys, registerHttpPlugins, registerLocaleDictionary, registerTracingHooks, remedyLines, renderReact, renderReactMail, reportPositionalHandlerSuspects, reportUnguardedMutatingRoutes, requestContext, requestMemo, requiresDefaultCsrfGuard, resetHttpReadyReport, resetMailConfig, resetMailMode, resetRolesCacheForTests, resetTracingConfigForTests, resetUnguardedRouteReports, resolveCspConfig, resolveCsrfOriginVerdict, resolveImageVariant, resolveMailConfig, resolvePublicRoot, resolveRequestLoggingOptions, resolveTracingConfig, resolveWithinRoot, rootPath, routeNameMethodSuffix, router, runDefaultCsrfGuard, runPipeline, safeFetchToBuffer, safeRedirect, sanitizePath, secrets, seeder, sendBootSignal, sendMail, serializeCspDirectives, servesHttp, setBaseUrl, setClockSource, setConfig, setEnvironment, setHttpReadyReport, setIdsSource, setLogConfigurations, setMailConfigurations, setMailMode, shouldPreflightHttpPort, sleep, sluggable, srcPath, startHttpServer, stopHttpApplication, storage, storageConfig, storageConfigurations, storageDriverContext, storagePath, streamReactResponse, strongEntityTagMatch, t, tempPath, toJson, toSingleLineSseField, trackConnectionsForDrain, uniqueExceptCurrentIdRule, uniqueExceptCurrentUserRule, unregisterLocaleDictionary, unverifiedBuildRuntimeNotice, uploadedFileController, uploadedFileMetadataSchema, uploadsConfig, uploadsPath, uploadsUrl, url, useCase, useComputedModel, useComputedSlug, useCurrentUser, useHashedPassword, useRequest, useRequestStore, validateConfigValue, validateCspConfigAtBoot, validateCspDirectives, verifyMailer, verifyPassword, warlockConfigManager, warlockPath, wasMailSentTo, wasMailSentWithSubject, weakEntityTagMatch, wrapResponseInDataKey };
241
+ export { $registerUseCase, $unregisterUseCase, APP_ROLES, AUTH_GUARD_MARKER, AccessConnector, AggregateExpressionInput, AggregateExpressions, AiConnector, AllRepositoryOptions, AppConfigurations, AppError, AppRole, Application, AuthDescriptor, BOOT_SIGNAL_ENV_KEY, BOOT_SIGNAL_VERSION, BadRequestError, BadSchemaUseCaseError, BaseCastOutput, BaseConnector, type BenchmarkChannel, type BenchmarkConfigurations, type BenchmarkErrorResult, type BenchmarkOptions, BenchmarkProfiler, type BenchmarkProfilerOptions, type BenchmarkResult, BenchmarkSnapshots, type BenchmarkSnapshotsOptions, type BenchmarkStats, type BenchmarkSuccessResult, BootContext, BootListener, BootSignal, BootSignalType, BootValidator, type BudgetPage, type BudgetViolation, type BuildBudgetReport, type BuildBudgets, CLICommand, type CLICommandAction, type CLICommandOption, type CLICommandOptions, type CLICommandPreload, type CLICommandSource, CacheConnector, type CacheMiddlewareOptions, CachedRepositoryOptions, type CapturedMail, CascadeAdapter, CascadeQueryBuilder, CastOutput, ChunkCallback, ClockSource, ClosableServer, CloudDriver, CloudStorageDriverContract, CloudStorageDriverOptions, CloudStorageFileData, type CommandActionData, type ConcurrencyLimitOptions, ConditionalRequestInput, ConditionalRequestOutcome, ConfigIssue, ConfigKey, ConfigKeyRegistry, ConfigModuleEntry, ConfigName, ConfigOf, ConfigRegistry, ConfigSchema, ConfigSchemaOptions, ConfigSpecialHandlers, ConflictError, Connector, ConnectorBuildContext, ConnectorBuildContribution, ConnectorBuildGenerateResult, ConnectorEsbuildPatch, ConnectorLifecyclePhase, ConnectorName, ConnectorPriority, ConnectorsManager, ConsoleChannel, ContainerTypes, CookieJarUnavailableError, CookieOptions, CspConfig, CsrfOriginCheckReason, CsrfOriginVerdict, CursorPaginationOptions, CursorPaginationResult, DEFAULT_CSP_DIRECTIVES, DEFAULT_POSTMAN_BASE_URL, DOSpacesDriver, DatabaseCacheDriver, type DatabaseCacheOptions, DatabaseConnector, DatabaseLog, DatabaseLogModel, DatabaseLogOptions, DecodedAccessToken, DefineResourceOptions, DeleteManyResult, DetectedImageFormat, type DevelopmentAppModuleEntry, type DevelopmentAppModules, type DevelopmentModelModuleEntry, type DevelopmentModelModuleState, type DevelopmentModelModules, DevelopmentPostmanResult, EMPTY_TRANSLATION_USAGE, ERROR_CODES, ERROR_CODES_DOCS_URL, EncryptionConfigurations, EncryptionPasswordConfigurations, EntityTag, Environment, ErrorCodeArea, ErrorCodeCategory, ErrorCodeDefinition, EventSubscription, ExistsExceptCurrentIdRuleOptions, ExistsExceptCurrentUserRuleOptions, FastifyInstance, FieldOutput, FileNamingStrategy, FileValidationOptions, FileValidator, FileVisibility, FilterFunction, FilterOperator, FilterOptions, FilterRule, FilterRules, ForbiddenError, GenerateImageVariantsOptions, GeneratedImageDescriptor, GeneratedImageVariant, GroupByFields, GroupedRoutesOptions, HealthCheck, HealthStatus, HeraldConnector, HttpConfigurations, HttpConnector, HttpContext, HttpError, HttpErrorCodes, type HttpErrorMapper, type HttpErrorMapping, type HttpErrorResponseContext, type HttpErrorResponseFormatter, HttpLoggingConfig, HttpReadyReport, HttpServerOptions, HttpServerRebuiltListener, HttpTracingConfig, type IdempotencyOptions, IdsSource, Image, ImageFormat, ImageInput, ImageTransformCallback, ImageTransformConfig, ImageTransformOptions, ImageVariantDefinition, ImageVariantFit, ImageVariantOutputFormat, ImageVariantsConfigError, InvalidConfigError, InvalidCspDirectiveError, type IpFilterOptions, JavaScriptRuntime, JavaScriptRuntimeName, ListEndpointBody, ListEndpointOptions, ListEndpointRepositoryOptions, ListOptions, ListQuery, LocalDriver, LocalStorageDriverOptions, LocaleDictionaryEntries, LocaleDictionaryError, LocalizedObject, LogConfigurations, LoggerConnector, MAIL_EVENTS, Mail, type MailAddress, type MailAttachment, type MailConfigurations, MailError, type MailErrorCode, type MailEvents, type MailMode, type MailOptions, type MailPriority, type MailResult, MailerConnector, type MailersConfig, type MaintenanceOptions, MemorySecretBackend, Middleware, MiddlewareResponse, MimeTypes, ModelResourceRegistry, NULLABLE_RESOURCE, NamedApiRoute, NamedApiRoutesOptions, NoopChannel, type NormalizedMail, NotAcceptableError, NotAllowedError, NotificationsConnector, NullableResource, NullableResourceTarget, OPENAPI_JSON_SCHEMA_DIALECT, OpenApiBuildResult, OpenApiComponents, OpenApiContext, OpenApiDocument, OpenApiOperation, OpenApiParameter, OpenApiRequestBody, OpenApiResponse, OpenApiRouteInput, OpenApiSchema, OpenApiSecurityRequirement, OpenApiSecurityScheme, OpenApiValidationResponseConfig, POSTMAN_COLLECTION_SCHEMA, type PageBudget, PaginationMode, PaginationResult, ParsedLocaleDictionary, PartialMiddleware, PartialPick, Path, type PayloadBudget, PipeableReactStream, PipelineOptions, PortInUseError, PositionalHandlerSuspect, PostmanAuth, PostmanAuthEntry, PostmanBody, PostmanCollection, PostmanCollectionOptions, PostmanFolder, PostmanFormParam, PostmanHeader, PostmanItem, PostmanOriginalRequest, PostmanQueryParam, PostmanRequest, PostmanRequestItem, PostmanResponse, PostmanUrl, PostmanVariable, PrefixConfig, PrefixOptions, PresignedOptions, PresignedUploadOptions, PrivateRequestLoggingRule, PurgeImageVariantsOptions, PutDirectoryOptions, PutDirectoryResult, PutFromUrlOptions, PutOptions, QueryBuilderContract, Queue, R2Driver, R2StorageDriverOptions, type RateLimitOptions, RegisterConfiguredConnectorsOptions, RegisterResource, RegisteredUseCase, type ReleaseCheck, type ReleaseConfig, RepositoryAdapterContract, RepositoryConfigurations, RepositoryEvent, RepositoryManager, RepositoryOptions, RepositoryOptionsWithCursor, RepositoryOptionsWithPages, Request, RequestContextStore, RequestController, RequestControllerContract, RequestEvent, RequestHandler, RequestHandlerType, RequestHandlerValidation, RequestLocals, RequestLog, RequestLogSnapshot, RequestLogSource, RequestLoggingOptions, RequestMethod, RequestTranslator, ResolveImageVariantInput, type ResolvedCLICommandOption, ResolvedImageVariant, ResolvedImageVariantsConfig, Resource, ResourceArraySchema, ResourceCastType, ResourceConstructor, ResourceContract, ResourceFieldBuilder, ResourceFieldBuilderDateOutputOptions, ResourceFieldConfig, ResourceMethod, ResourceNotFoundError, ResourceOutput, ResourceOutputOf, ResourceOutputValueCastType, ResourceSchema, ResourceSelfReference, Response, ResponseBodyOutput, ResponseBodyValue, ResponseEvent, ResponseSSEController, ResponseSSEMessageOptions, ResponseSSEOptions, ResponseSchema, ResponseSchemaOutput, ResponseStatus, ResponseStreamController, ResponseStreamOptions, Restful, RestfulMiddleware, ReturnedResponse, Route, RouteNameTakenError, RouteOptions, RouteRateLimitOptions, RouteRegistry, RouteResource, Router, RouterGroupCallback, RouterStacks, RuntimeStrategy, S3Driver, type SESConfigurations, type SMTPConfigurations, SUPPORTED_RUNTIMES_DOCS_URL, SafeFetchOptions, SafeFetchResult, SafeRedirectOptions, SaveAsOptions, SaveMode, SaveOptions, ScopedStorage, ScopedStorageContract, type SecretBackend, type SecretBackendType, SecretStore, SecretStoreError, SecretStoreErrorCode, type SecretStoreOptions, type SecretsConfigurations, SeedClock, SeedContext, SeedRecordRef, SeedResult, Seeder, SeederDependencyCycleError, SeederMetadata, SendBufferOptions, SendFileOptions, Serialized, SerializedWire, ServerError, ShutdownListener, SocketAdapterFactory, SocketConnector, SocketOptions, StaticMountOptions, Storage, StorageCapabilityError, StorageConfigurations, StorageConnector, StorageCopyEventPayload, StorageDriverConfig, StorageDriverContextStore, StorageDriverContract, StorageDriverName, StorageDriverRegistry, StorageDriverType, StorageError, StorageErrorOptions, StorageEventHandler, StorageEventPayload, StorageEventType, StorageFile, StorageFileData, StorageFileInfo, StorageManagerContract, StorageNotInitializedError, StoragePutEventPayload, StreamReactResponseOptions, TemporaryTokenError, TemporaryTokenPayload, TemporaryTokenValidation, TracingContext, TracingContextSource, TracingHooks, TracingPhaseInfo, TracingRequestEndInfo, Track, TrackableModel, TranslationDynamicSite, TranslationGraphInput, TranslationGraphResult, TranslationSourceScan, TranslationUsage, TypedAllRepositoryOptions, TypedRepositoryOptions, TypedRepositoryOptionsWithCursor, TypedRepositoryOptionsWithPages, UPDATE_MANY_BATCH_SIZE, UPLOADS_DEFAULTS, URL_CREDENTIAL_PARAMS, UnAuthorizedError, UniqueExceptCurrentIdRuleOptions, UniqueExceptCurrentUserRuleOptions, UnknownSeederDependencyError, UploadedFile, UploadedFileControllerOptions, UploadedFileImageOptions, UploadedFileJson, UploadedFileQuery, UploadsConfigurations, UploadsImagesConfigurations, UseCase, UseCaseAfterMiddleware, UseCaseBeforeMiddleware, UseCaseBroadcastChannel, UseCaseBroadcastEvent, UseCaseBroadcastOption, UseCaseConfigurations, UseCaseContext, UseCaseErrorResult, UseCaseEventsCallbacksMap, UseCaseGuard, UseCaseHandler, UseCaseOnExecutingContext, UseCaseResult, UseCaseRuntimeOptions, UseCaseWithSchema, ValidationConfiguration, ValidationFailureContext, ValidationFailureHandler, ValidationFailureResponse, ValidationResponseConfiguration, VariantOutputFormat, VariantSourceFormat, WarlockConfig, WarlockConfigManager, WarlockError, WarlockErrorCode, WarningSink, WatermarkConfig, WhereOperator, XMLable, addUseCaseHistory, analyzePageTranslationUsage, analyzeTranslationGraph, anyMatch, app, appLog, appPath, applyCspHeader, assertConfiguredHttpPortIsFree, assertMailCount, assertMailSent, assertNoReservedConnectorNames, assertNodeOnlyCommand, assertPortIsAvailable, assertSitesRequireWebRole, assertUniqueConnectorNames, assertValidConfigModules, assetsUrl, beginHttpDrain, bootstrap, broadcastSocketEvent, broadcastUseCaseResult, buildCspHeaderValue, buildIdempotencyCacheKey, buildOpenApiDocument, buildRequestLogSnapshot, buildTracingContext, cachePath, captureMail, clearPositionalHandlerSuspects, clearTestMailbox, clock, closeAllMailers, closeMailer, closeServerWithTimeout, colors, command, config, configPath, configSpecialHandlers, connectorsManager, container, createHttpApplication, createRequestStore, createUploadedFileController, decrypt, defaultHttpConfigurations, defineConfig, defineConfigSchema, defineResource, deriveTraceId, describeJavaScriptRuntime, describePositionalHandlerSuspect, detectJavaScriptRuntime, dispatchPhase, dispatchRequestEnd, dispatchRequestStart, displayEnvironmentMode, encrypt, ensureFatalIsVisible, env, environment, errorCodeDocsUrl, errorCodeOf, escapeHeaderValue, evaluateConditionalRequest, exampleFromSchema, existsExceptCurrentIdRule, existsExceptCurrentUserRule, explainErrorCode, fetchLatestVersion, fileExtensionRule, fileRule, fileTypeRule, findMailsBySubject, findMailsTo, fireLifecycleEvent, forgetPositionalHandlerSuspects, formatConfigIssues, generateImageVariants, generateMailId, getDefaultMailConfig, getDevelopmentOpenApiDocument, getDevelopmentPostmanCollection, getExplicitMailMode, getHttpReadyReport, getHttpServer, getLastMail, getLocalized, getMailEventName, getMailMode, getMailboxSize, getMailer, getMailerConfig, getMimeType, getPoolStats, getPublicUrl, getRoles, getSites, getSocketServer, getTestMailbox, getUseCase, getUseCaseHistory, getUseCases, globalEventsCallbacksMap, globalUseCasesEvents, hasRole, hashBody, hashPassword, health, hmacHash, httpConfig, ids, imageRule, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls, inspectHandlerSignature, ipMatches, isAllowedCsrfOrigin, isAuthGuardMiddleware, isBootSignal, isConfigSchema, isDevelopmentMode, isNewerVersion, isNullableResource, isPortAvailable, isPrivateOrReservedIp, isProductionMode, isRequiredGuardRoute, isSafeRedirect, isTestMode, isTracingEnabled, isTranslationKeyUsed, isUnguardedMutatingRoute, isUnknownTsExtensionError, isUnresolvedConfigImportError, isUnsupportedTypeStrippingError, isValidIdempotencyKey, isWarlockErrorCode, listEndpoint, listPositionalHandlerSuspects, loadS3, logResponse, logsPath, looksLikePositionalHandler, mailEvents, markAuthGuard, matchesDerivedRouteName, matchesIfMatch, matchesIfNoneMatch, measure, mergeCspDirectives, mergeTranslationUsage, middleware, nodeOnlyCommandError, normalizeOrigin, normalizeRequestPath, normalizeRoutePath, notifyHttpServerRebuilt, nullable, onHttpServerRebuilt, openApiToPostmanCollection, originOf, ownOrigin, parseEntityTag, parseEntityTagList, parseLocaleDictionary, parseRoles, parseSites, parseSize, parseTraceparentTraceId, paths, preflightConfiguredHttpPort, promiseAllObject, publicPath, publicUrl, purgeImageVariants, readSourceFile, readTranslationDeclarations, redactQueryCredentials, redactUrlCredentials, registerAppConfig, registerConfiguredConnectors, registerDevelopmentOpenApiProvider, registerGroupedTranslationKeys, registerHttpPlugins, registerLocaleDictionary, registerTracingHooks, remedyLines, renderReact, renderReactMail, reportPositionalHandlerSuspects, reportUnguardedMutatingRoutes, requestContext, requestMemo, requiresDefaultCsrfGuard, resetHttpReadyReport, resetMailConfig, resetMailMode, resetRolesCacheForTests, resetTracingConfigForTests, resetUnguardedRouteReports, resolveCspConfig, resolveCsrfOriginVerdict, resolveImageVariant, resolveMailConfig, resolvePublicRoot, resolveRequestLoggingOptions, resolveSourceImport, resolveTracingConfig, resolveWithinRoot, rootPath, routeNameMethodSuffix, router, runDefaultCsrfGuard, runPipeline, safeFetchToBuffer, safeRedirect, sanitizePath, scanTranslationSource, secrets, seeder, sendBootSignal, sendMail, serializeCspDirectives, servesHttp, setBaseUrl, setClockSource, setConfig, setEnvironment, setHttpReadyReport, setIdsSource, setLogConfigurations, setMailConfigurations, setMailMode, shouldPreflightHttpPort, sleep, sluggable, srcPath, startHttpServer, stopHttpApplication, storage, storageConfig, storageConfigurations, storageDriverContext, storagePath, streamReactResponse, strongEntityTagMatch, t, tempPath, toJson, toSingleLineSseField, trackConnectionsForDrain, translationDeclarationUsage, uniqueExceptCurrentIdRule, uniqueExceptCurrentUserRule, unregisterLocaleDictionary, unverifiedBuildRuntimeNotice, uploadedFileController, uploadedFileMetadataSchema, uploadsConfig, uploadsPath, uploadsUrl, url, usageOf, useCase, useComputedModel, useComputedSlug, useCurrentUser, useHashedPassword, useRequest, useRequestStore, validateConfigValue, validateCspConfigAtBoot, validateCspDirectives, verifyMailer, verifyPassword, warlockConfigManager, warlockPath, wasMailSentTo, wasMailSentWithSubject, weakEntityTagMatch, wrapResponseInDataKey };
239
242
  import "./config/types.mjs";
240
243
  import "./http/request.mjs";
241
244
  import "./http/serialized.mjs";