@stencil/core 2.11.0 → 2.14.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/cli/index.cjs +33 -8
- package/cli/index.js +33 -8
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +2855 -4909
- package/compiler/lib.dom.iterable.d.ts +42 -66
- package/compiler/lib.es2015.core.d.ts +60 -18
- package/compiler/lib.es2015.iterable.d.ts +3 -11
- package/compiler/lib.es2015.promise.d.ts +2 -74
- package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
- package/compiler/lib.es2018.intl.d.ts +23 -11
- package/compiler/lib.es2019.string.d.ts +8 -2
- package/compiler/lib.es2020.bigint.d.ts +2 -2
- package/compiler/lib.es2020.intl.d.ts +173 -114
- package/compiler/lib.es2020.promise.d.ts +2 -3
- package/compiler/lib.es2021.d.ts +1 -0
- package/compiler/lib.es2021.intl.d.ts +44 -0
- package/compiler/lib.es2021.promise.d.ts +8 -1
- package/compiler/lib.es5.d.ts +112 -52
- package/compiler/lib.esnext.intl.d.ts +1 -10
- package/compiler/lib.webworker.d.ts +1013 -1267
- package/compiler/lib.webworker.iterable.d.ts +28 -34
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +391 -112
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +2 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +3 -3
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +16 -5
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +2 -2
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +34 -7
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +5 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/polyfills/css-shim.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +2 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-public-runtime.d.ts +6 -4
- package/internal/testing/index.js +15 -13
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +33 -3
- package/mock-doc/index.d.ts +4 -3
- package/mock-doc/index.js +33 -3
- package/mock-doc/package.json +1 -1
- package/package.json +7 -7
- package/readme.md +52 -85
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +2 -2
- package/sys/node/index.js +22 -18
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +430 -402
- package/testing/jest/jest-config.d.ts +11 -0
- package/testing/jest/jest-environment.d.ts +1 -0
- package/testing/jest/jest-preprocessor.d.ts +56 -8
- package/testing/jest/jest-runner.d.ts +4 -0
- package/testing/jest-preset.js +5 -0
- package/testing/package.json +1 -1
package/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Testing v2.
|
|
2
|
+
Stencil Testing v2.14.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
function _lazyRequire(e) {
|
|
5
5
|
return new Proxy({}, {
|
|
@@ -45,28 +45,28 @@ async function startPuppeteerBrowser(e) {
|
|
|
45
45
|
Array.isArray(e.testing.browserArgs) && e.logger.debug(`puppeteer args: ${e.testing.browserArgs.join(" ")}`),
|
|
46
46
|
"boolean" == typeof e.testing.browserDevtools && e.logger.debug(`puppeteer devtools: ${e.testing.browserDevtools}`),
|
|
47
47
|
"number" == typeof e.testing.browserSlowMo && e.logger.debug(`puppeteer slowMo: ${e.testing.browserSlowMo}`);
|
|
48
|
-
const
|
|
48
|
+
const o = {
|
|
49
49
|
ignoreHTTPSErrors: !0,
|
|
50
50
|
slowMo: e.testing.browserSlowMo
|
|
51
51
|
};
|
|
52
|
-
let
|
|
53
|
-
if (e.testing.browserWSEndpoint)
|
|
52
|
+
let i;
|
|
53
|
+
if (e.testing.browserWSEndpoint) i = await n.connect({
|
|
54
54
|
browserWSEndpoint: e.testing.browserWSEndpoint,
|
|
55
|
-
...
|
|
55
|
+
...o
|
|
56
56
|
}); else {
|
|
57
57
|
const t = {
|
|
58
58
|
args: e.testing.browserArgs,
|
|
59
59
|
headless: e.testing.browserHeadless,
|
|
60
60
|
devtools: e.testing.browserDevtools,
|
|
61
|
-
...
|
|
61
|
+
...o
|
|
62
62
|
};
|
|
63
63
|
e.testing.browserExecutablePath && (t.executablePath = e.testing.browserExecutablePath),
|
|
64
|
-
|
|
64
|
+
i = await n.launch({
|
|
65
65
|
...t
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
return t.__STENCIL_BROWSER_WS_ENDPOINT__ =
|
|
69
|
-
|
|
68
|
+
return t.__STENCIL_BROWSER_WS_ENDPOINT__ = i.wsEndpoint(), e.logger.debug(`puppeteer browser wsEndpoint: ${t.__STENCIL_BROWSER_WS_ENDPOINT__}`),
|
|
69
|
+
i;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function getAppStyleUrl(e, t) {
|
|
@@ -76,13 +76,13 @@ function getAppStyleUrl(e, t) {
|
|
|
76
76
|
function getAppUrl(e, t, r) {
|
|
77
77
|
const s = e.outputTargets.find(isOutputTargetWww);
|
|
78
78
|
if (s) {
|
|
79
|
-
const e = s.buildDir, n = path$2.join(e, r),
|
|
80
|
-
return new URL(
|
|
79
|
+
const e = s.buildDir, n = path$2.join(e, r), o = path$2.relative(s.dir, n);
|
|
80
|
+
return new URL(o, t).href;
|
|
81
81
|
}
|
|
82
82
|
const n = e.outputTargets.find(isOutputTargetDistLazy);
|
|
83
83
|
if (n) {
|
|
84
|
-
const s = n.esmDir,
|
|
85
|
-
return new URL(
|
|
84
|
+
const s = n.esmDir, o = path$2.join(s, r), i = path$2.relative(e.rootDir, o);
|
|
85
|
+
return new URL(i, t).href;
|
|
86
86
|
}
|
|
87
87
|
return t;
|
|
88
88
|
}
|
|
@@ -133,8 +133,28 @@ async function runJest(e, t) {
|
|
|
133
133
|
const t = require("yargs"), r = [ ...e.flags.unknownArgs.slice(), ...e.flags.knownArgs.slice() ];
|
|
134
134
|
r.some((e => e.startsWith("--max-workers") || e.startsWith("--maxWorkers"))) || r.push(`--max-workers=${e.maxConcurrentWorkers}`),
|
|
135
135
|
e.flags.devtools && r.push("--runInBand"), e.logger.info(e.logger.magenta(`jest args: ${r.join(" ")}`));
|
|
136
|
-
|
|
137
|
-
if (
|
|
136
|
+
let s = t(r).argv;
|
|
137
|
+
if (s = {
|
|
138
|
+
...s,
|
|
139
|
+
detectLeaks: !1,
|
|
140
|
+
"detect-leaks": !1,
|
|
141
|
+
detectOpenHandles: !1,
|
|
142
|
+
"detect-open-handles": !1,
|
|
143
|
+
errorOnDeprecated: !1,
|
|
144
|
+
"error-on-deprecated": !1,
|
|
145
|
+
listTests: !1,
|
|
146
|
+
"list-tests": !1,
|
|
147
|
+
maxConcurrency: 5,
|
|
148
|
+
"max-concurrency": 5,
|
|
149
|
+
notifyMode: "failure-change",
|
|
150
|
+
"notify-mode": "failure-change",
|
|
151
|
+
passWithNoTests: !1,
|
|
152
|
+
"pass-with-no-tests": !1,
|
|
153
|
+
runTestsByPath: !1,
|
|
154
|
+
"run-tests-by-path": !1,
|
|
155
|
+
testLocationInResults: !1,
|
|
156
|
+
"test-location-in-results": !1
|
|
157
|
+
}, s.config = function n(e) {
|
|
138
158
|
const t = e.testing, r = require("jest-config").defaults, s = Object.keys(r), n = {};
|
|
139
159
|
return Object.keys(t).forEach((e => {
|
|
140
160
|
s.includes(e) && (n[e] = t[e]);
|
|
@@ -145,16 +165,16 @@ async function runJest(e, t) {
|
|
|
145
165
|
isString(t.preset) && (n.preset = t.preset), t.projects && (n.projects = t.projects),
|
|
146
166
|
Array.isArray(t.reporters) && (n.reporters = t.reporters), isString(t.testResultsProcessor) && (n.testResultsProcessor = t.testResultsProcessor),
|
|
147
167
|
t.transform && (n.transform = t.transform), t.verbose && (n.verbose = t.verbose),
|
|
148
|
-
JSON.stringify(n);
|
|
149
|
-
}(e), "string" == typeof
|
|
150
|
-
|
|
168
|
+
n.testRunner = "jest-jasmine2", JSON.stringify(n);
|
|
169
|
+
}(e), "string" == typeof s.maxWorkers) try {
|
|
170
|
+
s.maxWorkers = parseInt(s.maxWorkers, 10);
|
|
151
171
|
} catch (e) {}
|
|
152
|
-
return "string" == typeof
|
|
153
|
-
}(e),
|
|
172
|
+
return "string" == typeof s.ci && (s.ci = "true" === s.ci || "" === s.ci), s;
|
|
173
|
+
}(e), o = function o(e, t) {
|
|
154
174
|
const r = t.projects ? t.projects : [];
|
|
155
175
|
return r.push(e.rootDir), r;
|
|
156
|
-
}(e, n), {runCLI:
|
|
157
|
-
r = !!(await
|
|
176
|
+
}(e, n), {runCLI: i} = require("@jest/core");
|
|
177
|
+
r = !!(await i(n, o)).results.success;
|
|
158
178
|
} catch (t) {
|
|
159
179
|
e.logger.error(`runJest: ${t}`);
|
|
160
180
|
}
|
|
@@ -205,6 +225,64 @@ function formatDiagnostic(e) {
|
|
|
205
225
|
t;
|
|
206
226
|
}
|
|
207
227
|
|
|
228
|
+
function getCompilerOptions(e) {
|
|
229
|
+
if (_tsCompilerOptions) return _tsCompilerOptions;
|
|
230
|
+
if ("string" != typeof e) return null;
|
|
231
|
+
e = normalizePath(e);
|
|
232
|
+
const t = stencil_js.ts.findConfigFile(e, stencil_js.ts.sys.fileExists);
|
|
233
|
+
if (!t) return null;
|
|
234
|
+
const r = stencil_js.ts.readConfigFile(t, stencil_js.ts.sys.readFile);
|
|
235
|
+
if (r.error) throw new Error(formatDiagnostic((e => {
|
|
236
|
+
const t = {
|
|
237
|
+
level: "warn",
|
|
238
|
+
type: "typescript",
|
|
239
|
+
language: "typescript",
|
|
240
|
+
header: "TypeScript",
|
|
241
|
+
code: e.code.toString(),
|
|
242
|
+
messageText: flattenDiagnosticMessageText(e, e.messageText),
|
|
243
|
+
relFilePath: null,
|
|
244
|
+
absFilePath: null,
|
|
245
|
+
lines: []
|
|
246
|
+
};
|
|
247
|
+
if (1 === e.category && (t.level = "error"), e.file) {
|
|
248
|
+
t.absFilePath = e.file.fileName;
|
|
249
|
+
const s = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), n = e.file.getLineAndCharacterOfPosition(e.start), o = {
|
|
250
|
+
lineIndex: n.line,
|
|
251
|
+
lineNumber: n.line + 1,
|
|
252
|
+
text: s[n.line],
|
|
253
|
+
errorCharStart: n.character,
|
|
254
|
+
errorLength: Math.max(e.length, 1)
|
|
255
|
+
};
|
|
256
|
+
if (t.lineNumber = o.lineNumber, t.columnNumber = o.errorCharStart + 1, t.lines.push(o),
|
|
257
|
+
0 === o.errorLength && o.errorCharStart > 0 && (o.errorLength = 1, o.errorCharStart--),
|
|
258
|
+
o.lineIndex > 0) {
|
|
259
|
+
const e = {
|
|
260
|
+
lineIndex: o.lineIndex - 1,
|
|
261
|
+
lineNumber: o.lineNumber - 1,
|
|
262
|
+
text: s[o.lineIndex - 1],
|
|
263
|
+
errorCharStart: -1,
|
|
264
|
+
errorLength: -1
|
|
265
|
+
};
|
|
266
|
+
t.lines.unshift(e);
|
|
267
|
+
}
|
|
268
|
+
if (o.lineIndex + 1 < s.length) {
|
|
269
|
+
const e = {
|
|
270
|
+
lineIndex: o.lineIndex + 1,
|
|
271
|
+
lineNumber: o.lineNumber + 1,
|
|
272
|
+
text: s[o.lineIndex + 1],
|
|
273
|
+
errorCharStart: -1,
|
|
274
|
+
errorLength: -1
|
|
275
|
+
};
|
|
276
|
+
t.lines.push(e);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
var r;
|
|
280
|
+
return t;
|
|
281
|
+
})(r.error)));
|
|
282
|
+
const s = stencil_js.ts.parseJsonConfigFileContent(r.config, stencil_js.ts.sys, e, void 0, t);
|
|
283
|
+
return _tsCompilerOptions = s.options, _tsCompilerOptions;
|
|
284
|
+
}
|
|
285
|
+
|
|
208
286
|
function compareHtml(e, t, r) {
|
|
209
287
|
if (null == e) throw new Error(`expect toEqualHtml() value is "${e}"`);
|
|
210
288
|
if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
|
|
@@ -235,11 +313,11 @@ function compareHtml(e, t, r) {
|
|
|
235
313
|
});
|
|
236
314
|
}
|
|
237
315
|
}
|
|
238
|
-
const
|
|
316
|
+
const o = index_cjs.parseHtmlToFragment(t), i = index_cjs.serializeNodeToHtml(o, {
|
|
239
317
|
prettyHtml: !0,
|
|
240
318
|
excludeTags: [ "body" ]
|
|
241
319
|
});
|
|
242
|
-
return s !==
|
|
320
|
+
return s !== i ? (expect(s).toBe(i), {
|
|
243
321
|
message: () => "HTML does not match",
|
|
244
322
|
pass: !1
|
|
245
323
|
}) : {
|
|
@@ -310,7 +388,7 @@ function assertPath(e) {
|
|
|
310
388
|
}
|
|
311
389
|
|
|
312
390
|
function normalizeStringPosix(e, t) {
|
|
313
|
-
var r, s, n,
|
|
391
|
+
var r, s, n, o = "", i = 0, a = -1, l = 0;
|
|
314
392
|
for (s = 0; s <= e.length; ++s) {
|
|
315
393
|
if (s < e.length) r = e.charCodeAt(s); else {
|
|
316
394
|
if (47 === r) break;
|
|
@@ -318,27 +396,27 @@ function normalizeStringPosix(e, t) {
|
|
|
318
396
|
}
|
|
319
397
|
if (47 === r) {
|
|
320
398
|
if (a === s - 1 || 1 === l) ; else if (a !== s - 1 && 2 === l) {
|
|
321
|
-
if (
|
|
322
|
-
if ((n =
|
|
323
|
-
-1 === n ? (
|
|
399
|
+
if (o.length < 2 || 2 !== i || 46 !== o.charCodeAt(o.length - 1) || 46 !== o.charCodeAt(o.length - 2)) if (o.length > 2) {
|
|
400
|
+
if ((n = o.lastIndexOf("/")) !== o.length - 1) {
|
|
401
|
+
-1 === n ? (o = "", i = 0) : i = (o = o.slice(0, n)).length - 1 - o.lastIndexOf("/"),
|
|
324
402
|
a = s, l = 0;
|
|
325
403
|
continue;
|
|
326
404
|
}
|
|
327
|
-
} else if (2 ===
|
|
328
|
-
|
|
405
|
+
} else if (2 === o.length || 1 === o.length) {
|
|
406
|
+
o = "", i = 0, a = s, l = 0;
|
|
329
407
|
continue;
|
|
330
408
|
}
|
|
331
|
-
t && (
|
|
332
|
-
} else
|
|
409
|
+
t && (o.length > 0 ? o += "/.." : o = "..", i = 2);
|
|
410
|
+
} else o.length > 0 ? o += "/" + e.slice(a + 1, s) : o = e.slice(a + 1, s), i = s - a - 1;
|
|
333
411
|
a = s, l = 0;
|
|
334
412
|
} else 46 === r && -1 !== l ? ++l : l = -1;
|
|
335
413
|
}
|
|
336
|
-
return
|
|
414
|
+
return o;
|
|
337
415
|
}
|
|
338
416
|
|
|
339
417
|
function specifierIncluded$1(e, t) {
|
|
340
|
-
var r, s, n,
|
|
341
|
-
for (r = 0; r < 3; ++r) if ((s = parseInt(
|
|
418
|
+
var r, s, n, o = e.split("."), i = t.split(" "), a = i.length > 1 ? i[0] : "=", l = (i.length > 1 ? i[1] : i[0]).split(".");
|
|
419
|
+
for (r = 0; r < 3; ++r) if ((s = parseInt(o[r] || 0, 10)) !== (n = parseInt(l[r] || 0, 10))) return "<" === a ? s < n : ">=" === a && s >= n;
|
|
342
420
|
return ">=" === a;
|
|
343
421
|
}
|
|
344
422
|
|
|
@@ -350,9 +428,9 @@ function matchesRange$1(e, t) {
|
|
|
350
428
|
}
|
|
351
429
|
|
|
352
430
|
function specifierIncluded(e) {
|
|
353
|
-
var t, r, s, n = e.split(" "),
|
|
354
|
-
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(
|
|
355
|
-
return ">=" ===
|
|
431
|
+
var t, r, s, n = e.split(" "), o = n.length > 1 ? n[0] : "=", i = (n.length > 1 ? n[1] : n[0]).split(".");
|
|
432
|
+
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(i[t] || 0, 10))) return "<" === o ? r < s : ">=" === o && r >= s;
|
|
433
|
+
return ">=" === o;
|
|
356
434
|
}
|
|
357
435
|
|
|
358
436
|
function matchesRange(e) {
|
|
@@ -461,23 +539,23 @@ function mockCompilerCtx(e) {
|
|
|
461
539
|
if (!0 === r.inMemoryOnly) {
|
|
462
540
|
let n = e;
|
|
463
541
|
n.endsWith("/") || (n += "/");
|
|
464
|
-
const
|
|
542
|
+
const o = e.split("/");
|
|
465
543
|
t.forEach(((t, n) => {
|
|
466
544
|
if (!n.startsWith(e)) return;
|
|
467
545
|
const a = n.split("/");
|
|
468
|
-
if ((a.length ===
|
|
546
|
+
if ((a.length === o.length + 1 || r.recursive && a.length > o.length) && t.exists) {
|
|
469
547
|
const e = {
|
|
470
548
|
absPath: n,
|
|
471
|
-
relPath: a[
|
|
549
|
+
relPath: a[o.length],
|
|
472
550
|
isDirectory: t.isDirectory,
|
|
473
551
|
isFile: t.isFile
|
|
474
552
|
};
|
|
475
|
-
|
|
553
|
+
i(r, e) || s.push(e);
|
|
476
554
|
}
|
|
477
555
|
}));
|
|
478
|
-
} else await
|
|
556
|
+
} else await o(e, e, r, s);
|
|
479
557
|
return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
|
|
480
|
-
},
|
|
558
|
+
}, o = async (t, r, s, n) => {
|
|
481
559
|
const a = await e.readDir(r);
|
|
482
560
|
if (a.length > 0) {
|
|
483
561
|
const e = b(r);
|
|
@@ -488,10 +566,10 @@ function mockCompilerCtx(e) {
|
|
|
488
566
|
isDirectory: l.isDirectory,
|
|
489
567
|
isFile: l.isFile
|
|
490
568
|
};
|
|
491
|
-
|
|
569
|
+
i(s, u) || (n.push(u), !0 === s.recursive && !0 === l.isDirectory && await o(t, r, s, n));
|
|
492
570
|
})));
|
|
493
571
|
}
|
|
494
|
-
},
|
|
572
|
+
}, i = (e, t) => {
|
|
495
573
|
if (t.isDirectory) {
|
|
496
574
|
if (Array.isArray(e.excludeDirNames)) {
|
|
497
575
|
const r = path$2.basename(t.absPath);
|
|
@@ -544,26 +622,26 @@ function mockCompilerCtx(e) {
|
|
|
544
622
|
}, d = async (t, s, n) => {
|
|
545
623
|
if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
|
|
546
624
|
if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
|
|
547
|
-
const
|
|
625
|
+
const o = {
|
|
548
626
|
ignored: !1,
|
|
549
627
|
changedContent: !1,
|
|
550
628
|
queuedWrite: !1
|
|
551
629
|
};
|
|
552
|
-
if (!0 === shouldIgnore(t)) return
|
|
553
|
-
const
|
|
554
|
-
if (
|
|
555
|
-
"string" == typeof
|
|
556
|
-
|
|
557
|
-
!1 === n.useCache && (
|
|
630
|
+
if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
|
|
631
|
+
const i = b(t);
|
|
632
|
+
if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
|
|
633
|
+
"string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : o.changedContent = !0,
|
|
634
|
+
i.fileText = s, o.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
|
|
635
|
+
!1 === n.useCache && (i.useCache = !1)), null != n && !0 === n.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
|
|
558
636
|
await h(t, !0); else if (null != n && !0 === n.immediateWrite) {
|
|
559
|
-
if (
|
|
637
|
+
if (o.changedContent || !0 !== n.useCache) {
|
|
560
638
|
const r = await e.readFile(t);
|
|
561
|
-
"string" == typeof r && (
|
|
562
|
-
|
|
639
|
+
"string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
|
|
640
|
+
o.changedContent && (await h(t, !1), await e.writeFile(t, i.fileText));
|
|
563
641
|
}
|
|
564
|
-
} else
|
|
565
|
-
|
|
566
|
-
return
|
|
642
|
+
} else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
|
|
643
|
+
o.queuedWrite = !0);
|
|
644
|
+
return o;
|
|
567
645
|
}, h = async (e, t) => {
|
|
568
646
|
const r = [];
|
|
569
647
|
for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
|
|
@@ -646,12 +724,12 @@ function mockCompilerCtx(e) {
|
|
|
646
724
|
clearDirCache: _,
|
|
647
725
|
clearFileCache: v,
|
|
648
726
|
commit: async () => {
|
|
649
|
-
const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy),
|
|
727
|
+
const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy), o = await y(e.filesToDelete), i = await w(e.dirsToDelete);
|
|
650
728
|
return e.filesToDelete.forEach(v), e.dirsToDelete.forEach(_), {
|
|
651
729
|
filesCopied: n,
|
|
652
730
|
filesWritten: s,
|
|
653
|
-
filesDeleted:
|
|
654
|
-
dirsDeleted:
|
|
731
|
+
filesDeleted: o,
|
|
732
|
+
dirsDeleted: i,
|
|
655
733
|
dirsAdded: r
|
|
656
734
|
};
|
|
657
735
|
},
|
|
@@ -761,19 +839,19 @@ async function initPageEvents(e) {
|
|
|
761
839
|
}
|
|
762
840
|
|
|
763
841
|
async function pageSpyOnEvent(e, t, r) {
|
|
764
|
-
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document,
|
|
765
|
-
return await addE2EListener(e,
|
|
842
|
+
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, o = await e.evaluateHandle(n);
|
|
843
|
+
return await addE2EListener(e, o, t, (e => {
|
|
766
844
|
s.push(e);
|
|
767
845
|
})), s;
|
|
768
846
|
}
|
|
769
847
|
|
|
770
848
|
async function waitForEvent(e, t, r) {
|
|
771
849
|
const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate(((e, t, r) => new Promise(((s, n) => {
|
|
772
|
-
const
|
|
850
|
+
const o = setTimeout((() => {
|
|
773
851
|
n(new Error(`waitForEvent() timeout, eventName: ${t}`));
|
|
774
852
|
}), r);
|
|
775
853
|
e.addEventListener(t, (e => {
|
|
776
|
-
clearTimeout(
|
|
854
|
+
clearTimeout(o), s(window.stencilSerializeEvent(e));
|
|
777
855
|
}), {
|
|
778
856
|
once: !0
|
|
779
857
|
});
|
|
@@ -787,8 +865,8 @@ async function addE2EListener(e, t, r, s) {
|
|
|
787
865
|
eventName: r,
|
|
788
866
|
callback: s
|
|
789
867
|
});
|
|
790
|
-
const
|
|
791
|
-
await
|
|
868
|
+
const o = t.executionContext();
|
|
869
|
+
await o.evaluate(((e, t, r) => {
|
|
792
870
|
e.addEventListener(r, (e => {
|
|
793
871
|
window.stencilOnEvent(t, window.stencilSerializeEvent(e));
|
|
794
872
|
}));
|
|
@@ -844,7 +922,7 @@ function browserContextEvents() {
|
|
|
844
922
|
}
|
|
845
923
|
|
|
846
924
|
async function find(e, t, r) {
|
|
847
|
-
const {lightSelector: s, shadowSelector: n, text:
|
|
925
|
+
const {lightSelector: s, shadowSelector: n, text: o, contains: i} = getSelector(r);
|
|
848
926
|
let a;
|
|
849
927
|
if (a = "string" == typeof s ? await async function l(e, t, r, s) {
|
|
850
928
|
let n = await t.$(r);
|
|
@@ -872,20 +950,20 @@ async function find(e, t, r) {
|
|
|
872
950
|
}(e), s;
|
|
873
951
|
}), t, r, s);
|
|
874
952
|
return n ? n.asElement() : null;
|
|
875
|
-
}(e, t,
|
|
953
|
+
}(e, t, o, i), !a) return null;
|
|
876
954
|
const u = new E2EElement(e, a);
|
|
877
955
|
return await u.e2eSync(), u;
|
|
878
956
|
}
|
|
879
957
|
|
|
880
958
|
async function findAll(e, t, r) {
|
|
881
|
-
const s = [], {lightSelector: n, shadowSelector:
|
|
882
|
-
if (0 ===
|
|
883
|
-
if (
|
|
884
|
-
const r =
|
|
959
|
+
const s = [], {lightSelector: n, shadowSelector: o} = getSelector(r), i = await t.$$(n);
|
|
960
|
+
if (0 === i.length) return s;
|
|
961
|
+
if (o) for (let t = 0; t < i.length; t++) {
|
|
962
|
+
const r = i[t].executionContext(), n = await r.evaluateHandle(((e, t) => {
|
|
885
963
|
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
886
964
|
return e.shadowRoot.querySelectorAll(t);
|
|
887
|
-
}),
|
|
888
|
-
await
|
|
965
|
+
}), i[t], o);
|
|
966
|
+
await i[t].dispose();
|
|
889
967
|
const a = await n.getProperties();
|
|
890
968
|
await n.dispose();
|
|
891
969
|
for (const t of a.values()) {
|
|
@@ -895,8 +973,8 @@ async function findAll(e, t, r) {
|
|
|
895
973
|
await t.e2eSync(), s.push(t);
|
|
896
974
|
}
|
|
897
975
|
}
|
|
898
|
-
} else for (let t = 0; t <
|
|
899
|
-
const r = new E2EElement(e,
|
|
976
|
+
} else for (let t = 0; t < i.length; t++) {
|
|
977
|
+
const r = new E2EElement(e, i[t]);
|
|
900
978
|
await r.e2eSync(), s.push(r);
|
|
901
979
|
}
|
|
902
980
|
return s;
|
|
@@ -935,7 +1013,7 @@ function writeFile(e, t) {
|
|
|
935
1013
|
}));
|
|
936
1014
|
}
|
|
937
1015
|
|
|
938
|
-
async function compareScreenshot(e, t, r, s, n,
|
|
1016
|
+
async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
939
1017
|
const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
|
|
940
1018
|
await async function u(e, t) {
|
|
941
1019
|
await function r(e) {
|
|
@@ -943,7 +1021,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
943
1021
|
fs__default.default.access(e, (e => t(!e)));
|
|
944
1022
|
}));
|
|
945
1023
|
}(e) || await writeFile(e, t);
|
|
946
|
-
}(c, r), r = null,
|
|
1024
|
+
}(c, r), r = null, i && (i = normalizePath(path$2.relative(t.rootDir, i)));
|
|
947
1025
|
const d = function h(e, t) {
|
|
948
1026
|
if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
|
|
949
1027
|
const r = crypto$3.createHash("md5");
|
|
@@ -956,9 +1034,9 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
956
1034
|
device: e.device,
|
|
957
1035
|
userAgent: e.userAgent,
|
|
958
1036
|
desc: s,
|
|
959
|
-
testPath:
|
|
1037
|
+
testPath: i,
|
|
960
1038
|
width: n,
|
|
961
|
-
height:
|
|
1039
|
+
height: o,
|
|
962
1040
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
963
1041
|
hasTouch: e.viewport.hasTouch,
|
|
964
1042
|
isLandscape: e.viewport.isLandscape,
|
|
@@ -972,14 +1050,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
972
1050
|
device: e.device,
|
|
973
1051
|
userAgent: e.userAgent,
|
|
974
1052
|
width: n,
|
|
975
|
-
height:
|
|
1053
|
+
height: o,
|
|
976
1054
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
977
1055
|
hasTouch: e.viewport.hasTouch,
|
|
978
1056
|
isLandscape: e.viewport.isLandscape,
|
|
979
1057
|
isMobile: e.viewport.isMobile,
|
|
980
1058
|
allowableMismatchedPixels: t.allowableMismatchedPixels,
|
|
981
1059
|
allowableMismatchedRatio: t.allowableMismatchedRatio,
|
|
982
|
-
testPath:
|
|
1060
|
+
testPath: i
|
|
983
1061
|
}
|
|
984
1062
|
};
|
|
985
1063
|
if (t.updateMaster) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
|
|
@@ -1001,7 +1079,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1001
1079
|
};
|
|
1002
1080
|
p.diff.mismatchedPixels = await async function g(e, t) {
|
|
1003
1081
|
return new Promise(((r, s) => {
|
|
1004
|
-
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL,
|
|
1082
|
+
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, o = setTimeout((() => {
|
|
1005
1083
|
s(`getMismatchedPixels timeout: ${n}ms`);
|
|
1006
1084
|
}), n);
|
|
1007
1085
|
try {
|
|
@@ -1010,14 +1088,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1010
1088
|
env: process.env,
|
|
1011
1089
|
cwd: process.cwd(),
|
|
1012
1090
|
stdio: [ "pipe", "pipe", "pipe", "ipc" ]
|
|
1013
|
-
},
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
})),
|
|
1017
|
-
clearTimeout(
|
|
1018
|
-
})),
|
|
1091
|
+
}, i = child_process$2.fork(e, [], n);
|
|
1092
|
+
i.on("message", (e => {
|
|
1093
|
+
i.kill(), clearTimeout(o), r(e);
|
|
1094
|
+
})), i.on("error", (e => {
|
|
1095
|
+
clearTimeout(o), s(e);
|
|
1096
|
+
})), i.send(t);
|
|
1019
1097
|
} catch (e) {
|
|
1020
|
-
clearTimeout(
|
|
1098
|
+
clearTimeout(o), s(`getMismatchedPixels error: ${e}`);
|
|
1021
1099
|
}
|
|
1022
1100
|
}));
|
|
1023
1101
|
}(t.pixelmatchModulePath, n);
|
|
@@ -1034,9 +1112,9 @@ async function e2eGoTo(e, t, r = {}) {
|
|
|
1034
1112
|
if ("string" != typeof s) throw new Error("invalid gotoTest() browser url");
|
|
1035
1113
|
const n = s + t.substring(1);
|
|
1036
1114
|
r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1037
|
-
const
|
|
1038
|
-
if (!
|
|
1039
|
-
return await waitForStencil(e, r),
|
|
1115
|
+
const o = await e._e2eGoto(n, r);
|
|
1116
|
+
if (!o.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${o.status()}`);
|
|
1117
|
+
return await waitForStencil(e, r), o;
|
|
1040
1118
|
}
|
|
1041
1119
|
|
|
1042
1120
|
async function e2eSetContent(e, t, r = {}) {
|
|
@@ -1045,18 +1123,18 @@ async function e2eSetContent(e, t, r = {}) {
|
|
|
1045
1123
|
const s = [], n = env.__STENCIL_APP_SCRIPT_URL__;
|
|
1046
1124
|
if ("string" != typeof n) throw new Error("invalid e2eSetContent() app script url");
|
|
1047
1125
|
s.push("<!doctype html>"), s.push("<html>"), s.push("<head>");
|
|
1048
|
-
const
|
|
1049
|
-
"string" == typeof
|
|
1126
|
+
const o = env.__STENCIL_APP_STYLE_URL__;
|
|
1127
|
+
"string" == typeof o && s.push(`<link rel="stylesheet" href="${o}">`), s.push(`<script type="module" src="${n}"><\/script>`),
|
|
1050
1128
|
s.push("</head>"), s.push("<body>"), s.push(t), s.push("</body>"), s.push("</html>");
|
|
1051
|
-
const
|
|
1129
|
+
const i = env.__STENCIL_BROWSER_URL__;
|
|
1052
1130
|
await e.setRequestInterception(!0), e.on("request", (e => {
|
|
1053
|
-
|
|
1131
|
+
i === e.url() ? e.respond({
|
|
1054
1132
|
status: 200,
|
|
1055
1133
|
contentType: "text/html",
|
|
1056
1134
|
body: s.join("\n")
|
|
1057
1135
|
}) : e.continue();
|
|
1058
1136
|
})), r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1059
|
-
const a = await e._e2eGoto(
|
|
1137
|
+
const a = await e._e2eGoto(i, r);
|
|
1060
1138
|
if (!a.ok()) throw new Error("Testing unable to load content");
|
|
1061
1139
|
return await waitForStencil(e, r), a;
|
|
1062
1140
|
}
|
|
@@ -1164,8 +1242,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1164
1242
|
}, noop = () => {}, isFunction = e => "function" == typeof e, isString = e => "string" == typeof e, isIterable = e => (e => null != e)(e) && isFunction(e[Symbol.iterator]), windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/, hasError = e => null != e && 0 !== e.length && e.some((e => "error" === e.level && "runtime" !== e.type)), normalizePath = e => {
|
|
1165
1243
|
if ("string" != typeof e) throw new Error("invalid path to normalize");
|
|
1166
1244
|
e = normalizeSlashes(e.trim());
|
|
1167
|
-
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1],
|
|
1168
|
-
return "" ===
|
|
1245
|
+
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], o = s + r.slice(1).join("/");
|
|
1246
|
+
return "" === o ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + o : o;
|
|
1169
1247
|
}, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
|
|
1170
1248
|
if (!Array.isArray(e) || 0 === e.length) return [];
|
|
1171
1249
|
const t = [ e[0] ];
|
|
@@ -1202,8 +1280,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1202
1280
|
if (-1 !== r) {
|
|
1203
1281
|
const t = r + "://".length, s = e.indexOf("/", t);
|
|
1204
1282
|
if (-1 !== s) {
|
|
1205
|
-
const n = e.slice(0, r),
|
|
1206
|
-
if ("file" === n && ("" ===
|
|
1283
|
+
const n = e.slice(0, r), o = e.slice(t, s);
|
|
1284
|
+
if ("file" === n && ("" === o || "localhost" === o) && isVolumeCharacter(e.charCodeAt(s + 1))) {
|
|
1207
1285
|
const t = getFileUrlVolumeSeparatorEnd(e, s + 2);
|
|
1208
1286
|
if (-1 !== t) {
|
|
1209
1287
|
if (47 === e.charCodeAt(t)) return ~(t + 1);
|
|
@@ -1235,9 +1313,13 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1235
1313
|
if (!r.includes(t.code) && (n = t.messageText, isIterable(t.next))) for (const r of t.next) n += flattenDiagnosticMessageText(e, r);
|
|
1236
1314
|
return s && (n = n.replace("type 'StencilConfig'", "Stencil Config"), n = n.replace("Object literal may only specify known properties, but ", ""),
|
|
1237
1315
|
n = n.replace("Object literal may only specify known properties, and ", "")), n.trim();
|
|
1238
|
-
}, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www",
|
|
1239
|
-
|
|
1240
|
-
|
|
1316
|
+
}, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www", isJest27TransformOptions = e => "object" == typeof e && e.hasOwnProperty("config");
|
|
1317
|
+
|
|
1318
|
+
let _tsCompilerOptions = null, _tsCompilerOptionsKey = null;
|
|
1319
|
+
|
|
1320
|
+
const jestPreprocessor = {
|
|
1321
|
+
process(e, t, r, s) {
|
|
1322
|
+
if (isJest27TransformOptions(r) && (s = r.config), function n(e, t) {
|
|
1241
1323
|
const r = e.split(".").pop().toLowerCase().split("?")[0];
|
|
1242
1324
|
if ("ts" === r || "tsx" === r || "jsx" === r) return !0;
|
|
1243
1325
|
if ("mjs" === r) return !0;
|
|
@@ -1247,91 +1329,34 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1247
1329
|
}
|
|
1248
1330
|
return "css" === r;
|
|
1249
1331
|
}(t, e)) {
|
|
1250
|
-
const
|
|
1332
|
+
const r = {
|
|
1251
1333
|
file: t,
|
|
1252
|
-
currentDirectory:
|
|
1253
|
-
}, n =
|
|
1254
|
-
n && (n.baseUrl && (
|
|
1255
|
-
const
|
|
1256
|
-
if (
|
|
1257
|
-
const e =
|
|
1334
|
+
currentDirectory: s.rootDir
|
|
1335
|
+
}, n = getCompilerOptions(s.rootDir);
|
|
1336
|
+
n && (n.baseUrl && (r.baseUrl = n.baseUrl), n.paths && (r.paths = n.paths));
|
|
1337
|
+
const o = transpile(e, r), i = o.diagnostics.some((e => "error" === e.level));
|
|
1338
|
+
if (o.diagnostics && i) {
|
|
1339
|
+
const e = o.diagnostics.map(formatDiagnostic).join("\n\n");
|
|
1258
1340
|
throw new Error(e);
|
|
1259
1341
|
}
|
|
1260
|
-
return
|
|
1342
|
+
return o.code;
|
|
1261
1343
|
}
|
|
1262
1344
|
return e;
|
|
1263
1345
|
},
|
|
1264
|
-
getCompilerOptions(e) {
|
|
1265
|
-
return this._tsCompilerOptions || (this._tsCompilerOptions = function t(e) {
|
|
1266
|
-
if ("string" != typeof e) return null;
|
|
1267
|
-
e = normalizePath(e);
|
|
1268
|
-
const t = stencil_js.ts.findConfigFile(e, stencil_js.ts.sys.fileExists);
|
|
1269
|
-
if (!t) return null;
|
|
1270
|
-
const r = stencil_js.ts.readConfigFile(t, stencil_js.ts.sys.readFile);
|
|
1271
|
-
if (r.error) throw new Error(formatDiagnostic((e => {
|
|
1272
|
-
const t = {
|
|
1273
|
-
level: "warn",
|
|
1274
|
-
type: "typescript",
|
|
1275
|
-
language: "typescript",
|
|
1276
|
-
header: "TypeScript",
|
|
1277
|
-
code: e.code.toString(),
|
|
1278
|
-
messageText: flattenDiagnosticMessageText(e, e.messageText),
|
|
1279
|
-
relFilePath: null,
|
|
1280
|
-
absFilePath: null,
|
|
1281
|
-
lines: []
|
|
1282
|
-
};
|
|
1283
|
-
if (1 === e.category && (t.level = "error"), e.file) {
|
|
1284
|
-
t.absFilePath = e.file.fileName;
|
|
1285
|
-
const s = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), n = e.file.getLineAndCharacterOfPosition(e.start), i = {
|
|
1286
|
-
lineIndex: n.line,
|
|
1287
|
-
lineNumber: n.line + 1,
|
|
1288
|
-
text: s[n.line],
|
|
1289
|
-
errorCharStart: n.character,
|
|
1290
|
-
errorLength: Math.max(e.length, 1)
|
|
1291
|
-
};
|
|
1292
|
-
if (t.lineNumber = i.lineNumber, t.columnNumber = i.errorCharStart + 1, t.lines.push(i),
|
|
1293
|
-
0 === i.errorLength && i.errorCharStart > 0 && (i.errorLength = 1, i.errorCharStart--),
|
|
1294
|
-
i.lineIndex > 0) {
|
|
1295
|
-
const e = {
|
|
1296
|
-
lineIndex: i.lineIndex - 1,
|
|
1297
|
-
lineNumber: i.lineNumber - 1,
|
|
1298
|
-
text: s[i.lineIndex - 1],
|
|
1299
|
-
errorCharStart: -1,
|
|
1300
|
-
errorLength: -1
|
|
1301
|
-
};
|
|
1302
|
-
t.lines.unshift(e);
|
|
1303
|
-
}
|
|
1304
|
-
if (i.lineIndex + 1 < s.length) {
|
|
1305
|
-
const e = {
|
|
1306
|
-
lineIndex: i.lineIndex + 1,
|
|
1307
|
-
lineNumber: i.lineNumber + 1,
|
|
1308
|
-
text: s[i.lineIndex + 1],
|
|
1309
|
-
errorCharStart: -1,
|
|
1310
|
-
errorLength: -1
|
|
1311
|
-
};
|
|
1312
|
-
t.lines.push(e);
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
var r;
|
|
1316
|
-
return t;
|
|
1317
|
-
})(r.error)));
|
|
1318
|
-
return stencil_js.ts.parseJsonConfigFileContent(r.config, stencil_js.ts.sys, e, void 0, t).options;
|
|
1319
|
-
}(e)), this._tsCompilerOptions;
|
|
1320
|
-
},
|
|
1321
1346
|
getCacheKey(e, t, r, s) {
|
|
1322
|
-
if (!
|
|
1323
|
-
const e =
|
|
1324
|
-
|
|
1347
|
+
if (isJest27TransformOptions(r) && (s = r.config), !_tsCompilerOptionsKey) {
|
|
1348
|
+
const e = getCompilerOptions(s.rootDir);
|
|
1349
|
+
_tsCompilerOptionsKey = JSON.stringify(e);
|
|
1325
1350
|
}
|
|
1326
|
-
return [ process.version,
|
|
1351
|
+
return [ process.version, _tsCompilerOptionsKey, e, t, r, !!s.instrument, 7 ].join(":");
|
|
1327
1352
|
}
|
|
1328
1353
|
}, deepEqual = function e(t, r) {
|
|
1329
|
-
var s, n,
|
|
1354
|
+
var s, n, o, i, a, l, c, u, d, h;
|
|
1330
1355
|
if (t === r) return !0;
|
|
1331
1356
|
if (t && r && "object" == typeof t && "object" == typeof r) {
|
|
1332
1357
|
if (s = Array.isArray(t), n = Array.isArray(r), s && n) {
|
|
1333
|
-
if ((
|
|
1334
|
-
for (
|
|
1358
|
+
if ((i = t.length) != r.length) return !1;
|
|
1359
|
+
for (o = i; 0 != o--; ) if (!e(t[o], r[o])) return !1;
|
|
1335
1360
|
return !0;
|
|
1336
1361
|
}
|
|
1337
1362
|
if (s != n) return !1;
|
|
@@ -1339,9 +1364,9 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1339
1364
|
if (l && c) return t.getTime() == r.getTime();
|
|
1340
1365
|
if ((u = t instanceof RegExp) != (d = r instanceof RegExp)) return !1;
|
|
1341
1366
|
if (u && d) return t.toString() == r.toString();
|
|
1342
|
-
if ((
|
|
1343
|
-
for (
|
|
1344
|
-
for (
|
|
1367
|
+
if ((i = (h = Object.keys(t)).length) !== Object.keys(r).length) return !1;
|
|
1368
|
+
for (o = i; 0 != o--; ) if (!Object.prototype.hasOwnProperty.call(r, h[o])) return !1;
|
|
1369
|
+
for (o = i; 0 != o--; ) if (!e(t[a = h[o]], r[a])) return !1;
|
|
1345
1370
|
return !0;
|
|
1346
1371
|
}
|
|
1347
1372
|
return t != t && r != r;
|
|
@@ -1739,9 +1764,9 @@ class BuildContext {
|
|
|
1739
1764
|
}
|
|
1740
1765
|
return {
|
|
1741
1766
|
duration: () => r.duration(),
|
|
1742
|
-
finish: (e, s, n,
|
|
1767
|
+
finish: (e, s, n, o) => {
|
|
1743
1768
|
if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
|
|
1744
|
-
r.finish(e, s, n,
|
|
1769
|
+
r.finish(e, s, n, o), !t)) {
|
|
1745
1770
|
const e = {
|
|
1746
1771
|
buildId: this.buildId,
|
|
1747
1772
|
messages: this.buildMessages.slice(),
|
|
@@ -1857,12 +1882,12 @@ class Cache {
|
|
|
1857
1882
|
if (null != t) {
|
|
1858
1883
|
if (e - t < ONE_DAY) return;
|
|
1859
1884
|
const r = this.cacheFs.sys, s = await r.readDir(this.config.cacheDir), n = s.map((e => path$2.join(this.config.cacheDir, e)));
|
|
1860
|
-
let
|
|
1861
|
-
const
|
|
1885
|
+
let o = 0;
|
|
1886
|
+
const i = n.map((async t => {
|
|
1862
1887
|
const s = (await r.stat(t)).mtimeMs;
|
|
1863
|
-
e - s > ONE_WEEK && (await r.removeFile(t),
|
|
1888
|
+
e - s > ONE_WEEK && (await r.removeFile(t), o++);
|
|
1864
1889
|
}));
|
|
1865
|
-
await Promise.all(
|
|
1890
|
+
await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${o}`);
|
|
1866
1891
|
}
|
|
1867
1892
|
this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
|
|
1868
1893
|
}
|
|
@@ -1904,10 +1929,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1904
1929
|
} else if (!0 === e.queueDeleteFromDisk) e.isDirectory && !t.dirsToEnsure.includes(r) ? t.dirsToDelete.push(r) : e.isFile && !t.filesToWrite.includes(r) && t.filesToDelete.push(r); else if ("string" == typeof e.queueCopyFileToDest) {
|
|
1905
1930
|
const s = r, n = e.queueCopyFileToDest;
|
|
1906
1931
|
t.filesToCopy.push([ s, n ]);
|
|
1907
|
-
const
|
|
1908
|
-
t.dirsToEnsure.includes(
|
|
1909
|
-
const
|
|
1910
|
-
|
|
1932
|
+
const o = normalizePath(path$2.dirname(n));
|
|
1933
|
+
t.dirsToEnsure.includes(o) || t.dirsToEnsure.push(o);
|
|
1934
|
+
const i = t.dirsToDelete.indexOf(o);
|
|
1935
|
+
i > -1 && t.dirsToDelete.splice(i, 1);
|
|
1911
1936
|
const a = t.filesToDelete.indexOf(n);
|
|
1912
1937
|
a > -1 && t.filesToDelete.splice(a, 1);
|
|
1913
1938
|
}
|
|
@@ -1940,10 +1965,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1940
1965
|
|
|
1941
1966
|
(posix = {
|
|
1942
1967
|
resolve: function e() {
|
|
1943
|
-
var t, r, s, n = "",
|
|
1944
|
-
for (r = arguments.length - 1; r >= -1 && !
|
|
1945
|
-
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n,
|
|
1946
|
-
return n = normalizeStringPosix(n, !
|
|
1968
|
+
var t, r, s, n = "", o = !1;
|
|
1969
|
+
for (r = arguments.length - 1; r >= -1 && !o; r--) r >= 0 ? s = arguments[r] : (void 0 === t && (t = process.cwd()),
|
|
1970
|
+
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n, o = 47 === s.charCodeAt(0));
|
|
1971
|
+
return n = normalizeStringPosix(n, !o), o ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
|
|
1947
1972
|
},
|
|
1948
1973
|
normalize: function e(t) {
|
|
1949
1974
|
var r, s;
|
|
@@ -1961,70 +1986,70 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1961
1986
|
return void 0 === t ? "." : posix.normalize(t);
|
|
1962
1987
|
},
|
|
1963
1988
|
relative: function e(t, r) {
|
|
1964
|
-
var s, n,
|
|
1989
|
+
var s, n, o, i, a, l, c, u, d, h;
|
|
1965
1990
|
if (assertPath(t), assertPath(r), t === r) return "";
|
|
1966
1991
|
if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
|
|
1967
1992
|
for (s = 1; s < t.length && 47 === t.charCodeAt(s); ++s) ;
|
|
1968
|
-
for (
|
|
1969
|
-
for (l =
|
|
1993
|
+
for (o = (n = t.length) - s, i = 1; i < r.length && 47 === r.charCodeAt(i); ++i) ;
|
|
1994
|
+
for (l = o < (a = r.length - i) ? o : a, c = -1, u = 0; u <= l; ++u) {
|
|
1970
1995
|
if (u === l) {
|
|
1971
1996
|
if (a > l) {
|
|
1972
|
-
if (47 === r.charCodeAt(
|
|
1973
|
-
if (0 === u) return r.slice(
|
|
1974
|
-
} else
|
|
1997
|
+
if (47 === r.charCodeAt(i + u)) return r.slice(i + u + 1);
|
|
1998
|
+
if (0 === u) return r.slice(i + u);
|
|
1999
|
+
} else o > l && (47 === t.charCodeAt(s + u) ? c = u : 0 === u && (c = 0));
|
|
1975
2000
|
break;
|
|
1976
2001
|
}
|
|
1977
|
-
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(
|
|
2002
|
+
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(i + u)) break;
|
|
1978
2003
|
47 === d && (c = u);
|
|
1979
2004
|
}
|
|
1980
2005
|
for (h = "", u = s + c + 1; u <= n; ++u) u !== n && 47 !== t.charCodeAt(u) || (0 === h.length ? h += ".." : h += "/..");
|
|
1981
|
-
return h.length > 0 ? h + r.slice(
|
|
1982
|
-
r.slice(
|
|
2006
|
+
return h.length > 0 ? h + r.slice(i + c) : (i += c, 47 === r.charCodeAt(i) && ++i,
|
|
2007
|
+
r.slice(i));
|
|
1983
2008
|
},
|
|
1984
2009
|
_makeLong: function e(t) {
|
|
1985
2010
|
return t;
|
|
1986
2011
|
},
|
|
1987
2012
|
dirname: function e(t) {
|
|
1988
|
-
var r, s, n,
|
|
2013
|
+
var r, s, n, o;
|
|
1989
2014
|
if (assertPath(t), 0 === t.length) return ".";
|
|
1990
|
-
for (r = 47 === t.charCodeAt(0), s = -1, n = !0,
|
|
2015
|
+
for (r = 47 === t.charCodeAt(0), s = -1, n = !0, o = t.length - 1; o >= 1; --o) if (47 === t.charCodeAt(o)) {
|
|
1991
2016
|
if (!n) {
|
|
1992
|
-
s =
|
|
2017
|
+
s = o;
|
|
1993
2018
|
break;
|
|
1994
2019
|
}
|
|
1995
2020
|
} else n = !1;
|
|
1996
2021
|
return -1 === s ? r ? "/" : "." : r && 1 === s ? "//" : t.slice(0, s);
|
|
1997
2022
|
},
|
|
1998
2023
|
basename: function e(t, r) {
|
|
1999
|
-
var s, n,
|
|
2024
|
+
var s, n, o, i, a, l, c;
|
|
2000
2025
|
if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
|
|
2001
|
-
if (assertPath(t), s = 0, n = -1,
|
|
2026
|
+
if (assertPath(t), s = 0, n = -1, o = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
|
|
2002
2027
|
if (r.length === t.length && r === t) return "";
|
|
2003
|
-
for (a = r.length - 1, l = -1,
|
|
2004
|
-
if (!
|
|
2005
|
-
s =
|
|
2028
|
+
for (a = r.length - 1, l = -1, i = t.length - 1; i >= 0; --i) if (47 === (c = t.charCodeAt(i))) {
|
|
2029
|
+
if (!o) {
|
|
2030
|
+
s = i + 1;
|
|
2006
2031
|
break;
|
|
2007
2032
|
}
|
|
2008
|
-
} else -1 === l && (
|
|
2033
|
+
} else -1 === l && (o = !1, l = i + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (n = i) : (a = -1,
|
|
2009
2034
|
n = l));
|
|
2010
2035
|
return s === n ? n = l : -1 === n && (n = t.length), t.slice(s, n);
|
|
2011
2036
|
}
|
|
2012
|
-
for (
|
|
2013
|
-
if (!
|
|
2014
|
-
s =
|
|
2037
|
+
for (i = t.length - 1; i >= 0; --i) if (47 === t.charCodeAt(i)) {
|
|
2038
|
+
if (!o) {
|
|
2039
|
+
s = i + 1;
|
|
2015
2040
|
break;
|
|
2016
2041
|
}
|
|
2017
|
-
} else -1 === n && (
|
|
2042
|
+
} else -1 === n && (o = !1, n = i + 1);
|
|
2018
2043
|
return -1 === n ? "" : t.slice(s, n);
|
|
2019
2044
|
},
|
|
2020
2045
|
extname: function e(t) {
|
|
2021
|
-
var r, s, n,
|
|
2022
|
-
for (assertPath(t), r = -1, s = 0, n = -1,
|
|
2023
|
-
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !==
|
|
2046
|
+
var r, s, n, o, i, a, l;
|
|
2047
|
+
for (assertPath(t), r = -1, s = 0, n = -1, o = !0, i = 0, a = t.length - 1; a >= 0; --a) if (47 !== (l = t.charCodeAt(a))) -1 === n && (o = !1,
|
|
2048
|
+
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !== i && (i = 1) : -1 !== r && (i = -1); else if (!o) {
|
|
2024
2049
|
s = a + 1;
|
|
2025
2050
|
break;
|
|
2026
2051
|
}
|
|
2027
|
-
return -1 === r || -1 === n || 0 ===
|
|
2052
|
+
return -1 === r || -1 === n || 0 === i || 1 === i && r === n - 1 && r === s + 1 ? "" : t.slice(r, n);
|
|
2028
2053
|
},
|
|
2029
2054
|
format: function e(t) {
|
|
2030
2055
|
if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
|
|
@@ -2034,7 +2059,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2034
2059
|
}("/", t);
|
|
2035
2060
|
},
|
|
2036
2061
|
parse: function e(t) {
|
|
2037
|
-
var r, s, n,
|
|
2062
|
+
var r, s, n, o, i, a, l, c, u, d;
|
|
2038
2063
|
if (assertPath(t), r = {
|
|
2039
2064
|
root: "",
|
|
2040
2065
|
dir: "",
|
|
@@ -2042,14 +2067,14 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2042
2067
|
ext: "",
|
|
2043
2068
|
name: ""
|
|
2044
2069
|
}, 0 === t.length) return r;
|
|
2045
|
-
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/",
|
|
2046
|
-
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >=
|
|
2047
|
-
l = u + 1), 46 === s ? -1 ===
|
|
2070
|
+
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/", o = 1) : o = 0, i = -1,
|
|
2071
|
+
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= o; --u) if (47 !== (s = t.charCodeAt(u))) -1 === l && (c = !1,
|
|
2072
|
+
l = u + 1), 46 === s ? -1 === i ? i = u : 1 !== d && (d = 1) : -1 !== i && (d = -1); else if (!c) {
|
|
2048
2073
|
a = u + 1;
|
|
2049
2074
|
break;
|
|
2050
2075
|
}
|
|
2051
|
-
return -1 ===
|
|
2052
|
-
r.base = t.slice(1, l)) : (r.name = t.slice(a,
|
|
2076
|
+
return -1 === i || -1 === l || 0 === d || 1 === d && i === l - 1 && i === a + 1 ? -1 !== l && (r.base = r.name = 0 === a && n ? t.slice(1, l) : t.slice(a, l)) : (0 === a && n ? (r.name = t.slice(1, i),
|
|
2077
|
+
r.base = t.slice(1, l)) : (r.name = t.slice(a, i), r.base = t.slice(a, l)), r.ext = t.slice(i, l)),
|
|
2053
2078
|
a > 0 ? r.dir = t.slice(0, a - 1) : n && (r.dir = "/"), r;
|
|
2054
2079
|
},
|
|
2055
2080
|
sep: "/",
|
|
@@ -2087,21 +2112,21 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2087
2112
|
let s = (r = normalizePath(r)).split("/").filter((e => e.length));
|
|
2088
2113
|
const n = s.lastIndexOf("node_modules");
|
|
2089
2114
|
n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
|
|
2090
|
-
let
|
|
2091
|
-
|
|
2092
|
-
const
|
|
2093
|
-
if ("@stencil/core" ===
|
|
2115
|
+
let o = s.shift();
|
|
2116
|
+
o.startsWith("@") && (o += "/" + s.shift());
|
|
2117
|
+
const i = s.join("/");
|
|
2118
|
+
if ("@stencil/core" === o) {
|
|
2094
2119
|
return ((e, t) => {
|
|
2095
2120
|
let r = (t = normalizePath(t)).split("/");
|
|
2096
2121
|
const s = r.lastIndexOf("node_modules");
|
|
2097
2122
|
return s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
|
|
2098
2123
|
t = r.join("/")), new URL("./" + t, (e => new URL("../", e).href)(e)).href;
|
|
2099
|
-
})(e.getCompilerExecutingPath(),
|
|
2124
|
+
})(e.getCompilerExecutingPath(), i);
|
|
2100
2125
|
}
|
|
2101
2126
|
return e.getRemoteModuleUrl({
|
|
2102
|
-
moduleId:
|
|
2103
|
-
version: t.get(
|
|
2104
|
-
path:
|
|
2127
|
+
moduleId: o,
|
|
2128
|
+
version: t.get(o),
|
|
2129
|
+
path: i
|
|
2105
2130
|
});
|
|
2106
2131
|
}, knownUrlSkips = [ "/@stencil/core/internal.js", "/@stencil/core/internal.json", "/@stencil/core/internal.mjs", "/@stencil/core/internal/stencil-core.js/index.json", "/@stencil/core/internal/stencil-core.js.json", "/@stencil/core/internal/stencil-core.js/package.json", "/@stencil/core.js", "/@stencil/core.json", "/@stencil/core.mjs", "/@stencil/core.css", "/@stencil/core/index.js", "/@stencil/core/index.json", "/@stencil/core/index.mjs", "/@stencil/core/index.css", "/@stencil/package.json" ], fetchModuleAsync = async (e, t, r, s, n) => {
|
|
2107
2132
|
if (!((e => {
|
|
@@ -2110,11 +2135,11 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2110
2135
|
const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
|
|
2111
2136
|
return !("node_modules" !== s || !isCommonDirModuleFile(n));
|
|
2112
2137
|
})(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
|
|
2113
|
-
const
|
|
2114
|
-
if (
|
|
2115
|
-
if (
|
|
2116
|
-
const
|
|
2117
|
-
return await (async (e, t, r, s, n,
|
|
2138
|
+
const o = await ((e, t, r) => (console.trace(t), e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r)))(e, s);
|
|
2139
|
+
if (o) {
|
|
2140
|
+
if (o.ok) {
|
|
2141
|
+
const i = await o.clone().text();
|
|
2142
|
+
return await (async (e, t, r, s, n, o) => {
|
|
2118
2143
|
r.endsWith("package.json") && ((e, t) => {
|
|
2119
2144
|
try {
|
|
2120
2145
|
const r = JSON.parse(t);
|
|
@@ -2122,14 +2147,14 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2122
2147
|
e.set(t, r);
|
|
2123
2148
|
})(e, r.name, r.version);
|
|
2124
2149
|
} catch (e) {}
|
|
2125
|
-
})(
|
|
2126
|
-
let
|
|
2127
|
-
for (;"/" !==
|
|
2128
|
-
|
|
2150
|
+
})(o, n);
|
|
2151
|
+
let i = path$2.dirname(s);
|
|
2152
|
+
for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
|
|
2153
|
+
i = path$2.dirname(i);
|
|
2129
2154
|
t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
|
|
2130
|
-
})(e, t, s, n,
|
|
2155
|
+
})(e, t, s, n, i, r), i;
|
|
2131
2156
|
}
|
|
2132
|
-
404 ===
|
|
2157
|
+
404 === o.status && known404Urls.add(s);
|
|
2133
2158
|
}
|
|
2134
2159
|
} catch (e) {
|
|
2135
2160
|
console.error(e);
|
|
@@ -2152,56 +2177,55 @@ caller = function() {
|
|
|
2152
2177
|
}
|
|
2153
2178
|
}, r.exports), r.exports;
|
|
2154
2179
|
}((function(e) {
|
|
2155
|
-
var t, r, s = "win32" === process.platform, n = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?
|
|
2180
|
+
var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, o = {
|
|
2156
2181
|
parse: function(e) {
|
|
2157
2182
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2158
2183
|
var t = function r(e) {
|
|
2159
|
-
|
|
2160
|
-
return [ r, o[1], o[2], o[3] ];
|
|
2184
|
+
return n.exec(e).slice(1);
|
|
2161
2185
|
}(e);
|
|
2162
|
-
if (!t ||
|
|
2186
|
+
if (!t || 5 !== t.length) throw new TypeError("Invalid path '" + e + "'");
|
|
2163
2187
|
return {
|
|
2164
|
-
root: t[
|
|
2165
|
-
dir: t[0]
|
|
2188
|
+
root: t[1],
|
|
2189
|
+
dir: t[0] === t[1] ? t[0] : t[0].slice(0, -1),
|
|
2166
2190
|
base: t[2],
|
|
2167
|
-
ext: t[
|
|
2168
|
-
name: t[
|
|
2191
|
+
ext: t[4],
|
|
2192
|
+
name: t[3]
|
|
2169
2193
|
};
|
|
2170
2194
|
}
|
|
2171
2195
|
};
|
|
2172
|
-
t = /^(
|
|
2196
|
+
t = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/, (r = {}).parse = function(e) {
|
|
2173
2197
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2174
2198
|
var r = function s(e) {
|
|
2175
2199
|
return t.exec(e).slice(1);
|
|
2176
2200
|
}(e);
|
|
2177
|
-
if (!r ||
|
|
2178
|
-
return
|
|
2179
|
-
root: r[
|
|
2180
|
-
dir: r[0]
|
|
2201
|
+
if (!r || 5 !== r.length) throw new TypeError("Invalid path '" + e + "'");
|
|
2202
|
+
return {
|
|
2203
|
+
root: r[1],
|
|
2204
|
+
dir: r[0].slice(0, -1),
|
|
2181
2205
|
base: r[2],
|
|
2182
|
-
ext: r[
|
|
2183
|
-
name: r[
|
|
2206
|
+
ext: r[4],
|
|
2207
|
+
name: r[3]
|
|
2184
2208
|
};
|
|
2185
2209
|
}, e.exports = s ? o.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = o.parse;
|
|
2186
2210
|
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2187
|
-
var s, n,
|
|
2188
|
-
for (/^([A-Za-z]:)/.test(t) ?
|
|
2211
|
+
var s, n, o = "/";
|
|
2212
|
+
for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"), s = [ t ],
|
|
2189
2213
|
n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
|
|
2190
2214
|
return s.reduce((function(e, t) {
|
|
2191
2215
|
return e.concat(r.map((function(e) {
|
|
2192
|
-
return path__default.default.resolve(
|
|
2216
|
+
return path__default.default.resolve(o, t, e);
|
|
2193
2217
|
})));
|
|
2194
2218
|
}), []);
|
|
2195
2219
|
}, nodeModulesPaths = function e(t, r, s) {
|
|
2196
|
-
var n,
|
|
2220
|
+
var n, o = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
|
|
2197
2221
|
return r && "function" == typeof r.paths ? r.paths(s, t, (function() {
|
|
2198
|
-
return getNodeModulesDirs(t,
|
|
2199
|
-
}), r) : (n = getNodeModulesDirs(t,
|
|
2222
|
+
return getNodeModulesDirs(t, o);
|
|
2223
|
+
}), r) : (n = getNodeModulesDirs(t, o), r && r.paths ? n.concat(r.paths) : n);
|
|
2200
2224
|
}, normalizeOptions = function(e, t) {
|
|
2201
2225
|
return t || {};
|
|
2202
2226
|
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2203
2227
|
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2204
|
-
var r, s, n,
|
|
2228
|
+
var r, s, n, o, i, a, l, c = this;
|
|
2205
2229
|
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2206
2230
|
for (r = slice.call(arguments, 1), n = function() {
|
|
2207
2231
|
if (this instanceof s) {
|
|
@@ -2209,8 +2233,8 @@ toStr = Object.prototype.toString, implementation = function e(t) {
|
|
|
2209
2233
|
return Object(e) === e ? e : this;
|
|
2210
2234
|
}
|
|
2211
2235
|
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2212
|
-
},
|
|
2213
|
-
return s = Function("binder", "return function (" +
|
|
2236
|
+
}, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
|
|
2237
|
+
return s = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this,arguments); }")(n),
|
|
2214
2238
|
c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
|
|
2215
2239
|
l.prototype = null), s;
|
|
2216
2240
|
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
@@ -2335,13 +2359,13 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2335
2359
|
}
|
|
2336
2360
|
}));
|
|
2337
2361
|
}, getPackageCandidates$1 = function e(t, r, s) {
|
|
2338
|
-
var n,
|
|
2339
|
-
for (n = 0; n <
|
|
2340
|
-
return
|
|
2362
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2363
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2364
|
+
return o;
|
|
2341
2365
|
}, async = function e(t, r, s) {
|
|
2342
2366
|
function n(e) {
|
|
2343
2367
|
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) T = path__default.default.resolve(e, t),
|
|
2344
|
-
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package,
|
|
2368
|
+
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package, o) : i(T, C.package, o); else {
|
|
2345
2369
|
if (_ && isCoreModule(t)) return S(null, t);
|
|
2346
2370
|
!function r(e, t, s) {
|
|
2347
2371
|
var n = function() {
|
|
@@ -2359,7 +2383,7 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2359
2383
|
}));
|
|
2360
2384
|
}
|
|
2361
2385
|
}
|
|
2362
|
-
function
|
|
2386
|
+
function o(e, r, s) {
|
|
2363
2387
|
e ? S(e) : r ? S(null, r, s) : l(T, (function(e, r, s) {
|
|
2364
2388
|
if (e) S(e); else if (r) maybeRealpath(f, r, C, (function(e, t) {
|
|
2365
2389
|
e ? S(e) : S(null, t, s);
|
|
@@ -2369,20 +2393,20 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2369
2393
|
}
|
|
2370
2394
|
}));
|
|
2371
2395
|
}
|
|
2372
|
-
function
|
|
2396
|
+
function i(e, t, r) {
|
|
2373
2397
|
var s = t, n = r;
|
|
2374
2398
|
"function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
|
|
2375
|
-
function
|
|
2399
|
+
function o(s, o, a) {
|
|
2376
2400
|
var u, h, p;
|
|
2377
|
-
return c =
|
|
2378
|
-
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l,
|
|
2401
|
+
return c = o, s ? n(s) : a && c && C.pathFilter && (h = (u = path__default.default.relative(a, l)).slice(0, u.length - t[0].length),
|
|
2402
|
+
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
|
|
2379
2403
|
}
|
|
2380
|
-
function
|
|
2381
|
-
return s ? n(s) :
|
|
2404
|
+
function i(s, o) {
|
|
2405
|
+
return s ? n(s) : o ? n(null, l, c) : void e(t.slice(1), r, c);
|
|
2382
2406
|
}
|
|
2383
2407
|
var l, c;
|
|
2384
2408
|
if (0 === t.length) return n(null, void 0, s);
|
|
2385
|
-
l = r + t[0], (c = s) ?
|
|
2409
|
+
l = r + t[0], (c = s) ? o(null, c) : a(path__default.default.dirname(l), o);
|
|
2386
2410
|
}([ "" ].concat(w), e, s);
|
|
2387
2411
|
}
|
|
2388
2412
|
function a(e, t) {
|
|
@@ -2393,8 +2417,8 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2393
2417
|
if (!s) return a(path__default.default.dirname(e), t);
|
|
2394
2418
|
m(p, n, (function(r, s) {
|
|
2395
2419
|
r && t(r);
|
|
2396
|
-
var
|
|
2397
|
-
|
|
2420
|
+
var o = s;
|
|
2421
|
+
o && C.packageFilter && (o = C.packageFilter(o, n)), t(null, o, e);
|
|
2398
2422
|
}));
|
|
2399
2423
|
}));
|
|
2400
2424
|
}));
|
|
@@ -2403,31 +2427,31 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2403
2427
|
var s = r, n = t;
|
|
2404
2428
|
"function" == typeof n && (s = n, n = C.package), maybeRealpath(f, e, C, (function(t, r) {
|
|
2405
2429
|
if (t) return s(t);
|
|
2406
|
-
var
|
|
2407
|
-
d(
|
|
2408
|
-
return t ? s(t) : r ? void m(p,
|
|
2430
|
+
var o = path__default.default.join(r, "package.json");
|
|
2431
|
+
d(o, (function(t, r) {
|
|
2432
|
+
return t ? s(t) : r ? void m(p, o, (function(t, r) {
|
|
2409
2433
|
var n, a;
|
|
2410
|
-
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n,
|
|
2411
|
-
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void
|
|
2434
|
+
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n, o)), n && n.main ? "string" != typeof n.main ? ((a = new TypeError("package “" + n.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2435
|
+
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void i(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2412
2436
|
return t ? s(t) : r ? s(null, r, n) : n ? void l(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2413
|
-
return t ? s(t) : r ? s(null, r, n) : void
|
|
2414
|
-
})) :
|
|
2415
|
-
}))) : void
|
|
2416
|
-
})) :
|
|
2437
|
+
return t ? s(t) : r ? s(null, r, n) : void i(path__default.default.join(e, "index"), n, s);
|
|
2438
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2439
|
+
}))) : void i(path__default.default.join(e, "/index"), n, s));
|
|
2440
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2417
2441
|
}));
|
|
2418
2442
|
}));
|
|
2419
2443
|
}
|
|
2420
2444
|
function c(e, t) {
|
|
2421
|
-
function r(t, r,
|
|
2422
|
-
return t ? e(t) : r ? e(null, r,
|
|
2445
|
+
function r(t, r, o) {
|
|
2446
|
+
return t ? e(t) : r ? e(null, r, o) : void l(n, C.package, s);
|
|
2423
2447
|
}
|
|
2424
2448
|
function s(r, s, n) {
|
|
2425
2449
|
return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
|
|
2426
2450
|
}
|
|
2427
2451
|
if (0 === t.length) return e(null, void 0);
|
|
2428
2452
|
var n = t[0];
|
|
2429
|
-
h(path__default.default.dirname(n), (function
|
|
2430
|
-
return s ? e(s) : a ? void
|
|
2453
|
+
h(path__default.default.dirname(n), (function o(s, a) {
|
|
2454
|
+
return s ? e(s) : a ? void i(n, C.package, r) : c(e, t.slice(1));
|
|
2431
2455
|
}));
|
|
2432
2456
|
}
|
|
2433
2457
|
var u, d, h, p, f, m, g, y, w, _, v, b, E, T, S = s, C = r;
|
|
@@ -2567,64 +2591,64 @@ defaultIsFile = function e(t) {
|
|
|
2567
2591
|
return JSON.parse(s);
|
|
2568
2592
|
} catch (e) {}
|
|
2569
2593
|
}, getPackageCandidates = function e(t, r, s) {
|
|
2570
|
-
var n,
|
|
2571
|
-
for (n = 0; n <
|
|
2572
|
-
return
|
|
2594
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2595
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2596
|
+
return o;
|
|
2573
2597
|
}, sync = function e(t, r) {
|
|
2574
2598
|
function s(e) {
|
|
2575
|
-
var t, r, s,
|
|
2576
|
-
if (l && l.dir && l.pkg &&
|
|
2577
|
-
(r =
|
|
2599
|
+
var t, r, s, o, l = n(path__default.default.dirname(e));
|
|
2600
|
+
if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2601
|
+
(r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2578
2602
|
a(e)) return e;
|
|
2579
|
-
for (s = 0; s < p.length; s++) if (
|
|
2603
|
+
for (s = 0; s < p.length; s++) if (o = e + p[s], a(o)) return o;
|
|
2580
2604
|
}
|
|
2581
2605
|
function n(e) {
|
|
2582
2606
|
var t, r;
|
|
2583
|
-
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e,
|
|
2584
|
-
a(t) ? ((r = d(l, t)) &&
|
|
2607
|
+
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e, i), "package.json"),
|
|
2608
|
+
a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
|
|
2585
2609
|
pkg: r,
|
|
2586
2610
|
dir: e
|
|
2587
2611
|
}) : n(path__default.default.dirname(e));
|
|
2588
2612
|
}
|
|
2589
|
-
function
|
|
2590
|
-
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e,
|
|
2613
|
+
function o(e) {
|
|
2614
|
+
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
|
|
2591
2615
|
if (a(h)) {
|
|
2592
2616
|
try {
|
|
2593
2617
|
t = d(l, h);
|
|
2594
2618
|
} catch (e) {}
|
|
2595
|
-
if (t &&
|
|
2619
|
+
if (t && i.packageFilter && (t = i.packageFilter(t, e)), t && t.main) {
|
|
2596
2620
|
if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2597
2621
|
r;
|
|
2598
2622
|
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2599
2623
|
try {
|
|
2600
2624
|
if (n = s(path__default.default.resolve(e, t.main))) return n;
|
|
2601
|
-
if (c =
|
|
2625
|
+
if (c = o(path__default.default.resolve(e, t.main))) return c;
|
|
2602
2626
|
} catch (e) {}
|
|
2603
2627
|
}
|
|
2604
2628
|
}
|
|
2605
2629
|
return s(path__default.default.join(e, "/index"));
|
|
2606
2630
|
}
|
|
2607
|
-
var
|
|
2631
|
+
var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
|
|
2608
2632
|
if ("string" != typeof t) throw new TypeError("Path must be a string.");
|
|
2609
|
-
if (
|
|
2610
|
-
c =
|
|
2611
|
-
|
|
2612
|
-
if (h =
|
|
2613
|
-
m =
|
|
2614
|
-
y = maybeRealpathSync(u, path__default.default.resolve(m),
|
|
2633
|
+
if (i = normalizeOptions(0, r), a = i.isFile || defaultIsFile, l = i.readFileSync || fs__default.default.readFileSync,
|
|
2634
|
+
c = i.isDirectory || defaultIsDir, u = i.realpathSync || defaultRealpathSync, d = i.readPackageSync || defaultReadPackageSync,
|
|
2635
|
+
i.readFileSync && i.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
2636
|
+
if (h = i.packageIterator, p = i.extensions || [ ".js" ], f = !1 !== i.includeCoreModules,
|
|
2637
|
+
m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || [],
|
|
2638
|
+
y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2615
2639
|
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2616
|
-
_ = s(w) ||
|
|
2640
|
+
_ = s(w) || o(w)) return maybeRealpathSync(u, _, i);
|
|
2617
2641
|
} else {
|
|
2618
2642
|
if (f && isCoreModule(t)) return t;
|
|
2619
2643
|
if (v = function E(e, t) {
|
|
2620
2644
|
var r, n, a, l, u = function() {
|
|
2621
|
-
return getPackageCandidates(e, t,
|
|
2622
|
-
}, d = h ? h(e, t, u,
|
|
2645
|
+
return getPackageCandidates(e, t, i);
|
|
2646
|
+
}, d = h ? h(e, t, u, i) : u();
|
|
2623
2647
|
for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
|
|
2624
2648
|
if (a = s(n)) return a;
|
|
2625
|
-
if (l =
|
|
2649
|
+
if (l = o(n)) return l;
|
|
2626
2650
|
}
|
|
2627
|
-
}(t, y)) return maybeRealpathSync(u, v,
|
|
2651
|
+
}(t, y)) return maybeRealpathSync(u, v, i);
|
|
2628
2652
|
}
|
|
2629
2653
|
throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
|
|
2630
2654
|
b;
|
|
@@ -2661,8 +2685,8 @@ const createSystem = e => {
|
|
|
2661
2685
|
let r = BLUE, s = "Build", n = "";
|
|
2662
2686
|
"error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
|
|
2663
2687
|
s = "Warning"), e.header && (s = e.header);
|
|
2664
|
-
const
|
|
2665
|
-
if (
|
|
2688
|
+
const o = e.relFilePath || e.absFilePath;
|
|
2689
|
+
if (o && (n += o, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
|
|
2666
2690
|
"number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
|
|
2667
2691
|
n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
|
|
2668
2692
|
n += "\n" + e.lineNumber + ": " + e.text;
|
|
@@ -2673,7 +2697,7 @@ const createSystem = e => {
|
|
|
2673
2697
|
})(t, e)));
|
|
2674
2698
|
}
|
|
2675
2699
|
};
|
|
2676
|
-
})(), r = new Map, s = new Set, n = e => s.add(e),
|
|
2700
|
+
})(), r = new Map, s = new Set, n = e => s.add(e), o = e => s.delete(e), i = (() => {
|
|
2677
2701
|
const e = [], t = t => {
|
|
2678
2702
|
const r = e.findIndex((e => e.callback === t));
|
|
2679
2703
|
return r > -1 && (e.splice(r, 1), !0);
|
|
@@ -2700,11 +2724,11 @@ const createSystem = e => {
|
|
|
2700
2724
|
}), () => t(n);
|
|
2701
2725
|
}
|
|
2702
2726
|
if ("string" == typeof r && "function" == typeof s) {
|
|
2703
|
-
const n = r.toLowerCase().trim(),
|
|
2727
|
+
const n = r.toLowerCase().trim(), o = s;
|
|
2704
2728
|
return e.push({
|
|
2705
2729
|
eventName: n,
|
|
2706
|
-
callback:
|
|
2707
|
-
}), () => t(
|
|
2730
|
+
callback: o
|
|
2731
|
+
}), () => t(o);
|
|
2708
2732
|
}
|
|
2709
2733
|
return () => !1;
|
|
2710
2734
|
},
|
|
@@ -2732,8 +2756,8 @@ const createSystem = e => {
|
|
|
2732
2756
|
}, d = (e, t, s) => {
|
|
2733
2757
|
const n = path$2.dirname(e);
|
|
2734
2758
|
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && d(n, t, s);
|
|
2735
|
-
const
|
|
2736
|
-
|
|
2759
|
+
const o = r.get(e);
|
|
2760
|
+
o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
|
|
2737
2761
|
basename: path$2.basename(e),
|
|
2738
2762
|
dirname: n,
|
|
2739
2763
|
isDirectory: !0,
|
|
@@ -2757,10 +2781,10 @@ const createSystem = e => {
|
|
|
2757
2781
|
}), m = (e, t, s) => {
|
|
2758
2782
|
const n = w(e);
|
|
2759
2783
|
if (!n.error && !s.error) if (n.isFile) {
|
|
2760
|
-
const n = path$2.dirname(t),
|
|
2784
|
+
const n = path$2.dirname(t), o = u(n, {
|
|
2761
2785
|
recursive: !0
|
|
2762
|
-
}),
|
|
2763
|
-
s.newDirs.push(...
|
|
2786
|
+
}), i = r.get(e).data, a = b(t, i);
|
|
2787
|
+
s.newDirs.push(...o.newDirs), s.renamed.push({
|
|
2764
2788
|
oldPath: e,
|
|
2765
2789
|
newPath: t,
|
|
2766
2790
|
isDirectory: !1,
|
|
@@ -2858,8 +2882,8 @@ const createSystem = e => {
|
|
|
2858
2882
|
u("/");
|
|
2859
2883
|
const S = {
|
|
2860
2884
|
name: "in-memory",
|
|
2861
|
-
version: "2.
|
|
2862
|
-
events:
|
|
2885
|
+
version: "2.14.0",
|
|
2886
|
+
events: i,
|
|
2863
2887
|
access: async e => c(e),
|
|
2864
2888
|
accessSync: c,
|
|
2865
2889
|
addDestory: n,
|
|
@@ -2906,7 +2930,7 @@ const createSystem = e => {
|
|
|
2906
2930
|
readFileSync: p,
|
|
2907
2931
|
realpath: async e => f(e),
|
|
2908
2932
|
realpathSync: f,
|
|
2909
|
-
removeDestory:
|
|
2933
|
+
removeDestory: o,
|
|
2910
2934
|
rename: async (e, t) => {
|
|
2911
2935
|
const r = {
|
|
2912
2936
|
oldPath: e = normalizePath(e),
|
|
@@ -2943,14 +2967,14 @@ const createSystem = e => {
|
|
|
2943
2967
|
removeFileSync: _,
|
|
2944
2968
|
watchDirectory: (e, t) => {
|
|
2945
2969
|
e = l(e);
|
|
2946
|
-
const s = r.get(e),
|
|
2970
|
+
const s = r.get(e), i = () => {
|
|
2947
2971
|
const s = r.get(e);
|
|
2948
2972
|
if (s && s.watcherCallbacks) {
|
|
2949
2973
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2950
2974
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2951
2975
|
}
|
|
2952
2976
|
};
|
|
2953
|
-
return n(
|
|
2977
|
+
return n(i), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2954
2978
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2955
2979
|
basename: path$2.basename(e),
|
|
2956
2980
|
dirname: path$2.dirname(e),
|
|
@@ -2960,20 +2984,20 @@ const createSystem = e => {
|
|
|
2960
2984
|
data: void 0
|
|
2961
2985
|
}), {
|
|
2962
2986
|
close() {
|
|
2963
|
-
i
|
|
2987
|
+
o(i), i();
|
|
2964
2988
|
}
|
|
2965
2989
|
};
|
|
2966
2990
|
},
|
|
2967
2991
|
watchFile: (e, t) => {
|
|
2968
2992
|
e = l(e);
|
|
2969
|
-
const s = r.get(e),
|
|
2993
|
+
const s = r.get(e), i = () => {
|
|
2970
2994
|
const s = r.get(e);
|
|
2971
2995
|
if (s && s.watcherCallbacks) {
|
|
2972
2996
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2973
2997
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2974
2998
|
}
|
|
2975
2999
|
};
|
|
2976
|
-
return n(
|
|
3000
|
+
return n(i), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2977
3001
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2978
3002
|
basename: path$2.basename(e),
|
|
2979
3003
|
dirname: path$2.dirname(e),
|
|
@@ -2983,7 +3007,7 @@ const createSystem = e => {
|
|
|
2983
3007
|
data: void 0
|
|
2984
3008
|
}), {
|
|
2985
3009
|
close() {
|
|
2986
|
-
i
|
|
3010
|
+
o(i), i();
|
|
2987
3011
|
}
|
|
2988
3012
|
};
|
|
2989
3013
|
},
|
|
@@ -2996,18 +3020,18 @@ const createSystem = e => {
|
|
|
2996
3020
|
return "number" == typeof t && (s = s.substr(0, t)), s;
|
|
2997
3021
|
},
|
|
2998
3022
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
2999
|
-
let r, s = 0, n = !1,
|
|
3023
|
+
let r, s = 0, n = !1, o = !1, i = 0;
|
|
3000
3024
|
const a = new Map, l = [], c = [], u = Math.max(Math.min(t, e.hardwareConcurrency), 2) - 1, d = Promise.resolve(), h = e => console.error(e), p = () => {
|
|
3001
3025
|
let t = null;
|
|
3002
|
-
const s = e.getCompilerExecutingPath(),
|
|
3003
|
-
name: "stencil.worker." +
|
|
3026
|
+
const s = e.getCompilerExecutingPath(), o = {
|
|
3027
|
+
name: "stencil.worker." + i++
|
|
3004
3028
|
};
|
|
3005
3029
|
try {
|
|
3006
|
-
t = new Worker(s,
|
|
3030
|
+
t = new Worker(s, o);
|
|
3007
3031
|
} catch (e) {
|
|
3008
3032
|
null == r && (r = new Blob([ `importScripts('${s}');` ], {
|
|
3009
3033
|
type: "application/javascript"
|
|
3010
|
-
})), t = new Worker(URL.createObjectURL(r),
|
|
3034
|
+
})), t = new Worker(URL.createObjectURL(r), o);
|
|
3011
3035
|
}
|
|
3012
3036
|
const l = {
|
|
3013
3037
|
worker: t,
|
|
@@ -3036,7 +3060,7 @@ const createSystem = e => {
|
|
|
3036
3060
|
} else t = p(), c.push(t);
|
|
3037
3061
|
t.activeTasks++, t.sendQueue.push(e);
|
|
3038
3062
|
}, g = () => {
|
|
3039
|
-
|
|
3063
|
+
o = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
3040
3064
|
}, y = (...e) => new Promise(((t, r) => {
|
|
3041
3065
|
if (n) r("task canceled"); else {
|
|
3042
3066
|
const n = {
|
|
@@ -3046,7 +3070,7 @@ const createSystem = e => {
|
|
|
3046
3070
|
l.push(n), a.set(n.stencilId, {
|
|
3047
3071
|
resolve: t,
|
|
3048
3072
|
reject: r
|
|
3049
|
-
}),
|
|
3073
|
+
}), o || (o = !0, d.then(g));
|
|
3050
3074
|
}
|
|
3051
3075
|
}));
|
|
3052
3076
|
return {
|
|
@@ -3077,11 +3101,11 @@ const createSystem = e => {
|
|
|
3077
3101
|
return S.resolveModuleId = e => ((e, t, r) => {
|
|
3078
3102
|
const s = ((e, t, r) => ({
|
|
3079
3103
|
async isFile(s, n) {
|
|
3080
|
-
const
|
|
3081
|
-
if ((await t.stat(
|
|
3082
|
-
if (shouldFetchModule(
|
|
3083
|
-
const r = getNodeModuleFetchUrl(e, packageVersions,
|
|
3084
|
-
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r,
|
|
3104
|
+
const o = normalizeFsPath(s);
|
|
3105
|
+
if ((await t.stat(o)).isFile) n(null, !0); else {
|
|
3106
|
+
if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
|
|
3107
|
+
const r = getNodeModuleFetchUrl(e, packageVersions, o);
|
|
3108
|
+
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
|
|
3085
3109
|
}
|
|
3086
3110
|
n(null, !1);
|
|
3087
3111
|
}
|
|
@@ -3094,7 +3118,7 @@ const createSystem = e => {
|
|
|
3094
3118
|
void s(null, !0);
|
|
3095
3119
|
if (isCommonDirModuleFile(n)) return void s(null, !1);
|
|
3096
3120
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
3097
|
-
const
|
|
3121
|
+
const o = getCommonDirUrl(e, packageVersions, n, r), i = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, o, i);
|
|
3098
3122
|
if (isString(a)) return void s(null, !0);
|
|
3099
3123
|
}
|
|
3100
3124
|
}
|
|
@@ -3113,13 +3137,13 @@ const createSystem = e => {
|
|
|
3113
3137
|
}))(e, null, r.exts);
|
|
3114
3138
|
return s.basedir = path$2.dirname(normalizeFsPath(r.containingFile)), r.packageFilter ? s.packageFilter = r.packageFilter : null !== r.packageFilter && (s.packageFilter = e => (isString(e.main) && "" !== e.main || (e.main = "package.json"),
|
|
3115
3139
|
e)), new Promise(((e, t) => {
|
|
3116
|
-
resolve(r.moduleId, s, ((s, n,
|
|
3140
|
+
resolve(r.moduleId, s, ((s, n, o) => {
|
|
3117
3141
|
if (s) t(s); else {
|
|
3118
3142
|
n = normalizePath(n);
|
|
3119
3143
|
const t = {
|
|
3120
3144
|
moduleId: r.moduleId,
|
|
3121
3145
|
resolveId: n,
|
|
3122
|
-
pkgData:
|
|
3146
|
+
pkgData: o,
|
|
3123
3147
|
pkgDirPath: getPackageDirPath(n, r.moduleId)
|
|
3124
3148
|
};
|
|
3125
3149
|
e(t);
|
|
@@ -3159,7 +3183,7 @@ const createSystem = e => {
|
|
|
3159
3183
|
t = e;
|
|
3160
3184
|
}
|
|
3161
3185
|
}
|
|
3162
|
-
}), !function
|
|
3186
|
+
}), !function o(e) {
|
|
3163
3187
|
return "diskReads" in e && "diskWrites" in e;
|
|
3164
3188
|
}(r)) throw new Error("could not generate TestingSystem");
|
|
3165
3189
|
return r;
|
|
@@ -3331,8 +3355,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3331
3355
|
waitForVisible() {
|
|
3332
3356
|
return new Promise(((e, t) => {
|
|
3333
3357
|
const r = setInterval((async () => {
|
|
3334
|
-
await this.isVisible() && (clearInterval(r), clearTimeout(
|
|
3335
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`),
|
|
3358
|
+
await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
|
|
3359
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3336
3360
|
clearTimeout(r), t(n);
|
|
3337
3361
|
}), s);
|
|
3338
3362
|
}));
|
|
@@ -3340,8 +3364,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3340
3364
|
waitForNotVisible() {
|
|
3341
3365
|
return new Promise(((e, t) => {
|
|
3342
3366
|
const r = setInterval((async () => {
|
|
3343
|
-
await this.isVisible() || (clearInterval(r), clearTimeout(
|
|
3344
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`),
|
|
3367
|
+
await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
|
|
3368
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3345
3369
|
clearTimeout(r), t(n);
|
|
3346
3370
|
}), s);
|
|
3347
3371
|
}));
|
|
@@ -3592,19 +3616,23 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3592
3616
|
} catch (e) {}
|
|
3593
3617
|
}(this.browser), this.browser = null;
|
|
3594
3618
|
}
|
|
3619
|
+
getVmContext() {
|
|
3620
|
+
return super.getVmContext();
|
|
3621
|
+
}
|
|
3595
3622
|
};
|
|
3596
3623
|
}, exports.createTestRunner = function createTestRunner() {
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3624
|
+
var e;
|
|
3625
|
+
const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
|
|
3626
|
+
return class r extends t {
|
|
3627
|
+
async runTests(e, t, r, s, n, o) {
|
|
3628
|
+
const i = process.env;
|
|
3601
3629
|
if (e = e.filter((e => function t(e, r) {
|
|
3602
3630
|
const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
|
|
3603
3631
|
return !("true" !== r.__STENCIL_E2E_TESTS__ || !s) || "true" === r.__STENCIL_SPEC_TESTS__ && !s;
|
|
3604
|
-
}(e.path,
|
|
3605
|
-
const a = JSON.parse(
|
|
3606
|
-
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l],
|
|
3607
|
-
} else await super.runTests(e, t, r, s, n,
|
|
3632
|
+
}(e.path, i))), "true" === i.__STENCIL_SCREENSHOT__) {
|
|
3633
|
+
const a = JSON.parse(i.__STENCIL_EMULATE_CONFIGS__);
|
|
3634
|
+
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r, s, n, o);
|
|
3635
|
+
} else await super.runTests(e, t, r, s, n, o);
|
|
3608
3636
|
}
|
|
3609
3637
|
};
|
|
3610
3638
|
}, exports.createTesting = async e => {
|
|
@@ -3616,14 +3644,14 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3616
3644
|
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3617
3645
|
}(e);
|
|
3618
3646
|
const {createCompiler: r} = require("../compiler/stencil.js"), s = await r(e);
|
|
3619
|
-
let n,
|
|
3620
|
-
const
|
|
3647
|
+
let n, o;
|
|
3648
|
+
const i = async () => {
|
|
3621
3649
|
const t = [];
|
|
3622
3650
|
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), n && (n.close && t.push(n.close()),
|
|
3623
|
-
n = null),
|
|
3651
|
+
n = null), o && (o.close && t.push(o.close()), o = null), await Promise.all(t);
|
|
3624
3652
|
};
|
|
3625
3653
|
return {
|
|
3626
|
-
destroy:
|
|
3654
|
+
destroy: i,
|
|
3627
3655
|
run: async (t = {}) => {
|
|
3628
3656
|
let r, a = !1, l = !1, c = null;
|
|
3629
3657
|
const u = [];
|
|
@@ -3646,9 +3674,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3646
3674
|
})), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3647
3675
|
e.devServer.reloadStrategy = null;
|
|
3648
3676
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3649
|
-
if (n = l[0],
|
|
3677
|
+
if (n = l[0], o = l[1], t) {
|
|
3650
3678
|
const r = await t;
|
|
3651
|
-
if (!r || !e.watch && hasError(r && r.diagnostics)) return await
|
|
3679
|
+
if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
|
|
3652
3680
|
}
|
|
3653
3681
|
n && (r.__STENCIL_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__STENCIL_BROWSER_URL__}`),
|
|
3654
3682
|
r.__STENCIL_APP_SCRIPT_URL__ = function d(e, t) {
|
|
@@ -3682,13 +3710,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3682
3710
|
waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
|
|
3683
3711
|
pixelmatchModulePath: s
|
|
3684
3712
|
}), e.flags.updateScreenshot || await r.pullMasterBuild(), n.finish("screenshot, initBuild finished");
|
|
3685
|
-
const
|
|
3686
|
-
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(
|
|
3713
|
+
const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
|
|
3714
|
+
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(i, a);
|
|
3687
3715
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3688
3716
|
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3689
3717
|
try {
|
|
3690
3718
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3691
|
-
let s = await r.completeBuild(
|
|
3719
|
+
let s = await r.completeBuild(i);
|
|
3692
3720
|
if (t.finish("screenshot, completeTimespan finished"), s) {
|
|
3693
3721
|
const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
|
|
3694
3722
|
if (s = await r.publishBuild(s), t.finish("screenshot, publishBuild finished"),
|
|
@@ -3702,7 +3730,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3702
3730
|
}
|
|
3703
3731
|
}
|
|
3704
3732
|
} catch (t) {
|
|
3705
|
-
e.logger.error(t, t.stack);
|
|
3733
|
+
t instanceof Error ? e.logger.error(t, t.stack) : e.logger.error(t);
|
|
3706
3734
|
}
|
|
3707
3735
|
return c;
|
|
3708
3736
|
}(e, r) : await runJest(e, r), e.logger.info(""), c && await c.close();
|
|
@@ -3770,19 +3798,19 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3770
3798
|
const t = process.env;
|
|
3771
3799
|
"true" === t.__STENCIL_SCREENSHOT__ ? e.compareScreenshot = (r, s) => {
|
|
3772
3800
|
const n = global;
|
|
3773
|
-
let
|
|
3774
|
-
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (
|
|
3775
|
-
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (
|
|
3776
|
-
"object" == typeof s && (
|
|
3777
|
-
|
|
3778
|
-
if (n.screenshotDescriptions.has(
|
|
3779
|
-
return n.screenshotDescriptions.add(
|
|
3801
|
+
let o, i = "", a = "";
|
|
3802
|
+
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (i = n.currentSpec.fullName),
|
|
3803
|
+
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (i.length > 0 ? i += ", " + r : i = r,
|
|
3804
|
+
"object" == typeof s && (o = s)) : "object" == typeof r && (o = r), i = i.trim(),
|
|
3805
|
+
o = o || {}, !i) throw new Error(`Invalid screenshot description in "${a}"`);
|
|
3806
|
+
if (n.screenshotDescriptions.has(i)) throw new Error(`Screenshot description "${i}" found in "${a}" cannot be used for multiple screenshots and must be unique. To make screenshot descriptions unique within the same test, use the first argument to "compareScreenshot", such as "compareScreenshot('more to the description')".`);
|
|
3807
|
+
return n.screenshotDescriptions.add(i), async function l(e, t, r, s, n) {
|
|
3780
3808
|
if ("string" != typeof t.__STENCIL_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
|
|
3781
3809
|
if ("string" != typeof t.__STENCIL_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
3782
|
-
const
|
|
3810
|
+
const o = JSON.parse(t.__STENCIL_EMULATE__), i = JSON.parse(t.__STENCIL_SCREENSHOT_BUILD__);
|
|
3783
3811
|
await function a(e) {
|
|
3784
3812
|
return new Promise((t => setTimeout(t, e)));
|
|
3785
|
-
}(
|
|
3813
|
+
}(i.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
|
|
3786
3814
|
window.requestAnimationFrame((() => {
|
|
3787
3815
|
e();
|
|
3788
3816
|
}));
|
|
@@ -3800,11 +3828,11 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3800
3828
|
width: e.clip.width,
|
|
3801
3829
|
height: e.clip.height
|
|
3802
3830
|
}), t;
|
|
3803
|
-
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold :
|
|
3804
|
-
let h =
|
|
3831
|
+
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : i.pixelmatchThreshold;
|
|
3832
|
+
let h = o.viewport.width, p = o.viewport.height;
|
|
3805
3833
|
return n && n.clip && ("number" == typeof n.clip.width && (h = n.clip.width), "number" == typeof n.clip.height && (p = n.clip.height)),
|
|
3806
|
-
await compareScreenshot(
|
|
3807
|
-
}(e, t,
|
|
3834
|
+
await compareScreenshot(o, i, u, r, h, p, s, d);
|
|
3835
|
+
}(e, t, i, a, o);
|
|
3808
3836
|
} : e.compareScreenshot = async () => ({
|
|
3809
3837
|
mismatchedPixels: 0,
|
|
3810
3838
|
allowableMismatchedPixels: 1,
|
|
@@ -3852,13 +3880,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3852
3880
|
e();
|
|
3853
3881
|
}))));
|
|
3854
3882
|
};
|
|
3855
|
-
const
|
|
3883
|
+
const o = !0 === e.failOnConsoleError, i = !0 === e.failOnNetworkError;
|
|
3856
3884
|
t.on("console", (e => {
|
|
3857
3885
|
"error" === e.type() && (r.push({
|
|
3858
3886
|
type: "error",
|
|
3859
3887
|
message: e.text(),
|
|
3860
3888
|
location: e.location().url
|
|
3861
|
-
}),
|
|
3889
|
+
}), o && fail(new Error(serializeConsoleMessage(e)))), function t(e) {
|
|
3862
3890
|
const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
|
|
3863
3891
|
"debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
|
|
3864
3892
|
}(e);
|
|
@@ -3873,7 +3901,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3873
3901
|
type: "requestfailed",
|
|
3874
3902
|
message: e.failure().errorText,
|
|
3875
3903
|
location: e.url()
|
|
3876
|
-
}),
|
|
3904
|
+
}), i ? fail(new Error(e.failure().errorText)) : console.error("requestfailed", e.url());
|
|
3877
3905
|
})), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
|
|
3878
3906
|
waitUntil: e.waitUntil
|
|
3879
3907
|
}) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
|
|
@@ -3939,7 +3967,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3939
3967
|
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
3940
3968
|
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
3941
3969
|
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
3942
|
-
})),
|
|
3970
|
+
})), o = (e => {
|
|
3943
3971
|
const t = e.some((e => e.htmlTagNames.includes("slot"))), r = e.some((e => "shadow" === e.encapsulation)), s = e.some((e => "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot"))), n = {
|
|
3944
3972
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
3945
3973
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
@@ -3999,8 +4027,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3999
4027
|
return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
|
|
4000
4028
|
n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
|
|
4001
4029
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4002
|
-
if (e.strictBuild ? Object.assign(appData.BUILD,
|
|
4003
|
-
!0 ===
|
|
4030
|
+
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
|
|
4031
|
+
!0 === o[e] && (appData.BUILD[e] = !0);
|
|
4004
4032
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4005
4033
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4006
4034
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
@@ -4030,10 +4058,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4030
4058
|
testing.renderVdom(t, e.template());
|
|
4031
4059
|
} else "string" == typeof e.html && (s.body.innerHTML = e.html);
|
|
4032
4060
|
!1 !== e.flushQueue && await s.waitForChanges();
|
|
4033
|
-
let
|
|
4061
|
+
let i = null;
|
|
4034
4062
|
return Object.defineProperty(s, "root", {
|
|
4035
4063
|
get() {
|
|
4036
|
-
if (null ==
|
|
4064
|
+
if (null == i && (i = findRootComponent(t, s.body)), null != i) return i;
|
|
4037
4065
|
const e = s.body.firstElementChild;
|
|
4038
4066
|
return null != e ? e : null;
|
|
4039
4067
|
}
|