@shivaedev/quality 0.62.0 → 0.63.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 +23 -0
- package/README.md +20 -4
- package/dist/adapters/biome/run.d.ts.map +1 -1
- package/dist/adapters/biome/run.js +6 -2
- package/dist/adapters/biome/run.js.map +1 -1
- package/dist/adapters/databaseUrlFindings.d.ts +11 -0
- package/dist/adapters/databaseUrlFindings.d.ts.map +1 -0
- package/dist/adapters/databaseUrlFindings.js +20 -0
- package/dist/adapters/databaseUrlFindings.js.map +1 -0
- package/dist/adapters/databaseUrlReads.d.ts +3 -0
- package/dist/adapters/databaseUrlReads.d.ts.map +1 -0
- package/dist/adapters/databaseUrlReads.js +107 -0
- package/dist/adapters/databaseUrlReads.js.map +1 -0
- package/dist/adapters/imports/resolve.js +1 -1
- package/dist/adapters/imports/resolve.js.map +1 -1
- package/dist/adapters/knip/report.d.ts +3 -0
- package/dist/adapters/knip/report.d.ts.map +1 -0
- package/dist/adapters/knip/report.js +22 -0
- package/dist/adapters/knip/report.js.map +1 -0
- package/dist/adapters/knip/run.d.ts +1 -1
- package/dist/adapters/knip/run.d.ts.map +1 -1
- package/dist/adapters/knip/run.js +3 -5
- package/dist/adapters/knip/run.js.map +1 -1
- package/dist/adapters/outsideImportFindings.d.ts.map +1 -1
- package/dist/adapters/outsideImportFindings.js +2 -30
- package/dist/adapters/outsideImportFindings.js.map +1 -1
- package/dist/adapters/units/runtime.d.ts +6 -0
- package/dist/adapters/units/runtime.d.ts.map +1 -0
- package/dist/adapters/units/runtime.js +46 -0
- package/dist/adapters/units/runtime.js.map +1 -0
- package/dist/adapters/units/runtimeImports.d.ts +10 -0
- package/dist/adapters/units/runtimeImports.d.ts.map +1 -0
- package/dist/adapters/units/runtimeImports.js +51 -0
- package/dist/adapters/units/runtimeImports.js.map +1 -0
- package/dist/adapters/units/runtimeOrigins.d.ts +4 -0
- package/dist/adapters/units/runtimeOrigins.d.ts.map +1 -0
- package/dist/adapters/units/runtimeOrigins.js +85 -0
- package/dist/adapters/units/runtimeOrigins.js.map +1 -0
- package/dist/adapters/units/runtimeUse.d.ts +8 -0
- package/dist/adapters/units/runtimeUse.d.ts.map +1 -0
- package/dist/adapters/units/runtimeUse.js +60 -0
- package/dist/adapters/units/runtimeUse.js.map +1 -0
- package/dist/imports/extract.d.ts.map +1 -1
- package/dist/imports/extract.js +13 -2
- package/dist/imports/extract.js.map +1 -1
- package/dist/inventory/collect.d.ts.map +1 -1
- package/dist/inventory/collect.js +3 -0
- package/dist/inventory/collect.js.map +1 -1
- package/dist/inventory/skillCopies.d.ts +7 -0
- package/dist/inventory/skillCopies.d.ts.map +1 -0
- package/dist/inventory/skillCopies.js +25 -0
- package/dist/inventory/skillCopies.js.map +1 -0
- package/dist/manifests/sorted.d.ts +1 -1
- package/dist/manifests/sorted.d.ts.map +1 -1
- package/dist/manifests/sorted.js +7 -4
- package/dist/manifests/sorted.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/effect/adapterImports.js +1 -1
- package/dist/rules/effect/adapterImports.js.map +1 -1
- package/dist/rules/manifestsExportsShape.d.ts.map +1 -1
- package/dist/rules/manifestsExportsShape.js +20 -11
- package/dist/rules/manifestsExportsShape.js.map +1 -1
- package/dist/rules/manifestsNoTestKits.d.ts +2 -0
- package/dist/rules/manifestsNoTestKits.d.ts.map +1 -0
- package/dist/rules/manifestsNoTestKits.js +59 -0
- package/dist/rules/manifestsNoTestKits.js.map +1 -0
- package/dist/rules/stories/databaseUrl.d.ts +2 -0
- package/dist/rules/stories/databaseUrl.d.ts.map +1 -0
- package/dist/rules/stories/databaseUrl.js +8 -0
- package/dist/rules/stories/databaseUrl.js.map +1 -0
- package/dist/rules/stories/engineOf.d.ts.map +1 -1
- package/dist/rules/stories/engineOf.js +1 -0
- package/dist/rules/stories/engineOf.js.map +1 -1
- package/dist/rules/stories/specs.d.ts.map +1 -1
- package/dist/rules/stories/specs.js +2 -1
- package/dist/rules/stories/specs.js.map +1 -1
- package/dist/rules/stories/unitTests.d.ts +2 -2
- package/dist/rules/stories/unitTests.d.ts.map +1 -1
- package/dist/rules/stories/unitTests.js +6 -2
- package/dist/rules/stories/unitTests.js.map +1 -1
- package/package.json +5 -5
- package/src/adapters/biome/run.ts +6 -2
- package/src/adapters/databaseUrlFindings.ts +23 -0
- package/src/adapters/databaseUrlReads.ts +119 -0
- package/src/adapters/imports/resolve.ts +1 -1
- package/src/adapters/knip/report.ts +22 -0
- package/src/adapters/knip/run.ts +3 -7
- package/src/adapters/outsideImportFindings.ts +2 -34
- package/src/adapters/units/runtime.ts +53 -0
- package/src/adapters/units/runtimeImports.ts +60 -0
- package/src/adapters/units/runtimeOrigins.ts +96 -0
- package/src/adapters/units/runtimeUse.ts +72 -0
- package/src/imports/extract.ts +16 -2
- package/src/inventory/collect.ts +3 -0
- package/src/inventory/skillCopies.ts +30 -0
- package/src/manifests/sorted.ts +9 -8
- package/src/rules/builtIn.ts +4 -0
- package/src/rules/effect/adapterImports.ts +1 -1
- package/src/rules/manifestsExportsShape.ts +20 -11
- package/src/rules/manifestsNoTestKits.ts +73 -0
- package/src/rules/stories/databaseUrl.ts +8 -0
- package/src/rules/stories/engineOf.ts +1 -0
- package/src/rules/stories/specs.ts +2 -1
- package/src/rules/stories/unitTests.ts +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.63.0 - 2026-11-05
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Flag direct `Config` and `process.env` reads of `*DATABASE_URL` variables in test-support with `tests/database-url`; use test-sql's `postgresTestUrl` so missing URLs fail in CI.
|
|
8
|
+
- Reject runtime packages that publish testing modules or declare test packages as shipped dependencies or peers. Findings name the package and direct helpers into `@shivaedev/test-kits`.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Report incomplete Knip analysis, including throwing tool configs, as one `code/unused` finding with the tool output while the other rules finish.
|
|
13
|
+
- Leave skills-tool managed copies, their Claude links and ownership manifests out of lint, formatting and fixes while continuing to check local skills.
|
|
14
|
+
- Resolve Vite asset imports through package exports, accepting the query suffixes declared by `vite/client` while reporting missing assets, private package paths and unsupported suffixes.
|
|
15
|
+
|
|
16
|
+
### Breaking
|
|
17
|
+
|
|
18
|
+
- Unit tests now reject Effect runners, Clock and TestClock through runtime import chains, including production helpers and shared `it.effect` adapters. Use plain Vitest `it` and existing pure APIs for pure logic; move Effect behaviour to the package's story kit. Findings name the helper chain and terminal source location.
|
|
19
|
+
|
|
20
|
+
## 0.62.1 - 2026-11-04
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Accept source-only file-preserving wildcard exports for packages with `"private": true`. Published packages still require source, types and dist mappings, and every package must keep `#test/*` rooted at `./src/test-support/*`.
|
|
25
|
+
|
|
3
26
|
## 0.62.0 - 2026-11-04
|
|
4
27
|
|
|
5
28
|
### Added
|
package/README.md
CHANGED
|
@@ -70,6 +70,8 @@ For an existing kit, compose the lower-level helpers through its local test-supp
|
|
|
70
70
|
|
|
71
71
|
### Dependency pins and repository hygiene
|
|
72
72
|
|
|
73
|
+
`manifests/no-test-kits` rejects runtime packages that expose a `testing` module or declare `@shivaedev/test`, `@shivaedev/test-story`, `@shivaedev/test-sql`, `@shivaedev/test-kits` or `vitest` in dependencies, optional dependencies or peers. It checks explicit export names and targets, including conditions and fallback arrays, and inventoried testing modules exposed through wildcards. Blocked exports and development dependencies pass. Private applications and the test-tooling packages quality, vitest-rerun, test, test-story, test-sql and test-kits are exempt. Move reusable runtime-package helpers into test-kits and keep test dependencies in development dependencies.
|
|
74
|
+
|
|
73
75
|
`manifests/dependency-pins` checks dependencies, development dependencies, optional dependencies and peers in every inventoried package manifest. External dependencies use exact versions, including npm aliases. Workspace, file and link dependencies stay local. Quality finds the nearest `pnpm-workspace.yaml` at or above its config folder. When that workspace declares a default or named catalog, external dependencies use `catalog:` or `catalog:<name>`, and the referenced catalog must contain that dependency. Catalog entries themselves use exact versions. Write catalogs as indented block mappings; inline mappings and YAML aliases receive findings instead of escaping the check.
|
|
74
76
|
|
|
75
77
|
`files/ascii` is opt-in by file selection. It checks the bytes of selected text files, including a UTF-8 BOM, and reports each line containing non-ASCII bytes. Other files are left alone. Supply repository-relative glob patterns:
|
|
@@ -138,7 +140,7 @@ The rule reports hidden configurations and method records, configuration and ope
|
|
|
138
140
|
|
|
139
141
|
`effect/adapter-imports` reports value imports of non-Effect dependencies, peers and optional dependencies, and Node builtins, at the import site. It includes side-effect imports, value re-exports, literal dynamic imports and `require` calls. Each package is checked against its own manifest; dev-only tools and workspace modules are accepted. Type-only imports and re-exports are accepted, including inline `type` specifiers when every binding is a type.
|
|
140
142
|
|
|
141
|
-
Move the integration into an `adapters/` folder and expose Effect values to the rest of the application. Use `import type` when only a type is needed. Folders named `adapters/` and `test-support/`, Effect packages (`effect` and `@effect/*`, including `@effect/platform-node`), native `@shivaedev/*` framework packages,
|
|
143
|
+
Move the integration into an `adapters/` folder and expose Effect values to the rest of the application. Use `import type` when only a type is needed. Folders named `adapters/` and `test-support/`, Effect packages (`effect` and `@effect/*`, including `@effect/platform-node`), native `@shivaedev/*` framework packages, React (`react` and `react-dom`) in `client/` folders, and plain Vitest imports in `.unit` tests are accepted. Other outside libraries in client folders and tests still need adapters; entry points do not exempt imports.
|
|
142
144
|
|
|
143
145
|
The rule refuses config exceptions and inline suppressions. For existing debt, run `quality baseline write --first-adoption --rule effect/adapter-imports`; baseline shards keep one entry per file with its finding count. Run `quality baseline tighten` after moving integrations.
|
|
144
146
|
|
|
@@ -221,6 +223,8 @@ export default defineConfig({ sources: ["src"] });
|
|
|
221
223
|
|
|
222
224
|
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 through `.gitignore`, `info/exclude` or `core.excludesFile`, and the `.git`, `.worktrees` 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`.
|
|
223
225
|
|
|
226
|
+
Quality reads the skills tool’s `.shivaedev-skills.json` ownership manifest in each repository’s `.agents/skills` folder. It skips the recorded folders, their `.claude/skills` links and the manifest itself in source checks, Biome lint and formatting, manifest sorting and fixes, including rule-specific fixes. Local skills beside those copies remain checked. Change a shared skill at its source and run `shivaedev-skills sync` to refresh the copies.
|
|
227
|
+
|
|
224
228
|
Quality discovers each app’s `components.json` and resolves `aliases.ui` through its TypeScript paths or package imports. Inside that folder, source rules and Biome lint, formatting and fixes skip only canonical shadcn registry filenames such as `button.tsx` and `dialog.tsx`, including their `.ts`, `.js` and `.jsx` variants. Hand-written components with other names stay checked, as do matching names outside the configured UI folder. Knip still follows imports from skipped components, so their dependencies count as used. Ownership follows filenames: a hand-written file that reuses a registry name inside the UI folder is also skipped.
|
|
225
229
|
|
|
226
230
|
Quality reads each app's `tsr.config.json` and literal `tanstackRouter` / `TanStackRouterVite` options imported from `@tanstack/router-plugin/vite` or `@tanstack/router-vite-plugin` in `vite.config.*`. `routesDirectory` is relative to that app's config folder and defaults to `src/routes`; Vite options override the JSON options. Declare the folder once in the router configuration: `files/named-after-export` accepts route filenames, and `files/folder-names` accepts their route groups and pathless layout folders, including routes added later. Other source rules still check routes. Ordinary files outside that folder, other apps and helper files excluded by `routeFileIgnorePrefix` (default `-`), `routeFileIgnorePattern` or `routeFilePrefix` keep their normal naming checks. A folder named `routes` alone establishes no ownership. Ignore patterns use Unicode regular expressions. Quality reads configuration without executing Vite: computed or spread router options must move into `tsr.config.json` or become literal options. Malformed JSON or invalid route-folder settings stop the gate. Exception declarations still name explicit files; route discovery adds no exception globs.
|
|
@@ -277,7 +281,11 @@ export default [uiBoundary];
|
|
|
277
281
|
|
|
278
282
|
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.
|
|
279
283
|
|
|
280
|
-
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 `@shivaedev/source` condition. The run stops when the sources hold no module at all.
|
|
284
|
+
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 `@shivaedev/source` condition. The run stops when the sources hold no module at all.
|
|
285
|
+
|
|
286
|
+
Vite asset queries resolve the path before the query, including package assets through their declared exports. Supported suffixes match `vite/client`: `?url`, `?raw`, `?worker`, `?worker&inline`, `?worker&url`, `?sharedworker`, `?sharedworker&inline`, `?sharedworker&url`, `?inline`, `?no-inline`, `?url&inline`, `?url&no-inline` and `.wasm?init`. For example, `import url from 'zxing-wasm/reader/zxing_reader.wasm?url'` resolves the exported wasm file without an application module declaration. Missing files, private package paths and unsupported query suffixes still produce findings.
|
|
287
|
+
|
|
288
|
+
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:
|
|
281
289
|
|
|
282
290
|
```ts
|
|
283
291
|
import { defineConfig } from "@shivaedev/quality/config.ts";
|
|
@@ -299,7 +307,11 @@ Quality's `tests/story-engine` rule reports spec bodies that read raw service ha
|
|
|
299
307
|
|
|
300
308
|
`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.
|
|
301
309
|
|
|
302
|
-
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.
|
|
310
|
+
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.
|
|
311
|
+
|
|
312
|
+
A unit file also reaches no `Clock`, `TestClock` or `Effect.run*` runner, including aliases, subpath imports and re-exports, through any runtime import chain, including production modules and shared `it.effect` helpers. Each such finding points to the first relevant import or call in the unit file and names the helper chain to the terminal file and line. A requirement-free Effect type does not prove purity. Keep pure logic in plain Vitest `it` tests using synchronous APIs or `Schema.decodeUnknownResult` / `Schema.encodeResult`; exercise behaviour that needs the Effect runtime through the package story kit. Type-only imports, comments, strings and unrelated local objects named `Clock` do not count.
|
|
313
|
+
|
|
314
|
+
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.
|
|
303
315
|
|
|
304
316
|
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.
|
|
305
317
|
|
|
@@ -389,6 +401,8 @@ Git calls `quality baseline merge <ancestor> <current> <other>`. Entries are key
|
|
|
389
401
|
|
|
390
402
|
Package `exports` are public API, including wildcard targets and source conditions. Package `bin` and scripts, test and story globs, tool configs and `src/test-support` provide the other entry points. Imports reachable from those entries count as used. Source-conditioned package import aliases resolve to their sources before a build. Compiler mappings from `tsconfig.json` and `tsconfig.build.json` keep imports on their source files when build output exists. An internal module can be used while one of its exports remains unused. An application’s declared dependency entry points satisfy provided imports under the same policy as `imports/manifest`.
|
|
391
403
|
|
|
404
|
+
When Knip cannot produce a valid report, including when a tool config such as `prisma.config.ts` throws because `DATABASE_URL` is missing, `code/unused` reports one finding on the root `package.json` with the tool’s output and repair guidance. The other rules still run. This finding means unused-code analysis did not complete; repair the failure and rerun the gate.
|
|
405
|
+
|
|
392
406
|
For adoption, run `quality baseline write --rule code/unused --file src/legacy.ts` and review the recorded debt. Burn it down by deleting unused code, removing unused dependency declarations, declaring missing dependencies, or connecting code to a real entry point. Run `quality baseline tighten` after repairs, or `quality baseline prune` across the repository. Do not add an entry point just to hide dead code.
|
|
393
407
|
|
|
394
408
|
### What the rules check
|
|
@@ -405,7 +419,7 @@ For adoption, run `quality baseline write --rule code/unused --file src/legacy.t
|
|
|
405
419
|
- **SQL transactions:** `effect/sql-transact` reports native `sql.withTransaction` calls around repository writes, `transact` or `invalidateOnCommit`. Begin the outer transaction with `transact(effect, { onSqlError })` so changed keys follow its commit. The rule resolves native SQL and repository declarations and follows direct calls, pipes, local aliases and source helpers. Native read-only and raw SQL transactions and unrelated transaction methods remain supported.
|
|
406
420
|
- **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.
|
|
407
421
|
- **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.
|
|
408
|
-
- **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 `@shivaedev/source` or `source` condition first in `exports` and `imports`. `manifests/exports-shape` checks the package root and workspace members. They use one file-preserving TypeScript wildcard: for example, `./*.ts` maps to `./src/*.ts`, `./dist/*.d.ts` and `./dist/*.js` under `@shivaedev/source` (or an application’s own `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. When declared, the standard imports must preserve their roots: `#*.ts` maps directly to `./src/*.ts` or uses `@shivaedev/source` (or an application’s own `source`) `./src/*.ts`, types `./dist/*.d.ts` and default `./dist/*.js`; `#test/*` maps to `./src/test-support/*`. Include subfolders in specifiers, such as `#server/module.ts`. Other aliases are allowed. `manifests/application` keeps an application on its entry points, as described above.
|
|
422
|
+
- **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 `@shivaedev/source` or `source` condition first in `exports` and `imports`. `manifests/exports-shape` checks the package root and workspace members. They use one file-preserving TypeScript wildcard: for example, `./*.ts` maps to `./src/*.ts`, `./dist/*.d.ts` and `./dist/*.js` under `@shivaedev/source` (or an application’s own `source`), `types` and `default`. Packages with `"private": true` may instead map the wildcard directly to source (`"./*.ts": "./src/*.ts"`); published packages require the full source, types and default conditions. 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. When declared, the standard imports must preserve their roots: `#*.ts` maps directly to `./src/*.ts` or uses `@shivaedev/source` (or an application’s own `source`) `./src/*.ts`, types `./dist/*.d.ts` and default `./dist/*.js`; `#test/*` maps to `./src/test-support/*`. Include subfolders in specifiers, such as `#server/module.ts`. Other aliases are allowed. `manifests/application` keeps an application on its entry points, as described above.
|
|
409
423
|
- **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.
|
|
410
424
|
|
|
411
425
|
### Decide before JSX
|
|
@@ -655,6 +669,8 @@ export default defineConfig({
|
|
|
655
669
|
|
|
656
670
|
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.
|
|
657
671
|
|
|
672
|
+
`tests/database-url` reports direct `Config` string, redacted and URL reads and `process.env` reads of names ending in `DATABASE_URL` inside `test-support/`. It follows imports and static const aliases, including bracket access and environment destructuring. Use `postgresTestUrl` instead. Environment writes, child-app source strings and forwarding the environment to a generated app are accepted.
|
|
673
|
+
|
|
658
674
|
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:
|
|
659
675
|
|
|
660
676
|
```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/adapters/biome/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/adapters/biome/run.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAQxC,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAID,eAAO,MAAM,QAAQ;;;;;;;;;kOAkCnB,CAAC"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
+
import { relative } from "node:path";
|
|
2
3
|
import process from "node:process";
|
|
3
4
|
import { Effect, Stream } from "effect";
|
|
4
5
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
5
6
|
import { withExceptionConfig } from "#adapters/biome/withExceptionConfig.ts";
|
|
7
|
+
import { posix } from "#inventory/ignoreScope.ts";
|
|
6
8
|
import { shadcnFiles } from "#inventory/shadcnFiles.ts";
|
|
9
|
+
import { skillCopies } from "#inventory/skillCopies.ts";
|
|
7
10
|
const BIN = createRequire(import.meta.url).resolve("@biomejs/biome/bin/biome");
|
|
8
11
|
export const runBiome = Effect.fn("Biome.runBiome")(function* (root, args, exceptions = [], nonEffectFolders = []) {
|
|
9
12
|
const files = yield* shadcnFiles(root);
|
|
13
|
+
const copies = (yield* skillCopies(root)).paths.map((file) => posix(relative(root, file)));
|
|
10
14
|
const toolOwned = [
|
|
11
15
|
{
|
|
12
|
-
files: ["**", "!**/pnpm-lock.yaml", ...files.map((file) => `!${file}`)],
|
|
13
|
-
reason: "pnpm
|
|
16
|
+
files: ["**", "!**/pnpm-lock.yaml", ...[...files, ...copies].map((file) => `!${file}`)],
|
|
17
|
+
reason: "pnpm, shadcn and the skills tool own their generated files and copies.",
|
|
14
18
|
rules: ["biome/files/includes"],
|
|
15
19
|
},
|
|
16
20
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/adapters/biome/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAQxD,MAAM,GAAG,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,EAC5D,IAAY,EACZ,IAAuB,EACvB,UAAU,GAAoC,EAAE,EAChD,gBAAgB,GAAsB,EAAE;IAExC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,SAAS,GAAoC;QAClD;YACC,KAAK,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/adapters/biome/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QA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AAE,GAAG,SAAS,CAAC,EAC7B,CAAC,UAAU,EAAE,EAAE,CACd,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,mBAAmB,CAAC,mBAAmB,CAAC;QAC/D,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CACjC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,UAAU,EAAE,cAAc,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAClH,CAAC;QACF,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAC/C,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,EACpH,EAAE,WAAW,EAAE,WAAW,EAAE,CAC5B,CAAC;QACF,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC/C,CAAC,CAAC,EACH,gBAAgB,CAChB,CACD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { RuleInputs } from "#rule.ts";
|
|
3
|
+
export declare const databaseUrlFindings: (inputs: RuleInputs) => Effect.Effect<{
|
|
4
|
+
count?: number | undefined;
|
|
5
|
+
line?: number | undefined;
|
|
6
|
+
message: string;
|
|
7
|
+
subject?: string | undefined;
|
|
8
|
+
threshold?: number | undefined;
|
|
9
|
+
file: string;
|
|
10
|
+
}[], import("./ImportAnalysisFailure.ts").ImportAnalysisFailure, never>;
|
|
11
|
+
//# sourceMappingURL=databaseUrlFindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"databaseUrlFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/databaseUrlFindings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAQ3C,eAAO,MAAM,mBAAmB;;;;;;;uEAU9B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { importGraph } from "#imports/graph.ts";
|
|
4
|
+
import { isTestSupport } from "#naming/testName.ts";
|
|
5
|
+
import { findingAt } from "#rules/stories/syntax.ts";
|
|
6
|
+
import { databaseUrlReads } from "./databaseUrlReads.js";
|
|
7
|
+
import { storyProgram } from "./storyProgram.js";
|
|
8
|
+
const MESSAGE = "Reads a *DATABASE_URL variable directly in test-support. Use postgresTestUrl(name) from @shivaedev/test-sql/server/adapters/postgresTestUrl.ts so missing PostgreSQL URLs fail in CI instead of silently skipping tests.";
|
|
9
|
+
export const databaseUrlFindings = Effect.fn("Stories.databaseUrlFindings")(function* (inputs) {
|
|
10
|
+
const graph = yield* importGraph(inputs);
|
|
11
|
+
const program = storyProgram(inputs, graph);
|
|
12
|
+
const checker = program.getTypeChecker();
|
|
13
|
+
return inputs.sources
|
|
14
|
+
.filter((file) => isTestSupport(file.path))
|
|
15
|
+
.flatMap((file) => {
|
|
16
|
+
const source = program.getSourceFile(join(inputs.root, file.path));
|
|
17
|
+
return source === undefined ? [] : databaseUrlReads(source, checker).map((node) => ({ ...findingAt(source, node, MESSAGE), file: file.path }));
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=databaseUrlFindings.js.map
|
|
@@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,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAChJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"databaseUrlReads.d.ts","sourceRoot":"","sources":["../../src/adapters/databaseUrlReads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAyB5B,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,GAAG,SAAS,EAAE,CAAC,IAAI,EAAE,CAqFnG"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { importFrom } from "#rules/stories/importOrigin.ts";
|
|
3
|
+
import { memberName, nodesWhere, unwrapped } from "#rules/stories/syntax.ts";
|
|
4
|
+
const READERS = new Set(["String", "NonEmptyString", "Redacted", "URL", "string", "nonEmptyString", "redacted", "url"]);
|
|
5
|
+
function importedReference(node) {
|
|
6
|
+
const from = importFrom(node);
|
|
7
|
+
if (from === undefined) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
if (ts.isImportSpecifier(node)) {
|
|
11
|
+
return [from, (node.propertyName ?? node.name).text];
|
|
12
|
+
}
|
|
13
|
+
if (ts.isNamespaceImport(node) || (ts.isImportClause(node) && (from === "node:process" || from === "process"))) {
|
|
14
|
+
return [from];
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
function bindingName(node) {
|
|
19
|
+
const name = node.propertyName ?? node.name;
|
|
20
|
+
return ts.isIdentifier(name) || ts.isStringLiteralLike(name) ? name.text : undefined;
|
|
21
|
+
}
|
|
22
|
+
export function databaseUrlReads(source, checker) {
|
|
23
|
+
const visiting = new Set();
|
|
24
|
+
function declaration(node) {
|
|
25
|
+
if (ts.isVariableDeclaration(node) && node.initializer !== undefined && (node.parent.flags & ts.NodeFlags.Const) !== 0) {
|
|
26
|
+
return value(node.initializer);
|
|
27
|
+
}
|
|
28
|
+
if (ts.isBindingElement(node) && ts.isObjectBindingPattern(node.parent) && ts.isVariableDeclaration(node.parent.parent)) {
|
|
29
|
+
const base = declaration(node.parent.parent);
|
|
30
|
+
const name = bindingName(node);
|
|
31
|
+
return base !== undefined && name !== undefined ? [...base, name] : undefined;
|
|
32
|
+
}
|
|
33
|
+
return importedReference(node);
|
|
34
|
+
}
|
|
35
|
+
function value(expression) {
|
|
36
|
+
const node = unwrapped(expression);
|
|
37
|
+
if (visiting.has(node)) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
visiting.add(node);
|
|
41
|
+
const result = reference(node);
|
|
42
|
+
visiting.delete(node);
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
function reference(node) {
|
|
46
|
+
if (ts.isStringLiteralLike(node)) {
|
|
47
|
+
return [node.text];
|
|
48
|
+
}
|
|
49
|
+
if (ts.isIdentifier(node)) {
|
|
50
|
+
const symbol = checker.getSymbolAtLocation(node);
|
|
51
|
+
return (symbol?.declarations?.map(declaration).find((item) => item !== undefined)
|
|
52
|
+
?? (symbol === undefined && node.text === "process" ? ["process"] : undefined));
|
|
53
|
+
}
|
|
54
|
+
if (ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) {
|
|
55
|
+
return access(node);
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
function access(node) {
|
|
60
|
+
const base = value(node.expression);
|
|
61
|
+
const name = memberName(node) ?? (ts.isElementAccessExpression(node) ? value(node.argumentExpression)?.[0] : undefined);
|
|
62
|
+
return base !== undefined && name !== undefined ? [...base, name] : undefined;
|
|
63
|
+
}
|
|
64
|
+
function environment(path) {
|
|
65
|
+
return path?.length === 2 && (path[0] === "process" || path[0] === "node:process") && path[1] === "env";
|
|
66
|
+
}
|
|
67
|
+
function databaseName(path) {
|
|
68
|
+
return path?.length === 1 && path[0]?.endsWith("DATABASE_URL") === true;
|
|
69
|
+
}
|
|
70
|
+
function environmentBinding(node) {
|
|
71
|
+
if (node.dotDotDotToken !== undefined || !ts.isObjectBindingPattern(node.parent)) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
const parent = node.parent.parent;
|
|
75
|
+
return (ts.isVariableDeclaration(parent)
|
|
76
|
+
&& parent.initializer !== undefined
|
|
77
|
+
&& environment(value(parent.initializer))
|
|
78
|
+
&& bindingName(node)?.endsWith("DATABASE_URL") === true);
|
|
79
|
+
}
|
|
80
|
+
function read(node) {
|
|
81
|
+
if (ts.isCallExpression(node)) {
|
|
82
|
+
const path = value(node.expression);
|
|
83
|
+
const method = path?.at(-1) ?? "";
|
|
84
|
+
const argument = node.arguments[method === "schema" ? 1 : 0];
|
|
85
|
+
return (path !== undefined
|
|
86
|
+
&& (READERS.has(method) || method === "schema")
|
|
87
|
+
&& path.slice(0, -1).join("/") === "effect/Config"
|
|
88
|
+
&& argument !== undefined
|
|
89
|
+
&& databaseName(value(argument)));
|
|
90
|
+
}
|
|
91
|
+
if (ts.isBindingElement(node)) {
|
|
92
|
+
return environmentBinding(node);
|
|
93
|
+
}
|
|
94
|
+
if (!(ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node))) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
const path = value(node);
|
|
98
|
+
return environment(path?.slice(0, -1)) && databaseName(path?.slice(-1)) && !write(node);
|
|
99
|
+
}
|
|
100
|
+
return nodesWhere(source, read);
|
|
101
|
+
}
|
|
102
|
+
function write(node) {
|
|
103
|
+
const parent = node.parent;
|
|
104
|
+
return (ts.isDeleteExpression(parent)
|
|
105
|
+
|| (ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === ts.SyntaxKind.EqualsToken));
|
|
106
|
+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,OAAO,CACN,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC;WAC1B,CAAC,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CACrH,CAAC;AACH,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { posix } from "#inventory/ignoreScope.ts";
|
|
|
6
6
|
const NODE_MODULES = "/node_modules/";
|
|
7
7
|
const ASSET_DECLARATION = /\.d(?<extension>\.[^./]+)\.ts$/u;
|
|
8
8
|
const DECLARATION = /\.d\.[cm]?ts$/u;
|
|
9
|
-
const QUERY =
|
|
9
|
+
const QUERY = /(?<=\.wasm)\?init$|\?(?:(?:shared)?worker(?:&(?:inline|url))?|raw|url(?:&(?:no-)?inline)?|(?:no-)?inline)$/u;
|
|
10
10
|
const PACKAGE_IMPORT = "#";
|
|
11
11
|
const PACKAGE_JSON = "package.json";
|
|
12
12
|
const presumingHost = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../src/adapters/imports/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAGlD,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAEtC,MAAM,iBAAiB,GAAG,iCAAiC,CAAC;AAE5D,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC,MAAM,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"resolve.js","source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AC,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC;QAC/C,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE;QAC/F,CAAC,CAAC,SAAS,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAkBjF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { knipFindings } from "./findings.js";
|
|
2
|
+
export function knipReport(stdout, stderr, code) {
|
|
3
|
+
let report;
|
|
4
|
+
let failure;
|
|
5
|
+
try {
|
|
6
|
+
report = knipFindings(stdout);
|
|
7
|
+
if (code === (report.length > 0 ? 1 : 0)) {
|
|
8
|
+
return report;
|
|
9
|
+
}
|
|
10
|
+
failure = `knip exited ${code} inconsistently with its report:\n${stderr || stdout}`;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
failure = `knip exited ${code} without a valid report:\n${stderr || stdout || "No output."}`;
|
|
14
|
+
}
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
file: "package.json",
|
|
18
|
+
message: `Unused-code analysis did not complete. Repair the tool configuration or command failure and rerun quality lint. ${failure}`,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../src/adapters/knip/report.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,MAAc,EAAE,IAAY;IACtE,IAAI,MAAgB,CAAC;IACrB,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACJ,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1C,OAAO,MAAM,CAAC;QACf,CAAC;QACD,OAAO,GAAG,eAAe,IAAI,qCAAqC,MAAM,IAAI,MAAM,EAAE,CAAC;IACtF,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,GAAG,eAAe,IAAI,6BAA6B,MAAM,IAAI,MAAM,IAAI,YAAY,EAAE,CAAC;IAC9F,CAAC;IACD,OAAO;QACN;YACC,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,mHAAmH,OAAO,EAAE;SACrI;KACD,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { RuleInputs } from "#rule.ts";
|
|
3
|
-
export declare const runKnip: (inputs: RuleInputs) => Effect.Effect<import("#rule.ts").Finding[],
|
|
3
|
+
export declare const runKnip: (inputs: RuleInputs) => Effect.Effect<import("#rule.ts").Finding[], import("../../inventory/filesystem.ts").FilesystemFailure | import("../ImportAnalysisFailure.ts").ImportAnalysisFailure | import("effect/PlatformError").PlatformError | import("../../failure.ts").SetupFailure, import("#rule.ts").RuleServices>;
|
|
4
4
|
//# sourceMappingURL=run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/run.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAsB,MAAM,QAAQ,CAAC;AAIpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/adapters/knip/run.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAsB,MAAM,QAAQ,CAAC;AAIpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAe3C,eAAO,MAAM,OAAO,wTAkDlB,CAAC"}
|
|
@@ -8,7 +8,8 @@ import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
|
8
8
|
import { shadcnFolders } from "#inventory/shadcnFolders.ts";
|
|
9
9
|
import { knipConfiguration } from "./configuration.js";
|
|
10
10
|
import { entryPointFindings } from "./entryPointFindings.js";
|
|
11
|
-
import { KNIP_ISSUES
|
|
11
|
+
import { KNIP_ISSUES } from "./findings.js";
|
|
12
|
+
import { knipReport } from "./report.js";
|
|
12
13
|
import { sourceConfig } from "./sourceConfig.js";
|
|
13
14
|
const API = createRequire(import.meta.url).resolve("knip");
|
|
14
15
|
const BIN = join(dirname(API), "..", "bin", "knip.js");
|
|
@@ -53,10 +54,7 @@ export const runKnip = Effect.fn("Knip.runKnip")(function* (inputs) {
|
|
|
53
54
|
"--no-progress",
|
|
54
55
|
], { cwd, env: { "JITI_TRY_NATIVE": "true" }, extendEnv: true, stdin: "ignore" }));
|
|
55
56
|
const [stdout, stderr, code] = yield* Effect.all([Stream.mkString(Stream.decodeText(child.stdout)), Stream.mkString(Stream.decodeText(child.stderr)), child.exitCode], { concurrency: "unbounded" });
|
|
56
|
-
const report =
|
|
57
|
-
if (Number(code) !== (report.length > 0 ? 1 : 0)) {
|
|
58
|
-
return yield* Effect.fail(new Error(`knip exited ${code} inconsistently with its report:\n${stderr || stdout}`));
|
|
59
|
-
}
|
|
57
|
+
const report = knipReport(stdout, stderr, Number(code));
|
|
60
58
|
return report.filter((finding) => checked.has(finding.file));
|
|
61
59
|
}));
|
|
62
60
|
return yield* entryPointFindings(inputs, findings);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/adapters/knip/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/adapters/knip/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OA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AAM;YACN,YAAY;YACZ,QAAQ;YACR,YAAY;YACZ,MAAM;YACN,WAAW;YACX,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;YACrB,eAAe;SACf,EACD,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAC7E,CACD,CAAC;QACF,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAC/C,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,EACpH,EAAE,WAAW,EAAE,WAAW,EAAE,CAC5B,CAAC;QACF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CACF,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACpD,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outsideImportFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/outsideImportFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"outsideImportFindings.d.ts","sourceRoot":"","sources":["../../src/adapters/outsideImportFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAMhF,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAapD,eAAO,MAAM,qBAAqB,yFA6ChC,CAAC"}
|
|
@@ -1,38 +1,12 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import ts from "typescript";
|
|
3
2
|
import { readPackageManifest } from "#adapters/manifestInventory.ts";
|
|
4
3
|
import { importGraph } from "#imports/graph.ts";
|
|
5
4
|
import { packageNameOf } from "#imports/packageName.ts";
|
|
6
5
|
import { packageOf } from "#imports/workspace.ts";
|
|
7
|
-
import {
|
|
8
|
-
function onlyInlineTypes(statement) {
|
|
9
|
-
if (ts.isImportDeclaration(statement)) {
|
|
10
|
-
const clause = statement.importClause;
|
|
11
|
-
const bindings = clause?.namedBindings;
|
|
12
|
-
return (clause?.name === undefined
|
|
13
|
-
&& bindings !== undefined
|
|
14
|
-
&& ts.isNamedImports(bindings)
|
|
15
|
-
&& bindings.elements.length > 0
|
|
16
|
-
&& bindings.elements.every((item) => item.isTypeOnly));
|
|
17
|
-
}
|
|
18
|
-
const exports = ts.isExportDeclaration(statement) ? statement.exportClause : undefined;
|
|
19
|
-
return exports !== undefined && ts.isNamedExports(exports) && exports.elements.length > 0 && exports.elements.every((item) => item.isTypeOnly);
|
|
20
|
-
}
|
|
21
|
-
function inlineTypes(inputs) {
|
|
22
|
-
const sites = new Set();
|
|
23
|
-
for (const file of inputs.sources) {
|
|
24
|
-
const source = parse(file);
|
|
25
|
-
if (source === undefined) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
for (const statement of source.statements.filter(onlyInlineTypes)) {
|
|
29
|
-
sites.add(`${file.path}:${source.getLineAndCharacterOfPosition(statement.getStart(source)).line + 1}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return sites;
|
|
33
|
-
}
|
|
6
|
+
import { testName } from "#naming/testName.ts";
|
|
34
7
|
function exempt(path, name) {
|
|
35
8
|
return (/(?:^|\/)(?:adapters|test-support)\//u.test(path)
|
|
9
|
+
|| (name === "vitest" && testName(path)?.modifiers.includes("unit") === true)
|
|
36
10
|
|| name === "effect"
|
|
37
11
|
|| name.startsWith("@effect/")
|
|
38
12
|
|| name.startsWith("@shivaedev/")
|
|
@@ -48,7 +22,6 @@ export const outsideImportFindings = Effect.fn("Imports.outsideImportFindings")(
|
|
|
48
22
|
new Set(Object.keys({ ...manifest?.dependencies, ...manifest?.peerDependencies, ...manifest?.optionalDependencies })),
|
|
49
23
|
];
|
|
50
24
|
}), { concurrency: "unbounded" }));
|
|
51
|
-
const types = inlineTypes(inputs);
|
|
52
25
|
const workspace = new Set(graph.packages.map((owner) => owner.name));
|
|
53
26
|
const sites = [
|
|
54
27
|
...graph.edges.flatMap((edge) => (edge.to.kind === "external" ? [{ ...edge, name: edge.to.package }] : [])),
|
|
@@ -61,7 +34,6 @@ export const outsideImportFindings = Effect.fn("Imports.outsideImportFindings")(
|
|
|
61
34
|
if (workspace.has(site.name)
|
|
62
35
|
|| site.type
|
|
63
36
|
|| site.kind !== "import"
|
|
64
|
-
|| types.has(`${site.from}:${site.line}`)
|
|
65
37
|
|| exempt(site.from, site.name)
|
|
66
38
|
|| !(site.name.startsWith("node:") || runtime.get(directory)?.has(site.name))) {
|
|
67
39
|
return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outsideImportFindings.js","sourceRoot":"","sources":["../../src/adapters/outsideImportFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"outsideImportFindings.js","sourceRoot":"","sources":["../../src/adapters/outsideImportFindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB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MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,IAAI,GAAG,CAAC;QACzE,IACC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;eACrB,IAAI,CAAC,IAAI;eACT,IAAI,CAAC,IAAI,KAAK,QAAQ;eACtB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;eAC5B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAC5E,CAAC;YACF,OAAO,EAAE,CAAC;QACX,CAAC;QACD,OAAO;YACN;gBACC,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,4BAA4B,IAAI,CAAC,SAAS,kHAAkH;aACrK;SACD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { ImportEdge } from "#imports/graph.ts";
|
|
3
|
+
import type { Finding } from "#rule.ts";
|
|
4
|
+
export declare const PURE_REPAIR = "Exercise the Effect behaviour through the package story kit, or test an existing pure API without the runner.";
|
|
5
|
+
export declare function runtime(checker: ts.TypeChecker, source: (path: string) => ts.SourceFile | undefined): (file: string, edgesFrom: ReadonlyMap<string, readonly ImportEdge[]>) => Finding | undefined;
|
|
6
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/adapters/units/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIxC,eAAO,MAAM,WAAW,kHAAkH,CAAC;AAE3I,wBAAgB,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,EAAE,CAAC,UAAU,GAAG,SAAS,UA+BrF,MAAM,aAAa,WAAW,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC,KAAG,OAAO,GAAG,SAAS,CAYjG"}
|