pipework 0.269.0 → 0.271.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 +9 -0
- package/REFERENCE.md +44 -0
- package/dist/cli/commands/check-steps.d.ts +34 -0
- package/dist/cli/commands/check-steps.d.ts.map +1 -0
- package/dist/cli/commands/check-steps.js +60 -0
- package/dist/cli/commands/check-steps.js.map +1 -0
- package/dist/cli/commands/check.d.ts +43 -1
- package/dist/cli/commands/check.d.ts.map +1 -1
- package/dist/cli/commands/check.js +232 -133
- package/dist/cli/commands/check.js.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +36 -1
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +55 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/lint/config.d.ts +4 -0
- package/dist/lint/config.d.ts.map +1 -1
- package/dist/lint/config.js +6 -0
- package/dist/lint/config.js.map +1 -1
- package/dist/lint/doctrine.d.ts +4 -0
- package/dist/lint/doctrine.d.ts.map +1 -1
- package/dist/lint/doctrine.js +14 -7
- package/dist/lint/doctrine.js.map +1 -1
- package/dist/lint/rules/doctrine.d.ts +3 -0
- package/dist/lint/rules/doctrine.d.ts.map +1 -0
- package/dist/lint/rules/doctrine.js +28 -0
- package/dist/lint/rules/doctrine.js.map +1 -0
- package/dist/trace/cardinality/check.d.ts +5 -1
- package/dist/trace/cardinality/check.d.ts.map +1 -1
- package/dist/trace/cardinality/check.js +3 -1
- package/dist/trace/cardinality/check.js.map +1 -1
- package/dist/trace/check/coverage-check.d.ts +2 -0
- package/dist/trace/check/coverage-check.d.ts.map +1 -1
- package/dist/trace/check/coverage-check.js +3 -1
- package/dist/trace/check/coverage-check.js.map +1 -1
- package/dist/trace/check/flow-check.d.ts +2 -0
- package/dist/trace/check/flow-check.d.ts.map +1 -1
- package/dist/trace/check/flow-check.js +3 -1
- package/dist/trace/check/flow-check.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/commands/check-steps.ts +98 -0
- package/src/cli/commands/check.ts +283 -147
- package/src/cli/commands/lint.ts +34 -1
- package/src/cli/index.ts +56 -2
- package/src/lint/config.ts +6 -0
- package/src/lint/doctrine.ts +17 -8
- package/src/lint/rules/doctrine.ts +31 -0
- package/src/trace/cardinality/check.ts +9 -2
- package/src/trace/check/coverage-check.ts +5 -1
- package/src/trace/check/flow-check.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.271.0
|
|
4
|
+
|
|
5
|
+
- **Added: the doctrine rules run in eslint** (#947). `define/prefer-pipe-define`, `define/no-raw-pgTable`, `define/brand-primary-key` and `define/use-traits` are now ESLint rules in the lint preset, on at `error`, with the same ids, lines and messages `pipework check`'s doctrine step reports, from one shared implementation. `pipework lint`, editors and plain `eslint` with the generated config see them per file; test files and `.d.ts` are not judged. Turn one off through `lint.extra` rules like any preset rule. `check` keeps its doctrine step, so a finding in a linted file may appear in both steps.
|
|
6
|
+
|
|
7
|
+
## 0.270.0
|
|
8
|
+
|
|
9
|
+
- **Added: check's steps run on their own, with JSON per violation** (#946). `pipework doctrine`, `pipework flow`, `pipework cardinality` and `pipework startup` each run one step of `check`, with `--format json` (a record of `rule`, `file`, `line`, `message` per violation and one entry per scanned file), `--output-file <path>`, the scope flags, and for the first three explicit file paths. `pipework check` gains `--format json` (one record per step) and `--only` / `--skip` by step name; a step not selected is reported as skipped, never passed. Each record's `reads` and REFERENCE.md say what a verdict depends on: doctrine and flow read only the file; cardinality cycles and the derived cap read every scanned file.
|
|
10
|
+
- **Added: `pipework lint --list-files`** (#946). Prints the repo-relative files `pipework check`'s lint pass covers, one per line and sorted, without linting: each module's include globs plus the files at the workspace root outside every module. It reads `pipework.config.ts`, not a package `lint` script, and `--shard i/n` prints the files of that shard (the root files belong to shard 1), so a runner can derive its lint shard from the lint configuration. `check` lints the same population, from one function.
|
|
11
|
+
|
|
3
12
|
## 0.269.0
|
|
4
13
|
|
|
5
14
|
- **Added: a route can opt out of cancel-on-disconnect** (#944). Since 0.266.0 a client that closes the connection aborts the request and rolls its transaction back, which loses the work of a webhook receiver whose sender abandons slow deliveries (GitHub after 10 s) and does not redeliver. `.route(method, path, { cancelOnDisconnect: false })` skips the disconnect listener for that route: its `signal` never aborts, the handler runs to completion and the transaction commits after the socket has closed. The default is unchanged (`true`).
|
package/REFERENCE.md
CHANGED
|
@@ -601,10 +601,54 @@ Thrown for configuration problems — includes a suggestion for how to fix.
|
|
|
601
601
|
|
|
602
602
|
`pipework lint [eslint args and files...]` runs eslint in the current directory with the config, include globs, ignores and eslint binary `pipework check` uses for that module (at the workspace root: the whole workspace). With no files named it lints the module's include globs; with files named it lints only those. Every other argument goes to eslint verbatim, so `pipework lint --format json --output-file r.json src/a.ts` writes `r.json` for `src/a.ts` alone. The exit code is eslint's.
|
|
603
603
|
|
|
604
|
+
`pipework lint --list-files [--shard i/n]` prints, one per line and sorted, the repo-relative files `pipework check`'s lint pass covers, and lints nothing. The set comes from `pipework.config.ts` (`lint.include`, `lint.modules.<path>.include`, the declared modules), not from a package `lint` script, so a runner that shards or caches lint per file derives its population from the lint configuration. It is the same population `check` lints: each module's include globs, plus the files at the workspace root outside every module (`lint.include` globs applied at the root, such as `*.ts` and `scripts/**/*.ts`), which belong to shard 1. `--shard i/n` splits modules as `check --shard` does. `--list-files` takes no other argument and exits 1 naming one it is given.
|
|
605
|
+
|
|
604
606
|
Generated module manifests declare `"lint": "pipework lint"` and `"type-check": "tsc --noEmit -p tsconfig.check.json"` (the config `check` type-checks with, which resolves sibling packages from source), so `pnpm -C <module> run lint --format json --output-file r.json <file>` gives `check`'s verdict for that file. `test` stays `vitest run`: `pipework test` provisions test databases and project filters that a bare `vitest run` in a module does not. Run `pipework sync` (or `pipework install`) to regenerate the manifests and `eslint.config.js`.
|
|
605
607
|
|
|
608
|
+
The lint preset also carries the four doctrine rules at `error`: `define/prefer-pipe-define`, `define/no-raw-pgTable`, `define/brand-primary-key` and `define/use-traits`. They are the same scans `pipework check`'s doctrine step runs (one implementation, same file, line and message), skip test files and `.d.ts`, and can be turned off through `lint.extra` rules like any preset rule. `check` keeps its doctrine step for files outside the lint globs, so a finding in a linted file can appear in both steps.
|
|
609
|
+
|
|
606
610
|
`lint.modules.<path>` overrides apply per file: the root `eslint.config.js` carries each module's `rules` and `configs` with their `files` and `ignores` globs prefixed by the module's path, so plain `eslint <file>` from the workspace root or a module directory agrees with `pipework check`.
|
|
607
611
|
|
|
612
|
+
### `pipework check` steps
|
|
613
|
+
|
|
614
|
+
`pipework check` runs these steps, in this order, and each has a name: `checksums`, `vitest-config`, `eslint-config`, `config-load`, `doctrine`, `flow`, `cardinality`, `coverage`, `lint`, `typecheck`, `startup`, `boundaries`, `dependencies`, `install`.
|
|
615
|
+
|
|
616
|
+
- `--only <a,b>` runs just those steps; `--skip <a,b>` runs all but those. Names are comma-separated. An unknown name, or `--only` with `--skip`, is refused with an error that lists the valid names. A step that is not selected is named as skipped in the output and never counts as passed; the closing line then reads `Selected checks passed (not run: ...)` instead of `All checks passed`.
|
|
617
|
+
- `--format json` writes one record per step, as a JSON array in the order above, to stdout, or to the file named by `--output-file <path>`. Every human line stays on stderr. A step that did not run (not selected, no modules resolved, no `pipework.config.ts`, no `scripts/check-boundaries.js`) has `"status": "skipped"` and a `reason`. The exit code is 1 when any step failed.
|
|
618
|
+
|
|
619
|
+
`pipework doctrine`, `pipework flow`, `pipework cardinality` and `pipework startup` run one step alone. Each takes `--format json`, `--output-file <path>` and the scope flags of `check` (`--all`, `--module`, `--staged`, `--fast`, `--full`). `doctrine`, `flow` and `cardinality` also take file paths: with files, only those files are judged; without, they judge the source files `check` judges for the scope. `startup` takes no files. The exit code is 1 when the step fails, else 0; the human output is what `check` prints for that step. `pipework doctrine --format json --output-file d.json src/a.ts` writes a single record for `src/a.ts`.
|
|
620
|
+
|
|
621
|
+
A record:
|
|
622
|
+
|
|
623
|
+
```json
|
|
624
|
+
{
|
|
625
|
+
"step": "doctrine",
|
|
626
|
+
"status": "failed",
|
|
627
|
+
"pipeworkVersion": "0.269.0",
|
|
628
|
+
"reads": "Each file's verdict depends only on that file's bytes and the pipework version; no other file is read.",
|
|
629
|
+
"files": [
|
|
630
|
+
{ "file": "src/a.ts", "violations": [{ "rule": "define/prefer-pipe-define", "file": "src/a.ts", "line": 3, "message": "..." }] },
|
|
631
|
+
{ "file": "src/b.ts", "violations": [] }
|
|
632
|
+
],
|
|
633
|
+
"violations": [{ "rule": "define/prefer-pipe-define", "file": "src/a.ts", "line": 3, "message": "..." }]
|
|
634
|
+
}
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
`status` is `passed`, `failed` or `skipped`. `violations` is every violation, flat; a violation that is not at a line (a config value) has `line: 0`. `files` is on `doctrine`, `flow`, `cardinality` and `coverage` only and lists every file scanned, clean ones with an empty `violations`, so a gate can bank one verdict per file. A file that does not parse is not judged by `flow`, `cardinality` or `coverage` and is absent from `files`. The other steps carry `status` and `violations` (empty for steps that report no structured violations). `coverage` never fails: its violations are warnings under `"status": "passed"`.
|
|
638
|
+
|
|
639
|
+
What each verdict reads (also in each record's `reads`):
|
|
640
|
+
|
|
641
|
+
| step | reads |
|
|
642
|
+
|---|---|
|
|
643
|
+
| `doctrine` | only the file's bytes and the pipework version |
|
|
644
|
+
| `flow` | only the file's bytes and the pipework version |
|
|
645
|
+
| `cardinality` | `cardinality/mismatch` and `cardinality/unannotated-ambiguity`: only the file's bytes. `cardinality/step-cycle`: ALL scanned source files (the call graph spans files). `cardinality/structural-max-too-low` and `-stale`: all scanned source files and `trace.structuralMax` in `pipework.config.ts`. With explicit file arguments the graph holds only those files, so cycles and the derived cap reflect that subset |
|
|
646
|
+
| `coverage` | the file's bytes, the pipework version and `trace.io` in `pipework.config.ts` |
|
|
647
|
+
| `startup` | `pipework.config.ts` loaded and everything it imports (it is evaluated, so every `define()` and registration it reaches counts); no database, no connection. Its violations are `startup/<phase>` with file `pipework.config.ts` |
|
|
648
|
+
| `lint` | the files the lint globs name, `eslint.config.js`, the tsconfig chain and `lint.*` in `pipework.config.ts`; type-aware rules also read the files a linted file imports. Not per-file independent |
|
|
649
|
+
| `typecheck` | each module's tsconfig and the whole program it names. Not per-file independent |
|
|
650
|
+
| `checksums`, `eslint-config`, `vitest-config`, `config-load`, `boundaries`, `dependencies`, `install` | the files named in the record's `reads` |
|
|
651
|
+
|
|
608
652
|
### Types
|
|
609
653
|
|
|
610
654
|
**`StatementEvent`**
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const STEP_NAMES: readonly ["checksums", "vitest-config", "eslint-config", "config-load", "doctrine", "flow", "cardinality", "coverage", "lint", "typecheck", "startup", "boundaries", "dependencies", "install"];
|
|
2
|
+
export type StepName = typeof STEP_NAMES[number];
|
|
3
|
+
export interface StepViolation {
|
|
4
|
+
readonly rule: string;
|
|
5
|
+
readonly file: string;
|
|
6
|
+
/** 1-based; 0 when the violation is not at a line (a config value, a whole-project fault). */
|
|
7
|
+
readonly line: number;
|
|
8
|
+
readonly message: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FileVerdict {
|
|
11
|
+
readonly file: string;
|
|
12
|
+
readonly violations: readonly StepViolation[];
|
|
13
|
+
}
|
|
14
|
+
export interface StepRecord {
|
|
15
|
+
readonly step: StepName;
|
|
16
|
+
readonly status: 'passed' | 'failed' | 'skipped';
|
|
17
|
+
readonly pipeworkVersion: string;
|
|
18
|
+
/** What the verdict depends on. */
|
|
19
|
+
readonly reads: string;
|
|
20
|
+
/** Only on a skipped step: why it did not run. */
|
|
21
|
+
readonly reason?: string;
|
|
22
|
+
/** Every scanned file, clean ones with an empty list. Only doctrine, flow, cardinality and coverage. */
|
|
23
|
+
readonly files?: readonly FileVerdict[];
|
|
24
|
+
readonly violations: readonly StepViolation[];
|
|
25
|
+
}
|
|
26
|
+
/** What each step's verdict depends on, for a gate that keys cached verdicts. */
|
|
27
|
+
export declare const STEP_READS: Readonly<Record<StepName, string>>;
|
|
28
|
+
export declare function record(step: StepName, version: string, status: StepRecord['status'], violations?: readonly StepViolation[], scannedFiles?: readonly string[], reason?: string): StepRecord;
|
|
29
|
+
export type StepSelection = (step: StepName) => boolean;
|
|
30
|
+
/** --only and --skip take comma-separated step names; either alone, never both. */
|
|
31
|
+
export declare function parseStepSelection(only: string | undefined, skip: string | undefined): StepSelection;
|
|
32
|
+
/** The JSON to stdout, or to `outputFile` when given. */
|
|
33
|
+
export declare function emitJson(value: unknown, outputFile: string | undefined): void;
|
|
34
|
+
//# sourceMappingURL=check-steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-steps.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/check-steps.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,iMAGb,CAAA;AAEV,MAAM,MAAM,QAAQ,GAAG,OAAO,UAAU,CAAC,MAAM,CAAC,CAAA;AAEhD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,8FAA8F;IAC9F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAA;CAC9C;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;IAChD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,mCAAmC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,kDAAkD;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,wGAAwG;IACxG,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,WAAW,EAAE,CAAA;IACvC,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAA;CAC9C;AAED,iFAAiF;AACjF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAezD,CAAA;AAED,wBAAgB,MAAM,CACpB,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAC5B,UAAU,GAAE,SAAS,aAAa,EAAO,EACzC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,EAChC,MAAM,CAAC,EAAE,MAAM,GACd,UAAU,CAMZ;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO,CAAA;AAEvD,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAgBpG;AAED,yDAAyD;AACzD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAI7E"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// The vocabulary of `check`'s steps: names, the structured record each step
|
|
2
|
+
// yields, the --only/--skip selection, and the JSON writer.
|
|
3
|
+
import { writeFileSync } from 'node:fs';
|
|
4
|
+
export const STEP_NAMES = [
|
|
5
|
+
'checksums', 'vitest-config', 'eslint-config', 'config-load', 'doctrine', 'flow',
|
|
6
|
+
'cardinality', 'coverage', 'lint', 'typecheck', 'startup', 'boundaries', 'dependencies', 'install',
|
|
7
|
+
];
|
|
8
|
+
/** What each step's verdict depends on, for a gate that keys cached verdicts. */
|
|
9
|
+
export const STEP_READS = {
|
|
10
|
+
'checksums': 'package.json (its _generated and _checksum fields).',
|
|
11
|
+
'vitest-config': 'vitest.config.ts, any stale vitest configs under the workspace, and the vitest section of pipework.config.ts (loaded, with everything it imports).',
|
|
12
|
+
'eslint-config': 'eslint.config.js and the pipework version.',
|
|
13
|
+
'config-load': 'pipework.config.ts and everything it imports (it is evaluated).',
|
|
14
|
+
'doctrine': "Each file's verdict depends only on that file's bytes and the pipework version; no other file is read.",
|
|
15
|
+
'flow': "Each file's verdict depends only on that file's bytes and the pipework version; no other file is read. A file that does not parse is not judged and is absent from files.",
|
|
16
|
+
'cardinality': "cardinality/mismatch and cardinality/unannotated-ambiguity depend only on the file's own bytes. cardinality/step-cycle depends on ALL scanned source files (the call graph spans files), and the cardinality/structural-max-* verdicts depend on all scanned source files and trace.structuralMax in pipework.config.ts (loaded, with everything it imports). With explicit file arguments only those files form the graph, so cycles and the derived cap reflect that subset. A file that does not parse is absent from files.",
|
|
17
|
+
'coverage': "Each file's verdict depends on that file's bytes, the pipework version and trace.io in pipework.config.ts (loaded, with everything it imports). Violations are warnings: the step never fails.",
|
|
18
|
+
'lint': 'The files the lint include globs name, eslint.config.js, the tsconfig chain and lint.* in pipework.config.ts; type-aware rules also read the files a linted file imports. Not per-file independent.',
|
|
19
|
+
'typecheck': "Every module's tsconfig and the whole program it names. Not per-file independent.",
|
|
20
|
+
'startup': 'pipework.config.ts loaded, and everything that config imports (it is evaluated, so every define() and registration it reaches counts). Needs no database and opens no connection.',
|
|
21
|
+
'boundaries': 'scripts/check-boundaries.js and the repository files it scans.',
|
|
22
|
+
'dependencies': 'package.json of each workspace package.',
|
|
23
|
+
'install': "The pipework copies under node_modules (pnpm's virtual-store lockfile and each copy's package.json).",
|
|
24
|
+
};
|
|
25
|
+
export function record(step, version, status, violations = [], scannedFiles, reason) {
|
|
26
|
+
const base = { step, status, pipeworkVersion: version, reads: STEP_READS[step] };
|
|
27
|
+
const withReason = reason === undefined ? base : { ...base, reason };
|
|
28
|
+
if (scannedFiles === undefined)
|
|
29
|
+
return { ...withReason, violations };
|
|
30
|
+
const files = scannedFiles.map(file => ({ file, violations: violations.filter(v => v.file === file) }));
|
|
31
|
+
return { ...withReason, files, violations };
|
|
32
|
+
}
|
|
33
|
+
/** --only and --skip take comma-separated step names; either alone, never both. */
|
|
34
|
+
export function parseStepSelection(only, skip) {
|
|
35
|
+
const valid = `Valid steps: ${STEP_NAMES.join(', ')}.`;
|
|
36
|
+
if (only !== undefined && skip !== undefined) {
|
|
37
|
+
throw new Error(`--only and --skip cannot be combined. ${valid}`);
|
|
38
|
+
}
|
|
39
|
+
const raw = only ?? skip;
|
|
40
|
+
if (raw === undefined)
|
|
41
|
+
return () => true;
|
|
42
|
+
const flag = only !== undefined ? '--only' : '--skip';
|
|
43
|
+
const names = raw.split(',').map(n => n.trim());
|
|
44
|
+
for (const name of names) {
|
|
45
|
+
if (!STEP_NAMES.includes(name)) {
|
|
46
|
+
throw new Error(`${flag} names an unknown step "${name}". ${valid}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const set = new Set(names);
|
|
50
|
+
return only !== undefined ? step => set.has(step) : step => !set.has(step);
|
|
51
|
+
}
|
|
52
|
+
/** The JSON to stdout, or to `outputFile` when given. */
|
|
53
|
+
export function emitJson(value, outputFile) {
|
|
54
|
+
const text = JSON.stringify(value, null, 2) + '\n';
|
|
55
|
+
if (outputFile === undefined)
|
|
56
|
+
process.stdout.write(text);
|
|
57
|
+
else
|
|
58
|
+
writeFileSync(outputFile, text, 'utf-8');
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=check-steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-steps.js","sourceRoot":"","sources":["../../../src/cli/commands/check-steps.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4DAA4D;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,CAAC,MAAM,UAAU,GA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C,GAAG,CAAC,IAAI,CAAC,CAAA;AAC5E,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,QAAQ,CAAC,KAAc,EAAE,UAA8B;IACrE,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAA;IAClD,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;;QACnD,aAAa,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AAC/C,CAAC"}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import type { ScopeMode } from '../../workspace/affected.js';
|
|
2
2
|
import { type Shard } from './shard.js';
|
|
3
|
-
|
|
3
|
+
import { type StepRecord, type StepSelection } from './check-steps.js';
|
|
4
|
+
export interface CheckOptions {
|
|
5
|
+
/** `json`: one record per step on stdout (or `outputFile`); human lines stay on stderr. */
|
|
6
|
+
readonly format?: 'human' | 'json';
|
|
7
|
+
readonly outputFile?: string | undefined;
|
|
8
|
+
/** Which steps run; the rest are recorded as skipped. */
|
|
9
|
+
readonly select?: StepSelection;
|
|
10
|
+
}
|
|
11
|
+
export declare function check(cwd: string, scope?: ScopeMode, shard?: Shard, options?: CheckOptions): Promise<void>;
|
|
12
|
+
export interface StepCommandOptions {
|
|
13
|
+
readonly format?: 'human' | 'json';
|
|
14
|
+
readonly outputFile?: string | undefined;
|
|
15
|
+
readonly scope?: ScopeMode;
|
|
16
|
+
/** Explicit files (doctrine, flow, cardinality): only these are judged. */
|
|
17
|
+
readonly files?: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
/** `pipework doctrine|flow|cardinality|startup`: one step alone. Returns the exit code. */
|
|
20
|
+
export declare function stepCommand(cwd: string, step: 'doctrine' | 'flow' | 'cardinality' | 'startup', options?: StepCommandOptions): Promise<number>;
|
|
4
21
|
/** The startup checks that need no database — what `serve` would refuse before connecting. */
|
|
22
|
+
export declare function startupStep(cwd: string): Promise<StepRecord>;
|
|
5
23
|
export declare function runStartupChecks(cwd: string): Promise<boolean>;
|
|
6
24
|
/** One line per platform-mode database: the role a running manifold connects as, and the only callers that may open the owner. */
|
|
7
25
|
export declare function describeRuntimeRoles(databases: ReadonlyMap<string, {
|
|
@@ -38,8 +56,12 @@ export interface ModuleScope {
|
|
|
38
56
|
export declare function resolveModulePaths(cwd: string, scope?: ScopeMode): Promise<ModuleScope>;
|
|
39
57
|
export declare function verifyVitestConfig(cwd: string): Promise<boolean>;
|
|
40
58
|
export declare function verifyEslintConfig(cwd: string): boolean;
|
|
59
|
+
export declare function doctrineStep(cwd: string, sourceFiles: readonly string[]): StepRecord;
|
|
60
|
+
export declare function flowStep(cwd: string, sourceFiles: readonly string[]): StepRecord;
|
|
41
61
|
export declare function runFlowCheck(cwd: string, sourceFiles: string[]): boolean;
|
|
62
|
+
export declare function cardinalityStep(cwd: string, sourceFiles: readonly string[], configuredStructuralMax?: number, fullScope?: boolean): StepRecord;
|
|
42
63
|
export declare function runCardinalityCheck(cwd: string, sourceFiles: string[], configuredStructuralMax?: number, fullScope?: boolean): boolean;
|
|
64
|
+
export declare function coverageStep(cwd: string, sourceFiles: readonly string[], extras?: Readonly<Record<string, 'read' | 'write'>>): StepRecord;
|
|
43
65
|
export declare function runCoverageCheckWarning(cwd: string, sourceFiles: string[], extras?: Readonly<Record<string, 'read' | 'write'>>): void;
|
|
44
66
|
export declare function resolveTscBin(cwd: string): string;
|
|
45
67
|
export declare function resolveEslintBin(cwd: string): string;
|
|
@@ -95,6 +117,26 @@ export declare function readEslintReport(stdout: string): {
|
|
|
95
117
|
*/
|
|
96
118
|
export declare function builtinConfigArgs(dir: string): string[];
|
|
97
119
|
export declare function lintDirectory(eslintBin: string, dir: string, label: string, cacheLocation: string | ((fingerprint: string) => string), configured?: readonly string[]): Promise<boolean>;
|
|
120
|
+
export declare function runLint(cwd: string, allModules: string[], shard?: Shard): Promise<boolean>;
|
|
121
|
+
export interface LintPopulation {
|
|
122
|
+
/** The sharded modules, each with the include globs `check` lints it with. */
|
|
123
|
+
readonly modules: ReadonlyArray<{
|
|
124
|
+
readonly path: string;
|
|
125
|
+
readonly includes: readonly string[] | undefined;
|
|
126
|
+
}>;
|
|
127
|
+
/** Root files outside every module; empty off shard 1. */
|
|
128
|
+
readonly root: string[];
|
|
129
|
+
/** Every file the run lints, repo-relative and sorted. */
|
|
130
|
+
readonly files: string[];
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The files `check`'s lint pass covers: each sharded module's include globs plus the
|
|
134
|
+
* root-outside-modules pass (shard 1 only). `runLint` lints this population and
|
|
135
|
+
* `pipework lint --list-files` prints it, so the two cannot drift.
|
|
136
|
+
*/
|
|
137
|
+
export declare function lintPopulation(cwd: string, allModules: readonly string[], includes: {
|
|
138
|
+
for: (mod: string) => readonly string[] | undefined;
|
|
139
|
+
}, shard?: Shard): LintPopulation;
|
|
98
140
|
/**
|
|
99
141
|
* Root-level lintable files that no module covers (#402).
|
|
100
142
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/check.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAQ5D,OAAO,EAA0B,KAAK,KAAK,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/check.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAQ5D,OAAO,EAA0B,KAAK,KAAK,EAAE,MAAM,YAAY,CAAA;AAC/D,OAAO,EAAmC,KAAK,UAAU,EAAE,KAAK,aAAa,EAAsB,MAAM,kBAAkB,CAAA;AAW3H,MAAM,WAAW,YAAY;IAC3B,2FAA2F;IAC3F,QAAQ,CAAC,MAAM,CAAC,EAAE,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