@shivaedev/quality 0.53.1 → 0.55.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 +47 -0
- package/README.md +14 -9
- package/dist/adapters/compileCache.config.d.ts +2 -0
- package/dist/adapters/compileCache.config.d.ts.map +1 -0
- package/dist/adapters/compileCache.config.js +3 -0
- package/dist/adapters/compileCache.config.js.map +1 -0
- package/dist/adapters/knip/entryPointFindings.d.ts.map +1 -1
- package/dist/adapters/knip/entryPointFindings.js +14 -8
- package/dist/adapters/knip/entryPointFindings.js.map +1 -1
- package/dist/adapters/manifestInventory.d.ts.map +1 -1
- package/dist/adapters/manifestInventory.js +3 -1
- package/dist/adapters/manifestInventory.js.map +1 -1
- package/dist/adapters/manifestReader.d.ts +2 -2
- package/dist/adapters/manifestReader.d.ts.map +1 -1
- package/dist/adapters/manifestReader.js +2 -1
- package/dist/adapters/manifestReader.js.map +1 -1
- package/dist/adapters/testProjects.d.ts.map +1 -1
- package/dist/adapters/testProjects.js +1 -0
- package/dist/adapters/testProjects.js.map +1 -1
- package/dist/biome/recognizeDiagnostics.d.ts.map +1 -1
- package/dist/biome/recognizeDiagnostics.js +4 -5
- package/dist/biome/recognizeDiagnostics.js.map +1 -1
- package/dist/biome/report.d.ts +2 -1
- package/dist/biome/report.d.ts.map +1 -1
- package/dist/biome/report.js +11 -5
- package/dist/biome/report.js.map +1 -1
- package/dist/cli/changedRanges.d.ts +2 -0
- package/dist/cli/changedRanges.d.ts.map +1 -0
- package/dist/cli/changedRanges.js +23 -0
- package/dist/cli/changedRanges.js.map +1 -0
- package/dist/cli/fix.d.ts.map +1 -1
- package/dist/cli/fix.js +12 -12
- package/dist/cli/fix.js.map +1 -1
- package/dist/cli/lint.d.ts.map +1 -1
- package/dist/cli/lint.js +3 -1
- package/dist/cli/lint.js.map +1 -1
- package/dist/config.d.ts +5 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/engine/runRules.d.ts.map +1 -1
- package/dist/engine/runRules.js +29 -6
- package/dist/engine/runRules.js.map +1 -1
- package/dist/engine/session.d.ts +3 -2
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/session.js +9 -6
- package/dist/engine/session.js.map +1 -1
- package/dist/exceptions/biomeFindings.d.ts +3 -0
- package/dist/exceptions/biomeFindings.d.ts.map +1 -1
- package/dist/exceptions/biomeFindings.js +21 -0
- package/dist/exceptions/biomeFindings.js.map +1 -1
- package/dist/hooks/preCommit.js +1 -1
- package/dist/hooks/preCommit.js.map +1 -1
- package/dist/imports/adminBindings.d.ts +8 -0
- package/dist/imports/adminBindings.d.ts.map +1 -0
- package/dist/imports/adminBindings.js +36 -0
- package/dist/imports/adminBindings.js.map +1 -0
- package/dist/imports/adminEvidence.d.ts +6 -0
- package/dist/imports/adminEvidence.d.ts.map +1 -0
- package/dist/imports/adminEvidence.js +46 -0
- package/dist/imports/adminEvidence.js.map +1 -0
- package/dist/imports/adminFindings.d.ts +4 -0
- package/dist/imports/adminFindings.d.ts.map +1 -0
- package/dist/imports/adminFindings.js +55 -0
- package/dist/imports/adminFindings.js.map +1 -0
- package/dist/imports/extract.d.ts +2 -1
- package/dist/imports/extract.d.ts.map +1 -1
- package/dist/imports/extract.js +11 -10
- package/dist/imports/extract.js.map +1 -1
- package/dist/imports/graph.d.ts +2 -1
- package/dist/imports/graph.d.ts.map +1 -1
- package/dist/imports/graph.js +4 -2
- package/dist/imports/graph.js.map +1 -1
- package/dist/imports/nodePlatformBarrels.d.ts +3 -0
- package/dist/imports/nodePlatformBarrels.d.ts.map +1 -0
- package/dist/imports/nodePlatformBarrels.js +46 -0
- package/dist/imports/nodePlatformBarrels.js.map +1 -0
- package/dist/imports/projects.d.ts +4 -1
- package/dist/imports/projects.d.ts.map +1 -1
- package/dist/imports/projects.js +42 -17
- package/dist/imports/projects.js.map +1 -1
- package/dist/imports/resolve.d.ts.map +1 -1
- package/dist/imports/resolve.js +5 -3
- package/dist/imports/resolve.js.map +1 -1
- package/dist/manifests/sorted.d.ts.map +1 -1
- package/dist/manifests/sorted.js +1 -1
- package/dist/manifests/sorted.js.map +1 -1
- package/dist/naming/ownExports.d.ts +1 -0
- package/dist/naming/ownExports.d.ts.map +1 -1
- package/dist/naming/ownExports.js +4 -1
- package/dist/naming/ownExports.js.map +1 -1
- package/dist/rules/builtIn.d.ts +2 -2
- package/dist/rules/builtIn.d.ts.map +1 -1
- package/dist/rules/builtIn.js +4 -0
- package/dist/rules/builtIn.js.map +1 -1
- package/dist/rules/files/namedAfterExport.d.ts.map +1 -1
- package/dist/rules/files/namedAfterExport.js +6 -2
- package/dist/rules/files/namedAfterExport.js.map +1 -1
- package/dist/rules/imports/adminPaths.d.ts +2 -0
- package/dist/rules/imports/adminPaths.d.ts.map +1 -0
- package/dist/rules/imports/adminPaths.js +11 -0
- package/dist/rules/imports/adminPaths.js.map +1 -0
- package/dist/rules/imports/resolvable.d.ts.map +1 -1
- package/dist/rules/imports/resolvable.js +9 -6
- package/dist/rules/imports/resolvable.js.map +1 -1
- package/dist/rules/imports/runtime.d.ts.map +1 -1
- package/dist/rules/imports/runtime.js +3 -2
- package/dist/rules/imports/runtime.js.map +1 -1
- package/dist/rules/stories/collectionOrigins.d.ts +1 -1
- package/dist/rules/stories/collectionOrigins.d.ts.map +1 -1
- package/dist/rules/stories/collectionOrigins.js.map +1 -1
- package/dist/rules/stories/globalRetries.d.ts +2 -0
- package/dist/rules/stories/globalRetries.d.ts.map +1 -0
- package/dist/rules/stories/globalRetries.js +45 -0
- package/dist/rules/stories/globalRetries.js.map +1 -0
- package/dist/rules/stories/httpStatus.d.ts.map +1 -1
- package/dist/rules/stories/httpStatus.js +11 -2
- package/dist/rules/stories/httpStatus.js.map +1 -1
- package/dist/rules/stories/importOrigin.d.ts +3 -1
- package/dist/rules/stories/importOrigin.d.ts.map +1 -1
- package/dist/rules/stories/importOrigin.js +15 -0
- package/dist/rules/stories/importOrigin.js.map +1 -1
- package/dist/rules/stories/origins.d.ts.map +1 -1
- package/dist/rules/stories/origins.js +14 -12
- package/dist/rules/stories/origins.js.map +1 -1
- package/dist/rules/stories/retryOption.d.ts +3 -0
- package/dist/rules/stories/retryOption.d.ts.map +1 -0
- package/dist/rules/stories/retryOption.js +37 -0
- package/dist/rules/stories/retryOption.js.map +1 -0
- package/package.json +4 -4
- package/src/adapters/compileCache.config.ts +3 -0
- package/src/adapters/knip/entryPointFindings.ts +15 -8
- package/src/adapters/manifestInventory.ts +3 -1
- package/src/adapters/manifestReader.ts +4 -3
- package/src/adapters/testProjects.ts +1 -0
- package/src/biome/recognizeDiagnostics.ts +6 -7
- package/src/biome/report.ts +11 -5
- package/src/cli/changedRanges.ts +24 -0
- package/src/cli/fix.ts +13 -14
- package/src/cli/lint.ts +3 -0
- package/src/config.ts +7 -5
- package/src/engine/runRules.ts +31 -11
- package/src/engine/session.ts +14 -13
- package/src/exceptions/biomeFindings.ts +29 -0
- package/src/hooks/preCommit.ts +1 -1
- package/src/imports/adminBindings.ts +45 -0
- package/src/imports/adminEvidence.ts +52 -0
- package/src/imports/adminFindings.ts +65 -0
- package/src/imports/extract.ts +12 -10
- package/src/imports/graph.ts +7 -4
- package/src/imports/nodePlatformBarrels.ts +51 -0
- package/src/imports/projects.ts +61 -27
- package/src/imports/resolve.ts +5 -3
- package/src/manifests/sorted.ts +3 -3
- package/src/naming/ownExports.ts +5 -1
- package/src/rules/builtIn.ts +4 -0
- package/src/rules/files/namedAfterExport.ts +6 -2
- package/src/rules/imports/adminPaths.ts +12 -0
- package/src/rules/imports/resolvable.ts +9 -6
- package/src/rules/imports/runtime.ts +3 -2
- package/src/rules/stories/collectionOrigins.ts +13 -1
- package/src/rules/stories/globalRetries.ts +50 -0
- package/src/rules/stories/httpStatus.ts +13 -2
- package/src/rules/stories/importOrigin.ts +17 -0
- package/src/rules/stories/origins.ts +14 -13
- package/src/rules/stories/retryOption.ts +41 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.55.0 - 2026-11-02
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Report test, suite and story registrations that declare a `retry` option with `tests/global-retries`. Remove local retries so vitest-rerun's global reruns record flakes.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Story kits and the Effect test adapter import native Effect submodules instead of whole barrels. Cookie windows, member windows, React mounting and OTLP decoding load when used; browser RPC imports use dedicated modules.
|
|
12
|
+
- App test workers reuse Node's on-disk compilation cache while keeping Vitest's file isolation.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Interrupting a scan stops its pending manifest reads.
|
|
17
|
+
- Report expected filesystem failures from rules as findings. Report unreadable manifests and manifests removed after discovery under `manifests/valid`; keep optional missing-file lookups unchanged.
|
|
18
|
+
- Report tsconfig diagnostics as import findings and honor configured module resolution, path aliases and package export conditions, including NodeNext import and require branches.
|
|
19
|
+
- Accept local rules that require custom Effect services in `defineConfig`, while preserving their rule IDs and schema input types.
|
|
20
|
+
- Refuse empty Biome selections with a Quality repair message for both `quality lint` and `quality fix` on Biome 2.6.3.
|
|
21
|
+
- Reject stale Biome lint and assist exceptions during `quality lint`, naming the file/rule pair to remove from the selected Quality config.
|
|
22
|
+
|
|
23
|
+
### Breaking
|
|
24
|
+
|
|
25
|
+
- `manifestReader` requires an Effect scope so its reads stop when the owning operation ends. Consumers must create and use the reader within `Effect.scoped`.
|
|
26
|
+
- `ImportGraph` includes required `configFindings` metadata. Consumers constructing graphs themselves must supply this array (`configFindings: []` when there are no diagnostics); graphs returned by `importGraph` already include it.
|
|
27
|
+
|
|
28
|
+
## 0.54.0 - 2026-11-01
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- Enforce `imports/admin-paths`: report admin-only source files outside an `admin/` path and admin files reached by member code, naming the destination folder. Follow production imports within each source tree while allowing registration composition and shared member dependencies.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- Count an entry point's dependency as used when an application's live source imports that piece through it, while keeping unused pieces and abandoned-file imports visible.
|
|
37
|
+
- Quality reports HTTP error branches written with `HttpStatus.fromLiteral` outside configured HTTP edges, including comparisons, switch cases and status-list membership.
|
|
38
|
+
- GitHub App requests and artifact storage downloads use the shared HTTP status filter while retaining their GitHub error tags and reasons.
|
|
39
|
+
- Server OTLP exports use the shared HTTP status filter to reset warning suppression after success and report redacted collector failures.
|
|
40
|
+
- Report production imports of the `@effect/platform-node` barrel with module subpaths that avoid loading optional integrations such as redis.
|
|
41
|
+
- Recognize native Effect `catchTags` record keys regardless of the handler body while retaining diagnostics for actual nested component and hook factories.
|
|
42
|
+
- Keep a constant's matching filename valid when the constant becomes private.
|
|
43
|
+
- Name each conflicting fix and format pass's file and line/column range when `quality fix` cannot settle.
|
|
44
|
+
- Use Node platform module subpaths in package runtimes and commands instead of loading the barrel.
|
|
45
|
+
|
|
46
|
+
### Breaking
|
|
47
|
+
|
|
48
|
+
- Generated apps keep shared declarations outside the admin-only tree. Migrate custom `ReadStatistics` imports from `#admin/ReadStatistics.ts` to `#ReadStatistics.ts`, and custom `AdminNavigation` type imports from `#client/admin/Shell.tsx` to `#client/AdminNavigation.ts`.
|
|
49
|
+
|
|
3
50
|
## 0.53.1 - 2026-11-01
|
|
4
51
|
|
|
5
52
|
### Fixed
|
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ The work has three parts: connect the repository to the shared tools once; descr
|
|
|
32
32
|
|
|
33
33
|
`defineRule` accepts synchronous, Promise and Effect checks. Promise checks receive an abort signal as `context.signal`; pass it to cancellable APIs. Effect checks compose filesystem and child-process work in the run's scope. An optional `validate(context)` callback returns inventory-dependent configuration issues before `check`; those issues stop the run as invalid configuration. Configured checks return Effects and preserve their service requirements; tool checks read `FileSystem` and `ChildProcessSpawner` from the environment.
|
|
34
34
|
|
|
35
|
-
Interrupting a run stops its Biome and knip processes and removes their scoped temporary configs before it ends. A rule crash is a defect; the CLI prints the rule id and original stack. Expected setup failures retain their underlying cause without including it in enumerable error data.
|
|
35
|
+
Interrupting a run stops pending manifest reads and its Biome and knip processes and removes their scoped temporary configs before it ends. Expected filesystem failures in rules become findings that name the affected file. A rule crash is a defect; the CLI prints the rule id and original stack. Expected setup failures retain their underlying cause without including it in enumerable error data.
|
|
36
36
|
|
|
37
37
|
### Effect boundaries and services
|
|
38
38
|
|
|
@@ -141,6 +141,8 @@ These contexts work at any repository path without configuration; TypeScript and
|
|
|
141
141
|
|
|
142
142
|
### 2. When architecture needs it: describe an import boundary
|
|
143
143
|
|
|
144
|
+
`imports/admin-paths` follows production imports within each `src/` tree. Files reached only from admin paths, `adminPage`, `registerAdmin`, an exported `adminRegistration`, or a guard using an imported admin permission belong under an `admin/` segment. Member code reaching an admin file is reported too; each finding names the folder to move it to. A member module may compose its admin `registration`, `pages` and `make` files from a `registration` or `modules` file, and both sides may use member persistence. Whole admin modules can live in `src/modules/admin/<name>/`; member features keep admin declarations, server work and client work in their own `admin/` subfolders. Type-only imports also determine ownership; test consumers are excluded. This checks literal import reachability and direct named framework calls, not runtime authorization or computed loaders.
|
|
145
|
+
|
|
144
146
|
An app says where its code runs through folder names. A package adopts the runtime convention by having `src/client/` or `src/server/`; no config entry is needed. In that package, `src/client/` is browser code, `src/server/` is server code, and everything else is shared except package-root tooling. Keep shared code wherever its topic belongs; there is no required `src/shared/` folder or runtime file suffix.
|
|
145
147
|
|
|
146
148
|
`imports/runtime` rejects client imports of server code or Node built-ins. Shared code may import neither client nor server code, use browser globals such as `window`, `document` or `localStorage`, or import Node built-ins. Both client and server code may import shared code. The check includes type imports and re-exports and resolves aliases through the shared import graph. Locally bound names and property names are not browser globals; portable web APIs such as `URL`, `fetch` and `AbortController` remain available to shared code. Test files and `test-support/` ship nowhere and are outside this runtime policy.
|
|
@@ -175,7 +177,7 @@ export default [uiBoundary];
|
|
|
175
177
|
|
|
176
178
|
This is `packages/ui/quality.fences.config.ts`; paths remain relative to the repository root. 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. Every file named in either chain must exist in the checked tree; a deleted file stops the run. Use `external()` for external targets. The chains demonstrate hypothetical imports between those files; they need not be actual imports. 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. A source exception such as `.from(folders("packages/ui/src").except(files("packages/ui/src/testClient.ts")))` admits that one file while its siblings remain fenced. 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.
|
|
177
179
|
|
|
178
|
-
The import rules resolve every literal specifier the
|
|
180
|
+
The import rules resolve every literal specifier with the nearest `tsconfig.json`, or the project it references that includes the file. They preserve the compiler's resolution settings, inherited path aliases and package export conditions, including NodeNext's import and require branches. `imports/resolvable` reports config syntax errors, invalid options and unreadable extended or referenced configs as findings on the config file; repair those before relying on import findings. Without a tsconfig, Quality uses bundler resolution with the `source` condition. The run stops 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:
|
|
179
181
|
|
|
180
182
|
```ts
|
|
181
183
|
import { defineConfig } from "@shivaedev/quality/config.ts";
|
|
@@ -193,6 +195,8 @@ Quality's `tests/story-specs` rule reports a test file that declares tests witho
|
|
|
193
195
|
|
|
194
196
|
Quality's `tests/story-engine` rule reports a kit story with no traits whose body never references its verbs, its story or its test context. Drive the engine through one of the kit's verbs or traits, or, if the code under test is pure, move it to `<stem>.unit.test.ts`, which reaches no engine and mocks nothing. The rule follows the same kit origins and prerequisite exemptions as `tests/story-specs`; unit and typecheck files are exempt.
|
|
195
197
|
|
|
198
|
+
`tests/global-retries` reports a `retry` option on a test, suite or kit story registration, including `retry: 0`. Remove the option: retries are global only and recorded by vitest-rerun so flakes stay visible. The rule follows registrar imports, aliases and modifiers, and options declared as literals, shared variables or spreads. Runner configuration and Effect retry schedules are accepted. It checks registrations throughout the inventory, including unit tests and test-support files, with no story prerequisite exemptions.
|
|
199
|
+
|
|
196
200
|
There is one other honest form. A pure function with no engine behind it gets a plain test in a **unit test** file, declared by the `unit` modifier: `parse.unit.test.ts` beside `parse.ts`, or `<behaviour>.unit.spec.ts`. A unit test exercises one unit and reaches nothing bigger, so `tests/story-specs` rejects a `.unit` file that reaches an engine, directly or through what it imports, following runtime imports through the shared import graph; type-only imports do not count. The engines are Node's file, network, process and worker modules, database clients, HTTP and socket libraries, DOM libraries and the story runners. A test-support fixture the unit file imports must pass the same check. The rule also rejects mocking (`vi.mock`, `vi.spyOn`, `vi.fn`, env and global stubs, fake timers), providing services (`Effect.provide*`, `Layer`, `ManagedRuntime`, `it.layer`) and DOM use in the unit file and its test-support fixtures. Running an Effect that needs nothing, such as with `Effect.runSync` or `it.effect`, is fine. When the module under test reaches an engine, the finding names the import chain and asks you to split the module: move the pure code into a module that reaches no engine and test that one. The static check reads imports and syntax. The runtime guard in `testProjects` catches I/O hidden inside an external package or a global such as `fetch` when a unit test runs.
|
|
197
201
|
|
|
198
202
|
Every finding names both repairs: drive the engine through the package's story kit, or, when the code under test is pure, move the test to a `.unit` file. Never wrap a pure function in a story that ignores its kit.
|
|
@@ -207,7 +211,7 @@ Three more rules keep a spec readable as a story, as the [story-testing skill](h
|
|
|
207
211
|
|
|
208
212
|
`boundaries/queue-sql` rejects SQL mentioning the private `pgboss.` schema. Apps use their queue definitions and let workers process jobs; there is no queue-purge API by design. `boundaries/auth-sql` rejects SQL accessing Better Auth's `user`, `account`, `session` and `verification` tables. App tables reference users by foreign key: migrations may reference only `user(id)` with `ON DELETE CASCADE` or `ON DELETE SET NULL`. Import `userReference` from `@shivaedev/identity/server/better-auth/userReference.ts` and interpolate `sql(userReference.table)` and `sql(userReference.column)` in the reference. Apps use identity for account data; `options.owners` names platform's own auth implementation and its migrations. These rules inspect SQL templates, literal query calls and query variables, and inventoried `.sql` files. They do not evaluate arbitrary runtime SQL construction.
|
|
209
213
|
|
|
210
|
-
`boundaries/http-status` rejects comparisons with HTTP error status numbers, switch cases and literal status-list membership outside `options.edge`. Domain code handles typed errors; the named HTTP edge translates them into transport responses. Process exit codes remain ordinary domain values.
|
|
214
|
+
`boundaries/http-status` rejects comparisons with HTTP error status numbers, switch cases and literal status-list membership outside `options.edge`. It recognizes numeric literals and `HttpStatus.fromLiteral("NotFound")`, for example. Domain code handles typed errors; the named HTTP edge translates them into transport responses. Process exit codes remain ordinary domain values.
|
|
211
215
|
|
|
212
216
|
Glob options (`toolOwned`, `content`, `edge`, `owners` and `suites`) use `{ glob, reason }` declarations. Every declaration needs a nonblank reason and must match a current inventoried file; otherwise configuration fails. Remove declarations when their files disappear. Paths and patterns are relative to the config's directory. Naming and suite options use gitignore patterns; `edge` and `owners` use Node glob patterns.
|
|
213
217
|
|
|
@@ -289,7 +293,7 @@ For adoption, run `quality baseline write --rule code/unused --file src/legacy.t
|
|
|
289
293
|
- **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. `files/named-after-export` accepts a file named after its single exported constant, such as `liveQueryWindow.ts` exporting `const liveQueryWindow`. It keeps the export’s full name while the file name omits words already supplied by any folder above it. In `spaces/client/`, a component exporting `CreateSpace` lives in `Create.tsx`: `spaces/` supplies “Space” even across the intervening `client/` folder. Keep the export named `CreateSpace`; `CreateSpace.tsx` would repeat a folder name. Inside a module’s `client/admin/` or `server/admin/` subtree, file names may repeat words from above `admin/`: `src/modules/inbox/client/admin/inboxRoutes.ts` may export `inboxRoutes`. Names must still match their exports and omit words repeated by folders within the admin subtree. 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 extends the rule's defaults, so list only repository-specific additions; `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.
|
|
290
294
|
- **React:** `react/jsx-conditionals` reports `&&` and ternaries in the JSX children a component returns, including nested decisions and returned `.map` items. Decisions in a `const` above the return, JSX built inside library callbacks and conditional attributes are accepted. A ternary with two plain string or number literal branches, such as `{on ? "On" : "Off"}`, is accepted; branches that select JSX, components or computed values still need a decision before the JSX. This rule owns the check, so the shared Biome preset leaves `noLeakedRender` off.
|
|
291
295
|
- **Tests:** `tests/follow` and `tests/colocated` keep a test beside the code it covers, named `<file>[.<modifier>].test.ts` or `<behaviour>[.<modifier>].spec.ts` with at most one modifier of `dom`, `slow`, `typecheck` and `unit`; a unit test runs without the DOM, so `.unit.dom` is rejected. `tests/colocated` always treats `__tests__/` as a test folder. It treats `test/`, `tests/` and `spec/` as test folders only when their directly contained checked files are all tests or test support; a product folder with source beside its specs is an ordinary source folder. Declared `suites` keep their own layout. Shared test support belongs in `test-support/`, the sanctioned test-only folder. A test covering a whole module may sit at its root or directly beside its folder. The story rules above keep setup in the kit.
|
|
292
|
-
- **Manifests:** `manifests/valid` decodes every repository `package.json` through one shared Schema before dependent rules run and reports each invalid manifest once with its file path.
|
|
296
|
+
- **Manifests:** `manifests/valid` decodes every repository `package.json` through one shared Schema before dependent rules run and reports each invalid manifest once with its file path. An unreadable manifest or one removed after discovery becomes a `manifests/valid` finding. Optional lookups still treat `NotFound` as absence. `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `source` condition first in `exports` and `imports`. `manifests/exports-shape` checks the package root and workspace members with exports. They use one file-preserving TypeScript wildcard: for example, `./*.ts` maps to `./src/*.ts`, `./dist/*.d.ts` and `./dist/*.js` under `source`, `types` and `default`. A subtree pattern such as `./server/*.ts` keeps that same subtree in its targets. An optional root entry and exact-path non-code assets such as JSON presets and `./package.json` are allowed. Every module remains importable; `null` export entries fail with a request to remove the block. A package without modules, such as a dependency shell, exports only exact assets and needs no wildcard. Import each module at its path under `src/`; named aliases, flattened paths, per-file module lists and additional wildcards fail. `manifests/application` keeps an application on its entry points, as described above.
|
|
293
297
|
- **Biome:** the `biome` rule reports Biome's error findings as `biome/<category>`. A Biome run that fails without an error finding, such as one whose config leaves no file to check, fails lint and fix with Biome's message. The preset leaves out the `.worktrees` folder at the root, so a checkout does not lint its linked worktrees, while a worktree inside it lints all of its own files. The preset's plugins ban ambient time, randomness, `console` and `process.env` in favour of Effect's services.
|
|
294
298
|
|
|
295
299
|
### Decide before JSX
|
|
@@ -495,7 +499,7 @@ import { appTestConfig } from "@shivaedev/quality/appTestConfig.ts";
|
|
|
495
499
|
export default appTestConfig();
|
|
496
500
|
```
|
|
497
501
|
|
|
498
|
-
Use this in `vitest.config.ts`. It composes `testProjects` with browser and server resolution and inlines the `@shivaedev` packages for the test server, since an application imports each framework piece by its own name. Both helpers accept extra export conditions for workspace development: `appViteConfig(plugins, ["source"])` and `appTestConfig(["source"])`. Published apps use the defaults.
|
|
502
|
+
Use this in `vitest.config.ts`. It composes `testProjects` with browser and server resolution and inlines the `@shivaedev` packages for the test server, since an application imports each framework piece by its own name. Its `testProjects` defaults enable Node’s on-disk compilation cache in workers to reuse compiled dependencies while Vitest keeps module state isolated between files. Node’s `NODE_DISABLE_COMPILE_CACHE=1` disables that cache. Both helpers accept extra export conditions for workspace development: `appViteConfig(plugins, ["source"])` and `appTestConfig(["source"])`. Published apps use the defaults.
|
|
499
503
|
|
|
500
504
|
For Vitest, install `vitest`, and add `@shivaedev/test-story` and `happy-dom` when the repository has DOM tests, then use:
|
|
501
505
|
|
|
@@ -536,16 +540,17 @@ export default defineConfig({
|
|
|
536
540
|
|
|
537
541
|
A skipped test proves nothing. `noSkippedTests` reports unconditional skips as errors, and its automatic fix is disabled: repair the test or remove a claim it cannot prove. Slow tests belong in the slow project.
|
|
538
542
|
|
|
539
|
-
The **PostgreSQL URL gate** is the only permitted skip convention: a test that needs real PostgreSQL registers conditionally on its `PLATFORM_*_TEST_DATABASE_URL`.
|
|
543
|
+
The **PostgreSQL URL gate** is the only permitted skip convention: a test that needs real PostgreSQL registers conditionally on its `PLATFORM_*_TEST_DATABASE_URL`. Use `postgresTestUrl(name)` from `@shivaedev/test-sql/server/adapters/postgresTestUrl.ts` at collection time. It returns `{ url, configured }`, treats absent and empty URLs as missing, and throws when a URL is missing and `CI` is nonempty. With a URL, execute the body against PostgreSQL and let connection or setup failures fail the test. Nothing else may skip. Keep the condition next to the database setup, either in the test file or its shared `test-support` module:
|
|
540
544
|
|
|
541
545
|
```ts
|
|
542
546
|
import { test } from "vitest";
|
|
543
|
-
import {
|
|
547
|
+
import { postgresTestUrl } from "@shivaedev/test-sql/server/adapters/postgresTestUrl.ts";
|
|
544
548
|
|
|
545
|
-
const
|
|
549
|
+
const { configured } = postgresTestUrl("PLATFORM_SQL_TEST_DATABASE_URL");
|
|
550
|
+
const integration = test.skipIf(!configured);
|
|
546
551
|
```
|
|
547
552
|
|
|
548
|
-
|
|
553
|
+
Declare the real PostgreSQL tests with `integration(name, body)`, or pass `configured` as a story kit's `runIf`. CI must supply the URL for every such test; a green run with missing URLs gives no PostgreSQL evidence.
|
|
549
554
|
|
|
550
555
|
#### Configuration limits
|
|
551
556
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compileCache.config.d.ts","sourceRoot":"","sources":["../../src/adapters/compileCache.config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compileCache.config.js","sourceRoot":"","sources":["../../src/adapters/compileCache.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,kBAAkB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entryPointFindings.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/entryPointFindings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entryPointFindings.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/entryPointFindings.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAOrD,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAyDlG"}
|
|
@@ -3,11 +3,15 @@ import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
|
3
3
|
import { ambientModules } from "#imports/ambient.ts";
|
|
4
4
|
import { importGraph } from "#imports/graph.ts";
|
|
5
5
|
import { isTooling } from "#imports/isTooling.ts";
|
|
6
|
+
import { packageNameOf } from "#imports/packageName.ts";
|
|
6
7
|
import { projectsFor } from "#imports/projects.ts";
|
|
7
8
|
import { packageOf } from "#imports/workspace.ts";
|
|
8
9
|
import { entryPointsOf, isApplication, provider } from "#manifests/entryPoints.ts";
|
|
9
10
|
import { isTestCode } from "#naming/testName.ts";
|
|
10
11
|
import { parse } from "#rules/parse.ts";
|
|
12
|
+
function importedPackage(specifier) {
|
|
13
|
+
return /^[.#/]/u.test(specifier) ? undefined : packageNameOf(specifier);
|
|
14
|
+
}
|
|
11
15
|
export async function entryPointFindings(inputs, findings) {
|
|
12
16
|
const graph = await importGraph(inputs);
|
|
13
17
|
const projectOf = projectsFor(inputs.root);
|
|
@@ -43,16 +47,18 @@ export async function entryPointFindings(inputs, findings) {
|
|
|
43
47
|
return true;
|
|
44
48
|
}
|
|
45
49
|
return ![...graph.edges, ...graph.unresolved].some((edge) => {
|
|
46
|
-
if (
|
|
50
|
+
if (unusedFiles.has(edge.from)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
const target = importedPackage(edge.specifier);
|
|
54
|
+
if (target === undefined) {
|
|
47
55
|
return false;
|
|
48
56
|
}
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.join("/");
|
|
55
|
-
return target !== undefined && provider(entries, target, development(directory, edge.from), true)?.name === name;
|
|
57
|
+
const consumer = owner(edge.from);
|
|
58
|
+
const supplied = provider(policies.get(consumer) ?? [], target, development(consumer, edge.from), true);
|
|
59
|
+
return consumer === directory
|
|
60
|
+
? supplied?.name === name
|
|
61
|
+
: supplied !== undefined && workspace.get(supplied.name) === directory && target === name;
|
|
56
62
|
});
|
|
57
63
|
});
|
|
58
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entryPointFindings.js","sourceRoot":"","sources":["../../../src/adapters/knip/entryPointFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAA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B5H"}
|
|
@@ -49,7 +49,9 @@ export async function loadPackageManifests(readText, files) {
|
|
|
49
49
|
const failures = [];
|
|
50
50
|
for (const file of files) {
|
|
51
51
|
try {
|
|
52
|
-
await manifestEntry(readText, file)
|
|
52
|
+
if ((await manifestEntry(readText, file)) === undefined) {
|
|
53
|
+
throw new ManifestFailure({ message: `required input is missing: ${file}`, path: file });
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
catch (cause) {
|
|
55
57
|
if (!(cause instanceof ManifestFailure)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifestInventory.js","sourceRoot":"","sources":["../../src/adapters/manifestInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKtD,MAAM,OAAO,eAAgB,SAAQ,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAGrE;CAAG;AAYL,MAAM,cAAc,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;AAE1F,MAAM,WAAW,GAAG,IAAI,OAAO,EAA+B,CAAC;AAE/D,SAAS,YAAY,CAAC,QAAkB;IACvC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,SAAS,GAAsB,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;IAC5D,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACrC,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,QAAkB,EAAE,IAAY;IAC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QACtB,CAAC;IACF,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Effect, type FileSystem } from "effect";
|
|
2
|
-
export declare const manifestReader: (root: string) => Effect.Effect<(path: string) => Promise<string | undefined>, never, FileSystem.FileSystem>;
|
|
1
|
+
import { Effect, type FileSystem, type Scope } from "effect";
|
|
2
|
+
export declare const manifestReader: (root: string) => Effect.Effect<(path: string) => Promise<string | undefined>, never, FileSystem.FileSystem | Scope.Scope>;
|
|
3
3
|
//# sourceMappingURL=manifestReader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifestReader.d.ts","sourceRoot":"","sources":["../../src/adapters/manifestReader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"manifestReader.d.ts","sourceRoot":"","sources":["../../src/adapters/manifestReader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAI7D,eAAO,MAAM,cAAc,4HAMzB,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { Effect } from "effect";
|
|
|
3
3
|
import { readOptionalText } from "#inventory/filesystem.ts";
|
|
4
4
|
export const manifestReader = Effect.fn("Manifests.manifestReader")(function* (root) {
|
|
5
5
|
const services = yield* Effect.context();
|
|
6
|
-
|
|
6
|
+
const signal = yield* Effect.abortSignal;
|
|
7
|
+
return (path) => Effect.runPromiseWith(services)(readOptionalText(resolve(root, path)), { signal });
|
|
7
8
|
});
|
|
8
9
|
//# sourceMappingURL=manifestReader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifestReader.js","sourceRoot":"","sources":["../../src/adapters/manifestReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"manifestReader.js","sourceRoot":"","sources":["../../src/adapters/manifestReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAA+B,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,EAC5E,IAAY;IAEZ,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,EAAyB,CAAC;IAChE,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;IACzC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AACrG,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testProjects.d.ts","sourceRoot":"","sources":["../../src/adapters/testProjects.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0C,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAgB5F,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAmBD,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"testProjects.d.ts","sourceRoot":"","sources":["../../src/adapters/testProjects.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0C,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAgB5F,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAmBD,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,cAAc,CAgD9E"}
|
|
@@ -26,6 +26,7 @@ export function testProjects(options = {}) {
|
|
|
26
26
|
const { coverage = false } = options;
|
|
27
27
|
const output = Effect.runSync(TestOutput.pipe(Effect.provide(TestOutput.layer)));
|
|
28
28
|
return {
|
|
29
|
+
execArgv: ["--import", fileURLToPath(import.meta.resolve("#adapters/compileCache.config.ts"))],
|
|
29
30
|
maxWorkers: workerCount(options),
|
|
30
31
|
...(coverage === false
|
|
31
32
|
? {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testProjects.js","sourceRoot":"","sources":["../../src/adapters/testProjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AAE5F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAEpC,MAAM,eAAe,GAAG,qBAAqB,SAAS,EAAE,CAAC;AAEzD,SAAS,KAAK,CAAC,WAAyB;IACvC,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I;QAC/I,WAAW,EAAE,MAAM;KACnB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeDiagnostics.d.ts","sourceRoot":"","sources":["../../src/biome/recognizeDiagnostics.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"recognizeDiagnostics.d.ts","sourceRoot":"","sources":["../../src/biome/recognizeDiagnostics.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAkD9C,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,UAAU,EAAE,CAY5G"}
|
|
@@ -15,15 +15,14 @@ function generatorParameter(node) {
|
|
|
15
15
|
}
|
|
16
16
|
function tagHandler(node, syntax) {
|
|
17
17
|
const property = node.parent;
|
|
18
|
-
if (!ts.isPropertyAssignment(property) ||
|
|
18
|
+
if (!(ts.isPropertyAssignment(property) || ts.isMethodDeclaration(property))
|
|
19
|
+
|| property.name !== node
|
|
20
|
+
|| !ts.isObjectLiteralExpression(property.parent)) {
|
|
19
21
|
return false;
|
|
20
22
|
}
|
|
21
23
|
const handlers = property.parent;
|
|
22
24
|
const call = handlers.parent;
|
|
23
|
-
return
|
|
24
|
-
&& call.arguments.includes(handlers)
|
|
25
|
-
&& ts.isArrowFunction(property.initializer)
|
|
26
|
-
&& nativeEffectCall(property.initializer.body, "fail", syntax));
|
|
25
|
+
return nativeEffectCall(call, "catchTags", syntax) && call.arguments.includes(handlers);
|
|
27
26
|
}
|
|
28
27
|
function misclassified(diagnostic, syntax) {
|
|
29
28
|
const { start, end } = diagnostic.location;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeDiagnostics.js","sourceRoot":"","sources":["../../src/biome/recognizeDiagnostics.ts"],"names":[],"mappings":"AA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AAQ,CAAC,IAAI,CAAC,CAAC;QACnD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1B,OAAO,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/biome/report.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ declare const Report: Schema.Struct<{
|
|
|
36
36
|
}>>;
|
|
37
37
|
readonly summary: Schema.Struct<{
|
|
38
38
|
readonly changed: Schema.Int;
|
|
39
|
+
readonly unchanged: Schema.Int;
|
|
39
40
|
}>;
|
|
40
41
|
}>;
|
|
41
42
|
export type Report = typeof Report.Type;
|
|
@@ -45,7 +46,7 @@ export declare const biomeReport: (root: string, args: readonly string[], except
|
|
|
45
46
|
readonly reason: string;
|
|
46
47
|
readonly rules: readonly [string, ...string[]];
|
|
47
48
|
readonly subject?: string;
|
|
48
|
-
}[] | undefined) => Effect.Effect<{
|
|
49
|
+
}[] | undefined, files?: readonly string[] | undefined) => Effect.Effect<{
|
|
49
50
|
diagnostics: readonly {
|
|
50
51
|
readonly category?: string;
|
|
51
52
|
readonly location: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/biome/report.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3C,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;EAKd,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD,QAAA,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/biome/report.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3C,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;EAKd,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AAEhD,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;EAGV,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAC;AAIxC,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,MAAM,CAA+B,CAAC;AAiCxE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;QAmBX,OAAO;;gLAElB,CAAC"}
|
package/dist/biome/report.js
CHANGED
|
@@ -13,14 +13,13 @@ const Diagnostic = Schema.Struct({
|
|
|
13
13
|
});
|
|
14
14
|
const Report = Schema.Struct({
|
|
15
15
|
diagnostics: Schema.Array(Diagnostic),
|
|
16
|
-
summary: Schema.Struct({ changed: Schema.Int }),
|
|
16
|
+
summary: Schema.Struct({ changed: Schema.Int, unchanged: Schema.Int }),
|
|
17
17
|
});
|
|
18
18
|
const decodeReport = Schema.decodeUnknownOption(Schema.fromJsonString(Report));
|
|
19
19
|
export const FAILING = new Set(["error", "fatal"]);
|
|
20
20
|
function failure(args, run, missing, output) {
|
|
21
21
|
return new SetupFailure({ message: `biome ${args.join(" ")} exited ${run.code} without ${missing}:\n${output.trim()}` });
|
|
22
22
|
}
|
|
23
|
-
// Biome exits with an error but prints an empty report when no file was processed, so only a failing diagnostic explains a failed run.
|
|
24
23
|
function unexplained(run, report) {
|
|
25
24
|
return run.code !== 0 && !report.diagnostics.some((diagnostic) => FAILING.has(diagnostic.severity));
|
|
26
25
|
}
|
|
@@ -31,19 +30,26 @@ const reportFor = Effect.fn("Biome.reportFor")(function* (root, args, paths, exc
|
|
|
31
30
|
if (report._tag === "None") {
|
|
32
31
|
return yield* Effect.fail(failure(command, run, "a report", [run.stdout, run.stderr].join("\n")));
|
|
33
32
|
}
|
|
33
|
+
if (report.value.summary.changed + report.value.summary.unchanged === 0 && !args.includes("--no-errors-on-unmatched")) {
|
|
34
|
+
return yield* new SetupFailure({
|
|
35
|
+
message: `biome ${command.join(" ")} processed no files. Check files.includes in biome.json or biome.jsonc so Quality has files to check.`,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
34
38
|
if (unexplained(run, report.value)) {
|
|
35
39
|
return yield* Effect.fail(failure(command, run, "a failing diagnostic", run.stderr));
|
|
36
40
|
}
|
|
37
41
|
return report.value;
|
|
38
42
|
});
|
|
39
|
-
export const biomeReport = Effect.fn("Biome.biomeReport")(function* (root, args, exceptions = []) {
|
|
40
|
-
const [report, tracked] = yield* Effect.all([reportFor(root, args,
|
|
43
|
+
export const biomeReport = Effect.fn("Biome.biomeReport")(function* (root, args, exceptions = [], files = ["."]) {
|
|
44
|
+
const [report, tracked] = yield* Effect.all([reportFor(root, args, files, exceptions), ignoredTrackedPaths(root)], {
|
|
41
45
|
concurrency: "unbounded",
|
|
42
46
|
});
|
|
43
47
|
const paths = tracked
|
|
44
48
|
.map((path) => relative(root, path))
|
|
49
|
+
.filter((path) => files.includes(".") || files.includes(path))
|
|
45
50
|
.filter((path) => !path.split(sep).some((part) => part === ".git" || part === ".worktrees" || part === "node_modules"));
|
|
46
|
-
const
|
|
51
|
+
const extraArgs = [...args, "--vcs-enabled=false", ...(args.includes("--no-errors-on-unmatched") ? [] : ["--no-errors-on-unmatched"])];
|
|
52
|
+
const extra = paths.length === 0 ? undefined : yield* reportFor(root, extraArgs, paths, exceptions);
|
|
47
53
|
const diagnostics = [...report.diagnostics, ...(extra?.diagnostics ?? [])];
|
|
48
54
|
const unique = [...new Map(diagnostics.map((diagnostic) => [JSON.stringify(diagnostic), diagnostic])).values()];
|
|
49
55
|
return {
|
package/dist/biome/report.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/biome/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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O,CAAC,OAAO,IAAI,CAAC,CAAC,EAAE;KAC5E,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changedRanges.d.ts","sourceRoot":"","sources":["../../src/cli/changedRanges.ts"],"names":[],"mappings":"AAmBA,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAItI"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function position(text, offset) {
|
|
2
|
+
const lines = text.slice(0, offset).split("\n");
|
|
3
|
+
return `${lines.length}:${[...(lines.at(-1) ?? "")].length + 1}`;
|
|
4
|
+
}
|
|
5
|
+
function range(before, after) {
|
|
6
|
+
let start = 0;
|
|
7
|
+
while (start < before.length && start < after.length && before[start] === after[start]) {
|
|
8
|
+
start += 1;
|
|
9
|
+
}
|
|
10
|
+
let end = before.length;
|
|
11
|
+
let otherEnd = after.length;
|
|
12
|
+
while (end > start && otherEnd > start && before[end - 1] === after[otherEnd - 1]) {
|
|
13
|
+
end -= 1;
|
|
14
|
+
otherEnd -= 1;
|
|
15
|
+
}
|
|
16
|
+
return `${position(before, start)}-${position(before, end)}`;
|
|
17
|
+
}
|
|
18
|
+
export function changedRanges(before, after, pass) {
|
|
19
|
+
return [...new Set([...before.keys(), ...after.keys()])]
|
|
20
|
+
.filter((path) => before.get(path) !== after.get(path))
|
|
21
|
+
.map((path) => `${path}:${range(before.get(path) ?? "", after.get(path) ?? "")} (${pass})`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=changedRanges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changedRanges.js","sourceRoot":"","sources":["../../src/cli/changedRanges.ts"],"names":[],"mappings":"AAAA,SAAS,QAAQ,CAAC,IAA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AI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACtD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;AAC9F,CAAC"}
|
package/dist/cli/fix.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix.d.ts","sourceRoot":"","sources":["../../src/cli/fix.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,MAAM,EAAc,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"fix.d.ts","sourceRoot":"","sources":["../../src/cli/fix.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,MAAM,EAAc,MAAM,QAAQ,CAAC;AAKrD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,cAAc,IAAI,CAAC;AAMhC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,CAU/G;AAED,MAAM,WAAW,IAAI,CAAC,QAAQ,EAAE,aAAa;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;CAC7D;AAED,MAAM,WAAW,QAAQ,CAAC,QAAQ,EAAE,aAAa;IAChD,QAAQ,CAAC,MAAM,EAAE,SAAS,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,CAAC;IAC1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;CACvF;AA2DD,eAAO,MAAM,MAAM,GAAsC,QAAQ,EAAE,aAAa,2GAuB9E,CAAC;AAEH,eAAO,MAAM,GAAG,8FAKd,CAAC"}
|
package/dist/cli/fix.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { relative } from "node:path";
|
|
2
2
|
import { Console, Effect, FileSystem } from "effect";
|
|
3
3
|
import { biomeReport } from "#biome/report.ts";
|
|
4
|
+
import { changedRanges } from "#cli/changedRanges.ts";
|
|
4
5
|
import { loadConfig } from "#config/load.ts";
|
|
5
6
|
import { SetupFailure } from "#failure.ts";
|
|
6
7
|
import { posix } from "#inventory/ignoreScope.ts";
|
|
@@ -39,19 +40,16 @@ const round = Effect.fn("Cli.round")(function* (passes, index, afterEachPass) {
|
|
|
39
40
|
const changed = yield* pass.run;
|
|
40
41
|
total += changed;
|
|
41
42
|
parts.push(`${plural(changed, "file")} ${pass.label}`);
|
|
42
|
-
yield* afterEachPass;
|
|
43
|
+
yield* afterEachPass(pass.label);
|
|
43
44
|
}
|
|
44
45
|
yield* Console.log(`quality: Biome round ${index} rewrote ${parts.join(" and ")}.`);
|
|
45
46
|
return total;
|
|
46
47
|
});
|
|
47
|
-
function changedBetween(before, after) {
|
|
48
|
-
return [...new Set([...before.keys(), ...after.keys()])].filter((path) => before.get(path) !== after.get(path));
|
|
49
|
-
}
|
|
50
48
|
function unsettled(changed) {
|
|
51
49
|
const paths = [...changed].sort((left, right) => left.localeCompare(right));
|
|
52
50
|
const stopped = `Biome still rewrote files after ${MAX_FIX_ROUNDS} rounds, so quality fix stopped.`;
|
|
53
51
|
const named = paths.length > 0
|
|
54
|
-
? [`${stopped} These
|
|
52
|
+
? [`${stopped} These ranges changed in the last round (before each pass):`, ...paths.map((path) => ` ${path}`)]
|
|
55
53
|
: [
|
|
56
54
|
`${stopped} The files it changed in the last round are ones quality fix does not read, such as files .gitignore lists.`,
|
|
57
55
|
"Run `biome check --write --unsafe --verbose` to name them.",
|
|
@@ -62,18 +60,20 @@ function unsettled(changed) {
|
|
|
62
60
|
}
|
|
63
61
|
export const settle = Effect.fn("Cli.settle")(function* ({ passes, snapshot, }) {
|
|
64
62
|
for (let index = 1; index < MAX_FIX_ROUNDS; index += 1) {
|
|
65
|
-
if ((yield* round(passes, index, Effect.void)) === 0) {
|
|
63
|
+
if ((yield* round(passes, index, () => Effect.void)) === 0) {
|
|
66
64
|
return;
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
const changed = new Set();
|
|
70
68
|
let previous = yield* snapshot;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
function record(label) {
|
|
70
|
+
return Effect.map(snapshot, (current) => {
|
|
71
|
+
for (const path of changedRanges(previous, current, label)) {
|
|
72
|
+
changed.add(path);
|
|
73
|
+
}
|
|
74
|
+
previous = current;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
77
|
if ((yield* round(passes, MAX_FIX_ROUNDS, record)) === 0) {
|
|
78
78
|
return;
|
|
79
79
|
}
|