@lde/pipeline-console-reporter 0.18.0 → 0.19.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.
@@ -8,7 +8,7 @@ export declare class ConsoleReporter implements ProgressReporter {
8
8
  private datasetIndex;
9
9
  private importTimer?;
10
10
  private probeLines;
11
- /** Print a static succeed/fail line without starting a spinner animation. */
11
+ /** Print a static line with a symbol prefix. */
12
12
  private printLine;
13
13
  /** Stop any active spinner and start a new one. */
14
14
  private startSpinner;
@@ -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,EAChB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAgBvB,qBAAa,eAAgB,YAAW,gBAAgB;IACtD,OAAO,CAAC,aAAa,CAAC,CAAM;IAC5B,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,WAAW,CAAC,CAAiC;IACrD,OAAO,CAAC,UAAU,CAAuC;IAEzD,6EAA6E;IAC7E,OAAO,CAAC,SAAS;IAKjB,mDAAmD;IACnD,OAAO,CAAC,YAAY;IAOpB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIlC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IASvD,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAgBpC,kBAAkB,CAAC,MAAM,EAAE,0BAA0B,GAAG,IAAI;IA0B5D,aAAa,IAAI,IAAI;IAUrB,YAAY,CAAC,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,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,aAAa,EAAE,MAAM,CAAC;KACvB,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;IAc9D,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAQlD,eAAe,CACb,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAC1D,IAAI;IASP,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAIvD,gBAAgB,CAAC,MAAM,EAAE;QACvB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;QACzB,aAAa,EAAE,MAAM,CAAC;KACvB,GAAG,IAAI;CAOT"}
@@ -18,9 +18,8 @@ export class ConsoleReporter {
18
18
  datasetIndex = 0;
19
19
  importTimer;
20
20
  probeLines = [];
21
- /** Print a static succeed/fail line without starting a spinner animation. */
22
- printLine(method, text) {
23
- const symbol = method === 'succeed' ? logSymbols.success : logSymbols.error;
21
+ /** Print a static line with a symbol prefix. */
22
+ printLine(symbol, text) {
24
23
  process.stderr.write(`${symbol} ${text}\n`);
25
24
  }
26
25
  /** Stop any active spinner and start a new one. */
@@ -61,8 +60,11 @@ export class ConsoleReporter {
61
60
  if (result.available) {
62
61
  const detail = result.statusCode !== undefined ? ` (HTTP ${result.statusCode})` : '';
63
62
  const text = `${typeLabel} ${url}${detail}`;
64
- this.printLine('succeed', text);
63
+ this.printLine(logSymbols.success, text);
65
64
  this.probeLines.push({ url, text });
65
+ for (const warning of result.warnings) {
66
+ this.printLine(logSymbols.warning, warning);
67
+ }
66
68
  }
67
69
  else {
68
70
  const detail = result.error
@@ -70,7 +72,7 @@ export class ConsoleReporter {
70
72
  : result.statusCode !== undefined
71
73
  ? ` (HTTP ${result.statusCode})`
72
74
  : '';
73
- this.printLine('fail', `${typeLabel} ${url}${detail}`);
75
+ this.printLine(logSymbols.error, `${typeLabel} ${url}${detail}`);
74
76
  this.probeLines.push({ url, text: '' });
75
77
  }
76
78
  }
@@ -90,7 +92,7 @@ export class ConsoleReporter {
90
92
  this.activeSpinner.fail();
91
93
  }
92
94
  else {
93
- this.printLine('fail', `Import failed: ${error}`);
95
+ this.printLine(logSymbols.error, `Import failed: ${error}`);
94
96
  }
95
97
  this.clearImportTimer();
96
98
  this.activeSpinner = undefined;
@@ -110,7 +112,7 @@ export class ConsoleReporter {
110
112
  this.activeSpinner.succeed();
111
113
  }
112
114
  else {
113
- this.printLine('succeed', text);
115
+ this.printLine(logSymbols.success, text);
114
116
  }
115
117
  this.clearImportTimer();
116
118
  this.activeSpinner = undefined;
@@ -125,14 +127,14 @@ export class ConsoleReporter {
125
127
  const linesUp = this.probeLines.length - this.probeLines.indexOf(probe);
126
128
  // Move cursor up to the probe line and clear it.
127
129
  process.stderr.write(`\x1B[${linesUp}A\x1B[2K\r`);
128
- this.printLine('succeed', selectedText);
130
+ this.printLine(logSymbols.success, selectedText);
129
131
  // Move cursor back down to original position.
130
132
  if (linesUp > 1) {
131
133
  process.stderr.write(`\x1B[${linesUp - 1}B`);
132
134
  }
133
135
  }
134
136
  else {
135
- this.printLine('succeed', selectedText);
137
+ this.printLine(logSymbols.success, selectedText);
136
138
  }
137
139
  }
138
140
  }
@@ -185,7 +187,7 @@ export class ConsoleReporter {
185
187
  this.printLine('succeed', `Completed in ${chalk.bold(prettyMilliseconds(Date.now() - this.datasetStartTime))} ${chalk.dim(`(memory: ${formatBytes(result.memoryUsageBytes)} RSS, ${formatBytes(result.heapUsedBytes)} heap)`)}`);
186
188
  }
187
189
  datasetSkipped(_dataset, reason) {
188
- this.printLine('fail', `Skipped: ${chalk.red(reason)}`);
190
+ this.printLine(logSymbols.error, `Skipped: ${chalk.red(reason)}`);
189
191
  }
190
192
  pipelineComplete(result) {
191
193
  process.stderr.write(`\nPipeline completed in ${chalk.bold(prettyMilliseconds(result.duration))} ${chalk.dim(`(memory: ${formatBytes(result.memoryUsageBytes)} RSS, ${formatBytes(result.heapUsedBytes)} heap)`)}\n`);
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@lde/pipeline-console-reporter",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "Console progress reporter for @lde/pipeline",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/ldelements/lde.git",
7
7
  "directory": "packages/pipeline-console-reporter"
8
8
  },
9
+ "license": "MIT",
9
10
  "type": "module",
10
11
  "exports": {
11
12
  "./package.json": "./package.json",
@@ -32,6 +33,6 @@
32
33
  },
33
34
  "peerDependencies": {
34
35
  "@lde/dataset": "0.7.2",
35
- "@lde/pipeline": "0.27.0"
36
+ "@lde/pipeline": "0.28.0"
36
37
  }
37
38
  }