@webority/repo-checks 0.150.0 → 0.152.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
@@ -15,6 +15,7 @@ pnpm exec webority-repo-checks # every app in the repository
15
15
  pnpm exec webority-repo-checks apps/portal # one app folder
16
16
  pnpm exec webority-repo-checks --offline # no advisory audit, so no network
17
17
  pnpm exec webority-repo-checks --build # quick rules only, for a build script
18
+ pnpm exec webority-repo-checks --skip-lint # leave out the Biome run, for a gate that already lints
18
19
  ```
19
20
 
20
21
  A product's build script runs `--build` before its bundler, for example `"build": "webority-repo-checks --build && vite build"`.
@@ -31,7 +32,7 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
31
32
  | `required:<name>` | A dependency every app carries (Biome and the shared preset, the core and UI packages, Bootstrap and react-bootstrap on web, Crashlytics on mobile) |
32
33
  | `not-exact:<name>` | A `^` or `~` range. Web pins `@webority/*` and `bootstrap` exactly; a React Native app pins every dependency exactly |
33
34
  | `lockstep:<set>` | Packages that publish together at one version are pinned at different versions |
34
- | `pnpm:*` | A committed `package-lock.json` or `yarn.lock`, no `pnpm-lock.yaml`, no `devEngines.packageManager` of `{ "name": "pnpm", "version": "<x.y.z>", "onFail": "error" }` (a plain `npm install` fails, and pnpm refuses any other version), a leftover `packageManager` field (pnpm ignores it beside devEngines), or a `pnpm-workspace.yaml` without `engineStrict: true` and `strictPeerDependencies: true` |
35
+ | `pnpm:*` | A committed `package-lock.json` or `yarn.lock`, no `pnpm-lock.yaml`, no `devEngines.packageManager` of `{ "name": "pnpm", "version": "<x.y.z>", "onFail": "error" }` (a plain `npm install` fails, and pnpm refuses any other version), a leftover `packageManager` field (pnpm ignores it beside devEngines), or a `pnpm-workspace.yaml` without `engineStrict: true` and `strictPeerDependencies: true`, or a pinned pnpm version that differs from the pnpm version in the machine prerequisites list (`pnpm:version`; skipped where the machine prerequisites list does not exist, and `WEBORITY_PREREQUISITES` points the check at another list) |
35
36
  | `biome:*` | No Biome config, a config that does not extend `@webority/biome-config/biome.jsonc`, a `formatter.lineEnding` or root `linter.rules`, or (mobile) no `__DEV__` global, either top-level or in an override whose `includes` cover the app folder |
36
37
  | `catalogue-copy:<file>` | A `.jsx` or `.tsx` file anywhere under `src/` of a web app, or of a workspace package that depends on `@webority/ui-react`, named like a `@webority/ui-react` export |
37
38
  | `android-release-signing` | `android/app/build.gradle` has no guard that throws a `GradleException` when a requested task name contains `release` and a signing setting or the upload key is missing |
@@ -45,9 +46,10 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
45
46
  | `library-copy:<file>:<name>` | A web portal's source file under `src/` declares or exports, itself, a name `@webority/web-core` exports (its logger, error helpers, store set-up, reload helpers, refresh lock, JWT helpers, India validators); a re-export from the package passes. Warns until a release enforces it |
46
47
  | `mobile-library-pin:<name>` | A React Native app pins a `@webority/mobile-*` package below this checker's own version, which is the current phone library version. Warns until a release enforces it |
47
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
+ | `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 |
48
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 |
49
51
  | `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 |
50
- | `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 |
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 |
51
53
  | `web-import-axios:<file>` | A web source file under `src/` imports `axios`; HTTP goes through `@webority/web-core` |
52
54
  | `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 |
53
55
  | `web-import-router:<file>` | A web source file imports `BrowserRouter` or `Routes` from `react-router` or `react-router-dom`; routes are objects for `createBrowserRouter` |
@@ -100,6 +102,7 @@ Comment lines (`//`, `/*`, `*`) and `.test.` or `.spec.` files are not read by t
100
102
  | `web-import-axios`, `web-import-axios-types`, `web-import-router`, `web-import-env-branch` | Web imports that bypass the shared packages or the app settings | yes | yes |
101
103
  | `endpoint-name` | Two RTK Query endpoints share a name | yes | yes |
102
104
  | `build-typecheck`, `library-copy`, `mobile-library-pin`, `root-file`, `web-folder` | Portal build script, library copies, phone pins, root files and folder layout (warn first) | yes | yes |
105
+ | `tracking-plan` | A product repo keeps a tracking plan that extends the shared plan (warn first) | yes | yes |
103
106
  | `lint`, `missing-export` | Biome over every file: lint findings, and imports a module does not export | no | yes |
104
107
  | `stale-theme-name` | Pre-0.89.0 theme names read as a whole token | no | yes |
105
108
  | `advisory` | Known advisories from `pnpm audit` (needs the network) | no | yes |
@@ -116,6 +119,8 @@ Comment lines (`//`, `/*`, `*`) and `.test.` or `.spec.` files are not read by t
116
119
 
117
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.
118
121
 
122
+ `--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
+
119
124
  `--build` cannot be combined with `--baseline-init`, `--baseline-shrink`, `--baseline-accept`, `--baseline-adopt` or `--sync-hook`; with one of them it prints a usage message and exits 2. The exit codes are 0 for nothing new, 1 for a new finding and 2 for a usage or setup error.
120
125
 
121
126
  ## Token rules: counted per file
@@ -128,7 +133,7 @@ a plain `Email` folder of admin screens stays checked), a path containing `wwwro
128
133
  a `.min.css` name, a `.test.` or `.spec.` script, and any path the repo lists under `generated[].paths` in
129
134
  `.webority/map.json` (a trailing `/` names a folder; `*` matches within one segment). List a compiled
130
135
  stylesheet there: it bundles the shared theme, so its library rules are not the product's code, and the
131
- rules still read the SCSS it is built from. They also skip any path the repo lists under `fixtures` in 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
132
137
  same map, with the same pattern syntax (`"fixtures": ["corpus/"]`): a test fixture that imitates captured
133
138
  device output holds literal colours and sizes on purpose.
134
139
 
@@ -153,7 +158,7 @@ colours: one finding per read, and a declaration is not a read.
153
158
  `raw-motion` counts a non-zero time or an easing in the six properties `transition`, `transition-duration`,
154
159
  `transition-timing-function`, `animation`, `animation-duration` and `animation-timing-function`. Motion comes
155
160
  from the tokens `--wui-duration-fast`, `--wui-duration-default`, `--wui-duration-slow` and `--wui-ease-out`,
156
- `--wui-ease-in-out`, `--wui-ease-ui` and `--wui-ease-elastic`; a delay and a zero are not counted.
161
+ `--wui-ease-in-out`, `--wui-ease-ui`, `--wui-ease-elastic` and `--wui-ease-linear`; a delay and a zero are not counted.
157
162
 
158
163
  `dark-read` counts each read of the private dark tier (`var(--wui-dark-*)`). A dark band is a scope with
159
164
  `data-theme="dark"`, never a direct read, so a read of the dark tier stays dark in light mode.
@@ -170,7 +175,7 @@ src/assets/styles/_home.scss:12: color: var(--wui-primary);
170
175
 
171
176
  ## New rules start as warnings
172
177
 
173
- `lint`, `rn-mainactivity-oncreate-bundle`, `spa-host-immutable-assets`, `oversize`, `advisory`, `endpoint-name`, `api-call`, `api-thunk`, `screen-service-import`, `build-typecheck`, `library-copy`, `mobile-library-pin`, `root-file`, `web-folder` and `web-import-axios-types` print as warnings and do not fail until
178
+ `lint`, `rn-mainactivity-oncreate-bundle`, `spa-host-immutable-assets`, `oversize`, `advisory`, `endpoint-name`, `api-call`, `api-thunk`, `screen-service-import`, `build-typecheck`, `library-copy`, `mobile-library-pin`, `root-file`, `web-folder`, `web-import-axios-types` and `tracking-plan` print as warnings and do not fail until
174
179
  `REPO_CHECKS_ENFORCE` names them: `REPO_CHECKS_ENFORCE=lint,rn-mainactivity-oncreate-bundle`, or `all`. A release
175
180
  removes a rule from the warning list when no repository has a hit. `--json` carries the warnings under `warnings`.
176
181
  For `advisory` the severity decides: a `high` or `critical` advisory fails, and any other severity warns, whatever `REPO_CHECKS_ENFORCE` names.