headlamp 0.1.3 → 0.1.5
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 +22 -24
- package/dist/cli.cjs +61 -2406
- package/dist/cli.cjs.map +4 -4
- package/dist/index.js +1576 -155
- package/dist/index.js.map +4 -4
- package/package.json +7 -3
package/dist/cli.cjs
CHANGED
|
@@ -33,2253 +33,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
mod
|
|
34
34
|
));
|
|
35
35
|
|
|
36
|
-
// node_modules/make-dir/node_modules/semver/internal/debug.js
|
|
37
|
-
var require_debug = __commonJS({
|
|
38
|
-
"node_modules/make-dir/node_modules/semver/internal/debug.js"(exports2, module2) {
|
|
39
|
-
"use strict";
|
|
40
|
-
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
41
|
-
};
|
|
42
|
-
module2.exports = debug;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// node_modules/make-dir/node_modules/semver/internal/constants.js
|
|
47
|
-
var require_constants = __commonJS({
|
|
48
|
-
"node_modules/make-dir/node_modules/semver/internal/constants.js"(exports2, module2) {
|
|
49
|
-
"use strict";
|
|
50
|
-
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
51
|
-
var MAX_LENGTH = 256;
|
|
52
|
-
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
53
|
-
9007199254740991;
|
|
54
|
-
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
55
|
-
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
56
|
-
var RELEASE_TYPES = [
|
|
57
|
-
"major",
|
|
58
|
-
"premajor",
|
|
59
|
-
"minor",
|
|
60
|
-
"preminor",
|
|
61
|
-
"patch",
|
|
62
|
-
"prepatch",
|
|
63
|
-
"prerelease"
|
|
64
|
-
];
|
|
65
|
-
module2.exports = {
|
|
66
|
-
MAX_LENGTH,
|
|
67
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
68
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
69
|
-
MAX_SAFE_INTEGER,
|
|
70
|
-
RELEASE_TYPES,
|
|
71
|
-
SEMVER_SPEC_VERSION,
|
|
72
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
73
|
-
FLAG_LOOSE: 2
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
// node_modules/make-dir/node_modules/semver/internal/re.js
|
|
79
|
-
var require_re = __commonJS({
|
|
80
|
-
"node_modules/make-dir/node_modules/semver/internal/re.js"(exports2, module2) {
|
|
81
|
-
"use strict";
|
|
82
|
-
var {
|
|
83
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
84
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
85
|
-
MAX_LENGTH
|
|
86
|
-
} = require_constants();
|
|
87
|
-
var debug = require_debug();
|
|
88
|
-
exports2 = module2.exports = {};
|
|
89
|
-
var re = exports2.re = [];
|
|
90
|
-
var safeRe = exports2.safeRe = [];
|
|
91
|
-
var src = exports2.src = [];
|
|
92
|
-
var safeSrc = exports2.safeSrc = [];
|
|
93
|
-
var t = exports2.t = {};
|
|
94
|
-
var R = 0;
|
|
95
|
-
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
96
|
-
var safeRegexReplacements = [
|
|
97
|
-
["\\s", 1],
|
|
98
|
-
["\\d", MAX_LENGTH],
|
|
99
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
100
|
-
];
|
|
101
|
-
var makeSafeRegex = (value) => {
|
|
102
|
-
for (const [token, max] of safeRegexReplacements) {
|
|
103
|
-
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
104
|
-
}
|
|
105
|
-
return value;
|
|
106
|
-
};
|
|
107
|
-
var createToken = (name, value, isGlobal) => {
|
|
108
|
-
const safe = makeSafeRegex(value);
|
|
109
|
-
const index = R++;
|
|
110
|
-
debug(name, index, value);
|
|
111
|
-
t[name] = index;
|
|
112
|
-
src[index] = value;
|
|
113
|
-
safeSrc[index] = safe;
|
|
114
|
-
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
115
|
-
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
116
|
-
};
|
|
117
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
118
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
119
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
120
|
-
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
121
|
-
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
122
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
123
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
124
|
-
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
125
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
126
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
127
|
-
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
128
|
-
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
129
|
-
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
130
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
131
|
-
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
132
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
|
133
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
134
|
-
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
135
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
136
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
137
|
-
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
138
|
-
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
139
|
-
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
140
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
141
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
142
|
-
createToken("COERCERTL", src[t.COERCE], true);
|
|
143
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
144
|
-
createToken("LONETILDE", "(?:~>?)");
|
|
145
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
146
|
-
exports2.tildeTrimReplace = "$1~";
|
|
147
|
-
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
148
|
-
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
149
|
-
createToken("LONECARET", "(?:\\^)");
|
|
150
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
151
|
-
exports2.caretTrimReplace = "$1^";
|
|
152
|
-
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
153
|
-
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
154
|
-
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
155
|
-
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
156
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
157
|
-
exports2.comparatorTrimReplace = "$1$2$3";
|
|
158
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
159
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
160
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
161
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
162
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
// node_modules/make-dir/node_modules/semver/internal/parse-options.js
|
|
167
|
-
var require_parse_options = __commonJS({
|
|
168
|
-
"node_modules/make-dir/node_modules/semver/internal/parse-options.js"(exports2, module2) {
|
|
169
|
-
"use strict";
|
|
170
|
-
var looseOption = Object.freeze({ loose: true });
|
|
171
|
-
var emptyOpts = Object.freeze({});
|
|
172
|
-
var parseOptions = (options) => {
|
|
173
|
-
if (!options) {
|
|
174
|
-
return emptyOpts;
|
|
175
|
-
}
|
|
176
|
-
if (typeof options !== "object") {
|
|
177
|
-
return looseOption;
|
|
178
|
-
}
|
|
179
|
-
return options;
|
|
180
|
-
};
|
|
181
|
-
module2.exports = parseOptions;
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
// node_modules/make-dir/node_modules/semver/internal/identifiers.js
|
|
186
|
-
var require_identifiers = __commonJS({
|
|
187
|
-
"node_modules/make-dir/node_modules/semver/internal/identifiers.js"(exports2, module2) {
|
|
188
|
-
"use strict";
|
|
189
|
-
var numeric = /^[0-9]+$/;
|
|
190
|
-
var compareIdentifiers = (a, b) => {
|
|
191
|
-
const anum = numeric.test(a);
|
|
192
|
-
const bnum = numeric.test(b);
|
|
193
|
-
if (anum && bnum) {
|
|
194
|
-
a = +a;
|
|
195
|
-
b = +b;
|
|
196
|
-
}
|
|
197
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
198
|
-
};
|
|
199
|
-
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
200
|
-
module2.exports = {
|
|
201
|
-
compareIdentifiers,
|
|
202
|
-
rcompareIdentifiers
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
// node_modules/make-dir/node_modules/semver/classes/semver.js
|
|
208
|
-
var require_semver = __commonJS({
|
|
209
|
-
"node_modules/make-dir/node_modules/semver/classes/semver.js"(exports2, module2) {
|
|
210
|
-
"use strict";
|
|
211
|
-
var debug = require_debug();
|
|
212
|
-
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
213
|
-
var { safeRe: re, t } = require_re();
|
|
214
|
-
var parseOptions = require_parse_options();
|
|
215
|
-
var { compareIdentifiers } = require_identifiers();
|
|
216
|
-
var SemVer = class _SemVer {
|
|
217
|
-
constructor(version, options) {
|
|
218
|
-
options = parseOptions(options);
|
|
219
|
-
if (version instanceof _SemVer) {
|
|
220
|
-
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
221
|
-
return version;
|
|
222
|
-
} else {
|
|
223
|
-
version = version.version;
|
|
224
|
-
}
|
|
225
|
-
} else if (typeof version !== "string") {
|
|
226
|
-
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
227
|
-
}
|
|
228
|
-
if (version.length > MAX_LENGTH) {
|
|
229
|
-
throw new TypeError(
|
|
230
|
-
`version is longer than ${MAX_LENGTH} characters`
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
debug("SemVer", version, options);
|
|
234
|
-
this.options = options;
|
|
235
|
-
this.loose = !!options.loose;
|
|
236
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
237
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
238
|
-
if (!m) {
|
|
239
|
-
throw new TypeError(`Invalid Version: ${version}`);
|
|
240
|
-
}
|
|
241
|
-
this.raw = version;
|
|
242
|
-
this.major = +m[1];
|
|
243
|
-
this.minor = +m[2];
|
|
244
|
-
this.patch = +m[3];
|
|
245
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
246
|
-
throw new TypeError("Invalid major version");
|
|
247
|
-
}
|
|
248
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
249
|
-
throw new TypeError("Invalid minor version");
|
|
250
|
-
}
|
|
251
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
252
|
-
throw new TypeError("Invalid patch version");
|
|
253
|
-
}
|
|
254
|
-
if (!m[4]) {
|
|
255
|
-
this.prerelease = [];
|
|
256
|
-
} else {
|
|
257
|
-
this.prerelease = m[4].split(".").map((id) => {
|
|
258
|
-
if (/^[0-9]+$/.test(id)) {
|
|
259
|
-
const num = +id;
|
|
260
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
261
|
-
return num;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
return id;
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
268
|
-
this.format();
|
|
269
|
-
}
|
|
270
|
-
format() {
|
|
271
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
272
|
-
if (this.prerelease.length) {
|
|
273
|
-
this.version += `-${this.prerelease.join(".")}`;
|
|
274
|
-
}
|
|
275
|
-
return this.version;
|
|
276
|
-
}
|
|
277
|
-
toString() {
|
|
278
|
-
return this.version;
|
|
279
|
-
}
|
|
280
|
-
compare(other) {
|
|
281
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
282
|
-
if (!(other instanceof _SemVer)) {
|
|
283
|
-
if (typeof other === "string" && other === this.version) {
|
|
284
|
-
return 0;
|
|
285
|
-
}
|
|
286
|
-
other = new _SemVer(other, this.options);
|
|
287
|
-
}
|
|
288
|
-
if (other.version === this.version) {
|
|
289
|
-
return 0;
|
|
290
|
-
}
|
|
291
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
292
|
-
}
|
|
293
|
-
compareMain(other) {
|
|
294
|
-
if (!(other instanceof _SemVer)) {
|
|
295
|
-
other = new _SemVer(other, this.options);
|
|
296
|
-
}
|
|
297
|
-
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
298
|
-
}
|
|
299
|
-
comparePre(other) {
|
|
300
|
-
if (!(other instanceof _SemVer)) {
|
|
301
|
-
other = new _SemVer(other, this.options);
|
|
302
|
-
}
|
|
303
|
-
if (this.prerelease.length && !other.prerelease.length) {
|
|
304
|
-
return -1;
|
|
305
|
-
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
306
|
-
return 1;
|
|
307
|
-
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
308
|
-
return 0;
|
|
309
|
-
}
|
|
310
|
-
let i = 0;
|
|
311
|
-
do {
|
|
312
|
-
const a = this.prerelease[i];
|
|
313
|
-
const b = other.prerelease[i];
|
|
314
|
-
debug("prerelease compare", i, a, b);
|
|
315
|
-
if (a === void 0 && b === void 0) {
|
|
316
|
-
return 0;
|
|
317
|
-
} else if (b === void 0) {
|
|
318
|
-
return 1;
|
|
319
|
-
} else if (a === void 0) {
|
|
320
|
-
return -1;
|
|
321
|
-
} else if (a === b) {
|
|
322
|
-
continue;
|
|
323
|
-
} else {
|
|
324
|
-
return compareIdentifiers(a, b);
|
|
325
|
-
}
|
|
326
|
-
} while (++i);
|
|
327
|
-
}
|
|
328
|
-
compareBuild(other) {
|
|
329
|
-
if (!(other instanceof _SemVer)) {
|
|
330
|
-
other = new _SemVer(other, this.options);
|
|
331
|
-
}
|
|
332
|
-
let i = 0;
|
|
333
|
-
do {
|
|
334
|
-
const a = this.build[i];
|
|
335
|
-
const b = other.build[i];
|
|
336
|
-
debug("build compare", i, a, b);
|
|
337
|
-
if (a === void 0 && b === void 0) {
|
|
338
|
-
return 0;
|
|
339
|
-
} else if (b === void 0) {
|
|
340
|
-
return 1;
|
|
341
|
-
} else if (a === void 0) {
|
|
342
|
-
return -1;
|
|
343
|
-
} else if (a === b) {
|
|
344
|
-
continue;
|
|
345
|
-
} else {
|
|
346
|
-
return compareIdentifiers(a, b);
|
|
347
|
-
}
|
|
348
|
-
} while (++i);
|
|
349
|
-
}
|
|
350
|
-
// preminor will bump the version up to the next minor release, and immediately
|
|
351
|
-
// down to pre-release. premajor and prepatch work the same way.
|
|
352
|
-
inc(release, identifier, identifierBase) {
|
|
353
|
-
if (release.startsWith("pre")) {
|
|
354
|
-
if (!identifier && identifierBase === false) {
|
|
355
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
356
|
-
}
|
|
357
|
-
if (identifier) {
|
|
358
|
-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
359
|
-
if (!match || match[1] !== identifier) {
|
|
360
|
-
throw new Error(`invalid identifier: ${identifier}`);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
switch (release) {
|
|
365
|
-
case "premajor":
|
|
366
|
-
this.prerelease.length = 0;
|
|
367
|
-
this.patch = 0;
|
|
368
|
-
this.minor = 0;
|
|
369
|
-
this.major++;
|
|
370
|
-
this.inc("pre", identifier, identifierBase);
|
|
371
|
-
break;
|
|
372
|
-
case "preminor":
|
|
373
|
-
this.prerelease.length = 0;
|
|
374
|
-
this.patch = 0;
|
|
375
|
-
this.minor++;
|
|
376
|
-
this.inc("pre", identifier, identifierBase);
|
|
377
|
-
break;
|
|
378
|
-
case "prepatch":
|
|
379
|
-
this.prerelease.length = 0;
|
|
380
|
-
this.inc("patch", identifier, identifierBase);
|
|
381
|
-
this.inc("pre", identifier, identifierBase);
|
|
382
|
-
break;
|
|
383
|
-
case "prerelease":
|
|
384
|
-
if (this.prerelease.length === 0) {
|
|
385
|
-
this.inc("patch", identifier, identifierBase);
|
|
386
|
-
}
|
|
387
|
-
this.inc("pre", identifier, identifierBase);
|
|
388
|
-
break;
|
|
389
|
-
case "release":
|
|
390
|
-
if (this.prerelease.length === 0) {
|
|
391
|
-
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
392
|
-
}
|
|
393
|
-
this.prerelease.length = 0;
|
|
394
|
-
break;
|
|
395
|
-
case "major":
|
|
396
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
397
|
-
this.major++;
|
|
398
|
-
}
|
|
399
|
-
this.minor = 0;
|
|
400
|
-
this.patch = 0;
|
|
401
|
-
this.prerelease = [];
|
|
402
|
-
break;
|
|
403
|
-
case "minor":
|
|
404
|
-
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
405
|
-
this.minor++;
|
|
406
|
-
}
|
|
407
|
-
this.patch = 0;
|
|
408
|
-
this.prerelease = [];
|
|
409
|
-
break;
|
|
410
|
-
case "patch":
|
|
411
|
-
if (this.prerelease.length === 0) {
|
|
412
|
-
this.patch++;
|
|
413
|
-
}
|
|
414
|
-
this.prerelease = [];
|
|
415
|
-
break;
|
|
416
|
-
case "pre": {
|
|
417
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
418
|
-
if (this.prerelease.length === 0) {
|
|
419
|
-
this.prerelease = [base];
|
|
420
|
-
} else {
|
|
421
|
-
let i = this.prerelease.length;
|
|
422
|
-
while (--i >= 0) {
|
|
423
|
-
if (typeof this.prerelease[i] === "number") {
|
|
424
|
-
this.prerelease[i]++;
|
|
425
|
-
i = -2;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
if (i === -1) {
|
|
429
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
430
|
-
throw new Error("invalid increment argument: identifier already exists");
|
|
431
|
-
}
|
|
432
|
-
this.prerelease.push(base);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
if (identifier) {
|
|
436
|
-
let prerelease = [identifier, base];
|
|
437
|
-
if (identifierBase === false) {
|
|
438
|
-
prerelease = [identifier];
|
|
439
|
-
}
|
|
440
|
-
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
441
|
-
if (isNaN(this.prerelease[1])) {
|
|
442
|
-
this.prerelease = prerelease;
|
|
443
|
-
}
|
|
444
|
-
} else {
|
|
445
|
-
this.prerelease = prerelease;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
break;
|
|
449
|
-
}
|
|
450
|
-
default:
|
|
451
|
-
throw new Error(`invalid increment argument: ${release}`);
|
|
452
|
-
}
|
|
453
|
-
this.raw = this.format();
|
|
454
|
-
if (this.build.length) {
|
|
455
|
-
this.raw += `+${this.build.join(".")}`;
|
|
456
|
-
}
|
|
457
|
-
return this;
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
module2.exports = SemVer;
|
|
461
|
-
}
|
|
462
|
-
});
|
|
463
|
-
|
|
464
|
-
// node_modules/make-dir/node_modules/semver/functions/compare.js
|
|
465
|
-
var require_compare = __commonJS({
|
|
466
|
-
"node_modules/make-dir/node_modules/semver/functions/compare.js"(exports2, module2) {
|
|
467
|
-
"use strict";
|
|
468
|
-
var SemVer = require_semver();
|
|
469
|
-
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
470
|
-
module2.exports = compare;
|
|
471
|
-
}
|
|
472
|
-
});
|
|
473
|
-
|
|
474
|
-
// node_modules/make-dir/node_modules/semver/functions/gte.js
|
|
475
|
-
var require_gte = __commonJS({
|
|
476
|
-
"node_modules/make-dir/node_modules/semver/functions/gte.js"(exports2, module2) {
|
|
477
|
-
"use strict";
|
|
478
|
-
var compare = require_compare();
|
|
479
|
-
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
480
|
-
module2.exports = gte;
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
|
|
484
|
-
// node_modules/make-dir/index.js
|
|
485
|
-
var require_make_dir = __commonJS({
|
|
486
|
-
"node_modules/make-dir/index.js"(exports2, module2) {
|
|
487
|
-
"use strict";
|
|
488
|
-
var fs6 = require("fs");
|
|
489
|
-
var path10 = require("path");
|
|
490
|
-
var { promisify } = require("util");
|
|
491
|
-
var semverGte = require_gte();
|
|
492
|
-
var useNativeRecursiveOption = semverGte(process.version, "10.12.0");
|
|
493
|
-
var checkPath = (pth) => {
|
|
494
|
-
if (process.platform === "win32") {
|
|
495
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path10.parse(pth).root, ""));
|
|
496
|
-
if (pathHasInvalidWinCharacters) {
|
|
497
|
-
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
498
|
-
error.code = "EINVAL";
|
|
499
|
-
throw error;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
};
|
|
503
|
-
var processOptions = (options) => {
|
|
504
|
-
const defaults = {
|
|
505
|
-
mode: 511,
|
|
506
|
-
fs: fs6
|
|
507
|
-
};
|
|
508
|
-
return {
|
|
509
|
-
...defaults,
|
|
510
|
-
...options
|
|
511
|
-
};
|
|
512
|
-
};
|
|
513
|
-
var permissionError = (pth) => {
|
|
514
|
-
const error = new Error(`operation not permitted, mkdir '${pth}'`);
|
|
515
|
-
error.code = "EPERM";
|
|
516
|
-
error.errno = -4048;
|
|
517
|
-
error.path = pth;
|
|
518
|
-
error.syscall = "mkdir";
|
|
519
|
-
return error;
|
|
520
|
-
};
|
|
521
|
-
var makeDir = async (input, options) => {
|
|
522
|
-
checkPath(input);
|
|
523
|
-
options = processOptions(options);
|
|
524
|
-
const mkdir2 = promisify(options.fs.mkdir);
|
|
525
|
-
const stat2 = promisify(options.fs.stat);
|
|
526
|
-
if (useNativeRecursiveOption && options.fs.mkdir === fs6.mkdir) {
|
|
527
|
-
const pth = path10.resolve(input);
|
|
528
|
-
await mkdir2(pth, {
|
|
529
|
-
mode: options.mode,
|
|
530
|
-
recursive: true
|
|
531
|
-
});
|
|
532
|
-
return pth;
|
|
533
|
-
}
|
|
534
|
-
const make = async (pth) => {
|
|
535
|
-
try {
|
|
536
|
-
await mkdir2(pth, options.mode);
|
|
537
|
-
return pth;
|
|
538
|
-
} catch (error) {
|
|
539
|
-
if (error.code === "EPERM") {
|
|
540
|
-
throw error;
|
|
541
|
-
}
|
|
542
|
-
if (error.code === "ENOENT") {
|
|
543
|
-
if (path10.dirname(pth) === pth) {
|
|
544
|
-
throw permissionError(pth);
|
|
545
|
-
}
|
|
546
|
-
if (error.message.includes("null bytes")) {
|
|
547
|
-
throw error;
|
|
548
|
-
}
|
|
549
|
-
await make(path10.dirname(pth));
|
|
550
|
-
return make(pth);
|
|
551
|
-
}
|
|
552
|
-
try {
|
|
553
|
-
const stats = await stat2(pth);
|
|
554
|
-
if (!stats.isDirectory()) {
|
|
555
|
-
throw new Error("The path is not a directory");
|
|
556
|
-
}
|
|
557
|
-
} catch {
|
|
558
|
-
throw error;
|
|
559
|
-
}
|
|
560
|
-
return pth;
|
|
561
|
-
}
|
|
562
|
-
};
|
|
563
|
-
return make(path10.resolve(input));
|
|
564
|
-
};
|
|
565
|
-
module2.exports = makeDir;
|
|
566
|
-
module2.exports.sync = (input, options) => {
|
|
567
|
-
checkPath(input);
|
|
568
|
-
options = processOptions(options);
|
|
569
|
-
if (useNativeRecursiveOption && options.fs.mkdirSync === fs6.mkdirSync) {
|
|
570
|
-
const pth = path10.resolve(input);
|
|
571
|
-
fs6.mkdirSync(pth, {
|
|
572
|
-
mode: options.mode,
|
|
573
|
-
recursive: true
|
|
574
|
-
});
|
|
575
|
-
return pth;
|
|
576
|
-
}
|
|
577
|
-
const make = (pth) => {
|
|
578
|
-
try {
|
|
579
|
-
options.fs.mkdirSync(pth, options.mode);
|
|
580
|
-
} catch (error) {
|
|
581
|
-
if (error.code === "EPERM") {
|
|
582
|
-
throw error;
|
|
583
|
-
}
|
|
584
|
-
if (error.code === "ENOENT") {
|
|
585
|
-
if (path10.dirname(pth) === pth) {
|
|
586
|
-
throw permissionError(pth);
|
|
587
|
-
}
|
|
588
|
-
if (error.message.includes("null bytes")) {
|
|
589
|
-
throw error;
|
|
590
|
-
}
|
|
591
|
-
make(path10.dirname(pth));
|
|
592
|
-
return make(pth);
|
|
593
|
-
}
|
|
594
|
-
try {
|
|
595
|
-
if (!options.fs.statSync(pth).isDirectory()) {
|
|
596
|
-
throw new Error("The path is not a directory");
|
|
597
|
-
}
|
|
598
|
-
} catch {
|
|
599
|
-
throw error;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
return pth;
|
|
603
|
-
};
|
|
604
|
-
return make(path10.resolve(input));
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
});
|
|
608
|
-
|
|
609
|
-
// node_modules/has-flag/index.js
|
|
610
|
-
var require_has_flag = __commonJS({
|
|
611
|
-
"node_modules/has-flag/index.js"(exports2, module2) {
|
|
612
|
-
"use strict";
|
|
613
|
-
module2.exports = (flag, argv = process.argv) => {
|
|
614
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
615
|
-
const position = argv.indexOf(prefix + flag);
|
|
616
|
-
const terminatorPosition = argv.indexOf("--");
|
|
617
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
});
|
|
621
|
-
|
|
622
|
-
// node_modules/supports-color/index.js
|
|
623
|
-
var require_supports_color = __commonJS({
|
|
624
|
-
"node_modules/supports-color/index.js"(exports2, module2) {
|
|
625
|
-
"use strict";
|
|
626
|
-
var os3 = require("os");
|
|
627
|
-
var tty = require("tty");
|
|
628
|
-
var hasFlag = require_has_flag();
|
|
629
|
-
var { env: env2 } = process;
|
|
630
|
-
var forceColor;
|
|
631
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
632
|
-
forceColor = 0;
|
|
633
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
634
|
-
forceColor = 1;
|
|
635
|
-
}
|
|
636
|
-
if ("FORCE_COLOR" in env2) {
|
|
637
|
-
if (env2.FORCE_COLOR === "true") {
|
|
638
|
-
forceColor = 1;
|
|
639
|
-
} else if (env2.FORCE_COLOR === "false") {
|
|
640
|
-
forceColor = 0;
|
|
641
|
-
} else {
|
|
642
|
-
forceColor = env2.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env2.FORCE_COLOR, 10), 3);
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
function translateLevel(level) {
|
|
646
|
-
if (level === 0) {
|
|
647
|
-
return false;
|
|
648
|
-
}
|
|
649
|
-
return {
|
|
650
|
-
level,
|
|
651
|
-
hasBasic: true,
|
|
652
|
-
has256: level >= 2,
|
|
653
|
-
has16m: level >= 3
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
657
|
-
if (forceColor === 0) {
|
|
658
|
-
return 0;
|
|
659
|
-
}
|
|
660
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
661
|
-
return 3;
|
|
662
|
-
}
|
|
663
|
-
if (hasFlag("color=256")) {
|
|
664
|
-
return 2;
|
|
665
|
-
}
|
|
666
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
667
|
-
return 0;
|
|
668
|
-
}
|
|
669
|
-
const min = forceColor || 0;
|
|
670
|
-
if (env2.TERM === "dumb") {
|
|
671
|
-
return min;
|
|
672
|
-
}
|
|
673
|
-
if (process.platform === "win32") {
|
|
674
|
-
const osRelease = os3.release().split(".");
|
|
675
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
676
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
677
|
-
}
|
|
678
|
-
return 1;
|
|
679
|
-
}
|
|
680
|
-
if ("CI" in env2) {
|
|
681
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env2) || env2.CI_NAME === "codeship") {
|
|
682
|
-
return 1;
|
|
683
|
-
}
|
|
684
|
-
return min;
|
|
685
|
-
}
|
|
686
|
-
if ("TEAMCITY_VERSION" in env2) {
|
|
687
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
688
|
-
}
|
|
689
|
-
if (env2.COLORTERM === "truecolor") {
|
|
690
|
-
return 3;
|
|
691
|
-
}
|
|
692
|
-
if ("TERM_PROGRAM" in env2) {
|
|
693
|
-
const version = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
694
|
-
switch (env2.TERM_PROGRAM) {
|
|
695
|
-
case "iTerm.app":
|
|
696
|
-
return version >= 3 ? 3 : 2;
|
|
697
|
-
case "Apple_Terminal":
|
|
698
|
-
return 2;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
702
|
-
return 2;
|
|
703
|
-
}
|
|
704
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
705
|
-
return 1;
|
|
706
|
-
}
|
|
707
|
-
if ("COLORTERM" in env2) {
|
|
708
|
-
return 1;
|
|
709
|
-
}
|
|
710
|
-
return min;
|
|
711
|
-
}
|
|
712
|
-
function getSupportLevel(stream) {
|
|
713
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
714
|
-
return translateLevel(level);
|
|
715
|
-
}
|
|
716
|
-
module2.exports = {
|
|
717
|
-
supportsColor: getSupportLevel,
|
|
718
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
719
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
});
|
|
723
|
-
|
|
724
|
-
// node_modules/istanbul-lib-report/lib/file-writer.js
|
|
725
|
-
var require_file_writer = __commonJS({
|
|
726
|
-
"node_modules/istanbul-lib-report/lib/file-writer.js"(exports2, module2) {
|
|
727
|
-
"use strict";
|
|
728
|
-
var path10 = require("path");
|
|
729
|
-
var fs6 = require("fs");
|
|
730
|
-
var mkdirp = require_make_dir();
|
|
731
|
-
var supportsColor = require_supports_color();
|
|
732
|
-
var ContentWriter = class {
|
|
733
|
-
/**
|
|
734
|
-
* returns the colorized version of a string. Typically,
|
|
735
|
-
* content writers that write to files will return the
|
|
736
|
-
* same string and ones writing to a tty will wrap it in
|
|
737
|
-
* appropriate escape sequences.
|
|
738
|
-
* @param {String} str the string to colorize
|
|
739
|
-
* @param {String} clazz one of `high`, `medium` or `low`
|
|
740
|
-
* @returns {String} the colorized form of the string
|
|
741
|
-
*/
|
|
742
|
-
colorize(str) {
|
|
743
|
-
return str;
|
|
744
|
-
}
|
|
745
|
-
/**
|
|
746
|
-
* writes a string appended with a newline to the destination
|
|
747
|
-
* @param {String} str the string to write
|
|
748
|
-
*/
|
|
749
|
-
println(str) {
|
|
750
|
-
this.write(`${str}
|
|
751
|
-
`);
|
|
752
|
-
}
|
|
753
|
-
/**
|
|
754
|
-
* closes this content writer. Should be called after all writes are complete.
|
|
755
|
-
*/
|
|
756
|
-
close() {
|
|
757
|
-
}
|
|
758
|
-
};
|
|
759
|
-
var FileContentWriter = class extends ContentWriter {
|
|
760
|
-
constructor(fd) {
|
|
761
|
-
super();
|
|
762
|
-
this.fd = fd;
|
|
763
|
-
}
|
|
764
|
-
write(str) {
|
|
765
|
-
fs6.writeSync(this.fd, str);
|
|
766
|
-
}
|
|
767
|
-
close() {
|
|
768
|
-
fs6.closeSync(this.fd);
|
|
769
|
-
}
|
|
770
|
-
};
|
|
771
|
-
var capture = false;
|
|
772
|
-
var output = "";
|
|
773
|
-
var ConsoleWriter = class extends ContentWriter {
|
|
774
|
-
write(str) {
|
|
775
|
-
if (capture) {
|
|
776
|
-
output += str;
|
|
777
|
-
} else {
|
|
778
|
-
process.stdout.write(str);
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
colorize(str, clazz) {
|
|
782
|
-
const colors = {
|
|
783
|
-
low: "31;1",
|
|
784
|
-
medium: "33;1",
|
|
785
|
-
high: "32;1"
|
|
786
|
-
};
|
|
787
|
-
if (supportsColor.stdout && colors[clazz]) {
|
|
788
|
-
return `\x1B[${colors[clazz]}m${str}\x1B[0m`;
|
|
789
|
-
}
|
|
790
|
-
return str;
|
|
791
|
-
}
|
|
792
|
-
};
|
|
793
|
-
var FileWriter = class _FileWriter {
|
|
794
|
-
constructor(baseDir) {
|
|
795
|
-
if (!baseDir) {
|
|
796
|
-
throw new Error("baseDir must be specified");
|
|
797
|
-
}
|
|
798
|
-
this.baseDir = baseDir;
|
|
799
|
-
}
|
|
800
|
-
/**
|
|
801
|
-
* static helpers for capturing stdout report output;
|
|
802
|
-
* super useful for tests!
|
|
803
|
-
*/
|
|
804
|
-
static startCapture() {
|
|
805
|
-
capture = true;
|
|
806
|
-
}
|
|
807
|
-
static stopCapture() {
|
|
808
|
-
capture = false;
|
|
809
|
-
}
|
|
810
|
-
static getOutput() {
|
|
811
|
-
return output;
|
|
812
|
-
}
|
|
813
|
-
static resetOutput() {
|
|
814
|
-
output = "";
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* returns a FileWriter that is rooted at the supplied subdirectory
|
|
818
|
-
* @param {String} subdir the subdirectory under which to root the
|
|
819
|
-
* returned FileWriter
|
|
820
|
-
* @returns {FileWriter}
|
|
821
|
-
*/
|
|
822
|
-
writerForDir(subdir) {
|
|
823
|
-
if (path10.isAbsolute(subdir)) {
|
|
824
|
-
throw new Error(
|
|
825
|
-
`Cannot create subdir writer for absolute path: ${subdir}`
|
|
826
|
-
);
|
|
827
|
-
}
|
|
828
|
-
return new _FileWriter(`${this.baseDir}/${subdir}`);
|
|
829
|
-
}
|
|
830
|
-
/**
|
|
831
|
-
* copies a file from a source directory to a destination name
|
|
832
|
-
* @param {String} source path to source file
|
|
833
|
-
* @param {String} dest relative path to destination file
|
|
834
|
-
* @param {String} [header=undefined] optional text to prepend to destination
|
|
835
|
-
* (e.g., an "this file is autogenerated" comment, copyright notice, etc.)
|
|
836
|
-
*/
|
|
837
|
-
copyFile(source, dest, header) {
|
|
838
|
-
if (path10.isAbsolute(dest)) {
|
|
839
|
-
throw new Error(`Cannot write to absolute path: ${dest}`);
|
|
840
|
-
}
|
|
841
|
-
dest = path10.resolve(this.baseDir, dest);
|
|
842
|
-
mkdirp.sync(path10.dirname(dest));
|
|
843
|
-
let contents;
|
|
844
|
-
if (header) {
|
|
845
|
-
contents = header + fs6.readFileSync(source, "utf8");
|
|
846
|
-
} else {
|
|
847
|
-
contents = fs6.readFileSync(source);
|
|
848
|
-
}
|
|
849
|
-
fs6.writeFileSync(dest, contents);
|
|
850
|
-
}
|
|
851
|
-
/**
|
|
852
|
-
* returns a content writer for writing content to the supplied file.
|
|
853
|
-
* @param {String|null} file the relative path to the file or the special
|
|
854
|
-
* values `"-"` or `null` for writing to the console
|
|
855
|
-
* @returns {ContentWriter}
|
|
856
|
-
*/
|
|
857
|
-
writeFile(file) {
|
|
858
|
-
if (file === null || file === "-") {
|
|
859
|
-
return new ConsoleWriter();
|
|
860
|
-
}
|
|
861
|
-
if (path10.isAbsolute(file)) {
|
|
862
|
-
throw new Error(`Cannot write to absolute path: ${file}`);
|
|
863
|
-
}
|
|
864
|
-
file = path10.resolve(this.baseDir, file);
|
|
865
|
-
mkdirp.sync(path10.dirname(file));
|
|
866
|
-
return new FileContentWriter(fs6.openSync(file, "w"));
|
|
867
|
-
}
|
|
868
|
-
};
|
|
869
|
-
module2.exports = FileWriter;
|
|
870
|
-
}
|
|
871
|
-
});
|
|
872
|
-
|
|
873
|
-
// node_modules/istanbul-lib-report/lib/xml-writer.js
|
|
874
|
-
var require_xml_writer = __commonJS({
|
|
875
|
-
"node_modules/istanbul-lib-report/lib/xml-writer.js"(exports2, module2) {
|
|
876
|
-
"use strict";
|
|
877
|
-
var INDENT = " ";
|
|
878
|
-
function attrString(attrs) {
|
|
879
|
-
return Object.entries(attrs || {}).map(([k, v]) => ` ${k}="${v}"`).join("");
|
|
880
|
-
}
|
|
881
|
-
var XMLWriter = class {
|
|
882
|
-
constructor(contentWriter) {
|
|
883
|
-
this.cw = contentWriter;
|
|
884
|
-
this.stack = [];
|
|
885
|
-
}
|
|
886
|
-
indent(str) {
|
|
887
|
-
return this.stack.map(() => INDENT).join("") + str;
|
|
888
|
-
}
|
|
889
|
-
/**
|
|
890
|
-
* writes the opening XML tag with the supplied attributes
|
|
891
|
-
* @param {String} name tag name
|
|
892
|
-
* @param {Object} [attrs=null] attrs attributes for the tag
|
|
893
|
-
*/
|
|
894
|
-
openTag(name, attrs) {
|
|
895
|
-
const str = this.indent(`<${name + attrString(attrs)}>`);
|
|
896
|
-
this.cw.println(str);
|
|
897
|
-
this.stack.push(name);
|
|
898
|
-
}
|
|
899
|
-
/**
|
|
900
|
-
* closes an open XML tag.
|
|
901
|
-
* @param {String} name - tag name to close. This must match the writer's
|
|
902
|
-
* notion of the tag that is currently open.
|
|
903
|
-
*/
|
|
904
|
-
closeTag(name) {
|
|
905
|
-
if (this.stack.length === 0) {
|
|
906
|
-
throw new Error(`Attempt to close tag ${name} when not opened`);
|
|
907
|
-
}
|
|
908
|
-
const stashed = this.stack.pop();
|
|
909
|
-
const str = `</${name}>`;
|
|
910
|
-
if (stashed !== name) {
|
|
911
|
-
throw new Error(
|
|
912
|
-
`Attempt to close tag ${name} when ${stashed} was the one open`
|
|
913
|
-
);
|
|
914
|
-
}
|
|
915
|
-
this.cw.println(this.indent(str));
|
|
916
|
-
}
|
|
917
|
-
/**
|
|
918
|
-
* writes a tag and its value opening and closing it at the same time
|
|
919
|
-
* @param {String} name tag name
|
|
920
|
-
* @param {Object} [attrs=null] attrs tag attributes
|
|
921
|
-
* @param {String} [content=null] content optional tag content
|
|
922
|
-
*/
|
|
923
|
-
inlineTag(name, attrs, content) {
|
|
924
|
-
let str = "<" + name + attrString(attrs);
|
|
925
|
-
if (content) {
|
|
926
|
-
str += `>${content}</${name}>`;
|
|
927
|
-
} else {
|
|
928
|
-
str += "/>";
|
|
929
|
-
}
|
|
930
|
-
str = this.indent(str);
|
|
931
|
-
this.cw.println(str);
|
|
932
|
-
}
|
|
933
|
-
/**
|
|
934
|
-
* closes all open tags and ends the document
|
|
935
|
-
*/
|
|
936
|
-
closeAll() {
|
|
937
|
-
this.stack.slice().reverse().forEach((name) => {
|
|
938
|
-
this.closeTag(name);
|
|
939
|
-
});
|
|
940
|
-
}
|
|
941
|
-
};
|
|
942
|
-
module2.exports = XMLWriter;
|
|
943
|
-
}
|
|
944
|
-
});
|
|
945
|
-
|
|
946
|
-
// node_modules/istanbul-lib-report/lib/tree.js
|
|
947
|
-
var require_tree = __commonJS({
|
|
948
|
-
"node_modules/istanbul-lib-report/lib/tree.js"(exports2, module2) {
|
|
949
|
-
"use strict";
|
|
950
|
-
var Visitor = class {
|
|
951
|
-
constructor(delegate) {
|
|
952
|
-
this.delegate = delegate;
|
|
953
|
-
}
|
|
954
|
-
};
|
|
955
|
-
["Start", "End", "Summary", "SummaryEnd", "Detail"].map((k) => `on${k}`).forEach((fn) => {
|
|
956
|
-
Object.defineProperty(Visitor.prototype, fn, {
|
|
957
|
-
writable: true,
|
|
958
|
-
value(node, state) {
|
|
959
|
-
if (typeof this.delegate[fn] === "function") {
|
|
960
|
-
this.delegate[fn](node, state);
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
});
|
|
964
|
-
});
|
|
965
|
-
var CompositeVisitor = class extends Visitor {
|
|
966
|
-
constructor(visitors) {
|
|
967
|
-
super();
|
|
968
|
-
if (!Array.isArray(visitors)) {
|
|
969
|
-
visitors = [visitors];
|
|
970
|
-
}
|
|
971
|
-
this.visitors = visitors.map((v) => {
|
|
972
|
-
if (v instanceof Visitor) {
|
|
973
|
-
return v;
|
|
974
|
-
}
|
|
975
|
-
return new Visitor(v);
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
};
|
|
979
|
-
["Start", "Summary", "SummaryEnd", "Detail", "End"].map((k) => `on${k}`).forEach((fn) => {
|
|
980
|
-
Object.defineProperty(CompositeVisitor.prototype, fn, {
|
|
981
|
-
value(node, state) {
|
|
982
|
-
this.visitors.forEach((v) => {
|
|
983
|
-
v[fn](node, state);
|
|
984
|
-
});
|
|
985
|
-
}
|
|
986
|
-
});
|
|
987
|
-
});
|
|
988
|
-
var BaseNode = class {
|
|
989
|
-
isRoot() {
|
|
990
|
-
return !this.getParent();
|
|
991
|
-
}
|
|
992
|
-
/**
|
|
993
|
-
* visit all nodes depth-first from this node down. Note that `onStart`
|
|
994
|
-
* and `onEnd` are never called on the visitor even if the current
|
|
995
|
-
* node is the root of the tree.
|
|
996
|
-
* @param visitor a full visitor that is called during tree traversal
|
|
997
|
-
* @param state optional state that is passed around
|
|
998
|
-
*/
|
|
999
|
-
visit(visitor, state) {
|
|
1000
|
-
if (this.isSummary()) {
|
|
1001
|
-
visitor.onSummary(this, state);
|
|
1002
|
-
} else {
|
|
1003
|
-
visitor.onDetail(this, state);
|
|
1004
|
-
}
|
|
1005
|
-
this.getChildren().forEach((child) => {
|
|
1006
|
-
child.visit(visitor, state);
|
|
1007
|
-
});
|
|
1008
|
-
if (this.isSummary()) {
|
|
1009
|
-
visitor.onSummaryEnd(this, state);
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
};
|
|
1013
|
-
var BaseTree = class {
|
|
1014
|
-
constructor(root) {
|
|
1015
|
-
this.root = root;
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
* returns the root node of the tree
|
|
1019
|
-
*/
|
|
1020
|
-
getRoot() {
|
|
1021
|
-
return this.root;
|
|
1022
|
-
}
|
|
1023
|
-
/**
|
|
1024
|
-
* visits the tree depth-first with the supplied partial visitor
|
|
1025
|
-
* @param visitor - a potentially partial visitor
|
|
1026
|
-
* @param state - the state to be passed around during tree traversal
|
|
1027
|
-
*/
|
|
1028
|
-
visit(visitor, state) {
|
|
1029
|
-
if (!(visitor instanceof Visitor)) {
|
|
1030
|
-
visitor = new Visitor(visitor);
|
|
1031
|
-
}
|
|
1032
|
-
visitor.onStart(this.getRoot(), state);
|
|
1033
|
-
this.getRoot().visit(visitor, state);
|
|
1034
|
-
visitor.onEnd(this.getRoot(), state);
|
|
1035
|
-
}
|
|
1036
|
-
};
|
|
1037
|
-
module2.exports = {
|
|
1038
|
-
BaseTree,
|
|
1039
|
-
BaseNode,
|
|
1040
|
-
Visitor,
|
|
1041
|
-
CompositeVisitor
|
|
1042
|
-
};
|
|
1043
|
-
}
|
|
1044
|
-
});
|
|
1045
|
-
|
|
1046
|
-
// node_modules/istanbul-lib-report/lib/watermarks.js
|
|
1047
|
-
var require_watermarks = __commonJS({
|
|
1048
|
-
"node_modules/istanbul-lib-report/lib/watermarks.js"(exports2, module2) {
|
|
1049
|
-
"use strict";
|
|
1050
|
-
module2.exports = {
|
|
1051
|
-
getDefault() {
|
|
1052
|
-
return {
|
|
1053
|
-
statements: [50, 80],
|
|
1054
|
-
functions: [50, 80],
|
|
1055
|
-
branches: [50, 80],
|
|
1056
|
-
lines: [50, 80]
|
|
1057
|
-
};
|
|
1058
|
-
}
|
|
1059
|
-
};
|
|
1060
|
-
}
|
|
1061
|
-
});
|
|
1062
|
-
|
|
1063
|
-
// node_modules/istanbul-lib-coverage/lib/percent.js
|
|
1064
|
-
var require_percent = __commonJS({
|
|
1065
|
-
"node_modules/istanbul-lib-coverage/lib/percent.js"(exports2, module2) {
|
|
1066
|
-
"use strict";
|
|
1067
|
-
module2.exports = function percent(covered, total) {
|
|
1068
|
-
let tmp;
|
|
1069
|
-
if (total > 0) {
|
|
1070
|
-
tmp = 1e3 * 100 * covered / total;
|
|
1071
|
-
return Math.floor(tmp / 10) / 100;
|
|
1072
|
-
} else {
|
|
1073
|
-
return 100;
|
|
1074
|
-
}
|
|
1075
|
-
};
|
|
1076
|
-
}
|
|
1077
|
-
});
|
|
1078
|
-
|
|
1079
|
-
// node_modules/istanbul-lib-coverage/lib/data-properties.js
|
|
1080
|
-
var require_data_properties = __commonJS({
|
|
1081
|
-
"node_modules/istanbul-lib-coverage/lib/data-properties.js"(exports2, module2) {
|
|
1082
|
-
"use strict";
|
|
1083
|
-
module2.exports = function dataProperties(klass, properties) {
|
|
1084
|
-
properties.forEach((p) => {
|
|
1085
|
-
Object.defineProperty(klass.prototype, p, {
|
|
1086
|
-
enumerable: true,
|
|
1087
|
-
get() {
|
|
1088
|
-
return this.data[p];
|
|
1089
|
-
}
|
|
1090
|
-
});
|
|
1091
|
-
});
|
|
1092
|
-
};
|
|
1093
|
-
}
|
|
1094
|
-
});
|
|
1095
|
-
|
|
1096
|
-
// node_modules/istanbul-lib-coverage/lib/coverage-summary.js
|
|
1097
|
-
var require_coverage_summary = __commonJS({
|
|
1098
|
-
"node_modules/istanbul-lib-coverage/lib/coverage-summary.js"(exports2, module2) {
|
|
1099
|
-
"use strict";
|
|
1100
|
-
var percent = require_percent();
|
|
1101
|
-
var dataProperties = require_data_properties();
|
|
1102
|
-
function blankSummary() {
|
|
1103
|
-
const empty = () => ({
|
|
1104
|
-
total: 0,
|
|
1105
|
-
covered: 0,
|
|
1106
|
-
skipped: 0,
|
|
1107
|
-
pct: "Unknown"
|
|
1108
|
-
});
|
|
1109
|
-
return {
|
|
1110
|
-
lines: empty(),
|
|
1111
|
-
statements: empty(),
|
|
1112
|
-
functions: empty(),
|
|
1113
|
-
branches: empty(),
|
|
1114
|
-
branchesTrue: empty()
|
|
1115
|
-
};
|
|
1116
|
-
}
|
|
1117
|
-
function assertValidSummary(obj) {
|
|
1118
|
-
const valid = obj && obj.lines && obj.statements && obj.functions && obj.branches;
|
|
1119
|
-
if (!valid) {
|
|
1120
|
-
throw new Error(
|
|
1121
|
-
"Invalid summary coverage object, missing keys, found:" + Object.keys(obj).join(",")
|
|
1122
|
-
);
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
var CoverageSummary = class _CoverageSummary {
|
|
1126
|
-
/**
|
|
1127
|
-
* @constructor
|
|
1128
|
-
* @param {Object|CoverageSummary} [obj=undefined] an optional data object or
|
|
1129
|
-
* another coverage summary to initialize this object with.
|
|
1130
|
-
*/
|
|
1131
|
-
constructor(obj) {
|
|
1132
|
-
if (!obj) {
|
|
1133
|
-
this.data = blankSummary();
|
|
1134
|
-
} else if (obj instanceof _CoverageSummary) {
|
|
1135
|
-
this.data = obj.data;
|
|
1136
|
-
} else {
|
|
1137
|
-
this.data = obj;
|
|
1138
|
-
}
|
|
1139
|
-
assertValidSummary(this.data);
|
|
1140
|
-
}
|
|
1141
|
-
/**
|
|
1142
|
-
* merges a second summary coverage object into this one
|
|
1143
|
-
* @param {CoverageSummary} obj - another coverage summary object
|
|
1144
|
-
*/
|
|
1145
|
-
merge(obj) {
|
|
1146
|
-
const keys = [
|
|
1147
|
-
"lines",
|
|
1148
|
-
"statements",
|
|
1149
|
-
"branches",
|
|
1150
|
-
"functions",
|
|
1151
|
-
"branchesTrue"
|
|
1152
|
-
];
|
|
1153
|
-
keys.forEach((key) => {
|
|
1154
|
-
if (obj[key]) {
|
|
1155
|
-
this[key].total += obj[key].total;
|
|
1156
|
-
this[key].covered += obj[key].covered;
|
|
1157
|
-
this[key].skipped += obj[key].skipped;
|
|
1158
|
-
this[key].pct = percent(this[key].covered, this[key].total);
|
|
1159
|
-
}
|
|
1160
|
-
});
|
|
1161
|
-
return this;
|
|
1162
|
-
}
|
|
1163
|
-
/**
|
|
1164
|
-
* returns a POJO that is JSON serializable. May be used to get the raw
|
|
1165
|
-
* summary object.
|
|
1166
|
-
*/
|
|
1167
|
-
toJSON() {
|
|
1168
|
-
return this.data;
|
|
1169
|
-
}
|
|
1170
|
-
/**
|
|
1171
|
-
* return true if summary has no lines of code
|
|
1172
|
-
*/
|
|
1173
|
-
isEmpty() {
|
|
1174
|
-
return this.lines.total === 0;
|
|
1175
|
-
}
|
|
1176
|
-
};
|
|
1177
|
-
dataProperties(CoverageSummary, [
|
|
1178
|
-
"lines",
|
|
1179
|
-
"statements",
|
|
1180
|
-
"functions",
|
|
1181
|
-
"branches",
|
|
1182
|
-
"branchesTrue"
|
|
1183
|
-
]);
|
|
1184
|
-
module2.exports = {
|
|
1185
|
-
CoverageSummary
|
|
1186
|
-
};
|
|
1187
|
-
}
|
|
1188
|
-
});
|
|
1189
|
-
|
|
1190
|
-
// node_modules/istanbul-lib-coverage/lib/file-coverage.js
|
|
1191
|
-
var require_file_coverage = __commonJS({
|
|
1192
|
-
"node_modules/istanbul-lib-coverage/lib/file-coverage.js"(exports2, module2) {
|
|
1193
|
-
"use strict";
|
|
1194
|
-
var percent = require_percent();
|
|
1195
|
-
var dataProperties = require_data_properties();
|
|
1196
|
-
var { CoverageSummary } = require_coverage_summary();
|
|
1197
|
-
function emptyCoverage(filePath, reportLogic) {
|
|
1198
|
-
const cov = {
|
|
1199
|
-
path: filePath,
|
|
1200
|
-
statementMap: {},
|
|
1201
|
-
fnMap: {},
|
|
1202
|
-
branchMap: {},
|
|
1203
|
-
s: {},
|
|
1204
|
-
f: {},
|
|
1205
|
-
b: {}
|
|
1206
|
-
};
|
|
1207
|
-
if (reportLogic) cov.bT = {};
|
|
1208
|
-
return cov;
|
|
1209
|
-
}
|
|
1210
|
-
function assertValidObject(obj) {
|
|
1211
|
-
const valid = obj && obj.path && obj.statementMap && obj.fnMap && obj.branchMap && obj.s && obj.f && obj.b;
|
|
1212
|
-
if (!valid) {
|
|
1213
|
-
throw new Error(
|
|
1214
|
-
"Invalid file coverage object, missing keys, found:" + Object.keys(obj).join(",")
|
|
1215
|
-
);
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
var keyFromLoc = ({ start, end }) => `${start.line}|${start.column}|${end.line}|${end.column}`;
|
|
1219
|
-
var isObj = (o) => !!o && typeof o === "object";
|
|
1220
|
-
var isLineCol = (o) => isObj(o) && typeof o.line === "number" && typeof o.column === "number";
|
|
1221
|
-
var isLoc = (o) => isObj(o) && isLineCol(o.start) && isLineCol(o.end);
|
|
1222
|
-
var getLoc = (o) => isLoc(o) ? o : isLoc(o.loc) ? o.loc : null;
|
|
1223
|
-
var findNearestContainer = (item, map) => {
|
|
1224
|
-
const itemLoc = getLoc(item);
|
|
1225
|
-
if (!itemLoc) return null;
|
|
1226
|
-
let nearestContainingItem = null;
|
|
1227
|
-
let containerDistance = null;
|
|
1228
|
-
let containerKey = null;
|
|
1229
|
-
for (const [i, mapItem] of Object.entries(map)) {
|
|
1230
|
-
const mapLoc = getLoc(mapItem);
|
|
1231
|
-
if (!mapLoc) continue;
|
|
1232
|
-
const distance = [
|
|
1233
|
-
itemLoc.start.line - mapLoc.start.line,
|
|
1234
|
-
itemLoc.start.column - mapLoc.start.column,
|
|
1235
|
-
mapLoc.end.line - itemLoc.end.line,
|
|
1236
|
-
mapLoc.end.column - itemLoc.end.column
|
|
1237
|
-
];
|
|
1238
|
-
if (distance[0] < 0 || distance[2] < 0 || distance[0] === 0 && distance[1] < 0 || distance[2] === 0 && distance[3] < 0) {
|
|
1239
|
-
continue;
|
|
1240
|
-
}
|
|
1241
|
-
if (nearestContainingItem === null) {
|
|
1242
|
-
containerDistance = distance;
|
|
1243
|
-
nearestContainingItem = mapItem;
|
|
1244
|
-
containerKey = i;
|
|
1245
|
-
continue;
|
|
1246
|
-
}
|
|
1247
|
-
const closerBefore = distance[0] < containerDistance[0] || distance[0] === 0 && distance[1] < containerDistance[1];
|
|
1248
|
-
const closerAfter = distance[2] < containerDistance[2] || distance[2] === 0 && distance[3] < containerDistance[3];
|
|
1249
|
-
if (closerBefore || closerAfter) {
|
|
1250
|
-
containerDistance = distance;
|
|
1251
|
-
nearestContainingItem = mapItem;
|
|
1252
|
-
containerKey = i;
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
return containerKey;
|
|
1256
|
-
};
|
|
1257
|
-
var addHits = (aHits, bHits) => {
|
|
1258
|
-
if (typeof aHits === "number" && typeof bHits === "number") {
|
|
1259
|
-
return aHits + bHits;
|
|
1260
|
-
} else if (Array.isArray(aHits) && Array.isArray(bHits)) {
|
|
1261
|
-
return aHits.map((a, i) => (a || 0) + (bHits[i] || 0));
|
|
1262
|
-
}
|
|
1263
|
-
return null;
|
|
1264
|
-
};
|
|
1265
|
-
var addNearestContainerHits = (item, itemHits, map, mapHits) => {
|
|
1266
|
-
const container = findNearestContainer(item, map);
|
|
1267
|
-
if (container) {
|
|
1268
|
-
return addHits(itemHits, mapHits[container]);
|
|
1269
|
-
} else {
|
|
1270
|
-
return itemHits;
|
|
1271
|
-
}
|
|
1272
|
-
};
|
|
1273
|
-
var mergeProp = (aHits, aMap, bHits, bMap, itemKey = keyFromLoc) => {
|
|
1274
|
-
const aItems = {};
|
|
1275
|
-
for (const [key, itemHits] of Object.entries(aHits)) {
|
|
1276
|
-
const item = aMap[key];
|
|
1277
|
-
aItems[itemKey(item)] = [itemHits, item];
|
|
1278
|
-
}
|
|
1279
|
-
const bItems = {};
|
|
1280
|
-
for (const [key, itemHits] of Object.entries(bHits)) {
|
|
1281
|
-
const item = bMap[key];
|
|
1282
|
-
bItems[itemKey(item)] = [itemHits, item];
|
|
1283
|
-
}
|
|
1284
|
-
const mergedItems = {};
|
|
1285
|
-
for (const [key, aValue] of Object.entries(aItems)) {
|
|
1286
|
-
let aItemHits = aValue[0];
|
|
1287
|
-
const aItem = aValue[1];
|
|
1288
|
-
const bValue = bItems[key];
|
|
1289
|
-
if (!bValue) {
|
|
1290
|
-
aItemHits = addNearestContainerHits(aItem, aItemHits, bMap, bHits);
|
|
1291
|
-
} else {
|
|
1292
|
-
aItemHits = addHits(aItemHits, bValue[0]);
|
|
1293
|
-
}
|
|
1294
|
-
mergedItems[key] = [aItemHits, aItem];
|
|
1295
|
-
}
|
|
1296
|
-
for (const [key, bValue] of Object.entries(bItems)) {
|
|
1297
|
-
let bItemHits = bValue[0];
|
|
1298
|
-
const bItem = bValue[1];
|
|
1299
|
-
if (mergedItems[key]) continue;
|
|
1300
|
-
bItemHits = addNearestContainerHits(bItem, bItemHits, aMap, aHits);
|
|
1301
|
-
mergedItems[key] = [bItemHits, bItem];
|
|
1302
|
-
}
|
|
1303
|
-
const hits = {};
|
|
1304
|
-
const map = {};
|
|
1305
|
-
Object.values(mergedItems).forEach(([itemHits, item], i) => {
|
|
1306
|
-
hits[i] = itemHits;
|
|
1307
|
-
map[i] = item;
|
|
1308
|
-
});
|
|
1309
|
-
return [hits, map];
|
|
1310
|
-
};
|
|
1311
|
-
var FileCoverage = class _FileCoverage {
|
|
1312
|
-
/**
|
|
1313
|
-
* @constructor
|
|
1314
|
-
* @param {Object|FileCoverage|String} pathOrObj is a string that initializes
|
|
1315
|
-
* and empty coverage object with the specified file path or a data object that
|
|
1316
|
-
* has all the required properties for a file coverage object.
|
|
1317
|
-
*/
|
|
1318
|
-
constructor(pathOrObj, reportLogic = false) {
|
|
1319
|
-
if (!pathOrObj) {
|
|
1320
|
-
throw new Error(
|
|
1321
|
-
"Coverage must be initialized with a path or an object"
|
|
1322
|
-
);
|
|
1323
|
-
}
|
|
1324
|
-
if (typeof pathOrObj === "string") {
|
|
1325
|
-
this.data = emptyCoverage(pathOrObj, reportLogic);
|
|
1326
|
-
} else if (pathOrObj instanceof _FileCoverage) {
|
|
1327
|
-
this.data = pathOrObj.data;
|
|
1328
|
-
} else if (typeof pathOrObj === "object") {
|
|
1329
|
-
this.data = pathOrObj;
|
|
1330
|
-
} else {
|
|
1331
|
-
throw new Error("Invalid argument to coverage constructor");
|
|
1332
|
-
}
|
|
1333
|
-
assertValidObject(this.data);
|
|
1334
|
-
}
|
|
1335
|
-
/**
|
|
1336
|
-
* returns computed line coverage from statement coverage.
|
|
1337
|
-
* This is a map of hits keyed by line number in the source.
|
|
1338
|
-
*/
|
|
1339
|
-
getLineCoverage() {
|
|
1340
|
-
const statementMap = this.data.statementMap;
|
|
1341
|
-
const statements = this.data.s;
|
|
1342
|
-
const lineMap = /* @__PURE__ */ Object.create(null);
|
|
1343
|
-
Object.entries(statements).forEach(([st, count]) => {
|
|
1344
|
-
if (!statementMap[st]) {
|
|
1345
|
-
return;
|
|
1346
|
-
}
|
|
1347
|
-
const { line } = statementMap[st].start;
|
|
1348
|
-
const prevVal = lineMap[line];
|
|
1349
|
-
if (prevVal === void 0 || prevVal < count) {
|
|
1350
|
-
lineMap[line] = count;
|
|
1351
|
-
}
|
|
1352
|
-
});
|
|
1353
|
-
return lineMap;
|
|
1354
|
-
}
|
|
1355
|
-
/**
|
|
1356
|
-
* returns an array of uncovered line numbers.
|
|
1357
|
-
* @returns {Array} an array of line numbers for which no hits have been
|
|
1358
|
-
* collected.
|
|
1359
|
-
*/
|
|
1360
|
-
getUncoveredLines() {
|
|
1361
|
-
const lc = this.getLineCoverage();
|
|
1362
|
-
const ret = [];
|
|
1363
|
-
Object.entries(lc).forEach(([l, hits]) => {
|
|
1364
|
-
if (hits === 0) {
|
|
1365
|
-
ret.push(l);
|
|
1366
|
-
}
|
|
1367
|
-
});
|
|
1368
|
-
return ret;
|
|
1369
|
-
}
|
|
1370
|
-
/**
|
|
1371
|
-
* returns a map of branch coverage by source line number.
|
|
1372
|
-
* @returns {Object} an object keyed by line number. Each object
|
|
1373
|
-
* has a `covered`, `total` and `coverage` (percentage) property.
|
|
1374
|
-
*/
|
|
1375
|
-
getBranchCoverageByLine() {
|
|
1376
|
-
const branchMap = this.branchMap;
|
|
1377
|
-
const branches = this.b;
|
|
1378
|
-
const ret = {};
|
|
1379
|
-
Object.entries(branchMap).forEach(([k, map]) => {
|
|
1380
|
-
const line = map.line || map.loc.start.line;
|
|
1381
|
-
const branchData = branches[k];
|
|
1382
|
-
ret[line] = ret[line] || [];
|
|
1383
|
-
ret[line].push(...branchData);
|
|
1384
|
-
});
|
|
1385
|
-
Object.entries(ret).forEach(([k, dataArray]) => {
|
|
1386
|
-
const covered = dataArray.filter((item) => item > 0);
|
|
1387
|
-
const coverage = covered.length / dataArray.length * 100;
|
|
1388
|
-
ret[k] = {
|
|
1389
|
-
covered: covered.length,
|
|
1390
|
-
total: dataArray.length,
|
|
1391
|
-
coverage
|
|
1392
|
-
};
|
|
1393
|
-
});
|
|
1394
|
-
return ret;
|
|
1395
|
-
}
|
|
1396
|
-
/**
|
|
1397
|
-
* return a JSON-serializable POJO for this file coverage object
|
|
1398
|
-
*/
|
|
1399
|
-
toJSON() {
|
|
1400
|
-
return this.data;
|
|
1401
|
-
}
|
|
1402
|
-
/**
|
|
1403
|
-
* merges a second coverage object into this one, updating hit counts
|
|
1404
|
-
* @param {FileCoverage} other - the coverage object to be merged into this one.
|
|
1405
|
-
* Note that the other object should have the same structure as this one (same file).
|
|
1406
|
-
*/
|
|
1407
|
-
merge(other) {
|
|
1408
|
-
if (other.all === true) {
|
|
1409
|
-
return;
|
|
1410
|
-
}
|
|
1411
|
-
if (this.all === true) {
|
|
1412
|
-
this.data = other.data;
|
|
1413
|
-
return;
|
|
1414
|
-
}
|
|
1415
|
-
let [hits, map] = mergeProp(
|
|
1416
|
-
this.s,
|
|
1417
|
-
this.statementMap,
|
|
1418
|
-
other.s,
|
|
1419
|
-
other.statementMap
|
|
1420
|
-
);
|
|
1421
|
-
this.data.s = hits;
|
|
1422
|
-
this.data.statementMap = map;
|
|
1423
|
-
const keyFromLocProp = (x) => keyFromLoc(x.loc);
|
|
1424
|
-
const keyFromLocationsProp = (x) => keyFromLoc(x.locations[0]);
|
|
1425
|
-
[hits, map] = mergeProp(
|
|
1426
|
-
this.f,
|
|
1427
|
-
this.fnMap,
|
|
1428
|
-
other.f,
|
|
1429
|
-
other.fnMap,
|
|
1430
|
-
keyFromLocProp
|
|
1431
|
-
);
|
|
1432
|
-
this.data.f = hits;
|
|
1433
|
-
this.data.fnMap = map;
|
|
1434
|
-
[hits, map] = mergeProp(
|
|
1435
|
-
this.b,
|
|
1436
|
-
this.branchMap,
|
|
1437
|
-
other.b,
|
|
1438
|
-
other.branchMap,
|
|
1439
|
-
keyFromLocationsProp
|
|
1440
|
-
);
|
|
1441
|
-
this.data.b = hits;
|
|
1442
|
-
this.data.branchMap = map;
|
|
1443
|
-
if (this.bT && other.bT) {
|
|
1444
|
-
[hits, map] = mergeProp(
|
|
1445
|
-
this.bT,
|
|
1446
|
-
this.branchMap,
|
|
1447
|
-
other.bT,
|
|
1448
|
-
other.branchMap,
|
|
1449
|
-
keyFromLocationsProp
|
|
1450
|
-
);
|
|
1451
|
-
this.data.bT = hits;
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
computeSimpleTotals(property) {
|
|
1455
|
-
let stats = this[property];
|
|
1456
|
-
if (typeof stats === "function") {
|
|
1457
|
-
stats = stats.call(this);
|
|
1458
|
-
}
|
|
1459
|
-
const ret = {
|
|
1460
|
-
total: Object.keys(stats).length,
|
|
1461
|
-
covered: Object.values(stats).filter((v) => !!v).length,
|
|
1462
|
-
skipped: 0
|
|
1463
|
-
};
|
|
1464
|
-
ret.pct = percent(ret.covered, ret.total);
|
|
1465
|
-
return ret;
|
|
1466
|
-
}
|
|
1467
|
-
computeBranchTotals(property) {
|
|
1468
|
-
const stats = this[property];
|
|
1469
|
-
const ret = { total: 0, covered: 0, skipped: 0 };
|
|
1470
|
-
Object.values(stats).forEach((branches) => {
|
|
1471
|
-
ret.covered += branches.filter((hits) => hits > 0).length;
|
|
1472
|
-
ret.total += branches.length;
|
|
1473
|
-
});
|
|
1474
|
-
ret.pct = percent(ret.covered, ret.total);
|
|
1475
|
-
return ret;
|
|
1476
|
-
}
|
|
1477
|
-
/**
|
|
1478
|
-
* resets hit counts for all statements, functions and branches
|
|
1479
|
-
* in this coverage object resulting in zero coverage.
|
|
1480
|
-
*/
|
|
1481
|
-
resetHits() {
|
|
1482
|
-
const statements = this.s;
|
|
1483
|
-
const functions = this.f;
|
|
1484
|
-
const branches = this.b;
|
|
1485
|
-
const branchesTrue = this.bT;
|
|
1486
|
-
Object.keys(statements).forEach((s) => {
|
|
1487
|
-
statements[s] = 0;
|
|
1488
|
-
});
|
|
1489
|
-
Object.keys(functions).forEach((f) => {
|
|
1490
|
-
functions[f] = 0;
|
|
1491
|
-
});
|
|
1492
|
-
Object.keys(branches).forEach((b) => {
|
|
1493
|
-
branches[b].fill(0);
|
|
1494
|
-
});
|
|
1495
|
-
if (branchesTrue) {
|
|
1496
|
-
Object.keys(branchesTrue).forEach((bT) => {
|
|
1497
|
-
branchesTrue[bT].fill(0);
|
|
1498
|
-
});
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
/**
|
|
1502
|
-
* returns a CoverageSummary for this file coverage object
|
|
1503
|
-
* @returns {CoverageSummary}
|
|
1504
|
-
*/
|
|
1505
|
-
toSummary() {
|
|
1506
|
-
const ret = {};
|
|
1507
|
-
ret.lines = this.computeSimpleTotals("getLineCoverage");
|
|
1508
|
-
ret.functions = this.computeSimpleTotals("f", "fnMap");
|
|
1509
|
-
ret.statements = this.computeSimpleTotals("s", "statementMap");
|
|
1510
|
-
ret.branches = this.computeBranchTotals("b");
|
|
1511
|
-
if (this.bT) {
|
|
1512
|
-
ret.branchesTrue = this.computeBranchTotals("bT");
|
|
1513
|
-
}
|
|
1514
|
-
return new CoverageSummary(ret);
|
|
1515
|
-
}
|
|
1516
|
-
};
|
|
1517
|
-
dataProperties(FileCoverage, [
|
|
1518
|
-
"path",
|
|
1519
|
-
"statementMap",
|
|
1520
|
-
"fnMap",
|
|
1521
|
-
"branchMap",
|
|
1522
|
-
"s",
|
|
1523
|
-
"f",
|
|
1524
|
-
"b",
|
|
1525
|
-
"bT",
|
|
1526
|
-
"all"
|
|
1527
|
-
]);
|
|
1528
|
-
module2.exports = {
|
|
1529
|
-
FileCoverage,
|
|
1530
|
-
// exported for testing
|
|
1531
|
-
findNearestContainer,
|
|
1532
|
-
addHits,
|
|
1533
|
-
addNearestContainerHits
|
|
1534
|
-
};
|
|
1535
|
-
}
|
|
1536
|
-
});
|
|
1537
|
-
|
|
1538
|
-
// node_modules/istanbul-lib-coverage/lib/coverage-map.js
|
|
1539
|
-
var require_coverage_map = __commonJS({
|
|
1540
|
-
"node_modules/istanbul-lib-coverage/lib/coverage-map.js"(exports2, module2) {
|
|
1541
|
-
"use strict";
|
|
1542
|
-
var { FileCoverage } = require_file_coverage();
|
|
1543
|
-
var { CoverageSummary } = require_coverage_summary();
|
|
1544
|
-
function maybeConstruct(obj, klass) {
|
|
1545
|
-
if (obj instanceof klass) {
|
|
1546
|
-
return obj;
|
|
1547
|
-
}
|
|
1548
|
-
return new klass(obj);
|
|
1549
|
-
}
|
|
1550
|
-
function loadMap(source) {
|
|
1551
|
-
const data = /* @__PURE__ */ Object.create(null);
|
|
1552
|
-
if (!source) {
|
|
1553
|
-
return data;
|
|
1554
|
-
}
|
|
1555
|
-
Object.entries(source).forEach(([k, cov]) => {
|
|
1556
|
-
data[k] = maybeConstruct(cov, FileCoverage);
|
|
1557
|
-
});
|
|
1558
|
-
return data;
|
|
1559
|
-
}
|
|
1560
|
-
var CoverageMap = class _CoverageMap {
|
|
1561
|
-
/**
|
|
1562
|
-
* @constructor
|
|
1563
|
-
* @param {Object} [obj=undefined] obj A coverage map from which to initialize this
|
|
1564
|
-
* map's contents. This can be the raw global coverage object.
|
|
1565
|
-
*/
|
|
1566
|
-
constructor(obj) {
|
|
1567
|
-
if (obj instanceof _CoverageMap) {
|
|
1568
|
-
this.data = obj.data;
|
|
1569
|
-
} else {
|
|
1570
|
-
this.data = loadMap(obj);
|
|
1571
|
-
}
|
|
1572
|
-
}
|
|
1573
|
-
/**
|
|
1574
|
-
* merges a second coverage map into this one
|
|
1575
|
-
* @param {CoverageMap} obj - a CoverageMap or its raw data. Coverage is merged
|
|
1576
|
-
* correctly for the same files and additional file coverage keys are created
|
|
1577
|
-
* as needed.
|
|
1578
|
-
*/
|
|
1579
|
-
merge(obj) {
|
|
1580
|
-
const other = maybeConstruct(obj, _CoverageMap);
|
|
1581
|
-
Object.values(other.data).forEach((fc) => {
|
|
1582
|
-
this.addFileCoverage(fc);
|
|
1583
|
-
});
|
|
1584
|
-
}
|
|
1585
|
-
/**
|
|
1586
|
-
* filter the coveragemap based on the callback provided
|
|
1587
|
-
* @param {Function (filename)} callback - Returns true if the path
|
|
1588
|
-
* should be included in the coveragemap. False if it should be
|
|
1589
|
-
* removed.
|
|
1590
|
-
*/
|
|
1591
|
-
filter(callback) {
|
|
1592
|
-
Object.keys(this.data).forEach((k) => {
|
|
1593
|
-
if (!callback(k)) {
|
|
1594
|
-
delete this.data[k];
|
|
1595
|
-
}
|
|
1596
|
-
});
|
|
1597
|
-
}
|
|
1598
|
-
/**
|
|
1599
|
-
* returns a JSON-serializable POJO for this coverage map
|
|
1600
|
-
* @returns {Object}
|
|
1601
|
-
*/
|
|
1602
|
-
toJSON() {
|
|
1603
|
-
return this.data;
|
|
1604
|
-
}
|
|
1605
|
-
/**
|
|
1606
|
-
* returns an array for file paths for which this map has coverage
|
|
1607
|
-
* @returns {Array{string}} - array of files
|
|
1608
|
-
*/
|
|
1609
|
-
files() {
|
|
1610
|
-
return Object.keys(this.data);
|
|
1611
|
-
}
|
|
1612
|
-
/**
|
|
1613
|
-
* returns the file coverage for the specified file.
|
|
1614
|
-
* @param {String} file
|
|
1615
|
-
* @returns {FileCoverage}
|
|
1616
|
-
*/
|
|
1617
|
-
fileCoverageFor(file) {
|
|
1618
|
-
const fc = this.data[file];
|
|
1619
|
-
if (!fc) {
|
|
1620
|
-
throw new Error(`No file coverage available for: ${file}`);
|
|
1621
|
-
}
|
|
1622
|
-
return fc;
|
|
1623
|
-
}
|
|
1624
|
-
/**
|
|
1625
|
-
* adds a file coverage object to this map. If the path for the object,
|
|
1626
|
-
* already exists in the map, it is merged with the existing coverage
|
|
1627
|
-
* otherwise a new key is added to the map.
|
|
1628
|
-
* @param {FileCoverage} fc the file coverage to add
|
|
1629
|
-
*/
|
|
1630
|
-
addFileCoverage(fc) {
|
|
1631
|
-
const cov = new FileCoverage(fc);
|
|
1632
|
-
const { path: path10 } = cov;
|
|
1633
|
-
if (this.data[path10]) {
|
|
1634
|
-
this.data[path10].merge(cov);
|
|
1635
|
-
} else {
|
|
1636
|
-
this.data[path10] = cov;
|
|
1637
|
-
}
|
|
1638
|
-
}
|
|
1639
|
-
/**
|
|
1640
|
-
* returns the coverage summary for all the file coverage objects in this map.
|
|
1641
|
-
* @returns {CoverageSummary}
|
|
1642
|
-
*/
|
|
1643
|
-
getCoverageSummary() {
|
|
1644
|
-
const ret = new CoverageSummary();
|
|
1645
|
-
Object.values(this.data).forEach((fc) => {
|
|
1646
|
-
ret.merge(fc.toSummary());
|
|
1647
|
-
});
|
|
1648
|
-
return ret;
|
|
1649
|
-
}
|
|
1650
|
-
};
|
|
1651
|
-
module2.exports = {
|
|
1652
|
-
CoverageMap
|
|
1653
|
-
};
|
|
1654
|
-
}
|
|
1655
|
-
});
|
|
1656
|
-
|
|
1657
|
-
// node_modules/istanbul-lib-coverage/index.js
|
|
1658
|
-
var require_istanbul_lib_coverage = __commonJS({
|
|
1659
|
-
"node_modules/istanbul-lib-coverage/index.js"(exports2, module2) {
|
|
1660
|
-
"use strict";
|
|
1661
|
-
var { FileCoverage } = require_file_coverage();
|
|
1662
|
-
var { CoverageMap } = require_coverage_map();
|
|
1663
|
-
var { CoverageSummary } = require_coverage_summary();
|
|
1664
|
-
module2.exports = {
|
|
1665
|
-
/**
|
|
1666
|
-
* creates a coverage summary object
|
|
1667
|
-
* @param {Object} obj an argument with the same semantics
|
|
1668
|
-
* as the one passed to the `CoverageSummary` constructor
|
|
1669
|
-
* @returns {CoverageSummary}
|
|
1670
|
-
*/
|
|
1671
|
-
createCoverageSummary(obj) {
|
|
1672
|
-
if (obj && obj instanceof CoverageSummary) {
|
|
1673
|
-
return obj;
|
|
1674
|
-
}
|
|
1675
|
-
return new CoverageSummary(obj);
|
|
1676
|
-
},
|
|
1677
|
-
/**
|
|
1678
|
-
* creates a CoverageMap object
|
|
1679
|
-
* @param {Object} obj optional - an argument with the same semantics
|
|
1680
|
-
* as the one passed to the CoverageMap constructor.
|
|
1681
|
-
* @returns {CoverageMap}
|
|
1682
|
-
*/
|
|
1683
|
-
createCoverageMap(obj) {
|
|
1684
|
-
if (obj && obj instanceof CoverageMap) {
|
|
1685
|
-
return obj;
|
|
1686
|
-
}
|
|
1687
|
-
return new CoverageMap(obj);
|
|
1688
|
-
},
|
|
1689
|
-
/**
|
|
1690
|
-
* creates a FileCoverage object
|
|
1691
|
-
* @param {Object} obj optional - an argument with the same semantics
|
|
1692
|
-
* as the one passed to the FileCoverage constructor.
|
|
1693
|
-
* @returns {FileCoverage}
|
|
1694
|
-
*/
|
|
1695
|
-
createFileCoverage(obj) {
|
|
1696
|
-
if (obj && obj instanceof FileCoverage) {
|
|
1697
|
-
return obj;
|
|
1698
|
-
}
|
|
1699
|
-
return new FileCoverage(obj);
|
|
1700
|
-
}
|
|
1701
|
-
};
|
|
1702
|
-
module2.exports.classes = {
|
|
1703
|
-
/**
|
|
1704
|
-
* the file coverage constructor
|
|
1705
|
-
*/
|
|
1706
|
-
FileCoverage
|
|
1707
|
-
};
|
|
1708
|
-
}
|
|
1709
|
-
});
|
|
1710
|
-
|
|
1711
|
-
// node_modules/istanbul-lib-report/lib/path.js
|
|
1712
|
-
var require_path = __commonJS({
|
|
1713
|
-
"node_modules/istanbul-lib-report/lib/path.js"(exports2, module2) {
|
|
1714
|
-
"use strict";
|
|
1715
|
-
var path10 = require("path");
|
|
1716
|
-
var parsePath = path10.parse;
|
|
1717
|
-
var SEP = path10.sep;
|
|
1718
|
-
var origParser = parsePath;
|
|
1719
|
-
var origSep = SEP;
|
|
1720
|
-
function makeRelativeNormalizedPath(str, sep) {
|
|
1721
|
-
const parsed = parsePath(str);
|
|
1722
|
-
let root = parsed.root;
|
|
1723
|
-
let dir;
|
|
1724
|
-
let file = parsed.base;
|
|
1725
|
-
let quoted;
|
|
1726
|
-
let pos;
|
|
1727
|
-
if (sep === "\\") {
|
|
1728
|
-
pos = root.indexOf(":\\");
|
|
1729
|
-
if (pos >= 0) {
|
|
1730
|
-
root = root.substring(0, pos + 2);
|
|
1731
|
-
}
|
|
1732
|
-
}
|
|
1733
|
-
dir = parsed.dir.substring(root.length);
|
|
1734
|
-
if (str === "") {
|
|
1735
|
-
return [];
|
|
1736
|
-
}
|
|
1737
|
-
if (sep !== "/") {
|
|
1738
|
-
quoted = new RegExp(sep.replace(/\W/g, "\\$&"), "g");
|
|
1739
|
-
dir = dir.replace(quoted, "/");
|
|
1740
|
-
file = file.replace(quoted, "/");
|
|
1741
|
-
}
|
|
1742
|
-
if (dir !== "") {
|
|
1743
|
-
dir = `${dir}/${file}`;
|
|
1744
|
-
} else {
|
|
1745
|
-
dir = file;
|
|
1746
|
-
}
|
|
1747
|
-
if (dir.substring(0, 1) === "/") {
|
|
1748
|
-
dir = dir.substring(1);
|
|
1749
|
-
}
|
|
1750
|
-
dir = dir.split(/\/+/);
|
|
1751
|
-
return dir;
|
|
1752
|
-
}
|
|
1753
|
-
var Path = class _Path {
|
|
1754
|
-
constructor(strOrArray) {
|
|
1755
|
-
if (Array.isArray(strOrArray)) {
|
|
1756
|
-
this.v = strOrArray;
|
|
1757
|
-
} else if (typeof strOrArray === "string") {
|
|
1758
|
-
this.v = makeRelativeNormalizedPath(strOrArray, SEP);
|
|
1759
|
-
} else {
|
|
1760
|
-
throw new Error(
|
|
1761
|
-
`Invalid Path argument must be string or array:${strOrArray}`
|
|
1762
|
-
);
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
toString() {
|
|
1766
|
-
return this.v.join("/");
|
|
1767
|
-
}
|
|
1768
|
-
hasParent() {
|
|
1769
|
-
return this.v.length > 0;
|
|
1770
|
-
}
|
|
1771
|
-
parent() {
|
|
1772
|
-
if (!this.hasParent()) {
|
|
1773
|
-
throw new Error("Unable to get parent for 0 elem path");
|
|
1774
|
-
}
|
|
1775
|
-
const p = this.v.slice();
|
|
1776
|
-
p.pop();
|
|
1777
|
-
return new _Path(p);
|
|
1778
|
-
}
|
|
1779
|
-
elements() {
|
|
1780
|
-
return this.v.slice();
|
|
1781
|
-
}
|
|
1782
|
-
name() {
|
|
1783
|
-
return this.v.slice(-1)[0];
|
|
1784
|
-
}
|
|
1785
|
-
contains(other) {
|
|
1786
|
-
let i;
|
|
1787
|
-
if (other.length > this.length) {
|
|
1788
|
-
return false;
|
|
1789
|
-
}
|
|
1790
|
-
for (i = 0; i < other.length; i += 1) {
|
|
1791
|
-
if (this.v[i] !== other.v[i]) {
|
|
1792
|
-
return false;
|
|
1793
|
-
}
|
|
1794
|
-
}
|
|
1795
|
-
return true;
|
|
1796
|
-
}
|
|
1797
|
-
ancestorOf(other) {
|
|
1798
|
-
return other.contains(this) && other.length !== this.length;
|
|
1799
|
-
}
|
|
1800
|
-
descendantOf(other) {
|
|
1801
|
-
return this.contains(other) && other.length !== this.length;
|
|
1802
|
-
}
|
|
1803
|
-
commonPrefixPath(other) {
|
|
1804
|
-
const len = this.length > other.length ? other.length : this.length;
|
|
1805
|
-
let i;
|
|
1806
|
-
const ret = [];
|
|
1807
|
-
for (i = 0; i < len; i += 1) {
|
|
1808
|
-
if (this.v[i] === other.v[i]) {
|
|
1809
|
-
ret.push(this.v[i]);
|
|
1810
|
-
} else {
|
|
1811
|
-
break;
|
|
1812
|
-
}
|
|
1813
|
-
}
|
|
1814
|
-
return new _Path(ret);
|
|
1815
|
-
}
|
|
1816
|
-
static compare(a, b) {
|
|
1817
|
-
const al = a.length;
|
|
1818
|
-
const bl = b.length;
|
|
1819
|
-
if (al < bl) {
|
|
1820
|
-
return -1;
|
|
1821
|
-
}
|
|
1822
|
-
if (al > bl) {
|
|
1823
|
-
return 1;
|
|
1824
|
-
}
|
|
1825
|
-
const astr = a.toString();
|
|
1826
|
-
const bstr = b.toString();
|
|
1827
|
-
return astr < bstr ? -1 : astr > bstr ? 1 : 0;
|
|
1828
|
-
}
|
|
1829
|
-
};
|
|
1830
|
-
["push", "pop", "shift", "unshift", "splice"].forEach((fn) => {
|
|
1831
|
-
Object.defineProperty(Path.prototype, fn, {
|
|
1832
|
-
value(...args) {
|
|
1833
|
-
return this.v[fn](...args);
|
|
1834
|
-
}
|
|
1835
|
-
});
|
|
1836
|
-
});
|
|
1837
|
-
Object.defineProperty(Path.prototype, "length", {
|
|
1838
|
-
enumerable: true,
|
|
1839
|
-
get() {
|
|
1840
|
-
return this.v.length;
|
|
1841
|
-
}
|
|
1842
|
-
});
|
|
1843
|
-
module2.exports = Path;
|
|
1844
|
-
Path.tester = {
|
|
1845
|
-
setParserAndSep(p, sep) {
|
|
1846
|
-
parsePath = p;
|
|
1847
|
-
SEP = sep;
|
|
1848
|
-
},
|
|
1849
|
-
reset() {
|
|
1850
|
-
parsePath = origParser;
|
|
1851
|
-
SEP = origSep;
|
|
1852
|
-
}
|
|
1853
|
-
};
|
|
1854
|
-
}
|
|
1855
|
-
});
|
|
1856
|
-
|
|
1857
|
-
// node_modules/istanbul-lib-report/lib/summarizer-factory.js
|
|
1858
|
-
var require_summarizer_factory = __commonJS({
|
|
1859
|
-
"node_modules/istanbul-lib-report/lib/summarizer-factory.js"(exports2, module2) {
|
|
1860
|
-
"use strict";
|
|
1861
|
-
var coverage = require_istanbul_lib_coverage();
|
|
1862
|
-
var Path = require_path();
|
|
1863
|
-
var { BaseNode, BaseTree } = require_tree();
|
|
1864
|
-
var ReportNode = class _ReportNode extends BaseNode {
|
|
1865
|
-
constructor(path10, fileCoverage) {
|
|
1866
|
-
super();
|
|
1867
|
-
this.path = path10;
|
|
1868
|
-
this.parent = null;
|
|
1869
|
-
this.fileCoverage = fileCoverage;
|
|
1870
|
-
this.children = [];
|
|
1871
|
-
}
|
|
1872
|
-
static createRoot(children) {
|
|
1873
|
-
const root = new _ReportNode(new Path([]));
|
|
1874
|
-
children.forEach((child) => {
|
|
1875
|
-
root.addChild(child);
|
|
1876
|
-
});
|
|
1877
|
-
return root;
|
|
1878
|
-
}
|
|
1879
|
-
addChild(child) {
|
|
1880
|
-
child.parent = this;
|
|
1881
|
-
this.children.push(child);
|
|
1882
|
-
}
|
|
1883
|
-
asRelative(p) {
|
|
1884
|
-
if (p.substring(0, 1) === "/") {
|
|
1885
|
-
return p.substring(1);
|
|
1886
|
-
}
|
|
1887
|
-
return p;
|
|
1888
|
-
}
|
|
1889
|
-
getQualifiedName() {
|
|
1890
|
-
return this.asRelative(this.path.toString());
|
|
1891
|
-
}
|
|
1892
|
-
getRelativeName() {
|
|
1893
|
-
const parent = this.getParent();
|
|
1894
|
-
const myPath = this.path;
|
|
1895
|
-
let relPath;
|
|
1896
|
-
let i;
|
|
1897
|
-
const parentPath = parent ? parent.path : new Path([]);
|
|
1898
|
-
if (parentPath.ancestorOf(myPath)) {
|
|
1899
|
-
relPath = new Path(myPath.elements());
|
|
1900
|
-
for (i = 0; i < parentPath.length; i += 1) {
|
|
1901
|
-
relPath.shift();
|
|
1902
|
-
}
|
|
1903
|
-
return this.asRelative(relPath.toString());
|
|
1904
|
-
}
|
|
1905
|
-
return this.asRelative(this.path.toString());
|
|
1906
|
-
}
|
|
1907
|
-
getParent() {
|
|
1908
|
-
return this.parent;
|
|
1909
|
-
}
|
|
1910
|
-
getChildren() {
|
|
1911
|
-
return this.children;
|
|
1912
|
-
}
|
|
1913
|
-
isSummary() {
|
|
1914
|
-
return !this.fileCoverage;
|
|
1915
|
-
}
|
|
1916
|
-
getFileCoverage() {
|
|
1917
|
-
return this.fileCoverage;
|
|
1918
|
-
}
|
|
1919
|
-
getCoverageSummary(filesOnly) {
|
|
1920
|
-
const cacheProp = `c_${filesOnly ? "files" : "full"}`;
|
|
1921
|
-
let summary;
|
|
1922
|
-
if (Object.prototype.hasOwnProperty.call(this, cacheProp)) {
|
|
1923
|
-
return this[cacheProp];
|
|
1924
|
-
}
|
|
1925
|
-
if (!this.isSummary()) {
|
|
1926
|
-
summary = this.getFileCoverage().toSummary();
|
|
1927
|
-
} else {
|
|
1928
|
-
let count = 0;
|
|
1929
|
-
summary = coverage.createCoverageSummary();
|
|
1930
|
-
this.getChildren().forEach((child) => {
|
|
1931
|
-
if (filesOnly && child.isSummary()) {
|
|
1932
|
-
return;
|
|
1933
|
-
}
|
|
1934
|
-
count += 1;
|
|
1935
|
-
summary.merge(child.getCoverageSummary(filesOnly));
|
|
1936
|
-
});
|
|
1937
|
-
if (count === 0 && filesOnly) {
|
|
1938
|
-
summary = null;
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
this[cacheProp] = summary;
|
|
1942
|
-
return summary;
|
|
1943
|
-
}
|
|
1944
|
-
};
|
|
1945
|
-
var ReportTree = class extends BaseTree {
|
|
1946
|
-
constructor(root, childPrefix) {
|
|
1947
|
-
super(root);
|
|
1948
|
-
const maybePrefix = (node) => {
|
|
1949
|
-
if (childPrefix && !node.isRoot()) {
|
|
1950
|
-
node.path.unshift(childPrefix);
|
|
1951
|
-
}
|
|
1952
|
-
};
|
|
1953
|
-
this.visit({
|
|
1954
|
-
onDetail: maybePrefix,
|
|
1955
|
-
onSummary(node) {
|
|
1956
|
-
maybePrefix(node);
|
|
1957
|
-
node.children.sort((a, b) => {
|
|
1958
|
-
const astr = a.path.toString();
|
|
1959
|
-
const bstr = b.path.toString();
|
|
1960
|
-
return astr < bstr ? -1 : astr > bstr ? 1 : (
|
|
1961
|
-
/* istanbul ignore next */
|
|
1962
|
-
0
|
|
1963
|
-
);
|
|
1964
|
-
});
|
|
1965
|
-
}
|
|
1966
|
-
});
|
|
1967
|
-
}
|
|
1968
|
-
};
|
|
1969
|
-
function findCommonParent(paths) {
|
|
1970
|
-
return paths.reduce(
|
|
1971
|
-
(common, path10) => common.commonPrefixPath(path10),
|
|
1972
|
-
paths[0] || new Path([])
|
|
1973
|
-
);
|
|
1974
|
-
}
|
|
1975
|
-
function findOrCreateParent(parentPath, nodeMap, created = () => {
|
|
1976
|
-
}) {
|
|
1977
|
-
let parent = nodeMap[parentPath.toString()];
|
|
1978
|
-
if (!parent) {
|
|
1979
|
-
parent = new ReportNode(parentPath);
|
|
1980
|
-
nodeMap[parentPath.toString()] = parent;
|
|
1981
|
-
created(parentPath, parent);
|
|
1982
|
-
}
|
|
1983
|
-
return parent;
|
|
1984
|
-
}
|
|
1985
|
-
function toDirParents(list) {
|
|
1986
|
-
const nodeMap = /* @__PURE__ */ Object.create(null);
|
|
1987
|
-
list.forEach((o) => {
|
|
1988
|
-
const parent = findOrCreateParent(o.path.parent(), nodeMap);
|
|
1989
|
-
parent.addChild(new ReportNode(o.path, o.fileCoverage));
|
|
1990
|
-
});
|
|
1991
|
-
return Object.values(nodeMap);
|
|
1992
|
-
}
|
|
1993
|
-
function addAllPaths(topPaths, nodeMap, path10, node) {
|
|
1994
|
-
const parent = findOrCreateParent(
|
|
1995
|
-
path10.parent(),
|
|
1996
|
-
nodeMap,
|
|
1997
|
-
(parentPath, parent2) => {
|
|
1998
|
-
if (parentPath.hasParent()) {
|
|
1999
|
-
addAllPaths(topPaths, nodeMap, parentPath, parent2);
|
|
2000
|
-
} else {
|
|
2001
|
-
topPaths.push(parent2);
|
|
2002
|
-
}
|
|
2003
|
-
}
|
|
2004
|
-
);
|
|
2005
|
-
parent.addChild(node);
|
|
2006
|
-
}
|
|
2007
|
-
function foldIntoOneDir(node, parent) {
|
|
2008
|
-
const { children } = node;
|
|
2009
|
-
if (children.length === 1 && !children[0].fileCoverage) {
|
|
2010
|
-
children[0].parent = parent;
|
|
2011
|
-
return foldIntoOneDir(children[0], parent);
|
|
2012
|
-
}
|
|
2013
|
-
node.children = children.map((child) => foldIntoOneDir(child, node));
|
|
2014
|
-
return node;
|
|
2015
|
-
}
|
|
2016
|
-
function pkgSummaryPrefix(dirParents, commonParent) {
|
|
2017
|
-
if (!dirParents.some((dp) => dp.path.length === 0)) {
|
|
2018
|
-
return;
|
|
2019
|
-
}
|
|
2020
|
-
if (commonParent.length === 0) {
|
|
2021
|
-
return "root";
|
|
2022
|
-
}
|
|
2023
|
-
return commonParent.name();
|
|
2024
|
-
}
|
|
2025
|
-
var SummarizerFactory = class {
|
|
2026
|
-
constructor(coverageMap, defaultSummarizer = "pkg") {
|
|
2027
|
-
this._coverageMap = coverageMap;
|
|
2028
|
-
this._defaultSummarizer = defaultSummarizer;
|
|
2029
|
-
this._initialList = coverageMap.files().map((filePath) => ({
|
|
2030
|
-
filePath,
|
|
2031
|
-
path: new Path(filePath),
|
|
2032
|
-
fileCoverage: coverageMap.fileCoverageFor(filePath)
|
|
2033
|
-
}));
|
|
2034
|
-
this._commonParent = findCommonParent(
|
|
2035
|
-
this._initialList.map((o) => o.path.parent())
|
|
2036
|
-
);
|
|
2037
|
-
if (this._commonParent.length > 0) {
|
|
2038
|
-
this._initialList.forEach((o) => {
|
|
2039
|
-
o.path.splice(0, this._commonParent.length);
|
|
2040
|
-
});
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
get defaultSummarizer() {
|
|
2044
|
-
return this[this._defaultSummarizer];
|
|
2045
|
-
}
|
|
2046
|
-
get flat() {
|
|
2047
|
-
if (!this._flat) {
|
|
2048
|
-
this._flat = new ReportTree(
|
|
2049
|
-
ReportNode.createRoot(
|
|
2050
|
-
this._initialList.map(
|
|
2051
|
-
(node) => new ReportNode(node.path, node.fileCoverage)
|
|
2052
|
-
)
|
|
2053
|
-
)
|
|
2054
|
-
);
|
|
2055
|
-
}
|
|
2056
|
-
return this._flat;
|
|
2057
|
-
}
|
|
2058
|
-
_createPkg() {
|
|
2059
|
-
const dirParents = toDirParents(this._initialList);
|
|
2060
|
-
if (dirParents.length === 1) {
|
|
2061
|
-
return new ReportTree(dirParents[0]);
|
|
2062
|
-
}
|
|
2063
|
-
return new ReportTree(
|
|
2064
|
-
ReportNode.createRoot(dirParents),
|
|
2065
|
-
pkgSummaryPrefix(dirParents, this._commonParent)
|
|
2066
|
-
);
|
|
2067
|
-
}
|
|
2068
|
-
get pkg() {
|
|
2069
|
-
if (!this._pkg) {
|
|
2070
|
-
this._pkg = this._createPkg();
|
|
2071
|
-
}
|
|
2072
|
-
return this._pkg;
|
|
2073
|
-
}
|
|
2074
|
-
_createNested() {
|
|
2075
|
-
const nodeMap = /* @__PURE__ */ Object.create(null);
|
|
2076
|
-
const topPaths = [];
|
|
2077
|
-
this._initialList.forEach((o) => {
|
|
2078
|
-
const node = new ReportNode(o.path, o.fileCoverage);
|
|
2079
|
-
addAllPaths(topPaths, nodeMap, o.path, node);
|
|
2080
|
-
});
|
|
2081
|
-
const topNodes = topPaths.map((node) => foldIntoOneDir(node));
|
|
2082
|
-
if (topNodes.length === 1) {
|
|
2083
|
-
return new ReportTree(topNodes[0]);
|
|
2084
|
-
}
|
|
2085
|
-
return new ReportTree(ReportNode.createRoot(topNodes));
|
|
2086
|
-
}
|
|
2087
|
-
get nested() {
|
|
2088
|
-
if (!this._nested) {
|
|
2089
|
-
this._nested = this._createNested();
|
|
2090
|
-
}
|
|
2091
|
-
return this._nested;
|
|
2092
|
-
}
|
|
2093
|
-
};
|
|
2094
|
-
module2.exports = SummarizerFactory;
|
|
2095
|
-
}
|
|
2096
|
-
});
|
|
2097
|
-
|
|
2098
|
-
// node_modules/istanbul-lib-report/lib/context.js
|
|
2099
|
-
var require_context = __commonJS({
|
|
2100
|
-
"node_modules/istanbul-lib-report/lib/context.js"(exports2, module2) {
|
|
2101
|
-
"use strict";
|
|
2102
|
-
var fs6 = require("fs");
|
|
2103
|
-
var FileWriter = require_file_writer();
|
|
2104
|
-
var XMLWriter = require_xml_writer();
|
|
2105
|
-
var tree = require_tree();
|
|
2106
|
-
var watermarks = require_watermarks();
|
|
2107
|
-
var SummarizerFactory = require_summarizer_factory();
|
|
2108
|
-
function defaultSourceLookup(path10) {
|
|
2109
|
-
try {
|
|
2110
|
-
return fs6.readFileSync(path10, "utf8");
|
|
2111
|
-
} catch (ex) {
|
|
2112
|
-
throw new Error(`Unable to lookup source: ${path10} (${ex.message})`);
|
|
2113
|
-
}
|
|
2114
|
-
}
|
|
2115
|
-
function normalizeWatermarks(specified = {}) {
|
|
2116
|
-
Object.entries(watermarks.getDefault()).forEach(([k, value]) => {
|
|
2117
|
-
const specValue = specified[k];
|
|
2118
|
-
if (!Array.isArray(specValue) || specValue.length !== 2) {
|
|
2119
|
-
specified[k] = value;
|
|
2120
|
-
}
|
|
2121
|
-
});
|
|
2122
|
-
return specified;
|
|
2123
|
-
}
|
|
2124
|
-
var Context = class {
|
|
2125
|
-
constructor(opts) {
|
|
2126
|
-
this.dir = opts.dir || "coverage";
|
|
2127
|
-
this.watermarks = normalizeWatermarks(opts.watermarks);
|
|
2128
|
-
this.sourceFinder = opts.sourceFinder || defaultSourceLookup;
|
|
2129
|
-
this._summarizerFactory = new SummarizerFactory(
|
|
2130
|
-
opts.coverageMap,
|
|
2131
|
-
opts.defaultSummarizer
|
|
2132
|
-
);
|
|
2133
|
-
this.data = {};
|
|
2134
|
-
}
|
|
2135
|
-
/**
|
|
2136
|
-
* returns a FileWriter implementation for reporting use. Also available
|
|
2137
|
-
* as the `writer` property on the context.
|
|
2138
|
-
* @returns {Writer}
|
|
2139
|
-
*/
|
|
2140
|
-
getWriter() {
|
|
2141
|
-
return this.writer;
|
|
2142
|
-
}
|
|
2143
|
-
/**
|
|
2144
|
-
* returns the source code for the specified file path or throws if
|
|
2145
|
-
* the source could not be found.
|
|
2146
|
-
* @param {String} filePath the file path as found in a file coverage object
|
|
2147
|
-
* @returns {String} the source code
|
|
2148
|
-
*/
|
|
2149
|
-
getSource(filePath) {
|
|
2150
|
-
return this.sourceFinder(filePath);
|
|
2151
|
-
}
|
|
2152
|
-
/**
|
|
2153
|
-
* returns the coverage class given a coverage
|
|
2154
|
-
* types and a percentage value.
|
|
2155
|
-
* @param {String} type - the coverage type, one of `statements`, `functions`,
|
|
2156
|
-
* `branches`, or `lines`
|
|
2157
|
-
* @param {Number} value - the percentage value
|
|
2158
|
-
* @returns {String} one of `high`, `medium` or `low`
|
|
2159
|
-
*/
|
|
2160
|
-
classForPercent(type, value) {
|
|
2161
|
-
const watermarks2 = this.watermarks[type];
|
|
2162
|
-
if (!watermarks2) {
|
|
2163
|
-
return "unknown";
|
|
2164
|
-
}
|
|
2165
|
-
if (value < watermarks2[0]) {
|
|
2166
|
-
return "low";
|
|
2167
|
-
}
|
|
2168
|
-
if (value >= watermarks2[1]) {
|
|
2169
|
-
return "high";
|
|
2170
|
-
}
|
|
2171
|
-
return "medium";
|
|
2172
|
-
}
|
|
2173
|
-
/**
|
|
2174
|
-
* returns an XML writer for the supplied content writer
|
|
2175
|
-
* @param {ContentWriter} contentWriter the content writer to which the returned XML writer
|
|
2176
|
-
* writes data
|
|
2177
|
-
* @returns {XMLWriter}
|
|
2178
|
-
*/
|
|
2179
|
-
getXMLWriter(contentWriter) {
|
|
2180
|
-
return new XMLWriter(contentWriter);
|
|
2181
|
-
}
|
|
2182
|
-
/**
|
|
2183
|
-
* returns a full visitor given a partial one.
|
|
2184
|
-
* @param {Object} partialVisitor a partial visitor only having the functions of
|
|
2185
|
-
* interest to the caller. These functions are called with a scope that is the
|
|
2186
|
-
* supplied object.
|
|
2187
|
-
* @returns {Visitor}
|
|
2188
|
-
*/
|
|
2189
|
-
getVisitor(partialVisitor) {
|
|
2190
|
-
return new tree.Visitor(partialVisitor);
|
|
2191
|
-
}
|
|
2192
|
-
getTree(name = "defaultSummarizer") {
|
|
2193
|
-
return this._summarizerFactory[name];
|
|
2194
|
-
}
|
|
2195
|
-
};
|
|
2196
|
-
Object.defineProperty(Context.prototype, "writer", {
|
|
2197
|
-
enumerable: true,
|
|
2198
|
-
get() {
|
|
2199
|
-
if (!this.data.writer) {
|
|
2200
|
-
this.data.writer = new FileWriter(this.dir);
|
|
2201
|
-
}
|
|
2202
|
-
return this.data.writer;
|
|
2203
|
-
}
|
|
2204
|
-
});
|
|
2205
|
-
module2.exports = Context;
|
|
2206
|
-
}
|
|
2207
|
-
});
|
|
2208
|
-
|
|
2209
|
-
// node_modules/istanbul-lib-report/lib/report-base.js
|
|
2210
|
-
var require_report_base = __commonJS({
|
|
2211
|
-
"node_modules/istanbul-lib-report/lib/report-base.js"(exports2, module2) {
|
|
2212
|
-
"use strict";
|
|
2213
|
-
var _summarizer = Symbol("ReportBase.#summarizer");
|
|
2214
|
-
var ReportBase = class {
|
|
2215
|
-
constructor(opts = {}) {
|
|
2216
|
-
this[_summarizer] = opts.summarizer;
|
|
2217
|
-
}
|
|
2218
|
-
execute(context) {
|
|
2219
|
-
context.getTree(this[_summarizer]).visit(this, context);
|
|
2220
|
-
}
|
|
2221
|
-
};
|
|
2222
|
-
module2.exports = ReportBase;
|
|
2223
|
-
}
|
|
2224
|
-
});
|
|
2225
|
-
|
|
2226
|
-
// node_modules/istanbul-lib-report/index.js
|
|
2227
|
-
var require_istanbul_lib_report = __commonJS({
|
|
2228
|
-
"node_modules/istanbul-lib-report/index.js"(exports2, module2) {
|
|
2229
|
-
"use strict";
|
|
2230
|
-
var Context = require_context();
|
|
2231
|
-
var watermarks = require_watermarks();
|
|
2232
|
-
var ReportBase = require_report_base();
|
|
2233
|
-
module2.exports = {
|
|
2234
|
-
/**
|
|
2235
|
-
* returns a reporting context for the supplied options
|
|
2236
|
-
* @param {Object} [opts=null] opts
|
|
2237
|
-
* @returns {Context}
|
|
2238
|
-
*/
|
|
2239
|
-
createContext(opts) {
|
|
2240
|
-
return new Context(opts);
|
|
2241
|
-
},
|
|
2242
|
-
/**
|
|
2243
|
-
* returns the default watermarks that would be used when not
|
|
2244
|
-
* overridden
|
|
2245
|
-
* @returns {Object} an object with `statements`, `functions`, `branches`,
|
|
2246
|
-
* and `line` keys. Each value is a 2 element array that has the low and
|
|
2247
|
-
* high watermark as percentages.
|
|
2248
|
-
*/
|
|
2249
|
-
getDefaultWatermarks() {
|
|
2250
|
-
return watermarks.getDefault();
|
|
2251
|
-
},
|
|
2252
|
-
/**
|
|
2253
|
-
* Base class for all reports
|
|
2254
|
-
*/
|
|
2255
|
-
ReportBase
|
|
2256
|
-
};
|
|
2257
|
-
}
|
|
2258
|
-
});
|
|
2259
|
-
|
|
2260
|
-
// node_modules/istanbul-reports/index.js
|
|
2261
|
-
var require_istanbul_reports = __commonJS({
|
|
2262
|
-
"node_modules/istanbul-reports/index.js"(exports2, module2) {
|
|
2263
|
-
"use strict";
|
|
2264
|
-
var path10 = require("path");
|
|
2265
|
-
module2.exports = {
|
|
2266
|
-
create(name, cfg) {
|
|
2267
|
-
cfg = cfg || {};
|
|
2268
|
-
let Cons;
|
|
2269
|
-
try {
|
|
2270
|
-
Cons = require(path10.join(__dirname, "lib", name));
|
|
2271
|
-
} catch (e) {
|
|
2272
|
-
if (e.code !== "MODULE_NOT_FOUND") {
|
|
2273
|
-
throw e;
|
|
2274
|
-
}
|
|
2275
|
-
Cons = require(name);
|
|
2276
|
-
}
|
|
2277
|
-
return new Cons(cfg);
|
|
2278
|
-
}
|
|
2279
|
-
};
|
|
2280
|
-
}
|
|
2281
|
-
});
|
|
2282
|
-
|
|
2283
36
|
// src/lib/env-utils.ts
|
|
2284
37
|
var safeEnv;
|
|
2285
38
|
var init_env_utils = __esm({
|
|
@@ -4210,10 +1963,11 @@ var require_lib = __commonJS({
|
|
|
4210
1963
|
var path9 = __toESM(require("node:path"), 1);
|
|
4211
1964
|
var os2 = __toESM(require("node:os"), 1);
|
|
4212
1965
|
var fsSync3 = __toESM(require("node:fs"), 1);
|
|
4213
|
-
var
|
|
1966
|
+
var import_istanbul_lib_coverage2 = require("istanbul-lib-coverage");
|
|
4214
1967
|
var fs5 = __toESM(require("node:fs/promises"), 1);
|
|
4215
|
-
var LibReport = __toESM(
|
|
4216
|
-
var
|
|
1968
|
+
var LibReport = __toESM(require("istanbul-lib-report"), 1);
|
|
1969
|
+
var import_text = __toESM(require("istanbul-reports/lib/text"), 1);
|
|
1970
|
+
var import_text_summary = __toESM(require("istanbul-reports/lib/text-summary"), 1);
|
|
4217
1971
|
init_env_utils();
|
|
4218
1972
|
init_exec();
|
|
4219
1973
|
init_args();
|
|
@@ -5034,7 +2788,8 @@ var decideShouldRunJest = (vitestFiles, jestFiles, opts) => {
|
|
|
5034
2788
|
|
|
5035
2789
|
// src/lib/coverage-core.ts
|
|
5036
2790
|
var fs3 = __toESM(require("node:fs/promises"), 1);
|
|
5037
|
-
var
|
|
2791
|
+
var import_picomatch = __toESM(require("picomatch"), 1);
|
|
2792
|
+
var import_istanbul_lib_coverage = require("istanbul-lib-coverage");
|
|
5038
2793
|
|
|
5039
2794
|
// src/lib/paths.ts
|
|
5040
2795
|
var path6 = __toESM(require("node:path"), 1);
|
|
@@ -5055,12 +2810,6 @@ var linkifyPadded = (absPath, line, hint) => (padded) => {
|
|
|
5055
2810
|
};
|
|
5056
2811
|
|
|
5057
2812
|
// src/lib/coverage-core.ts
|
|
5058
|
-
var import_meta = {};
|
|
5059
|
-
var require2 = (0, import_node_module.createRequire)(import_meta.url);
|
|
5060
|
-
var { createCoverageMap } = (
|
|
5061
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5062
|
-
require2("istanbul-lib-coverage")
|
|
5063
|
-
);
|
|
5064
2813
|
var readCoverageJson = async (jsonPath) => {
|
|
5065
2814
|
try {
|
|
5066
2815
|
const txt = await fs3.readFile(jsonPath, "utf8");
|
|
@@ -5074,11 +2823,11 @@ var readCoverageJson = async (jsonPath) => {
|
|
|
5074
2823
|
}
|
|
5075
2824
|
};
|
|
5076
2825
|
var filterCoverageMap = (map, opts) => {
|
|
5077
|
-
const picomatchFn =
|
|
2826
|
+
const picomatchFn = import_picomatch.default;
|
|
5078
2827
|
const makeMatcher = (globs) => globs.length === 0 ? () => true : picomatchFn(globs, { dot: true, nocase: true });
|
|
5079
2828
|
const includeMatch = makeMatcher(opts.includes.length ? opts.includes : ["**/*"]);
|
|
5080
2829
|
const excludeMatch = makeMatcher(opts.excludes);
|
|
5081
|
-
const out = createCoverageMap({});
|
|
2830
|
+
const out = (0, import_istanbul_lib_coverage.createCoverageMap)({});
|
|
5082
2831
|
for (const absFile of map.files()) {
|
|
5083
2832
|
const rel = relativizeForMatch(absFile, opts.root);
|
|
5084
2833
|
const summary = map.fileCoverageFor(absFile).toSummary();
|
|
@@ -7243,14 +4992,13 @@ ${footer}`;
|
|
|
7243
4992
|
}
|
|
7244
4993
|
|
|
7245
4994
|
// src/lib/program.ts
|
|
7246
|
-
var
|
|
4995
|
+
var import_meta = {};
|
|
7247
4996
|
var jestBin = "./node_modules/.bin/jest";
|
|
7248
4997
|
var babelNodeBin = "./node_modules/.bin/babel-node";
|
|
7249
4998
|
var moduleSpecifierForRequire = (
|
|
7250
4999
|
// @ts-ignore
|
|
7251
|
-
typeof __filename !== "undefined" ? __filename :
|
|
5000
|
+
typeof __filename !== "undefined" ? __filename : import_meta.url
|
|
7252
5001
|
);
|
|
7253
|
-
var requireCjs = (0, import_node_module2.createRequire)(moduleSpecifierForRequire);
|
|
7254
5002
|
var registerSignalHandlersOnce = () => {
|
|
7255
5003
|
let handled = false;
|
|
7256
5004
|
const on = (sig) => {
|
|
@@ -7266,9 +5014,7 @@ Received ${sig}, exiting...
|
|
|
7266
5014
|
process.once("SIGINT", on);
|
|
7267
5015
|
process.once("SIGTERM", on);
|
|
7268
5016
|
};
|
|
7269
|
-
var isDebug = () => Boolean(
|
|
7270
|
-
process.env.TEST_CLI_DEBUG
|
|
7271
|
-
);
|
|
5017
|
+
var isDebug = () => Boolean(process.env.TEST_CLI_DEBUG);
|
|
7272
5018
|
var mergeLcov = async () => {
|
|
7273
5019
|
const jestLcovPath = "coverage/jest/lcov.info";
|
|
7274
5020
|
const vitestLcovPath = "coverage/vitest/lcov.info";
|
|
@@ -7326,24 +5072,17 @@ var emitMergedCoverage = async (ui, opts) => {
|
|
|
7326
5072
|
if (isDebug()) {
|
|
7327
5073
|
console.info(`Decoded coverage entries \u2192 jest: ${jestFilesCount}`);
|
|
7328
5074
|
}
|
|
7329
|
-
const
|
|
7330
|
-
"istanbul-lib-coverage"
|
|
7331
|
-
);
|
|
7332
|
-
const map = createCoverageMap2({});
|
|
5075
|
+
const map = (0, import_istanbul_lib_coverage2.createCoverageMap)({});
|
|
7333
5076
|
if (jestFilesCount > 0) {
|
|
7334
5077
|
try {
|
|
7335
5078
|
map.merge(jestData);
|
|
7336
5079
|
} catch (mergeJestError) {
|
|
7337
|
-
console.warn(
|
|
7338
|
-
`Failed merging jest coverage JSON: ${String(mergeJestError)}`
|
|
7339
|
-
);
|
|
5080
|
+
console.warn(`Failed merging jest coverage JSON: ${String(mergeJestError)}`);
|
|
7340
5081
|
}
|
|
7341
5082
|
}
|
|
7342
5083
|
if (map.files().length === 0) {
|
|
7343
5084
|
if (isDebug()) {
|
|
7344
|
-
console.info(
|
|
7345
|
-
"No JSON coverage to merge; skipping merged coverage print."
|
|
7346
|
-
);
|
|
5085
|
+
console.info("No JSON coverage to merge; skipping merged coverage print.");
|
|
7347
5086
|
}
|
|
7348
5087
|
return;
|
|
7349
5088
|
}
|
|
@@ -7371,18 +5110,12 @@ var emitMergedCoverage = async (ui, opts) => {
|
|
|
7371
5110
|
}
|
|
7372
5111
|
let changedFilesOutput = [];
|
|
7373
5112
|
try {
|
|
7374
|
-
const out = await runText(
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
{
|
|
7378
|
-
env: safeEnv(process.env, {})
|
|
7379
|
-
}
|
|
7380
|
-
);
|
|
5113
|
+
const out = await runText("git", ["diff", "--name-only", "--diff-filter=ACMRTUXB", "HEAD"], {
|
|
5114
|
+
env: safeEnv(process.env, {})
|
|
5115
|
+
});
|
|
7381
5116
|
changedFilesOutput = out.split(/\r?\n/).map((line) => line.trim()).filter(Boolean).map((filePathText) => filePathText.replace(/\\/g, "/"));
|
|
7382
5117
|
} catch (gitError) {
|
|
7383
|
-
console.warn(
|
|
7384
|
-
`git diff failed when deriving changed files: ${String(gitError)}`
|
|
7385
|
-
);
|
|
5118
|
+
console.warn(`git diff failed when deriving changed files: ${String(gitError)}`);
|
|
7386
5119
|
}
|
|
7387
5120
|
await printPerFileCompositeTables({
|
|
7388
5121
|
map: filteredMap,
|
|
@@ -7398,10 +5131,7 @@ var emitMergedCoverage = async (ui, opts) => {
|
|
|
7398
5131
|
coverageMap: filteredMap,
|
|
7399
5132
|
defaultSummarizer: "nested"
|
|
7400
5133
|
});
|
|
7401
|
-
const reporters = ui === "jest" ? [
|
|
7402
|
-
Reports.create("text", { file: "coverage.txt" }),
|
|
7403
|
-
Reports.create("text-summary", { file: "coverage-summary.txt" })
|
|
7404
|
-
];
|
|
5134
|
+
const reporters = ui === "jest" ? [(0, import_text.default)({ file: "coverage.txt" })] : [(0, import_text.default)({ file: "coverage.txt" }), (0, import_text_summary.default)({ file: "coverage-summary.txt" })];
|
|
7405
5135
|
const colorizeIstanbulLine = (lineText) => {
|
|
7406
5136
|
const separator = /^[-=\s]+$/;
|
|
7407
5137
|
if (separator.test(lineText.trim())) {
|
|
@@ -7419,18 +5149,15 @@ var emitMergedCoverage = async (ui, opts) => {
|
|
|
7419
5149
|
return `${colorize(label)}${sep}${colorize(`${num}${pct}`)}`;
|
|
7420
5150
|
}
|
|
7421
5151
|
);
|
|
7422
|
-
return updated.replace(
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
const
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
return colorize(`( ${coveredText}/${totalText} )`);
|
|
7432
|
-
}
|
|
7433
|
-
);
|
|
5152
|
+
return updated.replace(/\(\s*(\d+)\s*\/\s*(\d+)\s*\)/, (_match, coveredText, totalText) => {
|
|
5153
|
+
const percent = (() => {
|
|
5154
|
+
const totalCount = Number(totalText);
|
|
5155
|
+
const coveredCount = Number(coveredText);
|
|
5156
|
+
return totalCount > 0 ? coveredCount / totalCount * 100 : 0;
|
|
5157
|
+
})();
|
|
5158
|
+
const colorize = tintPct(percent);
|
|
5159
|
+
return colorize(`( ${coveredText}/${totalText} )`);
|
|
5160
|
+
});
|
|
7434
5161
|
}
|
|
7435
5162
|
if (lineText.includes("|")) {
|
|
7436
5163
|
const parts = lineText.split("|");
|
|
@@ -7466,11 +5193,7 @@ var emitMergedCoverage = async (ui, opts) => {
|
|
|
7466
5193
|
reporter.execute(context);
|
|
7467
5194
|
}
|
|
7468
5195
|
const textPath = path9.resolve("coverage", "merged", "coverage.txt");
|
|
7469
|
-
const summaryPath = path9.resolve(
|
|
7470
|
-
"coverage",
|
|
7471
|
-
"merged",
|
|
7472
|
-
"coverage-summary.txt"
|
|
7473
|
-
);
|
|
5196
|
+
const summaryPath = path9.resolve("coverage", "merged", "coverage-summary.txt");
|
|
7474
5197
|
const filesToPrint = [];
|
|
7475
5198
|
if (fsSync3.existsSync(textPath)) {
|
|
7476
5199
|
filesToPrint.push(textPath);
|
|
@@ -7495,7 +5218,7 @@ var emitMergedCoverage = async (ui, opts) => {
|
|
|
7495
5218
|
}
|
|
7496
5219
|
}
|
|
7497
5220
|
} else {
|
|
7498
|
-
const stdoutReporters = ui === "jest" ? [
|
|
5221
|
+
const stdoutReporters = ui === "jest" ? [(0, import_text.default)({})] : [(0, import_text.default)({}), (0, import_text_summary.default)({})];
|
|
7499
5222
|
for (const reporter of stdoutReporters) {
|
|
7500
5223
|
reporter.execute(context);
|
|
7501
5224
|
}
|
|
@@ -7554,9 +5277,7 @@ var program = async () => {
|
|
|
7554
5277
|
coverageMaxHotspots: coverageMaxHotspotsArg,
|
|
7555
5278
|
coveragePageFit
|
|
7556
5279
|
} = deriveArgs(argv);
|
|
7557
|
-
console.info(
|
|
7558
|
-
`Selection \u2192 specified=${selectionSpecified} paths=${selectionPaths.length}`
|
|
7559
|
-
);
|
|
5280
|
+
console.info(`Selection \u2192 specified=${selectionSpecified} paths=${selectionPaths.length}`);
|
|
7560
5281
|
const { jest } = argsForDiscovery(["run"], jestArgs);
|
|
7561
5282
|
const selectionLooksLikeTest = selectionPaths.some(
|
|
7562
5283
|
(pathText) => /\.(test|spec)\.[tj]sx?$/i.test(pathText) || /(^|\/)tests?\//i.test(pathText)
|
|
@@ -7646,12 +5367,9 @@ var program = async () => {
|
|
|
7646
5367
|
const prodSelections2 = expandedProdSelections;
|
|
7647
5368
|
for (const cfg of projectConfigs) {
|
|
7648
5369
|
const cfgCwd = path9.dirname(cfg);
|
|
7649
|
-
const allTests = await discoverJestResilient(
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
cwd: cfgCwd
|
|
7653
|
-
}
|
|
7654
|
-
);
|
|
5370
|
+
const allTests = await discoverJestResilient([...jestDiscoveryArgs, "--config", cfg], {
|
|
5371
|
+
cwd: cfgCwd
|
|
5372
|
+
});
|
|
7655
5373
|
let directPerProject = [];
|
|
7656
5374
|
try {
|
|
7657
5375
|
directPerProject = await selectDirectTestsForProduction({
|
|
@@ -7661,11 +5379,7 @@ var program = async () => {
|
|
|
7661
5379
|
});
|
|
7662
5380
|
} catch (err) {
|
|
7663
5381
|
if (isDebug()) {
|
|
7664
|
-
console.warn(
|
|
7665
|
-
`direct selection failed for project ${path9.basename(
|
|
7666
|
-
cfg
|
|
7667
|
-
)}: ${String(err)}`
|
|
7668
|
-
);
|
|
5382
|
+
console.warn(`direct selection failed for project ${path9.basename(cfg)}: ${String(err)}`);
|
|
7669
5383
|
}
|
|
7670
5384
|
}
|
|
7671
5385
|
perProjectFiles.set(cfg, directPerProject);
|
|
@@ -7678,12 +5392,9 @@ var program = async () => {
|
|
|
7678
5392
|
);
|
|
7679
5393
|
for (const cfg of projectConfigs) {
|
|
7680
5394
|
const cfgCwd = path9.dirname(cfg);
|
|
7681
|
-
const files = await discoverJestResilient(
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
cwd: cfgCwd
|
|
7685
|
-
}
|
|
7686
|
-
);
|
|
5395
|
+
const files = await discoverJestResilient([...jestDiscoveryArgs, "--config", cfg], {
|
|
5396
|
+
cwd: cfgCwd
|
|
5397
|
+
});
|
|
7687
5398
|
perProjectFiles.set(cfg, files);
|
|
7688
5399
|
}
|
|
7689
5400
|
}
|
|
@@ -7706,20 +5417,14 @@ var program = async () => {
|
|
|
7706
5417
|
perProjectFiltered.set(cfg, onlyOwned);
|
|
7707
5418
|
}
|
|
7708
5419
|
let jestFiles = Array.from(perProjectFiltered.values()).flat();
|
|
7709
|
-
console.info(
|
|
7710
|
-
`Discovery results \u2192 jest=${jestFiles.length} (projects=${projectConfigs.length})`
|
|
7711
|
-
);
|
|
5420
|
+
console.info(`Discovery results \u2192 jest=${jestFiles.length} (projects=${projectConfigs.length})`);
|
|
7712
5421
|
const looksLikeTestPath = (candidatePath) => /\.(test|spec)\.[tj]sx?$/i.test(candidatePath) || /(^|\/)tests?\//i.test(candidatePath);
|
|
7713
5422
|
const prodSelections = expandedProdSelections;
|
|
7714
5423
|
let effectiveJestFiles = jestFiles.slice();
|
|
7715
5424
|
if (selectionHasPaths && prodSelections.length > 0) {
|
|
7716
|
-
console.info(
|
|
7717
|
-
`rg related \u2192 prodSelections=${prodSelections.length} (starting)`
|
|
7718
|
-
);
|
|
5425
|
+
console.info(`rg related \u2192 prodSelections=${prodSelections.length} (starting)`);
|
|
7719
5426
|
const repoRootForRefinement = workspaceRoot ?? await findRepoRoot();
|
|
7720
|
-
const selectionKey = prodSelections.map(
|
|
7721
|
-
(absPath) => path9.relative(repoRootForRefinement, absPath).replace(/\\/g, "/")
|
|
7722
|
-
).sort((a, b) => a.localeCompare(b)).join("|");
|
|
5427
|
+
const selectionKey = prodSelections.map((absPath) => path9.relative(repoRootForRefinement, absPath).replace(/\\/g, "/")).sort((a, b) => a.localeCompare(b)).join("|");
|
|
7723
5428
|
const { cachedRelated: cachedRelated2, findRelatedTestsFast: findRelatedTestsFast2, DEFAULT_TEST_GLOBS: DEFAULT_TEST_GLOBS2 } = await Promise.resolve().then(() => (init_fast_related(), fast_related_exports));
|
|
7724
5429
|
const { DEFAULT_EXCLUDE: DEFAULT_EXCLUDE2 } = await Promise.resolve().then(() => (init_args(), args_exports));
|
|
7725
5430
|
const rgMatches = await cachedRelated2({
|
|
@@ -7738,12 +5443,8 @@ var program = async () => {
|
|
|
7738
5443
|
const normalizedCandidates = rgMatches.map(
|
|
7739
5444
|
(candidatePath) => candidatePath.replace(/\\/g, "/")
|
|
7740
5445
|
);
|
|
7741
|
-
normalizedCandidates.forEach(
|
|
7742
|
-
|
|
7743
|
-
);
|
|
7744
|
-
const rgSet = new Set(
|
|
7745
|
-
rgMatches.map((candidate) => candidate.replace(/\\/g, "/"))
|
|
7746
|
-
);
|
|
5446
|
+
normalizedCandidates.forEach((candidatePath) => console.info(` - ${candidatePath}`));
|
|
5447
|
+
const rgSet = new Set(rgMatches.map((candidate) => candidate.replace(/\\/g, "/")));
|
|
7747
5448
|
if (rgSet.size > 0) {
|
|
7748
5449
|
if (selectionIncludesProdPaths) {
|
|
7749
5450
|
const rgCandidates = Array.from(rgSet);
|
|
@@ -7773,9 +5474,7 @@ var program = async () => {
|
|
|
7773
5474
|
const base = path9.basename(withoutExt);
|
|
7774
5475
|
const segs = withoutExt.split("/");
|
|
7775
5476
|
const tail2 = segs.slice(-2).join("/");
|
|
7776
|
-
return Array.from(
|
|
7777
|
-
new Set([withoutExt, base, tail2].filter(Boolean))
|
|
7778
|
-
);
|
|
5477
|
+
return Array.from(new Set([withoutExt, base, tail2].filter(Boolean)));
|
|
7779
5478
|
};
|
|
7780
5479
|
const seeds = Array.from(new Set(prodSelections.flatMap(toSeeds)));
|
|
7781
5480
|
const includesSeed = (text) => seeds.some((seed) => text.includes(seed));
|
|
@@ -7882,9 +5581,7 @@ var program = async () => {
|
|
|
7882
5581
|
).flatMap((rel) => {
|
|
7883
5582
|
const base = path9.basename(rel);
|
|
7884
5583
|
const segments = rel.split("/");
|
|
7885
|
-
return Array.from(
|
|
7886
|
-
new Set([rel, base, segments.slice(-2).join("/")].filter(Boolean))
|
|
7887
|
-
);
|
|
5584
|
+
return Array.from(new Set([rel, base, segments.slice(-2).join("/")].filter(Boolean)));
|
|
7888
5585
|
});
|
|
7889
5586
|
const includesSeed = (text) => seeds.some((seed) => text.includes(seed));
|
|
7890
5587
|
const tryReadFile = async (absPath) => {
|
|
@@ -7897,17 +5594,7 @@ var program = async () => {
|
|
|
7897
5594
|
const resolveLocalImport = (fromFile, spec) => {
|
|
7898
5595
|
const baseDir = path9.dirname(fromFile);
|
|
7899
5596
|
const candidate = path9.resolve(baseDir, spec);
|
|
7900
|
-
const extensions = [
|
|
7901
|
-
"",
|
|
7902
|
-
".ts",
|
|
7903
|
-
".tsx",
|
|
7904
|
-
".js",
|
|
7905
|
-
".jsx",
|
|
7906
|
-
".mjs",
|
|
7907
|
-
".cjs",
|
|
7908
|
-
".mts",
|
|
7909
|
-
".cts"
|
|
7910
|
-
];
|
|
5597
|
+
const extensions = ["", ".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts"];
|
|
7911
5598
|
for (const ext of extensions) {
|
|
7912
5599
|
const fullPath = ext ? `${candidate}${ext}` : candidate;
|
|
7913
5600
|
if (fsSync3.existsSync(fullPath)) {
|
|
@@ -8030,9 +5717,7 @@ var program = async () => {
|
|
|
8030
5717
|
if (jestKept.length) {
|
|
8031
5718
|
effectiveJestFiles = jestKept;
|
|
8032
5719
|
}
|
|
8033
|
-
console.info(
|
|
8034
|
-
`fallback refine (transitive) \u2192 jest=${effectiveJestFiles.length}`
|
|
8035
|
-
);
|
|
5720
|
+
console.info(`fallback refine (transitive) \u2192 jest=${effectiveJestFiles.length}`);
|
|
8036
5721
|
}
|
|
8037
5722
|
}
|
|
8038
5723
|
const jestDecision = decideShouldRunJest([], effectiveJestFiles, {
|
|
@@ -8045,21 +5730,15 @@ var program = async () => {
|
|
|
8045
5730
|
const msg = shouldRunJest ? `Jest selected (${sharePct}% of discovered tests; reason: ${jestDecision.reason})` : `Skipping Jest (${sharePct}% of discovered tests; reason: ${jestDecision.reason})`;
|
|
8046
5731
|
console.info(`Discovery \u2192 jest: ${jestCount}. ${msg}`);
|
|
8047
5732
|
if (!shouldRunJest) {
|
|
8048
|
-
console.warn(
|
|
8049
|
-
|
|
8050
|
-
);
|
|
8051
|
-
console.info(
|
|
8052
|
-
`Jest args: ${[...jestDiscoveryArgs, "--listTests"].join(" ")}`
|
|
8053
|
-
);
|
|
5733
|
+
console.warn("No matching tests were discovered for either Vitest or Jest.");
|
|
5734
|
+
console.info(`Jest args: ${[...jestDiscoveryArgs, "--listTests"].join(" ")}`);
|
|
8054
5735
|
console.info(
|
|
8055
5736
|
"Tip: check your -t/--testNamePattern and file path; Jest lists files selected by your patterns."
|
|
8056
5737
|
);
|
|
8057
5738
|
process.exit(1);
|
|
8058
5739
|
return;
|
|
8059
5740
|
}
|
|
8060
|
-
console.info(
|
|
8061
|
-
`Run plan \u2192 Jest maybe=${shouldRunJest} (projects=${projectConfigs.length})`
|
|
8062
|
-
);
|
|
5741
|
+
console.info(`Run plan \u2192 Jest maybe=${shouldRunJest} (projects=${projectConfigs.length})`);
|
|
8063
5742
|
let jestExitCode = 0;
|
|
8064
5743
|
const executedTestFilesSet = /* @__PURE__ */ new Set();
|
|
8065
5744
|
if (shouldRunJest) {
|
|
@@ -8072,9 +5751,7 @@ var program = async () => {
|
|
|
8072
5751
|
const totalProjectsToRun = projectsToRun.length;
|
|
8073
5752
|
const stripFooter = (text) => {
|
|
8074
5753
|
const lines = text.split("\n");
|
|
8075
|
-
const idx = lines.findIndex(
|
|
8076
|
-
(ln) => /^Test Files\s/.test(stripAnsiSimple(ln))
|
|
8077
|
-
);
|
|
5754
|
+
const idx = lines.findIndex((ln) => /^Test Files\s/.test(stripAnsiSimple(ln)));
|
|
8078
5755
|
return idx >= 0 ? lines.slice(0, idx).join("\n").trimEnd() : text;
|
|
8079
5756
|
};
|
|
8080
5757
|
for (let projIndex = 0; projIndex < projectsToRun.length; projIndex += 1) {
|
|
@@ -8082,11 +5759,7 @@ var program = async () => {
|
|
|
8082
5759
|
const isLastProject = projIndex === totalProjectsToRun - 1;
|
|
8083
5760
|
const files = perProjectFiltered.get(cfg) ?? [];
|
|
8084
5761
|
if (files.length === 0) {
|
|
8085
|
-
console.info(
|
|
8086
|
-
`Project ${path9.basename(
|
|
8087
|
-
cfg
|
|
8088
|
-
)}: 0 matching tests after filter; skipping.`
|
|
8089
|
-
);
|
|
5762
|
+
console.info(`Project ${path9.basename(cfg)}: 0 matching tests after filter; skipping.`);
|
|
8090
5763
|
continue;
|
|
8091
5764
|
}
|
|
8092
5765
|
files.forEach(
|
|
@@ -8100,22 +5773,12 @@ var program = async () => {
|
|
|
8100
5773
|
try {
|
|
8101
5774
|
if (!fsSync3.existsSync(reporterPath)) {
|
|
8102
5775
|
fsSync3.mkdirSync(path9.dirname(reporterPath), { recursive: true });
|
|
8103
|
-
fsSync3.writeFileSync(
|
|
8104
|
-
reporterPath,
|
|
8105
|
-
JEST_BRIDGE_REPORTER_SOURCE,
|
|
8106
|
-
"utf8"
|
|
8107
|
-
);
|
|
5776
|
+
fsSync3.writeFileSync(reporterPath, JEST_BRIDGE_REPORTER_SOURCE, "utf8");
|
|
8108
5777
|
}
|
|
8109
5778
|
} catch (ensureReporterError) {
|
|
8110
|
-
console.warn(
|
|
8111
|
-
`Unable to ensure jest bridge reporter: ${String(
|
|
8112
|
-
ensureReporterError
|
|
8113
|
-
)}`
|
|
8114
|
-
);
|
|
5779
|
+
console.warn(`Unable to ensure jest bridge reporter: ${String(ensureReporterError)}`);
|
|
8115
5780
|
}
|
|
8116
|
-
const selectedFilesForCoverage = selectionPaths.filter((pathToken) => /[\\/]/.test(pathToken)).filter((pathToken) => !looksLikeTestPath(pathToken)).map(
|
|
8117
|
-
(pathToken) => path9.relative(repoRootForDiscovery, pathToken).replace(/\\\\/g, "/")
|
|
8118
|
-
).filter((rel) => rel && !/^\.+\//.test(rel)).map((rel) => rel.startsWith("./") ? rel : `./${rel}`);
|
|
5781
|
+
const selectedFilesForCoverage = selectionPaths.filter((pathToken) => /[\\/]/.test(pathToken)).filter((pathToken) => !looksLikeTestPath(pathToken)).map((pathToken) => path9.relative(repoRootForDiscovery, pathToken).replace(/\\\\/g, "/")).filter((rel) => rel && !/^\.+\//.test(rel)).map((rel) => rel.startsWith("./") ? rel : `./${rel}`);
|
|
8119
5782
|
const coverageFromArgs = [];
|
|
8120
5783
|
for (const relPath of selectedFilesForCoverage) {
|
|
8121
5784
|
coverageFromArgs.push("--collectCoverageFrom", relPath);
|
|
@@ -8168,21 +5831,15 @@ var program = async () => {
|
|
|
8168
5831
|
});
|
|
8169
5832
|
if (debug) {
|
|
8170
5833
|
const preview = pretty.split("\n").slice(0, 3).join("\n");
|
|
8171
|
-
console.info(
|
|
8172
|
-
|
|
8173
|
-
${preview}${pretty.includes("\n") ? "\n\u2026" : ""}`
|
|
8174
|
-
);
|
|
5834
|
+
console.info(`pretty preview (json):
|
|
5835
|
+
${preview}${pretty.includes("\n") ? "\n\u2026" : ""}`);
|
|
8175
5836
|
}
|
|
8176
5837
|
} catch (jsonErr) {
|
|
8177
5838
|
const debug = isDebug();
|
|
8178
5839
|
if (debug) {
|
|
8179
|
-
console.info(
|
|
8180
|
-
"renderer: fallback to text prettifier (missing/invalid JSON)"
|
|
8181
|
-
);
|
|
5840
|
+
console.info("renderer: fallback to text prettifier (missing/invalid JSON)");
|
|
8182
5841
|
console.info(String(jsonErr));
|
|
8183
|
-
console.info(
|
|
8184
|
-
`fallback: raw output lines=${output.split(/\r?\n/).length}`
|
|
8185
|
-
);
|
|
5842
|
+
console.info(`fallback: raw output lines=${output.split(/\r?\n/).length}`);
|
|
8186
5843
|
}
|
|
8187
5844
|
const renderOpts = {
|
|
8188
5845
|
cwd: repoRootForDiscovery,
|
|
@@ -8191,10 +5848,8 @@ ${preview}${pretty.includes("\n") ? "\n\u2026" : ""}`
|
|
|
8191
5848
|
pretty = formatJestOutputVitest(output, renderOpts);
|
|
8192
5849
|
if (debug) {
|
|
8193
5850
|
const preview = pretty.split("\n").slice(0, 3).join("\n");
|
|
8194
|
-
console.info(
|
|
8195
|
-
|
|
8196
|
-
${preview}${pretty.includes("\n") ? "\n\u2026" : ""}`
|
|
8197
|
-
);
|
|
5851
|
+
console.info(`pretty preview (text):
|
|
5852
|
+
${preview}${pretty.includes("\n") ? "\n\u2026" : ""}`);
|
|
8198
5853
|
}
|
|
8199
5854
|
}
|
|
8200
5855
|
if (!isLastProject) {
|