@valbuild/tanstack-build 0.144.4 → 0.146.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/declarations/src/contract.d.ts +36 -0
- package/dist/declarations/src/index.d.ts +1 -0
- package/dist/declarations/src/node/index.d.ts +1 -1
- package/dist/declarations/src/node/vendorLayer.d.ts +26 -2
- package/dist/declarations/src/valModules.d.ts +29 -0
- package/dist/{regeneratorValues-4fe49970.esm.js → regeneratorValues-77cb8c45.esm.js} +11 -1
- package/dist/{regeneratorValues-295cad22.cjs.prod.js → regeneratorValues-eb61e1b2.cjs.prod.js} +12 -0
- package/dist/{regeneratorValues-5b6a1f70.cjs.dev.js → regeneratorValues-f5d7ce8a.cjs.dev.js} +12 -0
- package/dist/valbuild-tanstack-build.cjs.dev.js +215 -18
- package/dist/valbuild-tanstack-build.cjs.prod.js +215 -18
- package/dist/valbuild-tanstack-build.esm.js +214 -18
- package/node/dist/valbuild-tanstack-build-node.cjs.dev.js +710 -364
- package/node/dist/valbuild-tanstack-build-node.cjs.prod.js +710 -364
- package/node/dist/valbuild-tanstack-build-node.esm.js +711 -366
- package/package.json +1 -1
|
@@ -1,13 +1,117 @@
|
|
|
1
|
-
import { a as _asyncToGenerator, b as _regenerator, c as _toConsumableArray,
|
|
1
|
+
import { l as _toPropertyKey, a as _asyncToGenerator, b as _regenerator, c as _toConsumableArray, f as _objectSpread2, _ as _createForOfIteratorHelper, d as _slicedToArray, A as ASSET_BASE, h as _regeneratorValues, g as _defineProperty, e as _typeof } from '../../dist/regeneratorValues-77cb8c45.esm.js';
|
|
2
2
|
import { build } from 'rolldown';
|
|
3
3
|
import { createHash } from 'node:crypto';
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
5
5
|
import { readFile, rm, writeFile, mkdir, readdir, stat } from 'node:fs/promises';
|
|
6
|
-
import { join, resolve, extname, dirname } from 'node:path';
|
|
6
|
+
import { join, resolve, extname, dirname, isAbsolute } from 'node:path';
|
|
7
7
|
import { parseAstAsync } from 'rolldown/parseAst';
|
|
8
8
|
import { pathToFileURL } from 'node:url';
|
|
9
9
|
import { a as ENTRY_SHIM } from '../../dist/projectPaths-5e4defea.esm.js';
|
|
10
10
|
|
|
11
|
+
function _defineProperties(e, r) {
|
|
12
|
+
for (var t = 0; t < r.length; t++) {
|
|
13
|
+
var o = r[t];
|
|
14
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function _createClass(e, r, t) {
|
|
18
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
19
|
+
writable: !1
|
|
20
|
+
}), e;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function _classCallCheck(a, n) {
|
|
24
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _getPrototypeOf(t) {
|
|
28
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
29
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
30
|
+
}, _getPrototypeOf(t);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function _isNativeReflectConstruct() {
|
|
34
|
+
try {
|
|
35
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
36
|
+
} catch (t) {}
|
|
37
|
+
return (_isNativeReflectConstruct = function () {
|
|
38
|
+
return !!t;
|
|
39
|
+
})();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function _assertThisInitialized(e) {
|
|
43
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
44
|
+
return e;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function _possibleConstructorReturn(t, e) {
|
|
48
|
+
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
49
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
50
|
+
return _assertThisInitialized(t);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function _callSuper(t, o, e) {
|
|
54
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function _setPrototypeOf(t, e) {
|
|
58
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
59
|
+
return t.__proto__ = e, t;
|
|
60
|
+
}, _setPrototypeOf(t, e);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function _inherits(t, e) {
|
|
64
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
65
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
66
|
+
constructor: {
|
|
67
|
+
value: t,
|
|
68
|
+
writable: !0,
|
|
69
|
+
configurable: !0
|
|
70
|
+
}
|
|
71
|
+
}), Object.defineProperty(t, "prototype", {
|
|
72
|
+
writable: !1
|
|
73
|
+
}), e && _setPrototypeOf(t, e);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _isNativeFunction(t) {
|
|
77
|
+
try {
|
|
78
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
79
|
+
} catch (n) {
|
|
80
|
+
return "function" == typeof t;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function _construct(t, e, r) {
|
|
85
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
86
|
+
var o = [null];
|
|
87
|
+
o.push.apply(o, e);
|
|
88
|
+
var p = new (t.bind.apply(t, o))();
|
|
89
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function _wrapNativeSuper(t) {
|
|
93
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
94
|
+
return _wrapNativeSuper = function (t) {
|
|
95
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
96
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
97
|
+
if (void 0 !== r) {
|
|
98
|
+
if (r.has(t)) return r.get(t);
|
|
99
|
+
r.set(t, Wrapper);
|
|
100
|
+
}
|
|
101
|
+
function Wrapper() {
|
|
102
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
103
|
+
}
|
|
104
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
105
|
+
constructor: {
|
|
106
|
+
value: Wrapper,
|
|
107
|
+
enumerable: !1,
|
|
108
|
+
writable: !0,
|
|
109
|
+
configurable: !0
|
|
110
|
+
}
|
|
111
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
112
|
+
}, _wrapNativeSuper(t);
|
|
113
|
+
}
|
|
114
|
+
|
|
11
115
|
// A CJS-to-ESM bridge for Node builtins, so a CommonJS dependency can be
|
|
12
116
|
// layered at all.
|
|
13
117
|
//
|
|
@@ -339,6 +443,127 @@ var stubSource = function stubSource(specifier) {
|
|
|
339
443
|
* `() => null` and `null`, and says so by doing it.
|
|
340
444
|
*/
|
|
341
445
|
|
|
446
|
+
/** A pinned package, bundled into the layer at a version the base set is not. */
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* A layer that would carry a pinned package at another version.
|
|
450
|
+
*
|
|
451
|
+
* Its own class because it is the one failure `buildVendorLayer` must NOT
|
|
452
|
+
* absorb. Every other build error drops the dependency that caused it and
|
|
453
|
+
* carries on (see `skipped`), which is right for a Vite plugin nobody imports
|
|
454
|
+
* and wrong here: dropping `@valbuild/tanstack` because its TanStack disagrees
|
|
455
|
+
* with the platform's turns "your lockfile is out of step" into "this import
|
|
456
|
+
* is not available", which names the wrong thing to fix.
|
|
457
|
+
*/
|
|
458
|
+
var PinSkewError = /*#__PURE__*/function (_Error) {
|
|
459
|
+
function PinSkewError(skew, baseRev) {
|
|
460
|
+
var _this;
|
|
461
|
+
_classCallCheck(this, PinSkewError);
|
|
462
|
+
// One entry per pinned package: a package bundled at two versions is two
|
|
463
|
+
// skews, and the same pin twice.
|
|
464
|
+
var pinned = _toConsumableArray(new Map(skew.map(function (s) {
|
|
465
|
+
return [s.name, s.pinned];
|
|
466
|
+
})).entries());
|
|
467
|
+
_this = _callSuper(this, PinSkewError, ["The project's install resolves ".concat(skew.map(function (s) {
|
|
468
|
+
return "".concat(s.name, " ").concat(s.found);
|
|
469
|
+
}).join(", "), ", but the base layer it builds against (").concat(baseRev, ") is ") + "built from ".concat(pinned.map(function (_ref) {
|
|
470
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
471
|
+
name = _ref2[0],
|
|
472
|
+
version = _ref2[1];
|
|
473
|
+
return "".concat(name, " ").concat(version);
|
|
474
|
+
}).join(", "), ". ") + "These are shipped in lockstep with the base layer, and a copy at " + "another version links against the base layer's at runtime -- which " + "fails only when something first imports it, as \"does not provide an " + "export named ...\". Pin ".concat(skew.length === 1 ? "it" : "them", " to the ") + "base layer's version (in package.json, or with pnpm.overrides for a " + "transitive dependency) and reinstall."]);
|
|
475
|
+
_defineProperty(_this, "skew", void 0);
|
|
476
|
+
_this.name = "PinSkewError";
|
|
477
|
+
_this.skew = skew;
|
|
478
|
+
return _this;
|
|
479
|
+
}
|
|
480
|
+
_inherits(PinSkewError, _Error);
|
|
481
|
+
return _createClass(PinSkewError);
|
|
482
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* The package a bundled module belongs to: the nearest package.json above it
|
|
486
|
+
* that has both a name and a version.
|
|
487
|
+
*
|
|
488
|
+
* Both, because packages ship nested package.json files that only set
|
|
489
|
+
* `"type"` -- `dist/esm/package.json` -- and the version is the point.
|
|
490
|
+
* Memoised per directory: a layer bundles thousands of modules from a few
|
|
491
|
+
* dozen packages.
|
|
492
|
+
*/
|
|
493
|
+
function owningPackage(_x, _x2) {
|
|
494
|
+
return _owningPackage.apply(this, arguments);
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Every pinned package the layer bundled at a version other than the pin.
|
|
498
|
+
*
|
|
499
|
+
* Read off the modules rolldown actually put in the chunks, rather than off
|
|
500
|
+
* the lockfile or the manifest: those say what a project ASKED for, and only
|
|
501
|
+
* the bundle says which copy a specifier resolved to from wherever it was
|
|
502
|
+
* imported -- `start-server-core` is never a project's direct dependency, and
|
|
503
|
+
* it is the package that caused the incident this exists for.
|
|
504
|
+
*/
|
|
505
|
+
function _owningPackage() {
|
|
506
|
+
_owningPackage = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(id, cache) {
|
|
507
|
+
var visited, dir, found, cached, manifest, parent, _i3, _visited, each;
|
|
508
|
+
return _regenerator().w(function (_context2) {
|
|
509
|
+
while (1) switch (_context2.n) {
|
|
510
|
+
case 0:
|
|
511
|
+
visited = [];
|
|
512
|
+
dir = dirname(id);
|
|
513
|
+
found = null;
|
|
514
|
+
case 1:
|
|
515
|
+
cached = cache.get(dir);
|
|
516
|
+
if (!(cached !== undefined)) {
|
|
517
|
+
_context2.n = 2;
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
found = cached;
|
|
521
|
+
return _context2.a(3, 7);
|
|
522
|
+
case 2:
|
|
523
|
+
visited.push(dir);
|
|
524
|
+
_context2.n = 3;
|
|
525
|
+
return readFile(join(dir, "package.json"), "utf8").then(function (text) {
|
|
526
|
+
return JSON.parse(text);
|
|
527
|
+
})["catch"](function () {
|
|
528
|
+
return null;
|
|
529
|
+
});
|
|
530
|
+
case 3:
|
|
531
|
+
manifest = _context2.v;
|
|
532
|
+
if (!(_typeof(manifest) === "object" && manifest !== null && "name" in manifest && "version" in manifest && typeof manifest.name === "string" && typeof manifest.version === "string")) {
|
|
533
|
+
_context2.n = 4;
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
found = {
|
|
537
|
+
name: manifest.name,
|
|
538
|
+
version: manifest.version
|
|
539
|
+
};
|
|
540
|
+
return _context2.a(3, 7);
|
|
541
|
+
case 4:
|
|
542
|
+
parent = dirname(dir);
|
|
543
|
+
if (!(parent === dir)) {
|
|
544
|
+
_context2.n = 5;
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
return _context2.a(3, 7);
|
|
548
|
+
case 5:
|
|
549
|
+
dir = parent;
|
|
550
|
+
case 6:
|
|
551
|
+
_context2.n = 1;
|
|
552
|
+
break;
|
|
553
|
+
case 7:
|
|
554
|
+
for (_i3 = 0, _visited = visited; _i3 < _visited.length; _i3++) {
|
|
555
|
+
each = _visited[_i3];
|
|
556
|
+
cache.set(each, found);
|
|
557
|
+
}
|
|
558
|
+
return _context2.a(2, found);
|
|
559
|
+
}
|
|
560
|
+
}, _callee2);
|
|
561
|
+
}));
|
|
562
|
+
return _owningPackage.apply(this, arguments);
|
|
563
|
+
}
|
|
564
|
+
function pinSkewOf(_x3, _x4, _x5) {
|
|
565
|
+
return _pinSkewOf.apply(this, arguments);
|
|
566
|
+
}
|
|
342
567
|
/**
|
|
343
568
|
* Where each target's chunks address the base layer from.
|
|
344
569
|
*
|
|
@@ -349,6 +574,86 @@ var stubSource = function stubSource(specifier) {
|
|
|
349
574
|
* problem because its paths are absolute URLs, so its prefix is a literal
|
|
350
575
|
* here: it is a URL this package mints, not a path the platform owns.
|
|
351
576
|
*/
|
|
577
|
+
function _pinSkewOf() {
|
|
578
|
+
_pinSkewOf = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(moduleIds, pins, cache) {
|
|
579
|
+
var found, _iterator9, _step9, _found$get, id, owner, pinned, versions, _t;
|
|
580
|
+
return _regenerator().w(function (_context3) {
|
|
581
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
582
|
+
case 0:
|
|
583
|
+
found = new Map();
|
|
584
|
+
_iterator9 = _createForOfIteratorHelper(moduleIds);
|
|
585
|
+
_context3.p = 1;
|
|
586
|
+
_iterator9.s();
|
|
587
|
+
case 2:
|
|
588
|
+
if ((_step9 = _iterator9.n()).done) {
|
|
589
|
+
_context3.n = 8;
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
592
|
+
id = _step9.value;
|
|
593
|
+
if (isAbsolute(id)) {
|
|
594
|
+
_context3.n = 3;
|
|
595
|
+
break;
|
|
596
|
+
}
|
|
597
|
+
return _context3.a(3, 7);
|
|
598
|
+
case 3:
|
|
599
|
+
_context3.n = 4;
|
|
600
|
+
return owningPackage(id, cache);
|
|
601
|
+
case 4:
|
|
602
|
+
owner = _context3.v;
|
|
603
|
+
if (owner) {
|
|
604
|
+
_context3.n = 5;
|
|
605
|
+
break;
|
|
606
|
+
}
|
|
607
|
+
return _context3.a(3, 7);
|
|
608
|
+
case 5:
|
|
609
|
+
pinned = pins[owner.name];
|
|
610
|
+
if (!(pinned === undefined || owner.version === pinned)) {
|
|
611
|
+
_context3.n = 6;
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
return _context3.a(3, 7);
|
|
615
|
+
case 6:
|
|
616
|
+
versions = (_found$get = found.get(owner.name)) !== null && _found$get !== void 0 ? _found$get : new Set();
|
|
617
|
+
versions.add(owner.version);
|
|
618
|
+
found.set(owner.name, versions);
|
|
619
|
+
case 7:
|
|
620
|
+
_context3.n = 2;
|
|
621
|
+
break;
|
|
622
|
+
case 8:
|
|
623
|
+
_context3.n = 10;
|
|
624
|
+
break;
|
|
625
|
+
case 9:
|
|
626
|
+
_context3.p = 9;
|
|
627
|
+
_t = _context3.v;
|
|
628
|
+
_iterator9.e(_t);
|
|
629
|
+
case 10:
|
|
630
|
+
_context3.p = 10;
|
|
631
|
+
_iterator9.f();
|
|
632
|
+
return _context3.f(10);
|
|
633
|
+
case 11:
|
|
634
|
+
return _context3.a(2, _toConsumableArray(found.entries()).sort(function (_ref4, _ref5) {
|
|
635
|
+
var _ref6 = _slicedToArray(_ref4, 1),
|
|
636
|
+
a = _ref6[0];
|
|
637
|
+
var _ref7 = _slicedToArray(_ref5, 1),
|
|
638
|
+
b = _ref7[0];
|
|
639
|
+
return a.localeCompare(b);
|
|
640
|
+
}).flatMap(function (_ref8) {
|
|
641
|
+
var _ref9 = _slicedToArray(_ref8, 2),
|
|
642
|
+
name = _ref9[0],
|
|
643
|
+
versions = _ref9[1];
|
|
644
|
+
return _toConsumableArray(versions).sort().map(function (version) {
|
|
645
|
+
return {
|
|
646
|
+
name: name,
|
|
647
|
+
pinned: pins[name],
|
|
648
|
+
found: version
|
|
649
|
+
};
|
|
650
|
+
});
|
|
651
|
+
}));
|
|
652
|
+
}
|
|
653
|
+
}, _callee3, null, [[1, 9, 10, 11]]);
|
|
654
|
+
}));
|
|
655
|
+
return _pinSkewOf.apply(this, arguments);
|
|
656
|
+
}
|
|
352
657
|
var targetsFor = function targetsFor(platform) {
|
|
353
658
|
return [{
|
|
354
659
|
name: "worker",
|
|
@@ -409,7 +714,7 @@ var firstLine = function firstLine(message) {
|
|
|
409
714
|
* conditions), so anything that survives it is very unlikely to fail the
|
|
410
715
|
* browser build for a reason worth attributing separately.
|
|
411
716
|
*/
|
|
412
|
-
function buildTargets(
|
|
717
|
+
function buildTargets(_x6, _x7, _x8, _x9, _x0) {
|
|
413
718
|
return _buildTargets.apply(this, arguments);
|
|
414
719
|
}
|
|
415
720
|
/**
|
|
@@ -427,32 +732,34 @@ function buildTargets(_x, _x2, _x3, _x4, _x5) {
|
|
|
427
732
|
* saying so instead of failing the layer build with a bare specifier.
|
|
428
733
|
*/
|
|
429
734
|
function _buildTargets() {
|
|
430
|
-
_buildTargets = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
431
|
-
var out, digest,
|
|
432
|
-
return _regenerator().w(function (
|
|
433
|
-
while (1) switch (
|
|
735
|
+
_buildTargets = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(names, input, outRoot, quiet, platform) {
|
|
736
|
+
var out, digest, packages, _iterator0, _step0, target, forTarget, dir, shims, result, pins, skew, _iterator1, _step1, file, code, _t2, _t3, _t4;
|
|
737
|
+
return _regenerator().w(function (_context4) {
|
|
738
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
434
739
|
case 0:
|
|
435
740
|
out = {
|
|
436
741
|
worker: {},
|
|
437
742
|
browser: {}
|
|
438
743
|
};
|
|
439
744
|
digest = createHash("sha256");
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
745
|
+
/** Directory -> the package it belongs to, for the pin check. */
|
|
746
|
+
packages = new Map();
|
|
747
|
+
_iterator0 = _createForOfIteratorHelper(targetsFor(platform));
|
|
748
|
+
_context4.p = 1;
|
|
749
|
+
_iterator0.s();
|
|
443
750
|
case 2:
|
|
444
|
-
if ((
|
|
445
|
-
|
|
751
|
+
if ((_step0 = _iterator0.n()).done) {
|
|
752
|
+
_context4.n = 19;
|
|
446
753
|
break;
|
|
447
754
|
}
|
|
448
|
-
target =
|
|
755
|
+
target = _step0.value;
|
|
449
756
|
forTarget = Array.isArray(names) ? names : names[target.name]; // Nothing for this side: a dependency can be server-only, and building an
|
|
450
757
|
// empty bundle is both pointless and an error.
|
|
451
758
|
if (!(forTarget.length === 0)) {
|
|
452
|
-
|
|
759
|
+
_context4.n = 3;
|
|
453
760
|
break;
|
|
454
761
|
}
|
|
455
|
-
return
|
|
762
|
+
return _context4.a(3, 18);
|
|
456
763
|
case 3:
|
|
457
764
|
dir = join(outRoot, target.name);
|
|
458
765
|
/*
|
|
@@ -471,17 +778,17 @@ function _buildTargets() {
|
|
|
471
778
|
* dependency's code is shipped and folded into `rev`. rolldown has no
|
|
472
779
|
* `emptyOutDir`, so nothing else clears it.
|
|
473
780
|
*/
|
|
474
|
-
|
|
781
|
+
_context4.n = 4;
|
|
475
782
|
return rm(dir, {
|
|
476
783
|
recursive: true,
|
|
477
784
|
force: true
|
|
478
785
|
});
|
|
479
786
|
case 4:
|
|
480
|
-
|
|
787
|
+
_context4.n = 5;
|
|
481
788
|
return nodeShims(target.name === "worker");
|
|
482
789
|
case 5:
|
|
483
|
-
shims =
|
|
484
|
-
|
|
790
|
+
shims = _context4.v;
|
|
791
|
+
_context4.n = 6;
|
|
485
792
|
return build({
|
|
486
793
|
input: Object.fromEntries(forTarget.map(function (name) {
|
|
487
794
|
return [name, input[name]];
|
|
@@ -571,65 +878,85 @@ function _buildTargets() {
|
|
|
571
878
|
}
|
|
572
879
|
});
|
|
573
880
|
case 6:
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
881
|
+
result = _context4.v;
|
|
882
|
+
// Before the import audit, which would otherwise report the same skew as
|
|
883
|
+
// a missing export -- true, and one step removed from the cause.
|
|
884
|
+
pins = platform.base.pins;
|
|
885
|
+
if (!pins) {
|
|
886
|
+
_context4.n = 8;
|
|
887
|
+
break;
|
|
888
|
+
}
|
|
889
|
+
_context4.n = 7;
|
|
890
|
+
return pinSkewOf(result.output.flatMap(function (item) {
|
|
891
|
+
return item.type === "chunk" ? item.moduleIds : [];
|
|
892
|
+
}), pins, packages);
|
|
577
893
|
case 7:
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
894
|
+
skew = _context4.v;
|
|
895
|
+
if (!skew.length) {
|
|
896
|
+
_context4.n = 8;
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
throw new PinSkewError(skew, platform.base.rev);
|
|
900
|
+
case 8:
|
|
901
|
+
_t2 = _createForOfIteratorHelper;
|
|
902
|
+
_context4.n = 9;
|
|
903
|
+
return readdir(dir);
|
|
581
904
|
case 9:
|
|
582
|
-
|
|
583
|
-
|
|
905
|
+
_iterator1 = _t2(_context4.v.sort());
|
|
906
|
+
_context4.p = 10;
|
|
907
|
+
_iterator1.s();
|
|
908
|
+
case 11:
|
|
909
|
+
if ((_step1 = _iterator1.n()).done) {
|
|
910
|
+
_context4.n = 15;
|
|
584
911
|
break;
|
|
585
912
|
}
|
|
586
|
-
file =
|
|
587
|
-
|
|
913
|
+
file = _step1.value;
|
|
914
|
+
_context4.n = 12;
|
|
588
915
|
return readFile(join(dir, file), "utf8");
|
|
589
|
-
case
|
|
590
|
-
code =
|
|
591
|
-
|
|
916
|
+
case 12:
|
|
917
|
+
code = _context4.v;
|
|
918
|
+
_context4.n = 13;
|
|
592
919
|
return auditImports(target, file, code, platform);
|
|
593
|
-
case
|
|
920
|
+
case 13:
|
|
594
921
|
// Worker entries are module-map keys and carry the directory; browser
|
|
595
922
|
// entries are served under `/_pvendor/<rev>/` and do not.
|
|
596
923
|
out[target.name][target.name === "worker" ? "pvendor/".concat(file) : file] = code;
|
|
597
924
|
digest.update("".concat(target.name, "/").concat(file));
|
|
598
925
|
digest.update(code);
|
|
599
|
-
case 12:
|
|
600
|
-
_context2.n = 9;
|
|
601
|
-
break;
|
|
602
|
-
case 13:
|
|
603
|
-
_context2.n = 15;
|
|
604
|
-
break;
|
|
605
926
|
case 14:
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
_iterator0.e(_t2);
|
|
927
|
+
_context4.n = 11;
|
|
928
|
+
break;
|
|
609
929
|
case 15:
|
|
610
|
-
|
|
611
|
-
_iterator0.f();
|
|
612
|
-
return _context2.f(15);
|
|
613
|
-
case 16:
|
|
614
|
-
_context2.n = 2;
|
|
930
|
+
_context4.n = 17;
|
|
615
931
|
break;
|
|
932
|
+
case 16:
|
|
933
|
+
_context4.p = 16;
|
|
934
|
+
_t3 = _context4.v;
|
|
935
|
+
_iterator1.e(_t3);
|
|
616
936
|
case 17:
|
|
617
|
-
|
|
618
|
-
|
|
937
|
+
_context4.p = 17;
|
|
938
|
+
_iterator1.f();
|
|
939
|
+
return _context4.f(17);
|
|
619
940
|
case 18:
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
_iterator9.e(_t3);
|
|
941
|
+
_context4.n = 2;
|
|
942
|
+
break;
|
|
623
943
|
case 19:
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
return _context2.f(19);
|
|
944
|
+
_context4.n = 21;
|
|
945
|
+
break;
|
|
627
946
|
case 20:
|
|
628
|
-
|
|
947
|
+
_context4.p = 20;
|
|
948
|
+
_t4 = _context4.v;
|
|
949
|
+
_iterator0.e(_t4);
|
|
950
|
+
case 21:
|
|
951
|
+
_context4.p = 21;
|
|
952
|
+
_iterator0.f();
|
|
953
|
+
return _context4.f(21);
|
|
954
|
+
case 22:
|
|
955
|
+
return _context4.a(2, _objectSpread2(_objectSpread2({}, out), {}, {
|
|
629
956
|
rev: digest.digest("hex").slice(0, 16)
|
|
630
957
|
}));
|
|
631
958
|
}
|
|
632
|
-
},
|
|
959
|
+
}, _callee4, null, [[10, 16, 17, 18], [1, 20, 21, 22]]);
|
|
633
960
|
}));
|
|
634
961
|
return _buildTargets.apply(this, arguments);
|
|
635
962
|
}
|
|
@@ -830,7 +1157,7 @@ var nameOf = function nameOf(node) {
|
|
|
830
1157
|
node.value : null;
|
|
831
1158
|
};
|
|
832
1159
|
var parseModule = /*#__PURE__*/function () {
|
|
833
|
-
var
|
|
1160
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(code, file) {
|
|
834
1161
|
return _regenerator().w(function (_context) {
|
|
835
1162
|
while (1) switch (_context.n) {
|
|
836
1163
|
case 0:
|
|
@@ -843,53 +1170,53 @@ var parseModule = /*#__PURE__*/function () {
|
|
|
843
1170
|
}
|
|
844
1171
|
}, _callee);
|
|
845
1172
|
}));
|
|
846
|
-
return function parseModule(
|
|
847
|
-
return
|
|
1173
|
+
return function parseModule(_x1, _x10) {
|
|
1174
|
+
return _ref3.apply(this, arguments);
|
|
848
1175
|
};
|
|
849
1176
|
}();
|
|
850
1177
|
|
|
851
1178
|
/** Every import and re-export a chunk emits, with the names it takes. */
|
|
852
|
-
function auditableImports(
|
|
1179
|
+
function auditableImports(_x11, _x12) {
|
|
853
1180
|
return _auditableImports.apply(this, arguments);
|
|
854
1181
|
}
|
|
855
1182
|
function _auditableImports() {
|
|
856
|
-
_auditableImports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
857
|
-
var ast, imports,
|
|
858
|
-
return _regenerator().w(function (
|
|
859
|
-
while (1) switch (
|
|
1183
|
+
_auditableImports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(code, file) {
|
|
1184
|
+
var ast, imports, _iterator10, _step10, _statement$source, _statement$specifiers, statement, source, names, _iterator11, _step11, specifier, name, _name, _t5;
|
|
1185
|
+
return _regenerator().w(function (_context5) {
|
|
1186
|
+
while (1) switch (_context5.p = _context5.n) {
|
|
860
1187
|
case 0:
|
|
861
|
-
|
|
1188
|
+
_context5.n = 1;
|
|
862
1189
|
return parseModule(code, file);
|
|
863
1190
|
case 1:
|
|
864
|
-
ast =
|
|
1191
|
+
ast = _context5.v;
|
|
865
1192
|
imports = [];
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
1193
|
+
_iterator10 = _createForOfIteratorHelper(ast.body);
|
|
1194
|
+
_context5.p = 2;
|
|
1195
|
+
_iterator10.s();
|
|
869
1196
|
case 3:
|
|
870
|
-
if ((
|
|
871
|
-
|
|
1197
|
+
if ((_step10 = _iterator10.n()).done) {
|
|
1198
|
+
_context5.n = 7;
|
|
872
1199
|
break;
|
|
873
1200
|
}
|
|
874
|
-
statement =
|
|
1201
|
+
statement = _step10.value;
|
|
875
1202
|
if (!(statement.type !== "ImportDeclaration" && statement.type !== "ExportNamedDeclaration" && statement.type !== "ExportAllDeclaration")) {
|
|
876
|
-
|
|
1203
|
+
_context5.n = 4;
|
|
877
1204
|
break;
|
|
878
1205
|
}
|
|
879
|
-
return
|
|
1206
|
+
return _context5.a(3, 6);
|
|
880
1207
|
case 4:
|
|
881
1208
|
source = (_statement$source = statement.source) === null || _statement$source === void 0 ? void 0 : _statement$source.value;
|
|
882
1209
|
if (!(typeof source !== "string")) {
|
|
883
|
-
|
|
1210
|
+
_context5.n = 5;
|
|
884
1211
|
break;
|
|
885
1212
|
}
|
|
886
|
-
return
|
|
1213
|
+
return _context5.a(3, 6);
|
|
887
1214
|
case 5:
|
|
888
1215
|
names = [];
|
|
889
|
-
|
|
1216
|
+
_iterator11 = _createForOfIteratorHelper((_statement$specifiers = statement.specifiers) !== null && _statement$specifiers !== void 0 ? _statement$specifiers : []);
|
|
890
1217
|
try {
|
|
891
|
-
for (
|
|
892
|
-
specifier =
|
|
1218
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
1219
|
+
specifier = _step11.value;
|
|
893
1220
|
if (specifier.type === "ImportDefaultSpecifier") names.push("default");else if (specifier.type === "ImportSpecifier") {
|
|
894
1221
|
name = nameOf(specifier.imported);
|
|
895
1222
|
if (name) names.push(name);
|
|
@@ -902,36 +1229,36 @@ function _auditableImports() {
|
|
|
902
1229
|
// whatever is there.
|
|
903
1230
|
}
|
|
904
1231
|
} catch (err) {
|
|
905
|
-
|
|
1232
|
+
_iterator11.e(err);
|
|
906
1233
|
} finally {
|
|
907
|
-
|
|
1234
|
+
_iterator11.f();
|
|
908
1235
|
}
|
|
909
1236
|
imports.push({
|
|
910
1237
|
source: source,
|
|
911
1238
|
names: names
|
|
912
1239
|
});
|
|
913
1240
|
case 6:
|
|
914
|
-
|
|
1241
|
+
_context5.n = 3;
|
|
915
1242
|
break;
|
|
916
1243
|
case 7:
|
|
917
|
-
|
|
1244
|
+
_context5.n = 9;
|
|
918
1245
|
break;
|
|
919
1246
|
case 8:
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1247
|
+
_context5.p = 8;
|
|
1248
|
+
_t5 = _context5.v;
|
|
1249
|
+
_iterator10.e(_t5);
|
|
923
1250
|
case 9:
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
return
|
|
1251
|
+
_context5.p = 9;
|
|
1252
|
+
_iterator10.f();
|
|
1253
|
+
return _context5.f(9);
|
|
927
1254
|
case 10:
|
|
928
|
-
return
|
|
1255
|
+
return _context5.a(2, imports);
|
|
929
1256
|
}
|
|
930
|
-
},
|
|
1257
|
+
}, _callee5, null, [[2, 8, 9, 10]]);
|
|
931
1258
|
}));
|
|
932
1259
|
return _auditableImports.apply(this, arguments);
|
|
933
1260
|
}
|
|
934
|
-
function auditableSpecifiers(
|
|
1261
|
+
function auditableSpecifiers(_x13, _x14) {
|
|
935
1262
|
return _auditableSpecifiers.apply(this, arguments);
|
|
936
1263
|
}
|
|
937
1264
|
|
|
@@ -942,136 +1269,147 @@ function auditableSpecifiers(_x0, _x1) {
|
|
|
942
1269
|
* built, or the chunk re-exports from somewhere this does not follow. A check
|
|
943
1270
|
* that cannot be made has to say so rather than report an empty set, which
|
|
944
1271
|
* would fail every import into that chunk.
|
|
1272
|
+
*
|
|
1273
|
+
* Read from the built chunks when this checkout has them, and otherwise from
|
|
1274
|
+
* what the platform SAID they export (`BuildTarget.base.exports`). The second
|
|
1275
|
+
* is every build that is not the platform's own -- a project's CI publishing
|
|
1276
|
+
* with `val publish` above all -- which is where the audit used to be skipped
|
|
1277
|
+
* outright, and where a project's lockfile is least likely to agree with the
|
|
1278
|
+
* platform's.
|
|
945
1279
|
*/
|
|
946
1280
|
function _auditableSpecifiers() {
|
|
947
|
-
_auditableSpecifiers = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
948
|
-
return _regenerator().w(function (
|
|
949
|
-
while (1) switch (
|
|
1281
|
+
_auditableSpecifiers = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(code, file) {
|
|
1282
|
+
return _regenerator().w(function (_context6) {
|
|
1283
|
+
while (1) switch (_context6.n) {
|
|
950
1284
|
case 0:
|
|
951
|
-
|
|
1285
|
+
_context6.n = 1;
|
|
952
1286
|
return auditableImports(code, file);
|
|
953
1287
|
case 1:
|
|
954
|
-
return
|
|
1288
|
+
return _context6.a(2, _context6.v.map(function (entry) {
|
|
955
1289
|
return entry.source;
|
|
956
1290
|
}));
|
|
957
1291
|
}
|
|
958
|
-
},
|
|
1292
|
+
}, _callee6);
|
|
959
1293
|
}));
|
|
960
1294
|
return _auditableSpecifiers.apply(this, arguments);
|
|
961
1295
|
}
|
|
962
|
-
function baseChunkExports(
|
|
1296
|
+
function baseChunkExports(_x15, _x16, _x17) {
|
|
963
1297
|
return _baseChunkExports.apply(this, arguments);
|
|
964
1298
|
}
|
|
965
1299
|
function _baseChunkExports() {
|
|
966
|
-
_baseChunkExports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
967
|
-
var dist, file, code, ast, exported,
|
|
968
|
-
return _regenerator().w(function (
|
|
969
|
-
while (1) switch (
|
|
1300
|
+
_baseChunkExports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(target, specifier, platform) {
|
|
1301
|
+
var dist, _platform$base$export, chunk, chunks, listed, file, code, ast, exported, _iterator12, _step12, _declaration$id, _statement$specifiers2, _declaration$declarat, statement, _iterator13, _step13, specifierNode, name, declaration, _iterator14, _step14, _declarator$id, declarator, _t7;
|
|
1302
|
+
return _regenerator().w(function (_context7) {
|
|
1303
|
+
while (1) switch (_context7.p = _context7.n) {
|
|
970
1304
|
case 0:
|
|
971
1305
|
dist = platform.baseLayerDir;
|
|
972
1306
|
if (dist) {
|
|
973
|
-
|
|
1307
|
+
_context7.n = 1;
|
|
974
1308
|
break;
|
|
975
1309
|
}
|
|
976
|
-
|
|
1310
|
+
chunk = specifier.slice(target.baseFrom.length).replace(/\.js$/, "");
|
|
1311
|
+
chunks = (_platform$base$export = platform.base.exports) === null || _platform$base$export === void 0 ? void 0 : _platform$base$export[target.name]; // Own keys only: a chunk named like an Object.prototype member must not
|
|
1312
|
+
// read back a function.
|
|
1313
|
+
listed = chunks && Object.hasOwn(chunks, chunk) ? chunks[chunk] : undefined;
|
|
1314
|
+
return _context7.a(2, listed ? new Set(listed) : null);
|
|
977
1315
|
case 1:
|
|
978
1316
|
file = join(dist, target.name, "vendor", specifier.slice(target.baseFrom.length));
|
|
979
|
-
|
|
980
|
-
|
|
1317
|
+
_context7.p = 2;
|
|
1318
|
+
_context7.n = 3;
|
|
981
1319
|
return readFile(file, "utf8");
|
|
982
1320
|
case 3:
|
|
983
|
-
code =
|
|
984
|
-
|
|
1321
|
+
code = _context7.v;
|
|
1322
|
+
_context7.n = 5;
|
|
985
1323
|
break;
|
|
986
1324
|
case 4:
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
return
|
|
1325
|
+
_context7.p = 4;
|
|
1326
|
+
_context7.v;
|
|
1327
|
+
return _context7.a(2, null);
|
|
990
1328
|
case 5:
|
|
991
|
-
|
|
1329
|
+
_context7.n = 6;
|
|
992
1330
|
return parseModule(code, file);
|
|
993
1331
|
case 6:
|
|
994
|
-
ast =
|
|
1332
|
+
ast = _context7.v;
|
|
995
1333
|
exported = new Set();
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1334
|
+
_iterator12 = _createForOfIteratorHelper(ast.body);
|
|
1335
|
+
_context7.p = 7;
|
|
1336
|
+
_iterator12.s();
|
|
999
1337
|
case 8:
|
|
1000
|
-
if ((
|
|
1001
|
-
|
|
1338
|
+
if ((_step12 = _iterator12.n()).done) {
|
|
1339
|
+
_context7.n = 13;
|
|
1002
1340
|
break;
|
|
1003
1341
|
}
|
|
1004
|
-
statement =
|
|
1342
|
+
statement = _step12.value;
|
|
1005
1343
|
if (!(statement.type === "ExportAllDeclaration")) {
|
|
1006
|
-
|
|
1344
|
+
_context7.n = 9;
|
|
1007
1345
|
break;
|
|
1008
1346
|
}
|
|
1009
|
-
return
|
|
1347
|
+
return _context7.a(2, null);
|
|
1010
1348
|
case 9:
|
|
1011
1349
|
if (!(statement.type === "ExportDefaultDeclaration")) {
|
|
1012
|
-
|
|
1350
|
+
_context7.n = 10;
|
|
1013
1351
|
break;
|
|
1014
1352
|
}
|
|
1015
1353
|
exported.add("default");
|
|
1016
|
-
return
|
|
1354
|
+
return _context7.a(3, 12);
|
|
1017
1355
|
case 10:
|
|
1018
1356
|
if (!(statement.type !== "ExportNamedDeclaration")) {
|
|
1019
|
-
|
|
1357
|
+
_context7.n = 11;
|
|
1020
1358
|
break;
|
|
1021
1359
|
}
|
|
1022
|
-
return
|
|
1360
|
+
return _context7.a(3, 12);
|
|
1023
1361
|
case 11:
|
|
1024
|
-
|
|
1362
|
+
_iterator13 = _createForOfIteratorHelper((_statement$specifiers2 = statement.specifiers) !== null && _statement$specifiers2 !== void 0 ? _statement$specifiers2 : []);
|
|
1025
1363
|
try {
|
|
1026
|
-
for (
|
|
1027
|
-
specifierNode =
|
|
1364
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
1365
|
+
specifierNode = _step13.value;
|
|
1028
1366
|
name = nameOf(specifierNode.exported);
|
|
1029
1367
|
if (name) exported.add(name);
|
|
1030
1368
|
}
|
|
1031
1369
|
// `export const x = ...` / `export function x() {}`, which a hand-written
|
|
1032
1370
|
// chunk can carry even though a bundled one usually does not.
|
|
1033
1371
|
} catch (err) {
|
|
1034
|
-
|
|
1372
|
+
_iterator13.e(err);
|
|
1035
1373
|
} finally {
|
|
1036
|
-
|
|
1374
|
+
_iterator13.f();
|
|
1037
1375
|
}
|
|
1038
1376
|
declaration = statement.declaration;
|
|
1039
1377
|
if (declaration !== null && declaration !== void 0 && (_declaration$id = declaration.id) !== null && _declaration$id !== void 0 && _declaration$id.name) exported.add(declaration.id.name);
|
|
1040
|
-
|
|
1378
|
+
_iterator14 = _createForOfIteratorHelper((_declaration$declarat = declaration === null || declaration === void 0 ? void 0 : declaration.declarations) !== null && _declaration$declarat !== void 0 ? _declaration$declarat : []);
|
|
1041
1379
|
try {
|
|
1042
|
-
for (
|
|
1043
|
-
declarator =
|
|
1380
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
1381
|
+
declarator = _step14.value;
|
|
1044
1382
|
if (((_declarator$id = declarator.id) === null || _declarator$id === void 0 ? void 0 : _declarator$id.type) === "Identifier" && declarator.id.name) {
|
|
1045
1383
|
exported.add(declarator.id.name);
|
|
1046
1384
|
}
|
|
1047
1385
|
}
|
|
1048
1386
|
} catch (err) {
|
|
1049
|
-
|
|
1387
|
+
_iterator14.e(err);
|
|
1050
1388
|
} finally {
|
|
1051
|
-
|
|
1389
|
+
_iterator14.f();
|
|
1052
1390
|
}
|
|
1053
1391
|
case 12:
|
|
1054
|
-
|
|
1392
|
+
_context7.n = 8;
|
|
1055
1393
|
break;
|
|
1056
1394
|
case 13:
|
|
1057
|
-
|
|
1395
|
+
_context7.n = 15;
|
|
1058
1396
|
break;
|
|
1059
1397
|
case 14:
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1398
|
+
_context7.p = 14;
|
|
1399
|
+
_t7 = _context7.v;
|
|
1400
|
+
_iterator12.e(_t7);
|
|
1063
1401
|
case 15:
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
return
|
|
1402
|
+
_context7.p = 15;
|
|
1403
|
+
_iterator12.f();
|
|
1404
|
+
return _context7.f(15);
|
|
1067
1405
|
case 16:
|
|
1068
|
-
return
|
|
1406
|
+
return _context7.a(2, exported);
|
|
1069
1407
|
}
|
|
1070
|
-
},
|
|
1408
|
+
}, _callee7, null, [[7, 14, 15, 16], [2, 4]]);
|
|
1071
1409
|
}));
|
|
1072
1410
|
return _baseChunkExports.apply(this, arguments);
|
|
1073
1411
|
}
|
|
1074
|
-
function auditImports(
|
|
1412
|
+
function auditImports(_x18, _x19, _x20, _x21) {
|
|
1075
1413
|
return _auditImports.apply(this, arguments);
|
|
1076
1414
|
}
|
|
1077
1415
|
/**
|
|
@@ -1101,62 +1439,62 @@ function auditImports(_x13, _x14, _x15, _x16) {
|
|
|
1101
1439
|
* endpoint answers 500 forever.
|
|
1102
1440
|
*/
|
|
1103
1441
|
function _auditImports() {
|
|
1104
|
-
_auditImports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1105
|
-
var
|
|
1106
|
-
return _regenerator().w(function (
|
|
1107
|
-
while (1) switch (
|
|
1442
|
+
_auditImports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(target, file, code, platform) {
|
|
1443
|
+
var _iterator15, _step15, _step15$value, specifier, names, intoBase, intoSelf, builtin, _t8, _t9;
|
|
1444
|
+
return _regenerator().w(function (_context8) {
|
|
1445
|
+
while (1) switch (_context8.p = _context8.n) {
|
|
1108
1446
|
case 0:
|
|
1109
|
-
|
|
1110
|
-
|
|
1447
|
+
_t8 = _createForOfIteratorHelper;
|
|
1448
|
+
_context8.n = 1;
|
|
1111
1449
|
return auditableImports(code, file);
|
|
1112
1450
|
case 1:
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1451
|
+
_iterator15 = _t8(_context8.v);
|
|
1452
|
+
_context8.p = 2;
|
|
1453
|
+
_iterator15.s();
|
|
1116
1454
|
case 3:
|
|
1117
|
-
if ((
|
|
1118
|
-
|
|
1455
|
+
if ((_step15 = _iterator15.n()).done) {
|
|
1456
|
+
_context8.n = 6;
|
|
1119
1457
|
break;
|
|
1120
1458
|
}
|
|
1121
|
-
|
|
1459
|
+
_step15$value = _step15.value, specifier = _step15$value.source, names = _step15$value.names;
|
|
1122
1460
|
intoBase = specifier.startsWith(target.baseFrom);
|
|
1123
1461
|
intoSelf = specifier.startsWith("./") || specifier.startsWith("../pvendor/"); // Only the worker target: a browser has no Node builtins, and a chunk that
|
|
1124
1462
|
// reached for one there is a genuine error rather than a runtime import.
|
|
1125
1463
|
builtin = target.name === "worker" && isRuntimeBuiltin(specifier);
|
|
1126
1464
|
if (!(!intoBase && !intoSelf && !builtin)) {
|
|
1127
|
-
|
|
1465
|
+
_context8.n = 4;
|
|
1128
1466
|
break;
|
|
1129
1467
|
}
|
|
1130
1468
|
throw new Error("".concat(target.name, "/").concat(file, " imports '").concat(specifier, "', which is neither a base-layer chunk, ") + "a sibling, nor a Node builtin the runtime provides. It would be an unresolvable " + "bare specifier in the isolate.");
|
|
1131
1469
|
case 4:
|
|
1132
1470
|
if (!(intoBase && names.length)) {
|
|
1133
|
-
|
|
1471
|
+
_context8.n = 5;
|
|
1134
1472
|
break;
|
|
1135
1473
|
}
|
|
1136
|
-
|
|
1474
|
+
_context8.n = 5;
|
|
1137
1475
|
return auditBaseExports(target, file, specifier, names, platform);
|
|
1138
1476
|
case 5:
|
|
1139
|
-
|
|
1477
|
+
_context8.n = 3;
|
|
1140
1478
|
break;
|
|
1141
1479
|
case 6:
|
|
1142
|
-
|
|
1480
|
+
_context8.n = 8;
|
|
1143
1481
|
break;
|
|
1144
1482
|
case 7:
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1483
|
+
_context8.p = 7;
|
|
1484
|
+
_t9 = _context8.v;
|
|
1485
|
+
_iterator15.e(_t9);
|
|
1148
1486
|
case 8:
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
return
|
|
1487
|
+
_context8.p = 8;
|
|
1488
|
+
_iterator15.f();
|
|
1489
|
+
return _context8.f(8);
|
|
1152
1490
|
case 9:
|
|
1153
|
-
return
|
|
1491
|
+
return _context8.a(2);
|
|
1154
1492
|
}
|
|
1155
|
-
},
|
|
1493
|
+
}, _callee8, null, [[2, 7, 8, 9]]);
|
|
1156
1494
|
}));
|
|
1157
1495
|
return _auditImports.apply(this, arguments);
|
|
1158
1496
|
}
|
|
1159
|
-
function auditBaseExports(
|
|
1497
|
+
function auditBaseExports(_x22, _x23, _x24, _x25, _x26) {
|
|
1160
1498
|
return _auditBaseExports.apply(this, arguments);
|
|
1161
1499
|
}
|
|
1162
1500
|
/**
|
|
@@ -1168,37 +1506,37 @@ function auditBaseExports(_x17, _x18, _x19, _x20, _x21) {
|
|
|
1168
1506
|
* pull a package in.
|
|
1169
1507
|
*/
|
|
1170
1508
|
function _auditBaseExports() {
|
|
1171
|
-
_auditBaseExports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1509
|
+
_auditBaseExports = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(target, file, specifier, names, platform) {
|
|
1172
1510
|
var exported, missing;
|
|
1173
|
-
return _regenerator().w(function (
|
|
1174
|
-
while (1) switch (
|
|
1511
|
+
return _regenerator().w(function (_context9) {
|
|
1512
|
+
while (1) switch (_context9.n) {
|
|
1175
1513
|
case 0:
|
|
1176
|
-
|
|
1514
|
+
_context9.n = 1;
|
|
1177
1515
|
return baseChunkExports(target, specifier, platform);
|
|
1178
1516
|
case 1:
|
|
1179
|
-
exported =
|
|
1517
|
+
exported = _context9.v;
|
|
1180
1518
|
if (exported) {
|
|
1181
|
-
|
|
1519
|
+
_context9.n = 2;
|
|
1182
1520
|
break;
|
|
1183
1521
|
}
|
|
1184
|
-
return
|
|
1522
|
+
return _context9.a(2);
|
|
1185
1523
|
case 2:
|
|
1186
1524
|
missing = names.filter(function (name) {
|
|
1187
1525
|
return !exported.has(name);
|
|
1188
1526
|
});
|
|
1189
1527
|
if (!(missing.length === 0)) {
|
|
1190
|
-
|
|
1528
|
+
_context9.n = 3;
|
|
1191
1529
|
break;
|
|
1192
1530
|
}
|
|
1193
|
-
return
|
|
1531
|
+
return _context9.a(2);
|
|
1194
1532
|
case 3:
|
|
1195
1533
|
throw new Error("".concat(target.name, "/").concat(file, " imports ").concat(missing.map(function (name) {
|
|
1196
1534
|
return "'".concat(name, "'");
|
|
1197
1535
|
}).join(", "), " from ") + "'".concat(specifier, "', which the base layer does not export. The base layer is built from the ") + "platform's pinned versions (packages/vendor/package.json, and PINS.md for why they are " + "exact), so this is a project resolving a version of that package which disagrees with " + "the platform's. It would link in the isolate only until something imported it, and then " + "throw \"does not provide an export named '".concat(missing[0], "'\"."));
|
|
1198
1536
|
case 4:
|
|
1199
|
-
return
|
|
1537
|
+
return _context9.a(2);
|
|
1200
1538
|
}
|
|
1201
|
-
},
|
|
1539
|
+
}, _callee9);
|
|
1202
1540
|
}));
|
|
1203
1541
|
return _auditBaseExports.apply(this, arguments);
|
|
1204
1542
|
}
|
|
@@ -1418,13 +1756,13 @@ var STUB_DIR = ".platform-vendor-stubs";
|
|
|
1418
1756
|
* into the project's stylesheet by the builder's CSS pass. Resolution is the
|
|
1419
1757
|
* project's own, so the version matches whatever its lockfile pinned.
|
|
1420
1758
|
*/
|
|
1421
|
-
function collectDependencyCss(
|
|
1759
|
+
function collectDependencyCss(_x27, _x28, _x29) {
|
|
1422
1760
|
return _collectDependencyCss.apply(this, arguments);
|
|
1423
1761
|
}
|
|
1424
1762
|
|
|
1425
1763
|
/** `url(...)` with a relative target, quoted or not. */
|
|
1426
1764
|
function _collectDependencyCss() {
|
|
1427
|
-
_collectDependencyCss = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1765
|
+
_collectDependencyCss = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(dir, specifiers,
|
|
1428
1766
|
/**
|
|
1429
1767
|
* Where the files a stylesheet points at with `url(...)` go, base64, keyed
|
|
1430
1768
|
* by the content-addressed name the rewritten `url()` now uses. Pass it to
|
|
@@ -1434,65 +1772,65 @@ function _collectDependencyCss() {
|
|
|
1434
1772
|
* in one -- every font package's -- points at nothing once it is served.
|
|
1435
1773
|
*/
|
|
1436
1774
|
assets) {
|
|
1437
|
-
var require, css,
|
|
1438
|
-
return _regenerator().w(function (
|
|
1439
|
-
while (1) switch (
|
|
1775
|
+
var require, css, _iterator16, _step16, specifier, file, _t1;
|
|
1776
|
+
return _regenerator().w(function (_context0) {
|
|
1777
|
+
while (1) switch (_context0.p = _context0.n) {
|
|
1440
1778
|
case 0:
|
|
1441
1779
|
if (!(specifiers.length === 0)) {
|
|
1442
|
-
|
|
1780
|
+
_context0.n = 1;
|
|
1443
1781
|
break;
|
|
1444
1782
|
}
|
|
1445
|
-
return
|
|
1783
|
+
return _context0.a(2, {});
|
|
1446
1784
|
case 1:
|
|
1447
1785
|
require = createRequire(join(resolve(dir), "package.json"));
|
|
1448
1786
|
css = {};
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1787
|
+
_iterator16 = _createForOfIteratorHelper(specifiers);
|
|
1788
|
+
_context0.p = 2;
|
|
1789
|
+
_iterator16.s();
|
|
1452
1790
|
case 3:
|
|
1453
|
-
if ((
|
|
1454
|
-
|
|
1791
|
+
if ((_step16 = _iterator16.n()).done) {
|
|
1792
|
+
_context0.n = 10;
|
|
1455
1793
|
break;
|
|
1456
1794
|
}
|
|
1457
|
-
specifier =
|
|
1795
|
+
specifier = _step16.value;
|
|
1458
1796
|
file = void 0;
|
|
1459
|
-
|
|
1797
|
+
_context0.p = 4;
|
|
1460
1798
|
file = require.resolve(specifier);
|
|
1461
|
-
|
|
1799
|
+
_context0.n = 6;
|
|
1462
1800
|
break;
|
|
1463
1801
|
case 5:
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
return
|
|
1802
|
+
_context0.p = 5;
|
|
1803
|
+
_context0.v;
|
|
1804
|
+
return _context0.a(3, 9);
|
|
1467
1805
|
case 6:
|
|
1468
1806
|
if (file.endsWith(".css")) {
|
|
1469
|
-
|
|
1807
|
+
_context0.n = 7;
|
|
1470
1808
|
break;
|
|
1471
1809
|
}
|
|
1472
|
-
return
|
|
1810
|
+
return _context0.a(3, 9);
|
|
1473
1811
|
case 7:
|
|
1474
|
-
|
|
1812
|
+
_context0.n = 8;
|
|
1475
1813
|
return readDependencyStylesheet(file, assets, new Set());
|
|
1476
1814
|
case 8:
|
|
1477
|
-
css[specifier] =
|
|
1815
|
+
css[specifier] = _context0.v;
|
|
1478
1816
|
case 9:
|
|
1479
|
-
|
|
1817
|
+
_context0.n = 3;
|
|
1480
1818
|
break;
|
|
1481
1819
|
case 10:
|
|
1482
|
-
|
|
1820
|
+
_context0.n = 12;
|
|
1483
1821
|
break;
|
|
1484
1822
|
case 11:
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1823
|
+
_context0.p = 11;
|
|
1824
|
+
_t1 = _context0.v;
|
|
1825
|
+
_iterator16.e(_t1);
|
|
1488
1826
|
case 12:
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
return
|
|
1827
|
+
_context0.p = 12;
|
|
1828
|
+
_iterator16.f();
|
|
1829
|
+
return _context0.f(12);
|
|
1492
1830
|
case 13:
|
|
1493
|
-
return
|
|
1831
|
+
return _context0.a(2, css);
|
|
1494
1832
|
}
|
|
1495
|
-
},
|
|
1833
|
+
}, _callee0, null, [[4, 5], [2, 11, 12, 13]]);
|
|
1496
1834
|
}));
|
|
1497
1835
|
return _collectDependencyCss.apply(this, arguments);
|
|
1498
1836
|
}
|
|
@@ -1507,150 +1845,150 @@ var RELATIVE_URL = /url\(\s*(["']?)(?![a-z]+:|\/|#)([^"')]+)\1\s*\)/gi;
|
|
|
1507
1845
|
* Names follow `resolveAsset`'s: the first 16 hex of the base64's SHA-256, and
|
|
1508
1846
|
* the file's own extension.
|
|
1509
1847
|
*/
|
|
1510
|
-
function readDependencyStylesheet(
|
|
1848
|
+
function readDependencyStylesheet(_x30, _x31, _x32) {
|
|
1511
1849
|
return _readDependencyStylesheet.apply(this, arguments);
|
|
1512
1850
|
}
|
|
1513
1851
|
function _readDependencyStylesheet() {
|
|
1514
|
-
_readDependencyStylesheet = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1515
|
-
var base, css, imports,
|
|
1516
|
-
return _regenerator().w(function (
|
|
1517
|
-
while (1) switch (
|
|
1852
|
+
_readDependencyStylesheet = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(file, assets, seen) {
|
|
1853
|
+
var base, css, imports, _iterator17, _step17, match, target, inlined, rewrites, _iterator18, _step18, _match, reference, path, base64, hash, name, _t10, _t11, _t13;
|
|
1854
|
+
return _regenerator().w(function (_context1) {
|
|
1855
|
+
while (1) switch (_context1.p = _context1.n) {
|
|
1518
1856
|
case 0:
|
|
1519
1857
|
seen.add(file);
|
|
1520
1858
|
base = dirname(file);
|
|
1521
|
-
|
|
1859
|
+
_context1.n = 1;
|
|
1522
1860
|
return readFile(file, "utf8");
|
|
1523
1861
|
case 1:
|
|
1524
|
-
css =
|
|
1862
|
+
css = _context1.v;
|
|
1525
1863
|
imports = _toConsumableArray(css.matchAll(/@import\s+(?:url\(\s*)?(["'])(\.{1,2}\/[^"']+)\1[^;]*;/g));
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1864
|
+
_iterator17 = _createForOfIteratorHelper(imports);
|
|
1865
|
+
_context1.p = 2;
|
|
1866
|
+
_iterator17.s();
|
|
1529
1867
|
case 3:
|
|
1530
|
-
if ((
|
|
1531
|
-
|
|
1868
|
+
if ((_step17 = _iterator17.n()).done) {
|
|
1869
|
+
_context1.n = 8;
|
|
1532
1870
|
break;
|
|
1533
1871
|
}
|
|
1534
|
-
match =
|
|
1872
|
+
match = _step17.value;
|
|
1535
1873
|
target = join(base, match[2]);
|
|
1536
1874
|
if (!seen.has(target)) {
|
|
1537
|
-
|
|
1875
|
+
_context1.n = 4;
|
|
1538
1876
|
break;
|
|
1539
1877
|
}
|
|
1540
|
-
|
|
1541
|
-
|
|
1878
|
+
_t10 = "";
|
|
1879
|
+
_context1.n = 6;
|
|
1542
1880
|
break;
|
|
1543
1881
|
case 4:
|
|
1544
|
-
|
|
1882
|
+
_context1.n = 5;
|
|
1545
1883
|
return readDependencyStylesheet(target, assets, seen)["catch"](function () {
|
|
1546
1884
|
return null;
|
|
1547
1885
|
});
|
|
1548
1886
|
case 5:
|
|
1549
|
-
|
|
1887
|
+
_t10 = _context1.v;
|
|
1550
1888
|
case 6:
|
|
1551
|
-
inlined =
|
|
1889
|
+
inlined = _t10;
|
|
1552
1890
|
// A missing file stays an import, so the builder names it.
|
|
1553
1891
|
if (inlined !== null) css = css.replace(match[0], inlined);
|
|
1554
1892
|
case 7:
|
|
1555
|
-
|
|
1893
|
+
_context1.n = 3;
|
|
1556
1894
|
break;
|
|
1557
1895
|
case 8:
|
|
1558
|
-
|
|
1896
|
+
_context1.n = 10;
|
|
1559
1897
|
break;
|
|
1560
1898
|
case 9:
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1899
|
+
_context1.p = 9;
|
|
1900
|
+
_t11 = _context1.v;
|
|
1901
|
+
_iterator17.e(_t11);
|
|
1564
1902
|
case 10:
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
return
|
|
1903
|
+
_context1.p = 10;
|
|
1904
|
+
_iterator17.f();
|
|
1905
|
+
return _context1.f(10);
|
|
1568
1906
|
case 11:
|
|
1569
1907
|
if (assets) {
|
|
1570
|
-
|
|
1908
|
+
_context1.n = 12;
|
|
1571
1909
|
break;
|
|
1572
1910
|
}
|
|
1573
|
-
return
|
|
1911
|
+
return _context1.a(2, css);
|
|
1574
1912
|
case 12:
|
|
1575
1913
|
rewrites = new Map();
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1914
|
+
_iterator18 = _createForOfIteratorHelper(css.matchAll(RELATIVE_URL));
|
|
1915
|
+
_context1.p = 13;
|
|
1916
|
+
_iterator18.s();
|
|
1579
1917
|
case 14:
|
|
1580
|
-
if ((
|
|
1581
|
-
|
|
1918
|
+
if ((_step18 = _iterator18.n()).done) {
|
|
1919
|
+
_context1.n = 21;
|
|
1582
1920
|
break;
|
|
1583
1921
|
}
|
|
1584
|
-
_match =
|
|
1922
|
+
_match = _step18.value;
|
|
1585
1923
|
reference = _match[2].trim();
|
|
1586
1924
|
if (!rewrites.has(reference)) {
|
|
1587
|
-
|
|
1925
|
+
_context1.n = 15;
|
|
1588
1926
|
break;
|
|
1589
1927
|
}
|
|
1590
|
-
return
|
|
1928
|
+
return _context1.a(3, 20);
|
|
1591
1929
|
case 15:
|
|
1592
1930
|
path = join(base, reference.split(/[?#]/)[0]);
|
|
1593
1931
|
base64 = void 0;
|
|
1594
|
-
|
|
1595
|
-
|
|
1932
|
+
_context1.p = 16;
|
|
1933
|
+
_context1.n = 17;
|
|
1596
1934
|
return readFile(path);
|
|
1597
1935
|
case 17:
|
|
1598
|
-
base64 =
|
|
1599
|
-
|
|
1936
|
+
base64 = _context1.v.toString("base64");
|
|
1937
|
+
_context1.n = 19;
|
|
1600
1938
|
break;
|
|
1601
1939
|
case 18:
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
return
|
|
1940
|
+
_context1.p = 18;
|
|
1941
|
+
_context1.v;
|
|
1942
|
+
return _context1.a(3, 20);
|
|
1605
1943
|
case 19:
|
|
1606
1944
|
hash = createHash("sha256").update(base64).digest("hex").slice(0, 16);
|
|
1607
1945
|
name = "".concat(hash).concat(extname(path).toLowerCase());
|
|
1608
1946
|
assets[name] = base64;
|
|
1609
1947
|
rewrites.set(reference, "".concat(ASSET_BASE).concat(name));
|
|
1610
1948
|
case 20:
|
|
1611
|
-
|
|
1949
|
+
_context1.n = 14;
|
|
1612
1950
|
break;
|
|
1613
1951
|
case 21:
|
|
1614
|
-
|
|
1952
|
+
_context1.n = 23;
|
|
1615
1953
|
break;
|
|
1616
1954
|
case 22:
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1955
|
+
_context1.p = 22;
|
|
1956
|
+
_t13 = _context1.v;
|
|
1957
|
+
_iterator18.e(_t13);
|
|
1620
1958
|
case 23:
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
return
|
|
1959
|
+
_context1.p = 23;
|
|
1960
|
+
_iterator18.f();
|
|
1961
|
+
return _context1.f(23);
|
|
1624
1962
|
case 24:
|
|
1625
|
-
return
|
|
1963
|
+
return _context1.a(2, css.replace(RELATIVE_URL, function (whole, _quote, reference) {
|
|
1626
1964
|
var url = rewrites.get(reference.trim());
|
|
1627
1965
|
return url ? "url(".concat(url, ")") : whole;
|
|
1628
1966
|
}));
|
|
1629
1967
|
}
|
|
1630
|
-
},
|
|
1968
|
+
}, _callee1, null, [[16, 18], [13, 22, 23, 24], [2, 9, 10, 11]]);
|
|
1631
1969
|
}));
|
|
1632
1970
|
return _readDependencyStylesheet.apply(this, arguments);
|
|
1633
1971
|
}
|
|
1634
|
-
function buildVendorLayer(
|
|
1972
|
+
function buildVendorLayer(_x33, _x34, _x35, _x36) {
|
|
1635
1973
|
return _buildVendorLayer.apply(this, arguments);
|
|
1636
1974
|
}
|
|
1637
1975
|
function _buildVendorLayer() {
|
|
1638
|
-
_buildVendorLayer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1639
|
-
var modules,
|
|
1640
|
-
return _regenerator().w(function (
|
|
1641
|
-
while (1) switch (
|
|
1976
|
+
_buildVendorLayer = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(dir, deps, css, platform) {
|
|
1977
|
+
var modules, _iterator19, _step19, _loop3, stubs, input, _i4, _Object$entries3, _Object$entries3$_i, specifier, name, file, skipped, workerOnly, workerOnlyReasons, specifierOf, usable, built, _i5, _Object$values, _name2, worked, reasons, _iterator20, _step20, target, _message, _reasons$, _i6, _Object$entries4, _Object$entries4$_i, _specifier, _name3, _t14, _t15, _t16;
|
|
1978
|
+
return _regenerator().w(function (_context11) {
|
|
1979
|
+
while (1) switch (_context11.p = _context11.n) {
|
|
1642
1980
|
case 0:
|
|
1643
1981
|
if (!(deps.length === 0 && Object.keys(css).length === 0)) {
|
|
1644
|
-
|
|
1982
|
+
_context11.n = 1;
|
|
1645
1983
|
break;
|
|
1646
1984
|
}
|
|
1647
|
-
return
|
|
1985
|
+
return _context11.a(2, null);
|
|
1648
1986
|
case 1:
|
|
1649
1987
|
if (!(deps.length === 0)) {
|
|
1650
|
-
|
|
1988
|
+
_context11.n = 2;
|
|
1651
1989
|
break;
|
|
1652
1990
|
}
|
|
1653
|
-
return
|
|
1991
|
+
return _context11.a(2, {
|
|
1654
1992
|
rev: cssRev(css),
|
|
1655
1993
|
modules: {},
|
|
1656
1994
|
worker: {},
|
|
@@ -1662,53 +2000,53 @@ function _buildVendorLayer() {
|
|
|
1662
2000
|
});
|
|
1663
2001
|
case 2:
|
|
1664
2002
|
modules = {};
|
|
1665
|
-
|
|
1666
|
-
|
|
2003
|
+
_iterator19 = _createForOfIteratorHelper(deps);
|
|
2004
|
+
_context11.p = 3;
|
|
1667
2005
|
_loop3 = /*#__PURE__*/_regenerator().m(function _loop3() {
|
|
1668
2006
|
var specifier, name, clash;
|
|
1669
|
-
return _regenerator().w(function (
|
|
1670
|
-
while (1) switch (
|
|
2007
|
+
return _regenerator().w(function (_context10) {
|
|
2008
|
+
while (1) switch (_context10.n) {
|
|
1671
2009
|
case 0:
|
|
1672
|
-
specifier =
|
|
2010
|
+
specifier = _step19.value;
|
|
1673
2011
|
name = chunkNameFor(specifier);
|
|
1674
|
-
clash = Object.entries(modules).find(function (
|
|
1675
|
-
var
|
|
1676
|
-
existing =
|
|
2012
|
+
clash = Object.entries(modules).find(function (_ref10) {
|
|
2013
|
+
var _ref11 = _slicedToArray(_ref10, 2),
|
|
2014
|
+
existing = _ref11[1];
|
|
1677
2015
|
return existing === name;
|
|
1678
2016
|
});
|
|
1679
2017
|
if (!clash) {
|
|
1680
|
-
|
|
2018
|
+
_context10.n = 1;
|
|
1681
2019
|
break;
|
|
1682
2020
|
}
|
|
1683
2021
|
throw new Error("'".concat(specifier, "' and '").concat(clash[0], "' both map to the chunk name '").concat(name, "'. ") + "Rename is not an option, so this needs chunkNameFor to disambiguate.");
|
|
1684
2022
|
case 1:
|
|
1685
2023
|
modules[specifier] = name;
|
|
1686
2024
|
case 2:
|
|
1687
|
-
return
|
|
2025
|
+
return _context10.a(2);
|
|
1688
2026
|
}
|
|
1689
2027
|
}, _loop3);
|
|
1690
2028
|
});
|
|
1691
|
-
|
|
2029
|
+
_iterator19.s();
|
|
1692
2030
|
case 4:
|
|
1693
|
-
if ((
|
|
1694
|
-
|
|
2031
|
+
if ((_step19 = _iterator19.n()).done) {
|
|
2032
|
+
_context11.n = 6;
|
|
1695
2033
|
break;
|
|
1696
2034
|
}
|
|
1697
|
-
return
|
|
2035
|
+
return _context11.d(_regeneratorValues(_loop3()), 5);
|
|
1698
2036
|
case 5:
|
|
1699
|
-
|
|
2037
|
+
_context11.n = 4;
|
|
1700
2038
|
break;
|
|
1701
2039
|
case 6:
|
|
1702
|
-
|
|
2040
|
+
_context11.n = 8;
|
|
1703
2041
|
break;
|
|
1704
2042
|
case 7:
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
2043
|
+
_context11.p = 7;
|
|
2044
|
+
_t14 = _context11.v;
|
|
2045
|
+
_iterator19.e(_t14);
|
|
1708
2046
|
case 8:
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
return
|
|
2047
|
+
_context11.p = 8;
|
|
2048
|
+
_iterator19.f();
|
|
2049
|
+
return _context11.f(8);
|
|
1712
2050
|
case 9:
|
|
1713
2051
|
// `resolve` rather than `join`, and the CLI's own default argument is why.
|
|
1714
2052
|
//
|
|
@@ -1725,34 +2063,34 @@ function _buildVendorLayer() {
|
|
|
1725
2063
|
// path: the suites all build in a mkdtemp. The one caller that does not is
|
|
1726
2064
|
// the one a person uses.
|
|
1727
2065
|
stubs = join(resolve(dir), STUB_DIR);
|
|
1728
|
-
|
|
2066
|
+
_context11.n = 10;
|
|
1729
2067
|
return rm(stubs, {
|
|
1730
2068
|
recursive: true,
|
|
1731
2069
|
force: true
|
|
1732
2070
|
});
|
|
1733
2071
|
case 10:
|
|
1734
|
-
|
|
2072
|
+
_context11.n = 11;
|
|
1735
2073
|
return mkdir(stubs, {
|
|
1736
2074
|
recursive: true
|
|
1737
2075
|
});
|
|
1738
2076
|
case 11:
|
|
1739
|
-
|
|
2077
|
+
_context11.p = 11;
|
|
1740
2078
|
input = {};
|
|
1741
|
-
|
|
2079
|
+
_i4 = 0, _Object$entries3 = Object.entries(modules);
|
|
1742
2080
|
case 12:
|
|
1743
|
-
if (!(
|
|
1744
|
-
|
|
2081
|
+
if (!(_i4 < _Object$entries3.length)) {
|
|
2082
|
+
_context11.n = 15;
|
|
1745
2083
|
break;
|
|
1746
2084
|
}
|
|
1747
|
-
_Object$entries3$_i = _slicedToArray(_Object$entries3[
|
|
2085
|
+
_Object$entries3$_i = _slicedToArray(_Object$entries3[_i4], 2), specifier = _Object$entries3$_i[0], name = _Object$entries3$_i[1];
|
|
1748
2086
|
file = join(stubs, "".concat(name, ".js"));
|
|
1749
|
-
|
|
2087
|
+
_context11.n = 13;
|
|
1750
2088
|
return writeFile(file, stubSource(specifier));
|
|
1751
2089
|
case 13:
|
|
1752
2090
|
input[name] = file;
|
|
1753
2091
|
case 14:
|
|
1754
|
-
|
|
1755
|
-
|
|
2092
|
+
_i4++;
|
|
2093
|
+
_context11.n = 12;
|
|
1756
2094
|
break;
|
|
1757
2095
|
case 15:
|
|
1758
2096
|
// Fast path: one build with every entry, so shared code is shared. When it
|
|
@@ -1765,31 +2103,32 @@ function _buildVendorLayer() {
|
|
|
1765
2103
|
/** Why each of those failed its browser build. Reporting only. */
|
|
1766
2104
|
workerOnlyReasons = {};
|
|
1767
2105
|
specifierOf = function specifierOf(chunk) {
|
|
1768
|
-
return Object.entries(modules).find(function (
|
|
1769
|
-
var
|
|
1770
|
-
name =
|
|
2106
|
+
return Object.entries(modules).find(function (_ref0) {
|
|
2107
|
+
var _ref1 = _slicedToArray(_ref0, 2),
|
|
2108
|
+
name = _ref1[1];
|
|
1771
2109
|
return name === chunk;
|
|
1772
2110
|
})[0];
|
|
1773
2111
|
};
|
|
1774
2112
|
usable = Object.values(modules);
|
|
1775
|
-
|
|
1776
|
-
return buildTargets(usable, input, join(stubs, "out"), false, platform)["catch"](function () {
|
|
2113
|
+
_context11.n = 16;
|
|
2114
|
+
return buildTargets(usable, input, join(stubs, "out"), false, platform)["catch"](function (error) {
|
|
2115
|
+
if (error instanceof PinSkewError) throw error;
|
|
1777
2116
|
return null;
|
|
1778
2117
|
});
|
|
1779
2118
|
case 16:
|
|
1780
|
-
built =
|
|
2119
|
+
built = _context11.v;
|
|
1781
2120
|
if (built) {
|
|
1782
|
-
|
|
2121
|
+
_context11.n = 33;
|
|
1783
2122
|
break;
|
|
1784
2123
|
}
|
|
1785
2124
|
usable = [];
|
|
1786
|
-
|
|
2125
|
+
_i5 = 0, _Object$values = Object.values(modules);
|
|
1787
2126
|
case 17:
|
|
1788
|
-
if (!(
|
|
1789
|
-
|
|
2127
|
+
if (!(_i5 < _Object$values.length)) {
|
|
2128
|
+
_context11.n = 30;
|
|
1790
2129
|
break;
|
|
1791
2130
|
}
|
|
1792
|
-
_name2 = _Object$values[
|
|
2131
|
+
_name2 = _Object$values[_i5];
|
|
1793
2132
|
// Probed per target, because the two sides are not the same question.
|
|
1794
2133
|
// `@valbuild/tanstack/server` cannot build for a browser -- it reaches
|
|
1795
2134
|
// TanStack's SSR path, which lands on `node:stream/web` -- and it has no
|
|
@@ -1800,45 +2139,51 @@ function _buildVendorLayer() {
|
|
|
1800
2139
|
// the builder, naming it.
|
|
1801
2140
|
worked = {};
|
|
1802
2141
|
reasons = [];
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
2142
|
+
_iterator20 = _createForOfIteratorHelper(targetsFor(platform));
|
|
2143
|
+
_context11.p = 18;
|
|
2144
|
+
_iterator20.s();
|
|
1806
2145
|
case 19:
|
|
1807
|
-
if ((
|
|
1808
|
-
|
|
2146
|
+
if ((_step20 = _iterator20.n()).done) {
|
|
2147
|
+
_context11.n = 25;
|
|
1809
2148
|
break;
|
|
1810
2149
|
}
|
|
1811
|
-
target =
|
|
1812
|
-
|
|
1813
|
-
|
|
2150
|
+
target = _step20.value;
|
|
2151
|
+
_context11.p = 20;
|
|
2152
|
+
_context11.n = 21;
|
|
1814
2153
|
return buildTargets({
|
|
1815
2154
|
worker: target.name === "worker" ? [_name2] : [],
|
|
1816
2155
|
browser: target.name === "browser" ? [_name2] : []
|
|
1817
2156
|
}, input, join(stubs, "probe", target.name, _name2), true, platform);
|
|
1818
2157
|
case 21:
|
|
1819
2158
|
worked[target.name] = true;
|
|
1820
|
-
|
|
2159
|
+
_context11.n = 24;
|
|
1821
2160
|
break;
|
|
1822
2161
|
case 22:
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
2162
|
+
_context11.p = 22;
|
|
2163
|
+
_t15 = _context11.v;
|
|
2164
|
+
if (!(_t15 instanceof PinSkewError)) {
|
|
2165
|
+
_context11.n = 23;
|
|
2166
|
+
break;
|
|
2167
|
+
}
|
|
2168
|
+
throw _t15;
|
|
1827
2169
|
case 23:
|
|
1828
|
-
|
|
1829
|
-
|
|
2170
|
+
worked[target.name] = false;
|
|
2171
|
+
reasons.push(firstLine(String((_message = _t15 === null || _t15 === void 0 ? void 0 : _t15.message) !== null && _message !== void 0 ? _message : _t15)));
|
|
1830
2172
|
case 24:
|
|
1831
|
-
|
|
2173
|
+
_context11.n = 19;
|
|
1832
2174
|
break;
|
|
1833
2175
|
case 25:
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
_iterator19.e(_t15);
|
|
2176
|
+
_context11.n = 27;
|
|
2177
|
+
break;
|
|
1837
2178
|
case 26:
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
2179
|
+
_context11.p = 26;
|
|
2180
|
+
_t16 = _context11.v;
|
|
2181
|
+
_iterator20.e(_t16);
|
|
1841
2182
|
case 27:
|
|
2183
|
+
_context11.p = 27;
|
|
2184
|
+
_iterator20.f();
|
|
2185
|
+
return _context11.f(27);
|
|
2186
|
+
case 28:
|
|
1842
2187
|
if (worked.worker && worked.browser) usable.push(_name2);else if (worked.worker) {
|
|
1843
2188
|
usable.push(_name2);
|
|
1844
2189
|
workerOnly.push(specifierOf(_name2));
|
|
@@ -1855,22 +2200,22 @@ function _buildVendorLayer() {
|
|
|
1855
2200
|
reason: (_reasons$ = reasons[0]) !== null && _reasons$ !== void 0 ? _reasons$ : "build failed"
|
|
1856
2201
|
});
|
|
1857
2202
|
}
|
|
1858
|
-
case 28:
|
|
1859
|
-
_i4++;
|
|
1860
|
-
_context1.n = 17;
|
|
1861
|
-
break;
|
|
1862
2203
|
case 29:
|
|
1863
|
-
|
|
1864
|
-
|
|
2204
|
+
_i5++;
|
|
2205
|
+
_context11.n = 17;
|
|
2206
|
+
break;
|
|
2207
|
+
case 30:
|
|
2208
|
+
for (_i6 = 0, _Object$entries4 = Object.entries(modules); _i6 < _Object$entries4.length; _i6++) {
|
|
2209
|
+
_Object$entries4$_i = _slicedToArray(_Object$entries4[_i6], 2), _specifier = _Object$entries4$_i[0], _name3 = _Object$entries4$_i[1];
|
|
1865
2210
|
if (!usable.includes(_name3)) delete modules[_specifier];
|
|
1866
2211
|
}
|
|
1867
2212
|
// Everything failed: a layer with no entries is the same as no layer, and
|
|
1868
2213
|
// the skip list is what the caller reports.
|
|
1869
2214
|
if (!(usable.length === 0)) {
|
|
1870
|
-
|
|
2215
|
+
_context11.n = 31;
|
|
1871
2216
|
break;
|
|
1872
2217
|
}
|
|
1873
|
-
return
|
|
2218
|
+
return _context11.a(2, {
|
|
1874
2219
|
rev: "none",
|
|
1875
2220
|
modules: {},
|
|
1876
2221
|
worker: {},
|
|
@@ -1880,18 +2225,18 @@ function _buildVendorLayer() {
|
|
|
1880
2225
|
workerOnly: workerOnly,
|
|
1881
2226
|
workerOnlyReasons: workerOnlyReasons
|
|
1882
2227
|
});
|
|
1883
|
-
case
|
|
1884
|
-
|
|
2228
|
+
case 31:
|
|
2229
|
+
_context11.n = 32;
|
|
1885
2230
|
return buildTargets({
|
|
1886
2231
|
worker: usable,
|
|
1887
2232
|
browser: usable.filter(function (name) {
|
|
1888
2233
|
return !workerOnly.includes(specifierOf(name));
|
|
1889
2234
|
})
|
|
1890
2235
|
}, input, join(stubs, "out"), false, platform);
|
|
1891
|
-
case 31:
|
|
1892
|
-
built = _context1.v;
|
|
1893
2236
|
case 32:
|
|
1894
|
-
|
|
2237
|
+
built = _context11.v;
|
|
2238
|
+
case 33:
|
|
2239
|
+
return _context11.a(2, {
|
|
1895
2240
|
rev: "".concat(built.rev).concat(cssRev(css) ? "-".concat(cssRev(css)) : ""),
|
|
1896
2241
|
modules: modules,
|
|
1897
2242
|
worker: built.worker,
|
|
@@ -1901,19 +2246,19 @@ function _buildVendorLayer() {
|
|
|
1901
2246
|
workerOnly: workerOnly,
|
|
1902
2247
|
workerOnlyReasons: workerOnlyReasons
|
|
1903
2248
|
});
|
|
1904
|
-
case
|
|
1905
|
-
|
|
1906
|
-
|
|
2249
|
+
case 34:
|
|
2250
|
+
_context11.p = 34;
|
|
2251
|
+
_context11.n = 35;
|
|
1907
2252
|
return rm(stubs, {
|
|
1908
2253
|
recursive: true,
|
|
1909
2254
|
force: true
|
|
1910
2255
|
});
|
|
1911
|
-
case 34:
|
|
1912
|
-
return _context1.f(33);
|
|
1913
2256
|
case 35:
|
|
1914
|
-
return
|
|
2257
|
+
return _context11.f(34);
|
|
2258
|
+
case 36:
|
|
2259
|
+
return _context11.a(2);
|
|
1915
2260
|
}
|
|
1916
|
-
},
|
|
2261
|
+
}, _callee10, null, [[20, 22], [18, 26, 27, 28], [11,, 34, 36], [3, 7, 8, 9]]);
|
|
1917
2262
|
}));
|
|
1918
2263
|
return _buildVendorLayer.apply(this, arguments);
|
|
1919
2264
|
}
|
|
@@ -2366,4 +2711,4 @@ function _generateRouteTree() {
|
|
|
2366
2711
|
return _generateRouteTree.apply(this, arguments);
|
|
2367
2712
|
}
|
|
2368
2713
|
|
|
2369
|
-
export { BASE_PROVIDED, NODE_SHIMS, REEXPORT, SHIM_PREFIX, auditableImports, auditableSpecifiers, buildVendorLayer, chunkNameFor, collectDependencyCss, cssModuleLoader, cssSpecifiersOf, generateRouteTree, isFileBased, layerDepsOf, nodeShimSources, nodeShims, packageOf, routeSplitter };
|
|
2714
|
+
export { BASE_PROVIDED, NODE_SHIMS, PinSkewError, REEXPORT, SHIM_PREFIX, auditableImports, auditableSpecifiers, buildVendorLayer, chunkNameFor, collectDependencyCss, cssModuleLoader, cssSpecifiersOf, generateRouteTree, isFileBased, layerDepsOf, nodeShimSources, nodeShims, packageOf, routeSplitter };
|