@webority/repo-checks 0.161.0 → 0.163.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.
package/README.md CHANGED
@@ -48,8 +48,9 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
48
48
  | `root-file:<name>` | A web portal has no `.nvmrc` in its folder or above, lacks `spa-host.json` or a `spa-host.<Environment>.json`, has a JavaScript Vite config, has no `codeSplitting` groups, or sets `build.target`; react.md, as the starter does. Warns until a release enforces it |
49
49
  | `tracking-plan:<missing\|invalid\|extends>` | A product repo (it has `.github/workflows/production.yml`) has no `.webority/tracking-plan.json`, one that is not a JSON object, or one whose `extends` is not `@webority/analytics/fleet`; product-analytics.md. Warns until a release enforces it |
50
50
  | `web-folder:<folder>` | A web portal has `src/components/base/` or a flat `src/components/features/`; react.md → Folder layout. Warns until a release enforces it |
51
+ | `script-integrity:<file>` | A `<script>` in a markup or `.html` file loads its `src` from another host (`http://`, `https://` or `//`) with no `integrity` attribute. Counted per file. |
51
52
  | `stale-theme-name:<file>` | A web style or source file reads a pre-0.89.0 theme name as a whole token (`var(--radius)`, `--color-primary-ink`). No alias ships for these. Run `webority upgrade 0.89.0 --path <folder>` once, then `webority brand`. `--color-primary-text` is not flagged. Never recorded in the baseline |
52
- | `lint:<file>` | Biome's check, with warnings as errors, over the app folder: any error or warning. Never recorded in the baseline; fix the finding; `--skip-lint` leaves it out |
53
+ | `lint:<file>` | Biome's check, with warnings as errors, over the app folder: any error or warning. The five counted rules (`deprecated-import`, `react-string-ref`, `legacy-component-props`, `legacy-react-test-api`, `navigation-shim`) are taken out of it and counted per file. Never recorded in the baseline; fix the finding; `--skip-lint` leaves it out |
53
54
  | `web-import-axios:<file>` | A web source file under `src/` imports `axios`; HTTP goes through `@webority/web-core` |
54
55
  | `web-import-axios-types:<file>` | A web source file imports types from `axios` with `import type` or `export type`; import `AxiosError`, `AxiosInstance`, `AxiosRequestConfig` and `AxiosResponse` from `@webority/web-core`. Warns until a release enforces it |
55
56
  | `web-import-router:<file>` | A web source file imports `BrowserRouter` or `Routes` from `react-router` or `react-router-dom`; routes are objects for `createBrowserRouter` |
@@ -76,6 +77,7 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
76
77
  | `api-thunk:<file>` | A call of `createAsyncThunk`, or of a name the file binds to `createAsyncThunk.withTypes`, in an app's source; an API call moves to an RTK Query endpoint in `services/api` (react.md: API data). An app's session module, `src/redux/action/accountAction` on a phone or web head, is not counted: its sign-in, token refresh, session restore and sign-out thunks are session flows, not API reads (react.md, react-native.md). Counted per file. |
77
78
  | `screen-service-import:<file>` | A file under `src/screens/` imports from its head's `services/` folder other than the RTK Query api module (`services/api` or `services/api/*`); a screen reads data through that module. Counted per file. |
78
79
  | `api-call:<file>` | A hand-written URL in an app's `src`: a `.get(`, `.post(`, `.put(`, `.patch(` or `.delete(` call whose first argument is a string or template starting with `/` or `api/`, or a function in a `services` folder declared to return `Promise<unknown>`. The reply type and the URL come from the generated contract: call the operation through `api("<OperationId>", request)` from `src/services/api/api.ts`. Counted per file. Warns until a release enforces it (`REPO_CHECKS_ENFORCE=api-call` fails it now). |
80
+ | `page-lint:<file>` | A Biome check finding (error or warning) in a server-rendered site's own page script or style: a tracked `.js`, `.mjs` or `.css` file under a `wwwroot` folder, linted from the repo root by the root `biome.json`. Vendored and minified files are never read: the token rules' exemptions apply, plus a `.min.js` or `.min.mjs` name and a path the root `.gitattributes` marks `linguist-vendored` (for example `MySite/wwwroot/external/** linguist-vendored`). With no Biome installed at the repo root the run prints a note naming how many page files went unread. A repo adopting it records today's counts once with `--baseline-adopt page-lint`. Counted per file. |
79
81
  | `oversize:<file>` | A `.jsx`, `.tsx` or `.cshtml` file over 600 lines (over 800 says to split it along its concerns). A warning only: it never fails, even outside the baseline. Counted per file. |
80
82
  | `hook:drift` | The root `.husky/pre-commit` is missing or differs from the shared hook this package ships (CRLF is ignored) |
81
83
  | `tracked-case:<path>` | A tracked file or folder whose name on disk differs only by letter case, a rename done by hand on a Mac that git never saw; a Linux checkout cannot find the import. Run the `git mv` the message gives. A folder is reported once. Always fails. |
@@ -110,14 +112,21 @@ Comment lines (`//`, `/*`, `*`) and `.test.` or `.spec.` files are not read by t
110
112
  | `missing-canvas-key`, `repeated-canvas-key` | List items without a key, and repeated keys | no | yes |
111
113
  | `raw-bootstrap`, `library-class-restyle`, `rename-wrapper`, `shadowed-library-name`, `single-use-component` | Raw Bootstrap classes, product CSS restyling the library, wrappers, shadowed names and single-use components | no | yes |
112
114
  | `error-summary-title`, `route-internal-id`, `oversize` | Error summary titles, internal ids in routes and file size | no | yes |
115
+ | `script-integrity` | Scripts loaded from another host with no integrity hash | yes | yes |
113
116
  | `api-thunk`, `screen-service-import`, `api-call` | Hand-written API thunks, screens that import services other than the RTK Query api module, and hand-written API URLs | no | yes |
114
117
  | `razor-page-handler`, `razor-page-link`, `web-route-literal` | Razor handlers and page links that name nothing, and portal links written as literal paths | no | yes |
118
+ | `page-lint` | Biome over a server-rendered site's own page scripts and styles, counted per file | no | yes |
119
+ | `deprecated-import` | An import of a symbol its own library marks `@deprecated` (Biome's `noDeprecatedImports`). Counted per file; warn first until `REPO_CHECKS_ENFORCE` names it; adopt with `--baseline-adopt deprecated-import` | no | yes |
120
+ | `react-string-ref` | A string ref, which React 19 no longer supports (Biome's `noReactStringRefs`). Counted per file; warn first until `REPO_CHECKS_ENFORCE` names it; adopt with `--baseline-adopt react-string-ref` | no | yes |
121
+ | `legacy-component-props` | `defaultProps` on a function component and `propTypes`, both removed in React 19 (a Biome plugin). Counted per file; warn first until `REPO_CHECKS_ENFORCE` names it; adopt with `--baseline-adopt legacy-component-props` | no | yes |
122
+ | `legacy-react-test-api` | `react-test-renderer` and `act` from `react-dom/test-utils`, both retired in React 19 (a Biome plugin). Counted per file; warn first until `REPO_CHECKS_ENFORCE` names it; adopt with `--baseline-adopt legacy-react-test-api` | no | yes |
123
+ | `navigation-shim` | The React Navigation 6 shims and the `independent` prop that React Navigation 7 removed (a Biome plugin). Counted per file; warn first until `REPO_CHECKS_ENFORCE` names it; adopt with `--baseline-adopt navigation-shim` | no | yes |
115
124
 
116
125
  `--build` skips the rules in `BUILD_SKIPPED_RULES` (exported from `src/check.ts`) because they start Biome, read every file's content or call the network. It prints no stale or fallen baseline lines, and it combines with `--json`, `--offline` and folder arguments, but not with the `--baseline-*` flags or `--sync-hook`.
117
126
 
118
127
  ## Build mode
119
128
 
120
- A portal's `build` script runs `pnpm exec webority-repo-checks --build` as its first step, so every build fails on a new finding (exit 1). Build mode skips these 26 rules: `lint`, `missing-export`, `stale-theme-name`, `advisory`, `raw-measure`, `palette-read`, `raw-colour`, `root-font-size`, `raw-motion`, `dark-read`, `missing-canvas-key`, `repeated-canvas-key`, `raw-bootstrap`, `library-class-restyle`, `rename-wrapper`, `shadowed-library-name`, `single-use-component`, `error-summary-title`, `route-internal-id`, `razor-page-handler`, `razor-page-link`, `web-route-literal`, `api-thunk`, `screen-service-import`, `api-call` and `oversize`. Those rules run only in a full run (`pnpm exec webority-repo-checks` with no `--build`), which the push check still runs. Any rule not named here runs in both.
129
+ A portal's `build` script runs `pnpm exec webority-repo-checks --build` as its first step, so every build fails on a new finding (exit 1). Build mode skips these 32 rules: `lint`, `missing-export`, `stale-theme-name`, `advisory`, `raw-measure`, `palette-read`, `raw-colour`, `root-font-size`, `raw-motion`, `dark-read`, `missing-canvas-key`, `repeated-canvas-key`, `raw-bootstrap`, `library-class-restyle`, `rename-wrapper`, `shadowed-library-name`, `single-use-component`, `error-summary-title`, `route-internal-id`, `razor-page-handler`, `razor-page-link`, `web-route-literal`, `api-thunk`, `screen-service-import`, `api-call`, `oversize`, `page-lint`, `deprecated-import`, `react-string-ref`, `legacy-component-props`, `legacy-react-test-api` and `navigation-shim`. Those rules run only in a full run (`pnpm exec webority-repo-checks` with no `--build`), which the push check still runs. Any rule not named here runs in both.
121
130
 
122
131
  `--skip-lint` skips only the `lint` rule; it combines with `--json`, `--offline` and folder arguments, and with `--build`, but not with the `--baseline-*` flags or `--sync-hook`.
123
132
 
@@ -130,10 +139,10 @@ The four rules read every tracked `.scss`, `.css`, `.cshtml`, `.jsx` and `.tsx`
130
139
  `vendor`, `__tests__` or `__mocks__` segment, an email template project folder (`<Product>.Email` or
131
140
  `<Product>.Emails`: email clients read no CSS variables, so inline pixels and colours are required there;
132
141
  a plain `Email` folder of admin screens stays checked), a path containing `wwwroot/lib/`, a `.generated.` name,
133
- a `.min.css` name, a `.test.` or `.spec.` script, and any path the repo lists under `generated[].paths` in
142
+ a `.min.css`, `.min.js` or `.min.mjs` name, a `.test.` or `.spec.` script, and any path the repo lists under `generated[].paths` in
134
143
  `.webority/map.json` (a trailing `/` names a folder; `*` matches within one segment). List a compiled
135
144
  stylesheet there: it bundles the shared theme, so its library rules are not the product's code, and the
136
- rules still read the SCSS it is built from. They also skip a path the repo's root `.gitattributes` marks `linguist-generated` (for example `Webority.Canvas.Kits/** linguist-generated`; a later `-linguist-generated` line for a narrower path takes it back, as in Git; nested `.gitattributes` files are not read). They also skip any path the repo lists under `fixtures` in the
145
+ rules still read the SCSS it is built from. They also skip a path the repo's root `.gitattributes` marks `linguist-generated` or `linguist-vendored` (for example `Webority.Canvas.Kits/** linguist-generated`; a later `-linguist-generated` line for a narrower path takes it back, as in Git; nested `.gitattributes` files are not read). They also skip any path the repo lists under `fixtures` in the
137
146
  same map, with the same pattern syntax (`"fixtures": ["corpus/"]`): a test fixture that imitates captured
138
147
  device output holds literal colours and sizes on purpose.
139
148