@webority/repo-checks 0.163.0 → 0.165.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  Copyright (c) Webority Technologies. All rights reserved.
2
2
 
3
- This software and its NuGet packages are the proprietary and confidential property
3
+ This software and its Webority packages are the proprietary and confidential property
4
4
  of Webority Technologies. They are published publicly only for the convenience of
5
5
  Webority's own projects and internal consumption.
6
6
 
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 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 |
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,12 +60,14 @@ 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(...)`, `steps(...)`) 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. Counted per file. |
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. |
70
+ | `unknown-icon:<file>` | A .cshtml or script file names an icon the library does not have, in an icon, left-icon, right-icon, leading-icon, trailing-icon, header-icon or title-icon attribute (or the React props of the same names) or the name of an app-icon / AppIcon. Names built at run time are not read. Counted per file. |
69
71
  | `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
72
  | `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. |
71
73
  | `single-use-component:<file>` | A file under `src/components/<feature>/` (not `layout/`), or a shared partial under `Pages/Shared/` or a `*.Web.Common` project, that fewer than two files use; move it next to the page that uses it. A layout is skipped: a `_…Layout.cshtml` file, or one that a `_ViewStart.cshtml` of the same project names with `Layout = "<name>"`, because areas find it by that name. A Razor file whose first line is `@* layering-allow single-use-component: <reason> *@` is skipped too; a mark with no reason is a finding. Counted per file. |
@@ -77,7 +79,7 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
77
79
  | `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. |
78
80
  | `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. |
79
81
  | `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. |
82
+ | `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`. A page file over 200,000 bytes is skipped by the page lint and reported as one finding. Counted per file. |
81
83
  | `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. |
82
84
  | `hook:drift` | The root `.husky/pre-commit` is missing or differs from the shared hook this package ships (CRLF is ignored) |
83
85
  | `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,7 +112,8 @@ Comment lines (`//`, `/*`, `*`) and `.test.` or `.spec.` files are not read by t
110
112
  | `advisory` | Known advisories from `pnpm audit` (needs the network) | no | yes |
111
113
  | `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
114
  | `missing-canvas-key`, `repeated-canvas-key` | List items without a key, and repeated keys | no | yes |
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 |
115
+ | `raw-bootstrap`, `library-class-restyle`, `unknown-icon`, `rename-wrapper`, `shadowed-library-name`, `single-use-component` | Raw Bootstrap classes, product CSS restyling the library, unknown icon names, wrappers, shadowed names and single-use components | no | yes |
116
+ | `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
117
  | `error-summary-title`, `route-internal-id`, `oversize` | Error summary titles, internal ids in routes and file size | no | yes |
115
118
  | `script-integrity` | Scripts loaded from another host with no integrity hash | yes | yes |
116
119
  | `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 +124,13 @@ Comment lines (`//`, `/*`, `*`) and `.test.` or `.spec.` files are not read by t
121
124
  | `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
125
  | `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
126
  | `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 |
127
+ | `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
128
 
125
129
  `--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
130
 
127
131
  ## Build mode
128
132
 
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.
133
+ 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`, `unknown-icon`, `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
134
 
131
135
  `--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
136
 
@@ -134,8 +138,7 @@ A portal's `build` script runs `pnpm exec webority-repo-checks --build` as its f
134
138
 
135
139
  ## Token rules: counted per file
136
140
 
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`,
141
+ 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
142
  `vendor`, `__tests__` or `__mocks__` segment, an email template project folder (`<Product>.Email` or
140
143
  `<Product>.Emails`: email clients read no CSS variables, so inline pixels and colours are required there;
141
144
  a plain `Email` folder of admin screens stays checked), a path containing `wwwroot/lib/`, a `.generated.` name,