@stencil/core 2.15.2 → 2.16.1
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 +34 -16
- package/cli/index.js +34 -16
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +641 -242
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +1 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/client/test/hmr-util.spec.d.ts +1 -0
- package/dev-server/client/test/status.spec.d.ts +1 -0
- 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 +5 -3
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +1 -1
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +11 -9
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +2 -3
- package/internal/hydrate/index.js +37 -32
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/shadow-css.js +9 -9
- package/internal/package.json +1 -1
- package/internal/stencil-public-compiler.d.ts +67 -2
- package/internal/stencil-public-docs.d.ts +3 -0
- package/internal/testing/index.js +35 -30
- package/internal/testing/package.json +1 -1
- package/internal/testing/shadow-css.js +9 -9
- package/mock-doc/index.cjs +8 -2
- package/mock-doc/index.d.ts +9 -2
- package/mock-doc/index.js +8 -2
- package/mock-doc/package.json +1 -1
- package/package.json +22 -14
- package/screenshot/index.js +2 -0
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +335 -331
- package/testing/jest/test/jest-config.spec.d.ts +1 -0
- package/testing/jest/test/jest-preprocessor.spec.d.ts +1 -0
- package/testing/jest/test/jest-runner.spec.d.ts +1 -0
- package/testing/jest/test/jest-serializer.spec.d.ts +1 -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.16.1 | 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 i = {
|
|
49
49
|
ignoreHTTPSErrors: !0,
|
|
50
50
|
slowMo: e.testing.browserSlowMo
|
|
51
51
|
};
|
|
52
|
-
let
|
|
53
|
-
if (e.testing.browserWSEndpoint)
|
|
52
|
+
let o;
|
|
53
|
+
if (e.testing.browserWSEndpoint) o = await n.connect({
|
|
54
54
|
browserWSEndpoint: e.testing.browserWSEndpoint,
|
|
55
|
-
...
|
|
55
|
+
...i
|
|
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
|
+
...i
|
|
62
62
|
};
|
|
63
63
|
e.testing.browserExecutablePath && (t.executablePath = e.testing.browserExecutablePath),
|
|
64
|
-
|
|
64
|
+
o = 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__ = o.wsEndpoint(), e.logger.debug(`puppeteer browser wsEndpoint: ${t.__STENCIL_BROWSER_WS_ENDPOINT__}`),
|
|
69
|
+
o;
|
|
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), i = path$2.relative(s.dir, n);
|
|
80
|
+
return new URL(i, 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, i = path$2.join(s, r), o = path$2.relative(e.rootDir, i);
|
|
85
|
+
return new URL(o, t).href;
|
|
86
86
|
}
|
|
87
87
|
return t;
|
|
88
88
|
}
|
|
@@ -170,11 +170,11 @@ async function runJest(e, t) {
|
|
|
170
170
|
s.maxWorkers = parseInt(s.maxWorkers, 10);
|
|
171
171
|
} catch (e) {}
|
|
172
172
|
return "string" == typeof s.ci && (s.ci = "true" === s.ci || "" === s.ci), s;
|
|
173
|
-
}(e),
|
|
173
|
+
}(e), i = function i(e, t) {
|
|
174
174
|
const r = t.projects ? t.projects : [];
|
|
175
175
|
return r.push(e.rootDir), r;
|
|
176
|
-
}(e, n), {runCLI:
|
|
177
|
-
r = !!(await
|
|
176
|
+
}(e, n), {runCLI: o} = require("@jest/core");
|
|
177
|
+
r = !!(await o(n, i)).results.success;
|
|
178
178
|
} catch (t) {
|
|
179
179
|
e.logger.error(`runJest: ${t}`);
|
|
180
180
|
}
|
|
@@ -246,30 +246,30 @@ function getCompilerOptions(e) {
|
|
|
246
246
|
};
|
|
247
247
|
if (1 === e.category && (t.level = "error"), e.file) {
|
|
248
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),
|
|
249
|
+
const s = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), n = e.file.getLineAndCharacterOfPosition(e.start), i = {
|
|
250
250
|
lineIndex: n.line,
|
|
251
251
|
lineNumber: n.line + 1,
|
|
252
252
|
text: s[n.line],
|
|
253
253
|
errorCharStart: n.character,
|
|
254
254
|
errorLength: Math.max(e.length, 1)
|
|
255
255
|
};
|
|
256
|
-
if (t.lineNumber =
|
|
257
|
-
0 ===
|
|
258
|
-
|
|
256
|
+
if (t.lineNumber = i.lineNumber, t.columnNumber = i.errorCharStart + 1, t.lines.push(i),
|
|
257
|
+
0 === i.errorLength && i.errorCharStart > 0 && (i.errorLength = 1, i.errorCharStart--),
|
|
258
|
+
i.lineIndex > 0) {
|
|
259
259
|
const e = {
|
|
260
|
-
lineIndex:
|
|
261
|
-
lineNumber:
|
|
262
|
-
text: s[
|
|
260
|
+
lineIndex: i.lineIndex - 1,
|
|
261
|
+
lineNumber: i.lineNumber - 1,
|
|
262
|
+
text: s[i.lineIndex - 1],
|
|
263
263
|
errorCharStart: -1,
|
|
264
264
|
errorLength: -1
|
|
265
265
|
};
|
|
266
266
|
t.lines.unshift(e);
|
|
267
267
|
}
|
|
268
|
-
if (
|
|
268
|
+
if (i.lineIndex + 1 < s.length) {
|
|
269
269
|
const e = {
|
|
270
|
-
lineIndex:
|
|
271
|
-
lineNumber:
|
|
272
|
-
text: s[
|
|
270
|
+
lineIndex: i.lineIndex + 1,
|
|
271
|
+
lineNumber: i.lineNumber + 1,
|
|
272
|
+
text: s[i.lineIndex + 1],
|
|
273
273
|
errorCharStart: -1,
|
|
274
274
|
errorLength: -1
|
|
275
275
|
};
|
|
@@ -313,11 +313,11 @@ function compareHtml(e, t, r) {
|
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
const
|
|
316
|
+
const i = index_cjs.parseHtmlToFragment(t), o = index_cjs.serializeNodeToHtml(i, {
|
|
317
317
|
prettyHtml: !0,
|
|
318
318
|
excludeTags: [ "body" ]
|
|
319
319
|
});
|
|
320
|
-
return s !==
|
|
320
|
+
return s !== o ? (expect(s).toBe(o), {
|
|
321
321
|
message: () => "HTML does not match",
|
|
322
322
|
pass: !1
|
|
323
323
|
}) : {
|
|
@@ -388,7 +388,7 @@ function assertPath(e) {
|
|
|
388
388
|
}
|
|
389
389
|
|
|
390
390
|
function normalizeStringPosix(e, t) {
|
|
391
|
-
var r, s, n,
|
|
391
|
+
var r, s, n, i = "", o = 0, a = -1, l = 0;
|
|
392
392
|
for (s = 0; s <= e.length; ++s) {
|
|
393
393
|
if (s < e.length) r = e.charCodeAt(s); else {
|
|
394
394
|
if (47 === r) break;
|
|
@@ -396,27 +396,27 @@ function normalizeStringPosix(e, t) {
|
|
|
396
396
|
}
|
|
397
397
|
if (47 === r) {
|
|
398
398
|
if (a === s - 1 || 1 === l) ; else if (a !== s - 1 && 2 === l) {
|
|
399
|
-
if (
|
|
400
|
-
if ((n =
|
|
401
|
-
-1 === n ? (
|
|
399
|
+
if (i.length < 2 || 2 !== o || 46 !== i.charCodeAt(i.length - 1) || 46 !== i.charCodeAt(i.length - 2)) if (i.length > 2) {
|
|
400
|
+
if ((n = i.lastIndexOf("/")) !== i.length - 1) {
|
|
401
|
+
-1 === n ? (i = "", o = 0) : o = (i = i.slice(0, n)).length - 1 - i.lastIndexOf("/"),
|
|
402
402
|
a = s, l = 0;
|
|
403
403
|
continue;
|
|
404
404
|
}
|
|
405
|
-
} else if (2 ===
|
|
406
|
-
|
|
405
|
+
} else if (2 === i.length || 1 === i.length) {
|
|
406
|
+
i = "", o = 0, a = s, l = 0;
|
|
407
407
|
continue;
|
|
408
408
|
}
|
|
409
|
-
t && (
|
|
410
|
-
} else
|
|
409
|
+
t && (i.length > 0 ? i += "/.." : i = "..", o = 2);
|
|
410
|
+
} else i.length > 0 ? i += "/" + e.slice(a + 1, s) : i = e.slice(a + 1, s), o = s - a - 1;
|
|
411
411
|
a = s, l = 0;
|
|
412
412
|
} else 46 === r && -1 !== l ? ++l : l = -1;
|
|
413
413
|
}
|
|
414
|
-
return
|
|
414
|
+
return i;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
function specifierIncluded$1(e, t) {
|
|
418
|
-
var r, s, n,
|
|
419
|
-
for (r = 0; r < 3; ++r) if ((s = parseInt(
|
|
418
|
+
var r, s, n, i = e.split("."), o = t.split(" "), a = o.length > 1 ? o[0] : "=", l = (o.length > 1 ? o[1] : o[0]).split(".");
|
|
419
|
+
for (r = 0; r < 3; ++r) if ((s = parseInt(i[r] || 0, 10)) !== (n = parseInt(l[r] || 0, 10))) return "<" === a ? s < n : ">=" === a && s >= n;
|
|
420
420
|
return ">=" === a;
|
|
421
421
|
}
|
|
422
422
|
|
|
@@ -428,9 +428,9 @@ function matchesRange$1(e, t) {
|
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
function specifierIncluded(e) {
|
|
431
|
-
var t, r, s, n = e.split(" "),
|
|
432
|
-
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(
|
|
433
|
-
return ">=" ===
|
|
431
|
+
var t, r, s, n = e.split(" "), i = n.length > 1 ? n[0] : "=", o = (n.length > 1 ? n[1] : n[0]).split(".");
|
|
432
|
+
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(o[t] || 0, 10))) return "<" === i ? r < s : ">=" === i && r >= s;
|
|
433
|
+
return ">=" === i;
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
function matchesRange(e) {
|
|
@@ -539,23 +539,23 @@ function mockCompilerCtx(e) {
|
|
|
539
539
|
if (!0 === r.inMemoryOnly) {
|
|
540
540
|
let n = e;
|
|
541
541
|
n.endsWith("/") || (n += "/");
|
|
542
|
-
const
|
|
542
|
+
const i = e.split("/");
|
|
543
543
|
t.forEach(((t, n) => {
|
|
544
544
|
if (!n.startsWith(e)) return;
|
|
545
545
|
const a = n.split("/");
|
|
546
|
-
if ((a.length ===
|
|
546
|
+
if ((a.length === i.length + 1 || r.recursive && a.length > i.length) && t.exists) {
|
|
547
547
|
const e = {
|
|
548
548
|
absPath: n,
|
|
549
|
-
relPath: a[
|
|
549
|
+
relPath: a[i.length],
|
|
550
550
|
isDirectory: t.isDirectory,
|
|
551
551
|
isFile: t.isFile
|
|
552
552
|
};
|
|
553
|
-
|
|
553
|
+
o(r, e) || s.push(e);
|
|
554
554
|
}
|
|
555
555
|
}));
|
|
556
|
-
} else await
|
|
556
|
+
} else await i(e, e, r, s);
|
|
557
557
|
return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
|
|
558
|
-
},
|
|
558
|
+
}, i = async (t, r, s, n) => {
|
|
559
559
|
const a = await e.readDir(r);
|
|
560
560
|
if (a.length > 0) {
|
|
561
561
|
const e = b(r);
|
|
@@ -566,10 +566,10 @@ function mockCompilerCtx(e) {
|
|
|
566
566
|
isDirectory: l.isDirectory,
|
|
567
567
|
isFile: l.isFile
|
|
568
568
|
};
|
|
569
|
-
|
|
569
|
+
o(s, u) || (n.push(u), !0 === s.recursive && !0 === l.isDirectory && await i(t, r, s, n));
|
|
570
570
|
})));
|
|
571
571
|
}
|
|
572
|
-
},
|
|
572
|
+
}, o = (e, t) => {
|
|
573
573
|
if (t.isDirectory) {
|
|
574
574
|
if (Array.isArray(e.excludeDirNames)) {
|
|
575
575
|
const r = path$2.basename(t.absPath);
|
|
@@ -622,26 +622,26 @@ function mockCompilerCtx(e) {
|
|
|
622
622
|
}, d = async (t, s, n) => {
|
|
623
623
|
if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
|
|
624
624
|
if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
|
|
625
|
-
const
|
|
625
|
+
const i = {
|
|
626
626
|
ignored: !1,
|
|
627
627
|
changedContent: !1,
|
|
628
628
|
queuedWrite: !1
|
|
629
629
|
};
|
|
630
|
-
if (!0 === shouldIgnore(t)) return
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
633
|
-
"string" == typeof
|
|
634
|
-
|
|
635
|
-
!1 === n.useCache && (
|
|
630
|
+
if (!0 === shouldIgnore(t)) return i.ignored = !0, i;
|
|
631
|
+
const o = b(t);
|
|
632
|
+
if (o.exists = !0, o.isFile = !0, o.isDirectory = !1, o.queueDeleteFromDisk = !1,
|
|
633
|
+
"string" == typeof o.fileText ? i.changedContent = o.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : i.changedContent = !0,
|
|
634
|
+
o.fileText = s, i.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
|
|
635
|
+
!1 === n.useCache && (o.useCache = !1)), null != n && !0 === n.inMemoryOnly) o.queueWriteToDisk ? i.queuedWrite = !0 : o.queueWriteToDisk = !1,
|
|
636
636
|
await h(t, !0); else if (null != n && !0 === n.immediateWrite) {
|
|
637
|
-
if (
|
|
637
|
+
if (i.changedContent || !0 !== n.useCache) {
|
|
638
638
|
const r = await e.readFile(t);
|
|
639
|
-
"string" == typeof r && (
|
|
640
|
-
|
|
639
|
+
"string" == typeof r && (i.changedContent = o.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
|
|
640
|
+
i.changedContent && (await h(t, !1), await e.writeFile(t, o.fileText));
|
|
641
641
|
}
|
|
642
|
-
} else
|
|
643
|
-
|
|
644
|
-
return
|
|
642
|
+
} else o.queueWriteToDisk || !0 !== i.changedContent || (o.queueWriteToDisk = !0,
|
|
643
|
+
i.queuedWrite = !0);
|
|
644
|
+
return i;
|
|
645
645
|
}, h = async (e, t) => {
|
|
646
646
|
const r = [];
|
|
647
647
|
for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
|
|
@@ -724,12 +724,12 @@ function mockCompilerCtx(e) {
|
|
|
724
724
|
clearDirCache: _,
|
|
725
725
|
clearFileCache: v,
|
|
726
726
|
commit: async () => {
|
|
727
|
-
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), i = await y(e.filesToDelete), o = await w(e.dirsToDelete);
|
|
728
728
|
return e.filesToDelete.forEach(v), e.dirsToDelete.forEach(_), {
|
|
729
729
|
filesCopied: n,
|
|
730
730
|
filesWritten: s,
|
|
731
|
-
filesDeleted:
|
|
732
|
-
dirsDeleted:
|
|
731
|
+
filesDeleted: i,
|
|
732
|
+
dirsDeleted: o,
|
|
733
733
|
dirsAdded: r
|
|
734
734
|
};
|
|
735
735
|
},
|
|
@@ -839,19 +839,19 @@ async function initPageEvents(e) {
|
|
|
839
839
|
}
|
|
840
840
|
|
|
841
841
|
async function pageSpyOnEvent(e, t, r) {
|
|
842
|
-
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document,
|
|
843
|
-
return await addE2EListener(e,
|
|
842
|
+
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, i = await e.evaluateHandle(n);
|
|
843
|
+
return await addE2EListener(e, i, t, (e => {
|
|
844
844
|
s.push(e);
|
|
845
845
|
})), s;
|
|
846
846
|
}
|
|
847
847
|
|
|
848
848
|
async function waitForEvent(e, t, r) {
|
|
849
849
|
const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate(((e, t, r) => new Promise(((s, n) => {
|
|
850
|
-
const
|
|
850
|
+
const i = setTimeout((() => {
|
|
851
851
|
n(new Error(`waitForEvent() timeout, eventName: ${t}`));
|
|
852
852
|
}), r);
|
|
853
853
|
e.addEventListener(t, (e => {
|
|
854
|
-
clearTimeout(
|
|
854
|
+
clearTimeout(i), s(window.stencilSerializeEvent(e));
|
|
855
855
|
}), {
|
|
856
856
|
once: !0
|
|
857
857
|
});
|
|
@@ -865,8 +865,8 @@ async function addE2EListener(e, t, r, s) {
|
|
|
865
865
|
eventName: r,
|
|
866
866
|
callback: s
|
|
867
867
|
});
|
|
868
|
-
const
|
|
869
|
-
await
|
|
868
|
+
const i = t.executionContext();
|
|
869
|
+
await i.evaluate(((e, t, r) => {
|
|
870
870
|
e.addEventListener(r, (e => {
|
|
871
871
|
window.stencilOnEvent(t, window.stencilSerializeEvent(e));
|
|
872
872
|
}));
|
|
@@ -922,7 +922,7 @@ function browserContextEvents() {
|
|
|
922
922
|
}
|
|
923
923
|
|
|
924
924
|
async function find(e, t, r) {
|
|
925
|
-
const {lightSelector: s, shadowSelector: n, text:
|
|
925
|
+
const {lightSelector: s, shadowSelector: n, text: i, contains: o} = getSelector(r);
|
|
926
926
|
let a;
|
|
927
927
|
if (a = "string" == typeof s ? await async function l(e, t, r, s) {
|
|
928
928
|
let n = await t.$(r);
|
|
@@ -950,20 +950,20 @@ async function find(e, t, r) {
|
|
|
950
950
|
}(e), s;
|
|
951
951
|
}), t, r, s);
|
|
952
952
|
return n ? n.asElement() : null;
|
|
953
|
-
}(e, t,
|
|
953
|
+
}(e, t, i, o), !a) return null;
|
|
954
954
|
const u = new E2EElement(e, a);
|
|
955
955
|
return await u.e2eSync(), u;
|
|
956
956
|
}
|
|
957
957
|
|
|
958
958
|
async function findAll(e, t, r) {
|
|
959
|
-
const s = [], {lightSelector: n, shadowSelector:
|
|
960
|
-
if (0 ===
|
|
961
|
-
if (
|
|
962
|
-
const r =
|
|
959
|
+
const s = [], {lightSelector: n, shadowSelector: i} = getSelector(r), o = await t.$$(n);
|
|
960
|
+
if (0 === o.length) return s;
|
|
961
|
+
if (i) for (let t = 0; t < o.length; t++) {
|
|
962
|
+
const r = o[t].executionContext(), n = await r.evaluateHandle(((e, t) => {
|
|
963
963
|
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
964
964
|
return e.shadowRoot.querySelectorAll(t);
|
|
965
|
-
}),
|
|
966
|
-
await
|
|
965
|
+
}), o[t], i);
|
|
966
|
+
await o[t].dispose();
|
|
967
967
|
const a = await n.getProperties();
|
|
968
968
|
await n.dispose();
|
|
969
969
|
for (const t of a.values()) {
|
|
@@ -973,8 +973,8 @@ async function findAll(e, t, r) {
|
|
|
973
973
|
await t.e2eSync(), s.push(t);
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
|
-
} else for (let t = 0; t <
|
|
977
|
-
const r = new E2EElement(e,
|
|
976
|
+
} else for (let t = 0; t < o.length; t++) {
|
|
977
|
+
const r = new E2EElement(e, o[t]);
|
|
978
978
|
await r.e2eSync(), s.push(r);
|
|
979
979
|
}
|
|
980
980
|
return s;
|
|
@@ -1013,7 +1013,7 @@ function writeFile(e, t) {
|
|
|
1013
1013
|
}));
|
|
1014
1014
|
}
|
|
1015
1015
|
|
|
1016
|
-
async function compareScreenshot(e, t, r, s, n,
|
|
1016
|
+
async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
1017
1017
|
const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
|
|
1018
1018
|
await async function u(e, t) {
|
|
1019
1019
|
await function r(e) {
|
|
@@ -1021,7 +1021,7 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
1021
1021
|
fs__default.default.access(e, (e => t(!e)));
|
|
1022
1022
|
}));
|
|
1023
1023
|
}(e) || await writeFile(e, t);
|
|
1024
|
-
}(c, r), r = null,
|
|
1024
|
+
}(c, r), r = null, o && (o = normalizePath(path$2.relative(t.rootDir, o)));
|
|
1025
1025
|
const d = function h(e, t) {
|
|
1026
1026
|
if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
|
|
1027
1027
|
const r = crypto$3.createHash("md5");
|
|
@@ -1034,9 +1034,9 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
1034
1034
|
device: e.device,
|
|
1035
1035
|
userAgent: e.userAgent,
|
|
1036
1036
|
desc: s,
|
|
1037
|
-
testPath:
|
|
1037
|
+
testPath: o,
|
|
1038
1038
|
width: n,
|
|
1039
|
-
height:
|
|
1039
|
+
height: i,
|
|
1040
1040
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1041
1041
|
hasTouch: e.viewport.hasTouch,
|
|
1042
1042
|
isLandscape: e.viewport.isLandscape,
|
|
@@ -1050,14 +1050,14 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
1050
1050
|
device: e.device,
|
|
1051
1051
|
userAgent: e.userAgent,
|
|
1052
1052
|
width: n,
|
|
1053
|
-
height:
|
|
1053
|
+
height: i,
|
|
1054
1054
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1055
1055
|
hasTouch: e.viewport.hasTouch,
|
|
1056
1056
|
isLandscape: e.viewport.isLandscape,
|
|
1057
1057
|
isMobile: e.viewport.isMobile,
|
|
1058
1058
|
allowableMismatchedPixels: t.allowableMismatchedPixels,
|
|
1059
1059
|
allowableMismatchedRatio: t.allowableMismatchedRatio,
|
|
1060
|
-
testPath:
|
|
1060
|
+
testPath: o
|
|
1061
1061
|
}
|
|
1062
1062
|
};
|
|
1063
1063
|
if (t.updateMaster) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
|
|
@@ -1079,7 +1079,7 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
1079
1079
|
};
|
|
1080
1080
|
p.diff.mismatchedPixels = await async function g(e, t) {
|
|
1081
1081
|
return new Promise(((r, s) => {
|
|
1082
|
-
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL,
|
|
1082
|
+
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, i = setTimeout((() => {
|
|
1083
1083
|
s(`getMismatchedPixels timeout: ${n}ms`);
|
|
1084
1084
|
}), n);
|
|
1085
1085
|
try {
|
|
@@ -1088,14 +1088,14 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
1088
1088
|
env: process.env,
|
|
1089
1089
|
cwd: process.cwd(),
|
|
1090
1090
|
stdio: [ "pipe", "pipe", "pipe", "ipc" ]
|
|
1091
|
-
},
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
})),
|
|
1095
|
-
clearTimeout(
|
|
1096
|
-
})),
|
|
1091
|
+
}, o = child_process$2.fork(e, [], n);
|
|
1092
|
+
o.on("message", (e => {
|
|
1093
|
+
o.kill(), clearTimeout(i), r(e);
|
|
1094
|
+
})), o.on("error", (e => {
|
|
1095
|
+
clearTimeout(i), s(e);
|
|
1096
|
+
})), o.send(t);
|
|
1097
1097
|
} catch (e) {
|
|
1098
|
-
clearTimeout(
|
|
1098
|
+
clearTimeout(i), s(`getMismatchedPixels error: ${e}`);
|
|
1099
1099
|
}
|
|
1100
1100
|
}));
|
|
1101
1101
|
}(t.pixelmatchModulePath, n);
|
|
@@ -1112,9 +1112,9 @@ async function e2eGoTo(e, t, r = {}) {
|
|
|
1112
1112
|
if ("string" != typeof s) throw new Error("invalid gotoTest() browser url");
|
|
1113
1113
|
const n = s + t.substring(1);
|
|
1114
1114
|
r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1115
|
-
const
|
|
1116
|
-
if (!
|
|
1117
|
-
return await waitForStencil(e, r),
|
|
1115
|
+
const i = await e._e2eGoto(n, r);
|
|
1116
|
+
if (!i.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${i.status()}`);
|
|
1117
|
+
return await waitForStencil(e, r), i;
|
|
1118
1118
|
}
|
|
1119
1119
|
|
|
1120
1120
|
async function e2eSetContent(e, t, r = {}) {
|
|
@@ -1123,18 +1123,18 @@ async function e2eSetContent(e, t, r = {}) {
|
|
|
1123
1123
|
const s = [], n = env.__STENCIL_APP_SCRIPT_URL__;
|
|
1124
1124
|
if ("string" != typeof n) throw new Error("invalid e2eSetContent() app script url");
|
|
1125
1125
|
s.push("<!doctype html>"), s.push("<html>"), s.push("<head>");
|
|
1126
|
-
const
|
|
1127
|
-
"string" == typeof
|
|
1126
|
+
const i = env.__STENCIL_APP_STYLE_URL__;
|
|
1127
|
+
"string" == typeof i && s.push(`<link rel="stylesheet" href="${i}">`), s.push(`<script type="module" src="${n}"><\/script>`),
|
|
1128
1128
|
s.push("</head>"), s.push("<body>"), s.push(t), s.push("</body>"), s.push("</html>");
|
|
1129
|
-
const
|
|
1129
|
+
const o = env.__STENCIL_BROWSER_URL__;
|
|
1130
1130
|
await e.setRequestInterception(!0), e.on("request", (e => {
|
|
1131
|
-
|
|
1131
|
+
o === e.url() ? e.respond({
|
|
1132
1132
|
status: 200,
|
|
1133
1133
|
contentType: "text/html",
|
|
1134
1134
|
body: s.join("\n")
|
|
1135
1135
|
}) : e.continue();
|
|
1136
1136
|
})), r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1137
|
-
const a = await e._e2eGoto(
|
|
1137
|
+
const a = await e._e2eGoto(o, r);
|
|
1138
1138
|
if (!a.ok()) throw new Error("Testing unable to load content");
|
|
1139
1139
|
return await waitForStencil(e, r), a;
|
|
1140
1140
|
}
|
|
@@ -1237,13 +1237,13 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1237
1237
|
return t;
|
|
1238
1238
|
}, trimFalsy = e => {
|
|
1239
1239
|
const t = e;
|
|
1240
|
-
for (
|
|
1240
|
+
for (let e = t.length - 1; e >= 0 && !t[e]; e--) t.pop();
|
|
1241
1241
|
return t;
|
|
1242
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 => {
|
|
1243
1243
|
if ("string" != typeof e) throw new Error("invalid path to normalize");
|
|
1244
1244
|
e = normalizeSlashes(e.trim());
|
|
1245
|
-
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1],
|
|
1246
|
-
return "" ===
|
|
1245
|
+
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], i = s + r.slice(1).join("/");
|
|
1246
|
+
return "" === i ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + i : i;
|
|
1247
1247
|
}, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
|
|
1248
1248
|
if (!Array.isArray(e) || 0 === e.length) return [];
|
|
1249
1249
|
const t = [ e[0] ];
|
|
@@ -1280,8 +1280,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1280
1280
|
if (-1 !== r) {
|
|
1281
1281
|
const t = r + "://".length, s = e.indexOf("/", t);
|
|
1282
1282
|
if (-1 !== s) {
|
|
1283
|
-
const n = e.slice(0, r),
|
|
1284
|
-
if ("file" === n && ("" ===
|
|
1283
|
+
const n = e.slice(0, r), i = e.slice(t, s);
|
|
1284
|
+
if ("file" === n && ("" === i || "localhost" === i) && isVolumeCharacter(e.charCodeAt(s + 1))) {
|
|
1285
1285
|
const t = getFileUrlVolumeSeparatorEnd(e, s + 2);
|
|
1286
1286
|
if (-1 !== t) {
|
|
1287
1287
|
if (47 === e.charCodeAt(t)) return ~(t + 1);
|
|
@@ -1334,12 +1334,12 @@ const jestPreprocessor = {
|
|
|
1334
1334
|
currentDirectory: s.rootDir
|
|
1335
1335
|
}, n = getCompilerOptions(s.rootDir);
|
|
1336
1336
|
n && (n.baseUrl && (r.baseUrl = n.baseUrl), n.paths && (r.paths = n.paths));
|
|
1337
|
-
const
|
|
1338
|
-
if (
|
|
1339
|
-
const e =
|
|
1337
|
+
const i = transpile(e, r), o = i.diagnostics.some((e => "error" === e.level));
|
|
1338
|
+
if (i.diagnostics && o) {
|
|
1339
|
+
const e = i.diagnostics.map(formatDiagnostic).join("\n\n");
|
|
1340
1340
|
throw new Error(e);
|
|
1341
1341
|
}
|
|
1342
|
-
return
|
|
1342
|
+
return i.code;
|
|
1343
1343
|
}
|
|
1344
1344
|
return e;
|
|
1345
1345
|
},
|
|
@@ -1351,22 +1351,26 @@ const jestPreprocessor = {
|
|
|
1351
1351
|
return [ process.version, _tsCompilerOptionsKey, e, t, r, !!s.instrument, 7 ].join(":");
|
|
1352
1352
|
}
|
|
1353
1353
|
}, deepEqual = function e(t, r) {
|
|
1354
|
-
var s, n, o, i, a, l, c, u, d, h;
|
|
1355
1354
|
if (t === r) return !0;
|
|
1356
1355
|
if (t && r && "object" == typeof t && "object" == typeof r) {
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1356
|
+
const s = Array.isArray(t), n = Array.isArray(r);
|
|
1357
|
+
let i, o, a;
|
|
1358
|
+
if (s && n) {
|
|
1359
|
+
if (o = t.length, o != r.length) return !1;
|
|
1360
|
+
for (i = o; 0 != i--; ) if (!e(t[i], r[i])) return !1;
|
|
1360
1361
|
return !0;
|
|
1361
1362
|
}
|
|
1362
1363
|
if (s != n) return !1;
|
|
1363
|
-
|
|
1364
|
+
const l = t instanceof Date, c = r instanceof Date;
|
|
1365
|
+
if (l != c) return !1;
|
|
1364
1366
|
if (l && c) return t.getTime() == r.getTime();
|
|
1365
|
-
|
|
1367
|
+
const u = t instanceof RegExp, d = r instanceof RegExp;
|
|
1368
|
+
if (u != d) return !1;
|
|
1366
1369
|
if (u && d) return t.toString() == r.toString();
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
for (
|
|
1370
|
+
const h = Object.keys(t);
|
|
1371
|
+
if (o = h.length, o !== Object.keys(r).length) return !1;
|
|
1372
|
+
for (i = o; 0 != i--; ) if (!Object.prototype.hasOwnProperty.call(r, h[i])) return !1;
|
|
1373
|
+
for (i = o; 0 != i--; ) if (a = h[i], !e(t[a], r[a])) return !1;
|
|
1370
1374
|
return !0;
|
|
1371
1375
|
}
|
|
1372
1376
|
return t != t && r != r;
|
|
@@ -1764,9 +1768,9 @@ class BuildContext {
|
|
|
1764
1768
|
}
|
|
1765
1769
|
return {
|
|
1766
1770
|
duration: () => r.duration(),
|
|
1767
|
-
finish: (e, s, n,
|
|
1771
|
+
finish: (e, s, n, i) => {
|
|
1768
1772
|
if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
|
|
1769
|
-
r.finish(e, s, n,
|
|
1773
|
+
r.finish(e, s, n, i), !t)) {
|
|
1770
1774
|
const e = {
|
|
1771
1775
|
buildId: this.buildId,
|
|
1772
1776
|
messages: this.buildMessages.slice(),
|
|
@@ -1882,12 +1886,12 @@ class Cache {
|
|
|
1882
1886
|
if (null != t) {
|
|
1883
1887
|
if (e - t < ONE_DAY) return;
|
|
1884
1888
|
const r = this.cacheFs.sys, s = await r.readDir(this.config.cacheDir), n = s.map((e => path$2.join(this.config.cacheDir, e)));
|
|
1885
|
-
let
|
|
1886
|
-
const
|
|
1889
|
+
let i = 0;
|
|
1890
|
+
const o = n.map((async t => {
|
|
1887
1891
|
const s = (await r.stat(t)).mtimeMs;
|
|
1888
|
-
e - s > ONE_WEEK && (await r.removeFile(t),
|
|
1892
|
+
e - s > ONE_WEEK && (await r.removeFile(t), i++);
|
|
1889
1893
|
}));
|
|
1890
|
-
await Promise.all(
|
|
1894
|
+
await Promise.all(o), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${i}`);
|
|
1891
1895
|
}
|
|
1892
1896
|
this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
|
|
1893
1897
|
}
|
|
@@ -1929,10 +1933,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1929
1933
|
} 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) {
|
|
1930
1934
|
const s = r, n = e.queueCopyFileToDest;
|
|
1931
1935
|
t.filesToCopy.push([ s, n ]);
|
|
1932
|
-
const
|
|
1933
|
-
t.dirsToEnsure.includes(
|
|
1934
|
-
const
|
|
1935
|
-
|
|
1936
|
+
const i = normalizePath(path$2.dirname(n));
|
|
1937
|
+
t.dirsToEnsure.includes(i) || t.dirsToEnsure.push(i);
|
|
1938
|
+
const o = t.dirsToDelete.indexOf(i);
|
|
1939
|
+
o > -1 && t.dirsToDelete.splice(o, 1);
|
|
1936
1940
|
const a = t.filesToDelete.indexOf(n);
|
|
1937
1941
|
a > -1 && t.filesToDelete.splice(a, 1);
|
|
1938
1942
|
}
|
|
@@ -1965,10 +1969,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1965
1969
|
|
|
1966
1970
|
(posix = {
|
|
1967
1971
|
resolve: function e() {
|
|
1968
|
-
var t, r, s, n = "",
|
|
1969
|
-
for (r = arguments.length - 1; r >= -1 && !
|
|
1970
|
-
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n,
|
|
1971
|
-
return n = normalizeStringPosix(n, !
|
|
1972
|
+
var t, r, s, n = "", i = !1;
|
|
1973
|
+
for (r = arguments.length - 1; r >= -1 && !i; r--) r >= 0 ? s = arguments[r] : (void 0 === t && (t = process.cwd()),
|
|
1974
|
+
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n, i = 47 === s.charCodeAt(0));
|
|
1975
|
+
return n = normalizeStringPosix(n, !i), i ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
|
|
1972
1976
|
},
|
|
1973
1977
|
normalize: function e(t) {
|
|
1974
1978
|
var r, s;
|
|
@@ -1986,70 +1990,70 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1986
1990
|
return void 0 === t ? "." : posix.normalize(t);
|
|
1987
1991
|
},
|
|
1988
1992
|
relative: function e(t, r) {
|
|
1989
|
-
var s, n,
|
|
1993
|
+
var s, n, i, o, a, l, c, u, d, h;
|
|
1990
1994
|
if (assertPath(t), assertPath(r), t === r) return "";
|
|
1991
1995
|
if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
|
|
1992
1996
|
for (s = 1; s < t.length && 47 === t.charCodeAt(s); ++s) ;
|
|
1993
|
-
for (
|
|
1994
|
-
for (l =
|
|
1997
|
+
for (i = (n = t.length) - s, o = 1; o < r.length && 47 === r.charCodeAt(o); ++o) ;
|
|
1998
|
+
for (l = i < (a = r.length - o) ? i : a, c = -1, u = 0; u <= l; ++u) {
|
|
1995
1999
|
if (u === l) {
|
|
1996
2000
|
if (a > l) {
|
|
1997
|
-
if (47 === r.charCodeAt(
|
|
1998
|
-
if (0 === u) return r.slice(
|
|
1999
|
-
} else
|
|
2001
|
+
if (47 === r.charCodeAt(o + u)) return r.slice(o + u + 1);
|
|
2002
|
+
if (0 === u) return r.slice(o + u);
|
|
2003
|
+
} else i > l && (47 === t.charCodeAt(s + u) ? c = u : 0 === u && (c = 0));
|
|
2000
2004
|
break;
|
|
2001
2005
|
}
|
|
2002
|
-
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(
|
|
2006
|
+
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(o + u)) break;
|
|
2003
2007
|
47 === d && (c = u);
|
|
2004
2008
|
}
|
|
2005
2009
|
for (h = "", u = s + c + 1; u <= n; ++u) u !== n && 47 !== t.charCodeAt(u) || (0 === h.length ? h += ".." : h += "/..");
|
|
2006
|
-
return h.length > 0 ? h + r.slice(
|
|
2007
|
-
r.slice(
|
|
2010
|
+
return h.length > 0 ? h + r.slice(o + c) : (o += c, 47 === r.charCodeAt(o) && ++o,
|
|
2011
|
+
r.slice(o));
|
|
2008
2012
|
},
|
|
2009
2013
|
_makeLong: function e(t) {
|
|
2010
2014
|
return t;
|
|
2011
2015
|
},
|
|
2012
2016
|
dirname: function e(t) {
|
|
2013
|
-
var r, s, n,
|
|
2017
|
+
var r, s, n, i;
|
|
2014
2018
|
if (assertPath(t), 0 === t.length) return ".";
|
|
2015
|
-
for (r = 47 === t.charCodeAt(0), s = -1, n = !0,
|
|
2019
|
+
for (r = 47 === t.charCodeAt(0), s = -1, n = !0, i = t.length - 1; i >= 1; --i) if (47 === t.charCodeAt(i)) {
|
|
2016
2020
|
if (!n) {
|
|
2017
|
-
s =
|
|
2021
|
+
s = i;
|
|
2018
2022
|
break;
|
|
2019
2023
|
}
|
|
2020
2024
|
} else n = !1;
|
|
2021
2025
|
return -1 === s ? r ? "/" : "." : r && 1 === s ? "//" : t.slice(0, s);
|
|
2022
2026
|
},
|
|
2023
2027
|
basename: function e(t, r) {
|
|
2024
|
-
var s, n,
|
|
2028
|
+
var s, n, i, o, a, l, c;
|
|
2025
2029
|
if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
|
|
2026
|
-
if (assertPath(t), s = 0, n = -1,
|
|
2030
|
+
if (assertPath(t), s = 0, n = -1, i = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
|
|
2027
2031
|
if (r.length === t.length && r === t) return "";
|
|
2028
|
-
for (a = r.length - 1, l = -1,
|
|
2029
|
-
if (!
|
|
2030
|
-
s =
|
|
2032
|
+
for (a = r.length - 1, l = -1, o = t.length - 1; o >= 0; --o) if (47 === (c = t.charCodeAt(o))) {
|
|
2033
|
+
if (!i) {
|
|
2034
|
+
s = o + 1;
|
|
2031
2035
|
break;
|
|
2032
2036
|
}
|
|
2033
|
-
} else -1 === l && (
|
|
2037
|
+
} else -1 === l && (i = !1, l = o + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (n = o) : (a = -1,
|
|
2034
2038
|
n = l));
|
|
2035
2039
|
return s === n ? n = l : -1 === n && (n = t.length), t.slice(s, n);
|
|
2036
2040
|
}
|
|
2037
|
-
for (
|
|
2038
|
-
if (!
|
|
2039
|
-
s =
|
|
2041
|
+
for (o = t.length - 1; o >= 0; --o) if (47 === t.charCodeAt(o)) {
|
|
2042
|
+
if (!i) {
|
|
2043
|
+
s = o + 1;
|
|
2040
2044
|
break;
|
|
2041
2045
|
}
|
|
2042
|
-
} else -1 === n && (
|
|
2046
|
+
} else -1 === n && (i = !1, n = o + 1);
|
|
2043
2047
|
return -1 === n ? "" : t.slice(s, n);
|
|
2044
2048
|
},
|
|
2045
2049
|
extname: function e(t) {
|
|
2046
|
-
var r, s, n,
|
|
2047
|
-
for (assertPath(t), r = -1, s = 0, n = -1,
|
|
2048
|
-
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !==
|
|
2050
|
+
var r, s, n, i, o, a, l;
|
|
2051
|
+
for (assertPath(t), r = -1, s = 0, n = -1, i = !0, o = 0, a = t.length - 1; a >= 0; --a) if (47 !== (l = t.charCodeAt(a))) -1 === n && (i = !1,
|
|
2052
|
+
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !== o && (o = 1) : -1 !== r && (o = -1); else if (!i) {
|
|
2049
2053
|
s = a + 1;
|
|
2050
2054
|
break;
|
|
2051
2055
|
}
|
|
2052
|
-
return -1 === r || -1 === n || 0 ===
|
|
2056
|
+
return -1 === r || -1 === n || 0 === o || 1 === o && r === n - 1 && r === s + 1 ? "" : t.slice(r, n);
|
|
2053
2057
|
},
|
|
2054
2058
|
format: function e(t) {
|
|
2055
2059
|
if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
|
|
@@ -2059,7 +2063,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2059
2063
|
}("/", t);
|
|
2060
2064
|
},
|
|
2061
2065
|
parse: function e(t) {
|
|
2062
|
-
var r, s, n,
|
|
2066
|
+
var r, s, n, i, o, a, l, c, u, d;
|
|
2063
2067
|
if (assertPath(t), r = {
|
|
2064
2068
|
root: "",
|
|
2065
2069
|
dir: "",
|
|
@@ -2067,14 +2071,14 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2067
2071
|
ext: "",
|
|
2068
2072
|
name: ""
|
|
2069
2073
|
}, 0 === t.length) return r;
|
|
2070
|
-
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/",
|
|
2071
|
-
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >=
|
|
2072
|
-
l = u + 1), 46 === s ? -1 ===
|
|
2074
|
+
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/", i = 1) : i = 0, o = -1,
|
|
2075
|
+
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= i; --u) if (47 !== (s = t.charCodeAt(u))) -1 === l && (c = !1,
|
|
2076
|
+
l = u + 1), 46 === s ? -1 === o ? o = u : 1 !== d && (d = 1) : -1 !== o && (d = -1); else if (!c) {
|
|
2073
2077
|
a = u + 1;
|
|
2074
2078
|
break;
|
|
2075
2079
|
}
|
|
2076
|
-
return -1 ===
|
|
2077
|
-
r.base = t.slice(1, l)) : (r.name = t.slice(a,
|
|
2080
|
+
return -1 === o || -1 === l || 0 === d || 1 === d && o === l - 1 && o === 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, o),
|
|
2081
|
+
r.base = t.slice(1, l)) : (r.name = t.slice(a, o), r.base = t.slice(a, l)), r.ext = t.slice(o, l)),
|
|
2078
2082
|
a > 0 ? r.dir = t.slice(0, a - 1) : n && (r.dir = "/"), r;
|
|
2079
2083
|
},
|
|
2080
2084
|
sep: "/",
|
|
@@ -2112,21 +2116,21 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2112
2116
|
let s = (r = normalizePath(r)).split("/").filter((e => e.length));
|
|
2113
2117
|
const n = s.lastIndexOf("node_modules");
|
|
2114
2118
|
n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
|
|
2115
|
-
let
|
|
2116
|
-
|
|
2117
|
-
const
|
|
2118
|
-
if ("@stencil/core" ===
|
|
2119
|
+
let i = s.shift();
|
|
2120
|
+
i.startsWith("@") && (i += "/" + s.shift());
|
|
2121
|
+
const o = s.join("/");
|
|
2122
|
+
if ("@stencil/core" === i) {
|
|
2119
2123
|
return ((e, t) => {
|
|
2120
2124
|
let r = (t = normalizePath(t)).split("/");
|
|
2121
2125
|
const s = r.lastIndexOf("node_modules");
|
|
2122
2126
|
return s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
|
|
2123
2127
|
t = r.join("/")), new URL("./" + t, (e => new URL("../", e).href)(e)).href;
|
|
2124
|
-
})(e.getCompilerExecutingPath(),
|
|
2128
|
+
})(e.getCompilerExecutingPath(), o);
|
|
2125
2129
|
}
|
|
2126
2130
|
return e.getRemoteModuleUrl({
|
|
2127
|
-
moduleId:
|
|
2128
|
-
version: t.get(
|
|
2129
|
-
path:
|
|
2131
|
+
moduleId: i,
|
|
2132
|
+
version: t.get(i),
|
|
2133
|
+
path: o
|
|
2130
2134
|
});
|
|
2131
2135
|
}, 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) => {
|
|
2132
2136
|
if (!((e => {
|
|
@@ -2135,11 +2139,11 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2135
2139
|
const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
|
|
2136
2140
|
return !("node_modules" !== s || !isCommonDirModuleFile(n));
|
|
2137
2141
|
})(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
|
|
2138
|
-
const
|
|
2139
|
-
if (
|
|
2140
|
-
if (
|
|
2141
|
-
const
|
|
2142
|
-
return await (async (e, t, r, s, n,
|
|
2142
|
+
const i = await ((e, t, r) => (console.trace(t), e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r)))(e, s);
|
|
2143
|
+
if (i) {
|
|
2144
|
+
if (i.ok) {
|
|
2145
|
+
const o = await i.clone().text();
|
|
2146
|
+
return await (async (e, t, r, s, n, i) => {
|
|
2143
2147
|
r.endsWith("package.json") && ((e, t) => {
|
|
2144
2148
|
try {
|
|
2145
2149
|
const r = JSON.parse(t);
|
|
@@ -2147,14 +2151,14 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2147
2151
|
e.set(t, r);
|
|
2148
2152
|
})(e, r.name, r.version);
|
|
2149
2153
|
} catch (e) {}
|
|
2150
|
-
})(
|
|
2151
|
-
let
|
|
2152
|
-
for (;"/" !==
|
|
2153
|
-
|
|
2154
|
+
})(i, n);
|
|
2155
|
+
let o = path$2.dirname(s);
|
|
2156
|
+
for (;"/" !== o && "" !== o; ) t ? (t.clearFileCache(o), await t.sys.createDir(o)) : await e.createDir(o),
|
|
2157
|
+
o = path$2.dirname(o);
|
|
2154
2158
|
t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
|
|
2155
|
-
})(e, t, s, n,
|
|
2159
|
+
})(e, t, s, n, o, r), o;
|
|
2156
2160
|
}
|
|
2157
|
-
404 ===
|
|
2161
|
+
404 === i.status && known404Urls.add(s);
|
|
2158
2162
|
}
|
|
2159
2163
|
} catch (e) {
|
|
2160
2164
|
console.error(e);
|
|
@@ -2177,7 +2181,7 @@ caller = function() {
|
|
|
2177
2181
|
}
|
|
2178
2182
|
}, r.exports), r.exports;
|
|
2179
2183
|
}((function(e) {
|
|
2180
|
-
var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,
|
|
2184
|
+
var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, i = {
|
|
2181
2185
|
parse: function(e) {
|
|
2182
2186
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2183
2187
|
var t = function r(e) {
|
|
@@ -2206,26 +2210,26 @@ caller = function() {
|
|
|
2206
2210
|
ext: r[4],
|
|
2207
2211
|
name: r[3]
|
|
2208
2212
|
};
|
|
2209
|
-
}, e.exports = s ?
|
|
2213
|
+
}, e.exports = s ? i.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = i.parse;
|
|
2210
2214
|
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2211
|
-
var s, n,
|
|
2212
|
-
for (/^([A-Za-z]:)/.test(t) ?
|
|
2215
|
+
var s, n, i = "/";
|
|
2216
|
+
for (/^([A-Za-z]:)/.test(t) ? i = "" : /^\\\\/.test(t) && (i = "\\\\"), s = [ t ],
|
|
2213
2217
|
n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
|
|
2214
2218
|
return s.reduce((function(e, t) {
|
|
2215
2219
|
return e.concat(r.map((function(e) {
|
|
2216
|
-
return path__default.default.resolve(
|
|
2220
|
+
return path__default.default.resolve(i, t, e);
|
|
2217
2221
|
})));
|
|
2218
2222
|
}), []);
|
|
2219
2223
|
}, nodeModulesPaths = function e(t, r, s) {
|
|
2220
|
-
var n,
|
|
2224
|
+
var n, i = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
|
|
2221
2225
|
return r && "function" == typeof r.paths ? r.paths(s, t, (function() {
|
|
2222
|
-
return getNodeModulesDirs(t,
|
|
2223
|
-
}), r) : (n = getNodeModulesDirs(t,
|
|
2226
|
+
return getNodeModulesDirs(t, i);
|
|
2227
|
+
}), r) : (n = getNodeModulesDirs(t, i), r && r.paths ? n.concat(r.paths) : n);
|
|
2224
2228
|
}, normalizeOptions = function(e, t) {
|
|
2225
2229
|
return t || {};
|
|
2226
2230
|
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2227
2231
|
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2228
|
-
var r, s, n,
|
|
2232
|
+
var r, s, n, i, o, a, l, c = this;
|
|
2229
2233
|
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2230
2234
|
for (r = slice.call(arguments, 1), n = function() {
|
|
2231
2235
|
if (this instanceof s) {
|
|
@@ -2233,8 +2237,8 @@ toStr = Object.prototype.toString, implementation = function e(t) {
|
|
|
2233
2237
|
return Object(e) === e ? e : this;
|
|
2234
2238
|
}
|
|
2235
2239
|
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2236
|
-
},
|
|
2237
|
-
return s = Function("binder", "return function (" +
|
|
2240
|
+
}, i = Math.max(0, c.length - r.length), o = [], a = 0; a < i; a++) o.push("$" + a);
|
|
2241
|
+
return s = Function("binder", "return function (" + o.join(",") + "){ return binder.apply(this,arguments); }")(n),
|
|
2238
2242
|
c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
|
|
2239
2243
|
l.prototype = null), s;
|
|
2240
2244
|
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
@@ -2359,13 +2363,13 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2359
2363
|
}
|
|
2360
2364
|
}));
|
|
2361
2365
|
}, getPackageCandidates$1 = function e(t, r, s) {
|
|
2362
|
-
var n,
|
|
2363
|
-
for (n = 0; n <
|
|
2364
|
-
return
|
|
2366
|
+
var n, i = nodeModulesPaths(r, s, t);
|
|
2367
|
+
for (n = 0; n < i.length; n++) i[n] = path__default.default.join(i[n], t);
|
|
2368
|
+
return i;
|
|
2365
2369
|
}, async = function e(t, r, s) {
|
|
2366
2370
|
function n(e) {
|
|
2367
2371
|
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) T = path__default.default.resolve(e, t),
|
|
2368
|
-
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package,
|
|
2372
|
+
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package, i) : o(T, C.package, i); else {
|
|
2369
2373
|
if (_ && isCoreModule(t)) return S(null, t);
|
|
2370
2374
|
!function r(e, t, s) {
|
|
2371
2375
|
var n = function() {
|
|
@@ -2383,7 +2387,7 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2383
2387
|
}));
|
|
2384
2388
|
}
|
|
2385
2389
|
}
|
|
2386
|
-
function
|
|
2390
|
+
function i(e, r, s) {
|
|
2387
2391
|
e ? S(e) : r ? S(null, r, s) : l(T, (function(e, r, s) {
|
|
2388
2392
|
if (e) S(e); else if (r) maybeRealpath(f, r, C, (function(e, t) {
|
|
2389
2393
|
e ? S(e) : S(null, t, s);
|
|
@@ -2393,20 +2397,20 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2393
2397
|
}
|
|
2394
2398
|
}));
|
|
2395
2399
|
}
|
|
2396
|
-
function
|
|
2400
|
+
function o(e, t, r) {
|
|
2397
2401
|
var s = t, n = r;
|
|
2398
2402
|
"function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
|
|
2399
|
-
function
|
|
2403
|
+
function i(s, i, a) {
|
|
2400
2404
|
var u, h, p;
|
|
2401
|
-
return c =
|
|
2402
|
-
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l,
|
|
2405
|
+
return c = i, s ? n(s) : a && c && C.pathFilter && (h = (u = path__default.default.relative(a, l)).slice(0, u.length - t[0].length),
|
|
2406
|
+
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, o);
|
|
2403
2407
|
}
|
|
2404
|
-
function
|
|
2405
|
-
return s ? n(s) :
|
|
2408
|
+
function o(s, i) {
|
|
2409
|
+
return s ? n(s) : i ? n(null, l, c) : void e(t.slice(1), r, c);
|
|
2406
2410
|
}
|
|
2407
2411
|
var l, c;
|
|
2408
2412
|
if (0 === t.length) return n(null, void 0, s);
|
|
2409
|
-
l = r + t[0], (c = s) ?
|
|
2413
|
+
l = r + t[0], (c = s) ? i(null, c) : a(path__default.default.dirname(l), i);
|
|
2410
2414
|
}([ "" ].concat(w), e, s);
|
|
2411
2415
|
}
|
|
2412
2416
|
function a(e, t) {
|
|
@@ -2417,8 +2421,8 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2417
2421
|
if (!s) return a(path__default.default.dirname(e), t);
|
|
2418
2422
|
m(p, n, (function(r, s) {
|
|
2419
2423
|
r && t(r);
|
|
2420
|
-
var
|
|
2421
|
-
|
|
2424
|
+
var i = s;
|
|
2425
|
+
i && C.packageFilter && (i = C.packageFilter(i, n)), t(null, i, e);
|
|
2422
2426
|
}));
|
|
2423
2427
|
}));
|
|
2424
2428
|
}));
|
|
@@ -2427,31 +2431,31 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2427
2431
|
var s = r, n = t;
|
|
2428
2432
|
"function" == typeof n && (s = n, n = C.package), maybeRealpath(f, e, C, (function(t, r) {
|
|
2429
2433
|
if (t) return s(t);
|
|
2430
|
-
var
|
|
2431
|
-
d(
|
|
2432
|
-
return t ? s(t) : r ? void m(p,
|
|
2434
|
+
var i = path__default.default.join(r, "package.json");
|
|
2435
|
+
d(i, (function(t, r) {
|
|
2436
|
+
return t ? s(t) : r ? void m(p, i, (function(t, r) {
|
|
2433
2437
|
var n, a;
|
|
2434
|
-
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n,
|
|
2435
|
-
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void
|
|
2438
|
+
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n, i)), n && n.main ? "string" != typeof n.main ? ((a = new TypeError("package “" + n.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2439
|
+
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void o(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2436
2440
|
return t ? s(t) : r ? s(null, r, n) : n ? void l(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2437
|
-
return t ? s(t) : r ? s(null, r, n) : void
|
|
2438
|
-
})) :
|
|
2439
|
-
}))) : void
|
|
2440
|
-
})) :
|
|
2441
|
+
return t ? s(t) : r ? s(null, r, n) : void o(path__default.default.join(e, "index"), n, s);
|
|
2442
|
+
})) : o(path__default.default.join(e, "index"), n, s);
|
|
2443
|
+
}))) : void o(path__default.default.join(e, "/index"), n, s));
|
|
2444
|
+
})) : o(path__default.default.join(e, "index"), n, s);
|
|
2441
2445
|
}));
|
|
2442
2446
|
}));
|
|
2443
2447
|
}
|
|
2444
2448
|
function c(e, t) {
|
|
2445
|
-
function r(t, r,
|
|
2446
|
-
return t ? e(t) : r ? e(null, r,
|
|
2449
|
+
function r(t, r, i) {
|
|
2450
|
+
return t ? e(t) : r ? e(null, r, i) : void l(n, C.package, s);
|
|
2447
2451
|
}
|
|
2448
2452
|
function s(r, s, n) {
|
|
2449
2453
|
return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
|
|
2450
2454
|
}
|
|
2451
2455
|
if (0 === t.length) return e(null, void 0);
|
|
2452
2456
|
var n = t[0];
|
|
2453
|
-
h(path__default.default.dirname(n), (function
|
|
2454
|
-
return s ? e(s) : a ? void
|
|
2457
|
+
h(path__default.default.dirname(n), (function i(s, a) {
|
|
2458
|
+
return s ? e(s) : a ? void o(n, C.package, r) : c(e, t.slice(1));
|
|
2455
2459
|
}));
|
|
2456
2460
|
}
|
|
2457
2461
|
var u, d, h, p, f, m, g, y, w, _, v, b, E, T, S = s, C = r;
|
|
@@ -2591,64 +2595,64 @@ defaultIsFile = function e(t) {
|
|
|
2591
2595
|
return JSON.parse(s);
|
|
2592
2596
|
} catch (e) {}
|
|
2593
2597
|
}, getPackageCandidates = function e(t, r, s) {
|
|
2594
|
-
var n,
|
|
2595
|
-
for (n = 0; n <
|
|
2596
|
-
return
|
|
2598
|
+
var n, i = nodeModulesPaths(r, s, t);
|
|
2599
|
+
for (n = 0; n < i.length; n++) i[n] = path__default.default.join(i[n], t);
|
|
2600
|
+
return i;
|
|
2597
2601
|
}, sync = function e(t, r) {
|
|
2598
2602
|
function s(e) {
|
|
2599
|
-
var t, r, s,
|
|
2600
|
-
if (l && l.dir && l.pkg &&
|
|
2601
|
-
(r =
|
|
2603
|
+
var t, r, s, i, l = n(path__default.default.dirname(e));
|
|
2604
|
+
if (l && l.dir && l.pkg && o.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2605
|
+
(r = o.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2602
2606
|
a(e)) return e;
|
|
2603
|
-
for (s = 0; s < p.length; s++) if (
|
|
2607
|
+
for (s = 0; s < p.length; s++) if (i = e + p[s], a(i)) return i;
|
|
2604
2608
|
}
|
|
2605
2609
|
function n(e) {
|
|
2606
2610
|
var t, r;
|
|
2607
|
-
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e,
|
|
2608
|
-
a(t) ? ((r = d(l, t)) &&
|
|
2611
|
+
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e, o), "package.json"),
|
|
2612
|
+
a(t) ? ((r = d(l, t)) && o.packageFilter && (r = o.packageFilter(r, e)), {
|
|
2609
2613
|
pkg: r,
|
|
2610
2614
|
dir: e
|
|
2611
2615
|
}) : n(path__default.default.dirname(e));
|
|
2612
2616
|
}
|
|
2613
|
-
function
|
|
2614
|
-
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e,
|
|
2617
|
+
function i(e) {
|
|
2618
|
+
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, o), "/package.json");
|
|
2615
2619
|
if (a(h)) {
|
|
2616
2620
|
try {
|
|
2617
2621
|
t = d(l, h);
|
|
2618
2622
|
} catch (e) {}
|
|
2619
|
-
if (t &&
|
|
2623
|
+
if (t && o.packageFilter && (t = o.packageFilter(t, e)), t && t.main) {
|
|
2620
2624
|
if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2621
2625
|
r;
|
|
2622
2626
|
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2623
2627
|
try {
|
|
2624
2628
|
if (n = s(path__default.default.resolve(e, t.main))) return n;
|
|
2625
|
-
if (c =
|
|
2629
|
+
if (c = i(path__default.default.resolve(e, t.main))) return c;
|
|
2626
2630
|
} catch (e) {}
|
|
2627
2631
|
}
|
|
2628
2632
|
}
|
|
2629
2633
|
return s(path__default.default.join(e, "/index"));
|
|
2630
2634
|
}
|
|
2631
|
-
var
|
|
2635
|
+
var o, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
|
|
2632
2636
|
if ("string" != typeof t) throw new TypeError("Path must be a string.");
|
|
2633
|
-
if (
|
|
2634
|
-
c =
|
|
2635
|
-
|
|
2636
|
-
if (h =
|
|
2637
|
-
m =
|
|
2638
|
-
y = maybeRealpathSync(u, path__default.default.resolve(m),
|
|
2637
|
+
if (o = normalizeOptions(0, r), a = o.isFile || defaultIsFile, l = o.readFileSync || fs__default.default.readFileSync,
|
|
2638
|
+
c = o.isDirectory || defaultIsDir, u = o.realpathSync || defaultRealpathSync, d = o.readPackageSync || defaultReadPackageSync,
|
|
2639
|
+
o.readFileSync && o.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
2640
|
+
if (h = o.packageIterator, p = o.extensions || [ ".js" ], f = !1 !== o.includeCoreModules,
|
|
2641
|
+
m = o.basedir || path__default.default.dirname(caller()), g = o.filename || m, o.paths = o.paths || [],
|
|
2642
|
+
y = maybeRealpathSync(u, path__default.default.resolve(m), o), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2639
2643
|
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2640
|
-
_ = s(w) ||
|
|
2644
|
+
_ = s(w) || i(w)) return maybeRealpathSync(u, _, o);
|
|
2641
2645
|
} else {
|
|
2642
2646
|
if (f && isCoreModule(t)) return t;
|
|
2643
2647
|
if (v = function E(e, t) {
|
|
2644
2648
|
var r, n, a, l, u = function() {
|
|
2645
|
-
return getPackageCandidates(e, t,
|
|
2646
|
-
}, d = h ? h(e, t, u,
|
|
2649
|
+
return getPackageCandidates(e, t, o);
|
|
2650
|
+
}, d = h ? h(e, t, u, o) : u();
|
|
2647
2651
|
for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
|
|
2648
2652
|
if (a = s(n)) return a;
|
|
2649
|
-
if (l =
|
|
2653
|
+
if (l = i(n)) return l;
|
|
2650
2654
|
}
|
|
2651
|
-
}(t, y)) return maybeRealpathSync(u, v,
|
|
2655
|
+
}(t, y)) return maybeRealpathSync(u, v, o);
|
|
2652
2656
|
}
|
|
2653
2657
|
throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
|
|
2654
2658
|
b;
|
|
@@ -2685,8 +2689,8 @@ const createSystem = e => {
|
|
|
2685
2689
|
let r = BLUE, s = "Build", n = "";
|
|
2686
2690
|
"error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
|
|
2687
2691
|
s = "Warning"), e.header && (s = e.header);
|
|
2688
|
-
const
|
|
2689
|
-
if (
|
|
2692
|
+
const i = e.relFilePath || e.absFilePath;
|
|
2693
|
+
if (i && (n += i, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
|
|
2690
2694
|
"number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
|
|
2691
2695
|
n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
|
|
2692
2696
|
n += "\n" + e.lineNumber + ": " + e.text;
|
|
@@ -2697,7 +2701,7 @@ const createSystem = e => {
|
|
|
2697
2701
|
})(t, e)));
|
|
2698
2702
|
}
|
|
2699
2703
|
};
|
|
2700
|
-
})(), r = new Map, s = new Set, n = e => s.add(e),
|
|
2704
|
+
})(), r = new Map, s = new Set, n = e => s.add(e), i = e => s.delete(e), o = (() => {
|
|
2701
2705
|
const e = [], t = t => {
|
|
2702
2706
|
const r = e.findIndex((e => e.callback === t));
|
|
2703
2707
|
return r > -1 && (e.splice(r, 1), !0);
|
|
@@ -2724,11 +2728,11 @@ const createSystem = e => {
|
|
|
2724
2728
|
}), () => t(n);
|
|
2725
2729
|
}
|
|
2726
2730
|
if ("string" == typeof r && "function" == typeof s) {
|
|
2727
|
-
const n = r.toLowerCase().trim(),
|
|
2731
|
+
const n = r.toLowerCase().trim(), i = s;
|
|
2728
2732
|
return e.push({
|
|
2729
2733
|
eventName: n,
|
|
2730
|
-
callback:
|
|
2731
|
-
}), () => t(
|
|
2734
|
+
callback: i
|
|
2735
|
+
}), () => t(i);
|
|
2732
2736
|
}
|
|
2733
2737
|
return () => !1;
|
|
2734
2738
|
},
|
|
@@ -2756,8 +2760,8 @@ const createSystem = e => {
|
|
|
2756
2760
|
}, d = (e, t, s) => {
|
|
2757
2761
|
const n = path$2.dirname(e);
|
|
2758
2762
|
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && d(n, t, s);
|
|
2759
|
-
const
|
|
2760
|
-
|
|
2763
|
+
const i = r.get(e);
|
|
2764
|
+
i ? (i.isDirectory = !0, i.isFile = !1) : (r.set(e, {
|
|
2761
2765
|
basename: path$2.basename(e),
|
|
2762
2766
|
dirname: n,
|
|
2763
2767
|
isDirectory: !0,
|
|
@@ -2781,10 +2785,10 @@ const createSystem = e => {
|
|
|
2781
2785
|
}), m = (e, t, s) => {
|
|
2782
2786
|
const n = w(e);
|
|
2783
2787
|
if (!n.error && !s.error) if (n.isFile) {
|
|
2784
|
-
const n = path$2.dirname(t),
|
|
2788
|
+
const n = path$2.dirname(t), i = u(n, {
|
|
2785
2789
|
recursive: !0
|
|
2786
|
-
}),
|
|
2787
|
-
s.newDirs.push(...
|
|
2790
|
+
}), o = r.get(e).data, a = b(t, o);
|
|
2791
|
+
s.newDirs.push(...i.newDirs), s.renamed.push({
|
|
2788
2792
|
oldPath: e,
|
|
2789
2793
|
newPath: t,
|
|
2790
2794
|
isDirectory: !1,
|
|
@@ -2882,8 +2886,8 @@ const createSystem = e => {
|
|
|
2882
2886
|
u("/");
|
|
2883
2887
|
const S = {
|
|
2884
2888
|
name: "in-memory",
|
|
2885
|
-
version: "2.
|
|
2886
|
-
events:
|
|
2889
|
+
version: "2.16.1",
|
|
2890
|
+
events: o,
|
|
2887
2891
|
access: async e => c(e),
|
|
2888
2892
|
accessSync: c,
|
|
2889
2893
|
addDestory: n,
|
|
@@ -2930,7 +2934,7 @@ const createSystem = e => {
|
|
|
2930
2934
|
readFileSync: p,
|
|
2931
2935
|
realpath: async e => f(e),
|
|
2932
2936
|
realpathSync: f,
|
|
2933
|
-
removeDestory:
|
|
2937
|
+
removeDestory: i,
|
|
2934
2938
|
rename: async (e, t) => {
|
|
2935
2939
|
const r = {
|
|
2936
2940
|
oldPath: e = normalizePath(e),
|
|
@@ -2967,14 +2971,14 @@ const createSystem = e => {
|
|
|
2967
2971
|
removeFileSync: _,
|
|
2968
2972
|
watchDirectory: (e, t) => {
|
|
2969
2973
|
e = l(e);
|
|
2970
|
-
const s = r.get(e),
|
|
2974
|
+
const s = r.get(e), o = () => {
|
|
2971
2975
|
const s = r.get(e);
|
|
2972
2976
|
if (s && s.watcherCallbacks) {
|
|
2973
2977
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2974
2978
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2975
2979
|
}
|
|
2976
2980
|
};
|
|
2977
|
-
return n(
|
|
2981
|
+
return n(o), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2978
2982
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2979
2983
|
basename: path$2.basename(e),
|
|
2980
2984
|
dirname: path$2.dirname(e),
|
|
@@ -2984,20 +2988,20 @@ const createSystem = e => {
|
|
|
2984
2988
|
data: void 0
|
|
2985
2989
|
}), {
|
|
2986
2990
|
close() {
|
|
2987
|
-
o
|
|
2991
|
+
i(o), o();
|
|
2988
2992
|
}
|
|
2989
2993
|
};
|
|
2990
2994
|
},
|
|
2991
2995
|
watchFile: (e, t) => {
|
|
2992
2996
|
e = l(e);
|
|
2993
|
-
const s = r.get(e),
|
|
2997
|
+
const s = r.get(e), o = () => {
|
|
2994
2998
|
const s = r.get(e);
|
|
2995
2999
|
if (s && s.watcherCallbacks) {
|
|
2996
3000
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2997
3001
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2998
3002
|
}
|
|
2999
3003
|
};
|
|
3000
|
-
return n(
|
|
3004
|
+
return n(o), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
3001
3005
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
3002
3006
|
basename: path$2.basename(e),
|
|
3003
3007
|
dirname: path$2.dirname(e),
|
|
@@ -3007,7 +3011,7 @@ const createSystem = e => {
|
|
|
3007
3011
|
data: void 0
|
|
3008
3012
|
}), {
|
|
3009
3013
|
close() {
|
|
3010
|
-
o
|
|
3014
|
+
i(o), o();
|
|
3011
3015
|
}
|
|
3012
3016
|
};
|
|
3013
3017
|
},
|
|
@@ -3020,18 +3024,18 @@ const createSystem = e => {
|
|
|
3020
3024
|
return "number" == typeof t && (s = s.slice(0, t)), s;
|
|
3021
3025
|
},
|
|
3022
3026
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
3023
|
-
let r, s = 0, n = !1,
|
|
3027
|
+
let r, s = 0, n = !1, i = !1, o = 0;
|
|
3024
3028
|
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 = () => {
|
|
3025
3029
|
let t = null;
|
|
3026
|
-
const s = e.getCompilerExecutingPath(),
|
|
3027
|
-
name: "stencil.worker." +
|
|
3030
|
+
const s = e.getCompilerExecutingPath(), i = {
|
|
3031
|
+
name: "stencil.worker." + o++
|
|
3028
3032
|
};
|
|
3029
3033
|
try {
|
|
3030
|
-
t = new Worker(s,
|
|
3034
|
+
t = new Worker(s, i);
|
|
3031
3035
|
} catch (e) {
|
|
3032
3036
|
null == r && (r = new Blob([ `importScripts('${s}');` ], {
|
|
3033
3037
|
type: "application/javascript"
|
|
3034
|
-
})), t = new Worker(URL.createObjectURL(r),
|
|
3038
|
+
})), t = new Worker(URL.createObjectURL(r), i);
|
|
3035
3039
|
}
|
|
3036
3040
|
const l = {
|
|
3037
3041
|
worker: t,
|
|
@@ -3060,7 +3064,7 @@ const createSystem = e => {
|
|
|
3060
3064
|
} else t = p(), c.push(t);
|
|
3061
3065
|
t.activeTasks++, t.sendQueue.push(e);
|
|
3062
3066
|
}, g = () => {
|
|
3063
|
-
|
|
3067
|
+
i = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
3064
3068
|
}, y = (...e) => new Promise(((t, r) => {
|
|
3065
3069
|
if (n) r("task canceled"); else {
|
|
3066
3070
|
const n = {
|
|
@@ -3070,7 +3074,7 @@ const createSystem = e => {
|
|
|
3070
3074
|
l.push(n), a.set(n.stencilId, {
|
|
3071
3075
|
resolve: t,
|
|
3072
3076
|
reject: r
|
|
3073
|
-
}),
|
|
3077
|
+
}), i || (i = !0, d.then(g));
|
|
3074
3078
|
}
|
|
3075
3079
|
}));
|
|
3076
3080
|
return {
|
|
@@ -3101,11 +3105,11 @@ const createSystem = e => {
|
|
|
3101
3105
|
return S.resolveModuleId = e => ((e, t, r) => {
|
|
3102
3106
|
const s = ((e, t, r) => ({
|
|
3103
3107
|
async isFile(s, n) {
|
|
3104
|
-
const
|
|
3105
|
-
if ((await t.stat(
|
|
3106
|
-
if (shouldFetchModule(
|
|
3107
|
-
const r = getNodeModuleFetchUrl(e, packageVersions,
|
|
3108
|
-
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r,
|
|
3108
|
+
const i = normalizeFsPath(s);
|
|
3109
|
+
if ((await t.stat(i)).isFile) n(null, !0); else {
|
|
3110
|
+
if (shouldFetchModule(i) && r.some((e => i.endsWith(e)))) {
|
|
3111
|
+
const r = getNodeModuleFetchUrl(e, packageVersions, i);
|
|
3112
|
+
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, i));
|
|
3109
3113
|
}
|
|
3110
3114
|
n(null, !1);
|
|
3111
3115
|
}
|
|
@@ -3118,7 +3122,7 @@ const createSystem = e => {
|
|
|
3118
3122
|
void s(null, !0);
|
|
3119
3123
|
if (isCommonDirModuleFile(n)) return void s(null, !1);
|
|
3120
3124
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
3121
|
-
const
|
|
3125
|
+
const i = getCommonDirUrl(e, packageVersions, n, r), o = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, i, o);
|
|
3122
3126
|
if (isString(a)) return void s(null, !0);
|
|
3123
3127
|
}
|
|
3124
3128
|
}
|
|
@@ -3137,13 +3141,13 @@ const createSystem = e => {
|
|
|
3137
3141
|
}))(e, null, r.exts);
|
|
3138
3142
|
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"),
|
|
3139
3143
|
e)), new Promise(((e, t) => {
|
|
3140
|
-
resolve(r.moduleId, s, ((s, n,
|
|
3144
|
+
resolve(r.moduleId, s, ((s, n, i) => {
|
|
3141
3145
|
if (s) t(s); else {
|
|
3142
3146
|
n = normalizePath(n);
|
|
3143
3147
|
const t = {
|
|
3144
3148
|
moduleId: r.moduleId,
|
|
3145
3149
|
resolveId: n,
|
|
3146
|
-
pkgData:
|
|
3150
|
+
pkgData: i,
|
|
3147
3151
|
pkgDirPath: getPackageDirPath(n, r.moduleId)
|
|
3148
3152
|
};
|
|
3149
3153
|
e(t);
|
|
@@ -3183,7 +3187,7 @@ const createSystem = e => {
|
|
|
3183
3187
|
t = e;
|
|
3184
3188
|
}
|
|
3185
3189
|
}
|
|
3186
|
-
}), !function
|
|
3190
|
+
}), !function i(e) {
|
|
3187
3191
|
return "diskReads" in e && "diskWrites" in e;
|
|
3188
3192
|
}(r)) throw new Error("could not generate TestingSystem");
|
|
3189
3193
|
return r;
|
|
@@ -3202,16 +3206,16 @@ class TestingLogger {
|
|
|
3202
3206
|
return "";
|
|
3203
3207
|
}
|
|
3204
3208
|
info(...e) {
|
|
3205
|
-
this.isEnabled && console.log
|
|
3209
|
+
this.isEnabled && console.log(...e);
|
|
3206
3210
|
}
|
|
3207
3211
|
warn(...e) {
|
|
3208
|
-
this.isEnabled && console.warn
|
|
3212
|
+
this.isEnabled && console.warn(...e);
|
|
3209
3213
|
}
|
|
3210
3214
|
error(...e) {
|
|
3211
|
-
this.isEnabled && console.error
|
|
3215
|
+
this.isEnabled && console.error(...e);
|
|
3212
3216
|
}
|
|
3213
3217
|
debug(...e) {
|
|
3214
|
-
this.isEnabled && console.log
|
|
3218
|
+
this.isEnabled && console.log(...e);
|
|
3215
3219
|
}
|
|
3216
3220
|
color(e, t) {}
|
|
3217
3221
|
red(e) {
|
|
@@ -3355,8 +3359,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3355
3359
|
waitForVisible() {
|
|
3356
3360
|
return new Promise(((e, t) => {
|
|
3357
3361
|
const r = setInterval((async () => {
|
|
3358
|
-
await this.isVisible() && (clearInterval(r), clearTimeout(
|
|
3359
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`),
|
|
3362
|
+
await this.isVisible() && (clearInterval(r), clearTimeout(i), e());
|
|
3363
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), i = setTimeout((() => {
|
|
3360
3364
|
clearTimeout(r), t(n);
|
|
3361
3365
|
}), s);
|
|
3362
3366
|
}));
|
|
@@ -3364,8 +3368,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3364
3368
|
waitForNotVisible() {
|
|
3365
3369
|
return new Promise(((e, t) => {
|
|
3366
3370
|
const r = setInterval((async () => {
|
|
3367
|
-
await this.isVisible() || (clearInterval(r), clearTimeout(
|
|
3368
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`),
|
|
3371
|
+
await this.isVisible() || (clearInterval(r), clearTimeout(i), e());
|
|
3372
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), i = setTimeout((() => {
|
|
3369
3373
|
clearTimeout(r), t(n);
|
|
3370
3374
|
}), s);
|
|
3371
3375
|
}));
|
|
@@ -3624,15 +3628,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3624
3628
|
var e;
|
|
3625
3629
|
const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
|
|
3626
3630
|
return class r extends t {
|
|
3627
|
-
async runTests(e, t, r, s, n,
|
|
3628
|
-
const
|
|
3631
|
+
async runTests(e, t, r, s, n, i) {
|
|
3632
|
+
const o = process.env;
|
|
3629
3633
|
if (e = e.filter((e => function t(e, r) {
|
|
3630
3634
|
const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
|
|
3631
3635
|
return !("true" !== r.__STENCIL_E2E_TESTS__ || !s) || "true" === r.__STENCIL_SPEC_TESTS__ && !s;
|
|
3632
|
-
}(e.path,
|
|
3633
|
-
const a = JSON.parse(
|
|
3634
|
-
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l],
|
|
3635
|
-
} else await super.runTests(e, t, r, s, n,
|
|
3636
|
+
}(e.path, o))), "true" === o.__STENCIL_SCREENSHOT__) {
|
|
3637
|
+
const a = JSON.parse(o.__STENCIL_EMULATE_CONFIGS__);
|
|
3638
|
+
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], o), await super.runTests(e, t, r, s, n, i);
|
|
3639
|
+
} else await super.runTests(e, t, r, s, n, i);
|
|
3636
3640
|
}
|
|
3637
3641
|
};
|
|
3638
3642
|
}, exports.createTesting = async e => {
|
|
@@ -3644,14 +3648,14 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3644
3648
|
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3645
3649
|
}(e);
|
|
3646
3650
|
const {createCompiler: r} = require("../compiler/stencil.js"), s = await r(e);
|
|
3647
|
-
let n,
|
|
3648
|
-
const
|
|
3651
|
+
let n, i;
|
|
3652
|
+
const o = async () => {
|
|
3649
3653
|
const t = [];
|
|
3650
3654
|
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), n && (n.close && t.push(n.close()),
|
|
3651
|
-
n = null),
|
|
3655
|
+
n = null), i && (i.close && t.push(i.close()), i = null), await Promise.all(t);
|
|
3652
3656
|
};
|
|
3653
3657
|
return {
|
|
3654
|
-
destroy:
|
|
3658
|
+
destroy: o,
|
|
3655
3659
|
run: async (t = {}) => {
|
|
3656
3660
|
let r, a = !1, l = !1, c = null;
|
|
3657
3661
|
const u = [];
|
|
@@ -3674,9 +3678,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3674
3678
|
})), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3675
3679
|
e.devServer.reloadStrategy = null;
|
|
3676
3680
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3677
|
-
if (n = l[0],
|
|
3681
|
+
if (n = l[0], i = l[1], t) {
|
|
3678
3682
|
const r = await t;
|
|
3679
|
-
if (!r || !e.watch && hasError(r && r.diagnostics)) return await
|
|
3683
|
+
if (!r || !e.watch && hasError(r && r.diagnostics)) return await o(), !1;
|
|
3680
3684
|
}
|
|
3681
3685
|
n && (r.__STENCIL_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__STENCIL_BROWSER_URL__}`),
|
|
3682
3686
|
r.__STENCIL_APP_SCRIPT_URL__ = function d(e, t) {
|
|
@@ -3710,13 +3714,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3710
3714
|
waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
|
|
3711
3715
|
pixelmatchModulePath: s
|
|
3712
3716
|
}), e.flags.updateScreenshot || await r.pullMasterBuild(), n.finish("screenshot, initBuild finished");
|
|
3713
|
-
const
|
|
3714
|
-
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(
|
|
3717
|
+
const i = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), o = i[0], a = i[1];
|
|
3718
|
+
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(o, a);
|
|
3715
3719
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3716
3720
|
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3717
3721
|
try {
|
|
3718
3722
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3719
|
-
let s = await r.completeBuild(
|
|
3723
|
+
let s = await r.completeBuild(o);
|
|
3720
3724
|
if (t.finish("screenshot, completeTimespan finished"), s) {
|
|
3721
3725
|
const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
|
|
3722
3726
|
if (s = await r.publishBuild(s), t.finish("screenshot, publishBuild finished"),
|
|
@@ -3798,19 +3802,19 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3798
3802
|
const t = process.env;
|
|
3799
3803
|
"true" === t.__STENCIL_SCREENSHOT__ ? e.compareScreenshot = (r, s) => {
|
|
3800
3804
|
const n = global;
|
|
3801
|
-
let
|
|
3802
|
-
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (
|
|
3803
|
-
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (
|
|
3804
|
-
"object" == typeof s && (
|
|
3805
|
-
|
|
3806
|
-
if (n.screenshotDescriptions.has(
|
|
3807
|
-
return n.screenshotDescriptions.add(
|
|
3805
|
+
let i, o = "", a = "";
|
|
3806
|
+
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (o = n.currentSpec.fullName),
|
|
3807
|
+
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (o.length > 0 ? o += ", " + r : o = r,
|
|
3808
|
+
"object" == typeof s && (i = s)) : "object" == typeof r && (i = r), o = o.trim(),
|
|
3809
|
+
i = i || {}, !o) throw new Error(`Invalid screenshot description in "${a}"`);
|
|
3810
|
+
if (n.screenshotDescriptions.has(o)) throw new Error(`Screenshot description "${o}" 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')".`);
|
|
3811
|
+
return n.screenshotDescriptions.add(o), async function l(e, t, r, s, n) {
|
|
3808
3812
|
if ("string" != typeof t.__STENCIL_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
|
|
3809
3813
|
if ("string" != typeof t.__STENCIL_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
3810
|
-
const
|
|
3814
|
+
const i = JSON.parse(t.__STENCIL_EMULATE__), o = JSON.parse(t.__STENCIL_SCREENSHOT_BUILD__);
|
|
3811
3815
|
await function a(e) {
|
|
3812
3816
|
return new Promise((t => setTimeout(t, e)));
|
|
3813
|
-
}(
|
|
3817
|
+
}(o.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
|
|
3814
3818
|
window.requestAnimationFrame((() => {
|
|
3815
3819
|
e();
|
|
3816
3820
|
}));
|
|
@@ -3828,11 +3832,11 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3828
3832
|
width: e.clip.width,
|
|
3829
3833
|
height: e.clip.height
|
|
3830
3834
|
}), t;
|
|
3831
|
-
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold :
|
|
3832
|
-
let h =
|
|
3835
|
+
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : o.pixelmatchThreshold;
|
|
3836
|
+
let h = i.viewport.width, p = i.viewport.height;
|
|
3833
3837
|
return n && n.clip && ("number" == typeof n.clip.width && (h = n.clip.width), "number" == typeof n.clip.height && (p = n.clip.height)),
|
|
3834
|
-
await compareScreenshot(
|
|
3835
|
-
}(e, t,
|
|
3838
|
+
await compareScreenshot(i, o, u, r, h, p, s, d);
|
|
3839
|
+
}(e, t, o, a, i);
|
|
3836
3840
|
} : e.compareScreenshot = async () => ({
|
|
3837
3841
|
mismatchedPixels: 0,
|
|
3838
3842
|
allowableMismatchedPixels: 1,
|
|
@@ -3880,13 +3884,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3880
3884
|
e();
|
|
3881
3885
|
}))));
|
|
3882
3886
|
};
|
|
3883
|
-
const
|
|
3887
|
+
const i = !0 === e.failOnConsoleError, o = !0 === e.failOnNetworkError;
|
|
3884
3888
|
t.on("console", (e => {
|
|
3885
3889
|
"error" === e.type() && (r.push({
|
|
3886
3890
|
type: "error",
|
|
3887
3891
|
message: e.text(),
|
|
3888
3892
|
location: e.location().url
|
|
3889
|
-
}),
|
|
3893
|
+
}), i && fail(new Error(serializeConsoleMessage(e)))), function t(e) {
|
|
3890
3894
|
const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
|
|
3891
3895
|
"debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
|
|
3892
3896
|
}(e);
|
|
@@ -3901,7 +3905,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3901
3905
|
type: "requestfailed",
|
|
3902
3906
|
message: e.failure().errorText,
|
|
3903
3907
|
location: e.url()
|
|
3904
|
-
}),
|
|
3908
|
+
}), o ? fail(new Error(e.failure().errorText)) : console.error("requestfailed", e.url());
|
|
3905
3909
|
})), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
|
|
3906
3910
|
waitUntil: e.waitUntil
|
|
3907
3911
|
}) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
|
|
@@ -3967,7 +3971,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3967
3971
|
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
3968
3972
|
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
3969
3973
|
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
3970
|
-
})),
|
|
3974
|
+
})), i = (e => {
|
|
3971
3975
|
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 = {
|
|
3972
3976
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
3973
3977
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
@@ -4027,8 +4031,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4027
4031
|
return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
|
|
4028
4032
|
n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
|
|
4029
4033
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4030
|
-
if (e.strictBuild ? Object.assign(appData.BUILD,
|
|
4031
|
-
!0 ===
|
|
4034
|
+
if (e.strictBuild ? Object.assign(appData.BUILD, i) : Object.keys(i).forEach((e => {
|
|
4035
|
+
!0 === i[e] && (appData.BUILD[e] = !0);
|
|
4032
4036
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4033
4037
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4034
4038
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
@@ -4058,10 +4062,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4058
4062
|
testing.renderVdom(t, e.template());
|
|
4059
4063
|
} else "string" == typeof e.html && (s.body.innerHTML = e.html);
|
|
4060
4064
|
!1 !== e.flushQueue && await s.waitForChanges();
|
|
4061
|
-
let
|
|
4065
|
+
let o = null;
|
|
4062
4066
|
return Object.defineProperty(s, "root", {
|
|
4063
4067
|
get() {
|
|
4064
|
-
if (null ==
|
|
4068
|
+
if (null == o && (o = findRootComponent(t, s.body)), null != o) return o;
|
|
4065
4069
|
const e = s.body.firstElementChild;
|
|
4066
4070
|
return null != e ? e : null;
|
|
4067
4071
|
}
|