@webority/repo-checks 0.121.0 → 0.124.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 +10 -2
- package/dist/lockstep.json +1 -0
- package/dist/repo-checks.js +95 -41
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ markup and script file of the repository (bootstrap-ui.md → Tokens).
|
|
|
13
13
|
pnpm add -D --save-exact @webority/repo-checks
|
|
14
14
|
pnpm exec webority-repo-checks # every app in the repository
|
|
15
15
|
pnpm exec webority-repo-checks apps/portal # one app folder
|
|
16
|
+
pnpm exec webority-repo-checks --offline # no advisory audit, so no network
|
|
16
17
|
```
|
|
17
18
|
|
|
18
19
|
An app is a `package.json` whose `dependencies` hold `react-native` (mobile) or `react-dom` (web). A `react-dom` folder that also has `react-native-web` is a react-native-web demo: it gets the pnpm and Biome checks, not the portal rules. Biome and `@webority/biome-config` are read from the `package.json` beside the `biome.json` in effect (a nested config with `"root": false` defers to the one above), so a sub-folder linted by the root config does not repeat them. A `workspace:`, `file:` or `link:` reference is local and never counts as a lockstep version.
|
|
@@ -30,7 +31,7 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
|
|
|
30
31
|
| `lockstep:<set>` | Packages that publish together at one version are pinned at different versions |
|
|
31
32
|
| `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` |
|
|
32
33
|
| `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 |
|
|
33
|
-
| `catalogue-copy:<file>` | A
|
|
34
|
+
| `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 |
|
|
34
35
|
| `engines-node-floor:package.json` | `engines.node` is missing or is not `>=24.15 <25` |
|
|
35
36
|
| `engines-node-floor:.nvmrc` | No `.nvmrc` at or above the app, or it does not hold `24` |
|
|
36
37
|
| `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 |
|
|
@@ -52,7 +53,7 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
|
|
|
52
53
|
| `missing-canvas-key:<file>` | A list item (the first JSX tag in a `.map(` callback) with no `data-canvas` key on web or `testID` on a phone, and no spread. Counted per file. |
|
|
53
54
|
| `repeated-canvas-key:<file>` | A quoted `data-canvas` or `testID` value that a second tag in the same module repeats. Counted per file. |
|
|
54
55
|
| `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. A modifier such as `btn-primary` alone is not counted. Counted per file. |
|
|
55
|
-
| `library-class-restyle:<file>` | A product `.scss` or `.css` selector names a class the library theme defines (a `wui-*` component class
|
|
56
|
+
| `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. |
|
|
56
57
|
| `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. |
|
|
57
58
|
| `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. |
|
|
58
59
|
| `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. |
|
|
@@ -61,6 +62,9 @@ The `missing-export:<file>` check runs the Biome installed beside the app or in
|
|
|
61
62
|
| `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. |
|
|
62
63
|
| `hook:drift` | The root `.husky/pre-commit` is missing or differs from the shared hook this package ships (CRLF is ignored) |
|
|
63
64
|
| `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. |
|
|
65
|
+
| `advisory:<package>:<id>` | `pnpm audit` lists a known advisory for the lockfile that governs an app. A `high` or `critical` advisory fails; any other severity warns. Reported on the folder of that `pnpm-lock.yaml` |
|
|
66
|
+
| `advisory:unreachable` | `pnpm audit` could not reach the advisory service. It fails: check the network and run again, or pass `--offline` |
|
|
67
|
+
| `advisory:unreadable` | `pnpm audit` returned a report the check cannot read. It fails |
|
|
64
68
|
|
|
65
69
|
Comment lines (`//`, `/*`, `*`) and `.test.` or `.spec.` files are not read by the import checks.
|
|
66
70
|
|
|
@@ -110,6 +114,10 @@ src/assets/styles/_home.scss:12: color: var(--wui-primary);
|
|
|
110
114
|
`REPO_CHECKS_ENFORCE` names them: `REPO_CHECKS_ENFORCE=lint,rn-mainactivity-oncreate-bundle`, or `all`. A release
|
|
111
115
|
removes a rule from the warning list when no repository has a hit. `--json` carries the warnings under `warnings`.
|
|
112
116
|
|
|
117
|
+
## The advisory audit
|
|
118
|
+
|
|
119
|
+
Each run audits every distinct `pnpm-lock.yaml` that governs a checked app, once per lockfile, with `pnpm audit --json` from that lockfile's folder. The audit has a 60-second timeout and needs the network. An advisory accepted by the owner is recorded with `--baseline-accept <lockfile folder> --reason <text>`, like any other finding. `--offline` skips the audit and prints `repo-checks: advisory rule skipped (--offline).` to stderr, for a machine without the network.
|
|
120
|
+
|
|
113
121
|
## Existing findings: a baseline that only shrinks
|
|
114
122
|
|
|
115
123
|
A repository adopting the checks records what it has today, once:
|