@webority/repo-checks 0.163.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 +8 -6
- package/dist/repo-checks.js +51 -51
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -49,8 +49,8 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
|
|
|
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
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`). 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
|
|
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 |
|
|
54
54
|
| `web-import-axios:<file>` | A web source file under `src/` imports `axios`; HTTP goes through `@webority/web-core` |
|
|
55
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 |
|
|
56
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` |
|
|
@@ -60,11 +60,12 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
|
|
|
60
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. |
|
|
61
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. |
|
|
62
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. |
|
|
63
|
-
| `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. |
|
|
64
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. |
|
|
65
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. |
|
|
66
66
|
| `repeated-canvas-key:<file>` | A quoted `data-canvas` or `testID` value that a second tag in the same module repeats. Counted per file. |
|
|
67
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. |
|
|
68
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. |
|
|
69
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. |
|
|
70
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. |
|
|
@@ -111,6 +112,7 @@ Comment lines (`//`, `/*`, `*`) and `.test.` or `.spec.` files are not read by t
|
|
|
111
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 |
|
|
112
113
|
| `missing-canvas-key`, `repeated-canvas-key` | List items without a key, and repeated keys | no | yes |
|
|
113
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 |
|
|
114
116
|
| `error-summary-title`, `route-internal-id`, `oversize` | Error summary titles, internal ids in routes and file size | no | yes |
|
|
115
117
|
| `script-integrity` | Scripts loaded from another host with no integrity hash | yes | yes |
|
|
116
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 |
|
|
@@ -121,12 +123,13 @@ Comment lines (`//`, `/*`, `*`) and `.test.` or `.spec.` files are not read by t
|
|
|
121
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 |
|
|
122
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 |
|
|
123
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 |
|
|
124
127
|
|
|
125
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`.
|
|
126
129
|
|
|
127
130
|
## Build mode
|
|
128
131
|
|
|
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
|
|
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.
|
|
130
133
|
|
|
131
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`.
|
|
132
135
|
|
|
@@ -134,8 +137,7 @@ A portal's `build` script runs `pnpm exec webority-repo-checks --build` as its f
|
|
|
134
137
|
|
|
135
138
|
## Token rules: counted per file
|
|
136
139
|
|
|
137
|
-
The four rules read every tracked `.scss`, `.css`, `.cshtml`, `.jsx` and `.tsx` file, and each `.js` or
|
|
138
|
-
`.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`,
|
|
139
141
|
`vendor`, `__tests__` or `__mocks__` segment, an email template project folder (`<Product>.Email` or
|
|
140
142
|
`<Product>.Emails`: email clients read no CSS variables, so inline pixels and colours are required there;
|
|
141
143
|
a plain `Email` folder of admin screens stays checked), a path containing `wwwroot/lib/`, a `.generated.` name,
|