@warlock.js/core 5.35.0 → 5.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/esm/dev-server/module-loader.mjs +1 -1
  3. package/esm/dev-server/parse-imports.mjs +1 -1
  4. package/esm/dev-server/type-generator.mjs +1 -1
  5. package/esm/e2e/cdp.d.mts.map +1 -1
  6. package/esm/e2e/cdp.mjs +9 -2
  7. package/esm/e2e/cdp.mjs.map +1 -1
  8. package/esm/e2e/page.d.mts +9 -1
  9. package/esm/e2e/page.d.mts.map +1 -1
  10. package/esm/e2e/page.mjs +45 -7
  11. package/esm/e2e/page.mjs.map +1 -1
  12. package/esm/e2e/types.d.mts +18 -0
  13. package/esm/e2e/types.d.mts.map +1 -1
  14. package/esm/e2e/types.mjs.map +1 -1
  15. package/esm/errors/error-codes.d.mts +24 -0
  16. package/esm/errors/error-codes.d.mts.map +1 -1
  17. package/esm/errors/error-codes.mjs +24 -0
  18. package/esm/errors/error-codes.mjs.map +1 -1
  19. package/esm/generations/features/test.feature.mjs +7 -7
  20. package/esm/generations/features/test.feature.mjs.map +1 -1
  21. package/esm/generations/features/web.feature.mjs +3 -3
  22. package/esm/generations/features/web.feature.mjs.map +1 -1
  23. package/esm/index.d.mts +4 -2
  24. package/esm/index.mjs +3 -1
  25. package/esm/localization/index.mjs +3 -1
  26. package/esm/localization/translation-usage-graph.d.mts +49 -0
  27. package/esm/localization/translation-usage-graph.d.mts.map +1 -0
  28. package/esm/localization/translation-usage-graph.mjs +128 -0
  29. package/esm/localization/translation-usage-graph.mjs.map +1 -0
  30. package/esm/localization/translation-usage.d.mts +85 -0
  31. package/esm/localization/translation-usage.d.mts.map +1 -0
  32. package/esm/localization/translation-usage.mjs +307 -0
  33. package/esm/localization/translation-usage.mjs.map +1 -0
  34. package/esm/production/build-budgets.d.mts +18 -0
  35. package/esm/production/build-budgets.d.mts.map +1 -1
  36. package/esm/production/build-budgets.mjs.map +1 -1
  37. package/esm/production/route-registration-snapshot.mjs +5 -3
  38. package/esm/production/route-registration-snapshot.mjs.map +1 -1
  39. package/esm/router/router.d.mts +2 -0
  40. package/esm/router/router.d.mts.map +1 -1
  41. package/esm/router/router.mjs +4 -1
  42. package/esm/router/router.mjs.map +1 -1
  43. package/esm/router/types.d.mts +19 -0
  44. package/esm/router/types.d.mts.map +1 -1
  45. package/esm/tooling/check/api-route-references.d.mts +16 -0
  46. package/esm/tooling/check/api-route-references.d.mts.map +1 -0
  47. package/esm/tooling/check/api-route-references.mjs +146 -0
  48. package/esm/tooling/check/api-route-references.mjs.map +1 -0
  49. package/esm/tooling/check/conventions-step.d.mts +6 -3
  50. package/esm/tooling/check/conventions-step.d.mts.map +1 -1
  51. package/esm/tooling/check/conventions-step.mjs +19 -10
  52. package/esm/tooling/check/conventions-step.mjs.map +1 -1
  53. package/esm/tooling/check/run-check.d.mts.map +1 -1
  54. package/esm/tooling/check/run-check.mjs +4 -2
  55. package/esm/tooling/check/run-check.mjs.map +1 -1
  56. package/esm/tooling/check/translation-conventions.mjs +32 -0
  57. package/esm/tooling/check/translation-conventions.mjs.map +1 -0
  58. package/esm/tooling/inspect/collect-files.mjs +1 -1
  59. package/esm/upgrade/codemods/index.mjs +2 -0
  60. package/esm/upgrade/codemods/index.mjs.map +1 -1
  61. package/esm/upgrade/codemods/vite-vitest.mjs +170 -0
  62. package/esm/upgrade/codemods/vite-vitest.mjs.map +1 -0
  63. package/esm/upgrade/notes.mjs +4 -0
  64. package/esm/upgrade/notes.mjs.map +1 -1
  65. package/esm/warlock-config/index.d.mts +2 -2
  66. package/llms-full.txt +127 -16
  67. package/package.json +13 -13
  68. package/skills/register-route/SKILL.md +13 -0
  69. package/skills/test-service/SKILL.md +8 -8
  70. package/skills/upgrade-from-5-29/SKILL.md +91 -0
  71. package/skills/use-localization/SKILL.md +4 -0
  72. package/skills/warlock-check/SKILL.md +11 -8
@@ -357,3 +357,7 @@ connectors and the file runtime's loader channel, queued work, watchers, health
357
357
  workers, and registered module cleanup hooks, including after partial startup.
358
358
  A Node loader registration is process-scoped; its message channel is closed at
359
359
  teardown. Module-owned timers/listeners must register their cleanup hooks.
360
+
361
+ ## Translation keys in pages (5.36)
362
+
363
+ `warlock check` reports `WL9104` when a page renders a translation key computed at runtime (`trans(key)` with no static prefix, or a translator passed on as a value). Such a page ships every translation group. Declare its keys in the page's setup file, `export const config = { translations: ["statuses.*", "members.title"] }`, to ship only what it uses. The `web` skill `localize-pages` covers the browser side.
@@ -141,14 +141,17 @@ and work through the manual-review list. Use `--lint=oxc` for new apps.
141
141
  The following codes default to **warnings**, so upgrading does not fail existing projects.
142
142
  They parse real TypeScript/JSX syntax with the same oxc-parser adapter as the existing conventions.
143
143
 
144
- | Code | Convention | Remedy |
145
- | -------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
146
- | `WL9013` | A component file exceeds 150 lines | Split components and extract hooks; configure `componentLineLimit`. |
147
- | `WL9014` | More than one component in a file | Move each component into its own TSX file. |
148
- | `WL9015` | State/effects or event-handler functions inside a component | Move `useState`, `useReducer`, `useEffect`, `useLayoutEffect` and handlers into `use-*.ts` hooks. |
149
- | `WL9016` | Native select, checkbox, radio, date, time or datetime-local input | Use the design-system control. Native controls are allowed in `src/web/design-system/**`. |
150
- | `WL9017` | DOM input/textarea/select native validation | Use shared schema validation instead of `required`, `pattern`, `min`, `max`, `minLength`, `maxLength` or input `type="email"`. Custom component props are allowed. |
151
- | `WL9018` | Exported `RequestHandler` in `src/app/**/controllers` lacks `responseSchema` | Assign `handler.responseSchema` to document each response status. |
144
+ | Code | Convention | Remedy |
145
+ | -------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
146
+ | `WL9013` | A component file exceeds 150 lines | Split components and extract hooks; configure `componentLineLimit`. |
147
+ | `WL9014` | More than one component in a file | Move each component into its own TSX file. |
148
+ | `WL9015` | State/effects or event-handler functions inside a component | Move `useState`, `useReducer`, `useEffect`, `useLayoutEffect` and handlers into `use-*.ts` hooks. |
149
+ | `WL9016` | Native select, checkbox, radio, date, time or datetime-local input | Use the design-system control. Native controls are allowed in `src/web/design-system/**`. |
150
+ | `WL9017` | DOM input/textarea/select native validation | Use shared schema validation instead of `required`, `pattern`, `min`, `max`, `minLength`, `maxLength` or input `type="email"`. Custom component props are allowed. |
151
+ | `WL9018` | Exported `RequestHandler` in `src/app/**/controllers` lacks `responseSchema` | Assign `handler.responseSchema` to document each response status. |
152
+ | `WL9019` | Browser route call (`apiHref`, `useSubmitForm({ route })`) takes a run-time name | Pass a string literal or a template with a static prefix, or declare the names with `config.apiRoutes` in a page setup file. |
153
+ | `WL9020` | Browser code names a route registered with `clientVisible: false` (error) | Call the endpoint from the server, or remove `clientVisible: false` from the route. |
154
+ | `WL9104` | Translation key computed at runtime in `src/web` (the page ships every group) | Declare the keys with `config.translations` in the page's setup file, for example `["statuses.*"]`. |
152
155
 
153
156
  Web rules apply to `src/web/**/*.tsx`. Components are top-level JSX-returning functions
154
157
  with a capitalized name (or an anonymous default export). Hook files and ordinary helpers