@stencil/core 2.16.1 → 2.17.2-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/config-flags.d.ts +110 -0
- package/cli/index.cjs +710 -225
- package/cli/index.d.ts +2 -1
- package/cli/index.js +710 -225
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +905 -290
- 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 +11 -6
- 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/index.js +2 -2
- package/internal/hydrate/package.json +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +6 -2
- package/internal/stencil-public-compiler.d.ts +67 -48
- package/internal/testing/index.js +1 -1
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +163 -5
- package/mock-doc/index.d.ts +86 -1
- package/mock-doc/index.js +163 -5
- package/mock-doc/package.json +1 -1
- package/package.json +2 -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 +445 -382
- package/testing/jest/jest-config.d.ts +1 -1
- package/testing/jest/jest-runner.d.ts +3 -2
- package/testing/jest/jest-screenshot.d.ts +1 -1
- package/testing/mocks.d.ts +48 -3
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-browser.d.ts +2 -2
- package/testing/test/testing-utils.spec.d.ts +1 -0
- package/testing/testing-utils.d.ts +74 -2
- package/testing/testing.d.ts +2 -2
package/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Testing v2.
|
|
2
|
+
Stencil Testing v2.17.2-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) {
|
|
@@ -460,7 +460,7 @@ function mockConfig(e) {
|
|
|
460
460
|
enableCache: !1,
|
|
461
461
|
buildAppCore: !1,
|
|
462
462
|
buildDist: !0,
|
|
463
|
-
flags:
|
|
463
|
+
flags: createConfigFlags(),
|
|
464
464
|
bundles: null,
|
|
465
465
|
outputTargets: null,
|
|
466
466
|
buildEs5: !1,
|
|
@@ -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
|
},
|
|
@@ -813,6 +817,10 @@ function mockCompilerCtx(e) {
|
|
|
813
817
|
}), t;
|
|
814
818
|
}
|
|
815
819
|
|
|
820
|
+
function mockLogger() {
|
|
821
|
+
return new TestingLogger;
|
|
822
|
+
}
|
|
823
|
+
|
|
816
824
|
function findRootComponent(e, t) {
|
|
817
825
|
if (null != t) {
|
|
818
826
|
const r = t.children, s = r.length;
|
|
@@ -839,19 +847,19 @@ async function initPageEvents(e) {
|
|
|
839
847
|
}
|
|
840
848
|
|
|
841
849
|
async function pageSpyOnEvent(e, t, r) {
|
|
842
|
-
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document,
|
|
843
|
-
return await addE2EListener(e,
|
|
850
|
+
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, o = await e.evaluateHandle(n);
|
|
851
|
+
return await addE2EListener(e, o, t, (e => {
|
|
844
852
|
s.push(e);
|
|
845
853
|
})), s;
|
|
846
854
|
}
|
|
847
855
|
|
|
848
856
|
async function waitForEvent(e, t, r) {
|
|
849
857
|
const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate(((e, t, r) => new Promise(((s, n) => {
|
|
850
|
-
const
|
|
858
|
+
const o = setTimeout((() => {
|
|
851
859
|
n(new Error(`waitForEvent() timeout, eventName: ${t}`));
|
|
852
860
|
}), r);
|
|
853
861
|
e.addEventListener(t, (e => {
|
|
854
|
-
clearTimeout(
|
|
862
|
+
clearTimeout(o), s(window.stencilSerializeEvent(e));
|
|
855
863
|
}), {
|
|
856
864
|
once: !0
|
|
857
865
|
});
|
|
@@ -865,8 +873,8 @@ async function addE2EListener(e, t, r, s) {
|
|
|
865
873
|
eventName: r,
|
|
866
874
|
callback: s
|
|
867
875
|
});
|
|
868
|
-
const
|
|
869
|
-
await
|
|
876
|
+
const o = t.executionContext();
|
|
877
|
+
await o.evaluate(((e, t, r) => {
|
|
870
878
|
e.addEventListener(r, (e => {
|
|
871
879
|
window.stencilOnEvent(t, window.stencilSerializeEvent(e));
|
|
872
880
|
}));
|
|
@@ -922,7 +930,7 @@ function browserContextEvents() {
|
|
|
922
930
|
}
|
|
923
931
|
|
|
924
932
|
async function find(e, t, r) {
|
|
925
|
-
const {lightSelector: s, shadowSelector: n, text:
|
|
933
|
+
const {lightSelector: s, shadowSelector: n, text: o, contains: i} = getSelector(r);
|
|
926
934
|
let a;
|
|
927
935
|
if (a = "string" == typeof s ? await async function l(e, t, r, s) {
|
|
928
936
|
let n = await t.$(r);
|
|
@@ -950,20 +958,20 @@ async function find(e, t, r) {
|
|
|
950
958
|
}(e), s;
|
|
951
959
|
}), t, r, s);
|
|
952
960
|
return n ? n.asElement() : null;
|
|
953
|
-
}(e, t,
|
|
961
|
+
}(e, t, o, i), !a) return null;
|
|
954
962
|
const u = new E2EElement(e, a);
|
|
955
963
|
return await u.e2eSync(), u;
|
|
956
964
|
}
|
|
957
965
|
|
|
958
966
|
async function findAll(e, t, r) {
|
|
959
|
-
const s = [], {lightSelector: n, shadowSelector:
|
|
960
|
-
if (0 ===
|
|
961
|
-
if (
|
|
962
|
-
const r =
|
|
967
|
+
const s = [], {lightSelector: n, shadowSelector: o} = getSelector(r), i = await t.$$(n);
|
|
968
|
+
if (0 === i.length) return s;
|
|
969
|
+
if (o) for (let t = 0; t < i.length; t++) {
|
|
970
|
+
const r = i[t].executionContext(), n = await r.evaluateHandle(((e, t) => {
|
|
963
971
|
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
964
972
|
return e.shadowRoot.querySelectorAll(t);
|
|
965
|
-
}),
|
|
966
|
-
await
|
|
973
|
+
}), i[t], o);
|
|
974
|
+
await i[t].dispose();
|
|
967
975
|
const a = await n.getProperties();
|
|
968
976
|
await n.dispose();
|
|
969
977
|
for (const t of a.values()) {
|
|
@@ -973,8 +981,8 @@ async function findAll(e, t, r) {
|
|
|
973
981
|
await t.e2eSync(), s.push(t);
|
|
974
982
|
}
|
|
975
983
|
}
|
|
976
|
-
} else for (let t = 0; t <
|
|
977
|
-
const r = new E2EElement(e,
|
|
984
|
+
} else for (let t = 0; t < i.length; t++) {
|
|
985
|
+
const r = new E2EElement(e, i[t]);
|
|
978
986
|
await r.e2eSync(), s.push(r);
|
|
979
987
|
}
|
|
980
988
|
return s;
|
|
@@ -1013,7 +1021,7 @@ function writeFile(e, t) {
|
|
|
1013
1021
|
}));
|
|
1014
1022
|
}
|
|
1015
1023
|
|
|
1016
|
-
async function compareScreenshot(e, t, r, s, n,
|
|
1024
|
+
async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
1017
1025
|
const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
|
|
1018
1026
|
await async function u(e, t) {
|
|
1019
1027
|
await function r(e) {
|
|
@@ -1021,7 +1029,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1021
1029
|
fs__default.default.access(e, (e => t(!e)));
|
|
1022
1030
|
}));
|
|
1023
1031
|
}(e) || await writeFile(e, t);
|
|
1024
|
-
}(c, r), r = null,
|
|
1032
|
+
}(c, r), r = null, i && (i = normalizePath(path$2.relative(t.rootDir, i)));
|
|
1025
1033
|
const d = function h(e, t) {
|
|
1026
1034
|
if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
|
|
1027
1035
|
const r = crypto$3.createHash("md5");
|
|
@@ -1034,9 +1042,9 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1034
1042
|
device: e.device,
|
|
1035
1043
|
userAgent: e.userAgent,
|
|
1036
1044
|
desc: s,
|
|
1037
|
-
testPath:
|
|
1045
|
+
testPath: i,
|
|
1038
1046
|
width: n,
|
|
1039
|
-
height:
|
|
1047
|
+
height: o,
|
|
1040
1048
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1041
1049
|
hasTouch: e.viewport.hasTouch,
|
|
1042
1050
|
isLandscape: e.viewport.isLandscape,
|
|
@@ -1050,14 +1058,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1050
1058
|
device: e.device,
|
|
1051
1059
|
userAgent: e.userAgent,
|
|
1052
1060
|
width: n,
|
|
1053
|
-
height:
|
|
1061
|
+
height: o,
|
|
1054
1062
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1055
1063
|
hasTouch: e.viewport.hasTouch,
|
|
1056
1064
|
isLandscape: e.viewport.isLandscape,
|
|
1057
1065
|
isMobile: e.viewport.isMobile,
|
|
1058
1066
|
allowableMismatchedPixels: t.allowableMismatchedPixels,
|
|
1059
1067
|
allowableMismatchedRatio: t.allowableMismatchedRatio,
|
|
1060
|
-
testPath:
|
|
1068
|
+
testPath: i
|
|
1061
1069
|
}
|
|
1062
1070
|
};
|
|
1063
1071
|
if (t.updateMaster) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
|
|
@@ -1079,7 +1087,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1079
1087
|
};
|
|
1080
1088
|
p.diff.mismatchedPixels = await async function g(e, t) {
|
|
1081
1089
|
return new Promise(((r, s) => {
|
|
1082
|
-
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL,
|
|
1090
|
+
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, o = setTimeout((() => {
|
|
1083
1091
|
s(`getMismatchedPixels timeout: ${n}ms`);
|
|
1084
1092
|
}), n);
|
|
1085
1093
|
try {
|
|
@@ -1088,14 +1096,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1088
1096
|
env: process.env,
|
|
1089
1097
|
cwd: process.cwd(),
|
|
1090
1098
|
stdio: [ "pipe", "pipe", "pipe", "ipc" ]
|
|
1091
|
-
},
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
})),
|
|
1095
|
-
clearTimeout(
|
|
1096
|
-
})),
|
|
1099
|
+
}, i = child_process$2.fork(e, [], n);
|
|
1100
|
+
i.on("message", (e => {
|
|
1101
|
+
i.kill(), clearTimeout(o), r(e);
|
|
1102
|
+
})), i.on("error", (e => {
|
|
1103
|
+
clearTimeout(o), s(e);
|
|
1104
|
+
})), i.send(t);
|
|
1097
1105
|
} catch (e) {
|
|
1098
|
-
clearTimeout(
|
|
1106
|
+
clearTimeout(o), s(`getMismatchedPixels error: ${e}`);
|
|
1099
1107
|
}
|
|
1100
1108
|
}));
|
|
1101
1109
|
}(t.pixelmatchModulePath, n);
|
|
@@ -1112,9 +1120,9 @@ async function e2eGoTo(e, t, r = {}) {
|
|
|
1112
1120
|
if ("string" != typeof s) throw new Error("invalid gotoTest() browser url");
|
|
1113
1121
|
const n = s + t.substring(1);
|
|
1114
1122
|
r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1115
|
-
const
|
|
1116
|
-
if (!
|
|
1117
|
-
return await waitForStencil(e, r),
|
|
1123
|
+
const o = await e._e2eGoto(n, r);
|
|
1124
|
+
if (!o.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${o.status()}`);
|
|
1125
|
+
return await waitForStencil(e, r), o;
|
|
1118
1126
|
}
|
|
1119
1127
|
|
|
1120
1128
|
async function e2eSetContent(e, t, r = {}) {
|
|
@@ -1123,18 +1131,18 @@ async function e2eSetContent(e, t, r = {}) {
|
|
|
1123
1131
|
const s = [], n = env.__STENCIL_APP_SCRIPT_URL__;
|
|
1124
1132
|
if ("string" != typeof n) throw new Error("invalid e2eSetContent() app script url");
|
|
1125
1133
|
s.push("<!doctype html>"), s.push("<html>"), s.push("<head>");
|
|
1126
|
-
const
|
|
1127
|
-
"string" == typeof
|
|
1134
|
+
const o = env.__STENCIL_APP_STYLE_URL__;
|
|
1135
|
+
"string" == typeof o && s.push(`<link rel="stylesheet" href="${o}">`), s.push(`<script type="module" src="${n}"><\/script>`),
|
|
1128
1136
|
s.push("</head>"), s.push("<body>"), s.push(t), s.push("</body>"), s.push("</html>");
|
|
1129
|
-
const
|
|
1137
|
+
const i = env.__STENCIL_BROWSER_URL__;
|
|
1130
1138
|
await e.setRequestInterception(!0), e.on("request", (e => {
|
|
1131
|
-
|
|
1139
|
+
i === e.url() ? e.respond({
|
|
1132
1140
|
status: 200,
|
|
1133
1141
|
contentType: "text/html",
|
|
1134
1142
|
body: s.join("\n")
|
|
1135
1143
|
}) : e.continue();
|
|
1136
1144
|
})), r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1137
|
-
const a = await e._e2eGoto(
|
|
1145
|
+
const a = await e._e2eGoto(i, r);
|
|
1138
1146
|
if (!a.ok()) throw new Error("Testing unable to load content");
|
|
1139
1147
|
return await waitForStencil(e, r), a;
|
|
1140
1148
|
}
|
|
@@ -1242,8 +1250,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1242
1250
|
}, 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
1251
|
if ("string" != typeof e) throw new Error("invalid path to normalize");
|
|
1244
1252
|
e = normalizeSlashes(e.trim());
|
|
1245
|
-
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1],
|
|
1246
|
-
return "" ===
|
|
1253
|
+
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], o = s + r.slice(1).join("/");
|
|
1254
|
+
return "" === o ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + o : o;
|
|
1247
1255
|
}, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
|
|
1248
1256
|
if (!Array.isArray(e) || 0 === e.length) return [];
|
|
1249
1257
|
const t = [ e[0] ];
|
|
@@ -1280,8 +1288,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1280
1288
|
if (-1 !== r) {
|
|
1281
1289
|
const t = r + "://".length, s = e.indexOf("/", t);
|
|
1282
1290
|
if (-1 !== s) {
|
|
1283
|
-
const n = e.slice(0, r),
|
|
1284
|
-
if ("file" === n && ("" ===
|
|
1291
|
+
const n = e.slice(0, r), o = e.slice(t, s);
|
|
1292
|
+
if ("file" === n && ("" === o || "localhost" === o) && isVolumeCharacter(e.charCodeAt(s + 1))) {
|
|
1285
1293
|
const t = getFileUrlVolumeSeparatorEnd(e, s + 2);
|
|
1286
1294
|
if (-1 !== t) {
|
|
1287
1295
|
if (47 === e.charCodeAt(t)) return ~(t + 1);
|
|
@@ -1334,12 +1342,12 @@ const jestPreprocessor = {
|
|
|
1334
1342
|
currentDirectory: s.rootDir
|
|
1335
1343
|
}, n = getCompilerOptions(s.rootDir);
|
|
1336
1344
|
n && (n.baseUrl && (r.baseUrl = n.baseUrl), n.paths && (r.paths = n.paths));
|
|
1337
|
-
const
|
|
1338
|
-
if (
|
|
1339
|
-
const e =
|
|
1345
|
+
const o = transpile(e, r), i = o.diagnostics.some((e => "error" === e.level));
|
|
1346
|
+
if (o.diagnostics && i) {
|
|
1347
|
+
const e = o.diagnostics.map(formatDiagnostic).join("\n\n");
|
|
1340
1348
|
throw new Error(e);
|
|
1341
1349
|
}
|
|
1342
|
-
return
|
|
1350
|
+
return o.code;
|
|
1343
1351
|
}
|
|
1344
1352
|
return e;
|
|
1345
1353
|
},
|
|
@@ -1354,10 +1362,10 @@ const jestPreprocessor = {
|
|
|
1354
1362
|
if (t === r) return !0;
|
|
1355
1363
|
if (t && r && "object" == typeof t && "object" == typeof r) {
|
|
1356
1364
|
const s = Array.isArray(t), n = Array.isArray(r);
|
|
1357
|
-
let
|
|
1365
|
+
let o, i, a;
|
|
1358
1366
|
if (s && n) {
|
|
1359
|
-
if (
|
|
1360
|
-
for (
|
|
1367
|
+
if (i = t.length, i != r.length) return !1;
|
|
1368
|
+
for (o = i; 0 != o--; ) if (!e(t[o], r[o])) return !1;
|
|
1361
1369
|
return !0;
|
|
1362
1370
|
}
|
|
1363
1371
|
if (s != n) return !1;
|
|
@@ -1368,9 +1376,9 @@ const jestPreprocessor = {
|
|
|
1368
1376
|
if (u != d) return !1;
|
|
1369
1377
|
if (u && d) return t.toString() == r.toString();
|
|
1370
1378
|
const h = Object.keys(t);
|
|
1371
|
-
if (
|
|
1372
|
-
for (
|
|
1373
|
-
for (
|
|
1379
|
+
if (i = h.length, i !== Object.keys(r).length) return !1;
|
|
1380
|
+
for (o = i; 0 != o--; ) if (!Object.prototype.hasOwnProperty.call(r, h[o])) return !1;
|
|
1381
|
+
for (o = i; 0 != o--; ) if (a = h[o], !e(t[a], r[a])) return !1;
|
|
1374
1382
|
return !0;
|
|
1375
1383
|
}
|
|
1376
1384
|
return t != t && r != r;
|
|
@@ -1768,9 +1776,9 @@ class BuildContext {
|
|
|
1768
1776
|
}
|
|
1769
1777
|
return {
|
|
1770
1778
|
duration: () => r.duration(),
|
|
1771
|
-
finish: (e, s, n,
|
|
1779
|
+
finish: (e, s, n, o) => {
|
|
1772
1780
|
if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
|
|
1773
|
-
r.finish(e, s, n,
|
|
1781
|
+
r.finish(e, s, n, o), !t)) {
|
|
1774
1782
|
const e = {
|
|
1775
1783
|
buildId: this.buildId,
|
|
1776
1784
|
messages: this.buildMessages.slice(),
|
|
@@ -1886,12 +1894,12 @@ class Cache {
|
|
|
1886
1894
|
if (null != t) {
|
|
1887
1895
|
if (e - t < ONE_DAY) return;
|
|
1888
1896
|
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
|
|
1897
|
+
let o = 0;
|
|
1898
|
+
const i = n.map((async t => {
|
|
1891
1899
|
const s = (await r.stat(t)).mtimeMs;
|
|
1892
|
-
e - s > ONE_WEEK && (await r.removeFile(t),
|
|
1900
|
+
e - s > ONE_WEEK && (await r.removeFile(t), o++);
|
|
1893
1901
|
}));
|
|
1894
|
-
await Promise.all(
|
|
1902
|
+
await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${o}`);
|
|
1895
1903
|
}
|
|
1896
1904
|
this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
|
|
1897
1905
|
}
|
|
@@ -1933,10 +1941,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1933
1941
|
} 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
1942
|
const s = r, n = e.queueCopyFileToDest;
|
|
1935
1943
|
t.filesToCopy.push([ s, n ]);
|
|
1936
|
-
const
|
|
1937
|
-
t.dirsToEnsure.includes(
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1944
|
+
const o = normalizePath(path$2.dirname(n));
|
|
1945
|
+
t.dirsToEnsure.includes(o) || t.dirsToEnsure.push(o);
|
|
1946
|
+
const i = t.dirsToDelete.indexOf(o);
|
|
1947
|
+
i > -1 && t.dirsToDelete.splice(i, 1);
|
|
1940
1948
|
const a = t.filesToDelete.indexOf(n);
|
|
1941
1949
|
a > -1 && t.filesToDelete.splice(a, 1);
|
|
1942
1950
|
}
|
|
@@ -1969,10 +1977,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1969
1977
|
|
|
1970
1978
|
(posix = {
|
|
1971
1979
|
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, !
|
|
1980
|
+
var t, r, s, n = "", o = !1;
|
|
1981
|
+
for (r = arguments.length - 1; r >= -1 && !o; r--) r >= 0 ? s = arguments[r] : (void 0 === t && (t = process.cwd()),
|
|
1982
|
+
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n, o = 47 === s.charCodeAt(0));
|
|
1983
|
+
return n = normalizeStringPosix(n, !o), o ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
|
|
1976
1984
|
},
|
|
1977
1985
|
normalize: function e(t) {
|
|
1978
1986
|
var r, s;
|
|
@@ -1990,70 +1998,70 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1990
1998
|
return void 0 === t ? "." : posix.normalize(t);
|
|
1991
1999
|
},
|
|
1992
2000
|
relative: function e(t, r) {
|
|
1993
|
-
var s, n,
|
|
2001
|
+
var s, n, o, i, a, l, c, u, d, h;
|
|
1994
2002
|
if (assertPath(t), assertPath(r), t === r) return "";
|
|
1995
2003
|
if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
|
|
1996
2004
|
for (s = 1; s < t.length && 47 === t.charCodeAt(s); ++s) ;
|
|
1997
|
-
for (
|
|
1998
|
-
for (l =
|
|
2005
|
+
for (o = (n = t.length) - s, i = 1; i < r.length && 47 === r.charCodeAt(i); ++i) ;
|
|
2006
|
+
for (l = o < (a = r.length - i) ? o : a, c = -1, u = 0; u <= l; ++u) {
|
|
1999
2007
|
if (u === l) {
|
|
2000
2008
|
if (a > l) {
|
|
2001
|
-
if (47 === r.charCodeAt(
|
|
2002
|
-
if (0 === u) return r.slice(
|
|
2003
|
-
} else
|
|
2009
|
+
if (47 === r.charCodeAt(i + u)) return r.slice(i + u + 1);
|
|
2010
|
+
if (0 === u) return r.slice(i + u);
|
|
2011
|
+
} else o > l && (47 === t.charCodeAt(s + u) ? c = u : 0 === u && (c = 0));
|
|
2004
2012
|
break;
|
|
2005
2013
|
}
|
|
2006
|
-
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(
|
|
2014
|
+
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(i + u)) break;
|
|
2007
2015
|
47 === d && (c = u);
|
|
2008
2016
|
}
|
|
2009
2017
|
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(
|
|
2018
|
+
return h.length > 0 ? h + r.slice(i + c) : (i += c, 47 === r.charCodeAt(i) && ++i,
|
|
2019
|
+
r.slice(i));
|
|
2012
2020
|
},
|
|
2013
2021
|
_makeLong: function e(t) {
|
|
2014
2022
|
return t;
|
|
2015
2023
|
},
|
|
2016
2024
|
dirname: function e(t) {
|
|
2017
|
-
var r, s, n,
|
|
2025
|
+
var r, s, n, o;
|
|
2018
2026
|
if (assertPath(t), 0 === t.length) return ".";
|
|
2019
|
-
for (r = 47 === t.charCodeAt(0), s = -1, n = !0,
|
|
2027
|
+
for (r = 47 === t.charCodeAt(0), s = -1, n = !0, o = t.length - 1; o >= 1; --o) if (47 === t.charCodeAt(o)) {
|
|
2020
2028
|
if (!n) {
|
|
2021
|
-
s =
|
|
2029
|
+
s = o;
|
|
2022
2030
|
break;
|
|
2023
2031
|
}
|
|
2024
2032
|
} else n = !1;
|
|
2025
2033
|
return -1 === s ? r ? "/" : "." : r && 1 === s ? "//" : t.slice(0, s);
|
|
2026
2034
|
},
|
|
2027
2035
|
basename: function e(t, r) {
|
|
2028
|
-
var s, n,
|
|
2036
|
+
var s, n, o, i, a, l, c;
|
|
2029
2037
|
if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
|
|
2030
|
-
if (assertPath(t), s = 0, n = -1,
|
|
2038
|
+
if (assertPath(t), s = 0, n = -1, o = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
|
|
2031
2039
|
if (r.length === t.length && r === t) return "";
|
|
2032
|
-
for (a = r.length - 1, l = -1,
|
|
2033
|
-
if (!
|
|
2034
|
-
s =
|
|
2040
|
+
for (a = r.length - 1, l = -1, i = t.length - 1; i >= 0; --i) if (47 === (c = t.charCodeAt(i))) {
|
|
2041
|
+
if (!o) {
|
|
2042
|
+
s = i + 1;
|
|
2035
2043
|
break;
|
|
2036
2044
|
}
|
|
2037
|
-
} else -1 === l && (
|
|
2045
|
+
} else -1 === l && (o = !1, l = i + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (n = i) : (a = -1,
|
|
2038
2046
|
n = l));
|
|
2039
2047
|
return s === n ? n = l : -1 === n && (n = t.length), t.slice(s, n);
|
|
2040
2048
|
}
|
|
2041
|
-
for (
|
|
2042
|
-
if (!
|
|
2043
|
-
s =
|
|
2049
|
+
for (i = t.length - 1; i >= 0; --i) if (47 === t.charCodeAt(i)) {
|
|
2050
|
+
if (!o) {
|
|
2051
|
+
s = i + 1;
|
|
2044
2052
|
break;
|
|
2045
2053
|
}
|
|
2046
|
-
} else -1 === n && (
|
|
2054
|
+
} else -1 === n && (o = !1, n = i + 1);
|
|
2047
2055
|
return -1 === n ? "" : t.slice(s, n);
|
|
2048
2056
|
},
|
|
2049
2057
|
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 !==
|
|
2058
|
+
var r, s, n, o, i, a, l;
|
|
2059
|
+
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,
|
|
2060
|
+
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !== i && (i = 1) : -1 !== r && (i = -1); else if (!o) {
|
|
2053
2061
|
s = a + 1;
|
|
2054
2062
|
break;
|
|
2055
2063
|
}
|
|
2056
|
-
return -1 === r || -1 === n || 0 ===
|
|
2064
|
+
return -1 === r || -1 === n || 0 === i || 1 === i && r === n - 1 && r === s + 1 ? "" : t.slice(r, n);
|
|
2057
2065
|
},
|
|
2058
2066
|
format: function e(t) {
|
|
2059
2067
|
if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
|
|
@@ -2063,7 +2071,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2063
2071
|
}("/", t);
|
|
2064
2072
|
},
|
|
2065
2073
|
parse: function e(t) {
|
|
2066
|
-
var r, s, n,
|
|
2074
|
+
var r, s, n, o, i, a, l, c, u, d;
|
|
2067
2075
|
if (assertPath(t), r = {
|
|
2068
2076
|
root: "",
|
|
2069
2077
|
dir: "",
|
|
@@ -2071,14 +2079,14 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2071
2079
|
ext: "",
|
|
2072
2080
|
name: ""
|
|
2073
2081
|
}, 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 ===
|
|
2082
|
+
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/", o = 1) : o = 0, i = -1,
|
|
2083
|
+
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,
|
|
2084
|
+
l = u + 1), 46 === s ? -1 === i ? i = u : 1 !== d && (d = 1) : -1 !== i && (d = -1); else if (!c) {
|
|
2077
2085
|
a = u + 1;
|
|
2078
2086
|
break;
|
|
2079
2087
|
}
|
|
2080
|
-
return -1 ===
|
|
2081
|
-
r.base = t.slice(1, l)) : (r.name = t.slice(a,
|
|
2088
|
+
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),
|
|
2089
|
+
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
2090
|
a > 0 ? r.dir = t.slice(0, a - 1) : n && (r.dir = "/"), r;
|
|
2083
2091
|
},
|
|
2084
2092
|
sep: "/",
|
|
@@ -2087,7 +2095,46 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2087
2095
|
posix: null
|
|
2088
2096
|
}).posix = posix, pathBrowserify = posix;
|
|
2089
2097
|
|
|
2090
|
-
const
|
|
2098
|
+
const buildEvents = () => {
|
|
2099
|
+
const e = [], t = t => {
|
|
2100
|
+
const r = e.findIndex((e => e.callback === t));
|
|
2101
|
+
return r > -1 && (e.splice(r, 1), !0);
|
|
2102
|
+
};
|
|
2103
|
+
return {
|
|
2104
|
+
emit: (t, r) => {
|
|
2105
|
+
const s = t.toLowerCase().trim(), n = e.slice();
|
|
2106
|
+
for (const e of n) if (null == e.eventName) try {
|
|
2107
|
+
e.callback(t, r);
|
|
2108
|
+
} catch (e) {
|
|
2109
|
+
console.error(e);
|
|
2110
|
+
} else if (e.eventName === s) try {
|
|
2111
|
+
e.callback(r);
|
|
2112
|
+
} catch (e) {
|
|
2113
|
+
console.error(e);
|
|
2114
|
+
}
|
|
2115
|
+
},
|
|
2116
|
+
on: (r, s) => {
|
|
2117
|
+
if ("function" == typeof r) {
|
|
2118
|
+
const s = null, n = r;
|
|
2119
|
+
return e.push({
|
|
2120
|
+
eventName: s,
|
|
2121
|
+
callback: n
|
|
2122
|
+
}), () => t(n);
|
|
2123
|
+
}
|
|
2124
|
+
if ("string" == typeof r && "function" == typeof s) {
|
|
2125
|
+
const n = r.toLowerCase().trim(), o = s;
|
|
2126
|
+
return e.push({
|
|
2127
|
+
eventName: n,
|
|
2128
|
+
callback: o
|
|
2129
|
+
}), () => t(o);
|
|
2130
|
+
}
|
|
2131
|
+
return () => !1;
|
|
2132
|
+
},
|
|
2133
|
+
unsubscribeAll: () => {
|
|
2134
|
+
e.length = 0;
|
|
2135
|
+
}
|
|
2136
|
+
};
|
|
2137
|
+
}, IS_NODE_ENV = !("undefined" == typeof global || "function" != typeof require || !global.process || "string" != typeof __filename || global.origin && "string" == typeof global.origin);
|
|
2091
2138
|
|
|
2092
2139
|
IS_NODE_ENV && process.platform;
|
|
2093
2140
|
|
|
@@ -2116,21 +2163,20 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2116
2163
|
let s = (r = normalizePath(r)).split("/").filter((e => e.length));
|
|
2117
2164
|
const n = s.lastIndexOf("node_modules");
|
|
2118
2165
|
n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
|
|
2119
|
-
let
|
|
2120
|
-
|
|
2121
|
-
const
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
path: o
|
|
2166
|
+
let o = s.shift();
|
|
2167
|
+
o.startsWith("@") && (o += "/" + s.shift());
|
|
2168
|
+
const i = s.join("/");
|
|
2169
|
+
return "@stencil/core" === o ? ((e, t) => {
|
|
2170
|
+
let r = (t = normalizePath(t)).split("/");
|
|
2171
|
+
const s = r.lastIndexOf("node_modules");
|
|
2172
|
+
s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
|
|
2173
|
+
t = r.join("/"));
|
|
2174
|
+
const n = new URL("../", e).href;
|
|
2175
|
+
return new URL("./" + t, n).href;
|
|
2176
|
+
})(e.getCompilerExecutingPath(), i) : e.getRemoteModuleUrl({
|
|
2177
|
+
moduleId: o,
|
|
2178
|
+
version: t.get(o),
|
|
2179
|
+
path: i
|
|
2134
2180
|
});
|
|
2135
2181
|
}, 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
2182
|
if (!((e => {
|
|
@@ -2139,11 +2185,11 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2139
2185
|
const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
|
|
2140
2186
|
return !("node_modules" !== s || !isCommonDirModuleFile(n));
|
|
2141
2187
|
})(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,
|
|
2188
|
+
const o = await ((e, t, r) => e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r))(e, s);
|
|
2189
|
+
if (o) {
|
|
2190
|
+
if (o.ok) {
|
|
2191
|
+
const i = await o.clone().text();
|
|
2192
|
+
return await (async (e, t, r, s, n, o) => {
|
|
2147
2193
|
r.endsWith("package.json") && ((e, t) => {
|
|
2148
2194
|
try {
|
|
2149
2195
|
const r = JSON.parse(t);
|
|
@@ -2151,14 +2197,14 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2151
2197
|
e.set(t, r);
|
|
2152
2198
|
})(e, r.name, r.version);
|
|
2153
2199
|
} catch (e) {}
|
|
2154
|
-
})(
|
|
2155
|
-
let
|
|
2156
|
-
for (;"/" !==
|
|
2157
|
-
|
|
2200
|
+
})(o, n);
|
|
2201
|
+
let i = path$2.dirname(s);
|
|
2202
|
+
for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
|
|
2203
|
+
i = path$2.dirname(i);
|
|
2158
2204
|
t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
|
|
2159
|
-
})(e, t, s, n,
|
|
2205
|
+
})(e, t, s, n, i, r), i;
|
|
2160
2206
|
}
|
|
2161
|
-
404 ===
|
|
2207
|
+
404 === o.status && known404Urls.add(s);
|
|
2162
2208
|
}
|
|
2163
2209
|
} catch (e) {
|
|
2164
2210
|
console.error(e);
|
|
@@ -2181,7 +2227,7 @@ caller = function() {
|
|
|
2181
2227
|
}
|
|
2182
2228
|
}, r.exports), r.exports;
|
|
2183
2229
|
}((function(e) {
|
|
2184
|
-
var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,
|
|
2230
|
+
var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, o = {
|
|
2185
2231
|
parse: function(e) {
|
|
2186
2232
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2187
2233
|
var t = function r(e) {
|
|
@@ -2210,26 +2256,26 @@ caller = function() {
|
|
|
2210
2256
|
ext: r[4],
|
|
2211
2257
|
name: r[3]
|
|
2212
2258
|
};
|
|
2213
|
-
}, e.exports = s ?
|
|
2259
|
+
}, e.exports = s ? o.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = o.parse;
|
|
2214
2260
|
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2215
|
-
var s, n,
|
|
2216
|
-
for (/^([A-Za-z]:)/.test(t) ?
|
|
2261
|
+
var s, n, o = "/";
|
|
2262
|
+
for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"), s = [ t ],
|
|
2217
2263
|
n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
|
|
2218
2264
|
return s.reduce((function(e, t) {
|
|
2219
2265
|
return e.concat(r.map((function(e) {
|
|
2220
|
-
return path__default.default.resolve(
|
|
2266
|
+
return path__default.default.resolve(o, t, e);
|
|
2221
2267
|
})));
|
|
2222
2268
|
}), []);
|
|
2223
2269
|
}, nodeModulesPaths = function e(t, r, s) {
|
|
2224
|
-
var n,
|
|
2270
|
+
var n, o = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
|
|
2225
2271
|
return r && "function" == typeof r.paths ? r.paths(s, t, (function() {
|
|
2226
|
-
return getNodeModulesDirs(t,
|
|
2227
|
-
}), r) : (n = getNodeModulesDirs(t,
|
|
2272
|
+
return getNodeModulesDirs(t, o);
|
|
2273
|
+
}), r) : (n = getNodeModulesDirs(t, o), r && r.paths ? n.concat(r.paths) : n);
|
|
2228
2274
|
}, normalizeOptions = function(e, t) {
|
|
2229
2275
|
return t || {};
|
|
2230
2276
|
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2231
2277
|
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2232
|
-
var r, s, n,
|
|
2278
|
+
var r, s, n, o, i, a, l, c = this;
|
|
2233
2279
|
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2234
2280
|
for (r = slice.call(arguments, 1), n = function() {
|
|
2235
2281
|
if (this instanceof s) {
|
|
@@ -2237,8 +2283,8 @@ toStr = Object.prototype.toString, implementation = function e(t) {
|
|
|
2237
2283
|
return Object(e) === e ? e : this;
|
|
2238
2284
|
}
|
|
2239
2285
|
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2240
|
-
},
|
|
2241
|
-
return s = Function("binder", "return function (" +
|
|
2286
|
+
}, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
|
|
2287
|
+
return s = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this,arguments); }")(n),
|
|
2242
2288
|
c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
|
|
2243
2289
|
l.prototype = null), s;
|
|
2244
2290
|
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
@@ -2363,13 +2409,13 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2363
2409
|
}
|
|
2364
2410
|
}));
|
|
2365
2411
|
}, getPackageCandidates$1 = function e(t, r, s) {
|
|
2366
|
-
var n,
|
|
2367
|
-
for (n = 0; n <
|
|
2368
|
-
return
|
|
2412
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2413
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2414
|
+
return o;
|
|
2369
2415
|
}, async = function e(t, r, s) {
|
|
2370
2416
|
function n(e) {
|
|
2371
2417
|
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,
|
|
2418
|
+
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package, o) : i(T, C.package, o); else {
|
|
2373
2419
|
if (_ && isCoreModule(t)) return S(null, t);
|
|
2374
2420
|
!function r(e, t, s) {
|
|
2375
2421
|
var n = function() {
|
|
@@ -2387,7 +2433,7 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2387
2433
|
}));
|
|
2388
2434
|
}
|
|
2389
2435
|
}
|
|
2390
|
-
function
|
|
2436
|
+
function o(e, r, s) {
|
|
2391
2437
|
e ? S(e) : r ? S(null, r, s) : l(T, (function(e, r, s) {
|
|
2392
2438
|
if (e) S(e); else if (r) maybeRealpath(f, r, C, (function(e, t) {
|
|
2393
2439
|
e ? S(e) : S(null, t, s);
|
|
@@ -2397,20 +2443,20 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2397
2443
|
}
|
|
2398
2444
|
}));
|
|
2399
2445
|
}
|
|
2400
|
-
function
|
|
2446
|
+
function i(e, t, r) {
|
|
2401
2447
|
var s = t, n = r;
|
|
2402
2448
|
"function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
|
|
2403
|
-
function
|
|
2449
|
+
function o(s, o, a) {
|
|
2404
2450
|
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,
|
|
2451
|
+
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),
|
|
2452
|
+
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
|
|
2407
2453
|
}
|
|
2408
|
-
function
|
|
2409
|
-
return s ? n(s) :
|
|
2454
|
+
function i(s, o) {
|
|
2455
|
+
return s ? n(s) : o ? n(null, l, c) : void e(t.slice(1), r, c);
|
|
2410
2456
|
}
|
|
2411
2457
|
var l, c;
|
|
2412
2458
|
if (0 === t.length) return n(null, void 0, s);
|
|
2413
|
-
l = r + t[0], (c = s) ?
|
|
2459
|
+
l = r + t[0], (c = s) ? o(null, c) : a(path__default.default.dirname(l), o);
|
|
2414
2460
|
}([ "" ].concat(w), e, s);
|
|
2415
2461
|
}
|
|
2416
2462
|
function a(e, t) {
|
|
@@ -2421,8 +2467,8 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2421
2467
|
if (!s) return a(path__default.default.dirname(e), t);
|
|
2422
2468
|
m(p, n, (function(r, s) {
|
|
2423
2469
|
r && t(r);
|
|
2424
|
-
var
|
|
2425
|
-
|
|
2470
|
+
var o = s;
|
|
2471
|
+
o && C.packageFilter && (o = C.packageFilter(o, n)), t(null, o, e);
|
|
2426
2472
|
}));
|
|
2427
2473
|
}));
|
|
2428
2474
|
}));
|
|
@@ -2431,31 +2477,31 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2431
2477
|
var s = r, n = t;
|
|
2432
2478
|
"function" == typeof n && (s = n, n = C.package), maybeRealpath(f, e, C, (function(t, r) {
|
|
2433
2479
|
if (t) return s(t);
|
|
2434
|
-
var
|
|
2435
|
-
d(
|
|
2436
|
-
return t ? s(t) : r ? void m(p,
|
|
2480
|
+
var o = path__default.default.join(r, "package.json");
|
|
2481
|
+
d(o, (function(t, r) {
|
|
2482
|
+
return t ? s(t) : r ? void m(p, o, (function(t, r) {
|
|
2437
2483
|
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
|
|
2484
|
+
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",
|
|
2485
|
+
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void i(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2440
2486
|
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
|
-
})) :
|
|
2487
|
+
return t ? s(t) : r ? s(null, r, n) : void i(path__default.default.join(e, "index"), n, s);
|
|
2488
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2489
|
+
}))) : void i(path__default.default.join(e, "/index"), n, s));
|
|
2490
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2445
2491
|
}));
|
|
2446
2492
|
}));
|
|
2447
2493
|
}
|
|
2448
2494
|
function c(e, t) {
|
|
2449
|
-
function r(t, r,
|
|
2450
|
-
return t ? e(t) : r ? e(null, r,
|
|
2495
|
+
function r(t, r, o) {
|
|
2496
|
+
return t ? e(t) : r ? e(null, r, o) : void l(n, C.package, s);
|
|
2451
2497
|
}
|
|
2452
2498
|
function s(r, s, n) {
|
|
2453
2499
|
return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
|
|
2454
2500
|
}
|
|
2455
2501
|
if (0 === t.length) return e(null, void 0);
|
|
2456
2502
|
var n = t[0];
|
|
2457
|
-
h(path__default.default.dirname(n), (function
|
|
2458
|
-
return s ? e(s) : a ? void
|
|
2503
|
+
h(path__default.default.dirname(n), (function o(s, a) {
|
|
2504
|
+
return s ? e(s) : a ? void i(n, C.package, r) : c(e, t.slice(1));
|
|
2459
2505
|
}));
|
|
2460
2506
|
}
|
|
2461
2507
|
var u, d, h, p, f, m, g, y, w, _, v, b, E, T, S = s, C = r;
|
|
@@ -2595,64 +2641,64 @@ defaultIsFile = function e(t) {
|
|
|
2595
2641
|
return JSON.parse(s);
|
|
2596
2642
|
} catch (e) {}
|
|
2597
2643
|
}, getPackageCandidates = function e(t, r, s) {
|
|
2598
|
-
var n,
|
|
2599
|
-
for (n = 0; n <
|
|
2600
|
-
return
|
|
2644
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2645
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2646
|
+
return o;
|
|
2601
2647
|
}, sync = function e(t, r) {
|
|
2602
2648
|
function s(e) {
|
|
2603
|
-
var t, r, s,
|
|
2604
|
-
if (l && l.dir && l.pkg &&
|
|
2605
|
-
(r =
|
|
2649
|
+
var t, r, s, o, l = n(path__default.default.dirname(e));
|
|
2650
|
+
if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2651
|
+
(r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2606
2652
|
a(e)) return e;
|
|
2607
|
-
for (s = 0; s < p.length; s++) if (
|
|
2653
|
+
for (s = 0; s < p.length; s++) if (o = e + p[s], a(o)) return o;
|
|
2608
2654
|
}
|
|
2609
2655
|
function n(e) {
|
|
2610
2656
|
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)) &&
|
|
2657
|
+
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"),
|
|
2658
|
+
a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
|
|
2613
2659
|
pkg: r,
|
|
2614
2660
|
dir: e
|
|
2615
2661
|
}) : n(path__default.default.dirname(e));
|
|
2616
2662
|
}
|
|
2617
|
-
function
|
|
2618
|
-
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e,
|
|
2663
|
+
function o(e) {
|
|
2664
|
+
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
|
|
2619
2665
|
if (a(h)) {
|
|
2620
2666
|
try {
|
|
2621
2667
|
t = d(l, h);
|
|
2622
2668
|
} catch (e) {}
|
|
2623
|
-
if (t &&
|
|
2669
|
+
if (t && i.packageFilter && (t = i.packageFilter(t, e)), t && t.main) {
|
|
2624
2670
|
if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2625
2671
|
r;
|
|
2626
2672
|
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2627
2673
|
try {
|
|
2628
2674
|
if (n = s(path__default.default.resolve(e, t.main))) return n;
|
|
2629
|
-
if (c =
|
|
2675
|
+
if (c = o(path__default.default.resolve(e, t.main))) return c;
|
|
2630
2676
|
} catch (e) {}
|
|
2631
2677
|
}
|
|
2632
2678
|
}
|
|
2633
2679
|
return s(path__default.default.join(e, "/index"));
|
|
2634
2680
|
}
|
|
2635
|
-
var
|
|
2681
|
+
var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
|
|
2636
2682
|
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),
|
|
2683
|
+
if (i = normalizeOptions(0, r), a = i.isFile || defaultIsFile, l = i.readFileSync || fs__default.default.readFileSync,
|
|
2684
|
+
c = i.isDirectory || defaultIsDir, u = i.realpathSync || defaultRealpathSync, d = i.readPackageSync || defaultReadPackageSync,
|
|
2685
|
+
i.readFileSync && i.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
2686
|
+
if (h = i.packageIterator, p = i.extensions || [ ".js" ], f = !1 !== i.includeCoreModules,
|
|
2687
|
+
m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || [],
|
|
2688
|
+
y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2643
2689
|
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2644
|
-
_ = s(w) ||
|
|
2690
|
+
_ = s(w) || o(w)) return maybeRealpathSync(u, _, i);
|
|
2645
2691
|
} else {
|
|
2646
2692
|
if (f && isCoreModule(t)) return t;
|
|
2647
2693
|
if (v = function E(e, t) {
|
|
2648
2694
|
var r, n, a, l, u = function() {
|
|
2649
|
-
return getPackageCandidates(e, t,
|
|
2650
|
-
}, d = h ? h(e, t, u,
|
|
2695
|
+
return getPackageCandidates(e, t, i);
|
|
2696
|
+
}, d = h ? h(e, t, u, i) : u();
|
|
2651
2697
|
for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
|
|
2652
2698
|
if (a = s(n)) return a;
|
|
2653
|
-
if (l =
|
|
2699
|
+
if (l = o(n)) return l;
|
|
2654
2700
|
}
|
|
2655
|
-
}(t, y)) return maybeRealpathSync(u, v,
|
|
2701
|
+
}(t, y)) return maybeRealpathSync(u, v, i);
|
|
2656
2702
|
}
|
|
2657
2703
|
throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
|
|
2658
2704
|
b;
|
|
@@ -2689,8 +2735,8 @@ const createSystem = e => {
|
|
|
2689
2735
|
let r = BLUE, s = "Build", n = "";
|
|
2690
2736
|
"error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
|
|
2691
2737
|
s = "Warning"), e.header && (s = e.header);
|
|
2692
|
-
const
|
|
2693
|
-
if (
|
|
2738
|
+
const o = e.relFilePath || e.absFilePath;
|
|
2739
|
+
if (o && (n += o, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
|
|
2694
2740
|
"number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
|
|
2695
2741
|
n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
|
|
2696
2742
|
n += "\n" + e.lineNumber + ": " + e.text;
|
|
@@ -2701,46 +2747,7 @@ const createSystem = e => {
|
|
|
2701
2747
|
})(t, e)));
|
|
2702
2748
|
}
|
|
2703
2749
|
};
|
|
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 => {
|
|
2750
|
+
})(), 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
2751
|
if ("/" === e || "" === e) return "/";
|
|
2745
2752
|
const t = path$2.dirname(e), r = path$2.basename(e);
|
|
2746
2753
|
return t.endsWith("/") ? normalizePath(`${t}${r}`) : normalizePath(`${t}/${r}`);
|
|
@@ -2760,8 +2767,8 @@ const createSystem = e => {
|
|
|
2760
2767
|
}, d = (e, t, s) => {
|
|
2761
2768
|
const n = path$2.dirname(e);
|
|
2762
2769
|
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && d(n, t, s);
|
|
2763
|
-
const
|
|
2764
|
-
|
|
2770
|
+
const o = r.get(e);
|
|
2771
|
+
o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
|
|
2765
2772
|
basename: path$2.basename(e),
|
|
2766
2773
|
dirname: n,
|
|
2767
2774
|
isDirectory: !0,
|
|
@@ -2785,10 +2792,10 @@ const createSystem = e => {
|
|
|
2785
2792
|
}), m = (e, t, s) => {
|
|
2786
2793
|
const n = w(e);
|
|
2787
2794
|
if (!n.error && !s.error) if (n.isFile) {
|
|
2788
|
-
const n = path$2.dirname(t),
|
|
2795
|
+
const n = path$2.dirname(t), o = u(n, {
|
|
2789
2796
|
recursive: !0
|
|
2790
|
-
}),
|
|
2791
|
-
s.newDirs.push(...
|
|
2797
|
+
}), i = r.get(e).data, a = b(t, i);
|
|
2798
|
+
s.newDirs.push(...o.newDirs), s.renamed.push({
|
|
2792
2799
|
oldPath: e,
|
|
2793
2800
|
newPath: t,
|
|
2794
2801
|
isDirectory: !1,
|
|
@@ -2886,8 +2893,8 @@ const createSystem = e => {
|
|
|
2886
2893
|
u("/");
|
|
2887
2894
|
const S = {
|
|
2888
2895
|
name: "in-memory",
|
|
2889
|
-
version: "2.
|
|
2890
|
-
events:
|
|
2896
|
+
version: "2.17.2-0",
|
|
2897
|
+
events: i,
|
|
2891
2898
|
access: async e => c(e),
|
|
2892
2899
|
accessSync: c,
|
|
2893
2900
|
addDestory: n,
|
|
@@ -2934,7 +2941,7 @@ const createSystem = e => {
|
|
|
2934
2941
|
readFileSync: p,
|
|
2935
2942
|
realpath: async e => f(e),
|
|
2936
2943
|
realpathSync: f,
|
|
2937
|
-
removeDestory:
|
|
2944
|
+
removeDestory: o,
|
|
2938
2945
|
rename: async (e, t) => {
|
|
2939
2946
|
const r = {
|
|
2940
2947
|
oldPath: e = normalizePath(e),
|
|
@@ -2971,14 +2978,14 @@ const createSystem = e => {
|
|
|
2971
2978
|
removeFileSync: _,
|
|
2972
2979
|
watchDirectory: (e, t) => {
|
|
2973
2980
|
e = l(e);
|
|
2974
|
-
const s = r.get(e),
|
|
2981
|
+
const s = r.get(e), i = () => {
|
|
2975
2982
|
const s = r.get(e);
|
|
2976
2983
|
if (s && s.watcherCallbacks) {
|
|
2977
2984
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2978
2985
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2979
2986
|
}
|
|
2980
2987
|
};
|
|
2981
|
-
return n(
|
|
2988
|
+
return n(i), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2982
2989
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2983
2990
|
basename: path$2.basename(e),
|
|
2984
2991
|
dirname: path$2.dirname(e),
|
|
@@ -2988,20 +2995,20 @@ const createSystem = e => {
|
|
|
2988
2995
|
data: void 0
|
|
2989
2996
|
}), {
|
|
2990
2997
|
close() {
|
|
2991
|
-
i
|
|
2998
|
+
o(i), i();
|
|
2992
2999
|
}
|
|
2993
3000
|
};
|
|
2994
3001
|
},
|
|
2995
3002
|
watchFile: (e, t) => {
|
|
2996
3003
|
e = l(e);
|
|
2997
|
-
const s = r.get(e),
|
|
3004
|
+
const s = r.get(e), i = () => {
|
|
2998
3005
|
const s = r.get(e);
|
|
2999
3006
|
if (s && s.watcherCallbacks) {
|
|
3000
3007
|
const e = s.watcherCallbacks.indexOf(t);
|
|
3001
3008
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
3002
3009
|
}
|
|
3003
3010
|
};
|
|
3004
|
-
return n(
|
|
3011
|
+
return n(i), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
3005
3012
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
3006
3013
|
basename: path$2.basename(e),
|
|
3007
3014
|
dirname: path$2.dirname(e),
|
|
@@ -3011,7 +3018,7 @@ const createSystem = e => {
|
|
|
3011
3018
|
data: void 0
|
|
3012
3019
|
}), {
|
|
3013
3020
|
close() {
|
|
3014
|
-
i
|
|
3021
|
+
o(i), i();
|
|
3015
3022
|
}
|
|
3016
3023
|
};
|
|
3017
3024
|
},
|
|
@@ -3024,18 +3031,18 @@ const createSystem = e => {
|
|
|
3024
3031
|
return "number" == typeof t && (s = s.slice(0, t)), s;
|
|
3025
3032
|
},
|
|
3026
3033
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
3027
|
-
let r, s = 0, n = !1,
|
|
3034
|
+
let r, s = 0, n = !1, o = !1, i = 0;
|
|
3028
3035
|
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
3036
|
let t = null;
|
|
3030
|
-
const s = e.getCompilerExecutingPath(),
|
|
3031
|
-
name: "stencil.worker." +
|
|
3037
|
+
const s = e.getCompilerExecutingPath(), o = {
|
|
3038
|
+
name: "stencil.worker." + i++
|
|
3032
3039
|
};
|
|
3033
3040
|
try {
|
|
3034
|
-
t = new Worker(s,
|
|
3041
|
+
t = new Worker(s, o);
|
|
3035
3042
|
} catch (e) {
|
|
3036
3043
|
null == r && (r = new Blob([ `importScripts('${s}');` ], {
|
|
3037
3044
|
type: "application/javascript"
|
|
3038
|
-
})), t = new Worker(URL.createObjectURL(r),
|
|
3045
|
+
})), t = new Worker(URL.createObjectURL(r), o);
|
|
3039
3046
|
}
|
|
3040
3047
|
const l = {
|
|
3041
3048
|
worker: t,
|
|
@@ -3064,7 +3071,7 @@ const createSystem = e => {
|
|
|
3064
3071
|
} else t = p(), c.push(t);
|
|
3065
3072
|
t.activeTasks++, t.sendQueue.push(e);
|
|
3066
3073
|
}, g = () => {
|
|
3067
|
-
|
|
3074
|
+
o = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
3068
3075
|
}, y = (...e) => new Promise(((t, r) => {
|
|
3069
3076
|
if (n) r("task canceled"); else {
|
|
3070
3077
|
const n = {
|
|
@@ -3074,7 +3081,7 @@ const createSystem = e => {
|
|
|
3074
3081
|
l.push(n), a.set(n.stencilId, {
|
|
3075
3082
|
resolve: t,
|
|
3076
3083
|
reject: r
|
|
3077
|
-
}),
|
|
3084
|
+
}), o || (o = !0, d.then(g));
|
|
3078
3085
|
}
|
|
3079
3086
|
}));
|
|
3080
3087
|
return {
|
|
@@ -3105,11 +3112,11 @@ const createSystem = e => {
|
|
|
3105
3112
|
return S.resolveModuleId = e => ((e, t, r) => {
|
|
3106
3113
|
const s = ((e, t, r) => ({
|
|
3107
3114
|
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,
|
|
3115
|
+
const o = normalizeFsPath(s);
|
|
3116
|
+
if ((await t.stat(o)).isFile) n(null, !0); else {
|
|
3117
|
+
if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
|
|
3118
|
+
const r = getNodeModuleFetchUrl(e, packageVersions, o);
|
|
3119
|
+
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
|
|
3113
3120
|
}
|
|
3114
3121
|
n(null, !1);
|
|
3115
3122
|
}
|
|
@@ -3122,7 +3129,7 @@ const createSystem = e => {
|
|
|
3122
3129
|
void s(null, !0);
|
|
3123
3130
|
if (isCommonDirModuleFile(n)) return void s(null, !1);
|
|
3124
3131
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
3125
|
-
const
|
|
3132
|
+
const o = getCommonDirUrl(e, packageVersions, n, r), i = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, o, i);
|
|
3126
3133
|
if (isString(a)) return void s(null, !0);
|
|
3127
3134
|
}
|
|
3128
3135
|
}
|
|
@@ -3141,13 +3148,13 @@ const createSystem = e => {
|
|
|
3141
3148
|
}))(e, null, r.exts);
|
|
3142
3149
|
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
3150
|
e)), new Promise(((e, t) => {
|
|
3144
|
-
resolve(r.moduleId, s, ((s, n,
|
|
3151
|
+
resolve(r.moduleId, s, ((s, n, o) => {
|
|
3145
3152
|
if (s) t(s); else {
|
|
3146
3153
|
n = normalizePath(n);
|
|
3147
3154
|
const t = {
|
|
3148
3155
|
moduleId: r.moduleId,
|
|
3149
3156
|
resolveId: n,
|
|
3150
|
-
pkgData:
|
|
3157
|
+
pkgData: o,
|
|
3151
3158
|
pkgDirPath: getPackageDirPath(n, r.moduleId)
|
|
3152
3159
|
};
|
|
3153
3160
|
e(t);
|
|
@@ -3174,7 +3181,8 @@ const createSystem = e => {
|
|
|
3174
3181
|
r.readDirSync = s(r.readDirSync), r.stat = s(r.stat), r.statSync = s(r.statSync),
|
|
3175
3182
|
r.copyFile = n(r.copyFile), r.createDir = n(r.createDir), r.createDirSync = n(r.createDirSync),
|
|
3176
3183
|
r.removeFile = n(r.removeFile), r.removeFileSync = n(r.removeFileSync), r.writeFile = n(r.writeFile),
|
|
3177
|
-
r.writeFileSync = n(r.writeFileSync),
|
|
3184
|
+
r.writeFileSync = n(r.writeFileSync), r.getCompilerExecutingPath = () => "bin/stencil.js",
|
|
3185
|
+
Object.defineProperties(r, {
|
|
3178
3186
|
diskReads: {
|
|
3179
3187
|
get: () => e,
|
|
3180
3188
|
set(t) {
|
|
@@ -3187,7 +3195,7 @@ const createSystem = e => {
|
|
|
3187
3195
|
t = e;
|
|
3188
3196
|
}
|
|
3189
3197
|
}
|
|
3190
|
-
}), !function
|
|
3198
|
+
}), !function o(e) {
|
|
3191
3199
|
return "diskReads" in e && "diskWrites" in e;
|
|
3192
3200
|
}(r)) throw new Error("could not generate TestingSystem");
|
|
3193
3201
|
return r;
|
|
@@ -3257,6 +3265,14 @@ class TestingLogger {
|
|
|
3257
3265
|
printDiagnostics(e) {}
|
|
3258
3266
|
}
|
|
3259
3267
|
|
|
3268
|
+
const createConfigFlags = (e = {}) => ({
|
|
3269
|
+
task: null,
|
|
3270
|
+
args: [],
|
|
3271
|
+
knownArgs: [],
|
|
3272
|
+
unknownArgs: [],
|
|
3273
|
+
...e
|
|
3274
|
+
});
|
|
3275
|
+
|
|
3260
3276
|
class EventSpy {
|
|
3261
3277
|
constructor(e) {
|
|
3262
3278
|
this.eventName = e, this.events = [], this.cursor = 0, this.queuedHandler = [];
|
|
@@ -3359,8 +3375,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3359
3375
|
waitForVisible() {
|
|
3360
3376
|
return new Promise(((e, t) => {
|
|
3361
3377
|
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`),
|
|
3378
|
+
await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
|
|
3379
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3364
3380
|
clearTimeout(r), t(n);
|
|
3365
3381
|
}), s);
|
|
3366
3382
|
}));
|
|
@@ -3368,8 +3384,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3368
3384
|
waitForNotVisible() {
|
|
3369
3385
|
return new Promise(((e, t) => {
|
|
3370
3386
|
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`),
|
|
3387
|
+
await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
|
|
3388
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3373
3389
|
clearTimeout(r), t(n);
|
|
3374
3390
|
}), s);
|
|
3375
3391
|
}));
|
|
@@ -3628,34 +3644,34 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3628
3644
|
var e;
|
|
3629
3645
|
const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
|
|
3630
3646
|
return class r extends t {
|
|
3631
|
-
async runTests(e, t, r, s, n,
|
|
3632
|
-
const
|
|
3647
|
+
async runTests(e, t, r, s, n, o) {
|
|
3648
|
+
const i = process.env;
|
|
3633
3649
|
if (e = e.filter((e => function t(e, r) {
|
|
3634
3650
|
const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
|
|
3635
3651
|
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,
|
|
3652
|
+
}(e.path, i))), "true" === i.__STENCIL_SCREENSHOT__) {
|
|
3653
|
+
const a = JSON.parse(i.__STENCIL_EMULATE_CONFIGS__);
|
|
3654
|
+
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r, s, n, o);
|
|
3655
|
+
} else await super.runTests(e, t, r, s, n, o);
|
|
3640
3656
|
}
|
|
3641
3657
|
};
|
|
3642
3658
|
}, exports.createTesting = async e => {
|
|
3643
3659
|
e = function t(e) {
|
|
3644
3660
|
return e.buildEs5 = !1, e.devMode = !0, e.minifyCss = !1, e.minifyJs = !1, e.hashFileNames = !1,
|
|
3645
|
-
e.validateTypes = !1, e._isTesting = !0, e.buildDist = !0, e.flags = e.flags
|
|
3646
|
-
e.
|
|
3661
|
+
e.validateTypes = !1, e._isTesting = !0, e.buildDist = !0, e.flags.serve = !1, e.flags.open = !1,
|
|
3662
|
+
e.outputTargets.forEach((e => {
|
|
3647
3663
|
"www" === e.type && (e.serviceWorker = null);
|
|
3648
3664
|
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3649
3665
|
}(e);
|
|
3650
3666
|
const {createCompiler: r} = require("../compiler/stencil.js"), s = await r(e);
|
|
3651
|
-
let n,
|
|
3652
|
-
const
|
|
3667
|
+
let n, o;
|
|
3668
|
+
const i = async () => {
|
|
3653
3669
|
const t = [];
|
|
3654
3670
|
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), n && (n.close && t.push(n.close()),
|
|
3655
|
-
n = null),
|
|
3671
|
+
n = null), o && (o.close && t.push(o.close()), o = null), await Promise.all(t);
|
|
3656
3672
|
};
|
|
3657
3673
|
return {
|
|
3658
|
-
destroy:
|
|
3674
|
+
destroy: i,
|
|
3659
3675
|
run: async (t = {}) => {
|
|
3660
3676
|
let r, a = !1, l = !1, c = null;
|
|
3661
3677
|
const u = [];
|
|
@@ -3678,9 +3694,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3678
3694
|
})), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3679
3695
|
e.devServer.reloadStrategy = null;
|
|
3680
3696
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3681
|
-
if (n = l[0],
|
|
3697
|
+
if (n = l[0], o = l[1], t) {
|
|
3682
3698
|
const r = await t;
|
|
3683
|
-
if (!r || !e.watch && hasError(r && r.diagnostics)) return await
|
|
3699
|
+
if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
|
|
3684
3700
|
}
|
|
3685
3701
|
n && (r.__STENCIL_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__STENCIL_BROWSER_URL__}`),
|
|
3686
3702
|
r.__STENCIL_APP_SCRIPT_URL__ = function d(e, t) {
|
|
@@ -3714,13 +3730,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3714
3730
|
waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
|
|
3715
3731
|
pixelmatchModulePath: s
|
|
3716
3732
|
}), e.flags.updateScreenshot || await r.pullMasterBuild(), n.finish("screenshot, initBuild finished");
|
|
3717
|
-
const
|
|
3718
|
-
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(
|
|
3733
|
+
const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
|
|
3734
|
+
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(i, a);
|
|
3719
3735
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3720
3736
|
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3721
3737
|
try {
|
|
3722
3738
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3723
|
-
let s = await r.completeBuild(
|
|
3739
|
+
let s = await r.completeBuild(i);
|
|
3724
3740
|
if (t.finish("screenshot, completeTimespan finished"), s) {
|
|
3725
3741
|
const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
|
|
3726
3742
|
if (s = await r.publishBuild(s), t.finish("screenshot, publishBuild finished"),
|
|
@@ -3777,12 +3793,57 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3777
3793
|
}
|
|
3778
3794
|
}, exports.mockBuildCtx = function mockBuildCtx(e, t) {
|
|
3779
3795
|
return e || (e = mockConfig()), t || (t = mockCompilerCtx(e)), new BuildContext(e, t);
|
|
3780
|
-
}, exports.mockCompilerCtx = mockCompilerCtx, exports.
|
|
3781
|
-
return new index_cjs.MockWindow(e).document;
|
|
3782
|
-
}, exports.mockFetch = mockFetch, exports.mockLogger = function mockLogger() {
|
|
3783
|
-
return new TestingLogger;
|
|
3784
|
-
}, exports.mockStencilSystem = function mockStencilSystem() {
|
|
3796
|
+
}, exports.mockCompilerCtx = mockCompilerCtx, exports.mockCompilerSystem = function mockCompilerSystem() {
|
|
3785
3797
|
return createTestingSystem();
|
|
3798
|
+
}, exports.mockConfig = mockConfig, exports.mockDocument = function mockDocument(e = null) {
|
|
3799
|
+
return new index_cjs.MockWindow(e).document;
|
|
3800
|
+
}, exports.mockFetch = mockFetch, exports.mockLoadConfigInit = e => ({
|
|
3801
|
+
config: {},
|
|
3802
|
+
configPath: void 0,
|
|
3803
|
+
initTsConfig: !0,
|
|
3804
|
+
logger: void 0,
|
|
3805
|
+
sys: void 0,
|
|
3806
|
+
...e
|
|
3807
|
+
}), exports.mockLogger = mockLogger, exports.mockModule = (e = {}) => ({
|
|
3808
|
+
cmps: [],
|
|
3809
|
+
coreRuntimeApis: [],
|
|
3810
|
+
collectionName: "",
|
|
3811
|
+
dtsFilePath: "",
|
|
3812
|
+
excludeFromCollection: !1,
|
|
3813
|
+
externalImports: [],
|
|
3814
|
+
htmlAttrNames: [],
|
|
3815
|
+
htmlTagNames: [],
|
|
3816
|
+
htmlParts: [],
|
|
3817
|
+
isCollectionDependency: !1,
|
|
3818
|
+
isLegacy: !1,
|
|
3819
|
+
jsFilePath: "",
|
|
3820
|
+
localImports: [],
|
|
3821
|
+
originalImports: [],
|
|
3822
|
+
originalCollectionComponentPath: "",
|
|
3823
|
+
potentialCmpRefs: [],
|
|
3824
|
+
sourceFilePath: "",
|
|
3825
|
+
staticSourceFile: "",
|
|
3826
|
+
staticSourceFileText: "",
|
|
3827
|
+
sourceMapPath: "",
|
|
3828
|
+
sourceMapFileText: "",
|
|
3829
|
+
hasVdomAttribute: !1,
|
|
3830
|
+
hasVdomClass: !1,
|
|
3831
|
+
hasVdomFunctional: !1,
|
|
3832
|
+
hasVdomKey: !1,
|
|
3833
|
+
hasVdomListener: !1,
|
|
3834
|
+
hasVdomPropOrAttr: !1,
|
|
3835
|
+
hasVdomRef: !1,
|
|
3836
|
+
hasVdomRender: !1,
|
|
3837
|
+
hasVdomStyle: !1,
|
|
3838
|
+
hasVdomText: !1,
|
|
3839
|
+
hasVdomXlink: !1,
|
|
3840
|
+
...e
|
|
3841
|
+
}), exports.mockValidatedConfig = function mockValidatedConfig(e) {
|
|
3842
|
+
return {
|
|
3843
|
+
...mockConfig(e),
|
|
3844
|
+
flags: createConfigFlags(),
|
|
3845
|
+
logger: mockLogger()
|
|
3846
|
+
};
|
|
3786
3847
|
}, exports.mockWindow = function mockWindow(e = null) {
|
|
3787
3848
|
return new index_cjs.MockWindow(e);
|
|
3788
3849
|
}, exports.newE2EPage = async function newE2EPage(e = {}) {
|
|
@@ -3802,19 +3863,19 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3802
3863
|
const t = process.env;
|
|
3803
3864
|
"true" === t.__STENCIL_SCREENSHOT__ ? e.compareScreenshot = (r, s) => {
|
|
3804
3865
|
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(
|
|
3866
|
+
let o, i = "", a = "";
|
|
3867
|
+
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (i = n.currentSpec.fullName),
|
|
3868
|
+
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (i.length > 0 ? i += ", " + r : i = r,
|
|
3869
|
+
"object" == typeof s && (o = s)) : "object" == typeof r && (o = r), i = i.trim(),
|
|
3870
|
+
o = o || {}, !i) throw new Error(`Invalid screenshot description in "${a}"`);
|
|
3871
|
+
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')".`);
|
|
3872
|
+
return n.screenshotDescriptions.add(i), async function l(e, t, r, s, n) {
|
|
3812
3873
|
if ("string" != typeof t.__STENCIL_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
|
|
3813
3874
|
if ("string" != typeof t.__STENCIL_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
3814
|
-
const
|
|
3875
|
+
const o = JSON.parse(t.__STENCIL_EMULATE__), i = JSON.parse(t.__STENCIL_SCREENSHOT_BUILD__);
|
|
3815
3876
|
await function a(e) {
|
|
3816
3877
|
return new Promise((t => setTimeout(t, e)));
|
|
3817
|
-
}(
|
|
3878
|
+
}(i.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
|
|
3818
3879
|
window.requestAnimationFrame((() => {
|
|
3819
3880
|
e();
|
|
3820
3881
|
}));
|
|
@@ -3832,11 +3893,11 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3832
3893
|
width: e.clip.width,
|
|
3833
3894
|
height: e.clip.height
|
|
3834
3895
|
}), t;
|
|
3835
|
-
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold :
|
|
3836
|
-
let h =
|
|
3896
|
+
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : i.pixelmatchThreshold;
|
|
3897
|
+
let h = o.viewport.width, p = o.viewport.height;
|
|
3837
3898
|
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,
|
|
3899
|
+
await compareScreenshot(o, i, u, r, h, p, s, d);
|
|
3900
|
+
}(e, t, i, a, o);
|
|
3840
3901
|
} : e.compareScreenshot = async () => ({
|
|
3841
3902
|
mismatchedPixels: 0,
|
|
3842
3903
|
allowableMismatchedPixels: 1,
|
|
@@ -3884,28 +3945,30 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3884
3945
|
e();
|
|
3885
3946
|
}))));
|
|
3886
3947
|
};
|
|
3887
|
-
const
|
|
3948
|
+
const o = !0 === e.failOnConsoleError, i = !0 === e.failOnNetworkError;
|
|
3888
3949
|
t.on("console", (e => {
|
|
3889
|
-
"error" === e.type() && (r.push({
|
|
3950
|
+
if ("error" === e.type() && (r.push({
|
|
3890
3951
|
type: "error",
|
|
3891
3952
|
message: e.text(),
|
|
3892
3953
|
location: e.location().url
|
|
3893
|
-
}),
|
|
3954
|
+
}), o)) throw new Error(serializeConsoleMessage(e));
|
|
3955
|
+
!function t(e) {
|
|
3894
3956
|
const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
|
|
3895
3957
|
"debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
|
|
3896
3958
|
}(e);
|
|
3897
3959
|
})), t.on("pageerror", (e => {
|
|
3898
|
-
r.push({
|
|
3960
|
+
throw r.push({
|
|
3899
3961
|
type: "pageerror",
|
|
3900
3962
|
message: e.message,
|
|
3901
3963
|
location: e.stack
|
|
3902
|
-
}),
|
|
3964
|
+
}), e;
|
|
3903
3965
|
})), t.on("requestfailed", (e => {
|
|
3904
|
-
r.push({
|
|
3966
|
+
if (r.push({
|
|
3905
3967
|
type: "requestfailed",
|
|
3906
3968
|
message: e.failure().errorText,
|
|
3907
3969
|
location: e.url()
|
|
3908
|
-
}),
|
|
3970
|
+
}), i) throw new Error(e.failure().errorText);
|
|
3971
|
+
console.error("requestfailed", e.url());
|
|
3909
3972
|
})), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
|
|
3910
3973
|
waitUntil: e.waitUntil
|
|
3911
3974
|
}) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
|
|
@@ -3971,7 +4034,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3971
4034
|
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
3972
4035
|
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
3973
4036
|
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
3974
|
-
})),
|
|
4037
|
+
})), o = (e => {
|
|
3975
4038
|
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
4039
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
3977
4040
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
@@ -4031,8 +4094,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4031
4094
|
return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
|
|
4032
4095
|
n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
|
|
4033
4096
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4034
|
-
if (e.strictBuild ? Object.assign(appData.BUILD,
|
|
4035
|
-
!0 ===
|
|
4097
|
+
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
|
|
4098
|
+
!0 === o[e] && (appData.BUILD[e] = !0);
|
|
4036
4099
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4037
4100
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4038
4101
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
@@ -4062,10 +4125,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4062
4125
|
testing.renderVdom(t, e.template());
|
|
4063
4126
|
} else "string" == typeof e.html && (s.body.innerHTML = e.html);
|
|
4064
4127
|
!1 !== e.flushQueue && await s.waitForChanges();
|
|
4065
|
-
let
|
|
4128
|
+
let i = null;
|
|
4066
4129
|
return Object.defineProperty(s, "root", {
|
|
4067
4130
|
get() {
|
|
4068
|
-
if (null ==
|
|
4131
|
+
if (null == i && (i = findRootComponent(t, s.body)), null != i) return i;
|
|
4069
4132
|
const e = s.body.firstElementChild;
|
|
4070
4133
|
return null != e ? e : null;
|
|
4071
4134
|
}
|