ccqa 1.42.1 → 1.42.2
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/dist/bin/ccqa.mjs +40 -18
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/bin/ccqa.mjs
CHANGED
|
@@ -6353,6 +6353,14 @@ function resolveCovered(prepared, ranges) {
|
|
|
6353
6353
|
const VENDOR = /(^|\/)node_modules\//;
|
|
6354
6354
|
/** `(rsc)`, `(pages-dir-browser)`, ... — which build layer, not part of the path. */
|
|
6355
6355
|
const LAYER = /^\([^)]*\)\//;
|
|
6356
|
+
/**
|
|
6357
|
+
* What follows `[project]/` is relative to the build's project root, not to
|
|
6358
|
+
* where the build ran. Only this one root is stripped: Turbopack's others
|
|
6359
|
+
* (`[output]`, `[externals]`) name generated code, not files on disk.
|
|
6360
|
+
*/
|
|
6361
|
+
const TURBOPACK_PROJECT = /^\[project\]\//;
|
|
6362
|
+
/** The ` [layer] (ecmascript)` suffix Turbopack appends when it names a module. */
|
|
6363
|
+
const MODULE_IDENTIFIER = / \[[^\]]*\]/;
|
|
6356
6364
|
const DEPENDENCY = { kind: "dependency" };
|
|
6357
6365
|
const UNRESOLVED = { kind: "unresolved" };
|
|
6358
6366
|
/** `absolute` as a posix path under `root`, or undefined when it is not under it. */
|
|
@@ -6371,9 +6379,12 @@ function normalizeSourcePath(raw, roots) {
|
|
|
6371
6379
|
path = slash < 0 ? afterScheme : afterScheme.slice(from);
|
|
6372
6380
|
}
|
|
6373
6381
|
path = posix.normalize(path.replace(LAYER, ""));
|
|
6382
|
+
const rooted = TURBOPACK_PROJECT.test(path);
|
|
6383
|
+
if (rooted) path = path.replace(TURBOPACK_PROJECT, "");
|
|
6374
6384
|
if (path === "" || path === ".") return UNRESOLVED;
|
|
6375
6385
|
if (path.startsWith("<") || path.startsWith("[")) return UNRESOLVED;
|
|
6376
|
-
|
|
6386
|
+
if (rooted && MODULE_IDENTIFIER.test(path)) return UNRESOLVED;
|
|
6387
|
+
const absolute = path.startsWith("/") ? path : resolve(rooted ? roots.root : roots.base, path);
|
|
6377
6388
|
const rel = toProjectRelative(roots.root, absolute);
|
|
6378
6389
|
if (rel === void 0) return UNRESOLVED;
|
|
6379
6390
|
return VENDOR.test(rel) ? DEPENDENCY : {
|
|
@@ -6575,18 +6586,14 @@ var FrontendResolution = class {
|
|
|
6575
6586
|
* nearly all of them misses on a deployment that pushes nothing.
|
|
6576
6587
|
*/
|
|
6577
6588
|
sourceMapLoaders(script, source) {
|
|
6578
|
-
const loaders = [];
|
|
6579
6589
|
const reference = readSourceMappingUrl(source);
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
if (target !== void 0) loaders.push(() => this.fetchText(target));
|
|
6586
|
-
}
|
|
6587
|
-
}
|
|
6590
|
+
const inline = reference === void 0 ? void 0 : decodeInlineSourceMap(reference);
|
|
6591
|
+
const mapUrl = reference !== void 0 && inline === void 0 ? absoluteOrUndefined(reference, script.url) : void 0;
|
|
6592
|
+
const loaders = [];
|
|
6593
|
+
if (inline !== void 0) loaders.push(() => Promise.resolve(inline));
|
|
6594
|
+
if (mapUrl !== void 0) loaders.push(() => this.fetchText(mapUrl));
|
|
6588
6595
|
const stored = this.fetchStoredMap;
|
|
6589
|
-
if (stored !== void 0) loaders.push(() => stored(script.url));
|
|
6596
|
+
if (stored !== void 0) loaders.push(() => stored(mapUrl ?? script.url, script.url));
|
|
6590
6597
|
return loaders;
|
|
6591
6598
|
}
|
|
6592
6599
|
};
|
|
@@ -7191,7 +7198,7 @@ var Engine = class {
|
|
|
7191
7198
|
coverageDir: opts.coverageDir,
|
|
7192
7199
|
roots: opts.roots,
|
|
7193
7200
|
fetchText: (url) => this.fetchThroughBrowser(url),
|
|
7194
|
-
fetchStoredMap: (scriptUrl) => this.storedMapFor(scriptUrl),
|
|
7201
|
+
fetchStoredMap: (mapUrl, scriptUrl) => this.storedMapFor(mapUrl, scriptUrl),
|
|
7195
7202
|
warn: opts.warn
|
|
7196
7203
|
});
|
|
7197
7204
|
}
|
|
@@ -7458,19 +7465,24 @@ var Engine = class {
|
|
|
7458
7465
|
}
|
|
7459
7466
|
}
|
|
7460
7467
|
/**
|
|
7461
|
-
* The map a deploy stored for
|
|
7468
|
+
* The map a deploy stored for a script, if this run knows where to ask.
|
|
7462
7469
|
* Addressed by the path under the asset origin rather than the URL, so the
|
|
7463
7470
|
* push and the read agree without either knowing the other's host.
|
|
7471
|
+
*
|
|
7472
|
+
* The script's pointer names the map, but it may name it somewhere this run
|
|
7473
|
+
* never declared — a map-only host. Guessing from the script is worse than
|
|
7474
|
+
* the pointer and better than not asking, so it stays as the fallback.
|
|
7464
7475
|
*/
|
|
7465
|
-
async storedMapFor(scriptUrl) {
|
|
7476
|
+
async storedMapFor(mapUrl, scriptUrl) {
|
|
7466
7477
|
const stored = this.opts.fetchStoredSourceMap;
|
|
7467
7478
|
if (stored === void 0) return void 0;
|
|
7468
|
-
const
|
|
7469
|
-
|
|
7479
|
+
const origins = [...this.opts.origins, ...this.opts.assetOrigins ?? []];
|
|
7480
|
+
const key = storeKeyOf(mapUrl, origins) ?? storeKeyOf(scriptUrl, origins);
|
|
7481
|
+
if (key === void 0) return void 0;
|
|
7470
7482
|
try {
|
|
7471
|
-
return await stored(
|
|
7483
|
+
return await stored(key);
|
|
7472
7484
|
} catch (err) {
|
|
7473
|
-
this.opts.warn(`could not read the stored source map for ${
|
|
7485
|
+
this.opts.warn(`could not read the stored source map for ${key}: ${message(err)}`);
|
|
7474
7486
|
return;
|
|
7475
7487
|
}
|
|
7476
7488
|
}
|
|
@@ -7494,6 +7506,16 @@ function message(error) {
|
|
|
7494
7506
|
* is part of what the browser asked for, so the push has to have used it too.
|
|
7495
7507
|
* A URL from an origin the run never declared is not ours to look up.
|
|
7496
7508
|
*/
|
|
7509
|
+
/**
|
|
7510
|
+
* The key a stored map is read by: the asset path, with `.map` appended only
|
|
7511
|
+
* when it is missing. A push files each map under its own path, so a URL that
|
|
7512
|
+
* already names a map needs no suffix; only a script URL has to guess one.
|
|
7513
|
+
*/
|
|
7514
|
+
function storeKeyOf(url, origins) {
|
|
7515
|
+
const assetPath = assetPathOf(url, origins);
|
|
7516
|
+
if (assetPath === void 0) return void 0;
|
|
7517
|
+
return assetPath.endsWith(".map") ? assetPath : `${assetPath}.map`;
|
|
7518
|
+
}
|
|
7497
7519
|
function assetPathOf(url, origins) {
|
|
7498
7520
|
let parsed;
|
|
7499
7521
|
try {
|
package/dist/package.json
CHANGED