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