@webority/repo-checks 0.161.0 → 0.164.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 +19 -8
- package/dist/repo-checks.js +52 -50
- package/package.json +3 -3
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
|
-
| `
|
|
52
|
-
| `
|
|
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. |
|
|
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`), or a retired chart family built in a template literal (`` `--wui-chart-${i + 1}` ``). 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 |
|
|
53
|
+
| `lint:<file>` | Biome's check, with warnings as errors, over the app folder: any error or warning. The six counted rules (`deprecated-import`, `react-string-ref`, `legacy-component-props`, `legacy-react-test-api`, `navigation-shim`, `legacy-node-sqlite`) 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` |
|
|
@@ -59,11 +60,12 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
|
|
|
59
60
|
| `raw-colour:<file>` | A hex, an `rgb()` or `hsl()` with numbers, or a CSS named colour in a colour property or style key, where a colour meaning belongs. Counted per file. |
|
|
60
61
|
| `root-font-size:<file>` | A `font-size` or `font` declared on `html` or `:root`. The type scale assumes the browser's root size. Counted per file. |
|
|
61
62
|
| `palette-read:<file>` | A read of a raw palette step (`var(--wui-<step>)`, or a phone `palette.` read) or of a Bootstrap theme colour (`var(--bs-primary)`, `var(--bs-primary-rgb)` or Sass `$primary`, for the eight theme colours), where a colour meaning belongs. The message names the meaning to read. Counted per file. |
|
|
62
|
-
| `raw-motion:<file>` | A non-zero time (`150ms`, `.2s`) or an easing (`ease`, `linear`, `cubic-bezier(...)
|
|
63
|
+
| `raw-motion:<file>` | A non-zero time (`150ms`, `.2s`) or an easing (`ease`, `linear`, `cubic-bezier(...)`) in `transition`, `transition-duration`, `transition-timing-function`, `animation`, `animation-duration` or `animation-timing-function`, where a motion token belongs. A `var()` read, a zero and a delay are not counted. Step timing functions (`steps()`, `step-start`, `step-end`) are not counted. Counted per file. |
|
|
63
64
|
| `dark-read:<file>` | A read of the private dark tier (`var(--wui-dark-primary)` and the other `--wui-dark-*` steps), which stays dark in light mode. The message names the `--color-*` meaning to read. It replaces the `palette-read` count for those reads. Counted per file. |
|
|
64
65
|
| `missing-canvas-key:<file>` | A list item with no `data-canvas` key on web or `testID` on a phone, and no spread: the first JSX tag (past a Fragment) that an expression the `.map(` callback itself returns holds outside any object literal, in an expression body or any `return` of a block body. An object holding an element is data, a nested function's returns are its own, a block with no returned element draws no row, a React Navigation `.Screen` or `.Group` configures a navigator, and a component whose root sets the key (in the same file or imported) is keyed by itself. A map given a named function has its whole argument read. Counted per file. |
|
|
65
66
|
| `repeated-canvas-key:<file>` | A quoted `data-canvas` or `testID` value that a second tag in the same module repeats. Counted per file. |
|
|
66
67
|
| `raw-bootstrap:<file>` | A `.jsx`, `.tsx` or `.cshtml` file writes a raw Bootstrap component class (`btn`, `card`, `modal`, `table`, `badge`, `alert`, `form-control`, `form-select`, `form-check-input`, `pagination`, `nav-tabs`, `dropdown-menu`, `offcanvas`, `breadcrumb`, `progress`, `spinner-border`, `accordion`); the message names the library component (`badge` names `AppBadge` / `<app-badge>`, and `AppStatusBadge` / `<app-status-badge>` for a badge that shows a status). A modifier such as `btn-primary` alone is not counted. Counted per file. |
|
|
68
|
+
| `bootstrap-overlay:<file>` | A `.cshtml` or `.html` file writes a Bootstrap overlay attribute (`data-bs-toggle` set to `modal`, `dropdown`, `tooltip`, `popover` or `offcanvas`, or `data-bs-dismiss` set to `modal` or `offcanvas`) or a hand-written `<dialog` or `popover` attribute, or a page script calls `bootstrap.Modal`, `bootstrap.Tooltip`, `bootstrap.Popover`, `bootstrap.Dropdown`, `bootstrap.Offcanvas`, `.showModal(` or `.showPopover(`. The message names `data-wui-open`, `data-wui-dismiss` or the app tag. Never recorded in the baseline; fix the finding. |
|
|
67
69
|
| `library-class-restyle:<file>` | A product `.scss` or `.css` selector names a class the library theme defines (a `wui-*` component class, an `app-*` shell, navigation or tab class, or a Bootstrap component class the theme skins: `btn`, `card`, `modal`, `table`, `form-control`, `form-select`, `form-check`, `form-label`, `form-text`, `badge`, `alert`, `dropdown`, `nav-tabs`, `nav-pills`, `nav-link`, `pagination`, `page-item`, `page-link`, `offcanvas`, `accordion`, `breadcrumb`, `progress`, `spinner-border`, `list-group`, `input-group`, each also with a `-suffix`), including as an ancestor (`.my-page .wui-card-body`, `.app-shell.collapsed .app-sidebar .brand-logo`); use a library prop or token, or a product class. A token file that only sets custom properties names no class and is not counted. Counted per file. |
|
|
68
70
|
| `shadowed-library-name:<file>` | A `.jsx` or `.tsx` file imports a catalogue component from `@webority/ui-react` under another name and declares a component under the catalogue name (`import { AppButton as LibraryAppButton }` with `function AppButton`), so its call sites read as the library component. Use the library component and its props, or give the product component its own name. Counted per file. |
|
|
69
71
|
| `rename-wrapper:<file>` | A re-export of `@webority/ui-react`, a component whose body only returns one catalogue component, or a `_Name.cshtml` partial that is one `<app-*>` element: import the library name. Counted per file. |
|
|
@@ -76,6 +78,7 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
|
|
|
76
78
|
| `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
79
|
| `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
80
|
| `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). |
|
|
81
|
+
| `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
82
|
| `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
83
|
| `hook:drift` | The root `.husky/pre-commit` is missing or differs from the shared hook this package ships (CRLF is ignored) |
|
|
81
84
|
| `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. |
|
|
@@ -109,15 +112,24 @@ Comment lines (`//`, `/*`, `*`) and `.test.` or `.spec.` files are not read by t
|
|
|
109
112
|
| `raw-measure`, `palette-read`, `raw-colour`, `root-font-size`, `raw-motion`, `dark-read` | Counted style rules: raw sizes, colours and motion, palette reads and the root font size | no | yes |
|
|
110
113
|
| `missing-canvas-key`, `repeated-canvas-key` | List items without a key, and repeated keys | no | yes |
|
|
111
114
|
| `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 |
|
|
115
|
+
| `bootstrap-overlay` | Bootstrap or native overlay markup (`data-bs-*` modal, dropdown, tooltip, popover or offcanvas, a hand-written `<dialog` or `popover`) and page-script overlay calls, which the app tags or `AppModal` replace | no | yes |
|
|
112
116
|
| `error-summary-title`, `route-internal-id`, `oversize` | Error summary titles, internal ids in routes and file size | no | yes |
|
|
117
|
+
| `script-integrity` | Scripts loaded from another host with no integrity hash | yes | yes |
|
|
113
118
|
| `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
119
|
| `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 |
|
|
120
|
+
| `page-lint` | Biome over a server-rendered site's own page scripts and styles, counted per file | no | yes |
|
|
121
|
+
| `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 |
|
|
122
|
+
| `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 |
|
|
123
|
+
| `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 |
|
|
124
|
+
| `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 |
|
|
125
|
+
| `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 |
|
|
126
|
+
| `legacy-node-sqlite` | `DatabaseSync` or `StatementSync` imported from `node:sqlite`, which Node renamed to `Database` and `Statement` (a Biome plugin). Counted per file; warn first until `REPO_CHECKS_ENFORCE` names it; adopt with `--baseline-adopt legacy-node-sqlite` | no | yes |
|
|
115
127
|
|
|
116
128
|
`--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
129
|
|
|
118
130
|
## Build mode
|
|
119
131
|
|
|
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
|
|
132
|
+
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 33 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`, `navigation-shim` and `legacy-node-sqlite`. 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
133
|
|
|
122
134
|
`--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
135
|
|
|
@@ -125,15 +137,14 @@ A portal's `build` script runs `pnpm exec webority-repo-checks --build` as its f
|
|
|
125
137
|
|
|
126
138
|
## Token rules: counted per file
|
|
127
139
|
|
|
128
|
-
The four rules read every tracked `.scss`, `.css`, `.cshtml`, `.jsx` and `.tsx` file, and each `.js` or
|
|
129
|
-
`.ts` file that imports `react-native`. They skip a path with a `node_modules`, `dist`, `generated`,
|
|
140
|
+
The four rules read every tracked `.scss`, `.css`, `.cshtml`, `.jsx` and `.tsx` file, and each `.js` or `.ts` file (in a UI library's own repo, only one that imports `react-native`). They skip a path with a `node_modules`, `dist`, `generated`,
|
|
130
141
|
`vendor`, `__tests__` or `__mocks__` segment, an email template project folder (`<Product>.Email` or
|
|
131
142
|
`<Product>.Emails`: email clients read no CSS variables, so inline pixels and colours are required there;
|
|
132
143
|
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
|
|
144
|
+
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
145
|
`.webority/map.json` (a trailing `/` names a folder; `*` matches within one segment). List a compiled
|
|
135
146
|
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
|
|
147
|
+
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
148
|
same map, with the same pattern syntax (`"fixtures": ["corpus/"]`): a test fixture that imitates captured
|
|
138
149
|
device output holds literal colours and sizes on purpose.
|
|
139
150
|
|