@shivaedev/quality 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +71 -28
- package/dist/baseline/compare.js +1 -1
- package/dist/baseline/compare.js.map +1 -1
- package/dist/baseline/update.js +3 -3
- package/dist/baseline/update.js.map +1 -1
- package/dist/cli/args.d.ts +1 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +5 -18
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/fix.js +1 -1
- package/dist/cli/fix.js.map +1 -1
- package/dist/cli/lint.d.ts +1 -2
- package/dist/cli/lint.d.ts.map +1 -1
- package/dist/cli/lint.js +1 -2
- package/dist/cli/lint.js.map +1 -1
- package/dist/cli/messages.d.ts +2 -2
- package/dist/cli/messages.d.ts.map +1 -1
- package/dist/cli/messages.js +7 -3
- package/dist/cli/messages.js.map +1 -1
- package/dist/cli/migrate.js +1 -1
- package/dist/cli/migrate.js.map +1 -1
- package/dist/cli/migrateExceptions.js +1 -1
- package/dist/cli/migrateExceptions.js.map +1 -1
- package/dist/cli/program.js +1 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/{run-main.d.ts → runMain.d.ts} +1 -1
- package/dist/cli/runMain.d.ts.map +1 -0
- package/dist/cli/{run-main.js → runMain.js} +1 -1
- package/dist/cli/runMain.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/config/decode.d.ts +0 -2
- package/dist/config/decode.d.ts.map +1 -1
- package/dist/config/decode.js +0 -8
- package/dist/config/decode.js.map +1 -1
- package/dist/config/resolve.d.ts +1 -3
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +1 -1
- package/dist/config/resolve.js.map +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/decoded.d.ts +1 -1
- package/dist/decoded.d.ts.map +1 -1
- package/dist/decoded.js +1 -1
- package/dist/decoded.js.map +1 -1
- package/dist/engine/{baseline-file.d.ts → baselineFile.d.ts} +1 -1
- package/dist/engine/baselineFile.d.ts.map +1 -0
- package/dist/engine/{baseline-file.js → baselineFile.js} +1 -1
- package/dist/engine/baselineFile.js.map +1 -0
- package/dist/engine/evaluate.d.ts +0 -1
- package/dist/engine/evaluate.d.ts.map +1 -1
- package/dist/engine/evaluate.js +1 -2
- package/dist/engine/evaluate.js.map +1 -1
- package/dist/engine/{run-rules.d.ts → runRules.d.ts} +1 -1
- package/dist/engine/runRules.d.ts.map +1 -0
- package/dist/engine/{run-rules.js → runRules.js} +2 -2
- package/dist/engine/runRules.js.map +1 -0
- package/dist/engine/session.d.ts +1 -1
- package/dist/engine/session.d.ts.map +1 -1
- package/dist/engine/session.js +2 -2
- package/dist/engine/session.js.map +1 -1
- package/dist/engine/violation.d.ts +1 -1
- package/dist/engine/violation.d.ts.map +1 -1
- package/dist/engine/violation.js +1 -1
- package/dist/engine/violation.js.map +1 -1
- package/dist/hooks/preCommit.js +1 -1
- package/dist/hooks/preCommit.js.map +1 -1
- package/dist/imports/generated.js +1 -1
- package/dist/imports/generated.js.map +1 -1
- package/dist/imports/{pnpm-workspace.d.ts → pnpmWorkspacePatterns.d.ts} +1 -1
- package/dist/imports/pnpmWorkspacePatterns.d.ts.map +1 -0
- package/dist/imports/{pnpm-workspace.js → pnpmWorkspacePatterns.js} +1 -1
- package/dist/imports/pnpmWorkspacePatterns.js.map +1 -0
- package/dist/imports/resolve.js +1 -1
- package/dist/imports/resolve.js.map +1 -1
- package/dist/imports/workspace.js +1 -1
- package/dist/imports/workspace.js.map +1 -1
- package/dist/inventory/collect.js +1 -1
- package/dist/inventory/collect.js.map +1 -1
- package/dist/inventory/{ignore-scope.d.ts → ignoreScope.d.ts} +1 -1
- package/dist/inventory/ignoreScope.d.ts.map +1 -0
- package/dist/inventory/{ignore-scope.js → ignoreScope.js} +1 -1
- package/dist/inventory/ignoreScope.js.map +1 -0
- package/dist/inventory/walk.d.ts +1 -1
- package/dist/inventory/walk.d.ts.map +1 -1
- package/dist/inventory/walk.js +1 -1
- package/dist/inventory/walk.js.map +1 -1
- package/dist/manifests/sorted.js +1 -1
- package/dist/manifests/sorted.js.map +1 -1
- package/dist/report/render.d.ts +0 -2
- package/dist/report/render.d.ts.map +1 -1
- package/dist/report/render.js +6 -16
- package/dist/report/render.js.map +1 -1
- package/dist/report/stale.js +1 -1
- package/dist/report/stale.js.map +1 -1
- package/dist/rule.d.ts +1 -1
- package/dist/rule.d.ts.map +1 -1
- package/dist/rule.js +1 -1
- package/dist/rule.js.map +1 -1
- package/dist/rules/{built-in.d.ts → builtIn.d.ts} +2 -2
- package/dist/rules/builtIn.d.ts.map +1 -0
- package/dist/rules/{built-in.js → builtIn.js} +15 -13
- package/dist/rules/builtIn.js.map +1 -0
- package/dist/rules/comments/{pattern-rule.d.ts → definePattern.d.ts} +1 -1
- package/dist/rules/comments/definePattern.d.ts.map +1 -0
- package/dist/rules/comments/{pattern-rule.js → definePattern.js} +1 -1
- package/dist/rules/comments/definePattern.js.map +1 -0
- package/dist/rules/comments/{max-per-file.d.ts → maxPerFile.d.ts} +1 -1
- package/dist/rules/comments/maxPerFile.d.ts.map +1 -0
- package/dist/rules/comments/{max-per-file.js → maxPerFile.js} +1 -1
- package/dist/rules/comments/maxPerFile.js.map +1 -0
- package/dist/rules/comments/{no-banner.d.ts → noBanner.d.ts} +1 -1
- package/dist/rules/comments/noBanner.d.ts.map +1 -0
- package/dist/rules/comments/{no-banner.js → noBanner.js} +2 -2
- package/dist/rules/comments/noBanner.js.map +1 -0
- package/dist/rules/comments/{no-environment-pragma.d.ts → noEnvironmentPragma.d.ts} +1 -1
- package/dist/rules/comments/noEnvironmentPragma.d.ts.map +1 -0
- package/dist/rules/comments/{no-environment-pragma.js → noEnvironmentPragma.js} +2 -2
- package/dist/rules/comments/noEnvironmentPragma.js.map +1 -0
- package/dist/rules/comments/{no-jsdoc.d.ts → noJsdoc.d.ts} +1 -1
- package/dist/rules/comments/noJsdoc.d.ts.map +1 -0
- package/dist/rules/comments/{no-jsdoc.js → noJsdoc.js} +1 -1
- package/dist/rules/comments/noJsdoc.js.map +1 -0
- package/dist/rules/comments/{no-line-reference.d.ts → noLineReference.d.ts} +1 -1
- package/dist/rules/comments/noLineReference.d.ts.map +1 -0
- package/dist/rules/comments/{no-line-reference.js → noLineReference.js} +2 -2
- package/dist/rules/comments/noLineReference.js.map +1 -0
- package/dist/rules/comments/{no-pr-reference.d.ts → noPrReference.d.ts} +1 -1
- package/dist/rules/comments/noPrReference.d.ts.map +1 -0
- package/dist/rules/comments/{no-pr-reference.js → noPrReference.js} +2 -2
- package/dist/rules/comments/noPrReference.js.map +1 -0
- package/dist/rules/comments/{no-todo.d.ts → noTodo.d.ts} +1 -1
- package/dist/rules/comments/noTodo.d.ts.map +1 -0
- package/dist/rules/comments/{no-todo.js → noTodo.js} +2 -2
- package/dist/rules/comments/noTodo.js.map +1 -0
- package/dist/rules/{manifests-sorted.d.ts → manifestsSorted.d.ts} +1 -1
- package/dist/rules/manifestsSorted.d.ts.map +1 -0
- package/dist/rules/{manifests-sorted.js → manifestsSorted.js} +1 -1
- package/dist/rules/manifestsSorted.js.map +1 -0
- package/dist/rules/manifestsSourceFirst.d.ts +2 -0
- package/dist/rules/manifestsSourceFirst.d.ts.map +1 -0
- package/dist/rules/manifestsSourceFirst.js +43 -0
- package/dist/rules/manifestsSourceFirst.js.map +1 -0
- package/dist/rules/{max-lines.d.ts → maxLines.d.ts} +1 -1
- package/dist/rules/maxLines.d.ts.map +1 -0
- package/dist/rules/{max-lines.js → maxLines.js} +1 -1
- package/dist/rules/maxLines.js.map +1 -0
- package/dist/rules/suppressions/{biome-overrides.d.ts → biomeOverrides.d.ts} +1 -1
- package/dist/rules/suppressions/biomeOverrides.d.ts.map +1 -0
- package/dist/rules/suppressions/{biome-overrides.js → biomeOverrides.js} +1 -1
- package/dist/rules/suppressions/biomeOverrides.js.map +1 -0
- package/dist/rules/suppressions/{no-double-cast.d.ts → noDoubleCast.d.ts} +1 -1
- package/dist/rules/suppressions/noDoubleCast.d.ts.map +1 -0
- package/dist/rules/suppressions/{no-double-cast.js → noDoubleCast.js} +1 -1
- package/dist/rules/suppressions/noDoubleCast.js.map +1 -0
- package/dist/rules/suppressions/noIgnoreDeprecations.js +1 -1
- package/dist/rules/suppressions/noIgnoreDeprecations.js.map +1 -1
- package/dist/rules/suppressions/{no-inline.d.ts → noInline.d.ts} +1 -1
- package/dist/rules/suppressions/noInline.d.ts.map +1 -0
- package/dist/rules/suppressions/{no-inline.js → noInline.js} +2 -2
- package/dist/rules/suppressions/noInline.js.map +1 -0
- package/dist/rules/suppressions/{stylesheet-comments.d.ts → stylesheetComments.d.ts} +1 -1
- package/dist/rules/suppressions/stylesheetComments.d.ts.map +1 -0
- package/dist/rules/suppressions/{stylesheet-comments.js → stylesheetComments.js} +1 -1
- package/dist/rules/suppressions/stylesheetComments.js.map +1 -0
- package/dist/{standard-schema.d.ts → standardSchema.d.ts} +1 -1
- package/dist/standardSchema.d.ts.map +1 -0
- package/dist/{standard-schema.js → standardSchema.js} +1 -1
- package/dist/standardSchema.js.map +1 -0
- package/dist/testProjects.d.ts +1 -1
- package/dist/testProjects.d.ts.map +1 -1
- package/dist/testProjects.js +4 -4
- package/dist/testProjects.js.map +1 -1
- package/docs/debt-and-hooks.md +9 -38
- package/docs/north-star.md +0 -3
- package/package.json +2 -3
- package/src/baseline/compare.ts +1 -1
- package/src/baseline/update.ts +3 -3
- package/src/cli/args.ts +6 -21
- package/src/cli/fix.ts +1 -1
- package/src/cli/lint.ts +1 -3
- package/src/cli/messages.ts +7 -4
- package/src/cli/migrate.ts +1 -1
- package/src/cli/migrateExceptions.ts +1 -1
- package/src/cli/program.ts +1 -1
- package/src/cli.ts +1 -1
- package/src/config/decode.ts +0 -11
- package/src/config/resolve.ts +2 -2
- package/src/config.ts +2 -2
- package/src/decoded.ts +1 -1
- package/src/engine/evaluate.ts +1 -3
- package/src/engine/{run-rules.ts → runRules.ts} +1 -1
- package/src/engine/session.ts +2 -2
- package/src/engine/violation.ts +2 -2
- package/src/hooks/preCommit.ts +1 -1
- package/src/imports/generated.ts +1 -1
- package/src/imports/resolve.ts +1 -1
- package/src/imports/workspace.ts +1 -1
- package/src/inventory/collect.ts +1 -1
- package/src/inventory/walk.ts +1 -1
- package/src/manifests/sorted.ts +1 -1
- package/src/report/render.ts +6 -26
- package/src/report/stale.ts +1 -1
- package/src/rule.ts +1 -1
- package/src/rules/{built-in.ts → builtIn.ts} +14 -12
- package/src/rules/comments/{no-banner.ts → noBanner.ts} +1 -1
- package/src/rules/comments/{no-environment-pragma.ts → noEnvironmentPragma.ts} +1 -1
- package/src/rules/comments/{no-line-reference.ts → noLineReference.ts} +1 -1
- package/src/rules/comments/{no-pr-reference.ts → noPrReference.ts} +1 -1
- package/src/rules/comments/{no-todo.ts → noTodo.ts} +1 -1
- package/src/rules/manifestsSourceFirst.ts +48 -0
- package/src/rules/suppressions/noIgnoreDeprecations.ts +1 -1
- package/src/rules/suppressions/{no-inline.ts → noInline.ts} +1 -1
- package/src/testProjects.ts +4 -4
- package/dist/cli/run-main.d.ts.map +0 -1
- package/dist/cli/run-main.js.map +0 -1
- package/dist/engine/baseline-file.d.ts.map +0 -1
- package/dist/engine/baseline-file.js.map +0 -1
- package/dist/engine/run-rules.d.ts.map +0 -1
- package/dist/engine/run-rules.js.map +0 -1
- package/dist/imports/pnpm-workspace.d.ts.map +0 -1
- package/dist/imports/pnpm-workspace.js.map +0 -1
- package/dist/inventory/ignore-scope.d.ts.map +0 -1
- package/dist/inventory/ignore-scope.js.map +0 -1
- package/dist/rules/built-in.d.ts.map +0 -1
- package/dist/rules/built-in.js.map +0 -1
- package/dist/rules/comments/max-per-file.d.ts.map +0 -1
- package/dist/rules/comments/max-per-file.js.map +0 -1
- package/dist/rules/comments/no-banner.d.ts.map +0 -1
- package/dist/rules/comments/no-banner.js.map +0 -1
- package/dist/rules/comments/no-environment-pragma.d.ts.map +0 -1
- package/dist/rules/comments/no-environment-pragma.js.map +0 -1
- package/dist/rules/comments/no-jsdoc.d.ts.map +0 -1
- package/dist/rules/comments/no-jsdoc.js.map +0 -1
- package/dist/rules/comments/no-line-reference.d.ts.map +0 -1
- package/dist/rules/comments/no-line-reference.js.map +0 -1
- package/dist/rules/comments/no-pr-reference.d.ts.map +0 -1
- package/dist/rules/comments/no-pr-reference.js.map +0 -1
- package/dist/rules/comments/no-todo.d.ts.map +0 -1
- package/dist/rules/comments/no-todo.js.map +0 -1
- package/dist/rules/comments/pattern-rule.d.ts.map +0 -1
- package/dist/rules/comments/pattern-rule.js.map +0 -1
- package/dist/rules/manifests-sorted.d.ts.map +0 -1
- package/dist/rules/manifests-sorted.js.map +0 -1
- package/dist/rules/max-lines.d.ts.map +0 -1
- package/dist/rules/max-lines.js.map +0 -1
- package/dist/rules/suppressions/biome-overrides.d.ts.map +0 -1
- package/dist/rules/suppressions/biome-overrides.js.map +0 -1
- package/dist/rules/suppressions/no-double-cast.d.ts.map +0 -1
- package/dist/rules/suppressions/no-double-cast.js.map +0 -1
- package/dist/rules/suppressions/no-inline.d.ts.map +0 -1
- package/dist/rules/suppressions/no-inline.js.map +0 -1
- package/dist/rules/suppressions/stylesheet-comments.d.ts.map +0 -1
- package/dist/rules/suppressions/stylesheet-comments.js.map +0 -1
- package/dist/standard-schema.d.ts.map +0 -1
- package/dist/standard-schema.js.map +0 -1
- package/docs/modules.md +0 -274
- package/docs/naming.md +0 -130
- package/docs/roadmap.md +0 -37
- package/docs/rules.md +0 -297
- package/docs/tooling.md +0 -105
- /package/src/cli/{run-main.ts → runMain.ts} +0 -0
- /package/src/engine/{baseline-file.ts → baselineFile.ts} +0 -0
- /package/src/imports/{pnpm-workspace.ts → pnpmWorkspacePatterns.ts} +0 -0
- /package/src/inventory/{ignore-scope.ts → ignoreScope.ts} +0 -0
- /package/src/rules/comments/{pattern-rule.ts → definePattern.ts} +0 -0
- /package/src/rules/comments/{max-per-file.ts → maxPerFile.ts} +0 -0
- /package/src/rules/comments/{no-jsdoc.ts → noJsdoc.ts} +0 -0
- /package/src/rules/{manifests-sorted.ts → manifestsSorted.ts} +0 -0
- /package/src/rules/{max-lines.ts → maxLines.ts} +0 -0
- /package/src/rules/suppressions/{biome-overrides.ts → biomeOverrides.ts} +0 -0
- /package/src/rules/suppressions/{no-double-cast.ts → noDoubleCast.ts} +0 -0
- /package/src/rules/suppressions/{stylesheet-comments.ts → stylesheetComments.ts} +0 -0
- /package/src/{standard-schema.ts → standardSchema.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.26.0 - 2026-10-18
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `cli/messages.ts` exports `SUBCOMMANDS: Readonly<Record<string, string>>`, the usage hints for commands with subcommands.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- `testProjects()` sets `silent: "passed-only"` outside CI and `silent: false` in CI, while leaving reporter selection to Vitest.
|
|
12
|
+
- Stale `adopt` and `preCommit` configuration keys and the `quality adopt` command now fail with the general unknown-key and unknown-command errors.
|
|
13
|
+
|
|
14
|
+
## 0.25.0 - 2026-10-18
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `manifests/source-first` reports a `package.json` `exports` or `imports` condition block that lists the `source` condition after another condition, because TypeScript then reads built declarations instead of the sources once they exist.
|
|
19
|
+
|
|
20
|
+
### Breaking
|
|
21
|
+
|
|
22
|
+
- Modules are named in camelCase or after their export: `standard-schema.ts` becomes `standardSchema.ts`, `cli/run-main.ts` becomes `cli/runMain.ts`, `engine/baseline-file.ts` becomes `engine/baselineFile.ts`, `engine/run-rules.ts` becomes `engine/runRules.ts`, `imports/pnpm-workspace.ts` becomes `imports/pnpmWorkspacePatterns.ts`, `inventory/ignore-scope.ts` becomes `inventory/ignoreScope.ts`, `rules/built-in.ts` becomes `rules/builtIn.ts`, `rules/manifests-sorted.ts` becomes `rules/manifestsSorted.ts`, `rules/max-lines.ts` becomes `rules/maxLines.ts`, `rules/comments/pattern-rule.ts` becomes `rules/comments/definePattern.ts`, the comment rules `rules/comments/max-per-file.ts`, `no-banner.ts`, `no-environment-pragma.ts`, `no-jsdoc.ts`, `no-line-reference.ts`, `no-pr-reference.ts` and `no-todo.ts` become `maxPerFile.ts`, `noBanner.ts`, `noEnvironmentPragma.ts`, `noJsdoc.ts`, `noLineReference.ts`, `noPrReference.ts` and `noTodo.ts`, and the suppression rules `rules/suppressions/biome-overrides.ts`, `no-double-cast.ts`, `no-inline.ts` and `stylesheet-comments.ts` become `biomeOverrides.ts`, `noDoubleCast.ts`, `noInline.ts` and `stylesheetComments.ts`. Rule ids are unchanged.
|
|
23
|
+
- Remove `quality lint --warnings`; `Level` and `ActiveLevel` are `"error"` only. Remove `Outcome.warnings`, `ReportContext.warnings` and the `WarningDetail` export. The `lint` function takes only `cwd` and `config`.
|
|
24
|
+
|
|
3
25
|
## 0.24.0 - 2026-10-18
|
|
4
26
|
|
|
5
27
|
### Added
|
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ export default defineConfig({ sources: ["src"] });
|
|
|
76
76
|
|
|
77
77
|
When a config exists, its folder is the root for paths and hook scripts. Without one, the current directory is the root. `sources` chooses the files the source rules read; a missing source stops the run. Directory discovery skips untracked files ignored by git and the `.git` and `node_modules` directories. Tracked files remain checked even when an ignore pattern matches them; a folder named `generated/` does not exempt authored code. Some repository rules, such as manifest sorting, inspect the whole repository even when `sources` names only `src`.
|
|
78
78
|
|
|
79
|
-
`defineConfig` checks the config's types. The CLI also validates it: a broken config, unknown rule id or invalid options fails before checks run. An explicit `--config` path must exist.
|
|
79
|
+
`defineConfig` checks the config's types. The CLI also validates it: a broken config, unknown rule id or invalid options fails before checks run. An explicit `--config` path must exist.
|
|
80
80
|
|
|
81
81
|
### 2. When architecture needs it: describe an import boundary
|
|
82
82
|
|
|
@@ -108,13 +108,23 @@ const uiBoundary = fence("ui-never-imports-server")
|
|
|
108
108
|
export default [uiBoundary];
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
This is `packages/ui/quality.fences.config.ts`; paths remain relative to the repository root. Existing fences supplied through `rules["imports/fences"].options.fences` join the same policy. This adds a fact about the repository's architecture to the shared import check. It does not select a different set of Quality rules. Use real checked files and workspace package names in these chains. The illegal chain must cross this fence alone; the legal chain must cross none. `mayNotImport` checks direct imports; `mayNotReach` also follows repository imports transitively; `mayImportOnly(...subjects).of(unit)` permits only named modules or folders of a unit. Fences count type imports but never hold test files or files under `test-support/`. The default `imports/no-test-code` rule rejects production imports of either, including type imports and re-exports. Move shared code into a production module that tests can import.
|
|
111
|
+
This is `packages/ui/quality.fences.config.ts`; paths remain relative to the repository root. Existing fences supplied through `rules["imports/fences"].options.fences` join the same policy. This adds a fact about the repository's architecture to the shared import check. It does not select a different set of Quality rules. Use real checked files and workspace package names in these chains. The illegal chain must cross this fence alone; the legal chain must cross none. `mayNotImport` checks direct imports; `mayNotReach` also follows repository imports transitively; `mayImportOnly(...subjects).of(unit)` permits only named modules or folders of a unit. Fences count type imports but never hold test files or files under `test-support/`. The default `imports/no-test-code` rule rejects production imports of either, including type imports and re-exports. Move shared code into a production module that tests can import.
|
|
112
|
+
|
|
113
|
+
The import rules resolve every literal specifier the way the TypeScript compiler does, with the nearest `tsconfig.json`, and stop the run when the sources hold no module at all. A relative or `#` import of a file that a generator writes before the tests run resolves only inside a folder that `imports/resolvable` lists as `generated`; the folder, or every file an import names in it, must be ignored by git:
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import { defineConfig } from "@shivaedev/quality/config.ts";
|
|
117
|
+
|
|
118
|
+
export default defineConfig({
|
|
119
|
+
rules: { "imports/resolvable": { options: { generated: ["packages/db/src/test-support/generated"] } } },
|
|
120
|
+
});
|
|
121
|
+
```
|
|
112
122
|
|
|
113
123
|
### Story tests
|
|
114
124
|
|
|
115
125
|
Write setup in the domain kit under `test-support/` and keep each test specific to its story. [`@shivaedev/test-story`](https://github.com/ShivaeDev/platform/tree/main/packages/test-story#readme) explains how to build the kit, traits and verbs over a real engine.
|
|
116
126
|
|
|
117
|
-
Quality's `tests/story-specs` rule reports a test file that declares tests without a kit's `it`, including plain Vitest `it` and `test` declarations mixed with stories.
|
|
127
|
+
Quality's `tests/story-specs` rule reports a test file that declares tests without a kit's `it`, including plain Vitest `it` and `test` declarations mixed with stories. Typecheck tests are exempt, as are test-story itself and its transitive workspace dependencies, including development, optional and peer dependencies: requiring those packages to depend on test-story would create a cycle. Pure-function tests are included: the baseline records existing files, and that debt should only go down.
|
|
118
128
|
|
|
119
129
|
Every package tests its real engine through its own story kit, so setup and actions share the package's domain vocabulary. To repair a finding, build the kit with `storyKit` from `@shivaedev/test-story/storyKit.ts` in `src/test-support`, import it in the spec and replace plain registrations with `kit.it(name, traits, body)`. The rule follows imports, aliases and conditional registrars back to the kit; it checks declarations, while review and runtime tests establish whether the kit exercises the real engine.
|
|
120
130
|
|
|
@@ -136,7 +146,7 @@ When you fix debt, lower the entries of changed files:
|
|
|
136
146
|
quality baseline tighten
|
|
137
147
|
```
|
|
138
148
|
|
|
139
|
-
`tighten` lowers entries for files changed since `HEAD`; `--staged` restricts those updates to staged files. `prune` considers every baseline entry. Both only lower or remove counts and can carry entries when git detects tracked moves.
|
|
149
|
+
`tighten` lowers entries for files changed since `HEAD`; `--staged` restricts those updates to staged files. `prune` considers every baseline entry. Both only lower or remove counts and can carry entries when git detects tracked moves.
|
|
140
150
|
|
|
141
151
|
When a Quality upgrade adds a check, or a reviewed change needs to record one rule's findings again:
|
|
142
152
|
|
|
@@ -144,17 +154,30 @@ When a Quality upgrade adds a check, or a reviewed change needs to record one ru
|
|
|
144
154
|
quality baseline write --rule tests/story-setup
|
|
145
155
|
```
|
|
146
156
|
|
|
147
|
-
Keep the default error level. The command replaces that rule's entries and leaves other rules' entries alone. Any new or raised count belongs in the review and the pull request's Callouts. The [debt and hook guide](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/debt-and-hooks.md) covers exception subjects, limit changes, renames and commit checks.
|
|
157
|
+
Keep the default error level. The command replaces that rule's entries and leaves other rules' entries alone. Any new or raised count belongs in the review and the pull request's Callouts. The [debt and hook guide](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/debt-and-hooks.md) covers the baseline format, exception subjects, limit changes, renames and commit checks.
|
|
158
|
+
|
|
159
|
+
### What the rules check
|
|
160
|
+
|
|
161
|
+
`quality lint` prints each failing rule's guidance with its findings, so the finding is the reference for what to change. The built-in rules fall into these groups:
|
|
162
|
+
|
|
163
|
+
- **Structure:** `structure/max-lines` allows 150 lines in a source file and 300 in test code, `nesting/max-depth` rejects lines indented eight tabs deep, and `structure/no-barrel` rejects `index` modules. The preset rejects every re-export, types included; when `noExportedImports` suggests `export … from`, import the name where it is used instead. A module does one job.
|
|
164
|
+
- **Comments:** the `comments/*` rules reject JSDoc, TODOs, banners, line and pull request references, environment pragmas and more than two comments per file. A comment says why, never what the code already says or what it used to be. A tool pragma such as `@jsxImportSource` counts as a comment until both `comments/no-jsdoc` and `comments/max-per-file` list its tag in their `allow` option.
|
|
165
|
+
- **Suppressions:** the `suppressions/*` rules reject inline lint and compiler directives, casts through `unknown`, `any` or `never`, Biome settings that weaken a check, recommended Biome rules the preset leaves below `error`, and `ignoreDeprecations`. None of them takes exceptions. A type test (`*.typecheck.test.ts`) may use `@ts-expect-error`; a test that must pass a rejected value at run time calls the API through `Reflect.apply`.
|
|
166
|
+
- **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest, relative imports that leave their folder, production imports of test code, runtime folders and fences, as described above.
|
|
167
|
+
- **Names and files:** the Biome preset's naming rules and plugins, and the `files/*` rules, which name a file after its main export with its folders as the prefix. No naming rule renames anything; the author picks the name. A name an outside system owns, such as a query parameter or an environment variable, is written as a quoted key, which the naming rules skip. A `Schema.Struct` field stays camelCase even when quoted and maps to the outside name with `Schema.encodeKeys`. Biome's naming messages print only a pattern: spell acronyms as words (`HttpClient`, `userId`, `parseUrl`) rather than turning off `strictCase` as its hint suggests, give a type no `I` prefix, and name a type parameter `T`, `T` plus a PascalCase name (`TItem`), or Effect's `A`, `E` and `R`. No rule checks these, so review does: a boolean reads as a question (`isOpen`, `canRetry`) unless the DOM or React names it (`open`, `disabled`); a schema shares its name with its type (`type Item = typeof Item.Type`); an unused parameter is removed rather than renamed with the `_` prefix TypeScript accepts. The naming rules take repository facts: `toolOwned` lists `.gitignore` patterns whose names a tool fixes, and a configured list replaces the rule's defaults, so repeat any default you still need; `content` lists snake_case content folders and files; `tests/follow` and `tests/colocated` take `suites` for test folders with their own layout, such as a Playwright suite.
|
|
168
|
+
- **Tests:** `tests/follow` and `tests/colocated` keep a test beside the code it covers, named `<file>[.<environment>].test.ts` or `<behaviour>[.<environment>].spec.ts`, and the story rules above keep setup in the kit.
|
|
169
|
+
- **Manifests:** `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `source` condition first in `exports` and `imports`.
|
|
170
|
+
- **Biome:** the `biome` rule reports Biome's error findings as `biome/<category>`. The preset's plugins ban ambient time, randomness, `console` and `process.env` in favour of Effect's services.
|
|
148
171
|
|
|
149
172
|
### API
|
|
150
173
|
|
|
151
|
-
Import names from their defining module; there is no root entry. The package's `./*.ts` export pattern also exposes the gate's implementation modules
|
|
174
|
+
Import names from their defining module; there is no root entry. The package's `./*.ts` export pattern also exposes the gate's implementation modules; the following table lists the config, tool and extension entry points:
|
|
152
175
|
|
|
153
176
|
| Module | Exports |
|
|
154
177
|
| --- | --- |
|
|
155
|
-
| `config.ts` | `defineConfig`, `QualityConfig`, `Level
|
|
178
|
+
| `config.ts` | `defineConfig`, `QualityConfig`, `Level` (`"error"`), `RuleSetting`, `RuleSettings`, `BuiltInRules` |
|
|
156
179
|
| `rule.ts` | `defineRule`, `Rule`, `Configured`, `Finding`, `Findings`, `SourceFile`, `RuleInputs`, `RuleContext` |
|
|
157
|
-
| `
|
|
180
|
+
| `standardSchema.ts` | `StandardSchemaV1`, `StandardResult`, `StandardIssue`, `describeIssue` |
|
|
158
181
|
| `imports/fences/dsl.ts` | `fence` |
|
|
159
182
|
| `imports/fences/selectors.ts` | `packages`, `folders`, `files`, `modules`, `scopes`, `anyOf`, `workspace`, `anything`, `external` |
|
|
160
183
|
| `imports/fences/model.ts` | `Fence`, `Target`, `Selector`, `Prohibition`, `Examples`, `Chain`, `ExampleStep`, `External` |
|
|
@@ -175,18 +198,22 @@ Import names from their defining module; there is no root entry. The package's `
|
|
|
175
198
|
|
|
176
199
|
#### Local rules
|
|
177
200
|
|
|
178
|
-
The exposed local-rule API supplements the gate; a repository does not need to use it to get the shared policy.
|
|
201
|
+
The exposed local-rule API supplements the gate; a repository does not need to use it to get the shared policy. Reusable quality policy belongs in Quality itself.
|
|
179
202
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
203
|
+
```ts
|
|
204
|
+
import { defineRule } from "@shivaedev/quality/rule.ts";
|
|
205
|
+
|
|
206
|
+
export const noLog = defineRule({
|
|
207
|
+
check: ({ sources }) =>
|
|
208
|
+
sources
|
|
209
|
+
.filter((file) => file.text.includes("console.log"))
|
|
210
|
+
.map((file) => ({ file: file.path, message: "logs to the console." })),
|
|
211
|
+
description: "Log through the logger.",
|
|
212
|
+
id: "local/no-console-log",
|
|
213
|
+
});
|
|
214
|
+
```
|
|
188
215
|
|
|
189
|
-
A limit rule reports its amount over the limit as `count` and the limit as `threshold
|
|
216
|
+
Register it with `defineConfig({ local: [noLog] })`. Its check receives `root`, checked paths in `files`, source files in `sources`, `readText(path)` and decoded `options`, and may return findings directly or asynchronously. For options, provide a [Standard Schema](https://standardschema.dev) validator; an absent options object is validated as `{}`, so defaults belong in the schema, and a rule without a schema refuses options. A finding's optional `subject` distinguishes exceptions within a rule and file. A limit rule reports its amount over the limit as `count` and the limit as `threshold`; the baseline stores the count. Set `registrable: false` when a rule must never be excused by a config exception.
|
|
190
217
|
|
|
191
218
|
#### Command line
|
|
192
219
|
|
|
@@ -217,9 +244,19 @@ quality hooks pre-commit [--config <file>]
|
|
|
217
244
|
pnpm add --save-dev @shivaedev/quality @effect/platform-node@4.0.4 @effect/platform-node-shared@4.0.4 effect@4.0.4
|
|
218
245
|
```
|
|
219
246
|
|
|
220
|
-
Node 24 or later is required. The CLI loads the TypeScript config through Node's native import; use erasable syntax and `.ts` extensions for relative TypeScript imports.
|
|
247
|
+
Node 24 or later is required. The CLI loads the TypeScript config through Node's native import; use erasable syntax and `.ts` extensions for relative TypeScript imports.
|
|
221
248
|
|
|
222
|
-
The package includes `@shivaedev/quality/biome`, `@shivaedev/quality/tsconfig/base.json` for type-checking
|
|
249
|
+
The package includes `@shivaedev/quality/biome`, `@shivaedev/quality/tsconfig/base.json` for type-checking with `noEmit`, and `@shivaedev/quality/tsconfig/package.json` for package builds, which adds declarations, maps and `rewriteRelativeImportExtensions` so relative `.ts` imports are emitted as `.js`. Read the preset files for their settings. The preset's plugins load from `./node_modules/@shivaedev/quality/biome/plugins`, so install the package at the repository root. Biome sorts a specifier that starts with `#`, `@/`, `~`, `$` or `%` as an alias; a tsconfig path such as `@app/*` sorts with the packages and Biome's `noUndeclaredDependencies` takes it for one, so name aliases in a form Biome recognizes.
|
|
250
|
+
|
|
251
|
+
The TypeScript base leaves `types`, `jsx`, `paths`, `include` and output directories to each project. A project that needs more built-ins, such as the DOM, sets `lib` itself and keeps `ESNext` in it. A package that type-checks its tests with one config and builds `src` with another extends both, the package preset last:
|
|
252
|
+
|
|
253
|
+
```json
|
|
254
|
+
{
|
|
255
|
+
"extends": ["./tsconfig.json", "@shivaedev/quality/tsconfig/package.json"],
|
|
256
|
+
"compilerOptions": { "outDir": "dist", "rootDir": "src" },
|
|
257
|
+
"include": ["src"]
|
|
258
|
+
}
|
|
259
|
+
```
|
|
223
260
|
|
|
224
261
|
For Vitest, install `vitest` and `happy-dom` when the repository has DOM tests, then use:
|
|
225
262
|
|
|
@@ -230,7 +267,18 @@ import { defineConfig } from "vitest/config";
|
|
|
230
267
|
export default defineConfig({ test: testProjects() });
|
|
231
268
|
```
|
|
232
269
|
|
|
233
|
-
`testProjects` runs unit tests and specs in Node and `.dom` tests and specs in happy-dom by default. Each test gets 30 seconds instead of Vitest's 5, because tests that start servers, browsers or CLIs take seconds on a busy CI runner. `.slow` tests run only when `--project slow` asks for them. Type tests are excluded from Vitest and belong in the compiler's input. The helper takes no options
|
|
270
|
+
`testProjects` runs unit tests and specs in Node and `.dom` tests and specs in happy-dom by default. Each test gets 30 seconds instead of Vitest's 5, because tests that start servers, browsers or CLIs take seconds on a busy CI runner. `.slow` tests run only when `--project slow` asks for them. Type tests are excluded from Vitest and belong in the compiler's input. The helper takes no options.
|
|
271
|
+
|
|
272
|
+
Outside CI, `testProjects` sets `silent: "passed-only"` so local runs show logs only from failing tests. When `CI` is set to a nonempty value, it sets `silent: false` so CI keeps all test logs. It leaves `reporters` unset so Vitest can auto-detect its agent reporter. If a repository adds a reporter, spread `configDefaults.reporters` instead of replacing the defaults:
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
import { testProjects } from "@shivaedev/quality/testProjects.ts";
|
|
276
|
+
import { configDefaults, defineConfig } from "vitest/config";
|
|
277
|
+
|
|
278
|
+
export default defineConfig({
|
|
279
|
+
test: { ...testProjects(), reporters: [...configDefaults.reporters, "junit"] },
|
|
280
|
+
});
|
|
281
|
+
```
|
|
234
282
|
|
|
235
283
|
#### PostgreSQL URL gate
|
|
236
284
|
|
|
@@ -267,11 +315,6 @@ export default defineConfig({
|
|
|
267
315
|
|
|
268
316
|
Quality merges the Biome settings at lint and fix time; do not add or mirror an override in `biome.json`. Files are explicit repository paths. Biome exceptions cover individual lint rules or assist actions; whole checks, rule groups and globs are rejected. `biome/files/includes` is the directory exclusion form: keep `**` and list negative patterns naming directories, such as `!**/test-support/generated`. Quality's shipped exceptions remain part of its internal policy. [Exceptions and upgrades](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/debt-and-hooks.md#exceptions) describes subjects, stale entries and the upgrade command.
|
|
269
317
|
|
|
270
|
-
Local-rule APIs supplement the shared policy. They are not setup requirements. Use the shared defaults; repository-specific inputs such as source locations and fences supply information the policy needs.
|
|
271
|
-
|
|
272
|
-
- The gate checks static source policy. A successful import graph, fence example or test naming check does not prove an application's HTTP, database or browser behavior.
|
|
273
318
|
- The source inventory and Biome have their own scopes. `quality fix` runs Biome from the config's folder; it is not restricted to the source-rule inventory.
|
|
274
|
-
- The installed hook checks files on disk and uses each committing worktree's config and dependencies.
|
|
275
|
-
-
|
|
276
|
-
- Workspace imports require a declaration in the importing package’s `dependencies`, `peerDependencies` or `optionalDependencies`. Tests, `test-support`, package-root tooling folders (`script`, `scripts`, `tooling`) and package-root config files may also use `devDependencies`. Explicitly export-blocked bundle inputs may use them when no runtime module reaches those inputs in the scanned import graph; an executable or another public export keeps its imports in the runtime boundary. See the [manifest rule](https://github.com/ShivaeDev/platform/blob/main/packages/quality/docs/rules.md#manifest-dependencies).
|
|
277
|
-
- Import fences skip test code. Keep the tests honest through their real fixtures and review; declare exceptions only where the rule allows it.
|
|
319
|
+
- The installed hook checks files on disk, not only what is staged, and uses each committing worktree's config and dependencies. A pre-existing `core.hooksPath` decides which hook git runs.
|
|
320
|
+
- Workspace imports require a declaration in the importing package’s `dependencies`, `peerDependencies` or `optionalDependencies`. Tests, `test-support`, package-root tooling folders (`script`, `scripts`, `tooling`) and package-root config files may also use `devDependencies`. Explicitly export-blocked bundle inputs may use them when no runtime module reaches those inputs in the scanned import graph; an executable or another public export keeps its imports in the runtime boundary.
|
package/dist/baseline/compare.js
CHANGED
|
@@ -12,7 +12,7 @@ export function applyBaseline(violations, entries, rules) {
|
|
|
12
12
|
const group = groups.get(keyOf(entry.rule, entry.file)) ?? [];
|
|
13
13
|
if (group.length === 0) {
|
|
14
14
|
const level = levelOf(rules, entry.rule);
|
|
15
|
-
(level === undefined
|
|
15
|
+
(level === undefined ? stale : loose).push({
|
|
16
16
|
entry,
|
|
17
17
|
problem: unusedEntryProblem(rules, entry.rule, "has no violations left"),
|
|
18
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../../src/baseline/compare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAkB,kBAAkB,EAAkB,MAAM,sBAAsB,CAAC;AAqBnH,MAAM,UAAU,OAAO,CAAC,UAAgC;IACvD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAgC,EAAE,OAAiC,EAAE,KAAgB;IAClH,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,MAAM,WAAW,GAAiB,EAAE,CAAC;IACrC,MAAM,KAAK,GAAyB,EAAE,CAAC;IACvC,MAAM,KAAK,GAAyB,EAAE,CAAC;IACvC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,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AAO,EAAE,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC;aACxE,CAAC,CAAC;YACH,SAAS;QACV,CAAC;QACD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7B,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;YACzB,WAAW,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YACnC,SAAS;QACV,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3C,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,6BAA6B,KAAK,YAAY,KAAK,CAAC,KAAK,YAAY,EAAE,CAAC,CAAC;QACvG,CAAC;IACF,CAAC;IACD,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnG,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AACxF,CAAC"}
|
package/dist/baseline/update.js
CHANGED
|
@@ -15,7 +15,7 @@ function refusal(id, index) {
|
|
|
15
15
|
if (level === undefined) {
|
|
16
16
|
return [`${id}: no built-in or local rule has this id.`];
|
|
17
17
|
}
|
|
18
|
-
return
|
|
18
|
+
return [];
|
|
19
19
|
}
|
|
20
20
|
export function adopt(existing, rules, violations, index) {
|
|
21
21
|
if (existing !== undefined && rules.length === 0) {
|
|
@@ -29,7 +29,7 @@ export function adopt(existing, rules, violations, index) {
|
|
|
29
29
|
return rules.some((name) => covers(name, rule));
|
|
30
30
|
}
|
|
31
31
|
const kept = (existing ?? []).filter((entry) => !named(entry.rule));
|
|
32
|
-
const adopted = violations.filter((violation) =>
|
|
32
|
+
const adopted = violations.filter((violation) => rules.length === 0 || named(violation.rule));
|
|
33
33
|
const added = record(adopted);
|
|
34
34
|
return { _tag: "Adopted", added: added.length, entries: [...kept, ...added], replaced: (existing ?? []).length - kept.length };
|
|
35
35
|
}
|
|
@@ -51,7 +51,7 @@ export function prune(existing, violations, index, scope = { moves: new Map() })
|
|
|
51
51
|
}
|
|
52
52
|
const level = levelOf(index, before.rule);
|
|
53
53
|
const now = current.get(keyOf(before.rule, before.file)) ?? destination(before, current, scope.moves, taken);
|
|
54
|
-
if (now === undefined || level === undefined
|
|
54
|
+
if (now === undefined || level === undefined) {
|
|
55
55
|
return [];
|
|
56
56
|
}
|
|
57
57
|
moved += Number(now.file !== before.file);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/baseline/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAkC,MAAM,sBAAsB,CAAC;AACvG,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAcvC,SAAS,MAAM,CAAC,UAAgC;IAC/C,OAAO,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAChH,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,EAAE,CAAC;QACX,CAAC;QACD,MAAM,KAAK,GA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AC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7G,CAAC,CAAC,CAAC;IACH,OAAO;QACN,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC;QACvC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM;QAChF,KAAK;QACL,OAAO,EAAE,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM;KACtC,CAAC;AACH,CAAC"}
|
package/dist/cli/args.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { WarningDetail } from "#report/render.ts";
|
|
2
1
|
export type Command = {
|
|
3
2
|
readonly _tag: "Lint";
|
|
4
3
|
readonly config: string | undefined;
|
|
5
|
-
readonly warnings: WarningDetail;
|
|
6
4
|
} | {
|
|
7
5
|
readonly _tag: "ExceptionsMigrate";
|
|
8
6
|
readonly config: string | undefined;
|
|
@@ -45,6 +43,6 @@ export type Parsed = {
|
|
|
45
43
|
readonly _tag: "Usage";
|
|
46
44
|
readonly problem: string;
|
|
47
45
|
};
|
|
48
|
-
export declare const USAGE = "Usage:\n quality lint [--config <file>]
|
|
46
|
+
export declare const USAGE = "Usage:\n quality lint [--config <file>]\n quality fix [--config <file>]\n quality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline write [--config <file>] [--rule <id>]...\n quality baseline prune [--config <file>] [--against <ref>]\n quality baseline tighten [--config <file>] [--staged]\n quality baseline migrate [--config <file>] [--from <file>]\n quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks pre-commit [--config <file>]\n\nlint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry\n or a baseline entry for an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline write Record current error-level violations. Creates the baseline, or records the named rules again, replacing their entries.\nbaseline prune Drop fixed debt, lower entries to what is left and carry entries to files git saw move. Never adds or raises an entry.\nbaseline tighten Prune only the entries of files changed since HEAD, or with --staged, in the index.\nbaseline migrate Move a baseline from the earlier JSON format (--from, quality/baseline.json by default) to the configured file.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\n--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
|
|
49
47
|
export declare function parseCommand(args: readonly string[]): Parsed;
|
|
50
48
|
//# sourceMappingURL=args.d.ts.map
|
package/dist/cli/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC9D;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,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AI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnI,eAAO,MAAM,KAAK,8sEAAgB,CAAC;AA2EnC,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAoB5D"}
|
package/dist/cli/args.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
2
|
import { Result } from "effect";
|
|
3
|
-
import {
|
|
3
|
+
import { USAGE as COMMAND_USAGE, SUBCOMMANDS } from "./messages.js";
|
|
4
4
|
export const USAGE = COMMAND_USAGE;
|
|
5
5
|
const OPTIONS = {
|
|
6
6
|
against: { type: "string" },
|
|
@@ -10,20 +10,14 @@ const OPTIONS = {
|
|
|
10
10
|
help: { short: "h", type: "boolean" },
|
|
11
11
|
rule: { multiple: true, type: "string" },
|
|
12
12
|
staged: { type: "boolean" },
|
|
13
|
-
warnings: { type: "string" },
|
|
14
13
|
};
|
|
15
14
|
function usage(problem) {
|
|
16
15
|
return { _tag: "Usage", problem };
|
|
17
16
|
}
|
|
18
|
-
const SUBCOMMANDS = {
|
|
19
|
-
baseline: "baseline takes write, prune, tighten or migrate.",
|
|
20
|
-
exceptions: "exceptions takes migrate.",
|
|
21
|
-
hooks: "hooks takes install, uninstall or pre-commit.",
|
|
22
|
-
};
|
|
23
17
|
function parsed(command) {
|
|
24
18
|
return { _tag: "Parsed", command };
|
|
25
19
|
}
|
|
26
|
-
const COMMAND_OPTIONS = ["against", "force", "from", "rule", "staged"
|
|
20
|
+
const COMMAND_OPTIONS = ["against", "force", "from", "rule", "staged"];
|
|
27
21
|
const ACCEPTS = {
|
|
28
22
|
"baseline migrate": ["from"],
|
|
29
23
|
"baseline prune": ["against"],
|
|
@@ -34,7 +28,7 @@ const ACCEPTS = {
|
|
|
34
28
|
"hooks install": ["force"],
|
|
35
29
|
"hooks pre-commit": [],
|
|
36
30
|
"hooks uninstall": [],
|
|
37
|
-
lint: [
|
|
31
|
+
lint: [],
|
|
38
32
|
};
|
|
39
33
|
function misplaced(name, values) {
|
|
40
34
|
const option = COMMAND_OPTIONS.find((key) => values[key] !== undefined && !(ACCEPTS[name] ?? []).includes(key));
|
|
@@ -47,12 +41,8 @@ function ref(against, command) {
|
|
|
47
41
|
function commandFor(name, values) {
|
|
48
42
|
const config = values.config;
|
|
49
43
|
switch (name) {
|
|
50
|
-
case "lint":
|
|
51
|
-
|
|
52
|
-
return warnings === "summary" || warnings === "all"
|
|
53
|
-
? parsed({ _tag: "Lint", config, warnings })
|
|
54
|
-
: usage(`--warnings takes summary or all, not "${warnings}".`);
|
|
55
|
-
}
|
|
44
|
+
case "lint":
|
|
45
|
+
return parsed({ _tag: "Lint", config });
|
|
56
46
|
case "exceptions migrate":
|
|
57
47
|
return parsed({ _tag: "ExceptionsMigrate", config, from: values.from });
|
|
58
48
|
case "fix":
|
|
@@ -87,9 +77,6 @@ export function parseCommand(args) {
|
|
|
87
77
|
return parsed({ _tag: "Help" });
|
|
88
78
|
}
|
|
89
79
|
const name = [command, ...rest].join(" ");
|
|
90
|
-
if (command === "adopt") {
|
|
91
|
-
return usage(ADOPT_REMOVED);
|
|
92
|
-
}
|
|
93
80
|
if (ACCEPTS[name] === undefined) {
|
|
94
81
|
const subcommands = SUBCOMMANDS[command];
|
|
95
82
|
return usage(subcommands !== undefined && rest.length < 2 ? subcommands : `unknown command: ${name}`);
|
package/dist/cli/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version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MAAM,CAAC,CAAC;IACxC,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAC1E,CAAC"}
|
package/dist/cli/fix.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Console, Effect, FileSystem } from "effect";
|
|
|
3
3
|
import { biomeReport } from "#biome/report.ts";
|
|
4
4
|
import { loadConfig } from "#config/load.ts";
|
|
5
5
|
import { SetupFailure } from "#failure.ts";
|
|
6
|
-
import { posix } from "#inventory/
|
|
6
|
+
import { posix } from "#inventory/ignoreScope.ts";
|
|
7
7
|
import { walk } from "#inventory/walk.ts";
|
|
8
8
|
import { sortManifests } from "#manifests/sorted.ts";
|
|
9
9
|
import { plural } from "#report/plural.ts";
|
package/dist/cli/fix.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix.js","sourceRoot":"","sources":["../../src/cli/fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fix.js","sourceRoot":"","sources":["../../src/cli/fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,E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,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EAChD,GAAW,EACX,MAA0B;IAE1B,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACxH,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,sCAAsC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IACxF,KAAK,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtF,CAAC,CAAC,CAAC"}
|
package/dist/cli/lint.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Effect, type FileSystem } from "effect";
|
|
2
2
|
import { GateFailed, type SetupFailure } from "#failure.ts";
|
|
3
|
-
|
|
4
|
-
export declare const lint: (cwd: string, config: string | undefined, warnings: WarningDetail) => Effect.Effect<void, GateFailed | SetupFailure, FileSystem.FileSystem>;
|
|
3
|
+
export declare const lint: (cwd: string, config: string | undefined) => Effect.Effect<void, GateFailed | SetupFailure, FileSystem.FileSystem>;
|
|
5
4
|
//# sourceMappingURL=lint.d.ts.map
|
package/dist/cli/lint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/cli/lint.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/cli/lint.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAG1D,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAG5D,eAAO,MAAM,IAAI,oHAiBf,CAAC"}
|
package/dist/cli/lint.js
CHANGED
|
@@ -4,7 +4,7 @@ import { evaluate, passes } from "#engine/evaluate.ts";
|
|
|
4
4
|
import { openSession } from "#engine/session.ts";
|
|
5
5
|
import { GateFailed } from "#failure.ts";
|
|
6
6
|
import { render } from "#report/render.ts";
|
|
7
|
-
export const lint = Effect.fn("Cli.lint")(function* (cwd, config
|
|
7
|
+
export const lint = Effect.fn("Cli.lint")(function* (cwd, config) {
|
|
8
8
|
const session = yield* openSession(cwd, config);
|
|
9
9
|
const outcome = evaluate(session.violations, session.registry, session.baseline.entries, session.config);
|
|
10
10
|
yield* Console.log(render(outcome, {
|
|
@@ -12,7 +12,6 @@ export const lint = Effect.fn("Cli.lint")(function* (cwd, config, warnings) {
|
|
|
12
12
|
checked: session.inventory.sources.length,
|
|
13
13
|
descriptions: new Map(session.config.active.map((rule) => [rule.id, rule.description])),
|
|
14
14
|
registry: session.config.exceptions.length === 0 ? session.config.registry : `${relative(session.config.root, session.config.file)} exceptions`,
|
|
15
|
-
warnings,
|
|
16
15
|
}));
|
|
17
16
|
if (!passes(outcome)) {
|
|
18
17
|
return yield* new GateFailed();
|
package/dist/cli/lint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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QAAQ;QACjC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM;QACzC,YAAY,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QACvF,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa;KAC/I,CAAC,CACF,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC;IAChC,CAAC;AACF,CAAC,CAAC,CAAC"}
|
package/dist/cli/messages.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const USAGE = "Usage:\n quality lint [--config <file>]
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const USAGE = "Usage:\n quality lint [--config <file>]\n quality fix [--config <file>]\n quality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline write [--config <file>] [--rule <id>]...\n quality baseline prune [--config <file>] [--against <ref>]\n quality baseline tighten [--config <file>] [--staged]\n quality baseline migrate [--config <file>] [--from <file>]\n quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks pre-commit [--config <file>]\n\nlint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry\n or a baseline entry for an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline write Record current error-level violations. Creates the baseline, or records the named rules again, replacing their entries.\nbaseline prune Drop fixed debt, lower entries to what is left and carry entries to files git saw move. Never adds or raises an entry.\nbaseline tighten Prune only the entries of files changed since HEAD, or with --staged, in the index.\nbaseline migrate Move a baseline from the earlier JSON format (--from, quality/baseline.json by default) to the configured file.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\n--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
|
|
2
|
+
export declare const SUBCOMMANDS: Readonly<Record<string, string>>;
|
|
3
3
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,8sEA2BwC,CAAC;AAE3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIxD,CAAC"}
|
package/dist/cli/messages.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const USAGE = `Usage:
|
|
2
|
-
quality lint [--config <file>]
|
|
2
|
+
quality lint [--config <file>]
|
|
3
3
|
quality fix [--config <file>]
|
|
4
4
|
quality exceptions migrate [--config <file>] [--from <registry>]
|
|
5
5
|
quality baseline write [--config <file>] [--rule <id>]...
|
|
@@ -11,7 +11,7 @@ export const USAGE = `Usage:
|
|
|
11
11
|
quality hooks pre-commit [--config <file>]
|
|
12
12
|
|
|
13
13
|
lint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry
|
|
14
|
-
or a baseline entry for
|
|
14
|
+
or a baseline entry for an unknown rule.
|
|
15
15
|
fix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.
|
|
16
16
|
exceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.
|
|
17
17
|
baseline write Record current error-level violations. Creates the baseline, or records the named rules again, replacing their entries.
|
|
@@ -26,5 +26,9 @@ hooks pre-commit What the hook runs: lint, then package.json scripts typecheck
|
|
|
26
26
|
--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.
|
|
27
27
|
--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.
|
|
28
28
|
Exit codes: 0 passed, 1 failed the gate, 2 could not run.`;
|
|
29
|
-
export const
|
|
29
|
+
export const SUBCOMMANDS = {
|
|
30
|
+
baseline: "baseline takes write, prune, tighten or migrate.",
|
|
31
|
+
exceptions: "exceptions takes migrate.",
|
|
32
|
+
hooks: "hooks takes install, uninstall or pre-commit.",
|
|
33
|
+
};
|
|
30
34
|
//# sourceMappingURL=messages.js.map
|
package/dist/cli/messages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;0DA2BqC,CAAC;AAE3D,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;0DA2BqC,CAAC;AAE3D,MAAM,CAAC,MAAM,WAAW,GAAqC;IAC5D,QAAQ,EAAE,kDAAkD;IAC5D,UAAU,EAAE,2BAA2B;IACvC,KAAK,EAAE,+CAA+C;CACtD,CAAC"}
|
package/dist/cli/migrate.js
CHANGED
|
@@ -4,7 +4,7 @@ import { encodeBaseline } from "#baseline/format.ts";
|
|
|
4
4
|
import { convertLegacy, decodeLegacyBaseline, LEGACY_BASELINE } from "#baseline/legacy.ts";
|
|
5
5
|
import { loadConfig } from "#config/load.ts";
|
|
6
6
|
import { validOrFail } from "#decoded.ts";
|
|
7
|
-
import { readInput } from "#engine/
|
|
7
|
+
import { readInput } from "#engine/baselineFile.ts";
|
|
8
8
|
import { scan } from "#engine/session.ts";
|
|
9
9
|
import { SetupFailure } from "#failure.ts";
|
|
10
10
|
import { writeText } from "#inventory/filesystem.ts";
|
package/dist/cli/migrate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/cli/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/cli/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,cAAc,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C,CAAC;AACpI,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { join } from "node:path";
|
|
|
2
2
|
import { Console, Effect, FileSystem } from "effect";
|
|
3
3
|
import { loadConfig } from "#config/load.ts";
|
|
4
4
|
import { validOrFail } from "#decoded.ts";
|
|
5
|
-
import { readInput } from "#engine/
|
|
5
|
+
import { readInput } from "#engine/baselineFile.ts";
|
|
6
6
|
import { decodeExceptions } from "#exceptions/declaration.ts";
|
|
7
7
|
import { migrateBiome } from "#exceptions/migrateBiome.ts";
|
|
8
8
|
import { migrateConfig } from "#exceptions/migrateConfig.ts";
|