@terra-symposium/standards-quality 0.8.0 → 0.9.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/README.md +8 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/node-reporter.d.ts +79 -0
- package/dist/node-reporter.d.ts.map +1 -0
- package/dist/node-reporter.js +217 -0
- package/dist/node-reporter.js.map +1 -0
- package/dist/playwright-reporter.d.ts +107 -0
- package/dist/playwright-reporter.d.ts.map +1 -0
- package/dist/playwright-reporter.js +138 -0
- package/dist/playwright-reporter.js.map +1 -0
- package/dist/progress.d.ts +5 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +6 -4
- package/dist/progress.js.map +1 -1
- package/dist/runner.d.ts +3 -1
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +580 -86
- package/dist/runner.js.map +1 -1
- package/dist/single-use.d.ts +2 -1
- package/dist/single-use.d.ts.map +1 -1
- package/dist/single-use.js +42 -15
- package/dist/single-use.js.map +1 -1
- package/dist/test-workspace.d.ts +6 -0
- package/dist/test-workspace.d.ts.map +1 -0
- package/dist/test-workspace.js +48 -0
- package/dist/test-workspace.js.map +1 -0
- package/dist/ui-recommendations.d.ts +43 -0
- package/dist/ui-recommendations.d.ts.map +1 -0
- package/dist/ui-recommendations.js +182 -0
- package/dist/ui-recommendations.js.map +1 -0
- package/dist/workspace-test-runner.d.ts +6 -0
- package/dist/workspace-test-runner.d.ts.map +1 -0
- package/dist/workspace-test-runner.js +48 -0
- package/dist/workspace-test-runner.js.map +1 -0
- package/package.json +2 -2
- package/quality.schema.json +195 -130
package/README.md
CHANGED
|
@@ -46,6 +46,14 @@ pnpm exec terra-quality quality --all --warn
|
|
|
46
46
|
|
|
47
47
|
The normal scope is changed and untracked files in a Git worktree. `--all` selects every file under `sourceRoots`; `--warn` disables autofixes and runs dead-code analysis once without a temporary fix preview. It reports rule-level fix candidates; fix mode then type-checks proposed dead-code edits before writing and may reject a candidate. Configured quality commands still run unless you pass `--skip-commands`.
|
|
48
48
|
|
|
49
|
+
## Output order and tests
|
|
50
|
+
|
|
51
|
+
The runner controls a fixed phase order: **Format → Static quality → Tests → Framework / type checks → Build → Repository health**. `quality.json` selects enabled checks and commands; it does not define phase order or test categories. Commands in ordinary phases keep their configured order; tests keep their configured order within each category.
|
|
52
|
+
|
|
53
|
+
Selected test commands are grouped as **Unit / Contract**, **Integration**, **Browser / Cloud**, or **Other tests**. Each suite has a 24-cell progress bar. Node and Playwright suites also report individual case progress; other runners receive suite-level progress only. The runner suppresses native child test output when its custom case reporter owns the output, preventing duplicate case listings.
|
|
54
|
+
|
|
55
|
+
Dead-code is reported as one group. Fix mode shows **Safe fixes** (Knip import consumers, ESLint unused declarations, single-use declaration/reference scans, classification, then only proven edits) followed by **Verification** (Knip reachability, final ESLint and single-use results, and TypeScript safety for candidate edits). Manual findings appear in stable path/line/rule/name order and fail by default; set `"manualWarnings": "warning"` to make them non-blocking. All configured checks finish before the run returns failure.
|
|
56
|
+
|
|
49
57
|
## What it does
|
|
50
58
|
|
|
51
59
|
Terra Quality combines source checks such as documentation, import resolution, naming, forwarding, security, and configured UI-pattern checks with repository-owned tools and commands. Safe transformations can maintain layout, apply tool fixes, and rewrite supported syntax. Findings that require domain or runtime judgment remain for review.
|
package/dist/index.d.ts
CHANGED
|
@@ -10,10 +10,14 @@ export * from './imports.js';
|
|
|
10
10
|
export * from './inline-if.js';
|
|
11
11
|
export * from './documentation.js';
|
|
12
12
|
export * from './naming.js';
|
|
13
|
+
export { qualityNodeReporter } from './node-reporter.js';
|
|
13
14
|
export * from './object-forwarding.js';
|
|
14
15
|
export * from './port.js';
|
|
15
16
|
export * from './runner.js';
|
|
16
17
|
export * from './single-use.js';
|
|
17
18
|
export * from './security.js';
|
|
18
19
|
export * from './patterns.js';
|
|
20
|
+
export * from './ui-recommendations.js';
|
|
21
|
+
export { default as QualityPlaywrightReporter } from './playwright-reporter.js';
|
|
22
|
+
export type { QualityPlaywrightReporterOptions } from './playwright-reporter.js';
|
|
19
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAChF,YAAY,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,10 +10,13 @@ export * from './imports.js';
|
|
|
10
10
|
export * from './inline-if.js';
|
|
11
11
|
export * from './documentation.js';
|
|
12
12
|
export * from './naming.js';
|
|
13
|
+
export { qualityNodeReporter } from './node-reporter.js';
|
|
13
14
|
export * from './object-forwarding.js';
|
|
14
15
|
export * from './port.js';
|
|
15
16
|
export * from './runner.js';
|
|
16
17
|
export * from './single-use.js';
|
|
17
18
|
export * from './security.js';
|
|
18
19
|
export * from './patterns.js';
|
|
20
|
+
export * from './ui-recommendations.js';
|
|
21
|
+
export { default as QualityPlaywrightReporter } from './playwright-reporter.js';
|
|
19
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* packages/quality/src/node-reporter.ts
|
|
3
|
+
* Per-case progress reporter for the Node.js test runner.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Describes the subset of Node test events used for progress and case summaries.
|
|
7
|
+
*/
|
|
8
|
+
type NodeTestE = {
|
|
9
|
+
type: string;
|
|
10
|
+
data?: {
|
|
11
|
+
name?: string;
|
|
12
|
+
nesting?: number;
|
|
13
|
+
type?: string;
|
|
14
|
+
testId?: number;
|
|
15
|
+
testNumber?: number;
|
|
16
|
+
file?: string;
|
|
17
|
+
line?: number;
|
|
18
|
+
skip?: boolean | string;
|
|
19
|
+
todo?: boolean | string;
|
|
20
|
+
counts?: {
|
|
21
|
+
tests?: number;
|
|
22
|
+
passed?: number;
|
|
23
|
+
failed?: number;
|
|
24
|
+
skipped?: number;
|
|
25
|
+
todo?: number;
|
|
26
|
+
cancelled?: number;
|
|
27
|
+
};
|
|
28
|
+
details?: {
|
|
29
|
+
type?: string;
|
|
30
|
+
passed?: boolean;
|
|
31
|
+
skip?: boolean | string;
|
|
32
|
+
todo?: boolean | string;
|
|
33
|
+
error?: {
|
|
34
|
+
message?: string;
|
|
35
|
+
} | string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Replaces any inherited Node test reporter with the shared quality reporter.
|
|
41
|
+
*
|
|
42
|
+
* @param curr Existing `NODE_OPTIONS`, if set.
|
|
43
|
+
* @param reporterUrl URL of the compiled shared reporter.
|
|
44
|
+
*
|
|
45
|
+
* @return Node options that retain unrelated flags and select one quality reporter.
|
|
46
|
+
*/
|
|
47
|
+
export declare function qualityNodeReporterOptions(curr: string | undefined, reporterUrl: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* Node.js custom test reporter with one progress unit per non-suite test.
|
|
50
|
+
*
|
|
51
|
+
* Node 24's `test:complete` events provide execution-order progress and
|
|
52
|
+
* file-scoped test IDs. The reporter also handles Node 18's older enqueue
|
|
53
|
+
* events, which omit test IDs and suite types, by correlating source metadata
|
|
54
|
+
* with terminal events. Discovery can continue while earlier files finish, so
|
|
55
|
+
* live updates leave the line open and finalize once the event stream ends.
|
|
56
|
+
* Test stdout, stderr, and diagnostics are intentionally ignored to avoid
|
|
57
|
+
* replaying output already written by child processes.
|
|
58
|
+
*
|
|
59
|
+
* @param src Node.js test event stream.
|
|
60
|
+
* @param opts Optional writer used by focused tests; opaque reporter arguments are ignored.
|
|
61
|
+
*
|
|
62
|
+
* @return The per-case result lines accepted by the Node reporter API.
|
|
63
|
+
*/
|
|
64
|
+
export declare function qualityNodeReporter(src: AsyncIterable<NodeTestE>, opts?: unknown): AsyncGenerator<string>;
|
|
65
|
+
/**
|
|
66
|
+
* Uses the shared reporter once in each test-runner process tree.
|
|
67
|
+
*
|
|
68
|
+
* Node propagates NODE_OPTIONS to isolated test workers and nested child
|
|
69
|
+
* processes. The first runner owns progress; nested runners drain their event
|
|
70
|
+
* streams so they cannot replay the same suite output.
|
|
71
|
+
*
|
|
72
|
+
* @param src Node.js test event stream.
|
|
73
|
+
* @param opts Optional writer used by focused tests; opaque reporter arguments are ignored.
|
|
74
|
+
*
|
|
75
|
+
* @return The per-case result lines accepted by the Node reporter API.
|
|
76
|
+
*/
|
|
77
|
+
declare function defaultQualityNodeReporter(src: AsyncIterable<NodeTestE>, opts?: unknown): AsyncGenerator<string>;
|
|
78
|
+
export default defaultQualityNodeReporter;
|
|
79
|
+
//# sourceMappingURL=node-reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-reporter.d.ts","sourceRoot":"","sources":["../src/node-reporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;GAEG;AACH,KAAK,SAAS,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QACxB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACnH,OAAO,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,OAAO,CAAC;YAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE;gBAAE,OAAO,CAAC,EAAE,MAAM,CAAA;aAAE,GAAG,MAAM,CAAA;SAAE,CAAC;KACvI,CAAC;CACF,CAAC;AAMF;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAahG;AA2BD;;;;;;;;;;;;;;;GAeG;AACH,wBAAuB,mBAAmB,CAAC,GAAG,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAoGhH;AAED;;;;;;;;;;;GAWG;AACH,iBAAgB,0BAA0B,CAAC,GAAG,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAShH;AACD,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* packages/quality/src/node-reporter.ts
|
|
3
|
+
* Per-case progress reporter for the Node.js test runner.
|
|
4
|
+
*/
|
|
5
|
+
/*//////////////////////////////////////////////////
|
|
6
|
+
IMPORTS
|
|
7
|
+
//////////////////////////////////////////////////*/
|
|
8
|
+
// API
|
|
9
|
+
import { qualityProgress } from './progress.js';
|
|
10
|
+
/*//////////////////////////////////////////////////
|
|
11
|
+
OPTIONS
|
|
12
|
+
//////////////////////////////////////////////////*/
|
|
13
|
+
/**
|
|
14
|
+
* Replaces any inherited Node test reporter with the shared quality reporter.
|
|
15
|
+
*
|
|
16
|
+
* @param curr Existing `NODE_OPTIONS`, if set.
|
|
17
|
+
* @param reporterUrl URL of the compiled shared reporter.
|
|
18
|
+
*
|
|
19
|
+
* @return Node options that retain unrelated flags and select one quality reporter.
|
|
20
|
+
*/
|
|
21
|
+
export function qualityNodeReporterOptions(curr, reporterUrl) {
|
|
22
|
+
const opts = curr?.match(/(?:[^\s"'=]+=)?(?:"[^"]*"|'[^']*'|[^\s]+)/gu) ?? [];
|
|
23
|
+
const retained = [];
|
|
24
|
+
for (let idx = 0; idx < opts.length; idx++) {
|
|
25
|
+
const opt = opts[idx];
|
|
26
|
+
if (opt === '--test-reporter' || opt === '--test-reporter-destination') {
|
|
27
|
+
idx++;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (opt.startsWith('--test-reporter=') || opt.startsWith('--test-reporter-destination='))
|
|
31
|
+
continue;
|
|
32
|
+
retained.push(opt);
|
|
33
|
+
}
|
|
34
|
+
return [...retained, `--test-reporter=${reporterUrl}`, '--test-reporter-destination=stdout'].join(' ');
|
|
35
|
+
}
|
|
36
|
+
/*//////////////////////////////////////////////////
|
|
37
|
+
HELPERS
|
|
38
|
+
//////////////////////////////////////////////////*/
|
|
39
|
+
/**
|
|
40
|
+
* Formats one terminal Node test result without forwarding child output.
|
|
41
|
+
*
|
|
42
|
+
* @param e Terminal pass or fail event from node:test.
|
|
43
|
+
* @param status Normalized status for the test case.
|
|
44
|
+
*
|
|
45
|
+
* @return One stable, single-line result.
|
|
46
|
+
*/
|
|
47
|
+
function fmtNodeResult(e, status) {
|
|
48
|
+
const data = e.data;
|
|
49
|
+
const nesting = Math.max(0, data?.nesting ?? 0);
|
|
50
|
+
const err = data?.details?.error;
|
|
51
|
+
const msg = typeof err === 'string' ? err : err?.message;
|
|
52
|
+
const detail = status === 'FAIL' && msg ? ` — ${msg.replace(/\s+/gu, ' ').trim()}` : '';
|
|
53
|
+
return `${' '.repeat(nesting)}[${status}] ${data?.name ?? 'unnamed test'}${detail}\n`;
|
|
54
|
+
}
|
|
55
|
+
/*//////////////////////////////////////////////////
|
|
56
|
+
REPORTER
|
|
57
|
+
//////////////////////////////////////////////////*/
|
|
58
|
+
/**
|
|
59
|
+
* Node.js custom test reporter with one progress unit per non-suite test.
|
|
60
|
+
*
|
|
61
|
+
* Node 24's `test:complete` events provide execution-order progress and
|
|
62
|
+
* file-scoped test IDs. The reporter also handles Node 18's older enqueue
|
|
63
|
+
* events, which omit test IDs and suite types, by correlating source metadata
|
|
64
|
+
* with terminal events. Discovery can continue while earlier files finish, so
|
|
65
|
+
* live updates leave the line open and finalize once the event stream ends.
|
|
66
|
+
* Test stdout, stderr, and diagnostics are intentionally ignored to avoid
|
|
67
|
+
* replaying output already written by child processes.
|
|
68
|
+
*
|
|
69
|
+
* @param src Node.js test event stream.
|
|
70
|
+
* @param opts Optional writer used by focused tests; opaque reporter arguments are ignored.
|
|
71
|
+
*
|
|
72
|
+
* @return The per-case result lines accepted by the Node reporter API.
|
|
73
|
+
*/
|
|
74
|
+
export async function* qualityNodeReporter(src, opts) {
|
|
75
|
+
const reportProgress = typeof opts === 'function' ? opts : (text) => void process.stderr.write(text);
|
|
76
|
+
let enqueued = 0;
|
|
77
|
+
let completed = 0;
|
|
78
|
+
const counts = { PASS: 0, FAIL: 0, SKIP: 0 };
|
|
79
|
+
let hasProgress = false;
|
|
80
|
+
let lastProgressCompleted = -1;
|
|
81
|
+
let lastProgressTotal = -1;
|
|
82
|
+
let terminalProtocol;
|
|
83
|
+
let summaryCounts;
|
|
84
|
+
const pendingByIdentity = new Map();
|
|
85
|
+
const seenTerminal = new Set();
|
|
86
|
+
const identity = (data, terminal = false) => {
|
|
87
|
+
const file = data?.file ?? '';
|
|
88
|
+
if (data?.testId !== undefined)
|
|
89
|
+
return JSON.stringify([file, 'id', data.testId]) ?? '';
|
|
90
|
+
if (terminal && data?.testNumber !== undefined)
|
|
91
|
+
return JSON.stringify([file, 'number', data.testNumber]) ?? '';
|
|
92
|
+
return JSON.stringify([file, 'source', data?.line ?? null, data?.nesting ?? 0, data?.name ?? 'unnamed test']) ?? '';
|
|
93
|
+
};
|
|
94
|
+
const isFileSuite = (data) => {
|
|
95
|
+
if (data?.nesting !== 0 || !data.name)
|
|
96
|
+
return false;
|
|
97
|
+
const normPath = (path) => path.replace(/^file:\/\//u, '').replace(/\\/gu, '/');
|
|
98
|
+
const basename = (path) => normPath(path).split('/').at(-1) ?? '';
|
|
99
|
+
const fileLikeName = /(?:^|[/\\])[^/\\]+\.(?:test|spec)\.(?:[cm]?js|tsx?)$/u.test(data.name);
|
|
100
|
+
return data.name === data.file || (data.file !== undefined && basename(data.name) === basename(data.file)) || (fileLikeName && (data.file === undefined || data.line === 1));
|
|
101
|
+
};
|
|
102
|
+
const liveProgress = () => {
|
|
103
|
+
lastProgressCompleted = completed;
|
|
104
|
+
lastProgressTotal = Math.max(completed, enqueued);
|
|
105
|
+
qualityProgress('Cases', lastProgressCompleted, lastProgressTotal, reportProgress, { finalize: false });
|
|
106
|
+
};
|
|
107
|
+
const rememberPending = (data, counted) => {
|
|
108
|
+
const key = identity(data);
|
|
109
|
+
pendingByIdentity.set(key, [...(pendingByIdentity.get(key) ?? []), { counted }]);
|
|
110
|
+
};
|
|
111
|
+
const takePending = (data) => {
|
|
112
|
+
const key = identity(data);
|
|
113
|
+
const entries = pendingByIdentity.get(key) ?? [];
|
|
114
|
+
const [pending] = entries.splice(0, 1);
|
|
115
|
+
if (entries.length)
|
|
116
|
+
pendingByIdentity.set(key, entries);
|
|
117
|
+
else
|
|
118
|
+
pendingByIdentity.delete(key);
|
|
119
|
+
return pending;
|
|
120
|
+
};
|
|
121
|
+
for await (const e of src) {
|
|
122
|
+
if (e.type === 'test:summary') {
|
|
123
|
+
const data = e.data;
|
|
124
|
+
if (data?.file === undefined && data?.counts)
|
|
125
|
+
summaryCounts = data.counts;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (e.type === 'test:enqueue') {
|
|
129
|
+
if (isFileSuite(e.data))
|
|
130
|
+
continue;
|
|
131
|
+
const counted = e.data?.type !== 'suite';
|
|
132
|
+
if (counted)
|
|
133
|
+
enqueued += 1;
|
|
134
|
+
rememberPending(e.data, counted);
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (e.type !== 'test:complete' && e.type !== 'test:pass' && e.type !== 'test:fail')
|
|
138
|
+
continue;
|
|
139
|
+
const protocol = e.type === 'test:complete' ? 'complete' : 'legacy';
|
|
140
|
+
terminalProtocol ??= protocol;
|
|
141
|
+
if (protocol !== terminalProtocol)
|
|
142
|
+
continue;
|
|
143
|
+
const data = e.data;
|
|
144
|
+
if (isFileSuite(data))
|
|
145
|
+
continue;
|
|
146
|
+
const details = data?.details;
|
|
147
|
+
const isSuite = details?.type === 'suite' || data?.type === 'suite';
|
|
148
|
+
const terminalKey = identity(data, true);
|
|
149
|
+
if (seenTerminal.has(terminalKey))
|
|
150
|
+
continue;
|
|
151
|
+
seenTerminal.add(terminalKey);
|
|
152
|
+
const pending = takePending(data);
|
|
153
|
+
if (isSuite) {
|
|
154
|
+
if (pending?.counted) {
|
|
155
|
+
enqueued = Math.max(completed, enqueued - 1);
|
|
156
|
+
if (hasProgress)
|
|
157
|
+
liveProgress();
|
|
158
|
+
}
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (pending && !pending.counted)
|
|
162
|
+
enqueued += 1;
|
|
163
|
+
completed += 1;
|
|
164
|
+
liveProgress();
|
|
165
|
+
hasProgress = true;
|
|
166
|
+
const failed = e.type === 'test:fail' || (e.type === 'test:complete' && details?.passed === false);
|
|
167
|
+
const skip = details?.skip ?? data?.skip;
|
|
168
|
+
const todo = details?.todo ?? data?.todo;
|
|
169
|
+
const isExpectedTodoFailure = todo && failed;
|
|
170
|
+
const status = skip || isExpectedTodoFailure ? 'SKIP' : failed ? 'FAIL' : 'PASS';
|
|
171
|
+
counts[status] += 1;
|
|
172
|
+
if (status !== 'PASS')
|
|
173
|
+
yield fmtNodeResult(e, status);
|
|
174
|
+
}
|
|
175
|
+
const total = summaryCounts?.tests ?? enqueued;
|
|
176
|
+
const finalCompleted = summaryCounts?.tests ?? completed;
|
|
177
|
+
if (summaryCounts) {
|
|
178
|
+
counts.PASS = summaryCounts.passed ?? counts.PASS;
|
|
179
|
+
counts.FAIL = summaryCounts.failed ?? counts.FAIL;
|
|
180
|
+
counts.SKIP = (summaryCounts.skipped ?? 0) + (summaryCounts.todo ?? 0) + (summaryCounts.cancelled ?? 0);
|
|
181
|
+
}
|
|
182
|
+
if (!hasProgress && total === 0)
|
|
183
|
+
qualityProgress('Cases', 0, 0, reportProgress, { finalize: true });
|
|
184
|
+
else if (lastProgressCompleted === finalCompleted && lastProgressTotal === total)
|
|
185
|
+
reportProgress('\n');
|
|
186
|
+
else
|
|
187
|
+
qualityProgress('Cases', finalCompleted, total, reportProgress, { finalize: true });
|
|
188
|
+
if (finalCompleted < total)
|
|
189
|
+
yield `Node tests incomplete: ${total - finalCompleted} enqueued cases did not report a result\n`;
|
|
190
|
+
yield `Node tests: ${counts.PASS} passed, ${counts.FAIL} failed, ${counts.SKIP} skipped\n`;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Uses the shared reporter once in each test-runner process tree.
|
|
194
|
+
*
|
|
195
|
+
* Node propagates NODE_OPTIONS to isolated test workers and nested child
|
|
196
|
+
* processes. The first runner owns progress; nested runners drain their event
|
|
197
|
+
* streams so they cannot replay the same suite output.
|
|
198
|
+
*
|
|
199
|
+
* @param src Node.js test event stream.
|
|
200
|
+
* @param opts Optional writer used by focused tests; opaque reporter arguments are ignored.
|
|
201
|
+
*
|
|
202
|
+
* @return The per-case result lines accepted by the Node reporter API.
|
|
203
|
+
*/
|
|
204
|
+
async function* defaultQualityNodeReporter(src, opts) {
|
|
205
|
+
const isTestWorker = process.env.NODE_TEST_CONTEXT === 'child-v8';
|
|
206
|
+
const ownsReporter = process.env.TERRA_QUALITY_NODE_REPORTER_OWNER === '1' && !isTestWorker;
|
|
207
|
+
if (isTestWorker)
|
|
208
|
+
delete process.env.TERRA_QUALITY_NODE_REPORTER_OWNER;
|
|
209
|
+
if (!ownsReporter) {
|
|
210
|
+
for await (const _event of src)
|
|
211
|
+
void _event;
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
yield* qualityNodeReporter(src, opts);
|
|
215
|
+
}
|
|
216
|
+
export default defaultQualityNodeReporter;
|
|
217
|
+
//# sourceMappingURL=node-reporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-reporter.js","sourceRoot":"","sources":["../src/node-reporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;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iCAAiC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;IAC5F,IAAI,YAAY;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC;IACvE,IAAI,CAAC,YAAY,EAAE,CAAC;QACnB,IAAI,KAAK,EAAE,MAAM,MAAM,IAAI,GAAG;YAAE,KAAK,MAAM,CAAC;QAC5C,OAAO;IACR,CAAC;IACD,KAAK,CAAC,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC;AACD,eAAe,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* packages/quality/src/playwright-reporter.ts
|
|
3
|
+
* Structural Playwright reporter for per-test progress and final results.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Status values reported by Playwright for an individual test attempt.
|
|
7
|
+
*/
|
|
8
|
+
type PlaywrightStatus = 'passed' | 'failed' | 'timedOut' | 'skipped' | 'interrupted';
|
|
9
|
+
/**
|
|
10
|
+
* Result data retained for one Playwright test attempt.
|
|
11
|
+
*/
|
|
12
|
+
type PlaywrightTestResult = {
|
|
13
|
+
status: PlaywrightStatus;
|
|
14
|
+
retry: number;
|
|
15
|
+
error?: {
|
|
16
|
+
message?: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Structural test data needed to report progress without importing Playwright.
|
|
21
|
+
*/
|
|
22
|
+
type PlaywrightTestCase = {
|
|
23
|
+
title: string;
|
|
24
|
+
titlePath?: () => string[];
|
|
25
|
+
expectedStatus?: PlaywrightStatus;
|
|
26
|
+
retries?: number;
|
|
27
|
+
results?: PlaywrightTestResult[];
|
|
28
|
+
outcome?: () => 'skipped' | 'expected' | 'unexpected' | 'flaky';
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Minimal Playwright suite contract used to enumerate discovered tests.
|
|
32
|
+
*/
|
|
33
|
+
type PlaywrightSuite = {
|
|
34
|
+
allTests(): PlaywrightTestCase[];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Final run status passed to the Playwright reporter's `onEnd` callback.
|
|
38
|
+
*/
|
|
39
|
+
type PlaywrightFullResult = {
|
|
40
|
+
status: 'passed' | 'failed' | 'timedout' | 'interrupted';
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Optional output sinks for the Playwright progress reporter.
|
|
44
|
+
*/
|
|
45
|
+
export type QualityPlaywrightReporterOptions = {
|
|
46
|
+
write?: (text: string) => void;
|
|
47
|
+
writeProgress?: (text: string) => void;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Playwright reporter that counts tests once and prints final results in
|
|
51
|
+
* discovery order. Playwright is structural here and remains a peer runtime
|
|
52
|
+
* supplied by the consuming project.
|
|
53
|
+
*/
|
|
54
|
+
export default class QualityPlaywrightReporter {
|
|
55
|
+
private readonly write;
|
|
56
|
+
private readonly writeProgress;
|
|
57
|
+
private tests;
|
|
58
|
+
private readonly started;
|
|
59
|
+
private readonly finished;
|
|
60
|
+
private readonly lastResults;
|
|
61
|
+
/**
|
|
62
|
+
* Creates a reporter with optional output sinks.
|
|
63
|
+
*
|
|
64
|
+
* @param opts Optional sinks for output and progress.
|
|
65
|
+
*/
|
|
66
|
+
constructor(opts?: QualityPlaywrightReporterOptions);
|
|
67
|
+
/**
|
|
68
|
+
* Initializes progress from the discovered test cases.
|
|
69
|
+
*
|
|
70
|
+
* @param _config Playwright's resolved configuration.
|
|
71
|
+
* @param suite Root test suite supplied by Playwright.
|
|
72
|
+
*/
|
|
73
|
+
onBegin(_config: unknown, suite: PlaywrightSuite): void;
|
|
74
|
+
/**
|
|
75
|
+
* Records that a test has started; retries reuse the same test identity.
|
|
76
|
+
*
|
|
77
|
+
* @param test Playwright test case.
|
|
78
|
+
*/
|
|
79
|
+
onTestBegin(test: PlaywrightTestCase): void;
|
|
80
|
+
/**
|
|
81
|
+
* Stores the latest attempt and advances progress only when no retry remains.
|
|
82
|
+
*
|
|
83
|
+
* @param test Playwright test case.
|
|
84
|
+
* @param result Result for this attempt.
|
|
85
|
+
*/
|
|
86
|
+
onTestEnd(test: PlaywrightTestCase, result: PlaywrightTestResult): void;
|
|
87
|
+
/**
|
|
88
|
+
* Resolves tests not observed in onTestEnd, then emits one ordered result and summary.
|
|
89
|
+
*
|
|
90
|
+
* @param result Final Playwright run result.
|
|
91
|
+
*/
|
|
92
|
+
onEnd(result: PlaywrightFullResult): void;
|
|
93
|
+
/**
|
|
94
|
+
* Confirms this reporter owns terminal output so Playwright does not add another reporter.
|
|
95
|
+
*
|
|
96
|
+
* @return True because this reporter writes result lines and a summary.
|
|
97
|
+
*/
|
|
98
|
+
printsToStdio(): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Adds a test to the completed set once and updates the shared progress bar.
|
|
101
|
+
*
|
|
102
|
+
* @param test Completed Playwright test case.
|
|
103
|
+
*/
|
|
104
|
+
private finish;
|
|
105
|
+
}
|
|
106
|
+
export {};
|
|
107
|
+
//# sourceMappingURL=playwright-reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright-reporter.d.ts","sourceRoot":"","sources":["../src/playwright-reporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;GAEG;AACH,KAAK,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,CAAC;AAKrF;;GAEG;AACH,KAAK,oBAAoB,GAAG;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC;AACtG;;GAEG;AACH,KAAK,kBAAkB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,gBAA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AoB,GAAG,IAAI;IAazC;;;;OAIG;IACH,aAAa,IAAI,OAAO;IAIxB;;;;OAIG;IACH,OAAO,CAAC,MAAM;CAKd"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* packages/quality/src/playwright-reporter.ts
|
|
3
|
+
* Structural Playwright reporter for per-test progress and final results.
|
|
4
|
+
*/
|
|
5
|
+
/*//////////////////////////////////////////////////
|
|
6
|
+
IMPORTS
|
|
7
|
+
//////////////////////////////////////////////////*/
|
|
8
|
+
// API
|
|
9
|
+
import { qualityProgress } from './progress.js';
|
|
10
|
+
/*//////////////////////////////////////////////////
|
|
11
|
+
HELPERS
|
|
12
|
+
//////////////////////////////////////////////////*/
|
|
13
|
+
/**
|
|
14
|
+
* Resolves a completed Playwright test to one of the supported case statuses.
|
|
15
|
+
*
|
|
16
|
+
* @param test Playwright test case.
|
|
17
|
+
* @param result Last result recorded for the test, if it ran.
|
|
18
|
+
*
|
|
19
|
+
* @return Normalized pass, fail, or skip status.
|
|
20
|
+
*/
|
|
21
|
+
function qualityStatus(test, result) {
|
|
22
|
+
if (!result || result.status === 'skipped' || test.expectedStatus === 'skipped')
|
|
23
|
+
return 'SKIP';
|
|
24
|
+
const outcome = test.outcome?.();
|
|
25
|
+
if (outcome === 'skipped')
|
|
26
|
+
return 'SKIP';
|
|
27
|
+
if (outcome === 'expected' || outcome === 'flaky')
|
|
28
|
+
return 'PASS';
|
|
29
|
+
if (outcome === 'unexpected')
|
|
30
|
+
return 'FAIL';
|
|
31
|
+
if (result.status === (test.expectedStatus ?? 'passed'))
|
|
32
|
+
return 'PASS';
|
|
33
|
+
return result.status === 'passed' || result.status === 'failed' || result.status === 'timedOut' || result.status === 'interrupted' ? 'FAIL' : 'SKIP';
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Returns a stable display name for a test, including its suite path when present.
|
|
37
|
+
*
|
|
38
|
+
* @param test Playwright test case.
|
|
39
|
+
*
|
|
40
|
+
* @return A deterministic display name.
|
|
41
|
+
*/
|
|
42
|
+
function testName(test) {
|
|
43
|
+
const titlePath = test.titlePath?.();
|
|
44
|
+
return titlePath?.length ? titlePath.join(' › ') : test.title;
|
|
45
|
+
}
|
|
46
|
+
/*//////////////////////////////////////////////////
|
|
47
|
+
REPORTER
|
|
48
|
+
//////////////////////////////////////////////////*/
|
|
49
|
+
/**
|
|
50
|
+
* Playwright reporter that counts tests once and prints final results in
|
|
51
|
+
* discovery order. Playwright is structural here and remains a peer runtime
|
|
52
|
+
* supplied by the consuming project.
|
|
53
|
+
*/
|
|
54
|
+
export default class QualityPlaywrightReporter {
|
|
55
|
+
write;
|
|
56
|
+
writeProgress;
|
|
57
|
+
tests = [];
|
|
58
|
+
started = new Set();
|
|
59
|
+
finished = new Set();
|
|
60
|
+
lastResults = new Map();
|
|
61
|
+
/**
|
|
62
|
+
* Creates a reporter with optional output sinks.
|
|
63
|
+
*
|
|
64
|
+
* @param opts Optional sinks for output and progress.
|
|
65
|
+
*/
|
|
66
|
+
constructor(opts = {}) {
|
|
67
|
+
this.write = opts.write ?? ((text) => void process.stdout.write(text));
|
|
68
|
+
this.writeProgress = opts.writeProgress ?? ((text) => void process.stderr.write(text));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Initializes progress from the discovered test cases.
|
|
72
|
+
*
|
|
73
|
+
* @param _config Playwright's resolved configuration.
|
|
74
|
+
* @param suite Root test suite supplied by Playwright.
|
|
75
|
+
*/
|
|
76
|
+
onBegin(_config, suite) {
|
|
77
|
+
this.tests = suite.allTests();
|
|
78
|
+
qualityProgress('Cases', 0, this.tests.length, this.writeProgress);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Records that a test has started; retries reuse the same test identity.
|
|
82
|
+
*
|
|
83
|
+
* @param test Playwright test case.
|
|
84
|
+
*/
|
|
85
|
+
onTestBegin(test) {
|
|
86
|
+
this.started.add(test);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Stores the latest attempt and advances progress only when no retry remains.
|
|
90
|
+
*
|
|
91
|
+
* @param test Playwright test case.
|
|
92
|
+
* @param result Result for this attempt.
|
|
93
|
+
*/
|
|
94
|
+
onTestEnd(test, result) {
|
|
95
|
+
this.lastResults.set(test, result);
|
|
96
|
+
const canRetry = (result.status === 'failed' || result.status === 'timedOut') && result.retry < (test.retries ?? 0) && test.expectedStatus !== result.status;
|
|
97
|
+
if (!canRetry)
|
|
98
|
+
this.finish(test);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Resolves tests not observed in onTestEnd, then emits one ordered result and summary.
|
|
102
|
+
*
|
|
103
|
+
* @param result Final Playwright run result.
|
|
104
|
+
*/
|
|
105
|
+
onEnd(result) {
|
|
106
|
+
const counts = { PASS: 0, FAIL: 0, SKIP: 0 };
|
|
107
|
+
for (const test of this.tests) {
|
|
108
|
+
const latestResult = this.lastResults.get(test) ?? test.results?.at(-1);
|
|
109
|
+
const status = this.started.has(test) && !latestResult ? 'FAIL' : qualityStatus(test, latestResult);
|
|
110
|
+
counts[status] += 1;
|
|
111
|
+
const msg = status === 'FAIL' ? latestResult?.error?.message?.replace(/\s+/gu, ' ').trim() : undefined;
|
|
112
|
+
if (status !== 'PASS')
|
|
113
|
+
this.write(` [${status}] ${testName(test)}${msg ? ` — ${msg}` : ''}\n`);
|
|
114
|
+
this.finish(test);
|
|
115
|
+
}
|
|
116
|
+
this.write(`Playwright ${result.status}: ${counts.PASS} passed, ${counts.FAIL} failed, ${counts.SKIP} skipped\n`);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Confirms this reporter owns terminal output so Playwright does not add another reporter.
|
|
120
|
+
*
|
|
121
|
+
* @return True because this reporter writes result lines and a summary.
|
|
122
|
+
*/
|
|
123
|
+
printsToStdio() {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Adds a test to the completed set once and updates the shared progress bar.
|
|
128
|
+
*
|
|
129
|
+
* @param test Completed Playwright test case.
|
|
130
|
+
*/
|
|
131
|
+
finish(test) {
|
|
132
|
+
if (this.finished.has(test))
|
|
133
|
+
return;
|
|
134
|
+
this.finished.add(test);
|
|
135
|
+
qualityProgress('Cases', this.finished.size, this.tests.length, this.writeProgress);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=playwright-reporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright-reporter.js","sourceRoot":"","sources":["../src/playwright-reporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;oDAEoD;AAEpD,MAAM;AACN,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA0ChD;;oDAEoD;AAEpD;;;;;;;GAOG;AACH,SAAS,aAAa,CAAC,IAAwB,EAAE,MAA6B;IAC7E,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IAC/F,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IACjC,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACzC,IAAI,OAAO,KAAK,UAAU,IAAI,OAAO,KAAK,OAAO;QAAE,OAAO,MAAM,CAAC;IACjE,IAAI,OAAO,KAAK,YAAY;QAAE,OAAO,MAAM,CAAC;IAC5C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,cAAc,IAAI,QAAQ,CAAC;QAAE,OAAO,MAAM,CAAC;IACvE,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;AACtJ,CAAC;AAED;;;;;;GAMG;A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K,CAAC,MAAM,MAAM,KAAK,QAAQ,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YAChG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,cAAc,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,YAAY,MAAM,CAAC,IAAI,YAAY,MAAM,CAAC,IAAI,YAAY,CAAC,CAAC;IACnH,CAAC;IAED;;;;OAIG;IACH,aAAa;QACZ,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,IAAwB;QACtC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACrF,CAAC;CACD"}
|
package/dist/progress.d.ts
CHANGED
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
* @param curr Number of completed units.
|
|
10
10
|
* @param total Total units, or zero when there is no work to process.
|
|
11
11
|
* @param write Optional output writer used by tests; production writes to standard error.
|
|
12
|
+
* @param opts Optional line-finalization policy for streams with late discoveries.
|
|
12
13
|
*
|
|
13
|
-
* @return Nothing; the progress bar is written to standard error and
|
|
14
|
+
* @return Nothing; the progress bar is written to standard error and may end with a newline.
|
|
14
15
|
*/
|
|
15
|
-
export declare function qualityProgress(label: string, curr: number, total: number, write?: (text: string) => void
|
|
16
|
+
export declare function qualityProgress(label: string, curr: number, total: number, write?: (text: string) => void, opts?: {
|
|
17
|
+
finalize?: boolean;
|
|
18
|
+
}): void;
|
|
16
19
|
//# sourceMappingURL=progress.d.ts.map
|