@stencil/core 2.12.1 → 2.13.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 +2 -2
- package/cli/index.js +2 -2
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +20 -5
- 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/testing/package.json +1 -1
- package/mock-doc/index.cjs +16 -1
- package/mock-doc/index.d.ts +1 -0
- package/mock-doc/index.js +16 -1
- package/mock-doc/package.json +1 -1
- package/package.json +6 -7
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +4 -4
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +354 -333
- package/testing/jest/jest-config.d.ts +11 -0
- package/testing/jest/jest-runner.d.ts +4 -0
- package/testing/package.json +1 -1
package/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Testing v2.
|
|
2
|
+
Stencil Testing v2.13.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
function _lazyRequire(e) {
|
|
5
5
|
return new Proxy({}, {
|
|
@@ -45,28 +45,28 @@ async function startPuppeteerBrowser(e) {
|
|
|
45
45
|
Array.isArray(e.testing.browserArgs) && e.logger.debug(`puppeteer args: ${e.testing.browserArgs.join(" ")}`),
|
|
46
46
|
"boolean" == typeof e.testing.browserDevtools && e.logger.debug(`puppeteer devtools: ${e.testing.browserDevtools}`),
|
|
47
47
|
"number" == typeof e.testing.browserSlowMo && e.logger.debug(`puppeteer slowMo: ${e.testing.browserSlowMo}`);
|
|
48
|
-
const
|
|
48
|
+
const o = {
|
|
49
49
|
ignoreHTTPSErrors: !0,
|
|
50
50
|
slowMo: e.testing.browserSlowMo
|
|
51
51
|
};
|
|
52
|
-
let
|
|
53
|
-
if (e.testing.browserWSEndpoint)
|
|
52
|
+
let i;
|
|
53
|
+
if (e.testing.browserWSEndpoint) i = await n.connect({
|
|
54
54
|
browserWSEndpoint: e.testing.browserWSEndpoint,
|
|
55
|
-
...
|
|
55
|
+
...o
|
|
56
56
|
}); else {
|
|
57
57
|
const t = {
|
|
58
58
|
args: e.testing.browserArgs,
|
|
59
59
|
headless: e.testing.browserHeadless,
|
|
60
60
|
devtools: e.testing.browserDevtools,
|
|
61
|
-
...
|
|
61
|
+
...o
|
|
62
62
|
};
|
|
63
63
|
e.testing.browserExecutablePath && (t.executablePath = e.testing.browserExecutablePath),
|
|
64
|
-
|
|
64
|
+
i = await n.launch({
|
|
65
65
|
...t
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
return t.__STENCIL_BROWSER_WS_ENDPOINT__ =
|
|
69
|
-
|
|
68
|
+
return t.__STENCIL_BROWSER_WS_ENDPOINT__ = i.wsEndpoint(), e.logger.debug(`puppeteer browser wsEndpoint: ${t.__STENCIL_BROWSER_WS_ENDPOINT__}`),
|
|
69
|
+
i;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function getAppStyleUrl(e, t) {
|
|
@@ -76,13 +76,13 @@ function getAppStyleUrl(e, t) {
|
|
|
76
76
|
function getAppUrl(e, t, r) {
|
|
77
77
|
const s = e.outputTargets.find(isOutputTargetWww);
|
|
78
78
|
if (s) {
|
|
79
|
-
const e = s.buildDir, n = path$2.join(e, r),
|
|
80
|
-
return new URL(
|
|
79
|
+
const e = s.buildDir, n = path$2.join(e, r), o = path$2.relative(s.dir, n);
|
|
80
|
+
return new URL(o, t).href;
|
|
81
81
|
}
|
|
82
82
|
const n = e.outputTargets.find(isOutputTargetDistLazy);
|
|
83
83
|
if (n) {
|
|
84
|
-
const s = n.esmDir,
|
|
85
|
-
return new URL(
|
|
84
|
+
const s = n.esmDir, o = path$2.join(s, r), i = path$2.relative(e.rootDir, o);
|
|
85
|
+
return new URL(i, t).href;
|
|
86
86
|
}
|
|
87
87
|
return t;
|
|
88
88
|
}
|
|
@@ -133,8 +133,28 @@ async function runJest(e, t) {
|
|
|
133
133
|
const t = require("yargs"), r = [ ...e.flags.unknownArgs.slice(), ...e.flags.knownArgs.slice() ];
|
|
134
134
|
r.some((e => e.startsWith("--max-workers") || e.startsWith("--maxWorkers"))) || r.push(`--max-workers=${e.maxConcurrentWorkers}`),
|
|
135
135
|
e.flags.devtools && r.push("--runInBand"), e.logger.info(e.logger.magenta(`jest args: ${r.join(" ")}`));
|
|
136
|
-
|
|
137
|
-
if (
|
|
136
|
+
let s = t(r).argv;
|
|
137
|
+
if (s = {
|
|
138
|
+
...s,
|
|
139
|
+
detectLeaks: !1,
|
|
140
|
+
"detect-leaks": !1,
|
|
141
|
+
detectOpenHandles: !1,
|
|
142
|
+
"detect-open-handles": !1,
|
|
143
|
+
errorOnDeprecated: !1,
|
|
144
|
+
"error-on-deprecated": !1,
|
|
145
|
+
listTests: !1,
|
|
146
|
+
"list-tests": !1,
|
|
147
|
+
maxConcurrency: 5,
|
|
148
|
+
"max-concurrency": 5,
|
|
149
|
+
notifyMode: "failure-change",
|
|
150
|
+
"notify-mode": "failure-change",
|
|
151
|
+
passWithNoTests: !1,
|
|
152
|
+
"pass-with-no-tests": !1,
|
|
153
|
+
runTestsByPath: !1,
|
|
154
|
+
"run-tests-by-path": !1,
|
|
155
|
+
testLocationInResults: !1,
|
|
156
|
+
"test-location-in-results": !1
|
|
157
|
+
}, s.config = function n(e) {
|
|
138
158
|
const t = e.testing, r = require("jest-config").defaults, s = Object.keys(r), n = {};
|
|
139
159
|
return Object.keys(t).forEach((e => {
|
|
140
160
|
s.includes(e) && (n[e] = t[e]);
|
|
@@ -145,16 +165,16 @@ async function runJest(e, t) {
|
|
|
145
165
|
isString(t.preset) && (n.preset = t.preset), t.projects && (n.projects = t.projects),
|
|
146
166
|
Array.isArray(t.reporters) && (n.reporters = t.reporters), isString(t.testResultsProcessor) && (n.testResultsProcessor = t.testResultsProcessor),
|
|
147
167
|
t.transform && (n.transform = t.transform), t.verbose && (n.verbose = t.verbose),
|
|
148
|
-
JSON.stringify(n);
|
|
149
|
-
}(e), "string" == typeof
|
|
150
|
-
|
|
168
|
+
n.testRunner = "jest-jasmine2", JSON.stringify(n);
|
|
169
|
+
}(e), "string" == typeof s.maxWorkers) try {
|
|
170
|
+
s.maxWorkers = parseInt(s.maxWorkers, 10);
|
|
151
171
|
} catch (e) {}
|
|
152
|
-
return "string" == typeof
|
|
153
|
-
}(e),
|
|
172
|
+
return "string" == typeof s.ci && (s.ci = "true" === s.ci || "" === s.ci), s;
|
|
173
|
+
}(e), o = function o(e, t) {
|
|
154
174
|
const r = t.projects ? t.projects : [];
|
|
155
175
|
return r.push(e.rootDir), r;
|
|
156
|
-
}(e, n), {runCLI:
|
|
157
|
-
r = !!(await
|
|
176
|
+
}(e, n), {runCLI: i} = require("@jest/core");
|
|
177
|
+
r = !!(await i(n, o)).results.success;
|
|
158
178
|
} catch (t) {
|
|
159
179
|
e.logger.error(`runJest: ${t}`);
|
|
160
180
|
}
|
|
@@ -226,30 +246,30 @@ function getCompilerOptions(e) {
|
|
|
226
246
|
};
|
|
227
247
|
if (1 === e.category && (t.level = "error"), e.file) {
|
|
228
248
|
t.absFilePath = e.file.fileName;
|
|
229
|
-
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 = {
|
|
230
250
|
lineIndex: n.line,
|
|
231
251
|
lineNumber: n.line + 1,
|
|
232
252
|
text: s[n.line],
|
|
233
253
|
errorCharStart: n.character,
|
|
234
254
|
errorLength: Math.max(e.length, 1)
|
|
235
255
|
};
|
|
236
|
-
if (t.lineNumber =
|
|
237
|
-
0 ===
|
|
238
|
-
|
|
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) {
|
|
239
259
|
const e = {
|
|
240
|
-
lineIndex:
|
|
241
|
-
lineNumber:
|
|
242
|
-
text: s[
|
|
260
|
+
lineIndex: o.lineIndex - 1,
|
|
261
|
+
lineNumber: o.lineNumber - 1,
|
|
262
|
+
text: s[o.lineIndex - 1],
|
|
243
263
|
errorCharStart: -1,
|
|
244
264
|
errorLength: -1
|
|
245
265
|
};
|
|
246
266
|
t.lines.unshift(e);
|
|
247
267
|
}
|
|
248
|
-
if (
|
|
268
|
+
if (o.lineIndex + 1 < s.length) {
|
|
249
269
|
const e = {
|
|
250
|
-
lineIndex:
|
|
251
|
-
lineNumber:
|
|
252
|
-
text: s[
|
|
270
|
+
lineIndex: o.lineIndex + 1,
|
|
271
|
+
lineNumber: o.lineNumber + 1,
|
|
272
|
+
text: s[o.lineIndex + 1],
|
|
253
273
|
errorCharStart: -1,
|
|
254
274
|
errorLength: -1
|
|
255
275
|
};
|
|
@@ -293,11 +313,11 @@ function compareHtml(e, t, r) {
|
|
|
293
313
|
});
|
|
294
314
|
}
|
|
295
315
|
}
|
|
296
|
-
const
|
|
316
|
+
const o = index_cjs.parseHtmlToFragment(t), i = index_cjs.serializeNodeToHtml(o, {
|
|
297
317
|
prettyHtml: !0,
|
|
298
318
|
excludeTags: [ "body" ]
|
|
299
319
|
});
|
|
300
|
-
return s !==
|
|
320
|
+
return s !== i ? (expect(s).toBe(i), {
|
|
301
321
|
message: () => "HTML does not match",
|
|
302
322
|
pass: !1
|
|
303
323
|
}) : {
|
|
@@ -368,7 +388,7 @@ function assertPath(e) {
|
|
|
368
388
|
}
|
|
369
389
|
|
|
370
390
|
function normalizeStringPosix(e, t) {
|
|
371
|
-
var r, s, n,
|
|
391
|
+
var r, s, n, o = "", i = 0, a = -1, l = 0;
|
|
372
392
|
for (s = 0; s <= e.length; ++s) {
|
|
373
393
|
if (s < e.length) r = e.charCodeAt(s); else {
|
|
374
394
|
if (47 === r) break;
|
|
@@ -376,27 +396,27 @@ function normalizeStringPosix(e, t) {
|
|
|
376
396
|
}
|
|
377
397
|
if (47 === r) {
|
|
378
398
|
if (a === s - 1 || 1 === l) ; else if (a !== s - 1 && 2 === l) {
|
|
379
|
-
if (
|
|
380
|
-
if ((n =
|
|
381
|
-
-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("/"),
|
|
382
402
|
a = s, l = 0;
|
|
383
403
|
continue;
|
|
384
404
|
}
|
|
385
|
-
} else if (2 ===
|
|
386
|
-
|
|
405
|
+
} else if (2 === o.length || 1 === o.length) {
|
|
406
|
+
o = "", i = 0, a = s, l = 0;
|
|
387
407
|
continue;
|
|
388
408
|
}
|
|
389
|
-
t && (
|
|
390
|
-
} 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;
|
|
391
411
|
a = s, l = 0;
|
|
392
412
|
} else 46 === r && -1 !== l ? ++l : l = -1;
|
|
393
413
|
}
|
|
394
|
-
return
|
|
414
|
+
return o;
|
|
395
415
|
}
|
|
396
416
|
|
|
397
417
|
function specifierIncluded$1(e, t) {
|
|
398
|
-
var r, s, n,
|
|
399
|
-
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;
|
|
400
420
|
return ">=" === a;
|
|
401
421
|
}
|
|
402
422
|
|
|
@@ -408,9 +428,9 @@ function matchesRange$1(e, t) {
|
|
|
408
428
|
}
|
|
409
429
|
|
|
410
430
|
function specifierIncluded(e) {
|
|
411
|
-
var t, r, s, n = e.split(" "),
|
|
412
|
-
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(
|
|
413
|
-
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;
|
|
414
434
|
}
|
|
415
435
|
|
|
416
436
|
function matchesRange(e) {
|
|
@@ -519,23 +539,23 @@ function mockCompilerCtx(e) {
|
|
|
519
539
|
if (!0 === r.inMemoryOnly) {
|
|
520
540
|
let n = e;
|
|
521
541
|
n.endsWith("/") || (n += "/");
|
|
522
|
-
const
|
|
542
|
+
const o = e.split("/");
|
|
523
543
|
t.forEach(((t, n) => {
|
|
524
544
|
if (!n.startsWith(e)) return;
|
|
525
545
|
const a = n.split("/");
|
|
526
|
-
if ((a.length ===
|
|
546
|
+
if ((a.length === o.length + 1 || r.recursive && a.length > o.length) && t.exists) {
|
|
527
547
|
const e = {
|
|
528
548
|
absPath: n,
|
|
529
|
-
relPath: a[
|
|
549
|
+
relPath: a[o.length],
|
|
530
550
|
isDirectory: t.isDirectory,
|
|
531
551
|
isFile: t.isFile
|
|
532
552
|
};
|
|
533
|
-
|
|
553
|
+
i(r, e) || s.push(e);
|
|
534
554
|
}
|
|
535
555
|
}));
|
|
536
|
-
} else await
|
|
556
|
+
} else await o(e, e, r, s);
|
|
537
557
|
return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
|
|
538
|
-
},
|
|
558
|
+
}, o = async (t, r, s, n) => {
|
|
539
559
|
const a = await e.readDir(r);
|
|
540
560
|
if (a.length > 0) {
|
|
541
561
|
const e = b(r);
|
|
@@ -546,10 +566,10 @@ function mockCompilerCtx(e) {
|
|
|
546
566
|
isDirectory: l.isDirectory,
|
|
547
567
|
isFile: l.isFile
|
|
548
568
|
};
|
|
549
|
-
|
|
569
|
+
i(s, u) || (n.push(u), !0 === s.recursive && !0 === l.isDirectory && await o(t, r, s, n));
|
|
550
570
|
})));
|
|
551
571
|
}
|
|
552
|
-
},
|
|
572
|
+
}, i = (e, t) => {
|
|
553
573
|
if (t.isDirectory) {
|
|
554
574
|
if (Array.isArray(e.excludeDirNames)) {
|
|
555
575
|
const r = path$2.basename(t.absPath);
|
|
@@ -602,26 +622,26 @@ function mockCompilerCtx(e) {
|
|
|
602
622
|
}, d = async (t, s, n) => {
|
|
603
623
|
if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
|
|
604
624
|
if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
|
|
605
|
-
const
|
|
625
|
+
const o = {
|
|
606
626
|
ignored: !1,
|
|
607
627
|
changedContent: !1,
|
|
608
628
|
queuedWrite: !1
|
|
609
629
|
};
|
|
610
|
-
if (!0 === shouldIgnore(t)) return
|
|
611
|
-
const
|
|
612
|
-
if (
|
|
613
|
-
"string" == typeof
|
|
614
|
-
|
|
615
|
-
!1 === n.useCache && (
|
|
630
|
+
if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
|
|
631
|
+
const i = b(t);
|
|
632
|
+
if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
|
|
633
|
+
"string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : o.changedContent = !0,
|
|
634
|
+
i.fileText = s, o.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
|
|
635
|
+
!1 === n.useCache && (i.useCache = !1)), null != n && !0 === n.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
|
|
616
636
|
await h(t, !0); else if (null != n && !0 === n.immediateWrite) {
|
|
617
|
-
if (
|
|
637
|
+
if (o.changedContent || !0 !== n.useCache) {
|
|
618
638
|
const r = await e.readFile(t);
|
|
619
|
-
"string" == typeof r && (
|
|
620
|
-
|
|
639
|
+
"string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
|
|
640
|
+
o.changedContent && (await h(t, !1), await e.writeFile(t, i.fileText));
|
|
621
641
|
}
|
|
622
|
-
} else
|
|
623
|
-
|
|
624
|
-
return
|
|
642
|
+
} else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
|
|
643
|
+
o.queuedWrite = !0);
|
|
644
|
+
return o;
|
|
625
645
|
}, h = async (e, t) => {
|
|
626
646
|
const r = [];
|
|
627
647
|
for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
|
|
@@ -704,12 +724,12 @@ function mockCompilerCtx(e) {
|
|
|
704
724
|
clearDirCache: _,
|
|
705
725
|
clearFileCache: v,
|
|
706
726
|
commit: async () => {
|
|
707
|
-
const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy),
|
|
727
|
+
const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy), o = await y(e.filesToDelete), i = await w(e.dirsToDelete);
|
|
708
728
|
return e.filesToDelete.forEach(v), e.dirsToDelete.forEach(_), {
|
|
709
729
|
filesCopied: n,
|
|
710
730
|
filesWritten: s,
|
|
711
|
-
filesDeleted:
|
|
712
|
-
dirsDeleted:
|
|
731
|
+
filesDeleted: o,
|
|
732
|
+
dirsDeleted: i,
|
|
713
733
|
dirsAdded: r
|
|
714
734
|
};
|
|
715
735
|
},
|
|
@@ -819,19 +839,19 @@ async function initPageEvents(e) {
|
|
|
819
839
|
}
|
|
820
840
|
|
|
821
841
|
async function pageSpyOnEvent(e, t, r) {
|
|
822
|
-
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document,
|
|
823
|
-
return await addE2EListener(e,
|
|
842
|
+
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, o = await e.evaluateHandle(n);
|
|
843
|
+
return await addE2EListener(e, o, t, (e => {
|
|
824
844
|
s.push(e);
|
|
825
845
|
})), s;
|
|
826
846
|
}
|
|
827
847
|
|
|
828
848
|
async function waitForEvent(e, t, r) {
|
|
829
849
|
const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate(((e, t, r) => new Promise(((s, n) => {
|
|
830
|
-
const
|
|
850
|
+
const o = setTimeout((() => {
|
|
831
851
|
n(new Error(`waitForEvent() timeout, eventName: ${t}`));
|
|
832
852
|
}), r);
|
|
833
853
|
e.addEventListener(t, (e => {
|
|
834
|
-
clearTimeout(
|
|
854
|
+
clearTimeout(o), s(window.stencilSerializeEvent(e));
|
|
835
855
|
}), {
|
|
836
856
|
once: !0
|
|
837
857
|
});
|
|
@@ -845,8 +865,8 @@ async function addE2EListener(e, t, r, s) {
|
|
|
845
865
|
eventName: r,
|
|
846
866
|
callback: s
|
|
847
867
|
});
|
|
848
|
-
const
|
|
849
|
-
await
|
|
868
|
+
const o = t.executionContext();
|
|
869
|
+
await o.evaluate(((e, t, r) => {
|
|
850
870
|
e.addEventListener(r, (e => {
|
|
851
871
|
window.stencilOnEvent(t, window.stencilSerializeEvent(e));
|
|
852
872
|
}));
|
|
@@ -902,7 +922,7 @@ function browserContextEvents() {
|
|
|
902
922
|
}
|
|
903
923
|
|
|
904
924
|
async function find(e, t, r) {
|
|
905
|
-
const {lightSelector: s, shadowSelector: n, text:
|
|
925
|
+
const {lightSelector: s, shadowSelector: n, text: o, contains: i} = getSelector(r);
|
|
906
926
|
let a;
|
|
907
927
|
if (a = "string" == typeof s ? await async function l(e, t, r, s) {
|
|
908
928
|
let n = await t.$(r);
|
|
@@ -930,20 +950,20 @@ async function find(e, t, r) {
|
|
|
930
950
|
}(e), s;
|
|
931
951
|
}), t, r, s);
|
|
932
952
|
return n ? n.asElement() : null;
|
|
933
|
-
}(e, t,
|
|
953
|
+
}(e, t, o, i), !a) return null;
|
|
934
954
|
const u = new E2EElement(e, a);
|
|
935
955
|
return await u.e2eSync(), u;
|
|
936
956
|
}
|
|
937
957
|
|
|
938
958
|
async function findAll(e, t, r) {
|
|
939
|
-
const s = [], {lightSelector: n, shadowSelector:
|
|
940
|
-
if (0 ===
|
|
941
|
-
if (
|
|
942
|
-
const r =
|
|
959
|
+
const s = [], {lightSelector: n, shadowSelector: o} = getSelector(r), i = await t.$$(n);
|
|
960
|
+
if (0 === i.length) return s;
|
|
961
|
+
if (o) for (let t = 0; t < i.length; t++) {
|
|
962
|
+
const r = i[t].executionContext(), n = await r.evaluateHandle(((e, t) => {
|
|
943
963
|
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
944
964
|
return e.shadowRoot.querySelectorAll(t);
|
|
945
|
-
}),
|
|
946
|
-
await
|
|
965
|
+
}), i[t], o);
|
|
966
|
+
await i[t].dispose();
|
|
947
967
|
const a = await n.getProperties();
|
|
948
968
|
await n.dispose();
|
|
949
969
|
for (const t of a.values()) {
|
|
@@ -953,8 +973,8 @@ async function findAll(e, t, r) {
|
|
|
953
973
|
await t.e2eSync(), s.push(t);
|
|
954
974
|
}
|
|
955
975
|
}
|
|
956
|
-
} else for (let t = 0; t <
|
|
957
|
-
const r = new E2EElement(e,
|
|
976
|
+
} else for (let t = 0; t < i.length; t++) {
|
|
977
|
+
const r = new E2EElement(e, i[t]);
|
|
958
978
|
await r.e2eSync(), s.push(r);
|
|
959
979
|
}
|
|
960
980
|
return s;
|
|
@@ -993,7 +1013,7 @@ function writeFile(e, t) {
|
|
|
993
1013
|
}));
|
|
994
1014
|
}
|
|
995
1015
|
|
|
996
|
-
async function compareScreenshot(e, t, r, s, n,
|
|
1016
|
+
async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
997
1017
|
const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
|
|
998
1018
|
await async function u(e, t) {
|
|
999
1019
|
await function r(e) {
|
|
@@ -1001,7 +1021,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1001
1021
|
fs__default.default.access(e, (e => t(!e)));
|
|
1002
1022
|
}));
|
|
1003
1023
|
}(e) || await writeFile(e, t);
|
|
1004
|
-
}(c, r), r = null,
|
|
1024
|
+
}(c, r), r = null, i && (i = normalizePath(path$2.relative(t.rootDir, i)));
|
|
1005
1025
|
const d = function h(e, t) {
|
|
1006
1026
|
if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
|
|
1007
1027
|
const r = crypto$3.createHash("md5");
|
|
@@ -1014,9 +1034,9 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1014
1034
|
device: e.device,
|
|
1015
1035
|
userAgent: e.userAgent,
|
|
1016
1036
|
desc: s,
|
|
1017
|
-
testPath:
|
|
1037
|
+
testPath: i,
|
|
1018
1038
|
width: n,
|
|
1019
|
-
height:
|
|
1039
|
+
height: o,
|
|
1020
1040
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1021
1041
|
hasTouch: e.viewport.hasTouch,
|
|
1022
1042
|
isLandscape: e.viewport.isLandscape,
|
|
@@ -1030,14 +1050,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1030
1050
|
device: e.device,
|
|
1031
1051
|
userAgent: e.userAgent,
|
|
1032
1052
|
width: n,
|
|
1033
|
-
height:
|
|
1053
|
+
height: o,
|
|
1034
1054
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1035
1055
|
hasTouch: e.viewport.hasTouch,
|
|
1036
1056
|
isLandscape: e.viewport.isLandscape,
|
|
1037
1057
|
isMobile: e.viewport.isMobile,
|
|
1038
1058
|
allowableMismatchedPixels: t.allowableMismatchedPixels,
|
|
1039
1059
|
allowableMismatchedRatio: t.allowableMismatchedRatio,
|
|
1040
|
-
testPath:
|
|
1060
|
+
testPath: i
|
|
1041
1061
|
}
|
|
1042
1062
|
};
|
|
1043
1063
|
if (t.updateMaster) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
|
|
@@ -1059,7 +1079,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1059
1079
|
};
|
|
1060
1080
|
p.diff.mismatchedPixels = await async function g(e, t) {
|
|
1061
1081
|
return new Promise(((r, s) => {
|
|
1062
|
-
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL,
|
|
1082
|
+
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, o = setTimeout((() => {
|
|
1063
1083
|
s(`getMismatchedPixels timeout: ${n}ms`);
|
|
1064
1084
|
}), n);
|
|
1065
1085
|
try {
|
|
@@ -1068,14 +1088,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1068
1088
|
env: process.env,
|
|
1069
1089
|
cwd: process.cwd(),
|
|
1070
1090
|
stdio: [ "pipe", "pipe", "pipe", "ipc" ]
|
|
1071
|
-
},
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
})),
|
|
1075
|
-
clearTimeout(
|
|
1076
|
-
})),
|
|
1091
|
+
}, i = child_process$2.fork(e, [], n);
|
|
1092
|
+
i.on("message", (e => {
|
|
1093
|
+
i.kill(), clearTimeout(o), r(e);
|
|
1094
|
+
})), i.on("error", (e => {
|
|
1095
|
+
clearTimeout(o), s(e);
|
|
1096
|
+
})), i.send(t);
|
|
1077
1097
|
} catch (e) {
|
|
1078
|
-
clearTimeout(
|
|
1098
|
+
clearTimeout(o), s(`getMismatchedPixels error: ${e}`);
|
|
1079
1099
|
}
|
|
1080
1100
|
}));
|
|
1081
1101
|
}(t.pixelmatchModulePath, n);
|
|
@@ -1092,9 +1112,9 @@ async function e2eGoTo(e, t, r = {}) {
|
|
|
1092
1112
|
if ("string" != typeof s) throw new Error("invalid gotoTest() browser url");
|
|
1093
1113
|
const n = s + t.substring(1);
|
|
1094
1114
|
r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1095
|
-
const
|
|
1096
|
-
if (!
|
|
1097
|
-
return await waitForStencil(e, r),
|
|
1115
|
+
const o = await e._e2eGoto(n, r);
|
|
1116
|
+
if (!o.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${o.status()}`);
|
|
1117
|
+
return await waitForStencil(e, r), o;
|
|
1098
1118
|
}
|
|
1099
1119
|
|
|
1100
1120
|
async function e2eSetContent(e, t, r = {}) {
|
|
@@ -1103,18 +1123,18 @@ async function e2eSetContent(e, t, r = {}) {
|
|
|
1103
1123
|
const s = [], n = env.__STENCIL_APP_SCRIPT_URL__;
|
|
1104
1124
|
if ("string" != typeof n) throw new Error("invalid e2eSetContent() app script url");
|
|
1105
1125
|
s.push("<!doctype html>"), s.push("<html>"), s.push("<head>");
|
|
1106
|
-
const
|
|
1107
|
-
"string" == typeof
|
|
1126
|
+
const o = env.__STENCIL_APP_STYLE_URL__;
|
|
1127
|
+
"string" == typeof o && s.push(`<link rel="stylesheet" href="${o}">`), s.push(`<script type="module" src="${n}"><\/script>`),
|
|
1108
1128
|
s.push("</head>"), s.push("<body>"), s.push(t), s.push("</body>"), s.push("</html>");
|
|
1109
|
-
const
|
|
1129
|
+
const i = env.__STENCIL_BROWSER_URL__;
|
|
1110
1130
|
await e.setRequestInterception(!0), e.on("request", (e => {
|
|
1111
|
-
|
|
1131
|
+
i === e.url() ? e.respond({
|
|
1112
1132
|
status: 200,
|
|
1113
1133
|
contentType: "text/html",
|
|
1114
1134
|
body: s.join("\n")
|
|
1115
1135
|
}) : e.continue();
|
|
1116
1136
|
})), r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1117
|
-
const a = await e._e2eGoto(
|
|
1137
|
+
const a = await e._e2eGoto(i, r);
|
|
1118
1138
|
if (!a.ok()) throw new Error("Testing unable to load content");
|
|
1119
1139
|
return await waitForStencil(e, r), a;
|
|
1120
1140
|
}
|
|
@@ -1222,8 +1242,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1222
1242
|
}, noop = () => {}, isFunction = e => "function" == typeof e, isString = e => "string" == typeof e, isIterable = e => (e => null != e)(e) && isFunction(e[Symbol.iterator]), windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/, hasError = e => null != e && 0 !== e.length && e.some((e => "error" === e.level && "runtime" !== e.type)), normalizePath = e => {
|
|
1223
1243
|
if ("string" != typeof e) throw new Error("invalid path to normalize");
|
|
1224
1244
|
e = normalizeSlashes(e.trim());
|
|
1225
|
-
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1],
|
|
1226
|
-
return "" ===
|
|
1245
|
+
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], o = s + r.slice(1).join("/");
|
|
1246
|
+
return "" === o ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + o : o;
|
|
1227
1247
|
}, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
|
|
1228
1248
|
if (!Array.isArray(e) || 0 === e.length) return [];
|
|
1229
1249
|
const t = [ e[0] ];
|
|
@@ -1260,8 +1280,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1260
1280
|
if (-1 !== r) {
|
|
1261
1281
|
const t = r + "://".length, s = e.indexOf("/", t);
|
|
1262
1282
|
if (-1 !== s) {
|
|
1263
|
-
const n = e.slice(0, r),
|
|
1264
|
-
if ("file" === n && ("" ===
|
|
1283
|
+
const n = e.slice(0, r), o = e.slice(t, s);
|
|
1284
|
+
if ("file" === n && ("" === o || "localhost" === o) && isVolumeCharacter(e.charCodeAt(s + 1))) {
|
|
1265
1285
|
const t = getFileUrlVolumeSeparatorEnd(e, s + 2);
|
|
1266
1286
|
if (-1 !== t) {
|
|
1267
1287
|
if (47 === e.charCodeAt(t)) return ~(t + 1);
|
|
@@ -1314,12 +1334,12 @@ const jestPreprocessor = {
|
|
|
1314
1334
|
currentDirectory: s.rootDir
|
|
1315
1335
|
}, n = getCompilerOptions(s.rootDir);
|
|
1316
1336
|
n && (n.baseUrl && (r.baseUrl = n.baseUrl), n.paths && (r.paths = n.paths));
|
|
1317
|
-
const
|
|
1318
|
-
if (
|
|
1319
|
-
const e =
|
|
1337
|
+
const o = transpile(e, r), i = o.diagnostics.some((e => "error" === e.level));
|
|
1338
|
+
if (o.diagnostics && i) {
|
|
1339
|
+
const e = o.diagnostics.map(formatDiagnostic).join("\n\n");
|
|
1320
1340
|
throw new Error(e);
|
|
1321
1341
|
}
|
|
1322
|
-
return
|
|
1342
|
+
return o.code;
|
|
1323
1343
|
}
|
|
1324
1344
|
return e;
|
|
1325
1345
|
},
|
|
@@ -1331,12 +1351,12 @@ const jestPreprocessor = {
|
|
|
1331
1351
|
return [ process.version, _tsCompilerOptionsKey, e, t, r, !!s.instrument, 7 ].join(":");
|
|
1332
1352
|
}
|
|
1333
1353
|
}, deepEqual = function e(t, r) {
|
|
1334
|
-
var s, n,
|
|
1354
|
+
var s, n, o, i, a, l, c, u, d, h;
|
|
1335
1355
|
if (t === r) return !0;
|
|
1336
1356
|
if (t && r && "object" == typeof t && "object" == typeof r) {
|
|
1337
1357
|
if (s = Array.isArray(t), n = Array.isArray(r), s && n) {
|
|
1338
|
-
if ((
|
|
1339
|
-
for (
|
|
1358
|
+
if ((i = t.length) != r.length) return !1;
|
|
1359
|
+
for (o = i; 0 != o--; ) if (!e(t[o], r[o])) return !1;
|
|
1340
1360
|
return !0;
|
|
1341
1361
|
}
|
|
1342
1362
|
if (s != n) return !1;
|
|
@@ -1344,9 +1364,9 @@ const jestPreprocessor = {
|
|
|
1344
1364
|
if (l && c) return t.getTime() == r.getTime();
|
|
1345
1365
|
if ((u = t instanceof RegExp) != (d = r instanceof RegExp)) return !1;
|
|
1346
1366
|
if (u && d) return t.toString() == r.toString();
|
|
1347
|
-
if ((
|
|
1348
|
-
for (
|
|
1349
|
-
for (
|
|
1367
|
+
if ((i = (h = Object.keys(t)).length) !== Object.keys(r).length) return !1;
|
|
1368
|
+
for (o = i; 0 != o--; ) if (!Object.prototype.hasOwnProperty.call(r, h[o])) return !1;
|
|
1369
|
+
for (o = i; 0 != o--; ) if (!e(t[a = h[o]], r[a])) return !1;
|
|
1350
1370
|
return !0;
|
|
1351
1371
|
}
|
|
1352
1372
|
return t != t && r != r;
|
|
@@ -1744,9 +1764,9 @@ class BuildContext {
|
|
|
1744
1764
|
}
|
|
1745
1765
|
return {
|
|
1746
1766
|
duration: () => r.duration(),
|
|
1747
|
-
finish: (e, s, n,
|
|
1767
|
+
finish: (e, s, n, o) => {
|
|
1748
1768
|
if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
|
|
1749
|
-
r.finish(e, s, n,
|
|
1769
|
+
r.finish(e, s, n, o), !t)) {
|
|
1750
1770
|
const e = {
|
|
1751
1771
|
buildId: this.buildId,
|
|
1752
1772
|
messages: this.buildMessages.slice(),
|
|
@@ -1862,12 +1882,12 @@ class Cache {
|
|
|
1862
1882
|
if (null != t) {
|
|
1863
1883
|
if (e - t < ONE_DAY) return;
|
|
1864
1884
|
const r = this.cacheFs.sys, s = await r.readDir(this.config.cacheDir), n = s.map((e => path$2.join(this.config.cacheDir, e)));
|
|
1865
|
-
let
|
|
1866
|
-
const
|
|
1885
|
+
let o = 0;
|
|
1886
|
+
const i = n.map((async t => {
|
|
1867
1887
|
const s = (await r.stat(t)).mtimeMs;
|
|
1868
|
-
e - s > ONE_WEEK && (await r.removeFile(t),
|
|
1888
|
+
e - s > ONE_WEEK && (await r.removeFile(t), o++);
|
|
1869
1889
|
}));
|
|
1870
|
-
await Promise.all(
|
|
1890
|
+
await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${o}`);
|
|
1871
1891
|
}
|
|
1872
1892
|
this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
|
|
1873
1893
|
}
|
|
@@ -1909,10 +1929,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1909
1929
|
} else if (!0 === e.queueDeleteFromDisk) e.isDirectory && !t.dirsToEnsure.includes(r) ? t.dirsToDelete.push(r) : e.isFile && !t.filesToWrite.includes(r) && t.filesToDelete.push(r); else if ("string" == typeof e.queueCopyFileToDest) {
|
|
1910
1930
|
const s = r, n = e.queueCopyFileToDest;
|
|
1911
1931
|
t.filesToCopy.push([ s, n ]);
|
|
1912
|
-
const
|
|
1913
|
-
t.dirsToEnsure.includes(
|
|
1914
|
-
const
|
|
1915
|
-
|
|
1932
|
+
const o = normalizePath(path$2.dirname(n));
|
|
1933
|
+
t.dirsToEnsure.includes(o) || t.dirsToEnsure.push(o);
|
|
1934
|
+
const i = t.dirsToDelete.indexOf(o);
|
|
1935
|
+
i > -1 && t.dirsToDelete.splice(i, 1);
|
|
1916
1936
|
const a = t.filesToDelete.indexOf(n);
|
|
1917
1937
|
a > -1 && t.filesToDelete.splice(a, 1);
|
|
1918
1938
|
}
|
|
@@ -1945,10 +1965,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1945
1965
|
|
|
1946
1966
|
(posix = {
|
|
1947
1967
|
resolve: function e() {
|
|
1948
|
-
var t, r, s, n = "",
|
|
1949
|
-
for (r = arguments.length - 1; r >= -1 && !
|
|
1950
|
-
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n,
|
|
1951
|
-
return n = normalizeStringPosix(n, !
|
|
1968
|
+
var t, r, s, n = "", o = !1;
|
|
1969
|
+
for (r = arguments.length - 1; r >= -1 && !o; r--) r >= 0 ? s = arguments[r] : (void 0 === t && (t = process.cwd()),
|
|
1970
|
+
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n, o = 47 === s.charCodeAt(0));
|
|
1971
|
+
return n = normalizeStringPosix(n, !o), o ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
|
|
1952
1972
|
},
|
|
1953
1973
|
normalize: function e(t) {
|
|
1954
1974
|
var r, s;
|
|
@@ -1966,70 +1986,70 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1966
1986
|
return void 0 === t ? "." : posix.normalize(t);
|
|
1967
1987
|
},
|
|
1968
1988
|
relative: function e(t, r) {
|
|
1969
|
-
var s, n,
|
|
1989
|
+
var s, n, o, i, a, l, c, u, d, h;
|
|
1970
1990
|
if (assertPath(t), assertPath(r), t === r) return "";
|
|
1971
1991
|
if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
|
|
1972
1992
|
for (s = 1; s < t.length && 47 === t.charCodeAt(s); ++s) ;
|
|
1973
|
-
for (
|
|
1974
|
-
for (l =
|
|
1993
|
+
for (o = (n = t.length) - s, i = 1; i < r.length && 47 === r.charCodeAt(i); ++i) ;
|
|
1994
|
+
for (l = o < (a = r.length - i) ? o : a, c = -1, u = 0; u <= l; ++u) {
|
|
1975
1995
|
if (u === l) {
|
|
1976
1996
|
if (a > l) {
|
|
1977
|
-
if (47 === r.charCodeAt(
|
|
1978
|
-
if (0 === u) return r.slice(
|
|
1979
|
-
} else
|
|
1997
|
+
if (47 === r.charCodeAt(i + u)) return r.slice(i + u + 1);
|
|
1998
|
+
if (0 === u) return r.slice(i + u);
|
|
1999
|
+
} else o > l && (47 === t.charCodeAt(s + u) ? c = u : 0 === u && (c = 0));
|
|
1980
2000
|
break;
|
|
1981
2001
|
}
|
|
1982
|
-
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(
|
|
2002
|
+
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(i + u)) break;
|
|
1983
2003
|
47 === d && (c = u);
|
|
1984
2004
|
}
|
|
1985
2005
|
for (h = "", u = s + c + 1; u <= n; ++u) u !== n && 47 !== t.charCodeAt(u) || (0 === h.length ? h += ".." : h += "/..");
|
|
1986
|
-
return h.length > 0 ? h + r.slice(
|
|
1987
|
-
r.slice(
|
|
2006
|
+
return h.length > 0 ? h + r.slice(i + c) : (i += c, 47 === r.charCodeAt(i) && ++i,
|
|
2007
|
+
r.slice(i));
|
|
1988
2008
|
},
|
|
1989
2009
|
_makeLong: function e(t) {
|
|
1990
2010
|
return t;
|
|
1991
2011
|
},
|
|
1992
2012
|
dirname: function e(t) {
|
|
1993
|
-
var r, s, n,
|
|
2013
|
+
var r, s, n, o;
|
|
1994
2014
|
if (assertPath(t), 0 === t.length) return ".";
|
|
1995
|
-
for (r = 47 === t.charCodeAt(0), s = -1, n = !0,
|
|
2015
|
+
for (r = 47 === t.charCodeAt(0), s = -1, n = !0, o = t.length - 1; o >= 1; --o) if (47 === t.charCodeAt(o)) {
|
|
1996
2016
|
if (!n) {
|
|
1997
|
-
s =
|
|
2017
|
+
s = o;
|
|
1998
2018
|
break;
|
|
1999
2019
|
}
|
|
2000
2020
|
} else n = !1;
|
|
2001
2021
|
return -1 === s ? r ? "/" : "." : r && 1 === s ? "//" : t.slice(0, s);
|
|
2002
2022
|
},
|
|
2003
2023
|
basename: function e(t, r) {
|
|
2004
|
-
var s, n,
|
|
2024
|
+
var s, n, o, i, a, l, c;
|
|
2005
2025
|
if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
|
|
2006
|
-
if (assertPath(t), s = 0, n = -1,
|
|
2026
|
+
if (assertPath(t), s = 0, n = -1, o = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
|
|
2007
2027
|
if (r.length === t.length && r === t) return "";
|
|
2008
|
-
for (a = r.length - 1, l = -1,
|
|
2009
|
-
if (!
|
|
2010
|
-
s =
|
|
2028
|
+
for (a = r.length - 1, l = -1, i = t.length - 1; i >= 0; --i) if (47 === (c = t.charCodeAt(i))) {
|
|
2029
|
+
if (!o) {
|
|
2030
|
+
s = i + 1;
|
|
2011
2031
|
break;
|
|
2012
2032
|
}
|
|
2013
|
-
} else -1 === l && (
|
|
2033
|
+
} else -1 === l && (o = !1, l = i + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (n = i) : (a = -1,
|
|
2014
2034
|
n = l));
|
|
2015
2035
|
return s === n ? n = l : -1 === n && (n = t.length), t.slice(s, n);
|
|
2016
2036
|
}
|
|
2017
|
-
for (
|
|
2018
|
-
if (!
|
|
2019
|
-
s =
|
|
2037
|
+
for (i = t.length - 1; i >= 0; --i) if (47 === t.charCodeAt(i)) {
|
|
2038
|
+
if (!o) {
|
|
2039
|
+
s = i + 1;
|
|
2020
2040
|
break;
|
|
2021
2041
|
}
|
|
2022
|
-
} else -1 === n && (
|
|
2042
|
+
} else -1 === n && (o = !1, n = i + 1);
|
|
2023
2043
|
return -1 === n ? "" : t.slice(s, n);
|
|
2024
2044
|
},
|
|
2025
2045
|
extname: function e(t) {
|
|
2026
|
-
var r, s, n,
|
|
2027
|
-
for (assertPath(t), r = -1, s = 0, n = -1,
|
|
2028
|
-
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !==
|
|
2046
|
+
var r, s, n, o, i, a, l;
|
|
2047
|
+
for (assertPath(t), r = -1, s = 0, n = -1, o = !0, i = 0, a = t.length - 1; a >= 0; --a) if (47 !== (l = t.charCodeAt(a))) -1 === n && (o = !1,
|
|
2048
|
+
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !== i && (i = 1) : -1 !== r && (i = -1); else if (!o) {
|
|
2029
2049
|
s = a + 1;
|
|
2030
2050
|
break;
|
|
2031
2051
|
}
|
|
2032
|
-
return -1 === r || -1 === n || 0 ===
|
|
2052
|
+
return -1 === r || -1 === n || 0 === i || 1 === i && r === n - 1 && r === s + 1 ? "" : t.slice(r, n);
|
|
2033
2053
|
},
|
|
2034
2054
|
format: function e(t) {
|
|
2035
2055
|
if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
|
|
@@ -2039,7 +2059,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2039
2059
|
}("/", t);
|
|
2040
2060
|
},
|
|
2041
2061
|
parse: function e(t) {
|
|
2042
|
-
var r, s, n,
|
|
2062
|
+
var r, s, n, o, i, a, l, c, u, d;
|
|
2043
2063
|
if (assertPath(t), r = {
|
|
2044
2064
|
root: "",
|
|
2045
2065
|
dir: "",
|
|
@@ -2047,14 +2067,14 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2047
2067
|
ext: "",
|
|
2048
2068
|
name: ""
|
|
2049
2069
|
}, 0 === t.length) return r;
|
|
2050
|
-
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/",
|
|
2051
|
-
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >=
|
|
2052
|
-
l = u + 1), 46 === s ? -1 ===
|
|
2070
|
+
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/", o = 1) : o = 0, i = -1,
|
|
2071
|
+
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= o; --u) if (47 !== (s = t.charCodeAt(u))) -1 === l && (c = !1,
|
|
2072
|
+
l = u + 1), 46 === s ? -1 === i ? i = u : 1 !== d && (d = 1) : -1 !== i && (d = -1); else if (!c) {
|
|
2053
2073
|
a = u + 1;
|
|
2054
2074
|
break;
|
|
2055
2075
|
}
|
|
2056
|
-
return -1 ===
|
|
2057
|
-
r.base = t.slice(1, l)) : (r.name = t.slice(a,
|
|
2076
|
+
return -1 === i || -1 === l || 0 === d || 1 === d && i === l - 1 && i === a + 1 ? -1 !== l && (r.base = r.name = 0 === a && n ? t.slice(1, l) : t.slice(a, l)) : (0 === a && n ? (r.name = t.slice(1, i),
|
|
2077
|
+
r.base = t.slice(1, l)) : (r.name = t.slice(a, i), r.base = t.slice(a, l)), r.ext = t.slice(i, l)),
|
|
2058
2078
|
a > 0 ? r.dir = t.slice(0, a - 1) : n && (r.dir = "/"), r;
|
|
2059
2079
|
},
|
|
2060
2080
|
sep: "/",
|
|
@@ -2092,21 +2112,21 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2092
2112
|
let s = (r = normalizePath(r)).split("/").filter((e => e.length));
|
|
2093
2113
|
const n = s.lastIndexOf("node_modules");
|
|
2094
2114
|
n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
|
|
2095
|
-
let
|
|
2096
|
-
|
|
2097
|
-
const
|
|
2098
|
-
if ("@stencil/core" ===
|
|
2115
|
+
let o = s.shift();
|
|
2116
|
+
o.startsWith("@") && (o += "/" + s.shift());
|
|
2117
|
+
const i = s.join("/");
|
|
2118
|
+
if ("@stencil/core" === o) {
|
|
2099
2119
|
return ((e, t) => {
|
|
2100
2120
|
let r = (t = normalizePath(t)).split("/");
|
|
2101
2121
|
const s = r.lastIndexOf("node_modules");
|
|
2102
2122
|
return s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
|
|
2103
2123
|
t = r.join("/")), new URL("./" + t, (e => new URL("../", e).href)(e)).href;
|
|
2104
|
-
})(e.getCompilerExecutingPath(),
|
|
2124
|
+
})(e.getCompilerExecutingPath(), i);
|
|
2105
2125
|
}
|
|
2106
2126
|
return e.getRemoteModuleUrl({
|
|
2107
|
-
moduleId:
|
|
2108
|
-
version: t.get(
|
|
2109
|
-
path:
|
|
2127
|
+
moduleId: o,
|
|
2128
|
+
version: t.get(o),
|
|
2129
|
+
path: i
|
|
2110
2130
|
});
|
|
2111
2131
|
}, knownUrlSkips = [ "/@stencil/core/internal.js", "/@stencil/core/internal.json", "/@stencil/core/internal.mjs", "/@stencil/core/internal/stencil-core.js/index.json", "/@stencil/core/internal/stencil-core.js.json", "/@stencil/core/internal/stencil-core.js/package.json", "/@stencil/core.js", "/@stencil/core.json", "/@stencil/core.mjs", "/@stencil/core.css", "/@stencil/core/index.js", "/@stencil/core/index.json", "/@stencil/core/index.mjs", "/@stencil/core/index.css", "/@stencil/package.json" ], fetchModuleAsync = async (e, t, r, s, n) => {
|
|
2112
2132
|
if (!((e => {
|
|
@@ -2115,11 +2135,11 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2115
2135
|
const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
|
|
2116
2136
|
return !("node_modules" !== s || !isCommonDirModuleFile(n));
|
|
2117
2137
|
})(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
|
|
2118
|
-
const
|
|
2119
|
-
if (
|
|
2120
|
-
if (
|
|
2121
|
-
const
|
|
2122
|
-
return await (async (e, t, r, s, n,
|
|
2138
|
+
const o = await ((e, t, r) => (console.trace(t), e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r)))(e, s);
|
|
2139
|
+
if (o) {
|
|
2140
|
+
if (o.ok) {
|
|
2141
|
+
const i = await o.clone().text();
|
|
2142
|
+
return await (async (e, t, r, s, n, o) => {
|
|
2123
2143
|
r.endsWith("package.json") && ((e, t) => {
|
|
2124
2144
|
try {
|
|
2125
2145
|
const r = JSON.parse(t);
|
|
@@ -2127,14 +2147,14 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2127
2147
|
e.set(t, r);
|
|
2128
2148
|
})(e, r.name, r.version);
|
|
2129
2149
|
} catch (e) {}
|
|
2130
|
-
})(
|
|
2131
|
-
let
|
|
2132
|
-
for (;"/" !==
|
|
2133
|
-
|
|
2150
|
+
})(o, n);
|
|
2151
|
+
let i = path$2.dirname(s);
|
|
2152
|
+
for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
|
|
2153
|
+
i = path$2.dirname(i);
|
|
2134
2154
|
t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
|
|
2135
|
-
})(e, t, s, n,
|
|
2155
|
+
})(e, t, s, n, i, r), i;
|
|
2136
2156
|
}
|
|
2137
|
-
404 ===
|
|
2157
|
+
404 === o.status && known404Urls.add(s);
|
|
2138
2158
|
}
|
|
2139
2159
|
} catch (e) {
|
|
2140
2160
|
console.error(e);
|
|
@@ -2157,12 +2177,12 @@ caller = function() {
|
|
|
2157
2177
|
}
|
|
2158
2178
|
}, r.exports), r.exports;
|
|
2159
2179
|
}((function(e) {
|
|
2160
|
-
var t, r, s = "win32" === process.platform, n = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,
|
|
2180
|
+
var t, r, s = "win32" === process.platform, n = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/, o = /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/, i = {
|
|
2161
2181
|
parse: function(e) {
|
|
2162
2182
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2163
2183
|
var t = function r(e) {
|
|
2164
|
-
var t = n.exec(e), r = (t[1] || "") + (t[2] || ""), s = t[3] || "",
|
|
2165
|
-
return [ r,
|
|
2184
|
+
var t = n.exec(e), r = (t[1] || "") + (t[2] || ""), s = t[3] || "", i = o.exec(s);
|
|
2185
|
+
return [ r, i[1], i[2], i[3] ];
|
|
2166
2186
|
}(e);
|
|
2167
2187
|
if (!t || 4 !== t.length) throw new TypeError("Invalid path '" + e + "'");
|
|
2168
2188
|
return {
|
|
@@ -2187,26 +2207,26 @@ caller = function() {
|
|
|
2187
2207
|
ext: r[3],
|
|
2188
2208
|
name: r[2].slice(0, r[2].length - r[3].length)
|
|
2189
2209
|
};
|
|
2190
|
-
}, e.exports = s ?
|
|
2210
|
+
}, e.exports = s ? i.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = i.parse;
|
|
2191
2211
|
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2192
|
-
var s, n,
|
|
2193
|
-
for (/^([A-Za-z]:)/.test(t) ?
|
|
2212
|
+
var s, n, o = "/";
|
|
2213
|
+
for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"), s = [ t ],
|
|
2194
2214
|
n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
|
|
2195
2215
|
return s.reduce((function(e, t) {
|
|
2196
2216
|
return e.concat(r.map((function(e) {
|
|
2197
|
-
return path__default.default.resolve(
|
|
2217
|
+
return path__default.default.resolve(o, t, e);
|
|
2198
2218
|
})));
|
|
2199
2219
|
}), []);
|
|
2200
2220
|
}, nodeModulesPaths = function e(t, r, s) {
|
|
2201
|
-
var n,
|
|
2221
|
+
var n, o = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
|
|
2202
2222
|
return r && "function" == typeof r.paths ? r.paths(s, t, (function() {
|
|
2203
|
-
return getNodeModulesDirs(t,
|
|
2204
|
-
}), r) : (n = getNodeModulesDirs(t,
|
|
2223
|
+
return getNodeModulesDirs(t, o);
|
|
2224
|
+
}), r) : (n = getNodeModulesDirs(t, o), r && r.paths ? n.concat(r.paths) : n);
|
|
2205
2225
|
}, normalizeOptions = function(e, t) {
|
|
2206
2226
|
return t || {};
|
|
2207
2227
|
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2208
2228
|
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2209
|
-
var r, s, n,
|
|
2229
|
+
var r, s, n, o, i, a, l, c = this;
|
|
2210
2230
|
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2211
2231
|
for (r = slice.call(arguments, 1), n = function() {
|
|
2212
2232
|
if (this instanceof s) {
|
|
@@ -2214,8 +2234,8 @@ toStr = Object.prototype.toString, implementation = function e(t) {
|
|
|
2214
2234
|
return Object(e) === e ? e : this;
|
|
2215
2235
|
}
|
|
2216
2236
|
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2217
|
-
},
|
|
2218
|
-
return s = Function("binder", "return function (" +
|
|
2237
|
+
}, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
|
|
2238
|
+
return s = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this,arguments); }")(n),
|
|
2219
2239
|
c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
|
|
2220
2240
|
l.prototype = null), s;
|
|
2221
2241
|
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
@@ -2340,13 +2360,13 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2340
2360
|
}
|
|
2341
2361
|
}));
|
|
2342
2362
|
}, getPackageCandidates$1 = function e(t, r, s) {
|
|
2343
|
-
var n,
|
|
2344
|
-
for (n = 0; n <
|
|
2345
|
-
return
|
|
2363
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2364
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2365
|
+
return o;
|
|
2346
2366
|
}, async = function e(t, r, s) {
|
|
2347
2367
|
function n(e) {
|
|
2348
2368
|
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) T = path__default.default.resolve(e, t),
|
|
2349
|
-
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package,
|
|
2369
|
+
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package, o) : i(T, C.package, o); else {
|
|
2350
2370
|
if (_ && isCoreModule(t)) return S(null, t);
|
|
2351
2371
|
!function r(e, t, s) {
|
|
2352
2372
|
var n = function() {
|
|
@@ -2364,7 +2384,7 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2364
2384
|
}));
|
|
2365
2385
|
}
|
|
2366
2386
|
}
|
|
2367
|
-
function
|
|
2387
|
+
function o(e, r, s) {
|
|
2368
2388
|
e ? S(e) : r ? S(null, r, s) : l(T, (function(e, r, s) {
|
|
2369
2389
|
if (e) S(e); else if (r) maybeRealpath(f, r, C, (function(e, t) {
|
|
2370
2390
|
e ? S(e) : S(null, t, s);
|
|
@@ -2374,20 +2394,20 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2374
2394
|
}
|
|
2375
2395
|
}));
|
|
2376
2396
|
}
|
|
2377
|
-
function
|
|
2397
|
+
function i(e, t, r) {
|
|
2378
2398
|
var s = t, n = r;
|
|
2379
2399
|
"function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
|
|
2380
|
-
function
|
|
2400
|
+
function o(s, o, a) {
|
|
2381
2401
|
var u, h, p;
|
|
2382
|
-
return c =
|
|
2383
|
-
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l,
|
|
2402
|
+
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),
|
|
2403
|
+
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
|
|
2384
2404
|
}
|
|
2385
|
-
function
|
|
2386
|
-
return s ? n(s) :
|
|
2405
|
+
function i(s, o) {
|
|
2406
|
+
return s ? n(s) : o ? n(null, l, c) : void e(t.slice(1), r, c);
|
|
2387
2407
|
}
|
|
2388
2408
|
var l, c;
|
|
2389
2409
|
if (0 === t.length) return n(null, void 0, s);
|
|
2390
|
-
l = r + t[0], (c = s) ?
|
|
2410
|
+
l = r + t[0], (c = s) ? o(null, c) : a(path__default.default.dirname(l), o);
|
|
2391
2411
|
}([ "" ].concat(w), e, s);
|
|
2392
2412
|
}
|
|
2393
2413
|
function a(e, t) {
|
|
@@ -2398,8 +2418,8 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2398
2418
|
if (!s) return a(path__default.default.dirname(e), t);
|
|
2399
2419
|
m(p, n, (function(r, s) {
|
|
2400
2420
|
r && t(r);
|
|
2401
|
-
var
|
|
2402
|
-
|
|
2421
|
+
var o = s;
|
|
2422
|
+
o && C.packageFilter && (o = C.packageFilter(o, n)), t(null, o, e);
|
|
2403
2423
|
}));
|
|
2404
2424
|
}));
|
|
2405
2425
|
}));
|
|
@@ -2408,31 +2428,31 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2408
2428
|
var s = r, n = t;
|
|
2409
2429
|
"function" == typeof n && (s = n, n = C.package), maybeRealpath(f, e, C, (function(t, r) {
|
|
2410
2430
|
if (t) return s(t);
|
|
2411
|
-
var
|
|
2412
|
-
d(
|
|
2413
|
-
return t ? s(t) : r ? void m(p,
|
|
2431
|
+
var o = path__default.default.join(r, "package.json");
|
|
2432
|
+
d(o, (function(t, r) {
|
|
2433
|
+
return t ? s(t) : r ? void m(p, o, (function(t, r) {
|
|
2414
2434
|
var n, a;
|
|
2415
|
-
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n,
|
|
2416
|
-
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void
|
|
2435
|
+
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",
|
|
2436
|
+
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void i(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2417
2437
|
return t ? s(t) : r ? s(null, r, n) : n ? void l(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2418
|
-
return t ? s(t) : r ? s(null, r, n) : void
|
|
2419
|
-
})) :
|
|
2420
|
-
}))) : void
|
|
2421
|
-
})) :
|
|
2438
|
+
return t ? s(t) : r ? s(null, r, n) : void i(path__default.default.join(e, "index"), n, s);
|
|
2439
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2440
|
+
}))) : void i(path__default.default.join(e, "/index"), n, s));
|
|
2441
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2422
2442
|
}));
|
|
2423
2443
|
}));
|
|
2424
2444
|
}
|
|
2425
2445
|
function c(e, t) {
|
|
2426
|
-
function r(t, r,
|
|
2427
|
-
return t ? e(t) : r ? e(null, r,
|
|
2446
|
+
function r(t, r, o) {
|
|
2447
|
+
return t ? e(t) : r ? e(null, r, o) : void l(n, C.package, s);
|
|
2428
2448
|
}
|
|
2429
2449
|
function s(r, s, n) {
|
|
2430
2450
|
return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
|
|
2431
2451
|
}
|
|
2432
2452
|
if (0 === t.length) return e(null, void 0);
|
|
2433
2453
|
var n = t[0];
|
|
2434
|
-
h(path__default.default.dirname(n), (function
|
|
2435
|
-
return s ? e(s) : a ? void
|
|
2454
|
+
h(path__default.default.dirname(n), (function o(s, a) {
|
|
2455
|
+
return s ? e(s) : a ? void i(n, C.package, r) : c(e, t.slice(1));
|
|
2436
2456
|
}));
|
|
2437
2457
|
}
|
|
2438
2458
|
var u, d, h, p, f, m, g, y, w, _, v, b, E, T, S = s, C = r;
|
|
@@ -2572,64 +2592,64 @@ defaultIsFile = function e(t) {
|
|
|
2572
2592
|
return JSON.parse(s);
|
|
2573
2593
|
} catch (e) {}
|
|
2574
2594
|
}, getPackageCandidates = function e(t, r, s) {
|
|
2575
|
-
var n,
|
|
2576
|
-
for (n = 0; n <
|
|
2577
|
-
return
|
|
2595
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2596
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2597
|
+
return o;
|
|
2578
2598
|
}, sync = function e(t, r) {
|
|
2579
2599
|
function s(e) {
|
|
2580
|
-
var t, r, s,
|
|
2581
|
-
if (l && l.dir && l.pkg &&
|
|
2582
|
-
(r =
|
|
2600
|
+
var t, r, s, o, l = n(path__default.default.dirname(e));
|
|
2601
|
+
if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2602
|
+
(r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2583
2603
|
a(e)) return e;
|
|
2584
|
-
for (s = 0; s < p.length; s++) if (
|
|
2604
|
+
for (s = 0; s < p.length; s++) if (o = e + p[s], a(o)) return o;
|
|
2585
2605
|
}
|
|
2586
2606
|
function n(e) {
|
|
2587
2607
|
var t, r;
|
|
2588
|
-
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e,
|
|
2589
|
-
a(t) ? ((r = d(l, t)) &&
|
|
2608
|
+
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"),
|
|
2609
|
+
a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
|
|
2590
2610
|
pkg: r,
|
|
2591
2611
|
dir: e
|
|
2592
2612
|
}) : n(path__default.default.dirname(e));
|
|
2593
2613
|
}
|
|
2594
|
-
function
|
|
2595
|
-
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e,
|
|
2614
|
+
function o(e) {
|
|
2615
|
+
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
|
|
2596
2616
|
if (a(h)) {
|
|
2597
2617
|
try {
|
|
2598
2618
|
t = d(l, h);
|
|
2599
2619
|
} catch (e) {}
|
|
2600
|
-
if (t &&
|
|
2620
|
+
if (t && i.packageFilter && (t = i.packageFilter(t, e)), t && t.main) {
|
|
2601
2621
|
if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2602
2622
|
r;
|
|
2603
2623
|
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2604
2624
|
try {
|
|
2605
2625
|
if (n = s(path__default.default.resolve(e, t.main))) return n;
|
|
2606
|
-
if (c =
|
|
2626
|
+
if (c = o(path__default.default.resolve(e, t.main))) return c;
|
|
2607
2627
|
} catch (e) {}
|
|
2608
2628
|
}
|
|
2609
2629
|
}
|
|
2610
2630
|
return s(path__default.default.join(e, "/index"));
|
|
2611
2631
|
}
|
|
2612
|
-
var
|
|
2632
|
+
var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
|
|
2613
2633
|
if ("string" != typeof t) throw new TypeError("Path must be a string.");
|
|
2614
|
-
if (
|
|
2615
|
-
c =
|
|
2616
|
-
|
|
2617
|
-
if (h =
|
|
2618
|
-
m =
|
|
2619
|
-
y = maybeRealpathSync(u, path__default.default.resolve(m),
|
|
2634
|
+
if (i = normalizeOptions(0, r), a = i.isFile || defaultIsFile, l = i.readFileSync || fs__default.default.readFileSync,
|
|
2635
|
+
c = i.isDirectory || defaultIsDir, u = i.realpathSync || defaultRealpathSync, d = i.readPackageSync || defaultReadPackageSync,
|
|
2636
|
+
i.readFileSync && i.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
2637
|
+
if (h = i.packageIterator, p = i.extensions || [ ".js" ], f = !1 !== i.includeCoreModules,
|
|
2638
|
+
m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || [],
|
|
2639
|
+
y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2620
2640
|
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2621
|
-
_ = s(w) ||
|
|
2641
|
+
_ = s(w) || o(w)) return maybeRealpathSync(u, _, i);
|
|
2622
2642
|
} else {
|
|
2623
2643
|
if (f && isCoreModule(t)) return t;
|
|
2624
2644
|
if (v = function E(e, t) {
|
|
2625
2645
|
var r, n, a, l, u = function() {
|
|
2626
|
-
return getPackageCandidates(e, t,
|
|
2627
|
-
}, d = h ? h(e, t, u,
|
|
2646
|
+
return getPackageCandidates(e, t, i);
|
|
2647
|
+
}, d = h ? h(e, t, u, i) : u();
|
|
2628
2648
|
for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
|
|
2629
2649
|
if (a = s(n)) return a;
|
|
2630
|
-
if (l =
|
|
2650
|
+
if (l = o(n)) return l;
|
|
2631
2651
|
}
|
|
2632
|
-
}(t, y)) return maybeRealpathSync(u, v,
|
|
2652
|
+
}(t, y)) return maybeRealpathSync(u, v, i);
|
|
2633
2653
|
}
|
|
2634
2654
|
throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
|
|
2635
2655
|
b;
|
|
@@ -2666,8 +2686,8 @@ const createSystem = e => {
|
|
|
2666
2686
|
let r = BLUE, s = "Build", n = "";
|
|
2667
2687
|
"error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
|
|
2668
2688
|
s = "Warning"), e.header && (s = e.header);
|
|
2669
|
-
const
|
|
2670
|
-
if (
|
|
2689
|
+
const o = e.relFilePath || e.absFilePath;
|
|
2690
|
+
if (o && (n += o, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
|
|
2671
2691
|
"number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
|
|
2672
2692
|
n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
|
|
2673
2693
|
n += "\n" + e.lineNumber + ": " + e.text;
|
|
@@ -2678,7 +2698,7 @@ const createSystem = e => {
|
|
|
2678
2698
|
})(t, e)));
|
|
2679
2699
|
}
|
|
2680
2700
|
};
|
|
2681
|
-
})(), r = new Map, s = new Set, n = e => s.add(e),
|
|
2701
|
+
})(), r = new Map, s = new Set, n = e => s.add(e), o = e => s.delete(e), i = (() => {
|
|
2682
2702
|
const e = [], t = t => {
|
|
2683
2703
|
const r = e.findIndex((e => e.callback === t));
|
|
2684
2704
|
return r > -1 && (e.splice(r, 1), !0);
|
|
@@ -2705,11 +2725,11 @@ const createSystem = e => {
|
|
|
2705
2725
|
}), () => t(n);
|
|
2706
2726
|
}
|
|
2707
2727
|
if ("string" == typeof r && "function" == typeof s) {
|
|
2708
|
-
const n = r.toLowerCase().trim(),
|
|
2728
|
+
const n = r.toLowerCase().trim(), o = s;
|
|
2709
2729
|
return e.push({
|
|
2710
2730
|
eventName: n,
|
|
2711
|
-
callback:
|
|
2712
|
-
}), () => t(
|
|
2731
|
+
callback: o
|
|
2732
|
+
}), () => t(o);
|
|
2713
2733
|
}
|
|
2714
2734
|
return () => !1;
|
|
2715
2735
|
},
|
|
@@ -2737,8 +2757,8 @@ const createSystem = e => {
|
|
|
2737
2757
|
}, d = (e, t, s) => {
|
|
2738
2758
|
const n = path$2.dirname(e);
|
|
2739
2759
|
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && d(n, t, s);
|
|
2740
|
-
const
|
|
2741
|
-
|
|
2760
|
+
const o = r.get(e);
|
|
2761
|
+
o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
|
|
2742
2762
|
basename: path$2.basename(e),
|
|
2743
2763
|
dirname: n,
|
|
2744
2764
|
isDirectory: !0,
|
|
@@ -2762,10 +2782,10 @@ const createSystem = e => {
|
|
|
2762
2782
|
}), m = (e, t, s) => {
|
|
2763
2783
|
const n = w(e);
|
|
2764
2784
|
if (!n.error && !s.error) if (n.isFile) {
|
|
2765
|
-
const n = path$2.dirname(t),
|
|
2785
|
+
const n = path$2.dirname(t), o = u(n, {
|
|
2766
2786
|
recursive: !0
|
|
2767
|
-
}),
|
|
2768
|
-
s.newDirs.push(...
|
|
2787
|
+
}), i = r.get(e).data, a = b(t, i);
|
|
2788
|
+
s.newDirs.push(...o.newDirs), s.renamed.push({
|
|
2769
2789
|
oldPath: e,
|
|
2770
2790
|
newPath: t,
|
|
2771
2791
|
isDirectory: !1,
|
|
@@ -2863,8 +2883,8 @@ const createSystem = e => {
|
|
|
2863
2883
|
u("/");
|
|
2864
2884
|
const S = {
|
|
2865
2885
|
name: "in-memory",
|
|
2866
|
-
version: "2.
|
|
2867
|
-
events:
|
|
2886
|
+
version: "2.13.0",
|
|
2887
|
+
events: i,
|
|
2868
2888
|
access: async e => c(e),
|
|
2869
2889
|
accessSync: c,
|
|
2870
2890
|
addDestory: n,
|
|
@@ -2911,7 +2931,7 @@ const createSystem = e => {
|
|
|
2911
2931
|
readFileSync: p,
|
|
2912
2932
|
realpath: async e => f(e),
|
|
2913
2933
|
realpathSync: f,
|
|
2914
|
-
removeDestory:
|
|
2934
|
+
removeDestory: o,
|
|
2915
2935
|
rename: async (e, t) => {
|
|
2916
2936
|
const r = {
|
|
2917
2937
|
oldPath: e = normalizePath(e),
|
|
@@ -2948,14 +2968,14 @@ const createSystem = e => {
|
|
|
2948
2968
|
removeFileSync: _,
|
|
2949
2969
|
watchDirectory: (e, t) => {
|
|
2950
2970
|
e = l(e);
|
|
2951
|
-
const s = r.get(e),
|
|
2971
|
+
const s = r.get(e), i = () => {
|
|
2952
2972
|
const s = r.get(e);
|
|
2953
2973
|
if (s && s.watcherCallbacks) {
|
|
2954
2974
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2955
2975
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2956
2976
|
}
|
|
2957
2977
|
};
|
|
2958
|
-
return n(
|
|
2978
|
+
return n(i), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2959
2979
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2960
2980
|
basename: path$2.basename(e),
|
|
2961
2981
|
dirname: path$2.dirname(e),
|
|
@@ -2965,20 +2985,20 @@ const createSystem = e => {
|
|
|
2965
2985
|
data: void 0
|
|
2966
2986
|
}), {
|
|
2967
2987
|
close() {
|
|
2968
|
-
i
|
|
2988
|
+
o(i), i();
|
|
2969
2989
|
}
|
|
2970
2990
|
};
|
|
2971
2991
|
},
|
|
2972
2992
|
watchFile: (e, t) => {
|
|
2973
2993
|
e = l(e);
|
|
2974
|
-
const s = r.get(e),
|
|
2994
|
+
const s = r.get(e), i = () => {
|
|
2975
2995
|
const s = r.get(e);
|
|
2976
2996
|
if (s && s.watcherCallbacks) {
|
|
2977
2997
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2978
2998
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2979
2999
|
}
|
|
2980
3000
|
};
|
|
2981
|
-
return n(
|
|
3001
|
+
return n(i), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2982
3002
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2983
3003
|
basename: path$2.basename(e),
|
|
2984
3004
|
dirname: path$2.dirname(e),
|
|
@@ -2988,7 +3008,7 @@ const createSystem = e => {
|
|
|
2988
3008
|
data: void 0
|
|
2989
3009
|
}), {
|
|
2990
3010
|
close() {
|
|
2991
|
-
i
|
|
3011
|
+
o(i), i();
|
|
2992
3012
|
}
|
|
2993
3013
|
};
|
|
2994
3014
|
},
|
|
@@ -3001,18 +3021,18 @@ const createSystem = e => {
|
|
|
3001
3021
|
return "number" == typeof t && (s = s.substr(0, t)), s;
|
|
3002
3022
|
},
|
|
3003
3023
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
3004
|
-
let r, s = 0, n = !1,
|
|
3024
|
+
let r, s = 0, n = !1, o = !1, i = 0;
|
|
3005
3025
|
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 = () => {
|
|
3006
3026
|
let t = null;
|
|
3007
|
-
const s = e.getCompilerExecutingPath(),
|
|
3008
|
-
name: "stencil.worker." +
|
|
3027
|
+
const s = e.getCompilerExecutingPath(), o = {
|
|
3028
|
+
name: "stencil.worker." + i++
|
|
3009
3029
|
};
|
|
3010
3030
|
try {
|
|
3011
|
-
t = new Worker(s,
|
|
3031
|
+
t = new Worker(s, o);
|
|
3012
3032
|
} catch (e) {
|
|
3013
3033
|
null == r && (r = new Blob([ `importScripts('${s}');` ], {
|
|
3014
3034
|
type: "application/javascript"
|
|
3015
|
-
})), t = new Worker(URL.createObjectURL(r),
|
|
3035
|
+
})), t = new Worker(URL.createObjectURL(r), o);
|
|
3016
3036
|
}
|
|
3017
3037
|
const l = {
|
|
3018
3038
|
worker: t,
|
|
@@ -3041,7 +3061,7 @@ const createSystem = e => {
|
|
|
3041
3061
|
} else t = p(), c.push(t);
|
|
3042
3062
|
t.activeTasks++, t.sendQueue.push(e);
|
|
3043
3063
|
}, g = () => {
|
|
3044
|
-
|
|
3064
|
+
o = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
3045
3065
|
}, y = (...e) => new Promise(((t, r) => {
|
|
3046
3066
|
if (n) r("task canceled"); else {
|
|
3047
3067
|
const n = {
|
|
@@ -3051,7 +3071,7 @@ const createSystem = e => {
|
|
|
3051
3071
|
l.push(n), a.set(n.stencilId, {
|
|
3052
3072
|
resolve: t,
|
|
3053
3073
|
reject: r
|
|
3054
|
-
}),
|
|
3074
|
+
}), o || (o = !0, d.then(g));
|
|
3055
3075
|
}
|
|
3056
3076
|
}));
|
|
3057
3077
|
return {
|
|
@@ -3082,11 +3102,11 @@ const createSystem = e => {
|
|
|
3082
3102
|
return S.resolveModuleId = e => ((e, t, r) => {
|
|
3083
3103
|
const s = ((e, t, r) => ({
|
|
3084
3104
|
async isFile(s, n) {
|
|
3085
|
-
const
|
|
3086
|
-
if ((await t.stat(
|
|
3087
|
-
if (shouldFetchModule(
|
|
3088
|
-
const r = getNodeModuleFetchUrl(e, packageVersions,
|
|
3089
|
-
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r,
|
|
3105
|
+
const o = normalizeFsPath(s);
|
|
3106
|
+
if ((await t.stat(o)).isFile) n(null, !0); else {
|
|
3107
|
+
if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
|
|
3108
|
+
const r = getNodeModuleFetchUrl(e, packageVersions, o);
|
|
3109
|
+
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
|
|
3090
3110
|
}
|
|
3091
3111
|
n(null, !1);
|
|
3092
3112
|
}
|
|
@@ -3099,7 +3119,7 @@ const createSystem = e => {
|
|
|
3099
3119
|
void s(null, !0);
|
|
3100
3120
|
if (isCommonDirModuleFile(n)) return void s(null, !1);
|
|
3101
3121
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
3102
|
-
const
|
|
3122
|
+
const o = getCommonDirUrl(e, packageVersions, n, r), i = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, o, i);
|
|
3103
3123
|
if (isString(a)) return void s(null, !0);
|
|
3104
3124
|
}
|
|
3105
3125
|
}
|
|
@@ -3118,13 +3138,13 @@ const createSystem = e => {
|
|
|
3118
3138
|
}))(e, null, r.exts);
|
|
3119
3139
|
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"),
|
|
3120
3140
|
e)), new Promise(((e, t) => {
|
|
3121
|
-
resolve(r.moduleId, s, ((s, n,
|
|
3141
|
+
resolve(r.moduleId, s, ((s, n, o) => {
|
|
3122
3142
|
if (s) t(s); else {
|
|
3123
3143
|
n = normalizePath(n);
|
|
3124
3144
|
const t = {
|
|
3125
3145
|
moduleId: r.moduleId,
|
|
3126
3146
|
resolveId: n,
|
|
3127
|
-
pkgData:
|
|
3147
|
+
pkgData: o,
|
|
3128
3148
|
pkgDirPath: getPackageDirPath(n, r.moduleId)
|
|
3129
3149
|
};
|
|
3130
3150
|
e(t);
|
|
@@ -3164,7 +3184,7 @@ const createSystem = e => {
|
|
|
3164
3184
|
t = e;
|
|
3165
3185
|
}
|
|
3166
3186
|
}
|
|
3167
|
-
}), !function
|
|
3187
|
+
}), !function o(e) {
|
|
3168
3188
|
return "diskReads" in e && "diskWrites" in e;
|
|
3169
3189
|
}(r)) throw new Error("could not generate TestingSystem");
|
|
3170
3190
|
return r;
|
|
@@ -3336,8 +3356,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3336
3356
|
waitForVisible() {
|
|
3337
3357
|
return new Promise(((e, t) => {
|
|
3338
3358
|
const r = setInterval((async () => {
|
|
3339
|
-
await this.isVisible() && (clearInterval(r), clearTimeout(
|
|
3340
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`),
|
|
3359
|
+
await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
|
|
3360
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3341
3361
|
clearTimeout(r), t(n);
|
|
3342
3362
|
}), s);
|
|
3343
3363
|
}));
|
|
@@ -3345,8 +3365,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3345
3365
|
waitForNotVisible() {
|
|
3346
3366
|
return new Promise(((e, t) => {
|
|
3347
3367
|
const r = setInterval((async () => {
|
|
3348
|
-
await this.isVisible() || (clearInterval(r), clearTimeout(
|
|
3349
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`),
|
|
3368
|
+
await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
|
|
3369
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3350
3370
|
clearTimeout(r), t(n);
|
|
3351
3371
|
}), s);
|
|
3352
3372
|
}));
|
|
@@ -3602,17 +3622,18 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3602
3622
|
}
|
|
3603
3623
|
};
|
|
3604
3624
|
}, exports.createTestRunner = function createTestRunner() {
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3625
|
+
var e;
|
|
3626
|
+
const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
|
|
3627
|
+
return class r extends t {
|
|
3628
|
+
async runTests(e, t, r, s, n, o) {
|
|
3629
|
+
const i = process.env;
|
|
3609
3630
|
if (e = e.filter((e => function t(e, r) {
|
|
3610
3631
|
const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
|
|
3611
3632
|
return !("true" !== r.__STENCIL_E2E_TESTS__ || !s) || "true" === r.__STENCIL_SPEC_TESTS__ && !s;
|
|
3612
|
-
}(e.path,
|
|
3613
|
-
const a = JSON.parse(
|
|
3614
|
-
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l],
|
|
3615
|
-
} else await super.runTests(e, t, r, s, n,
|
|
3633
|
+
}(e.path, i))), "true" === i.__STENCIL_SCREENSHOT__) {
|
|
3634
|
+
const a = JSON.parse(i.__STENCIL_EMULATE_CONFIGS__);
|
|
3635
|
+
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r, s, n, o);
|
|
3636
|
+
} else await super.runTests(e, t, r, s, n, o);
|
|
3616
3637
|
}
|
|
3617
3638
|
};
|
|
3618
3639
|
}, exports.createTesting = async e => {
|
|
@@ -3624,14 +3645,14 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3624
3645
|
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3625
3646
|
}(e);
|
|
3626
3647
|
const {createCompiler: r} = require("../compiler/stencil.js"), s = await r(e);
|
|
3627
|
-
let n,
|
|
3628
|
-
const
|
|
3648
|
+
let n, o;
|
|
3649
|
+
const i = async () => {
|
|
3629
3650
|
const t = [];
|
|
3630
3651
|
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), n && (n.close && t.push(n.close()),
|
|
3631
|
-
n = null),
|
|
3652
|
+
n = null), o && (o.close && t.push(o.close()), o = null), await Promise.all(t);
|
|
3632
3653
|
};
|
|
3633
3654
|
return {
|
|
3634
|
-
destroy:
|
|
3655
|
+
destroy: i,
|
|
3635
3656
|
run: async (t = {}) => {
|
|
3636
3657
|
let r, a = !1, l = !1, c = null;
|
|
3637
3658
|
const u = [];
|
|
@@ -3654,9 +3675,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3654
3675
|
})), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3655
3676
|
e.devServer.reloadStrategy = null;
|
|
3656
3677
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3657
|
-
if (n = l[0],
|
|
3678
|
+
if (n = l[0], o = l[1], t) {
|
|
3658
3679
|
const r = await t;
|
|
3659
|
-
if (!r || !e.watch && hasError(r && r.diagnostics)) return await
|
|
3680
|
+
if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
|
|
3660
3681
|
}
|
|
3661
3682
|
n && (r.__STENCIL_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__STENCIL_BROWSER_URL__}`),
|
|
3662
3683
|
r.__STENCIL_APP_SCRIPT_URL__ = function d(e, t) {
|
|
@@ -3690,13 +3711,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3690
3711
|
waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
|
|
3691
3712
|
pixelmatchModulePath: s
|
|
3692
3713
|
}), e.flags.updateScreenshot || await r.pullMasterBuild(), n.finish("screenshot, initBuild finished");
|
|
3693
|
-
const
|
|
3694
|
-
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(
|
|
3714
|
+
const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
|
|
3715
|
+
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(i, a);
|
|
3695
3716
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3696
3717
|
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3697
3718
|
try {
|
|
3698
3719
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3699
|
-
let s = await r.completeBuild(
|
|
3720
|
+
let s = await r.completeBuild(i);
|
|
3700
3721
|
if (t.finish("screenshot, completeTimespan finished"), s) {
|
|
3701
3722
|
const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
|
|
3702
3723
|
if (s = await r.publishBuild(s), t.finish("screenshot, publishBuild finished"),
|
|
@@ -3778,19 +3799,19 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3778
3799
|
const t = process.env;
|
|
3779
3800
|
"true" === t.__STENCIL_SCREENSHOT__ ? e.compareScreenshot = (r, s) => {
|
|
3780
3801
|
const n = global;
|
|
3781
|
-
let
|
|
3782
|
-
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (
|
|
3783
|
-
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (
|
|
3784
|
-
"object" == typeof s && (
|
|
3785
|
-
|
|
3786
|
-
if (n.screenshotDescriptions.has(
|
|
3787
|
-
return n.screenshotDescriptions.add(
|
|
3802
|
+
let o, i = "", a = "";
|
|
3803
|
+
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (i = n.currentSpec.fullName),
|
|
3804
|
+
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (i.length > 0 ? i += ", " + r : i = r,
|
|
3805
|
+
"object" == typeof s && (o = s)) : "object" == typeof r && (o = r), i = i.trim(),
|
|
3806
|
+
o = o || {}, !i) throw new Error(`Invalid screenshot description in "${a}"`);
|
|
3807
|
+
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')".`);
|
|
3808
|
+
return n.screenshotDescriptions.add(i), async function l(e, t, r, s, n) {
|
|
3788
3809
|
if ("string" != typeof t.__STENCIL_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
|
|
3789
3810
|
if ("string" != typeof t.__STENCIL_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
3790
|
-
const
|
|
3811
|
+
const o = JSON.parse(t.__STENCIL_EMULATE__), i = JSON.parse(t.__STENCIL_SCREENSHOT_BUILD__);
|
|
3791
3812
|
await function a(e) {
|
|
3792
3813
|
return new Promise((t => setTimeout(t, e)));
|
|
3793
|
-
}(
|
|
3814
|
+
}(i.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
|
|
3794
3815
|
window.requestAnimationFrame((() => {
|
|
3795
3816
|
e();
|
|
3796
3817
|
}));
|
|
@@ -3808,11 +3829,11 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3808
3829
|
width: e.clip.width,
|
|
3809
3830
|
height: e.clip.height
|
|
3810
3831
|
}), t;
|
|
3811
|
-
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold :
|
|
3812
|
-
let h =
|
|
3832
|
+
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : i.pixelmatchThreshold;
|
|
3833
|
+
let h = o.viewport.width, p = o.viewport.height;
|
|
3813
3834
|
return n && n.clip && ("number" == typeof n.clip.width && (h = n.clip.width), "number" == typeof n.clip.height && (p = n.clip.height)),
|
|
3814
|
-
await compareScreenshot(
|
|
3815
|
-
}(e, t,
|
|
3835
|
+
await compareScreenshot(o, i, u, r, h, p, s, d);
|
|
3836
|
+
}(e, t, i, a, o);
|
|
3816
3837
|
} : e.compareScreenshot = async () => ({
|
|
3817
3838
|
mismatchedPixels: 0,
|
|
3818
3839
|
allowableMismatchedPixels: 1,
|
|
@@ -3860,13 +3881,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3860
3881
|
e();
|
|
3861
3882
|
}))));
|
|
3862
3883
|
};
|
|
3863
|
-
const
|
|
3884
|
+
const o = !0 === e.failOnConsoleError, i = !0 === e.failOnNetworkError;
|
|
3864
3885
|
t.on("console", (e => {
|
|
3865
3886
|
"error" === e.type() && (r.push({
|
|
3866
3887
|
type: "error",
|
|
3867
3888
|
message: e.text(),
|
|
3868
3889
|
location: e.location().url
|
|
3869
|
-
}),
|
|
3890
|
+
}), o && fail(new Error(serializeConsoleMessage(e)))), function t(e) {
|
|
3870
3891
|
const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
|
|
3871
3892
|
"debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
|
|
3872
3893
|
}(e);
|
|
@@ -3881,7 +3902,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3881
3902
|
type: "requestfailed",
|
|
3882
3903
|
message: e.failure().errorText,
|
|
3883
3904
|
location: e.url()
|
|
3884
|
-
}),
|
|
3905
|
+
}), i ? fail(new Error(e.failure().errorText)) : console.error("requestfailed", e.url());
|
|
3885
3906
|
})), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
|
|
3886
3907
|
waitUntil: e.waitUntil
|
|
3887
3908
|
}) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
|
|
@@ -3947,7 +3968,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3947
3968
|
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
3948
3969
|
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
3949
3970
|
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
3950
|
-
})),
|
|
3971
|
+
})), o = (e => {
|
|
3951
3972
|
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 = {
|
|
3952
3973
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
3953
3974
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
@@ -4007,8 +4028,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4007
4028
|
return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
|
|
4008
4029
|
n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
|
|
4009
4030
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4010
|
-
if (e.strictBuild ? Object.assign(appData.BUILD,
|
|
4011
|
-
!0 ===
|
|
4031
|
+
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
|
|
4032
|
+
!0 === o[e] && (appData.BUILD[e] = !0);
|
|
4012
4033
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4013
4034
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4014
4035
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
@@ -4038,10 +4059,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4038
4059
|
testing.renderVdom(t, e.template());
|
|
4039
4060
|
} else "string" == typeof e.html && (s.body.innerHTML = e.html);
|
|
4040
4061
|
!1 !== e.flushQueue && await s.waitForChanges();
|
|
4041
|
-
let
|
|
4062
|
+
let i = null;
|
|
4042
4063
|
return Object.defineProperty(s, "root", {
|
|
4043
4064
|
get() {
|
|
4044
|
-
if (null ==
|
|
4065
|
+
if (null == i && (i = findRootComponent(t, s.body)), null != i) return i;
|
|
4045
4066
|
const e = s.body.firstElementChild;
|
|
4046
4067
|
return null != e ? e : null;
|
|
4047
4068
|
}
|