@lde/pipeline-console-reporter 0.11.0 → 0.12.1
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Dataset, Distribution } from '@lde/dataset';
|
|
2
|
-
import type { DistributionAnalysisResult, ProgressReporter } from '@lde/pipeline';
|
|
2
|
+
import type { DistributionAnalysisResult, ProgressReporter, ValidationReport } from '@lde/pipeline';
|
|
3
3
|
export declare class ConsoleReporter implements ProgressReporter {
|
|
4
4
|
private stageSpinner?;
|
|
5
5
|
private stageStartTime;
|
|
@@ -27,6 +27,7 @@ export declare class ConsoleReporter implements ProgressReporter {
|
|
|
27
27
|
duration: number;
|
|
28
28
|
}): void;
|
|
29
29
|
stageFailed(_stage: string, error: Error): void;
|
|
30
|
+
stageValidated(_stage: string, report: ValidationReport): void;
|
|
30
31
|
stageSkipped(_stage: string, reason: string): void;
|
|
31
32
|
datasetComplete(_dataset: Dataset): void;
|
|
32
33
|
datasetSkipped(_dataset: Dataset, reason: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consoleReporter.d.ts","sourceRoot":"","sources":["../src/consoleReporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EACV,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAUvB,qBAAa,eAAgB,YAAW,gBAAgB;IACtD,OAAO,CAAC,YAAY,CAAC,CAAM;IAC3B,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,aAAa,CAAC,CAAM;IAC5B,OAAO,CAAC,WAAW,CAAC,CAAiC;IAErD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,I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CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM/B,aAAa,CAAC,MAAM,EAAE;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,IAAI;IAWR,aAAa,CACX,MAAM,EAAE,MAAM,EACd,MAAM,EAAE;QACN,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;KAClB,GACA,IAAI;IAUP,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAQ/C,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAa9D,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAQlD,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAUxC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAQvD,gBAAgB,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAOrD"}
|
package/dist/consoleReporter.js
CHANGED
|
@@ -46,8 +46,7 @@ export class ConsoleReporter {
|
|
|
46
46
|
const s = ora({ discardStdin: false });
|
|
47
47
|
if (result.available) {
|
|
48
48
|
const detail = result.statusCode !== undefined ? ` (HTTP ${result.statusCode})` : '';
|
|
49
|
-
s.
|
|
50
|
-
s.succeed();
|
|
49
|
+
s.succeed(`${typeLabel} ${url}${detail}`);
|
|
51
50
|
}
|
|
52
51
|
else {
|
|
53
52
|
const detail = result.error
|
|
@@ -55,8 +54,7 @@ export class ConsoleReporter {
|
|
|
55
54
|
: result.statusCode !== undefined
|
|
56
55
|
? ` (HTTP ${result.statusCode})`
|
|
57
56
|
: '';
|
|
58
|
-
s.
|
|
59
|
-
s.fail();
|
|
57
|
+
s.fail(`${typeLabel} ${url}${detail}`);
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
60
|
importStarted() {
|
|
@@ -93,8 +91,7 @@ export class ConsoleReporter {
|
|
|
93
91
|
}
|
|
94
92
|
else {
|
|
95
93
|
const s = ora({ discardStdin: false });
|
|
96
|
-
s.
|
|
97
|
-
s.succeed();
|
|
94
|
+
s.succeed(`${distribution.accessUrl.toString()} ${chalk.dim('(selected)')}`);
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
97
|
clearImportSpinner() {
|
|
@@ -129,6 +126,15 @@ export class ConsoleReporter {
|
|
|
129
126
|
this.stageSpinner = undefined;
|
|
130
127
|
}
|
|
131
128
|
}
|
|
129
|
+
stageValidated(_stage, report) {
|
|
130
|
+
const s = ora({ discardStdin: false });
|
|
131
|
+
if (report.conforms) {
|
|
132
|
+
s.succeed(`Validated ${compactNumber.format(report.quadsValidated)} quads`);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
s.fail(`Validated ${compactNumber.format(report.quadsValidated)} quads: ${chalk.red(`${compactNumber.format(report.violations)} violation(s)`)}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
132
138
|
stageSkipped(_stage, reason) {
|
|
133
139
|
if (this.stageSpinner) {
|
|
134
140
|
this.stageSpinner.suffixText = `skipped: ${chalk.red(reason)}`;
|
|
@@ -140,14 +146,14 @@ export class ConsoleReporter {
|
|
|
140
146
|
const s = ora({
|
|
141
147
|
discardStdin: false,
|
|
142
148
|
text: `Completed in ${chalk.bold(prettyMilliseconds(Date.now() - this.datasetStartTime))}`,
|
|
143
|
-
})
|
|
149
|
+
});
|
|
144
150
|
s.succeed();
|
|
145
151
|
}
|
|
146
152
|
datasetSkipped(_dataset, reason) {
|
|
147
153
|
const s = ora({
|
|
148
154
|
discardStdin: false,
|
|
149
155
|
text: `Skipped: ${chalk.red(reason)}`,
|
|
150
|
-
})
|
|
156
|
+
});
|
|
151
157
|
s.fail();
|
|
152
158
|
}
|
|
153
159
|
pipelineComplete(result) {
|