@atlaspack/reporter-cli 2.17.3-typescript-5b4d3ad41.0 → 2.17.3
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/lib/CLIReporter.js +2 -11
- package/lib/bundleReport.js +1 -4
- package/lib/render.js +3 -3
- package/package.json +10 -15
- package/src/{CLIReporter.ts → CLIReporter.js} +9 -13
- package/src/{bundleReport.ts → bundleReport.js} +3 -4
- package/src/{emoji.ts → emoji.js} +2 -0
- package/src/{logLevels.ts → logLevels.js} +3 -1
- package/src/{phaseReport.ts → phaseReport.js} +3 -2
- package/src/{render.ts → render.js} +7 -7
- package/src/{utils.ts → utils.js} +1 -0
- package/test/{CLIReporter.test.ts → CLIReporter.test.js} +14 -15
- package/LICENSE +0 -201
- package/lib/CLIReporter.d.ts +0 -5
- package/lib/bundleReport.d.ts +0 -3
- package/lib/emoji.d.ts +0 -7
- package/lib/logLevels.d.ts +0 -10
- package/lib/phaseReport.d.ts +0 -3
- package/lib/render.d.ts +0 -14
- package/lib/utils.d.ts +0 -5
- package/tsconfig.json +0 -4
package/CHANGELOG.md
CHANGED
package/lib/CLIReporter.js
CHANGED
|
@@ -49,8 +49,6 @@ function _wrapAnsi() {
|
|
|
49
49
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
50
50
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
51
51
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
52
|
-
// @ts-expect-error TS7016
|
|
53
|
-
|
|
54
52
|
const THROTTLE_DELAY = 100;
|
|
55
53
|
const seenWarnings = new Set();
|
|
56
54
|
const seenPhases = new Set();
|
|
@@ -210,15 +208,12 @@ async function _report(event, options) {
|
|
|
210
208
|
await writeDiagnostic(options, event.diagnostics, 'red', true);
|
|
211
209
|
break;
|
|
212
210
|
default:
|
|
213
|
-
// @ts-expect-error TS2339
|
|
214
211
|
throw new Error('Unknown log level ' + event.level);
|
|
215
212
|
}
|
|
216
213
|
}
|
|
217
214
|
}
|
|
218
215
|
}
|
|
219
|
-
async function writeDiagnostic(options, diagnostics,
|
|
220
|
-
// @ts-expect-error TS2749
|
|
221
|
-
color, isError = false) {
|
|
216
|
+
async function writeDiagnostic(options, diagnostics, color, isError = false) {
|
|
222
217
|
let columns = (0, _utils2.getTerminalWidth)().columns;
|
|
223
218
|
let indent = 2;
|
|
224
219
|
let spaceAfter = isError;
|
|
@@ -230,7 +225,7 @@ color, isError = false) {
|
|
|
230
225
|
hints,
|
|
231
226
|
documentation
|
|
232
227
|
} = await (0, _utils().prettyDiagnostic)(diagnostic, options, columns - indent);
|
|
233
|
-
//
|
|
228
|
+
// $FlowFixMe[incompatible-use]
|
|
234
229
|
message = _chalk().default[color](message);
|
|
235
230
|
if (spaceAfter) {
|
|
236
231
|
(0, _render.writeOut)('');
|
|
@@ -259,8 +254,6 @@ color, isError = false) {
|
|
|
259
254
|
if (documentation) {
|
|
260
255
|
(0, _render.writeOut)(wrapWithIndent(`${emoji.docs} ${_chalk().default.magenta.bold(documentation)}`, hintIndent + 3, hintIndent));
|
|
261
256
|
}
|
|
262
|
-
|
|
263
|
-
// @ts-expect-error TS2322
|
|
264
257
|
spaceAfter = stack || codeframe || hints.length > 0 || documentation;
|
|
265
258
|
}
|
|
266
259
|
if (spaceAfter) {
|
|
@@ -273,8 +266,6 @@ function wrapWithIndent(string, indent = 0, initialIndent = indent) {
|
|
|
273
266
|
trim: false
|
|
274
267
|
}), indent, initialIndent);
|
|
275
268
|
}
|
|
276
|
-
|
|
277
|
-
// @ts-expect-error TS7006
|
|
278
269
|
function indentString(string, indent = 0, initialIndent = indent) {
|
|
279
270
|
return ' '.repeat(initialIndent) + string.replace(/\n/g, '\n' + ' '.repeat(indent));
|
|
280
271
|
}
|
package/lib/bundleReport.js
CHANGED
|
@@ -75,9 +75,7 @@ async function bundleReport(bundleGraph, fs, projectRoot, assetCount = 0) {
|
|
|
75
75
|
if (assetCount > 0) {
|
|
76
76
|
let largestAssets = bundle.assets.slice(0, assetCount);
|
|
77
77
|
for (let asset of largestAssets) {
|
|
78
|
-
let columns = [asset == largestAssets[largestAssets.length - 1] ? '└── ' : '├── ',
|
|
79
|
-
// @ts-expect-error TS2554
|
|
80
|
-
_chalk().default.dim(prettifySize(asset.size)), _chalk().default.dim(_chalk().default.green((0, _utils().prettifyTime)(asset.time)))];
|
|
78
|
+
let columns = [asset == largestAssets[largestAssets.length - 1] ? '└── ' : '├── ', _chalk().default.dim(prettifySize(asset.size)), _chalk().default.dim(_chalk().default.green((0, _utils().prettifyTime)(asset.time)))];
|
|
81
79
|
if (asset.filePath !== '') {
|
|
82
80
|
columns[0] += (0, _utils2.formatFilename)(asset.filePath, _chalk().default.reset);
|
|
83
81
|
} else {
|
|
@@ -100,7 +98,6 @@ async function bundleReport(bundleGraph, fs, projectRoot, assetCount = 0) {
|
|
|
100
98
|
|
|
101
99
|
// Render table
|
|
102
100
|
(0, _render.writeOut)('');
|
|
103
|
-
// @ts-expect-error TS2345
|
|
104
101
|
(0, _render.table)(COLUMNS, rows);
|
|
105
102
|
}
|
|
106
103
|
function prettifySize(size, isLarge) {
|
package/lib/render.js
CHANGED
|
@@ -37,7 +37,9 @@ var emoji = _interopRequireWildcard(require("./emoji"));
|
|
|
37
37
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
38
38
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
39
39
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
|
-
const isTTY = exports.isTTY =
|
|
40
|
+
const isTTY = exports.isTTY =
|
|
41
|
+
// $FlowFixMe
|
|
42
|
+
process.env.NODE_ENV !== 'test' && process.stdout.isTTY;
|
|
41
43
|
let stdout = process.stdout;
|
|
42
44
|
let stderr = process.stderr;
|
|
43
45
|
|
|
@@ -53,9 +55,7 @@ let lineCount = 0;
|
|
|
53
55
|
let errorLineCount = 0;
|
|
54
56
|
let statusPersisted = false;
|
|
55
57
|
function _setStdio(stdoutLike, stderrLike) {
|
|
56
|
-
// @ts-expect-error TS2322
|
|
57
58
|
stdout = stdoutLike;
|
|
58
|
-
// @ts-expect-error TS2322
|
|
59
59
|
stderr = stderrLike;
|
|
60
60
|
}
|
|
61
61
|
let spinner = (0, _ora().default)({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/reporter-cli",
|
|
3
|
-
"version": "2.17.3
|
|
3
|
+
"version": "2.17.3",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
|
11
11
|
},
|
|
12
|
-
"main": "
|
|
13
|
-
"source": "
|
|
14
|
-
"types": "./lib/CLIReporter.d.ts",
|
|
12
|
+
"main": "lib/CLIReporter.js",
|
|
13
|
+
"source": "src/CLIReporter.js",
|
|
15
14
|
"engines": {
|
|
16
15
|
"node": ">= 16.0.0"
|
|
17
16
|
},
|
|
@@ -27,23 +26,19 @@
|
|
|
27
26
|
}
|
|
28
27
|
},
|
|
29
28
|
"dependencies": {
|
|
30
|
-
"@atlaspack/plugin": "2.14.21
|
|
31
|
-
"@atlaspack/types": "2.15.11
|
|
32
|
-
"@atlaspack/utils": "2.17.3
|
|
29
|
+
"@atlaspack/plugin": "2.14.21",
|
|
30
|
+
"@atlaspack/types": "2.15.11",
|
|
31
|
+
"@atlaspack/utils": "2.17.3",
|
|
33
32
|
"chalk": "^4.1.0",
|
|
33
|
+
"term-size": "^2.2.1",
|
|
34
34
|
"filesize": "^6.1.0",
|
|
35
35
|
"nullthrows": "^1.1.1",
|
|
36
36
|
"ora": "^5.2.0",
|
|
37
37
|
"string-width": "^4.2.0",
|
|
38
|
-
"term-size": "^2.2.1",
|
|
39
38
|
"wrap-ansi": "^7.0.0"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
|
-
"@atlaspack/feature-flags": "2.
|
|
43
|
-
},
|
|
44
|
-
"type": "commonjs",
|
|
45
|
-
"scripts": {
|
|
46
|
-
"check-ts": "tsc --emitDeclarationOnly --rootDir src"
|
|
41
|
+
"@atlaspack/feature-flags": "2.20.0"
|
|
47
42
|
},
|
|
48
|
-
"
|
|
49
|
-
}
|
|
43
|
+
"type": "commonjs"
|
|
44
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import type {ReporterEvent, PluginOptions} from '@atlaspack/types';
|
|
2
3
|
import type {Diagnostic} from '@atlaspack/diagnostic';
|
|
3
4
|
import type {Color} from 'chalk';
|
|
@@ -27,7 +28,6 @@ import {
|
|
|
27
28
|
persistMessage,
|
|
28
29
|
} from './render';
|
|
29
30
|
import * as emoji from './emoji';
|
|
30
|
-
// @ts-expect-error TS7016
|
|
31
31
|
import wrapAnsi from 'wrap-ansi';
|
|
32
32
|
|
|
33
33
|
const THROTTLE_DELAY = 100;
|
|
@@ -35,7 +35,7 @@ const seenWarnings = new Set();
|
|
|
35
35
|
const seenPhases = new Set();
|
|
36
36
|
const seenPhasesGen = new Set();
|
|
37
37
|
|
|
38
|
-
let phaseStartTimes
|
|
38
|
+
let phaseStartTimes = {};
|
|
39
39
|
let pendingIncrementalBuild = false;
|
|
40
40
|
let packagingProgress = 0;
|
|
41
41
|
|
|
@@ -63,9 +63,9 @@ let statusThrottle = throttle((message: string) => {
|
|
|
63
63
|
updateSpinner(message);
|
|
64
64
|
}, THROTTLE_DELAY);
|
|
65
65
|
|
|
66
|
-
const cacheWriteState: {
|
|
67
|
-
startTime: number | null
|
|
68
|
-
} = {
|
|
66
|
+
const cacheWriteState: {|
|
|
67
|
+
startTime: number | null,
|
|
68
|
+
|} = {
|
|
69
69
|
startTime: null,
|
|
70
70
|
};
|
|
71
71
|
|
|
@@ -247,7 +247,6 @@ export async function _report(
|
|
|
247
247
|
await writeDiagnostic(options, event.diagnostics, 'red', true);
|
|
248
248
|
break;
|
|
249
249
|
default:
|
|
250
|
-
// @ts-expect-error TS2339
|
|
251
250
|
throw new Error('Unknown log level ' + event.level);
|
|
252
251
|
}
|
|
253
252
|
}
|
|
@@ -257,7 +256,6 @@ export async function _report(
|
|
|
257
256
|
async function writeDiagnostic(
|
|
258
257
|
options: PluginOptions,
|
|
259
258
|
diagnostics: Array<Diagnostic>,
|
|
260
|
-
// @ts-expect-error TS2749
|
|
261
259
|
color: Color,
|
|
262
260
|
isError: boolean = false,
|
|
263
261
|
) {
|
|
@@ -267,7 +265,7 @@ async function writeDiagnostic(
|
|
|
267
265
|
for (let diagnostic of diagnostics) {
|
|
268
266
|
let {message, stack, codeframe, hints, documentation} =
|
|
269
267
|
await prettyDiagnostic(diagnostic, options, columns - indent);
|
|
270
|
-
//
|
|
268
|
+
// $FlowFixMe[incompatible-use]
|
|
271
269
|
message = chalk[color](message);
|
|
272
270
|
|
|
273
271
|
if (spaceAfter) {
|
|
@@ -316,7 +314,6 @@ async function writeDiagnostic(
|
|
|
316
314
|
);
|
|
317
315
|
}
|
|
318
316
|
|
|
319
|
-
// @ts-expect-error TS2322
|
|
320
317
|
spaceAfter = stack || codeframe || hints.length > 0 || documentation;
|
|
321
318
|
}
|
|
322
319
|
|
|
@@ -325,7 +322,7 @@ async function writeDiagnostic(
|
|
|
325
322
|
}
|
|
326
323
|
}
|
|
327
324
|
|
|
328
|
-
function wrapWithIndent(string
|
|
325
|
+
function wrapWithIndent(string, indent = 0, initialIndent = indent) {
|
|
329
326
|
let width = getTerminalWidth().columns;
|
|
330
327
|
return indentString(
|
|
331
328
|
wrapAnsi(string.trimEnd(), width - indent, {trim: false}),
|
|
@@ -334,15 +331,14 @@ function wrapWithIndent(string: string, indent = 0, initialIndent = indent) {
|
|
|
334
331
|
);
|
|
335
332
|
}
|
|
336
333
|
|
|
337
|
-
// @ts-expect-error TS7006
|
|
338
334
|
function indentString(string, indent = 0, initialIndent = indent) {
|
|
339
335
|
return (
|
|
340
336
|
' '.repeat(initialIndent) + string.replace(/\n/g, '\n' + ' '.repeat(indent))
|
|
341
337
|
);
|
|
342
338
|
}
|
|
343
339
|
|
|
344
|
-
export default new Reporter({
|
|
340
|
+
export default (new Reporter({
|
|
345
341
|
report({event, options}) {
|
|
346
342
|
return _report(event, options);
|
|
347
343
|
},
|
|
348
|
-
})
|
|
344
|
+
}): Reporter);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import type {BundleGraph, FilePath, PackagedBundle} from '@atlaspack/types';
|
|
2
3
|
import type {FileSystem} from '@atlaspack/fs';
|
|
3
4
|
|
|
@@ -39,7 +40,7 @@ export default async function bundleReport(
|
|
|
39
40
|
};
|
|
40
41
|
}),
|
|
41
42
|
};
|
|
42
|
-
let rows
|
|
43
|
+
let rows = [];
|
|
43
44
|
|
|
44
45
|
for (let bundle of bundles) {
|
|
45
46
|
// Add a row for the bundle
|
|
@@ -54,7 +55,6 @@ export default async function bundleReport(
|
|
|
54
55
|
for (let asset of largestAssets) {
|
|
55
56
|
let columns: Array<string> = [
|
|
56
57
|
asset == largestAssets[largestAssets.length - 1] ? '└── ' : '├── ',
|
|
57
|
-
// @ts-expect-error TS2554
|
|
58
58
|
chalk.dim(prettifySize(asset.size)),
|
|
59
59
|
chalk.dim(chalk.green(prettifyTime(asset.time))),
|
|
60
60
|
];
|
|
@@ -87,11 +87,10 @@ export default async function bundleReport(
|
|
|
87
87
|
|
|
88
88
|
// Render table
|
|
89
89
|
writeOut('');
|
|
90
|
-
// @ts-expect-error TS2345
|
|
91
90
|
table(COLUMNS, rows);
|
|
92
91
|
}
|
|
93
92
|
|
|
94
|
-
function prettifySize(size
|
|
93
|
+
function prettifySize(size, isLarge) {
|
|
95
94
|
let res = filesize(size);
|
|
96
95
|
if (isLarge) {
|
|
97
96
|
return chalk.yellow(emoji.warning + ' ' + res);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import {prettifyTime} from '@atlaspack/utils';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
4
|
import {writeOut} from './render';
|
|
4
5
|
import invariant from 'assert';
|
|
5
6
|
|
|
6
|
-
export default function phaseReport(phaseStartTimes: {[
|
|
7
|
-
let phaseTimes
|
|
7
|
+
export default function phaseReport(phaseStartTimes: {[string]: number}) {
|
|
8
|
+
let phaseTimes = {};
|
|
8
9
|
if (phaseStartTimes['transforming'] && phaseStartTimes['bundling']) {
|
|
9
10
|
phaseTimes['Transforming'] =
|
|
10
11
|
phaseStartTimes['bundling'] - phaseStartTimes['transforming'];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @flow
|
|
1
2
|
import type {Writable} from 'stream';
|
|
2
3
|
|
|
3
4
|
import readline from 'readline';
|
|
@@ -8,11 +9,12 @@ import type {PadAlign} from './utils';
|
|
|
8
9
|
import {pad, countLines} from './utils';
|
|
9
10
|
import * as emoji from './emoji';
|
|
10
11
|
|
|
11
|
-
type ColumnType = {
|
|
12
|
-
align: PadAlign
|
|
13
|
-
};
|
|
12
|
+
type ColumnType = {|
|
|
13
|
+
align: PadAlign,
|
|
14
|
+
|};
|
|
14
15
|
|
|
15
16
|
export const isTTY: any | boolean | true =
|
|
17
|
+
// $FlowFixMe
|
|
16
18
|
process.env.NODE_ENV !== 'test' && process.stdout.isTTY;
|
|
17
19
|
|
|
18
20
|
let stdout = process.stdout;
|
|
@@ -31,9 +33,7 @@ let errorLineCount = 0;
|
|
|
31
33
|
let statusPersisted = false;
|
|
32
34
|
|
|
33
35
|
export function _setStdio(stdoutLike: Writable, stderrLike: Writable) {
|
|
34
|
-
// @ts-expect-error TS2322
|
|
35
36
|
stdout = stdoutLike;
|
|
36
|
-
// @ts-expect-error TS2322
|
|
37
37
|
stderr = stderrLike;
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -42,7 +42,7 @@ let spinner = ora({
|
|
|
42
42
|
stream: stdout,
|
|
43
43
|
discardStdin: false,
|
|
44
44
|
});
|
|
45
|
-
let persistedMessages
|
|
45
|
+
let persistedMessages = [];
|
|
46
46
|
|
|
47
47
|
export function writeOut(message: string, isError: boolean = false) {
|
|
48
48
|
let processedMessage = message + '\n';
|
|
@@ -132,7 +132,7 @@ export function resetWindow() {
|
|
|
132
132
|
|
|
133
133
|
export function table(columns: Array<ColumnType>, table: Array<Array<string>>) {
|
|
134
134
|
// Measure column widths
|
|
135
|
-
let colWidths
|
|
135
|
+
let colWidths = [];
|
|
136
136
|
for (let row of table) {
|
|
137
137
|
let i = 0;
|
|
138
138
|
for (let item of row) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// @flow strict-local
|
|
2
|
+
|
|
1
3
|
import assert from 'assert';
|
|
2
4
|
import sinon from 'sinon';
|
|
3
5
|
import {PassThrough} from 'stream';
|
|
@@ -37,13 +39,13 @@ const EMPTY_OPTIONS = {
|
|
|
37
39
|
assetsPerBundle: 10,
|
|
38
40
|
},
|
|
39
41
|
featureFlags: DEFAULT_FEATURE_FLAGS,
|
|
40
|
-
}
|
|
42
|
+
};
|
|
41
43
|
|
|
42
44
|
describe('CLIReporter', () => {
|
|
43
|
-
let originalStdout
|
|
44
|
-
let originalStderr
|
|
45
|
-
let stdoutOutput
|
|
46
|
-
let stderrOutput
|
|
45
|
+
let originalStdout;
|
|
46
|
+
let originalStderr;
|
|
47
|
+
let stdoutOutput;
|
|
48
|
+
let stderrOutput;
|
|
47
49
|
|
|
48
50
|
beforeEach(async () => {
|
|
49
51
|
// Stub these out to avoid writing noise to real stdio and to read from these
|
|
@@ -55,15 +57,9 @@ describe('CLIReporter', () => {
|
|
|
55
57
|
stderrOutput = '';
|
|
56
58
|
|
|
57
59
|
let mockStdout = new PassThrough();
|
|
58
|
-
mockStdout.on(
|
|
59
|
-
'data',
|
|
60
|
-
(d: any) => (stdoutOutput += stripAnsi(d.toString())),
|
|
61
|
-
);
|
|
60
|
+
mockStdout.on('data', (d) => (stdoutOutput += stripAnsi(d.toString())));
|
|
62
61
|
let mockStderr = new PassThrough();
|
|
63
|
-
mockStderr.on(
|
|
64
|
-
'data',
|
|
65
|
-
(d: any) => (stderrOutput += stripAnsi(d.toString())),
|
|
66
|
-
);
|
|
62
|
+
mockStderr.on('data', (d) => (stderrOutput += stripAnsi(d.toString())));
|
|
67
63
|
_setStdio(mockStdout, mockStderr);
|
|
68
64
|
|
|
69
65
|
await _report(
|
|
@@ -204,6 +200,7 @@ describe('CLIReporter', () => {
|
|
|
204
200
|
// emit a buildSuccess event to reset the timings and seen phases
|
|
205
201
|
// from the previous test
|
|
206
202
|
process.env['ATLASPACK_SHOW_PHASE_TIMES'] = undefined;
|
|
203
|
+
// $FlowFixMe
|
|
207
204
|
await _report({type: 'buildSuccess'}, EMPTY_OPTIONS);
|
|
208
205
|
|
|
209
206
|
process.env['ATLASPACK_SHOW_PHASE_TIMES'] = 'true';
|
|
@@ -213,16 +210,17 @@ describe('CLIReporter', () => {
|
|
|
213
210
|
);
|
|
214
211
|
await _report({type: 'buildProgress', phase: 'bundling'}, EMPTY_OPTIONS);
|
|
215
212
|
await _report(
|
|
213
|
+
// $FlowFixMe
|
|
216
214
|
{
|
|
217
215
|
type: 'buildProgress',
|
|
218
216
|
phase: 'packaging',
|
|
219
|
-
|
|
220
217
|
bundle: {
|
|
221
218
|
displayName: 'test',
|
|
222
219
|
},
|
|
223
220
|
},
|
|
224
221
|
EMPTY_OPTIONS,
|
|
225
222
|
);
|
|
223
|
+
// $FlowFixMe
|
|
226
224
|
await _report({type: 'buildSuccess'}, EMPTY_OPTIONS);
|
|
227
225
|
const expected =
|
|
228
226
|
/Building...\nBundling...\nPackaging & Optimizing...\nTransforming finished in [0-9]ms\nBundling finished in [0-9]ms\nPackaging & Optimizing finished in [0-9]ms/;
|
|
@@ -237,16 +235,17 @@ describe('CLIReporter', () => {
|
|
|
237
235
|
);
|
|
238
236
|
await _report({type: 'buildProgress', phase: 'bundling'}, EMPTY_OPTIONS);
|
|
239
237
|
await _report(
|
|
238
|
+
// $FlowFixMe
|
|
240
239
|
{
|
|
241
240
|
type: 'buildProgress',
|
|
242
241
|
phase: 'packaging',
|
|
243
|
-
|
|
244
242
|
bundle: {
|
|
245
243
|
displayName: 'test',
|
|
246
244
|
},
|
|
247
245
|
},
|
|
248
246
|
EMPTY_OPTIONS,
|
|
249
247
|
);
|
|
248
|
+
// $FlowFixMe
|
|
250
249
|
await _report({type: 'buildSuccess'}, EMPTY_OPTIONS);
|
|
251
250
|
|
|
252
251
|
assert.equal(
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright (c) 2024 Atlassian US., Inc.
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
package/lib/CLIReporter.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ReporterEvent, PluginOptions } from '@atlaspack/types';
|
|
2
|
-
import { Reporter } from '@atlaspack/plugin';
|
|
3
|
-
export declare function _report(event: ReporterEvent, options: PluginOptions): Promise<void>;
|
|
4
|
-
declare const _default: Reporter;
|
|
5
|
-
export default _default;
|
package/lib/bundleReport.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { BundleGraph, FilePath, PackagedBundle } from '@atlaspack/types';
|
|
2
|
-
import type { FileSystem } from '@atlaspack/fs';
|
|
3
|
-
export default function bundleReport(bundleGraph: BundleGraph<PackagedBundle>, fs: FileSystem, projectRoot: FilePath, assetCount?: number): Promise<void>;
|
package/lib/emoji.d.ts
DELETED
package/lib/logLevels.d.ts
DELETED
package/lib/phaseReport.d.ts
DELETED
package/lib/render.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Writable } from 'stream';
|
|
2
|
-
import type { PadAlign } from './utils';
|
|
3
|
-
type ColumnType = {
|
|
4
|
-
align: PadAlign;
|
|
5
|
-
};
|
|
6
|
-
export declare const isTTY: any | boolean | true;
|
|
7
|
-
export declare function _setStdio(stdoutLike: Writable, stderrLike: Writable): void;
|
|
8
|
-
export declare function writeOut(message: string, isError?: boolean): void;
|
|
9
|
-
export declare function persistMessage(message: string): void;
|
|
10
|
-
export declare function updateSpinner(message: string): void;
|
|
11
|
-
export declare function persistSpinner(name: string, status: 'success' | 'error', message: string): void;
|
|
12
|
-
export declare function resetWindow(): void;
|
|
13
|
-
export declare function table(columns: Array<ColumnType>, table: Array<Array<string>>): void;
|
|
14
|
-
export {};
|
package/lib/utils.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type PadAlign = 'left' | 'right';
|
|
2
|
-
export declare function getTerminalWidth(): any;
|
|
3
|
-
export declare function pad(text: string, length: number, align?: PadAlign): string;
|
|
4
|
-
export declare function formatFilename(filename: string, color?: (s: string) => string): string;
|
|
5
|
-
export declare function countLines(message: string): number;
|
package/tsconfig.json
DELETED