@stencil/core 2.16.1 → 2.17.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 +96 -6
- package/cli/index.js +96 -6
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +524 -121
- 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/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- 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 +1 -1
- 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 +1 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +4 -0
- package/internal/stencil-public-compiler.d.ts +2 -2
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +140 -5
- package/mock-doc/index.d.ts +76 -1
- package/mock-doc/index.js +140 -5
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +325 -314
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.d.ts +1 -1
- package/testing/index.js +406 -367
- package/testing/mocks.d.ts +22 -2
- 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.17.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
|
}
|
|
@@ -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), o = function o(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: i} = require("@jest/core");
|
|
177
|
+
r = !!(await i(n, o)).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), o = {
|
|
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 = 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
259
|
const e = {
|
|
260
|
-
lineIndex:
|
|
261
|
-
lineNumber:
|
|
262
|
-
text: s[
|
|
260
|
+
lineIndex: o.lineIndex - 1,
|
|
261
|
+
lineNumber: o.lineNumber - 1,
|
|
262
|
+
text: s[o.lineIndex - 1],
|
|
263
263
|
errorCharStart: -1,
|
|
264
264
|
errorLength: -1
|
|
265
265
|
};
|
|
266
266
|
t.lines.unshift(e);
|
|
267
267
|
}
|
|
268
|
-
if (
|
|
268
|
+
if (o.lineIndex + 1 < s.length) {
|
|
269
269
|
const e = {
|
|
270
|
-
lineIndex:
|
|
271
|
-
lineNumber:
|
|
272
|
-
text: s[
|
|
270
|
+
lineIndex: o.lineIndex + 1,
|
|
271
|
+
lineNumber: o.lineNumber + 1,
|
|
272
|
+
text: s[o.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 o = index_cjs.parseHtmlToFragment(t), i = index_cjs.serializeNodeToHtml(o, {
|
|
317
317
|
prettyHtml: !0,
|
|
318
318
|
excludeTags: [ "body" ]
|
|
319
319
|
});
|
|
320
|
-
return s !==
|
|
320
|
+
return s !== i ? (expect(s).toBe(i), {
|
|
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, o = "", i = 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 (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("/"),
|
|
402
402
|
a = s, l = 0;
|
|
403
403
|
continue;
|
|
404
404
|
}
|
|
405
|
-
} else if (2 ===
|
|
406
|
-
|
|
405
|
+
} else if (2 === o.length || 1 === o.length) {
|
|
406
|
+
o = "", i = 0, a = s, l = 0;
|
|
407
407
|
continue;
|
|
408
408
|
}
|
|
409
|
-
t && (
|
|
410
|
-
} 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;
|
|
411
411
|
a = s, l = 0;
|
|
412
412
|
} else 46 === r && -1 !== l ? ++l : l = -1;
|
|
413
413
|
}
|
|
414
|
-
return
|
|
414
|
+
return o;
|
|
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, 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;
|
|
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(" "), 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;
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
function matchesRange(e) {
|
|
@@ -476,7 +476,11 @@ function mockConfig(e) {
|
|
|
476
476
|
nodeResolve: {
|
|
477
477
|
customResolveOptions: {}
|
|
478
478
|
},
|
|
479
|
-
sourceMap: !0
|
|
479
|
+
sourceMap: !0,
|
|
480
|
+
rollupPlugins: {
|
|
481
|
+
before: [],
|
|
482
|
+
after: []
|
|
483
|
+
}
|
|
480
484
|
};
|
|
481
485
|
}
|
|
482
486
|
|
|
@@ -499,7 +503,7 @@ function mockCompilerCtx(e) {
|
|
|
499
503
|
compilerOptions: null,
|
|
500
504
|
cache: null,
|
|
501
505
|
cssModuleImports: new Map,
|
|
502
|
-
events:
|
|
506
|
+
events: buildEvents(),
|
|
503
507
|
fs: null,
|
|
504
508
|
hasSuccessfulBuild: !1,
|
|
505
509
|
isActivelyBuilding: !1,
|
|
@@ -539,23 +543,23 @@ function mockCompilerCtx(e) {
|
|
|
539
543
|
if (!0 === r.inMemoryOnly) {
|
|
540
544
|
let n = e;
|
|
541
545
|
n.endsWith("/") || (n += "/");
|
|
542
|
-
const
|
|
546
|
+
const o = e.split("/");
|
|
543
547
|
t.forEach(((t, n) => {
|
|
544
548
|
if (!n.startsWith(e)) return;
|
|
545
549
|
const a = n.split("/");
|
|
546
|
-
if ((a.length ===
|
|
550
|
+
if ((a.length === o.length + 1 || r.recursive && a.length > o.length) && t.exists) {
|
|
547
551
|
const e = {
|
|
548
552
|
absPath: n,
|
|
549
|
-
relPath: a[
|
|
553
|
+
relPath: a[o.length],
|
|
550
554
|
isDirectory: t.isDirectory,
|
|
551
555
|
isFile: t.isFile
|
|
552
556
|
};
|
|
553
|
-
|
|
557
|
+
i(r, e) || s.push(e);
|
|
554
558
|
}
|
|
555
559
|
}));
|
|
556
|
-
} else await
|
|
560
|
+
} else await o(e, e, r, s);
|
|
557
561
|
return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
|
|
558
|
-
},
|
|
562
|
+
}, o = async (t, r, s, n) => {
|
|
559
563
|
const a = await e.readDir(r);
|
|
560
564
|
if (a.length > 0) {
|
|
561
565
|
const e = b(r);
|
|
@@ -566,10 +570,10 @@ function mockCompilerCtx(e) {
|
|
|
566
570
|
isDirectory: l.isDirectory,
|
|
567
571
|
isFile: l.isFile
|
|
568
572
|
};
|
|
569
|
-
|
|
573
|
+
i(s, u) || (n.push(u), !0 === s.recursive && !0 === l.isDirectory && await o(t, r, s, n));
|
|
570
574
|
})));
|
|
571
575
|
}
|
|
572
|
-
},
|
|
576
|
+
}, i = (e, t) => {
|
|
573
577
|
if (t.isDirectory) {
|
|
574
578
|
if (Array.isArray(e.excludeDirNames)) {
|
|
575
579
|
const r = path$2.basename(t.absPath);
|
|
@@ -622,26 +626,26 @@ function mockCompilerCtx(e) {
|
|
|
622
626
|
}, d = async (t, s, n) => {
|
|
623
627
|
if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
|
|
624
628
|
if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
|
|
625
|
-
const
|
|
629
|
+
const o = {
|
|
626
630
|
ignored: !1,
|
|
627
631
|
changedContent: !1,
|
|
628
632
|
queuedWrite: !1
|
|
629
633
|
};
|
|
630
|
-
if (!0 === shouldIgnore(t)) return
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
633
|
-
"string" == typeof
|
|
634
|
-
|
|
635
|
-
!1 === n.useCache && (
|
|
634
|
+
if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
|
|
635
|
+
const i = b(t);
|
|
636
|
+
if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
|
|
637
|
+
"string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : o.changedContent = !0,
|
|
638
|
+
i.fileText = s, o.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
|
|
639
|
+
!1 === n.useCache && (i.useCache = !1)), null != n && !0 === n.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
|
|
636
640
|
await h(t, !0); else if (null != n && !0 === n.immediateWrite) {
|
|
637
|
-
if (
|
|
641
|
+
if (o.changedContent || !0 !== n.useCache) {
|
|
638
642
|
const r = await e.readFile(t);
|
|
639
|
-
"string" == typeof r && (
|
|
640
|
-
|
|
643
|
+
"string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
|
|
644
|
+
o.changedContent && (await h(t, !1), await e.writeFile(t, i.fileText));
|
|
641
645
|
}
|
|
642
|
-
} else
|
|
643
|
-
|
|
644
|
-
return
|
|
646
|
+
} else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
|
|
647
|
+
o.queuedWrite = !0);
|
|
648
|
+
return o;
|
|
645
649
|
}, h = async (e, t) => {
|
|
646
650
|
const r = [];
|
|
647
651
|
for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
|
|
@@ -724,12 +728,12 @@ function mockCompilerCtx(e) {
|
|
|
724
728
|
clearDirCache: _,
|
|
725
729
|
clearFileCache: v,
|
|
726
730
|
commit: async () => {
|
|
727
|
-
const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy),
|
|
731
|
+
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);
|
|
728
732
|
return e.filesToDelete.forEach(v), e.dirsToDelete.forEach(_), {
|
|
729
733
|
filesCopied: n,
|
|
730
734
|
filesWritten: s,
|
|
731
|
-
filesDeleted:
|
|
732
|
-
dirsDeleted:
|
|
735
|
+
filesDeleted: o,
|
|
736
|
+
dirsDeleted: i,
|
|
733
737
|
dirsAdded: r
|
|
734
738
|
};
|
|
735
739
|
},
|
|
@@ -839,19 +843,19 @@ async function initPageEvents(e) {
|
|
|
839
843
|
}
|
|
840
844
|
|
|
841
845
|
async function pageSpyOnEvent(e, t, r) {
|
|
842
|
-
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document,
|
|
843
|
-
return await addE2EListener(e,
|
|
846
|
+
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, o = await e.evaluateHandle(n);
|
|
847
|
+
return await addE2EListener(e, o, t, (e => {
|
|
844
848
|
s.push(e);
|
|
845
849
|
})), s;
|
|
846
850
|
}
|
|
847
851
|
|
|
848
852
|
async function waitForEvent(e, t, r) {
|
|
849
853
|
const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate(((e, t, r) => new Promise(((s, n) => {
|
|
850
|
-
const
|
|
854
|
+
const o = setTimeout((() => {
|
|
851
855
|
n(new Error(`waitForEvent() timeout, eventName: ${t}`));
|
|
852
856
|
}), r);
|
|
853
857
|
e.addEventListener(t, (e => {
|
|
854
|
-
clearTimeout(
|
|
858
|
+
clearTimeout(o), s(window.stencilSerializeEvent(e));
|
|
855
859
|
}), {
|
|
856
860
|
once: !0
|
|
857
861
|
});
|
|
@@ -865,8 +869,8 @@ async function addE2EListener(e, t, r, s) {
|
|
|
865
869
|
eventName: r,
|
|
866
870
|
callback: s
|
|
867
871
|
});
|
|
868
|
-
const
|
|
869
|
-
await
|
|
872
|
+
const o = t.executionContext();
|
|
873
|
+
await o.evaluate(((e, t, r) => {
|
|
870
874
|
e.addEventListener(r, (e => {
|
|
871
875
|
window.stencilOnEvent(t, window.stencilSerializeEvent(e));
|
|
872
876
|
}));
|
|
@@ -922,7 +926,7 @@ function browserContextEvents() {
|
|
|
922
926
|
}
|
|
923
927
|
|
|
924
928
|
async function find(e, t, r) {
|
|
925
|
-
const {lightSelector: s, shadowSelector: n, text:
|
|
929
|
+
const {lightSelector: s, shadowSelector: n, text: o, contains: i} = getSelector(r);
|
|
926
930
|
let a;
|
|
927
931
|
if (a = "string" == typeof s ? await async function l(e, t, r, s) {
|
|
928
932
|
let n = await t.$(r);
|
|
@@ -950,20 +954,20 @@ async function find(e, t, r) {
|
|
|
950
954
|
}(e), s;
|
|
951
955
|
}), t, r, s);
|
|
952
956
|
return n ? n.asElement() : null;
|
|
953
|
-
}(e, t,
|
|
957
|
+
}(e, t, o, i), !a) return null;
|
|
954
958
|
const u = new E2EElement(e, a);
|
|
955
959
|
return await u.e2eSync(), u;
|
|
956
960
|
}
|
|
957
961
|
|
|
958
962
|
async function findAll(e, t, r) {
|
|
959
|
-
const s = [], {lightSelector: n, shadowSelector:
|
|
960
|
-
if (0 ===
|
|
961
|
-
if (
|
|
962
|
-
const r =
|
|
963
|
+
const s = [], {lightSelector: n, shadowSelector: o} = getSelector(r), i = await t.$$(n);
|
|
964
|
+
if (0 === i.length) return s;
|
|
965
|
+
if (o) for (let t = 0; t < i.length; t++) {
|
|
966
|
+
const r = i[t].executionContext(), n = await r.evaluateHandle(((e, t) => {
|
|
963
967
|
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
964
968
|
return e.shadowRoot.querySelectorAll(t);
|
|
965
|
-
}),
|
|
966
|
-
await
|
|
969
|
+
}), i[t], o);
|
|
970
|
+
await i[t].dispose();
|
|
967
971
|
const a = await n.getProperties();
|
|
968
972
|
await n.dispose();
|
|
969
973
|
for (const t of a.values()) {
|
|
@@ -973,8 +977,8 @@ async function findAll(e, t, r) {
|
|
|
973
977
|
await t.e2eSync(), s.push(t);
|
|
974
978
|
}
|
|
975
979
|
}
|
|
976
|
-
} else for (let t = 0; t <
|
|
977
|
-
const r = new E2EElement(e,
|
|
980
|
+
} else for (let t = 0; t < i.length; t++) {
|
|
981
|
+
const r = new E2EElement(e, i[t]);
|
|
978
982
|
await r.e2eSync(), s.push(r);
|
|
979
983
|
}
|
|
980
984
|
return s;
|
|
@@ -1013,7 +1017,7 @@ function writeFile(e, t) {
|
|
|
1013
1017
|
}));
|
|
1014
1018
|
}
|
|
1015
1019
|
|
|
1016
|
-
async function compareScreenshot(e, t, r, s, n,
|
|
1020
|
+
async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
1017
1021
|
const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
|
|
1018
1022
|
await async function u(e, t) {
|
|
1019
1023
|
await function r(e) {
|
|
@@ -1021,7 +1025,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1021
1025
|
fs__default.default.access(e, (e => t(!e)));
|
|
1022
1026
|
}));
|
|
1023
1027
|
}(e) || await writeFile(e, t);
|
|
1024
|
-
}(c, r), r = null,
|
|
1028
|
+
}(c, r), r = null, i && (i = normalizePath(path$2.relative(t.rootDir, i)));
|
|
1025
1029
|
const d = function h(e, t) {
|
|
1026
1030
|
if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
|
|
1027
1031
|
const r = crypto$3.createHash("md5");
|
|
@@ -1034,9 +1038,9 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1034
1038
|
device: e.device,
|
|
1035
1039
|
userAgent: e.userAgent,
|
|
1036
1040
|
desc: s,
|
|
1037
|
-
testPath:
|
|
1041
|
+
testPath: i,
|
|
1038
1042
|
width: n,
|
|
1039
|
-
height:
|
|
1043
|
+
height: o,
|
|
1040
1044
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1041
1045
|
hasTouch: e.viewport.hasTouch,
|
|
1042
1046
|
isLandscape: e.viewport.isLandscape,
|
|
@@ -1050,14 +1054,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1050
1054
|
device: e.device,
|
|
1051
1055
|
userAgent: e.userAgent,
|
|
1052
1056
|
width: n,
|
|
1053
|
-
height:
|
|
1057
|
+
height: o,
|
|
1054
1058
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1055
1059
|
hasTouch: e.viewport.hasTouch,
|
|
1056
1060
|
isLandscape: e.viewport.isLandscape,
|
|
1057
1061
|
isMobile: e.viewport.isMobile,
|
|
1058
1062
|
allowableMismatchedPixels: t.allowableMismatchedPixels,
|
|
1059
1063
|
allowableMismatchedRatio: t.allowableMismatchedRatio,
|
|
1060
|
-
testPath:
|
|
1064
|
+
testPath: i
|
|
1061
1065
|
}
|
|
1062
1066
|
};
|
|
1063
1067
|
if (t.updateMaster) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
|
|
@@ -1079,7 +1083,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1079
1083
|
};
|
|
1080
1084
|
p.diff.mismatchedPixels = await async function g(e, t) {
|
|
1081
1085
|
return new Promise(((r, s) => {
|
|
1082
|
-
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL,
|
|
1086
|
+
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, o = setTimeout((() => {
|
|
1083
1087
|
s(`getMismatchedPixels timeout: ${n}ms`);
|
|
1084
1088
|
}), n);
|
|
1085
1089
|
try {
|
|
@@ -1088,14 +1092,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1088
1092
|
env: process.env,
|
|
1089
1093
|
cwd: process.cwd(),
|
|
1090
1094
|
stdio: [ "pipe", "pipe", "pipe", "ipc" ]
|
|
1091
|
-
},
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
})),
|
|
1095
|
-
clearTimeout(
|
|
1096
|
-
})),
|
|
1095
|
+
}, i = child_process$2.fork(e, [], n);
|
|
1096
|
+
i.on("message", (e => {
|
|
1097
|
+
i.kill(), clearTimeout(o), r(e);
|
|
1098
|
+
})), i.on("error", (e => {
|
|
1099
|
+
clearTimeout(o), s(e);
|
|
1100
|
+
})), i.send(t);
|
|
1097
1101
|
} catch (e) {
|
|
1098
|
-
clearTimeout(
|
|
1102
|
+
clearTimeout(o), s(`getMismatchedPixels error: ${e}`);
|
|
1099
1103
|
}
|
|
1100
1104
|
}));
|
|
1101
1105
|
}(t.pixelmatchModulePath, n);
|
|
@@ -1112,9 +1116,9 @@ async function e2eGoTo(e, t, r = {}) {
|
|
|
1112
1116
|
if ("string" != typeof s) throw new Error("invalid gotoTest() browser url");
|
|
1113
1117
|
const n = s + t.substring(1);
|
|
1114
1118
|
r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1115
|
-
const
|
|
1116
|
-
if (!
|
|
1117
|
-
return await waitForStencil(e, r),
|
|
1119
|
+
const o = await e._e2eGoto(n, r);
|
|
1120
|
+
if (!o.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${o.status()}`);
|
|
1121
|
+
return await waitForStencil(e, r), o;
|
|
1118
1122
|
}
|
|
1119
1123
|
|
|
1120
1124
|
async function e2eSetContent(e, t, r = {}) {
|
|
@@ -1123,18 +1127,18 @@ async function e2eSetContent(e, t, r = {}) {
|
|
|
1123
1127
|
const s = [], n = env.__STENCIL_APP_SCRIPT_URL__;
|
|
1124
1128
|
if ("string" != typeof n) throw new Error("invalid e2eSetContent() app script url");
|
|
1125
1129
|
s.push("<!doctype html>"), s.push("<html>"), s.push("<head>");
|
|
1126
|
-
const
|
|
1127
|
-
"string" == typeof
|
|
1130
|
+
const o = env.__STENCIL_APP_STYLE_URL__;
|
|
1131
|
+
"string" == typeof o && s.push(`<link rel="stylesheet" href="${o}">`), s.push(`<script type="module" src="${n}"><\/script>`),
|
|
1128
1132
|
s.push("</head>"), s.push("<body>"), s.push(t), s.push("</body>"), s.push("</html>");
|
|
1129
|
-
const
|
|
1133
|
+
const i = env.__STENCIL_BROWSER_URL__;
|
|
1130
1134
|
await e.setRequestInterception(!0), e.on("request", (e => {
|
|
1131
|
-
|
|
1135
|
+
i === e.url() ? e.respond({
|
|
1132
1136
|
status: 200,
|
|
1133
1137
|
contentType: "text/html",
|
|
1134
1138
|
body: s.join("\n")
|
|
1135
1139
|
}) : e.continue();
|
|
1136
1140
|
})), r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1137
|
-
const a = await e._e2eGoto(
|
|
1141
|
+
const a = await e._e2eGoto(i, r);
|
|
1138
1142
|
if (!a.ok()) throw new Error("Testing unable to load content");
|
|
1139
1143
|
return await waitForStencil(e, r), a;
|
|
1140
1144
|
}
|
|
@@ -1242,8 +1246,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1242
1246
|
}, 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
1247
|
if ("string" != typeof e) throw new Error("invalid path to normalize");
|
|
1244
1248
|
e = normalizeSlashes(e.trim());
|
|
1245
|
-
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1],
|
|
1246
|
-
return "" ===
|
|
1249
|
+
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], o = s + r.slice(1).join("/");
|
|
1250
|
+
return "" === o ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + o : o;
|
|
1247
1251
|
}, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
|
|
1248
1252
|
if (!Array.isArray(e) || 0 === e.length) return [];
|
|
1249
1253
|
const t = [ e[0] ];
|
|
@@ -1280,8 +1284,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1280
1284
|
if (-1 !== r) {
|
|
1281
1285
|
const t = r + "://".length, s = e.indexOf("/", t);
|
|
1282
1286
|
if (-1 !== s) {
|
|
1283
|
-
const n = e.slice(0, r),
|
|
1284
|
-
if ("file" === n && ("" ===
|
|
1287
|
+
const n = e.slice(0, r), o = e.slice(t, s);
|
|
1288
|
+
if ("file" === n && ("" === o || "localhost" === o) && isVolumeCharacter(e.charCodeAt(s + 1))) {
|
|
1285
1289
|
const t = getFileUrlVolumeSeparatorEnd(e, s + 2);
|
|
1286
1290
|
if (-1 !== t) {
|
|
1287
1291
|
if (47 === e.charCodeAt(t)) return ~(t + 1);
|
|
@@ -1334,12 +1338,12 @@ const jestPreprocessor = {
|
|
|
1334
1338
|
currentDirectory: s.rootDir
|
|
1335
1339
|
}, n = getCompilerOptions(s.rootDir);
|
|
1336
1340
|
n && (n.baseUrl && (r.baseUrl = n.baseUrl), n.paths && (r.paths = n.paths));
|
|
1337
|
-
const
|
|
1338
|
-
if (
|
|
1339
|
-
const e =
|
|
1341
|
+
const o = transpile(e, r), i = o.diagnostics.some((e => "error" === e.level));
|
|
1342
|
+
if (o.diagnostics && i) {
|
|
1343
|
+
const e = o.diagnostics.map(formatDiagnostic).join("\n\n");
|
|
1340
1344
|
throw new Error(e);
|
|
1341
1345
|
}
|
|
1342
|
-
return
|
|
1346
|
+
return o.code;
|
|
1343
1347
|
}
|
|
1344
1348
|
return e;
|
|
1345
1349
|
},
|
|
@@ -1354,10 +1358,10 @@ const jestPreprocessor = {
|
|
|
1354
1358
|
if (t === r) return !0;
|
|
1355
1359
|
if (t && r && "object" == typeof t && "object" == typeof r) {
|
|
1356
1360
|
const s = Array.isArray(t), n = Array.isArray(r);
|
|
1357
|
-
let
|
|
1361
|
+
let o, i, a;
|
|
1358
1362
|
if (s && n) {
|
|
1359
|
-
if (
|
|
1360
|
-
for (
|
|
1363
|
+
if (i = t.length, i != r.length) return !1;
|
|
1364
|
+
for (o = i; 0 != o--; ) if (!e(t[o], r[o])) return !1;
|
|
1361
1365
|
return !0;
|
|
1362
1366
|
}
|
|
1363
1367
|
if (s != n) return !1;
|
|
@@ -1368,9 +1372,9 @@ const jestPreprocessor = {
|
|
|
1368
1372
|
if (u != d) return !1;
|
|
1369
1373
|
if (u && d) return t.toString() == r.toString();
|
|
1370
1374
|
const h = Object.keys(t);
|
|
1371
|
-
if (
|
|
1372
|
-
for (
|
|
1373
|
-
for (
|
|
1375
|
+
if (i = h.length, i !== Object.keys(r).length) return !1;
|
|
1376
|
+
for (o = i; 0 != o--; ) if (!Object.prototype.hasOwnProperty.call(r, h[o])) return !1;
|
|
1377
|
+
for (o = i; 0 != o--; ) if (a = h[o], !e(t[a], r[a])) return !1;
|
|
1374
1378
|
return !0;
|
|
1375
1379
|
}
|
|
1376
1380
|
return t != t && r != r;
|
|
@@ -1768,9 +1772,9 @@ class BuildContext {
|
|
|
1768
1772
|
}
|
|
1769
1773
|
return {
|
|
1770
1774
|
duration: () => r.duration(),
|
|
1771
|
-
finish: (e, s, n,
|
|
1775
|
+
finish: (e, s, n, o) => {
|
|
1772
1776
|
if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
|
|
1773
|
-
r.finish(e, s, n,
|
|
1777
|
+
r.finish(e, s, n, o), !t)) {
|
|
1774
1778
|
const e = {
|
|
1775
1779
|
buildId: this.buildId,
|
|
1776
1780
|
messages: this.buildMessages.slice(),
|
|
@@ -1886,12 +1890,12 @@ class Cache {
|
|
|
1886
1890
|
if (null != t) {
|
|
1887
1891
|
if (e - t < ONE_DAY) return;
|
|
1888
1892
|
const r = this.cacheFs.sys, s = await r.readDir(this.config.cacheDir), n = s.map((e => path$2.join(this.config.cacheDir, e)));
|
|
1889
|
-
let
|
|
1890
|
-
const
|
|
1893
|
+
let o = 0;
|
|
1894
|
+
const i = n.map((async t => {
|
|
1891
1895
|
const s = (await r.stat(t)).mtimeMs;
|
|
1892
|
-
e - s > ONE_WEEK && (await r.removeFile(t),
|
|
1896
|
+
e - s > ONE_WEEK && (await r.removeFile(t), o++);
|
|
1893
1897
|
}));
|
|
1894
|
-
await Promise.all(
|
|
1898
|
+
await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${o}`);
|
|
1895
1899
|
}
|
|
1896
1900
|
this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
|
|
1897
1901
|
}
|
|
@@ -1933,10 +1937,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1933
1937
|
} 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) {
|
|
1934
1938
|
const s = r, n = e.queueCopyFileToDest;
|
|
1935
1939
|
t.filesToCopy.push([ s, n ]);
|
|
1936
|
-
const
|
|
1937
|
-
t.dirsToEnsure.includes(
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1940
|
+
const o = normalizePath(path$2.dirname(n));
|
|
1941
|
+
t.dirsToEnsure.includes(o) || t.dirsToEnsure.push(o);
|
|
1942
|
+
const i = t.dirsToDelete.indexOf(o);
|
|
1943
|
+
i > -1 && t.dirsToDelete.splice(i, 1);
|
|
1940
1944
|
const a = t.filesToDelete.indexOf(n);
|
|
1941
1945
|
a > -1 && t.filesToDelete.splice(a, 1);
|
|
1942
1946
|
}
|
|
@@ -1969,10 +1973,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1969
1973
|
|
|
1970
1974
|
(posix = {
|
|
1971
1975
|
resolve: function e() {
|
|
1972
|
-
var t, r, s, n = "",
|
|
1973
|
-
for (r = arguments.length - 1; r >= -1 && !
|
|
1974
|
-
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n,
|
|
1975
|
-
return n = normalizeStringPosix(n, !
|
|
1976
|
+
var t, r, s, n = "", o = !1;
|
|
1977
|
+
for (r = arguments.length - 1; r >= -1 && !o; r--) r >= 0 ? s = arguments[r] : (void 0 === t && (t = process.cwd()),
|
|
1978
|
+
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n, o = 47 === s.charCodeAt(0));
|
|
1979
|
+
return n = normalizeStringPosix(n, !o), o ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
|
|
1976
1980
|
},
|
|
1977
1981
|
normalize: function e(t) {
|
|
1978
1982
|
var r, s;
|
|
@@ -1990,70 +1994,70 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1990
1994
|
return void 0 === t ? "." : posix.normalize(t);
|
|
1991
1995
|
},
|
|
1992
1996
|
relative: function e(t, r) {
|
|
1993
|
-
var s, n,
|
|
1997
|
+
var s, n, o, i, a, l, c, u, d, h;
|
|
1994
1998
|
if (assertPath(t), assertPath(r), t === r) return "";
|
|
1995
1999
|
if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
|
|
1996
2000
|
for (s = 1; s < t.length && 47 === t.charCodeAt(s); ++s) ;
|
|
1997
|
-
for (
|
|
1998
|
-
for (l =
|
|
2001
|
+
for (o = (n = t.length) - s, i = 1; i < r.length && 47 === r.charCodeAt(i); ++i) ;
|
|
2002
|
+
for (l = o < (a = r.length - i) ? o : a, c = -1, u = 0; u <= l; ++u) {
|
|
1999
2003
|
if (u === l) {
|
|
2000
2004
|
if (a > l) {
|
|
2001
|
-
if (47 === r.charCodeAt(
|
|
2002
|
-
if (0 === u) return r.slice(
|
|
2003
|
-
} else
|
|
2005
|
+
if (47 === r.charCodeAt(i + u)) return r.slice(i + u + 1);
|
|
2006
|
+
if (0 === u) return r.slice(i + u);
|
|
2007
|
+
} else o > l && (47 === t.charCodeAt(s + u) ? c = u : 0 === u && (c = 0));
|
|
2004
2008
|
break;
|
|
2005
2009
|
}
|
|
2006
|
-
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(
|
|
2010
|
+
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(i + u)) break;
|
|
2007
2011
|
47 === d && (c = u);
|
|
2008
2012
|
}
|
|
2009
2013
|
for (h = "", u = s + c + 1; u <= n; ++u) u !== n && 47 !== t.charCodeAt(u) || (0 === h.length ? h += ".." : h += "/..");
|
|
2010
|
-
return h.length > 0 ? h + r.slice(
|
|
2011
|
-
r.slice(
|
|
2014
|
+
return h.length > 0 ? h + r.slice(i + c) : (i += c, 47 === r.charCodeAt(i) && ++i,
|
|
2015
|
+
r.slice(i));
|
|
2012
2016
|
},
|
|
2013
2017
|
_makeLong: function e(t) {
|
|
2014
2018
|
return t;
|
|
2015
2019
|
},
|
|
2016
2020
|
dirname: function e(t) {
|
|
2017
|
-
var r, s, n,
|
|
2021
|
+
var r, s, n, o;
|
|
2018
2022
|
if (assertPath(t), 0 === t.length) return ".";
|
|
2019
|
-
for (r = 47 === t.charCodeAt(0), s = -1, n = !0,
|
|
2023
|
+
for (r = 47 === t.charCodeAt(0), s = -1, n = !0, o = t.length - 1; o >= 1; --o) if (47 === t.charCodeAt(o)) {
|
|
2020
2024
|
if (!n) {
|
|
2021
|
-
s =
|
|
2025
|
+
s = o;
|
|
2022
2026
|
break;
|
|
2023
2027
|
}
|
|
2024
2028
|
} else n = !1;
|
|
2025
2029
|
return -1 === s ? r ? "/" : "." : r && 1 === s ? "//" : t.slice(0, s);
|
|
2026
2030
|
},
|
|
2027
2031
|
basename: function e(t, r) {
|
|
2028
|
-
var s, n,
|
|
2032
|
+
var s, n, o, i, a, l, c;
|
|
2029
2033
|
if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
|
|
2030
|
-
if (assertPath(t), s = 0, n = -1,
|
|
2034
|
+
if (assertPath(t), s = 0, n = -1, o = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
|
|
2031
2035
|
if (r.length === t.length && r === t) return "";
|
|
2032
|
-
for (a = r.length - 1, l = -1,
|
|
2033
|
-
if (!
|
|
2034
|
-
s =
|
|
2036
|
+
for (a = r.length - 1, l = -1, i = t.length - 1; i >= 0; --i) if (47 === (c = t.charCodeAt(i))) {
|
|
2037
|
+
if (!o) {
|
|
2038
|
+
s = i + 1;
|
|
2035
2039
|
break;
|
|
2036
2040
|
}
|
|
2037
|
-
} else -1 === l && (
|
|
2041
|
+
} else -1 === l && (o = !1, l = i + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (n = i) : (a = -1,
|
|
2038
2042
|
n = l));
|
|
2039
2043
|
return s === n ? n = l : -1 === n && (n = t.length), t.slice(s, n);
|
|
2040
2044
|
}
|
|
2041
|
-
for (
|
|
2042
|
-
if (!
|
|
2043
|
-
s =
|
|
2045
|
+
for (i = t.length - 1; i >= 0; --i) if (47 === t.charCodeAt(i)) {
|
|
2046
|
+
if (!o) {
|
|
2047
|
+
s = i + 1;
|
|
2044
2048
|
break;
|
|
2045
2049
|
}
|
|
2046
|
-
} else -1 === n && (
|
|
2050
|
+
} else -1 === n && (o = !1, n = i + 1);
|
|
2047
2051
|
return -1 === n ? "" : t.slice(s, n);
|
|
2048
2052
|
},
|
|
2049
2053
|
extname: function e(t) {
|
|
2050
|
-
var r, s, n,
|
|
2051
|
-
for (assertPath(t), r = -1, s = 0, n = -1,
|
|
2052
|
-
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !==
|
|
2054
|
+
var r, s, n, o, i, a, l;
|
|
2055
|
+
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,
|
|
2056
|
+
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !== i && (i = 1) : -1 !== r && (i = -1); else if (!o) {
|
|
2053
2057
|
s = a + 1;
|
|
2054
2058
|
break;
|
|
2055
2059
|
}
|
|
2056
|
-
return -1 === r || -1 === n || 0 ===
|
|
2060
|
+
return -1 === r || -1 === n || 0 === i || 1 === i && r === n - 1 && r === s + 1 ? "" : t.slice(r, n);
|
|
2057
2061
|
},
|
|
2058
2062
|
format: function e(t) {
|
|
2059
2063
|
if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
|
|
@@ -2063,7 +2067,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2063
2067
|
}("/", t);
|
|
2064
2068
|
},
|
|
2065
2069
|
parse: function e(t) {
|
|
2066
|
-
var r, s, n,
|
|
2070
|
+
var r, s, n, o, i, a, l, c, u, d;
|
|
2067
2071
|
if (assertPath(t), r = {
|
|
2068
2072
|
root: "",
|
|
2069
2073
|
dir: "",
|
|
@@ -2071,14 +2075,14 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2071
2075
|
ext: "",
|
|
2072
2076
|
name: ""
|
|
2073
2077
|
}, 0 === t.length) return r;
|
|
2074
|
-
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/",
|
|
2075
|
-
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >=
|
|
2076
|
-
l = u + 1), 46 === s ? -1 ===
|
|
2078
|
+
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/", o = 1) : o = 0, i = -1,
|
|
2079
|
+
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,
|
|
2080
|
+
l = u + 1), 46 === s ? -1 === i ? i = u : 1 !== d && (d = 1) : -1 !== i && (d = -1); else if (!c) {
|
|
2077
2081
|
a = u + 1;
|
|
2078
2082
|
break;
|
|
2079
2083
|
}
|
|
2080
|
-
return -1 ===
|
|
2081
|
-
r.base = t.slice(1, l)) : (r.name = t.slice(a,
|
|
2084
|
+
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),
|
|
2085
|
+
r.base = t.slice(1, l)) : (r.name = t.slice(a, i), r.base = t.slice(a, l)), r.ext = t.slice(i, l)),
|
|
2082
2086
|
a > 0 ? r.dir = t.slice(0, a - 1) : n && (r.dir = "/"), r;
|
|
2083
2087
|
},
|
|
2084
2088
|
sep: "/",
|
|
@@ -2087,7 +2091,46 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2087
2091
|
posix: null
|
|
2088
2092
|
}).posix = posix, pathBrowserify = posix;
|
|
2089
2093
|
|
|
2090
|
-
const
|
|
2094
|
+
const buildEvents = () => {
|
|
2095
|
+
const e = [], t = t => {
|
|
2096
|
+
const r = e.findIndex((e => e.callback === t));
|
|
2097
|
+
return r > -1 && (e.splice(r, 1), !0);
|
|
2098
|
+
};
|
|
2099
|
+
return {
|
|
2100
|
+
emit: (t, r) => {
|
|
2101
|
+
const s = t.toLowerCase().trim(), n = e.slice();
|
|
2102
|
+
for (const e of n) if (null == e.eventName) try {
|
|
2103
|
+
e.callback(t, r);
|
|
2104
|
+
} catch (e) {
|
|
2105
|
+
console.error(e);
|
|
2106
|
+
} else if (e.eventName === s) try {
|
|
2107
|
+
e.callback(r);
|
|
2108
|
+
} catch (e) {
|
|
2109
|
+
console.error(e);
|
|
2110
|
+
}
|
|
2111
|
+
},
|
|
2112
|
+
on: (r, s) => {
|
|
2113
|
+
if ("function" == typeof r) {
|
|
2114
|
+
const s = null, n = r;
|
|
2115
|
+
return e.push({
|
|
2116
|
+
eventName: s,
|
|
2117
|
+
callback: n
|
|
2118
|
+
}), () => t(n);
|
|
2119
|
+
}
|
|
2120
|
+
if ("string" == typeof r && "function" == typeof s) {
|
|
2121
|
+
const n = r.toLowerCase().trim(), o = s;
|
|
2122
|
+
return e.push({
|
|
2123
|
+
eventName: n,
|
|
2124
|
+
callback: o
|
|
2125
|
+
}), () => t(o);
|
|
2126
|
+
}
|
|
2127
|
+
return () => !1;
|
|
2128
|
+
},
|
|
2129
|
+
unsubscribeAll: () => {
|
|
2130
|
+
e.length = 0;
|
|
2131
|
+
}
|
|
2132
|
+
};
|
|
2133
|
+
}, IS_NODE_ENV = !("undefined" == typeof global || "function" != typeof require || !global.process || "string" != typeof __filename || global.origin && "string" == typeof global.origin);
|
|
2091
2134
|
|
|
2092
2135
|
IS_NODE_ENV && process.platform;
|
|
2093
2136
|
|
|
@@ -2116,21 +2159,21 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2116
2159
|
let s = (r = normalizePath(r)).split("/").filter((e => e.length));
|
|
2117
2160
|
const n = s.lastIndexOf("node_modules");
|
|
2118
2161
|
n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
|
|
2119
|
-
let
|
|
2120
|
-
|
|
2121
|
-
const
|
|
2122
|
-
if ("@stencil/core" ===
|
|
2162
|
+
let o = s.shift();
|
|
2163
|
+
o.startsWith("@") && (o += "/" + s.shift());
|
|
2164
|
+
const i = s.join("/");
|
|
2165
|
+
if ("@stencil/core" === o) {
|
|
2123
2166
|
return ((e, t) => {
|
|
2124
2167
|
let r = (t = normalizePath(t)).split("/");
|
|
2125
2168
|
const s = r.lastIndexOf("node_modules");
|
|
2126
2169
|
return s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
|
|
2127
2170
|
t = r.join("/")), new URL("./" + t, (e => new URL("../", e).href)(e)).href;
|
|
2128
|
-
})(e.getCompilerExecutingPath(),
|
|
2171
|
+
})(e.getCompilerExecutingPath(), i);
|
|
2129
2172
|
}
|
|
2130
2173
|
return e.getRemoteModuleUrl({
|
|
2131
|
-
moduleId:
|
|
2132
|
-
version: t.get(
|
|
2133
|
-
path:
|
|
2174
|
+
moduleId: o,
|
|
2175
|
+
version: t.get(o),
|
|
2176
|
+
path: i
|
|
2134
2177
|
});
|
|
2135
2178
|
}, 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) => {
|
|
2136
2179
|
if (!((e => {
|
|
@@ -2139,11 +2182,11 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2139
2182
|
const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
|
|
2140
2183
|
return !("node_modules" !== s || !isCommonDirModuleFile(n));
|
|
2141
2184
|
})(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
|
|
2142
|
-
const
|
|
2143
|
-
if (
|
|
2144
|
-
if (
|
|
2145
|
-
const
|
|
2146
|
-
return await (async (e, t, r, s, n,
|
|
2185
|
+
const o = await ((e, t, r) => (console.trace(t), e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r)))(e, s);
|
|
2186
|
+
if (o) {
|
|
2187
|
+
if (o.ok) {
|
|
2188
|
+
const i = await o.clone().text();
|
|
2189
|
+
return await (async (e, t, r, s, n, o) => {
|
|
2147
2190
|
r.endsWith("package.json") && ((e, t) => {
|
|
2148
2191
|
try {
|
|
2149
2192
|
const r = JSON.parse(t);
|
|
@@ -2151,14 +2194,14 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2151
2194
|
e.set(t, r);
|
|
2152
2195
|
})(e, r.name, r.version);
|
|
2153
2196
|
} catch (e) {}
|
|
2154
|
-
})(
|
|
2155
|
-
let
|
|
2156
|
-
for (;"/" !==
|
|
2157
|
-
|
|
2197
|
+
})(o, n);
|
|
2198
|
+
let i = path$2.dirname(s);
|
|
2199
|
+
for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
|
|
2200
|
+
i = path$2.dirname(i);
|
|
2158
2201
|
t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
|
|
2159
|
-
})(e, t, s, n,
|
|
2202
|
+
})(e, t, s, n, i, r), i;
|
|
2160
2203
|
}
|
|
2161
|
-
404 ===
|
|
2204
|
+
404 === o.status && known404Urls.add(s);
|
|
2162
2205
|
}
|
|
2163
2206
|
} catch (e) {
|
|
2164
2207
|
console.error(e);
|
|
@@ -2181,7 +2224,7 @@ caller = function() {
|
|
|
2181
2224
|
}
|
|
2182
2225
|
}, r.exports), r.exports;
|
|
2183
2226
|
}((function(e) {
|
|
2184
|
-
var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,
|
|
2227
|
+
var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, o = {
|
|
2185
2228
|
parse: function(e) {
|
|
2186
2229
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2187
2230
|
var t = function r(e) {
|
|
@@ -2210,26 +2253,26 @@ caller = function() {
|
|
|
2210
2253
|
ext: r[4],
|
|
2211
2254
|
name: r[3]
|
|
2212
2255
|
};
|
|
2213
|
-
}, e.exports = s ?
|
|
2256
|
+
}, e.exports = s ? o.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = o.parse;
|
|
2214
2257
|
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2215
|
-
var s, n,
|
|
2216
|
-
for (/^([A-Za-z]:)/.test(t) ?
|
|
2258
|
+
var s, n, o = "/";
|
|
2259
|
+
for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"), s = [ t ],
|
|
2217
2260
|
n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
|
|
2218
2261
|
return s.reduce((function(e, t) {
|
|
2219
2262
|
return e.concat(r.map((function(e) {
|
|
2220
|
-
return path__default.default.resolve(
|
|
2263
|
+
return path__default.default.resolve(o, t, e);
|
|
2221
2264
|
})));
|
|
2222
2265
|
}), []);
|
|
2223
2266
|
}, nodeModulesPaths = function e(t, r, s) {
|
|
2224
|
-
var n,
|
|
2267
|
+
var n, o = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
|
|
2225
2268
|
return r && "function" == typeof r.paths ? r.paths(s, t, (function() {
|
|
2226
|
-
return getNodeModulesDirs(t,
|
|
2227
|
-
}), r) : (n = getNodeModulesDirs(t,
|
|
2269
|
+
return getNodeModulesDirs(t, o);
|
|
2270
|
+
}), r) : (n = getNodeModulesDirs(t, o), r && r.paths ? n.concat(r.paths) : n);
|
|
2228
2271
|
}, normalizeOptions = function(e, t) {
|
|
2229
2272
|
return t || {};
|
|
2230
2273
|
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2231
2274
|
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2232
|
-
var r, s, n,
|
|
2275
|
+
var r, s, n, o, i, a, l, c = this;
|
|
2233
2276
|
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2234
2277
|
for (r = slice.call(arguments, 1), n = function() {
|
|
2235
2278
|
if (this instanceof s) {
|
|
@@ -2237,8 +2280,8 @@ toStr = Object.prototype.toString, implementation = function e(t) {
|
|
|
2237
2280
|
return Object(e) === e ? e : this;
|
|
2238
2281
|
}
|
|
2239
2282
|
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2240
|
-
},
|
|
2241
|
-
return s = Function("binder", "return function (" +
|
|
2283
|
+
}, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
|
|
2284
|
+
return s = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this,arguments); }")(n),
|
|
2242
2285
|
c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
|
|
2243
2286
|
l.prototype = null), s;
|
|
2244
2287
|
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
@@ -2363,13 +2406,13 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2363
2406
|
}
|
|
2364
2407
|
}));
|
|
2365
2408
|
}, getPackageCandidates$1 = function e(t, r, s) {
|
|
2366
|
-
var n,
|
|
2367
|
-
for (n = 0; n <
|
|
2368
|
-
return
|
|
2409
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2410
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2411
|
+
return o;
|
|
2369
2412
|
}, async = function e(t, r, s) {
|
|
2370
2413
|
function n(e) {
|
|
2371
2414
|
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) T = path__default.default.resolve(e, t),
|
|
2372
|
-
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package,
|
|
2415
|
+
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package, o) : i(T, C.package, o); else {
|
|
2373
2416
|
if (_ && isCoreModule(t)) return S(null, t);
|
|
2374
2417
|
!function r(e, t, s) {
|
|
2375
2418
|
var n = function() {
|
|
@@ -2387,7 +2430,7 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2387
2430
|
}));
|
|
2388
2431
|
}
|
|
2389
2432
|
}
|
|
2390
|
-
function
|
|
2433
|
+
function o(e, r, s) {
|
|
2391
2434
|
e ? S(e) : r ? S(null, r, s) : l(T, (function(e, r, s) {
|
|
2392
2435
|
if (e) S(e); else if (r) maybeRealpath(f, r, C, (function(e, t) {
|
|
2393
2436
|
e ? S(e) : S(null, t, s);
|
|
@@ -2397,20 +2440,20 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2397
2440
|
}
|
|
2398
2441
|
}));
|
|
2399
2442
|
}
|
|
2400
|
-
function
|
|
2443
|
+
function i(e, t, r) {
|
|
2401
2444
|
var s = t, n = r;
|
|
2402
2445
|
"function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
|
|
2403
|
-
function
|
|
2446
|
+
function o(s, o, a) {
|
|
2404
2447
|
var u, h, p;
|
|
2405
|
-
return c =
|
|
2406
|
-
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l,
|
|
2448
|
+
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),
|
|
2449
|
+
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
|
|
2407
2450
|
}
|
|
2408
|
-
function
|
|
2409
|
-
return s ? n(s) :
|
|
2451
|
+
function i(s, o) {
|
|
2452
|
+
return s ? n(s) : o ? n(null, l, c) : void e(t.slice(1), r, c);
|
|
2410
2453
|
}
|
|
2411
2454
|
var l, c;
|
|
2412
2455
|
if (0 === t.length) return n(null, void 0, s);
|
|
2413
|
-
l = r + t[0], (c = s) ?
|
|
2456
|
+
l = r + t[0], (c = s) ? o(null, c) : a(path__default.default.dirname(l), o);
|
|
2414
2457
|
}([ "" ].concat(w), e, s);
|
|
2415
2458
|
}
|
|
2416
2459
|
function a(e, t) {
|
|
@@ -2421,8 +2464,8 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2421
2464
|
if (!s) return a(path__default.default.dirname(e), t);
|
|
2422
2465
|
m(p, n, (function(r, s) {
|
|
2423
2466
|
r && t(r);
|
|
2424
|
-
var
|
|
2425
|
-
|
|
2467
|
+
var o = s;
|
|
2468
|
+
o && C.packageFilter && (o = C.packageFilter(o, n)), t(null, o, e);
|
|
2426
2469
|
}));
|
|
2427
2470
|
}));
|
|
2428
2471
|
}));
|
|
@@ -2431,31 +2474,31 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2431
2474
|
var s = r, n = t;
|
|
2432
2475
|
"function" == typeof n && (s = n, n = C.package), maybeRealpath(f, e, C, (function(t, r) {
|
|
2433
2476
|
if (t) return s(t);
|
|
2434
|
-
var
|
|
2435
|
-
d(
|
|
2436
|
-
return t ? s(t) : r ? void m(p,
|
|
2477
|
+
var o = path__default.default.join(r, "package.json");
|
|
2478
|
+
d(o, (function(t, r) {
|
|
2479
|
+
return t ? s(t) : r ? void m(p, o, (function(t, r) {
|
|
2437
2480
|
var n, a;
|
|
2438
|
-
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n,
|
|
2439
|
-
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void
|
|
2481
|
+
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",
|
|
2482
|
+
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void i(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2440
2483
|
return t ? s(t) : r ? s(null, r, n) : n ? void l(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2441
|
-
return t ? s(t) : r ? s(null, r, n) : void
|
|
2442
|
-
})) :
|
|
2443
|
-
}))) : void
|
|
2444
|
-
})) :
|
|
2484
|
+
return t ? s(t) : r ? s(null, r, n) : void i(path__default.default.join(e, "index"), n, s);
|
|
2485
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2486
|
+
}))) : void i(path__default.default.join(e, "/index"), n, s));
|
|
2487
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2445
2488
|
}));
|
|
2446
2489
|
}));
|
|
2447
2490
|
}
|
|
2448
2491
|
function c(e, t) {
|
|
2449
|
-
function r(t, r,
|
|
2450
|
-
return t ? e(t) : r ? e(null, r,
|
|
2492
|
+
function r(t, r, o) {
|
|
2493
|
+
return t ? e(t) : r ? e(null, r, o) : void l(n, C.package, s);
|
|
2451
2494
|
}
|
|
2452
2495
|
function s(r, s, n) {
|
|
2453
2496
|
return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
|
|
2454
2497
|
}
|
|
2455
2498
|
if (0 === t.length) return e(null, void 0);
|
|
2456
2499
|
var n = t[0];
|
|
2457
|
-
h(path__default.default.dirname(n), (function
|
|
2458
|
-
return s ? e(s) : a ? void
|
|
2500
|
+
h(path__default.default.dirname(n), (function o(s, a) {
|
|
2501
|
+
return s ? e(s) : a ? void i(n, C.package, r) : c(e, t.slice(1));
|
|
2459
2502
|
}));
|
|
2460
2503
|
}
|
|
2461
2504
|
var u, d, h, p, f, m, g, y, w, _, v, b, E, T, S = s, C = r;
|
|
@@ -2595,64 +2638,64 @@ defaultIsFile = function e(t) {
|
|
|
2595
2638
|
return JSON.parse(s);
|
|
2596
2639
|
} catch (e) {}
|
|
2597
2640
|
}, getPackageCandidates = function e(t, r, s) {
|
|
2598
|
-
var n,
|
|
2599
|
-
for (n = 0; n <
|
|
2600
|
-
return
|
|
2641
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2642
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2643
|
+
return o;
|
|
2601
2644
|
}, sync = function e(t, r) {
|
|
2602
2645
|
function s(e) {
|
|
2603
|
-
var t, r, s,
|
|
2604
|
-
if (l && l.dir && l.pkg &&
|
|
2605
|
-
(r =
|
|
2646
|
+
var t, r, s, o, l = n(path__default.default.dirname(e));
|
|
2647
|
+
if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2648
|
+
(r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2606
2649
|
a(e)) return e;
|
|
2607
|
-
for (s = 0; s < p.length; s++) if (
|
|
2650
|
+
for (s = 0; s < p.length; s++) if (o = e + p[s], a(o)) return o;
|
|
2608
2651
|
}
|
|
2609
2652
|
function n(e) {
|
|
2610
2653
|
var t, r;
|
|
2611
|
-
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e,
|
|
2612
|
-
a(t) ? ((r = d(l, t)) &&
|
|
2654
|
+
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"),
|
|
2655
|
+
a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
|
|
2613
2656
|
pkg: r,
|
|
2614
2657
|
dir: e
|
|
2615
2658
|
}) : n(path__default.default.dirname(e));
|
|
2616
2659
|
}
|
|
2617
|
-
function
|
|
2618
|
-
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e,
|
|
2660
|
+
function o(e) {
|
|
2661
|
+
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
|
|
2619
2662
|
if (a(h)) {
|
|
2620
2663
|
try {
|
|
2621
2664
|
t = d(l, h);
|
|
2622
2665
|
} catch (e) {}
|
|
2623
|
-
if (t &&
|
|
2666
|
+
if (t && i.packageFilter && (t = i.packageFilter(t, e)), t && t.main) {
|
|
2624
2667
|
if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2625
2668
|
r;
|
|
2626
2669
|
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2627
2670
|
try {
|
|
2628
2671
|
if (n = s(path__default.default.resolve(e, t.main))) return n;
|
|
2629
|
-
if (c =
|
|
2672
|
+
if (c = o(path__default.default.resolve(e, t.main))) return c;
|
|
2630
2673
|
} catch (e) {}
|
|
2631
2674
|
}
|
|
2632
2675
|
}
|
|
2633
2676
|
return s(path__default.default.join(e, "/index"));
|
|
2634
2677
|
}
|
|
2635
|
-
var
|
|
2678
|
+
var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
|
|
2636
2679
|
if ("string" != typeof t) throw new TypeError("Path must be a string.");
|
|
2637
|
-
if (
|
|
2638
|
-
c =
|
|
2639
|
-
|
|
2640
|
-
if (h =
|
|
2641
|
-
m =
|
|
2642
|
-
y = maybeRealpathSync(u, path__default.default.resolve(m),
|
|
2680
|
+
if (i = normalizeOptions(0, r), a = i.isFile || defaultIsFile, l = i.readFileSync || fs__default.default.readFileSync,
|
|
2681
|
+
c = i.isDirectory || defaultIsDir, u = i.realpathSync || defaultRealpathSync, d = i.readPackageSync || defaultReadPackageSync,
|
|
2682
|
+
i.readFileSync && i.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
2683
|
+
if (h = i.packageIterator, p = i.extensions || [ ".js" ], f = !1 !== i.includeCoreModules,
|
|
2684
|
+
m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || [],
|
|
2685
|
+
y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2643
2686
|
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2644
|
-
_ = s(w) ||
|
|
2687
|
+
_ = s(w) || o(w)) return maybeRealpathSync(u, _, i);
|
|
2645
2688
|
} else {
|
|
2646
2689
|
if (f && isCoreModule(t)) return t;
|
|
2647
2690
|
if (v = function E(e, t) {
|
|
2648
2691
|
var r, n, a, l, u = function() {
|
|
2649
|
-
return getPackageCandidates(e, t,
|
|
2650
|
-
}, d = h ? h(e, t, u,
|
|
2692
|
+
return getPackageCandidates(e, t, i);
|
|
2693
|
+
}, d = h ? h(e, t, u, i) : u();
|
|
2651
2694
|
for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
|
|
2652
2695
|
if (a = s(n)) return a;
|
|
2653
|
-
if (l =
|
|
2696
|
+
if (l = o(n)) return l;
|
|
2654
2697
|
}
|
|
2655
|
-
}(t, y)) return maybeRealpathSync(u, v,
|
|
2698
|
+
}(t, y)) return maybeRealpathSync(u, v, i);
|
|
2656
2699
|
}
|
|
2657
2700
|
throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
|
|
2658
2701
|
b;
|
|
@@ -2689,8 +2732,8 @@ const createSystem = e => {
|
|
|
2689
2732
|
let r = BLUE, s = "Build", n = "";
|
|
2690
2733
|
"error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
|
|
2691
2734
|
s = "Warning"), e.header && (s = e.header);
|
|
2692
|
-
const
|
|
2693
|
-
if (
|
|
2735
|
+
const o = e.relFilePath || e.absFilePath;
|
|
2736
|
+
if (o && (n += o, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
|
|
2694
2737
|
"number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
|
|
2695
2738
|
n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
|
|
2696
2739
|
n += "\n" + e.lineNumber + ": " + e.text;
|
|
@@ -2701,46 +2744,7 @@ const createSystem = e => {
|
|
|
2701
2744
|
})(t, e)));
|
|
2702
2745
|
}
|
|
2703
2746
|
};
|
|
2704
|
-
})(), r = new Map, s = new Set, n = e => s.add(e),
|
|
2705
|
-
const e = [], t = t => {
|
|
2706
|
-
const r = e.findIndex((e => e.callback === t));
|
|
2707
|
-
return r > -1 && (e.splice(r, 1), !0);
|
|
2708
|
-
};
|
|
2709
|
-
return {
|
|
2710
|
-
emit: (t, r) => {
|
|
2711
|
-
const s = t.toLowerCase().trim(), n = e.slice();
|
|
2712
|
-
for (const e of n) if (null == e.eventName) try {
|
|
2713
|
-
e.callback(t, r);
|
|
2714
|
-
} catch (e) {
|
|
2715
|
-
console.error(e);
|
|
2716
|
-
} else if (e.eventName === s) try {
|
|
2717
|
-
e.callback(r);
|
|
2718
|
-
} catch (e) {
|
|
2719
|
-
console.error(e);
|
|
2720
|
-
}
|
|
2721
|
-
},
|
|
2722
|
-
on: (r, s) => {
|
|
2723
|
-
if ("function" == typeof r) {
|
|
2724
|
-
const s = null, n = r;
|
|
2725
|
-
return e.push({
|
|
2726
|
-
eventName: s,
|
|
2727
|
-
callback: n
|
|
2728
|
-
}), () => t(n);
|
|
2729
|
-
}
|
|
2730
|
-
if ("string" == typeof r && "function" == typeof s) {
|
|
2731
|
-
const n = r.toLowerCase().trim(), i = s;
|
|
2732
|
-
return e.push({
|
|
2733
|
-
eventName: n,
|
|
2734
|
-
callback: i
|
|
2735
|
-
}), () => t(i);
|
|
2736
|
-
}
|
|
2737
|
-
return () => !1;
|
|
2738
|
-
},
|
|
2739
|
-
unsubscribeAll: () => {
|
|
2740
|
-
e.length = 0;
|
|
2741
|
-
}
|
|
2742
|
-
};
|
|
2743
|
-
})(), a = IS_BROWSER_ENV && navigator.hardwareConcurrency || 1, l = e => {
|
|
2747
|
+
})(), r = new Map, s = new Set, n = e => s.add(e), o = e => s.delete(e), i = buildEvents(), a = IS_BROWSER_ENV && navigator.hardwareConcurrency || 1, l = e => {
|
|
2744
2748
|
if ("/" === e || "" === e) return "/";
|
|
2745
2749
|
const t = path$2.dirname(e), r = path$2.basename(e);
|
|
2746
2750
|
return t.endsWith("/") ? normalizePath(`${t}${r}`) : normalizePath(`${t}/${r}`);
|
|
@@ -2760,8 +2764,8 @@ const createSystem = e => {
|
|
|
2760
2764
|
}, d = (e, t, s) => {
|
|
2761
2765
|
const n = path$2.dirname(e);
|
|
2762
2766
|
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && d(n, t, s);
|
|
2763
|
-
const
|
|
2764
|
-
|
|
2767
|
+
const o = r.get(e);
|
|
2768
|
+
o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
|
|
2765
2769
|
basename: path$2.basename(e),
|
|
2766
2770
|
dirname: n,
|
|
2767
2771
|
isDirectory: !0,
|
|
@@ -2785,10 +2789,10 @@ const createSystem = e => {
|
|
|
2785
2789
|
}), m = (e, t, s) => {
|
|
2786
2790
|
const n = w(e);
|
|
2787
2791
|
if (!n.error && !s.error) if (n.isFile) {
|
|
2788
|
-
const n = path$2.dirname(t),
|
|
2792
|
+
const n = path$2.dirname(t), o = u(n, {
|
|
2789
2793
|
recursive: !0
|
|
2790
|
-
}),
|
|
2791
|
-
s.newDirs.push(...
|
|
2794
|
+
}), i = r.get(e).data, a = b(t, i);
|
|
2795
|
+
s.newDirs.push(...o.newDirs), s.renamed.push({
|
|
2792
2796
|
oldPath: e,
|
|
2793
2797
|
newPath: t,
|
|
2794
2798
|
isDirectory: !1,
|
|
@@ -2886,8 +2890,8 @@ const createSystem = e => {
|
|
|
2886
2890
|
u("/");
|
|
2887
2891
|
const S = {
|
|
2888
2892
|
name: "in-memory",
|
|
2889
|
-
version: "2.
|
|
2890
|
-
events:
|
|
2893
|
+
version: "2.17.0",
|
|
2894
|
+
events: i,
|
|
2891
2895
|
access: async e => c(e),
|
|
2892
2896
|
accessSync: c,
|
|
2893
2897
|
addDestory: n,
|
|
@@ -2934,7 +2938,7 @@ const createSystem = e => {
|
|
|
2934
2938
|
readFileSync: p,
|
|
2935
2939
|
realpath: async e => f(e),
|
|
2936
2940
|
realpathSync: f,
|
|
2937
|
-
removeDestory:
|
|
2941
|
+
removeDestory: o,
|
|
2938
2942
|
rename: async (e, t) => {
|
|
2939
2943
|
const r = {
|
|
2940
2944
|
oldPath: e = normalizePath(e),
|
|
@@ -2971,14 +2975,14 @@ const createSystem = e => {
|
|
|
2971
2975
|
removeFileSync: _,
|
|
2972
2976
|
watchDirectory: (e, t) => {
|
|
2973
2977
|
e = l(e);
|
|
2974
|
-
const s = r.get(e),
|
|
2978
|
+
const s = r.get(e), i = () => {
|
|
2975
2979
|
const s = r.get(e);
|
|
2976
2980
|
if (s && s.watcherCallbacks) {
|
|
2977
2981
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2978
2982
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2979
2983
|
}
|
|
2980
2984
|
};
|
|
2981
|
-
return n(
|
|
2985
|
+
return n(i), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2982
2986
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2983
2987
|
basename: path$2.basename(e),
|
|
2984
2988
|
dirname: path$2.dirname(e),
|
|
@@ -2988,20 +2992,20 @@ const createSystem = e => {
|
|
|
2988
2992
|
data: void 0
|
|
2989
2993
|
}), {
|
|
2990
2994
|
close() {
|
|
2991
|
-
i
|
|
2995
|
+
o(i), i();
|
|
2992
2996
|
}
|
|
2993
2997
|
};
|
|
2994
2998
|
},
|
|
2995
2999
|
watchFile: (e, t) => {
|
|
2996
3000
|
e = l(e);
|
|
2997
|
-
const s = r.get(e),
|
|
3001
|
+
const s = r.get(e), i = () => {
|
|
2998
3002
|
const s = r.get(e);
|
|
2999
3003
|
if (s && s.watcherCallbacks) {
|
|
3000
3004
|
const e = s.watcherCallbacks.indexOf(t);
|
|
3001
3005
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
3002
3006
|
}
|
|
3003
3007
|
};
|
|
3004
|
-
return n(
|
|
3008
|
+
return n(i), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
3005
3009
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
3006
3010
|
basename: path$2.basename(e),
|
|
3007
3011
|
dirname: path$2.dirname(e),
|
|
@@ -3011,7 +3015,7 @@ const createSystem = e => {
|
|
|
3011
3015
|
data: void 0
|
|
3012
3016
|
}), {
|
|
3013
3017
|
close() {
|
|
3014
|
-
i
|
|
3018
|
+
o(i), i();
|
|
3015
3019
|
}
|
|
3016
3020
|
};
|
|
3017
3021
|
},
|
|
@@ -3024,18 +3028,18 @@ const createSystem = e => {
|
|
|
3024
3028
|
return "number" == typeof t && (s = s.slice(0, t)), s;
|
|
3025
3029
|
},
|
|
3026
3030
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
3027
|
-
let r, s = 0, n = !1,
|
|
3031
|
+
let r, s = 0, n = !1, o = !1, i = 0;
|
|
3028
3032
|
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 = () => {
|
|
3029
3033
|
let t = null;
|
|
3030
|
-
const s = e.getCompilerExecutingPath(),
|
|
3031
|
-
name: "stencil.worker." +
|
|
3034
|
+
const s = e.getCompilerExecutingPath(), o = {
|
|
3035
|
+
name: "stencil.worker." + i++
|
|
3032
3036
|
};
|
|
3033
3037
|
try {
|
|
3034
|
-
t = new Worker(s,
|
|
3038
|
+
t = new Worker(s, o);
|
|
3035
3039
|
} catch (e) {
|
|
3036
3040
|
null == r && (r = new Blob([ `importScripts('${s}');` ], {
|
|
3037
3041
|
type: "application/javascript"
|
|
3038
|
-
})), t = new Worker(URL.createObjectURL(r),
|
|
3042
|
+
})), t = new Worker(URL.createObjectURL(r), o);
|
|
3039
3043
|
}
|
|
3040
3044
|
const l = {
|
|
3041
3045
|
worker: t,
|
|
@@ -3064,7 +3068,7 @@ const createSystem = e => {
|
|
|
3064
3068
|
} else t = p(), c.push(t);
|
|
3065
3069
|
t.activeTasks++, t.sendQueue.push(e);
|
|
3066
3070
|
}, g = () => {
|
|
3067
|
-
|
|
3071
|
+
o = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
3068
3072
|
}, y = (...e) => new Promise(((t, r) => {
|
|
3069
3073
|
if (n) r("task canceled"); else {
|
|
3070
3074
|
const n = {
|
|
@@ -3074,7 +3078,7 @@ const createSystem = e => {
|
|
|
3074
3078
|
l.push(n), a.set(n.stencilId, {
|
|
3075
3079
|
resolve: t,
|
|
3076
3080
|
reject: r
|
|
3077
|
-
}),
|
|
3081
|
+
}), o || (o = !0, d.then(g));
|
|
3078
3082
|
}
|
|
3079
3083
|
}));
|
|
3080
3084
|
return {
|
|
@@ -3105,11 +3109,11 @@ const createSystem = e => {
|
|
|
3105
3109
|
return S.resolveModuleId = e => ((e, t, r) => {
|
|
3106
3110
|
const s = ((e, t, r) => ({
|
|
3107
3111
|
async isFile(s, n) {
|
|
3108
|
-
const
|
|
3109
|
-
if ((await t.stat(
|
|
3110
|
-
if (shouldFetchModule(
|
|
3111
|
-
const r = getNodeModuleFetchUrl(e, packageVersions,
|
|
3112
|
-
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r,
|
|
3112
|
+
const o = normalizeFsPath(s);
|
|
3113
|
+
if ((await t.stat(o)).isFile) n(null, !0); else {
|
|
3114
|
+
if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
|
|
3115
|
+
const r = getNodeModuleFetchUrl(e, packageVersions, o);
|
|
3116
|
+
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
|
|
3113
3117
|
}
|
|
3114
3118
|
n(null, !1);
|
|
3115
3119
|
}
|
|
@@ -3122,7 +3126,7 @@ const createSystem = e => {
|
|
|
3122
3126
|
void s(null, !0);
|
|
3123
3127
|
if (isCommonDirModuleFile(n)) return void s(null, !1);
|
|
3124
3128
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
3125
|
-
const
|
|
3129
|
+
const o = getCommonDirUrl(e, packageVersions, n, r), i = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, o, i);
|
|
3126
3130
|
if (isString(a)) return void s(null, !0);
|
|
3127
3131
|
}
|
|
3128
3132
|
}
|
|
@@ -3141,13 +3145,13 @@ const createSystem = e => {
|
|
|
3141
3145
|
}))(e, null, r.exts);
|
|
3142
3146
|
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"),
|
|
3143
3147
|
e)), new Promise(((e, t) => {
|
|
3144
|
-
resolve(r.moduleId, s, ((s, n,
|
|
3148
|
+
resolve(r.moduleId, s, ((s, n, o) => {
|
|
3145
3149
|
if (s) t(s); else {
|
|
3146
3150
|
n = normalizePath(n);
|
|
3147
3151
|
const t = {
|
|
3148
3152
|
moduleId: r.moduleId,
|
|
3149
3153
|
resolveId: n,
|
|
3150
|
-
pkgData:
|
|
3154
|
+
pkgData: o,
|
|
3151
3155
|
pkgDirPath: getPackageDirPath(n, r.moduleId)
|
|
3152
3156
|
};
|
|
3153
3157
|
e(t);
|
|
@@ -3174,7 +3178,8 @@ const createSystem = e => {
|
|
|
3174
3178
|
r.readDirSync = s(r.readDirSync), r.stat = s(r.stat), r.statSync = s(r.statSync),
|
|
3175
3179
|
r.copyFile = n(r.copyFile), r.createDir = n(r.createDir), r.createDirSync = n(r.createDirSync),
|
|
3176
3180
|
r.removeFile = n(r.removeFile), r.removeFileSync = n(r.removeFileSync), r.writeFile = n(r.writeFile),
|
|
3177
|
-
r.writeFileSync = n(r.writeFileSync),
|
|
3181
|
+
r.writeFileSync = n(r.writeFileSync), r.getCompilerExecutingPath = () => "bin/stencil.js",
|
|
3182
|
+
Object.defineProperties(r, {
|
|
3178
3183
|
diskReads: {
|
|
3179
3184
|
get: () => e,
|
|
3180
3185
|
set(t) {
|
|
@@ -3187,7 +3192,7 @@ const createSystem = e => {
|
|
|
3187
3192
|
t = e;
|
|
3188
3193
|
}
|
|
3189
3194
|
}
|
|
3190
|
-
}), !function
|
|
3195
|
+
}), !function o(e) {
|
|
3191
3196
|
return "diskReads" in e && "diskWrites" in e;
|
|
3192
3197
|
}(r)) throw new Error("could not generate TestingSystem");
|
|
3193
3198
|
return r;
|
|
@@ -3359,8 +3364,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3359
3364
|
waitForVisible() {
|
|
3360
3365
|
return new Promise(((e, t) => {
|
|
3361
3366
|
const r = setInterval((async () => {
|
|
3362
|
-
await this.isVisible() && (clearInterval(r), clearTimeout(
|
|
3363
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`),
|
|
3367
|
+
await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
|
|
3368
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3364
3369
|
clearTimeout(r), t(n);
|
|
3365
3370
|
}), s);
|
|
3366
3371
|
}));
|
|
@@ -3368,8 +3373,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3368
3373
|
waitForNotVisible() {
|
|
3369
3374
|
return new Promise(((e, t) => {
|
|
3370
3375
|
const r = setInterval((async () => {
|
|
3371
|
-
await this.isVisible() || (clearInterval(r), clearTimeout(
|
|
3372
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`),
|
|
3376
|
+
await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
|
|
3377
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3373
3378
|
clearTimeout(r), t(n);
|
|
3374
3379
|
}), s);
|
|
3375
3380
|
}));
|
|
@@ -3628,15 +3633,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3628
3633
|
var e;
|
|
3629
3634
|
const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
|
|
3630
3635
|
return class r extends t {
|
|
3631
|
-
async runTests(e, t, r, s, n,
|
|
3632
|
-
const
|
|
3636
|
+
async runTests(e, t, r, s, n, o) {
|
|
3637
|
+
const i = process.env;
|
|
3633
3638
|
if (e = e.filter((e => function t(e, r) {
|
|
3634
3639
|
const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
|
|
3635
3640
|
return !("true" !== r.__STENCIL_E2E_TESTS__ || !s) || "true" === r.__STENCIL_SPEC_TESTS__ && !s;
|
|
3636
|
-
}(e.path,
|
|
3637
|
-
const a = JSON.parse(
|
|
3638
|
-
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l],
|
|
3639
|
-
} else await super.runTests(e, t, r, s, n,
|
|
3641
|
+
}(e.path, i))), "true" === i.__STENCIL_SCREENSHOT__) {
|
|
3642
|
+
const a = JSON.parse(i.__STENCIL_EMULATE_CONFIGS__);
|
|
3643
|
+
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r, s, n, o);
|
|
3644
|
+
} else await super.runTests(e, t, r, s, n, o);
|
|
3640
3645
|
}
|
|
3641
3646
|
};
|
|
3642
3647
|
}, exports.createTesting = async e => {
|
|
@@ -3648,14 +3653,14 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3648
3653
|
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3649
3654
|
}(e);
|
|
3650
3655
|
const {createCompiler: r} = require("../compiler/stencil.js"), s = await r(e);
|
|
3651
|
-
let n,
|
|
3652
|
-
const
|
|
3656
|
+
let n, o;
|
|
3657
|
+
const i = async () => {
|
|
3653
3658
|
const t = [];
|
|
3654
3659
|
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), n && (n.close && t.push(n.close()),
|
|
3655
|
-
n = null),
|
|
3660
|
+
n = null), o && (o.close && t.push(o.close()), o = null), await Promise.all(t);
|
|
3656
3661
|
};
|
|
3657
3662
|
return {
|
|
3658
|
-
destroy:
|
|
3663
|
+
destroy: i,
|
|
3659
3664
|
run: async (t = {}) => {
|
|
3660
3665
|
let r, a = !1, l = !1, c = null;
|
|
3661
3666
|
const u = [];
|
|
@@ -3678,9 +3683,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3678
3683
|
})), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3679
3684
|
e.devServer.reloadStrategy = null;
|
|
3680
3685
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3681
|
-
if (n = l[0],
|
|
3686
|
+
if (n = l[0], o = l[1], t) {
|
|
3682
3687
|
const r = await t;
|
|
3683
|
-
if (!r || !e.watch && hasError(r && r.diagnostics)) return await
|
|
3688
|
+
if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
|
|
3684
3689
|
}
|
|
3685
3690
|
n && (r.__STENCIL_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__STENCIL_BROWSER_URL__}`),
|
|
3686
3691
|
r.__STENCIL_APP_SCRIPT_URL__ = function d(e, t) {
|
|
@@ -3714,13 +3719,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3714
3719
|
waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
|
|
3715
3720
|
pixelmatchModulePath: s
|
|
3716
3721
|
}), e.flags.updateScreenshot || await r.pullMasterBuild(), n.finish("screenshot, initBuild finished");
|
|
3717
|
-
const
|
|
3718
|
-
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(
|
|
3722
|
+
const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
|
|
3723
|
+
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(i, a);
|
|
3719
3724
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3720
3725
|
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3721
3726
|
try {
|
|
3722
3727
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3723
|
-
let s = await r.completeBuild(
|
|
3728
|
+
let s = await r.completeBuild(i);
|
|
3724
3729
|
if (t.finish("screenshot, completeTimespan finished"), s) {
|
|
3725
3730
|
const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
|
|
3726
3731
|
if (s = await r.publishBuild(s), t.finish("screenshot, publishBuild finished"),
|
|
@@ -3777,13 +3782,47 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3777
3782
|
}
|
|
3778
3783
|
}, exports.mockBuildCtx = function mockBuildCtx(e, t) {
|
|
3779
3784
|
return e || (e = mockConfig()), t || (t = mockCompilerCtx(e)), new BuildContext(e, t);
|
|
3780
|
-
}, exports.mockCompilerCtx = mockCompilerCtx, exports.
|
|
3785
|
+
}, exports.mockCompilerCtx = mockCompilerCtx, exports.mockCompilerSystem = function mockCompilerSystem() {
|
|
3786
|
+
return createTestingSystem();
|
|
3787
|
+
}, exports.mockConfig = mockConfig, exports.mockDocument = function mockDocument(e = null) {
|
|
3781
3788
|
return new index_cjs.MockWindow(e).document;
|
|
3782
3789
|
}, exports.mockFetch = mockFetch, exports.mockLogger = function mockLogger() {
|
|
3783
3790
|
return new TestingLogger;
|
|
3784
|
-
}, exports.
|
|
3785
|
-
|
|
3786
|
-
|
|
3791
|
+
}, exports.mockModule = (e = {}) => ({
|
|
3792
|
+
cmps: [],
|
|
3793
|
+
coreRuntimeApis: [],
|
|
3794
|
+
collectionName: "",
|
|
3795
|
+
dtsFilePath: "",
|
|
3796
|
+
excludeFromCollection: !1,
|
|
3797
|
+
externalImports: [],
|
|
3798
|
+
htmlAttrNames: [],
|
|
3799
|
+
htmlTagNames: [],
|
|
3800
|
+
htmlParts: [],
|
|
3801
|
+
isCollectionDependency: !1,
|
|
3802
|
+
isLegacy: !1,
|
|
3803
|
+
jsFilePath: "",
|
|
3804
|
+
localImports: [],
|
|
3805
|
+
originalImports: [],
|
|
3806
|
+
originalCollectionComponentPath: "",
|
|
3807
|
+
potentialCmpRefs: [],
|
|
3808
|
+
sourceFilePath: "",
|
|
3809
|
+
staticSourceFile: "",
|
|
3810
|
+
staticSourceFileText: "",
|
|
3811
|
+
sourceMapPath: "",
|
|
3812
|
+
sourceMapFileText: "",
|
|
3813
|
+
hasVdomAttribute: !1,
|
|
3814
|
+
hasVdomClass: !1,
|
|
3815
|
+
hasVdomFunctional: !1,
|
|
3816
|
+
hasVdomKey: !1,
|
|
3817
|
+
hasVdomListener: !1,
|
|
3818
|
+
hasVdomPropOrAttr: !1,
|
|
3819
|
+
hasVdomRef: !1,
|
|
3820
|
+
hasVdomRender: !1,
|
|
3821
|
+
hasVdomStyle: !1,
|
|
3822
|
+
hasVdomText: !1,
|
|
3823
|
+
hasVdomXlink: !1,
|
|
3824
|
+
...e
|
|
3825
|
+
}), exports.mockWindow = function mockWindow(e = null) {
|
|
3787
3826
|
return new index_cjs.MockWindow(e);
|
|
3788
3827
|
}, exports.newE2EPage = async function newE2EPage(e = {}) {
|
|
3789
3828
|
if (!global.__NEW_TEST_PAGE__) throw new Error("newE2EPage() is only available from E2E tests, and ran with the --e2e cmd line flag.");
|
|
@@ -3802,19 +3841,19 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3802
3841
|
const t = process.env;
|
|
3803
3842
|
"true" === t.__STENCIL_SCREENSHOT__ ? e.compareScreenshot = (r, s) => {
|
|
3804
3843
|
const n = global;
|
|
3805
|
-
let
|
|
3806
|
-
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (
|
|
3807
|
-
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (
|
|
3808
|
-
"object" == typeof s && (
|
|
3809
|
-
|
|
3810
|
-
if (n.screenshotDescriptions.has(
|
|
3811
|
-
return n.screenshotDescriptions.add(
|
|
3844
|
+
let o, i = "", a = "";
|
|
3845
|
+
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (i = n.currentSpec.fullName),
|
|
3846
|
+
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (i.length > 0 ? i += ", " + r : i = r,
|
|
3847
|
+
"object" == typeof s && (o = s)) : "object" == typeof r && (o = r), i = i.trim(),
|
|
3848
|
+
o = o || {}, !i) throw new Error(`Invalid screenshot description in "${a}"`);
|
|
3849
|
+
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')".`);
|
|
3850
|
+
return n.screenshotDescriptions.add(i), async function l(e, t, r, s, n) {
|
|
3812
3851
|
if ("string" != typeof t.__STENCIL_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
|
|
3813
3852
|
if ("string" != typeof t.__STENCIL_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
3814
|
-
const
|
|
3853
|
+
const o = JSON.parse(t.__STENCIL_EMULATE__), i = JSON.parse(t.__STENCIL_SCREENSHOT_BUILD__);
|
|
3815
3854
|
await function a(e) {
|
|
3816
3855
|
return new Promise((t => setTimeout(t, e)));
|
|
3817
|
-
}(
|
|
3856
|
+
}(i.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
|
|
3818
3857
|
window.requestAnimationFrame((() => {
|
|
3819
3858
|
e();
|
|
3820
3859
|
}));
|
|
@@ -3832,11 +3871,11 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3832
3871
|
width: e.clip.width,
|
|
3833
3872
|
height: e.clip.height
|
|
3834
3873
|
}), t;
|
|
3835
|
-
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold :
|
|
3836
|
-
let h =
|
|
3874
|
+
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : i.pixelmatchThreshold;
|
|
3875
|
+
let h = o.viewport.width, p = o.viewport.height;
|
|
3837
3876
|
return n && n.clip && ("number" == typeof n.clip.width && (h = n.clip.width), "number" == typeof n.clip.height && (p = n.clip.height)),
|
|
3838
|
-
await compareScreenshot(
|
|
3839
|
-
}(e, t,
|
|
3877
|
+
await compareScreenshot(o, i, u, r, h, p, s, d);
|
|
3878
|
+
}(e, t, i, a, o);
|
|
3840
3879
|
} : e.compareScreenshot = async () => ({
|
|
3841
3880
|
mismatchedPixels: 0,
|
|
3842
3881
|
allowableMismatchedPixels: 1,
|
|
@@ -3884,13 +3923,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3884
3923
|
e();
|
|
3885
3924
|
}))));
|
|
3886
3925
|
};
|
|
3887
|
-
const
|
|
3926
|
+
const o = !0 === e.failOnConsoleError, i = !0 === e.failOnNetworkError;
|
|
3888
3927
|
t.on("console", (e => {
|
|
3889
3928
|
"error" === e.type() && (r.push({
|
|
3890
3929
|
type: "error",
|
|
3891
3930
|
message: e.text(),
|
|
3892
3931
|
location: e.location().url
|
|
3893
|
-
}),
|
|
3932
|
+
}), o && fail(new Error(serializeConsoleMessage(e)))), function t(e) {
|
|
3894
3933
|
const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
|
|
3895
3934
|
"debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
|
|
3896
3935
|
}(e);
|
|
@@ -3905,7 +3944,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3905
3944
|
type: "requestfailed",
|
|
3906
3945
|
message: e.failure().errorText,
|
|
3907
3946
|
location: e.url()
|
|
3908
|
-
}),
|
|
3947
|
+
}), i ? fail(new Error(e.failure().errorText)) : console.error("requestfailed", e.url());
|
|
3909
3948
|
})), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
|
|
3910
3949
|
waitUntil: e.waitUntil
|
|
3911
3950
|
}) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
|
|
@@ -3971,7 +4010,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3971
4010
|
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
3972
4011
|
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
3973
4012
|
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
3974
|
-
})),
|
|
4013
|
+
})), o = (e => {
|
|
3975
4014
|
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 = {
|
|
3976
4015
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
3977
4016
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
@@ -4031,8 +4070,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4031
4070
|
return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
|
|
4032
4071
|
n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
|
|
4033
4072
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4034
|
-
if (e.strictBuild ? Object.assign(appData.BUILD,
|
|
4035
|
-
!0 ===
|
|
4073
|
+
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
|
|
4074
|
+
!0 === o[e] && (appData.BUILD[e] = !0);
|
|
4036
4075
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4037
4076
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4038
4077
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
@@ -4062,10 +4101,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4062
4101
|
testing.renderVdom(t, e.template());
|
|
4063
4102
|
} else "string" == typeof e.html && (s.body.innerHTML = e.html);
|
|
4064
4103
|
!1 !== e.flushQueue && await s.waitForChanges();
|
|
4065
|
-
let
|
|
4104
|
+
let i = null;
|
|
4066
4105
|
return Object.defineProperty(s, "root", {
|
|
4067
4106
|
get() {
|
|
4068
|
-
if (null ==
|
|
4107
|
+
if (null == i && (i = findRootComponent(t, s.body)), null != i) return i;
|
|
4069
4108
|
const e = s.body.firstElementChild;
|
|
4070
4109
|
return null != e ? e : null;
|
|
4071
4110
|
}
|