@shivaedev/quality 0.25.0 → 0.27.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/CHANGELOG.md +22 -0
- package/README.md +72 -27
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -9
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/messages.d.ts +1 -1
- package/dist/cli/messages.d.ts.map +1 -1
- package/dist/cli/messages.js +5 -1
- package/dist/cli/messages.js.map +1 -1
- package/dist/config/decode.d.ts +0 -2
- package/dist/config/decode.d.ts.map +1 -1
- package/dist/config/decode.js +0 -8
- package/dist/config/decode.js.map +1 -1
- package/dist/config/resolve.d.ts +0 -2
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/domEnvironment.config.d.ts +4 -0
- package/dist/domEnvironment.config.d.ts.map +1 -0
- package/dist/domEnvironment.config.js +17 -0
- package/dist/domEnvironment.config.js.map +1 -0
- package/dist/testProjects.d.ts +4 -1
- package/dist/testProjects.d.ts.map +1 -1
- package/dist/testProjects.js +26 -6
- package/dist/testProjects.js.map +1 -1
- package/docs/debt-and-hooks.md +8 -37
- package/docs/north-star.md +0 -3
- package/package.json +2 -1
- package/src/cli/args.ts +1 -10
- package/src/cli/messages.ts +5 -2
- package/src/config/decode.ts +0 -11
- package/src/domEnvironment.config.ts +13 -0
- package/src/testProjects.ts +30 -6
- package/docs/modules.md +0 -275
- package/docs/naming.md +0 -130
- package/docs/roadmap.md +0 -37
- package/docs/rules.md +0 -299
- package/docs/tooling.md +0 -105
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.27.0 - 2026-10-18
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `testProjects()` selects test-story's DOM environment for DOM tests and specs, preserving Node host constructors alongside the happy-dom window without a project remap.
|
|
8
|
+
- `testProjects({ coverage: true })` enables V8 coverage for selected projects, including unvisited source files and excluding tests and fixtures. The exported `TestProjectsOptions` type also accepts native Vitest coverage options through `coverage` to customize the report.
|
|
9
|
+
|
|
10
|
+
### Breaking
|
|
11
|
+
|
|
12
|
+
- DOM projects use test-story's environment instead of plain happy-dom. Install `@shivaedev/test-story` alongside `happy-dom`, and target the DOM window when stubbing browser APIs. Storage fixtures should bind global storage reads to `window.localStorage`; the Node host and DOM window keep separate constructors.
|
|
13
|
+
|
|
14
|
+
## 0.26.0 - 2026-10-18
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `cli/messages.ts` exports `SUBCOMMANDS: Readonly<Record<string, string>>`, the usage hints for commands with subcommands.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- `testProjects()` sets `silent: "passed-only"` outside CI and `silent: false` in CI, while leaving reporter selection to Vitest.
|
|
23
|
+
- Stale `adopt` and `preCommit` configuration keys and the `quality adopt` command now fail with the general unknown-key and unknown-command errors.
|
|
24
|
+
|
|
3
25
|
## 0.25.0 - 2026-10-18
|
|
4
26
|
|
|
5
27
|
### Added
|
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ export default defineConfig({ sources: ["src"] });
|
|
|
76
76
|
|
|
77
77
|
When a config exists, its folder is the root for paths and hook scripts. Without one, the current directory is the root. `sources` chooses the files the source rules read; a missing source stops the run. Directory discovery skips untracked files ignored by git and the `.git` and `node_modules` directories. Tracked files remain checked even when an ignore pattern matches them; a folder named `generated/` does not exempt authored code. Some repository rules, such as manifest sorting, inspect the whole repository even when `sources` names only `src`.
|
|
78
78
|
|
|
79
|
-
`defineConfig` checks the config's types. The CLI also validates it: a broken config, unknown rule id or invalid options fails before checks run. An explicit `--config` path must exist.
|
|
79
|
+
`defineConfig` checks the config's types. The CLI also validates it: a broken config, unknown rule id or invalid options fails before checks run. An explicit `--config` path must exist.
|
|
80
80
|
|
|
81
81
|
### 2. When architecture needs it: describe an import boundary
|
|
82
82
|
|
|
@@ -108,13 +108,23 @@ const uiBoundary = fence("ui-never-imports-server")
|
|
|
108
108
|
export default [uiBoundary];
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
This is `packages/ui/quality.fences.config.ts`; paths remain relative to the repository root. Existing fences supplied through `rules["imports/fences"].options.fences` join the same policy. This adds a fact about the repository's architecture to the shared import check. It does not select a different set of Quality rules. Use real checked files and workspace package names in these chains. The illegal chain must cross this fence alone; the legal chain must cross none. `mayNotImport` checks direct imports; `mayNotReach` also follows repository imports transitively; `mayImportOnly(...subjects).of(unit)` permits only named modules or folders of a unit. Fences count type imports but never hold test files or files under `test-support/`. The default `imports/no-test-code` rule rejects production imports of either, including type imports and re-exports. Move shared code into a production module that tests can import.
|
|
111
|
+
This is `packages/ui/quality.fences.config.ts`; paths remain relative to the repository root. Existing fences supplied through `rules["imports/fences"].options.fences` join the same policy. This adds a fact about the repository's architecture to the shared import check. It does not select a different set of Quality rules. Use real checked files and workspace package names in these chains. The illegal chain must cross this fence alone; the legal chain must cross none. `mayNotImport` checks direct imports; `mayNotReach` also follows repository imports transitively; `mayImportOnly(...subjects).of(unit)` permits only named modules or folders of a unit. Fences count type imports but never hold test files or files under `test-support/`. The default `imports/no-test-code` rule rejects production imports of either, including type imports and re-exports. Move shared code into a production module that tests can import.
|
|
112
|
+
|
|
113
|
+
The import rules resolve every literal specifier the way the TypeScript compiler does, with the nearest `tsconfig.json`, and stop the run when the sources hold no module at all. A relative or `#` import of a file that a generator writes before the tests run resolves only inside a folder that `imports/resolvable` lists as `generated`; the folder, or every file an import names in it, must be ignored by git:
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import { defineConfig } from "@shivaedev/quality/config.ts";
|
|
117
|
+
|
|
118
|
+
export default defineConfig({
|
|
119
|
+
rules: { "imports/resolvable": { options: { generated: ["packages/db/src/test-support/generated"] } } },
|
|
120
|
+
});
|
|
121
|
+
```
|
|
112
122
|
|
|
113
123
|
### Story tests
|
|
114
124
|
|
|
115
125
|
Write setup in the domain kit under `test-support/` and keep each test specific to its story. [`@shivaedev/test-story`](https://github.com/ShivaeDev/platform/tree/main/packages/test-story#readme) explains how to build the kit, traits and verbs over a real engine.
|
|
116
126
|
|
|
117
|
-
Quality's `tests/story-specs` rule reports a test file that declares tests without a kit's `it`, including plain Vitest `it` and `test` declarations mixed with stories.
|
|
127
|
+
Quality's `tests/story-specs` rule reports a test file that declares tests without a kit's `it`, including plain Vitest `it` and `test` declarations mixed with stories. Typecheck tests are exempt, as are test-story itself and its transitive workspace dependencies, including development, optional and peer dependencies: requiring those packages to depend on test-story would create a cycle. Pure-function tests are included: the baseline records existing files, and that debt should only go down.
|
|
118
128
|
|
|
119
129
|
Every package tests its real engine through its own story kit, so setup and actions share the package's domain vocabulary. To repair a finding, build the kit with `storyKit` from `@shivaedev/test-story/storyKit.ts` in `src/test-support`, import it in the spec and replace plain registrations with `kit.it(name, traits, body)`. The rule follows imports, aliases and conditional registrars back to the kit; it checks declarations, while review and runtime tests establish whether the kit exercises the real engine.
|
|
120
130
|
|
|
@@ -136,7 +146,7 @@ When you fix debt, lower the entries of changed files:
|
|
|
136
146
|
quality baseline tighten
|
|
137
147
|
```
|
|
138
148
|
|
|
139
|
-
`tighten` lowers entries for files changed since `HEAD`; `--staged` restricts those updates to staged files. `prune` considers every baseline entry. Both only lower or remove counts and can carry entries when git detects tracked moves.
|
|
149
|
+
`tighten` lowers entries for files changed since `HEAD`; `--staged` restricts those updates to staged files. `prune` considers every baseline entry. Both only lower or remove counts and can carry entries when git detects tracked moves.
|
|
140
150
|
|
|
141
151
|
When a Quality upgrade adds a check, or a reviewed change needs to record one rule's findings again:
|
|
142
152
|
|
|
@@ -144,11 +154,24 @@ When a Quality upgrade adds a check, or a reviewed change needs to record one ru
|
|
|
144
154
|
quality baseline write --rule tests/story-setup
|
|
145
155
|
```
|
|
146
156
|
|
|
147
|
-
Keep the default error level. The command replaces that rule's entries and leaves other rules' entries alone. Any new or raised count belongs in the review and the pull request's Callouts. The [debt and hook guide](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/debt-and-hooks.md) covers exception subjects, limit changes, renames and commit checks.
|
|
157
|
+
Keep the default error level. The command replaces that rule's entries and leaves other rules' entries alone. Any new or raised count belongs in the review and the pull request's Callouts. The [debt and hook guide](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/debt-and-hooks.md) covers the baseline format, exception subjects, limit changes, renames and commit checks.
|
|
158
|
+
|
|
159
|
+
### What the rules check
|
|
160
|
+
|
|
161
|
+
`quality lint` prints each failing rule's guidance with its findings, so the finding is the reference for what to change. The built-in rules fall into these groups:
|
|
162
|
+
|
|
163
|
+
- **Structure:** `structure/max-lines` allows 150 lines in a source file and 300 in test code, `nesting/max-depth` rejects lines indented eight tabs deep, and `structure/no-barrel` rejects `index` modules. The preset rejects every re-export, types included; when `noExportedImports` suggests `export … from`, import the name where it is used instead. A module does one job.
|
|
164
|
+
- **Comments:** the `comments/*` rules reject JSDoc, TODOs, banners, line and pull request references, environment pragmas and more than two comments per file. A comment says why, never what the code already says or what it used to be. A tool pragma such as `@jsxImportSource` counts as a comment until both `comments/no-jsdoc` and `comments/max-per-file` list its tag in their `allow` option.
|
|
165
|
+
- **Suppressions:** the `suppressions/*` rules reject inline lint and compiler directives, casts through `unknown`, `any` or `never`, Biome settings that weaken a check, recommended Biome rules the preset leaves below `error`, and `ignoreDeprecations`. None of them takes exceptions. A type test (`*.typecheck.test.ts`) may use `@ts-expect-error`; a test that must pass a rejected value at run time calls the API through `Reflect.apply`.
|
|
166
|
+
- **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest, relative imports that leave their folder, production imports of test code, runtime folders and fences, as described above.
|
|
167
|
+
- **Names and files:** the Biome preset's naming rules and plugins, and the `files/*` rules, which name a file after its main export with its folders as the prefix. No naming rule renames anything; the author picks the name. A name an outside system owns, such as a query parameter or an environment variable, is written as a quoted key, which the naming rules skip. A `Schema.Struct` field stays camelCase even when quoted and maps to the outside name with `Schema.encodeKeys`. Biome's naming messages print only a pattern: spell acronyms as words (`HttpClient`, `userId`, `parseUrl`) rather than turning off `strictCase` as its hint suggests, give a type no `I` prefix, and name a type parameter `T`, `T` plus a PascalCase name (`TItem`), or Effect's `A`, `E` and `R`. No rule checks these, so review does: a boolean reads as a question (`isOpen`, `canRetry`) unless the DOM or React names it (`open`, `disabled`); a schema shares its name with its type (`type Item = typeof Item.Type`); an unused parameter is removed rather than renamed with the `_` prefix TypeScript accepts. The naming rules take repository facts: `toolOwned` lists `.gitignore` patterns whose names a tool fixes, and a configured list replaces the rule's defaults, so repeat any default you still need; `content` lists snake_case content folders and files; `tests/follow` and `tests/colocated` take `suites` for test folders with their own layout, such as a Playwright suite.
|
|
168
|
+
- **Tests:** `tests/follow` and `tests/colocated` keep a test beside the code it covers, named `<file>[.<environment>].test.ts` or `<behaviour>[.<environment>].spec.ts`, and the story rules above keep setup in the kit.
|
|
169
|
+
- **Manifests:** `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `source` condition first in `exports` and `imports`.
|
|
170
|
+
- **Biome:** the `biome` rule reports Biome's error findings as `biome/<category>`. The preset's plugins ban ambient time, randomness, `console` and `process.env` in favour of Effect's services.
|
|
148
171
|
|
|
149
172
|
### API
|
|
150
173
|
|
|
151
|
-
Import names from their defining module; there is no root entry. The package's `./*.ts` export pattern also exposes the gate's implementation modules
|
|
174
|
+
Import names from their defining module; there is no root entry. The package's `./*.ts` export pattern also exposes the gate's implementation modules; the following table lists the config, tool and extension entry points:
|
|
152
175
|
|
|
153
176
|
| Module | Exports |
|
|
154
177
|
| --- | --- |
|
|
@@ -175,18 +198,22 @@ Import names from their defining module; there is no root entry. The package's `
|
|
|
175
198
|
|
|
176
199
|
#### Local rules
|
|
177
200
|
|
|
178
|
-
The exposed local-rule API supplements the gate; a repository does not need to use it to get the shared policy.
|
|
201
|
+
The exposed local-rule API supplements the gate; a repository does not need to use it to get the shared policy. Reusable quality policy belongs in Quality itself.
|
|
179
202
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
203
|
+
```ts
|
|
204
|
+
import { defineRule } from "@shivaedev/quality/rule.ts";
|
|
205
|
+
|
|
206
|
+
export const noLog = defineRule({
|
|
207
|
+
check: ({ sources }) =>
|
|
208
|
+
sources
|
|
209
|
+
.filter((file) => file.text.includes("console.log"))
|
|
210
|
+
.map((file) => ({ file: file.path, message: "logs to the console." })),
|
|
211
|
+
description: "Log through the logger.",
|
|
212
|
+
id: "local/no-console-log",
|
|
213
|
+
});
|
|
214
|
+
```
|
|
188
215
|
|
|
189
|
-
A limit rule reports its amount over the limit as `count` and the limit as `threshold
|
|
216
|
+
Register it with `defineConfig({ local: [noLog] })`. Its check receives `root`, checked paths in `files`, source files in `sources`, `readText(path)` and decoded `options`, and may return findings directly or asynchronously. For options, provide a [Standard Schema](https://standardschema.dev) validator; an absent options object is validated as `{}`, so defaults belong in the schema, and a rule without a schema refuses options. A finding's optional `subject` distinguishes exceptions within a rule and file. A limit rule reports its amount over the limit as `count` and the limit as `threshold`; the baseline stores the count. Set `registrable: false` when a rule must never be excused by a config exception.
|
|
190
217
|
|
|
191
218
|
#### Command line
|
|
192
219
|
|
|
@@ -217,11 +244,21 @@ quality hooks pre-commit [--config <file>]
|
|
|
217
244
|
pnpm add --save-dev @shivaedev/quality @effect/platform-node@4.0.4 @effect/platform-node-shared@4.0.4 effect@4.0.4
|
|
218
245
|
```
|
|
219
246
|
|
|
220
|
-
Node 24 or later is required. The CLI loads the TypeScript config through Node's native import; use erasable syntax and `.ts` extensions for relative TypeScript imports.
|
|
247
|
+
Node 24 or later is required. The CLI loads the TypeScript config through Node's native import; use erasable syntax and `.ts` extensions for relative TypeScript imports.
|
|
221
248
|
|
|
222
|
-
The package includes `@shivaedev/quality/biome`, `@shivaedev/quality/tsconfig/base.json` for type-checking
|
|
249
|
+
The package includes `@shivaedev/quality/biome`, `@shivaedev/quality/tsconfig/base.json` for type-checking with `noEmit`, and `@shivaedev/quality/tsconfig/package.json` for package builds, which adds declarations, maps and `rewriteRelativeImportExtensions` so relative `.ts` imports are emitted as `.js`. Read the preset files for their settings. The preset's plugins load from `./node_modules/@shivaedev/quality/biome/plugins`, so install the package at the repository root. Biome sorts a specifier that starts with `#`, `@/`, `~`, `$` or `%` as an alias; a tsconfig path such as `@app/*` sorts with the packages and Biome's `noUndeclaredDependencies` takes it for one, so name aliases in a form Biome recognizes.
|
|
223
250
|
|
|
224
|
-
|
|
251
|
+
The TypeScript base leaves `types`, `jsx`, `paths`, `include` and output directories to each project. A project that needs more built-ins, such as the DOM, sets `lib` itself and keeps `ESNext` in it. A package that type-checks its tests with one config and builds `src` with another extends both, the package preset last:
|
|
252
|
+
|
|
253
|
+
```json
|
|
254
|
+
{
|
|
255
|
+
"extends": ["./tsconfig.json", "@shivaedev/quality/tsconfig/package.json"],
|
|
256
|
+
"compilerOptions": { "outDir": "dist", "rootDir": "src" },
|
|
257
|
+
"include": ["src"]
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
For Vitest, install `vitest`, and add `@shivaedev/test-story` and `happy-dom` when the repository has DOM tests, then use:
|
|
225
262
|
|
|
226
263
|
```ts
|
|
227
264
|
import { testProjects } from "@shivaedev/quality/testProjects.ts";
|
|
@@ -230,7 +267,20 @@ import { defineConfig } from "vitest/config";
|
|
|
230
267
|
export default defineConfig({ test: testProjects() });
|
|
231
268
|
```
|
|
232
269
|
|
|
233
|
-
`testProjects` runs unit tests and specs in Node and `.dom` tests and specs in
|
|
270
|
+
`testProjects` runs unit tests and specs in Node and `.dom` tests and specs in test-story's DOM environment by default. The DOM environment keeps Node's host constructors separate from the happy-dom window, so DOM specs need no project remap. Each test gets 30 seconds instead of Vitest's 5, because tests that start servers, browsers or CLIs take seconds on a busy CI runner. `.slow` tests run only when `--project slow` asks for them. Type tests are excluded from Vitest and belong in the compiler's input.
|
|
271
|
+
|
|
272
|
+
Coverage is opt-in: `testProjects({ coverage: true })` enables Vitest's V8 provider across the selected projects. Install `@vitest/coverage-v8` at the same version as Vitest. The report includes unvisited `src/**/*.ts` and `src/**/*.tsx` files and excludes declarations, tests, specs and `test-support`. To customize it, pass native Vitest coverage options, for example `testProjects({ coverage: { reporter: ["lcov", "text-summary"] } })`. No separate coverage config is needed.
|
|
273
|
+
|
|
274
|
+
Outside CI, `testProjects` sets `silent: "passed-only"` so local runs show logs only from failing tests. When `CI` is set to a nonempty value, it sets `silent: false` so CI keeps all test logs. It leaves `reporters` unset so Vitest can auto-detect its agent reporter. If a repository adds a reporter, spread `configDefaults.reporters` instead of replacing the defaults:
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
import { testProjects } from "@shivaedev/quality/testProjects.ts";
|
|
278
|
+
import { configDefaults, defineConfig } from "vitest/config";
|
|
279
|
+
|
|
280
|
+
export default defineConfig({
|
|
281
|
+
test: { ...testProjects(), reporters: [...configDefaults.reporters, "junit"] },
|
|
282
|
+
});
|
|
283
|
+
```
|
|
234
284
|
|
|
235
285
|
#### PostgreSQL URL gate
|
|
236
286
|
|
|
@@ -267,11 +317,6 @@ export default defineConfig({
|
|
|
267
317
|
|
|
268
318
|
Quality merges the Biome settings at lint and fix time; do not add or mirror an override in `biome.json`. Files are explicit repository paths. Biome exceptions cover individual lint rules or assist actions; whole checks, rule groups and globs are rejected. `biome/files/includes` is the directory exclusion form: keep `**` and list negative patterns naming directories, such as `!**/test-support/generated`. Quality's shipped exceptions remain part of its internal policy. [Exceptions and upgrades](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/debt-and-hooks.md#exceptions) describes subjects, stale entries and the upgrade command.
|
|
269
319
|
|
|
270
|
-
Local-rule APIs supplement the shared policy. They are not setup requirements. Use the shared defaults; repository-specific inputs such as source locations and fences supply information the policy needs.
|
|
271
|
-
|
|
272
|
-
- The gate checks static source policy. A successful import graph, fence example or test naming check does not prove an application's HTTP, database or browser behavior.
|
|
273
320
|
- The source inventory and Biome have their own scopes. `quality fix` runs Biome from the config's folder; it is not restricted to the source-rule inventory.
|
|
274
|
-
- The installed hook checks files on disk and uses each committing worktree's config and dependencies.
|
|
275
|
-
-
|
|
276
|
-
- Workspace imports require a declaration in the importing package’s `dependencies`, `peerDependencies` or `optionalDependencies`. Tests, `test-support`, package-root tooling folders (`script`, `scripts`, `tooling`) and package-root config files may also use `devDependencies`. Explicitly export-blocked bundle inputs may use them when no runtime module reaches those inputs in the scanned import graph; an executable or another public export keeps its imports in the runtime boundary. See the [manifest rule](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/rules.md#manifest-dependencies).
|
|
277
|
-
- Import fences skip test code. Keep the tests honest through their real fixtures and review; declare exceptions only where the rule allows it.
|
|
321
|
+
- The installed hook checks files on disk, not only what is staged, and uses each committing worktree's config and dependencies. A pre-existing `core.hooksPath` decides which hook git runs.
|
|
322
|
+
- Workspace imports require a declaration in the importing package’s `dependencies`, `peerDependencies` or `optionalDependencies`. Tests, `test-support`, package-root tooling folders (`script`, `scripts`, `tooling`) and package-root config files may also use `devDependencies`. Explicitly export-blocked bundle inputs may use them when no runtime module reaches those inputs in the scanned import graph; an executable or another public export keeps its imports in the runtime boundary.
|
package/dist/cli/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC9D;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC9G;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CA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G,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC5G;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC/F;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,GACnC;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACxE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7B,MAAM,MAAM,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnI,eAAO,MAAM,KAAK,8sEAAgB,CAAC;AA2EnC,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAoB5D"}
|
package/dist/cli/args.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
2
|
import { Result } from "effect";
|
|
3
|
-
import {
|
|
3
|
+
import { USAGE as COMMAND_USAGE, SUBCOMMANDS } from "./messages.js";
|
|
4
4
|
export const USAGE = COMMAND_USAGE;
|
|
5
5
|
const OPTIONS = {
|
|
6
6
|
against: { type: "string" },
|
|
@@ -14,11 +14,6 @@ const OPTIONS = {
|
|
|
14
14
|
function usage(problem) {
|
|
15
15
|
return { _tag: "Usage", problem };
|
|
16
16
|
}
|
|
17
|
-
const SUBCOMMANDS = {
|
|
18
|
-
baseline: "baseline takes write, prune, tighten or migrate.",
|
|
19
|
-
exceptions: "exceptions takes migrate.",
|
|
20
|
-
hooks: "hooks takes install, uninstall or pre-commit.",
|
|
21
|
-
};
|
|
22
17
|
function parsed(command) {
|
|
23
18
|
return { _tag: "Parsed", command };
|
|
24
19
|
}
|
|
@@ -82,9 +77,6 @@ export function parseCommand(args) {
|
|
|
82
77
|
return parsed({ _tag: "Help" });
|
|
83
78
|
}
|
|
84
79
|
const name = [command, ...rest].join(" ");
|
|
85
|
-
if (command === "adopt") {
|
|
86
|
-
return usage(ADOPT_REMOVED);
|
|
87
|
-
}
|
|
88
80
|
if (ACCEPTS[name] === undefined) {
|
|
89
81
|
const subcommands = SUBCOMMANDS[command];
|
|
90
82
|
return usage(subcommands !== undefined && rest.length < 2 ? subcommands : `unknown command: ${name}`);
|
package/dist/cli/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAiBpE,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC;AAEnC,MAAM,OAAO,GAAG;IACf,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC3B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1B,IAAI,EAAE,EAAE,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,CAAC,CAAC;IAC9B,CAAC;IACD,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/C,MAAM,CAAC,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,WAAW,CAAC;IAChD,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,KAAK,MAAM,EAAE,CAAC;QAChD,OAAO,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1C,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,KAAK,CAAC,WAAW,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;IACvG,CAAC;IACD,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC1E,CAAC"}
|
package/dist/cli/messages.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const USAGE = "Usage:\n quality lint [--config <file>]\n quality fix [--config <file>]\n quality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline write [--config <file>] [--rule <id>]...\n quality baseline prune [--config <file>] [--against <ref>]\n quality baseline tighten [--config <file>] [--staged]\n quality baseline migrate [--config <file>] [--from <file>]\n quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks pre-commit [--config <file>]\n\nlint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry\n or a baseline entry for an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline write Record current error-level violations. Creates the baseline, or records the named rules again, replacing their entries.\nbaseline prune Drop fixed debt, lower entries to what is left and carry entries to files git saw move. Never adds or raises an entry.\nbaseline tighten Prune only the entries of files changed since HEAD, or with --staged, in the index.\nbaseline migrate Move a baseline from the earlier JSON format (--from, quality/baseline.json by default) to the configured file.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\n--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const SUBCOMMANDS: Readonly<Record<string, string>>;
|
|
3
3
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,8sEA2BwC,CAAC;AAE3D,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,8sEA2BwC,CAAC;AAE3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIxD,CAAC"}
|
package/dist/cli/messages.js
CHANGED
|
@@ -26,5 +26,9 @@ hooks pre-commit What the hook runs: lint, then package.json scripts typecheck
|
|
|
26
26
|
--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.
|
|
27
27
|
--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.
|
|
28
28
|
Exit codes: 0 passed, 1 failed the gate, 2 could not run.`;
|
|
29
|
-
export const
|
|
29
|
+
export const SUBCOMMANDS = {
|
|
30
|
+
baseline: "baseline takes write, prune, tighten or migrate.",
|
|
31
|
+
exceptions: "exceptions takes migrate.",
|
|
32
|
+
hooks: "hooks takes install, uninstall or pre-commit.",
|
|
33
|
+
};
|
|
30
34
|
//# sourceMappingURL=messages.js.map
|
package/dist/cli/messages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;0DA2BqC,CAAC;AAE3D,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;0DA2BqC,CAAC;AAE3D,MAAM,CAAC,MAAM,WAAW,GAAqC;IAC5D,QAAQ,EAAE,kDAAkD;IAC5D,UAAU,EAAE,2BAA2B;IACvC,KAAK,EAAE,+CAA+C;CACtD,CAAC"}
|
package/dist/config/decode.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Schema } from "effect";
|
|
|
2
2
|
import { type Decoded } from "#decoded.ts";
|
|
3
3
|
import type { Rule } from "#rule.ts";
|
|
4
4
|
declare const ConfigInput: Schema.Struct<{
|
|
5
|
-
readonly adopt: Schema.optionalKey<Schema.Never>;
|
|
6
5
|
readonly baseline: Schema.optionalKey<Schema.String>;
|
|
7
6
|
readonly exceptions: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
8
7
|
readonly files: Schema.NonEmptyArray<Schema.NonEmptyString>;
|
|
@@ -12,7 +11,6 @@ declare const ConfigInput: Schema.Struct<{
|
|
|
12
11
|
}>>>;
|
|
13
12
|
readonly extensions: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
14
13
|
readonly local: Schema.optionalKey<Schema.$Array<Schema.declare<Rule<string, unknown>, Rule<string, unknown>>>>;
|
|
15
|
-
readonly preCommit: Schema.optionalKey<Schema.Never>;
|
|
16
14
|
readonly registry: Schema.optionalKey<Schema.String>;
|
|
17
15
|
readonly rules: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Literal<"error">, Schema.Struct<{
|
|
18
16
|
readonly level: Schema.optionalKey<Schema.Literal<"error">>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../src/config/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,aAAa,CAAC;AAEvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../src/config/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,aAAa,CAAC;AAEvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAqBrC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;EAQf,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;AAIlD,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAE1E"}
|
package/dist/config/decode.js
CHANGED
|
@@ -14,19 +14,11 @@ function isRule(value) {
|
|
|
14
14
|
const Level = Schema.Literal("error");
|
|
15
15
|
const Setting = Schema.Union([Level, Schema.Struct({ level: Schema.optionalKey(Level), options: Schema.optionalKey(Schema.Unknown) })]);
|
|
16
16
|
const LocalRule = Schema.declare(isRule, { expected: "a rule made with defineRule" });
|
|
17
|
-
const AdoptRemoved = Schema.Never.annotate({
|
|
18
|
-
message: "removed in quality 0.7.0. Delete the key, and record a rule's existing findings with `quality baseline write --rule <id>`.",
|
|
19
|
-
});
|
|
20
|
-
const PreCommitRemoved = Schema.Never.annotate({
|
|
21
|
-
message: "removed. Put repository checks in the package.json quality:commit script; the hook also runs typecheck when present. Use `quality baseline tighten --staged` explicitly to lower staged debt.",
|
|
22
|
-
});
|
|
23
17
|
const ConfigInput = Schema.Struct({
|
|
24
|
-
adopt: Schema.optionalKey(AdoptRemoved),
|
|
25
18
|
baseline: Schema.optionalKey(Schema.String),
|
|
26
19
|
exceptions: Schema.optionalKey(Schema.Array(ExceptionDeclaration)),
|
|
27
20
|
extensions: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
28
21
|
local: Schema.optionalKey(Schema.Array(LocalRule)),
|
|
29
|
-
preCommit: Schema.optionalKey(PreCommitRemoved),
|
|
30
22
|
registry: Schema.optionalKey(Schema.String),
|
|
31
23
|
rules: Schema.optionalKey(Schema.Record(Schema.String, Setting)),
|
|
32
24
|
sources: Schema.optionalKey(Schema.Array(Schema.String)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decode.js","sourceRoot":"","sources":["../../src/config/decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAgB,UAAU,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,SAAS,MAAM,CAAC,K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,EAAE,gBAAgB,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAExH,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,OAAO,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/config/resolve.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export interface ResolvedRules extends RuleIndex {
|
|
|
7
7
|
readonly active: readonly ActiveRule[];
|
|
8
8
|
}
|
|
9
9
|
export declare const resolveRules: (config: {
|
|
10
|
-
readonly adopt?: never;
|
|
11
10
|
readonly baseline?: string;
|
|
12
11
|
readonly exceptions?: readonly {
|
|
13
12
|
readonly files: readonly [string, ...string[]];
|
|
@@ -17,7 +16,6 @@ export declare const resolveRules: (config: {
|
|
|
17
16
|
}[];
|
|
18
17
|
readonly extensions?: readonly string[];
|
|
19
18
|
readonly local?: readonly Rule<string, unknown>[];
|
|
20
|
-
readonly preCommit?: never;
|
|
21
19
|
readonly registry?: string;
|
|
22
20
|
readonly rules?: {
|
|
23
21
|
readonly [x: string]: "error" | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIrC,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC/C,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;CACvC;AA8CD,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIrC,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC/C,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;CACvC;AA8CD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;yDAmBvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domEnvironment.config.d.ts","sourceRoot":"","sources":["../src/domEnvironment.config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,QAAA,MAAiB,WAAW,aAE3B,CAAC;eAEa,WAAW"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
import { createRequire } from "node:module";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import process from "node:process";
|
|
12
|
+
import { pathToFileURL } from "node:url";
|
|
13
|
+
// Resolve the DOM plugin from the consumer; depending on test-story would cycle through its Quality tooling.
|
|
14
|
+
const consumer = createRequire(join(process.cwd(), "package.json"));
|
|
15
|
+
const { default: environment } = await import(__rewriteRelativeImportExtension(pathToFileURL(consumer.resolve("@shivaedev/test-story/domEnvironment.config.ts")).href));
|
|
16
|
+
export default environment;
|
|
17
|
+
//# sourceMappingURL=domEnvironment.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domEnvironment.config.js","sourceRoot":"","sources":["../src/domEnvironment.config.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,6GAA6G;AAC7G,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC;AACpE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAsC,MAAM,MAAM,kCAC/E,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,gDAAgD,CAAC,CAAC,CAAC,IAAI,EACtF,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/dist/testProjects.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { type TestUserConfig } from "vitest/config";
|
|
2
|
-
export
|
|
2
|
+
export interface TestProjectsOptions {
|
|
3
|
+
readonly coverage?: boolean | NonNullable<TestUserConfig["coverage"]>;
|
|
4
|
+
}
|
|
5
|
+
export declare function testProjects({ coverage }?: TestProjectsOptions): TestUserConfig;
|
|
3
6
|
//# sourceMappingURL=testProjects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testProjects.d.ts","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testProjects.d.ts","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0C,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAe5F,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;CACtE;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAgB,EAAE,GAAE,mBAAwB,GAAG,cAAc,CAgC3F"}
|
package/dist/testProjects.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { Config, ConfigProvider, Effect } from "effect";
|
|
3
|
+
import { coverageConfigDefaults, defaultExclude } from "vitest/config";
|
|
2
4
|
const EXTENSION = "?(c|m)[jt]s?(x)";
|
|
3
5
|
const TYPECHECK_ALONE = `**/typecheck.test.${EXTENSION}`;
|
|
4
6
|
function named(environment) {
|
|
@@ -7,17 +9,35 @@ function named(environment) {
|
|
|
7
9
|
function excluding(...patterns) {
|
|
8
10
|
return [...defaultExclude, named("typecheck"), TYPECHECK_ALONE, ...patterns];
|
|
9
11
|
}
|
|
10
|
-
export function testProjects(
|
|
11
|
-
|
|
12
|
-
throw new Error("testProjects takes no options. Remove suite exclusions; every test belongs in its named project.");
|
|
13
|
-
}
|
|
12
|
+
export function testProjects({ coverage = false } = {}) {
|
|
13
|
+
const ci = Effect.runSync(Config.String("CI").pipe(Config.withDefault("")).parse(ConfigProvider.fromEnv()));
|
|
14
14
|
return {
|
|
15
|
+
...(coverage === false
|
|
16
|
+
? {}
|
|
17
|
+
: {
|
|
18
|
+
coverage: {
|
|
19
|
+
enabled: true,
|
|
20
|
+
exclude: [...coverageConfigDefaults.exclude, "**/*.d.ts", "**/*.test.*", "**/*.spec.*", "**/test-support/**"],
|
|
21
|
+
include: ["src/**/*.{ts,tsx}"],
|
|
22
|
+
provider: "v8",
|
|
23
|
+
...(coverage === true ? {} : coverage),
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
15
26
|
project: ["unit", "dom"],
|
|
16
27
|
projects: [
|
|
17
28
|
{ extends: true, test: { environment: "node", exclude: excluding(named("dom"), named("slow")), include: [named()], name: "unit" } },
|
|
18
|
-
{
|
|
29
|
+
{
|
|
30
|
+
extends: true,
|
|
31
|
+
test: {
|
|
32
|
+
environment: fileURLToPath(import.meta.resolve("#domEnvironment.config.ts")),
|
|
33
|
+
exclude: excluding(named("slow")),
|
|
34
|
+
include: [named("dom")],
|
|
35
|
+
name: "dom",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
19
38
|
{ extends: true, test: { environment: "node", exclude: excluding(), include: [named("slow")], name: "slow" } },
|
|
20
39
|
],
|
|
40
|
+
silent: ci ? false : "passed-only",
|
|
21
41
|
// Tests that start real servers, browsers or CLIs need seconds on a busy CI runner, and Vitest's 5s default fails them for load, not behavior.
|
|
22
42
|
testTimeout: 30_000,
|
|
23
43
|
};
|
package/dist/testProjects.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testProjects.js","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"testProjects.js","sourceRoot":"","sources":["../src/testProjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AAG5F,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAEpC,MAAM,eAAe,GAAG,qBAAqB,SAAS,EAAE,CAAC;AAEzD,SAAS,KAAK,CAAC,WAAyB;IACvC,OAAO,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,qBAAqB,SAAS,EA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E;YACnI;gBACC,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE;oBACL,WAAW,EAAE,aAAa,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;oBAC5E,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBACjC,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACvB,IAAI,EAAE,KAAK;iBACX;aACD;YACD,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;SAC9G;QACD,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa;QAClC,+IAA+I;QAC/I,WAAW,EAAE,MAAM;KACnB,CAAC;AACH,CAAC"}
|
package/docs/debt-and-hooks.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Existing debt, exceptions and commit checks
|
|
2
2
|
|
|
3
|
-
The [README](../README.md) introduces the gate.
|
|
3
|
+
The [README](../README.md) introduces the gate. This page explains how the baseline records debt, how exceptions are applied and how the pre-commit hook runs.
|
|
4
4
|
|
|
5
5
|
## Baseline
|
|
6
6
|
|
|
@@ -35,33 +35,19 @@ quality lint
|
|
|
35
35
|
|
|
36
36
|
An error-level finding that neither the config exceptions nor the baseline covers fails `quality lint`; that is how new debt gets noticed. The baseline itself may grow: a reviewer sees each new or raised entry in the diff and judges it. When the failing findings are debt the baseline should keep, such as the debt of a file that moved or was renamed, record the rule again with `quality baseline write --rule <id>`. The report ends with that command for the rules that failed. Then call out the baseline growth in the pull request description.
|
|
37
37
|
|
|
38
|
-
When an upgrade adds a shared check, keep its default error level, inspect its findings and record retained debt with `quality baseline write --rule <id>`. Review any new counts in the commit.
|
|
39
|
-
|
|
40
38
|
### Counts after a policy change
|
|
41
39
|
|
|
42
|
-
A count depends on the rule's limit, so a Quality policy change that adjusts a limit shifts every count of that rule.
|
|
40
|
+
A count depends on the rule's limit, so a Quality policy change that adjusts a limit shifts every count of that rule. A looser limit leaves entries that allow more than is left: they pass, and `tighten` and `prune` lower them. A stricter limit can make an error-level rule's files fail `quality lint`, since each is now further over the limit. Inspect the findings under the new policy before recording retained debt again with `quality baseline write --rule <id>`. Commit the counts with the policy upgrade. The raised entries show in the diff, and the pull request calls them out.
|
|
43
41
|
|
|
44
42
|
## Exceptions
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
```ts
|
|
49
|
-
export default defineConfig({
|
|
50
|
-
exceptions: [
|
|
51
|
-
{
|
|
52
|
-
files: ["src/parse.ts"],
|
|
53
|
-
reason: "This parser documents and returns the external format unchanged.",
|
|
54
|
-
rules: ["comments/no-jsdoc", "biome/lint/suspicious/noExplicitAny"],
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
});
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Paths are explicit, relative to the config folder. A Quality exception can add `subject` to cover only that finding's subject. Rules that refuse exceptions still refuse them. Quality exceptions apply before the baseline and must cover a current finding; unknown rules, refused rules and stale entries fail the gate. Biome declarations permit individual lint rules and assist actions on explicit files, without a subject. A Biome declaration naming a missing file fails too.
|
|
44
|
+
Permanent exceptions live in `quality.config.ts`'s `exceptions`, as the [README](../README.md#configuration-limits) shows. One entry names `files`, `rules` and one `reason`; it can cover both Quality and Biome rules on the same file. Paths are explicit, relative to the config folder. A Quality exception can add `subject` to cover only that finding's subject. Rules that refuse exceptions still refuse them. Quality exceptions apply before the baseline and must cover a current finding; unknown rules, refused rules and stale entries fail the gate. Biome declarations permit individual lint rules and assist actions on explicit files, without a subject. A Biome declaration naming a missing file fails too.
|
|
61
45
|
|
|
62
46
|
Quality merges the native Biome overrides into a temporary config beside the root config, preserving the repository's settings, preset and plugins, and removes the temporary file after the command. Both `quality lint` and `quality fix` use it. Keep `biome.json` free of consumer exception settings; a manual weakening is still reported. Direct editor or Biome commands use the checked-in config; run Quality to apply its exceptions.
|
|
63
47
|
|
|
64
|
-
For a generated directory exclusion, use `rules: ["biome/files/includes"]` and `files: ["**", "!**/test-support/generated"]`.
|
|
48
|
+
For a generated directory exclusion, use `rules: ["biome/files/includes"]` and `files: ["**", "!**/test-support/generated"]`. Each negative pattern names a concrete directory: it may start with `**/` and use `*` for an intermediate directory, as in `!**/test-support/*/generated`; file patterns, nested `**` and wildcard suffixes are rejected.
|
|
49
|
+
|
|
50
|
+
A package that ships its own Biome preset declares the weakenings the preset makes in a `declarations.json` beside the preset file, as an array of `{ rule, includes, reason }` entries, so a repository that extends it adds nothing for them. Quality's own preset ships its reasons this way.
|
|
65
51
|
|
|
66
52
|
### Upgrade existing exceptions
|
|
67
53
|
|
|
@@ -77,24 +63,9 @@ Export an object or `defineConfig({ ... })` without spreads for automatic editin
|
|
|
77
63
|
|
|
78
64
|
## Pre-commit hook
|
|
79
65
|
|
|
80
|
-
|
|
81
|
-
quality hooks install
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
`quality hooks install` installs a git pre-commit hook that runs `quality hooks pre-commit` before every commit. Installing dependencies never installs it: a repository opts in by running the command, usually from the setup script each checkout runs once. Running it again is safe.
|
|
85
|
-
|
|
86
|
-
The hook runs `quality lint`, then the `typecheck` script from `package.json` when present, then an optional `quality:commit` script for repository checks:
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"scripts": {
|
|
91
|
-
"quality:commit": "pnpm test",
|
|
92
|
-
"typecheck": "tsc --noEmit"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
```
|
|
66
|
+
`quality hooks install` installs a git pre-commit hook that runs `quality hooks pre-commit` before every commit: `quality lint`, then the `typecheck` script, then an optional `quality:commit` script, as the [README](../README.md) describes. A repository opts in by running the command, usually from the setup script each checkout runs once. Running it again is safe.
|
|
96
67
|
|
|
97
|
-
Scripts run from the config's folder, or the current directory when there is no config.
|
|
68
|
+
Scripts run from the config's folder, or the current directory when there is no config. Without a manifest or either script, the hook runs lint alone. An invalid manifest stops the run. Baseline tightening is an explicit command; the hook does not change or stage debt records.
|
|
98
69
|
|
|
99
70
|
After a reported lint failure or a nonzero command exit, later commands still run, so one attempt shows their results too. A config, setup or process-launch failure stops the run. `lint` and the commands check the files on disk, not only what is staged. When checks report failures, the hook blocks the commit and ends with the checks that failed and what to do next:
|
|
100
71
|
|
package/docs/north-star.md
CHANGED
|
@@ -18,7 +18,6 @@ Every finding should tell an agent that has never used the package what to chang
|
|
|
18
18
|
|
|
19
19
|
## What good looks like
|
|
20
20
|
|
|
21
|
-
- Adoption is a small setup task. A repository uses the shared defaults instead of maintaining its own catalogue of rules and levels.
|
|
22
21
|
- Quality's rules, tool configuration and internal exceptions express one policy. A new shared convention belongs here, with a reason and accepted and rejected examples.
|
|
23
22
|
- Repository-specific inputs describe code and architecture. A generated path or import fence does not become permission to choose a weaker standard.
|
|
24
23
|
- The config, inventory, rule evaluation, exceptions, baseline and report form one path. Checks use that path instead of inventing their own debt handling.
|
|
@@ -32,8 +31,6 @@ Every finding should tell an agent that has never used the package what to chang
|
|
|
32
31
|
|
|
33
32
|
A new setting creates a decision every consuming repository must make and maintain. Prefer improving the shared default. Add an input when the check needs a fact about the repository, not merely because another repository prefers a different rule or threshold. Quality can disable a tool rule internally when another tool owns the check or the rule cannot make a reliable judgement. That reason belongs with the shared configuration.
|
|
34
33
|
|
|
35
|
-
The public configuration surface and its gaps are recorded in the [roadmap](./roadmap.md). Usage documentation must describe what the code actually accepts without turning an implementation gap into recommended policy.
|
|
36
|
-
|
|
37
34
|
### Strictness and adoption
|
|
38
35
|
|
|
39
36
|
Adopt the policy as a whole; record old debt instead of weakening it. The baseline exposes uncovered findings without demanding an immediate clean-up of every file. It is a record to review, not proof that retained debt is harmless. Explicit recording can raise counts, and a reviewer owns whether that growth is justified. A config exception is for an enduring, explained exception a rule permits, not a substitute for following that rule.
|