@stencil/core 2.12.1 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.cjs +15 -6
- package/cli/index.js +15 -6
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +2855 -4909
- package/compiler/lib.dom.iterable.d.ts +42 -66
- package/compiler/lib.es2015.core.d.ts +60 -18
- package/compiler/lib.es2015.iterable.d.ts +3 -11
- package/compiler/lib.es2015.promise.d.ts +2 -74
- package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
- package/compiler/lib.es2018.intl.d.ts +23 -11
- package/compiler/lib.es2019.string.d.ts +8 -2
- package/compiler/lib.es2020.bigint.d.ts +2 -2
- package/compiler/lib.es2020.intl.d.ts +173 -114
- package/compiler/lib.es2020.promise.d.ts +2 -3
- package/compiler/lib.es2021.d.ts +1 -0
- package/compiler/lib.es2021.intl.d.ts +44 -0
- package/compiler/lib.es2021.promise.d.ts +8 -1
- package/compiler/lib.es5.d.ts +112 -52
- package/compiler/lib.esnext.intl.d.ts +1 -10
- package/compiler/lib.webworker.d.ts +1013 -1267
- package/compiler/lib.webworker.iterable.d.ts +28 -34
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +399 -78
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +2 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +3 -3
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +16 -5
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +2 -2
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +28 -2
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +5 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/polyfills/css-shim.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +3 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/testing/index.js +3 -1
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +29 -2
- package/mock-doc/index.d.ts +4 -3
- package/mock-doc/index.js +29 -2
- package/mock-doc/package.json +1 -1
- package/package.json +7 -8
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +9 -6
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +365 -345
- 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.14.1 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
function _lazyRequire(e) {
|
|
5
5
|
return new Proxy({}, {
|
|
@@ -45,28 +45,28 @@ async function startPuppeteerBrowser(e) {
|
|
|
45
45
|
Array.isArray(e.testing.browserArgs) && e.logger.debug(`puppeteer args: ${e.testing.browserArgs.join(" ")}`),
|
|
46
46
|
"boolean" == typeof e.testing.browserDevtools && e.logger.debug(`puppeteer devtools: ${e.testing.browserDevtools}`),
|
|
47
47
|
"number" == typeof e.testing.browserSlowMo && e.logger.debug(`puppeteer slowMo: ${e.testing.browserSlowMo}`);
|
|
48
|
-
const
|
|
48
|
+
const 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,56 +2177,55 @@ 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}[^\\\/]+[\\\/]+[^\\\/]+)?
|
|
2180
|
+
var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, o = {
|
|
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
|
-
|
|
2165
|
-
return [ r, o[1], o[2], o[3] ];
|
|
2184
|
+
return n.exec(e).slice(1);
|
|
2166
2185
|
}(e);
|
|
2167
|
-
if (!t ||
|
|
2186
|
+
if (!t || 5 !== t.length) throw new TypeError("Invalid path '" + e + "'");
|
|
2168
2187
|
return {
|
|
2169
|
-
root: t[
|
|
2170
|
-
dir: t[0]
|
|
2188
|
+
root: t[1],
|
|
2189
|
+
dir: t[0] === t[1] ? t[0] : t[0].slice(0, -1),
|
|
2171
2190
|
base: t[2],
|
|
2172
|
-
ext: t[
|
|
2173
|
-
name: t[
|
|
2191
|
+
ext: t[4],
|
|
2192
|
+
name: t[3]
|
|
2174
2193
|
};
|
|
2175
2194
|
}
|
|
2176
2195
|
};
|
|
2177
|
-
t = /^(
|
|
2196
|
+
t = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/, (r = {}).parse = function(e) {
|
|
2178
2197
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2179
2198
|
var r = function s(e) {
|
|
2180
2199
|
return t.exec(e).slice(1);
|
|
2181
2200
|
}(e);
|
|
2182
|
-
if (!r ||
|
|
2183
|
-
return
|
|
2184
|
-
root: r[
|
|
2185
|
-
dir: r[0]
|
|
2201
|
+
if (!r || 5 !== r.length) throw new TypeError("Invalid path '" + e + "'");
|
|
2202
|
+
return {
|
|
2203
|
+
root: r[1],
|
|
2204
|
+
dir: r[0].slice(0, -1),
|
|
2186
2205
|
base: r[2],
|
|
2187
|
-
ext: r[
|
|
2188
|
-
name: r[
|
|
2206
|
+
ext: r[4],
|
|
2207
|
+
name: r[3]
|
|
2189
2208
|
};
|
|
2190
2209
|
}, e.exports = s ? o.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = o.parse;
|
|
2191
2210
|
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2192
|
-
var s, n,
|
|
2193
|
-
for (/^([A-Za-z]:)/.test(t) ?
|
|
2211
|
+
var s, n, o = "/";
|
|
2212
|
+
for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"), s = [ t ],
|
|
2194
2213
|
n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
|
|
2195
2214
|
return s.reduce((function(e, t) {
|
|
2196
2215
|
return e.concat(r.map((function(e) {
|
|
2197
|
-
return path__default.default.resolve(
|
|
2216
|
+
return path__default.default.resolve(o, t, e);
|
|
2198
2217
|
})));
|
|
2199
2218
|
}), []);
|
|
2200
2219
|
}, nodeModulesPaths = function e(t, r, s) {
|
|
2201
|
-
var n,
|
|
2220
|
+
var n, o = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
|
|
2202
2221
|
return r && "function" == typeof r.paths ? r.paths(s, t, (function() {
|
|
2203
|
-
return getNodeModulesDirs(t,
|
|
2204
|
-
}), r) : (n = getNodeModulesDirs(t,
|
|
2222
|
+
return getNodeModulesDirs(t, o);
|
|
2223
|
+
}), r) : (n = getNodeModulesDirs(t, o), r && r.paths ? n.concat(r.paths) : n);
|
|
2205
2224
|
}, normalizeOptions = function(e, t) {
|
|
2206
2225
|
return t || {};
|
|
2207
2226
|
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2208
2227
|
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2209
|
-
var r, s, n,
|
|
2228
|
+
var r, s, n, o, i, a, l, c = this;
|
|
2210
2229
|
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2211
2230
|
for (r = slice.call(arguments, 1), n = function() {
|
|
2212
2231
|
if (this instanceof s) {
|
|
@@ -2214,8 +2233,8 @@ toStr = Object.prototype.toString, implementation = function e(t) {
|
|
|
2214
2233
|
return Object(e) === e ? e : this;
|
|
2215
2234
|
}
|
|
2216
2235
|
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2217
|
-
},
|
|
2218
|
-
return s = Function("binder", "return function (" +
|
|
2236
|
+
}, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
|
|
2237
|
+
return s = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this,arguments); }")(n),
|
|
2219
2238
|
c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
|
|
2220
2239
|
l.prototype = null), s;
|
|
2221
2240
|
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
@@ -2340,13 +2359,13 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2340
2359
|
}
|
|
2341
2360
|
}));
|
|
2342
2361
|
}, getPackageCandidates$1 = function e(t, r, s) {
|
|
2343
|
-
var n,
|
|
2344
|
-
for (n = 0; n <
|
|
2345
|
-
return
|
|
2362
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2363
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2364
|
+
return o;
|
|
2346
2365
|
}, async = function e(t, r, s) {
|
|
2347
2366
|
function n(e) {
|
|
2348
2367
|
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,
|
|
2368
|
+
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package, o) : i(T, C.package, o); else {
|
|
2350
2369
|
if (_ && isCoreModule(t)) return S(null, t);
|
|
2351
2370
|
!function r(e, t, s) {
|
|
2352
2371
|
var n = function() {
|
|
@@ -2364,7 +2383,7 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2364
2383
|
}));
|
|
2365
2384
|
}
|
|
2366
2385
|
}
|
|
2367
|
-
function
|
|
2386
|
+
function o(e, r, s) {
|
|
2368
2387
|
e ? S(e) : r ? S(null, r, s) : l(T, (function(e, r, s) {
|
|
2369
2388
|
if (e) S(e); else if (r) maybeRealpath(f, r, C, (function(e, t) {
|
|
2370
2389
|
e ? S(e) : S(null, t, s);
|
|
@@ -2374,20 +2393,20 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2374
2393
|
}
|
|
2375
2394
|
}));
|
|
2376
2395
|
}
|
|
2377
|
-
function
|
|
2396
|
+
function i(e, t, r) {
|
|
2378
2397
|
var s = t, n = r;
|
|
2379
2398
|
"function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
|
|
2380
|
-
function
|
|
2399
|
+
function o(s, o, a) {
|
|
2381
2400
|
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,
|
|
2401
|
+
return c = o, s ? n(s) : a && c && C.pathFilter && (h = (u = path__default.default.relative(a, l)).slice(0, u.length - t[0].length),
|
|
2402
|
+
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
|
|
2384
2403
|
}
|
|
2385
|
-
function
|
|
2386
|
-
return s ? n(s) :
|
|
2404
|
+
function i(s, o) {
|
|
2405
|
+
return s ? n(s) : o ? n(null, l, c) : void e(t.slice(1), r, c);
|
|
2387
2406
|
}
|
|
2388
2407
|
var l, c;
|
|
2389
2408
|
if (0 === t.length) return n(null, void 0, s);
|
|
2390
|
-
l = r + t[0], (c = s) ?
|
|
2409
|
+
l = r + t[0], (c = s) ? o(null, c) : a(path__default.default.dirname(l), o);
|
|
2391
2410
|
}([ "" ].concat(w), e, s);
|
|
2392
2411
|
}
|
|
2393
2412
|
function a(e, t) {
|
|
@@ -2398,8 +2417,8 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2398
2417
|
if (!s) return a(path__default.default.dirname(e), t);
|
|
2399
2418
|
m(p, n, (function(r, s) {
|
|
2400
2419
|
r && t(r);
|
|
2401
|
-
var
|
|
2402
|
-
|
|
2420
|
+
var o = s;
|
|
2421
|
+
o && C.packageFilter && (o = C.packageFilter(o, n)), t(null, o, e);
|
|
2403
2422
|
}));
|
|
2404
2423
|
}));
|
|
2405
2424
|
}));
|
|
@@ -2408,31 +2427,31 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2408
2427
|
var s = r, n = t;
|
|
2409
2428
|
"function" == typeof n && (s = n, n = C.package), maybeRealpath(f, e, C, (function(t, r) {
|
|
2410
2429
|
if (t) return s(t);
|
|
2411
|
-
var
|
|
2412
|
-
d(
|
|
2413
|
-
return t ? s(t) : r ? void m(p,
|
|
2430
|
+
var o = path__default.default.join(r, "package.json");
|
|
2431
|
+
d(o, (function(t, r) {
|
|
2432
|
+
return t ? s(t) : r ? void m(p, o, (function(t, r) {
|
|
2414
2433
|
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
|
|
2434
|
+
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n, o)), n && n.main ? "string" != typeof n.main ? ((a = new TypeError("package “" + n.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2435
|
+
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void i(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2417
2436
|
return t ? s(t) : r ? s(null, r, n) : n ? void l(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2418
|
-
return t ? s(t) : r ? s(null, r, n) : void
|
|
2419
|
-
})) :
|
|
2420
|
-
}))) : void
|
|
2421
|
-
})) :
|
|
2437
|
+
return t ? s(t) : r ? s(null, r, n) : void i(path__default.default.join(e, "index"), n, s);
|
|
2438
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2439
|
+
}))) : void i(path__default.default.join(e, "/index"), n, s));
|
|
2440
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2422
2441
|
}));
|
|
2423
2442
|
}));
|
|
2424
2443
|
}
|
|
2425
2444
|
function c(e, t) {
|
|
2426
|
-
function r(t, r,
|
|
2427
|
-
return t ? e(t) : r ? e(null, r,
|
|
2445
|
+
function r(t, r, o) {
|
|
2446
|
+
return t ? e(t) : r ? e(null, r, o) : void l(n, C.package, s);
|
|
2428
2447
|
}
|
|
2429
2448
|
function s(r, s, n) {
|
|
2430
2449
|
return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
|
|
2431
2450
|
}
|
|
2432
2451
|
if (0 === t.length) return e(null, void 0);
|
|
2433
2452
|
var n = t[0];
|
|
2434
|
-
h(path__default.default.dirname(n), (function
|
|
2435
|
-
return s ? e(s) : a ? void
|
|
2453
|
+
h(path__default.default.dirname(n), (function o(s, a) {
|
|
2454
|
+
return s ? e(s) : a ? void i(n, C.package, r) : c(e, t.slice(1));
|
|
2436
2455
|
}));
|
|
2437
2456
|
}
|
|
2438
2457
|
var u, d, h, p, f, m, g, y, w, _, v, b, E, T, S = s, C = r;
|
|
@@ -2572,64 +2591,64 @@ defaultIsFile = function e(t) {
|
|
|
2572
2591
|
return JSON.parse(s);
|
|
2573
2592
|
} catch (e) {}
|
|
2574
2593
|
}, getPackageCandidates = function e(t, r, s) {
|
|
2575
|
-
var n,
|
|
2576
|
-
for (n = 0; n <
|
|
2577
|
-
return
|
|
2594
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2595
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2596
|
+
return o;
|
|
2578
2597
|
}, sync = function e(t, r) {
|
|
2579
2598
|
function s(e) {
|
|
2580
|
-
var t, r, s,
|
|
2581
|
-
if (l && l.dir && l.pkg &&
|
|
2582
|
-
(r =
|
|
2599
|
+
var t, r, s, o, l = n(path__default.default.dirname(e));
|
|
2600
|
+
if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2601
|
+
(r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2583
2602
|
a(e)) return e;
|
|
2584
|
-
for (s = 0; s < p.length; s++) if (
|
|
2603
|
+
for (s = 0; s < p.length; s++) if (o = e + p[s], a(o)) return o;
|
|
2585
2604
|
}
|
|
2586
2605
|
function n(e) {
|
|
2587
2606
|
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)) &&
|
|
2607
|
+
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e, i), "package.json"),
|
|
2608
|
+
a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
|
|
2590
2609
|
pkg: r,
|
|
2591
2610
|
dir: e
|
|
2592
2611
|
}) : n(path__default.default.dirname(e));
|
|
2593
2612
|
}
|
|
2594
|
-
function
|
|
2595
|
-
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e,
|
|
2613
|
+
function o(e) {
|
|
2614
|
+
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
|
|
2596
2615
|
if (a(h)) {
|
|
2597
2616
|
try {
|
|
2598
2617
|
t = d(l, h);
|
|
2599
2618
|
} catch (e) {}
|
|
2600
|
-
if (t &&
|
|
2619
|
+
if (t && i.packageFilter && (t = i.packageFilter(t, e)), t && t.main) {
|
|
2601
2620
|
if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2602
2621
|
r;
|
|
2603
2622
|
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2604
2623
|
try {
|
|
2605
2624
|
if (n = s(path__default.default.resolve(e, t.main))) return n;
|
|
2606
|
-
if (c =
|
|
2625
|
+
if (c = o(path__default.default.resolve(e, t.main))) return c;
|
|
2607
2626
|
} catch (e) {}
|
|
2608
2627
|
}
|
|
2609
2628
|
}
|
|
2610
2629
|
return s(path__default.default.join(e, "/index"));
|
|
2611
2630
|
}
|
|
2612
|
-
var
|
|
2631
|
+
var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
|
|
2613
2632
|
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),
|
|
2633
|
+
if (i = normalizeOptions(0, r), a = i.isFile || defaultIsFile, l = i.readFileSync || fs__default.default.readFileSync,
|
|
2634
|
+
c = i.isDirectory || defaultIsDir, u = i.realpathSync || defaultRealpathSync, d = i.readPackageSync || defaultReadPackageSync,
|
|
2635
|
+
i.readFileSync && i.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
2636
|
+
if (h = i.packageIterator, p = i.extensions || [ ".js" ], f = !1 !== i.includeCoreModules,
|
|
2637
|
+
m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || [],
|
|
2638
|
+
y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2620
2639
|
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2621
|
-
_ = s(w) ||
|
|
2640
|
+
_ = s(w) || o(w)) return maybeRealpathSync(u, _, i);
|
|
2622
2641
|
} else {
|
|
2623
2642
|
if (f && isCoreModule(t)) return t;
|
|
2624
2643
|
if (v = function E(e, t) {
|
|
2625
2644
|
var r, n, a, l, u = function() {
|
|
2626
|
-
return getPackageCandidates(e, t,
|
|
2627
|
-
}, d = h ? h(e, t, u,
|
|
2645
|
+
return getPackageCandidates(e, t, i);
|
|
2646
|
+
}, d = h ? h(e, t, u, i) : u();
|
|
2628
2647
|
for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
|
|
2629
2648
|
if (a = s(n)) return a;
|
|
2630
|
-
if (l =
|
|
2649
|
+
if (l = o(n)) return l;
|
|
2631
2650
|
}
|
|
2632
|
-
}(t, y)) return maybeRealpathSync(u, v,
|
|
2651
|
+
}(t, y)) return maybeRealpathSync(u, v, i);
|
|
2633
2652
|
}
|
|
2634
2653
|
throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
|
|
2635
2654
|
b;
|
|
@@ -2666,8 +2685,8 @@ const createSystem = e => {
|
|
|
2666
2685
|
let r = BLUE, s = "Build", n = "";
|
|
2667
2686
|
"error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
|
|
2668
2687
|
s = "Warning"), e.header && (s = e.header);
|
|
2669
|
-
const
|
|
2670
|
-
if (
|
|
2688
|
+
const o = e.relFilePath || e.absFilePath;
|
|
2689
|
+
if (o && (n += o, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
|
|
2671
2690
|
"number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
|
|
2672
2691
|
n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
|
|
2673
2692
|
n += "\n" + e.lineNumber + ": " + e.text;
|
|
@@ -2678,7 +2697,7 @@ const createSystem = e => {
|
|
|
2678
2697
|
})(t, e)));
|
|
2679
2698
|
}
|
|
2680
2699
|
};
|
|
2681
|
-
})(), r = new Map, s = new Set, n = e => s.add(e),
|
|
2700
|
+
})(), r = new Map, s = new Set, n = e => s.add(e), o = e => s.delete(e), i = (() => {
|
|
2682
2701
|
const e = [], t = t => {
|
|
2683
2702
|
const r = e.findIndex((e => e.callback === t));
|
|
2684
2703
|
return r > -1 && (e.splice(r, 1), !0);
|
|
@@ -2705,11 +2724,11 @@ const createSystem = e => {
|
|
|
2705
2724
|
}), () => t(n);
|
|
2706
2725
|
}
|
|
2707
2726
|
if ("string" == typeof r && "function" == typeof s) {
|
|
2708
|
-
const n = r.toLowerCase().trim(),
|
|
2727
|
+
const n = r.toLowerCase().trim(), o = s;
|
|
2709
2728
|
return e.push({
|
|
2710
2729
|
eventName: n,
|
|
2711
|
-
callback:
|
|
2712
|
-
}), () => t(
|
|
2730
|
+
callback: o
|
|
2731
|
+
}), () => t(o);
|
|
2713
2732
|
}
|
|
2714
2733
|
return () => !1;
|
|
2715
2734
|
},
|
|
@@ -2737,8 +2756,8 @@ const createSystem = e => {
|
|
|
2737
2756
|
}, d = (e, t, s) => {
|
|
2738
2757
|
const n = path$2.dirname(e);
|
|
2739
2758
|
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && d(n, t, s);
|
|
2740
|
-
const
|
|
2741
|
-
|
|
2759
|
+
const o = r.get(e);
|
|
2760
|
+
o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
|
|
2742
2761
|
basename: path$2.basename(e),
|
|
2743
2762
|
dirname: n,
|
|
2744
2763
|
isDirectory: !0,
|
|
@@ -2762,10 +2781,10 @@ const createSystem = e => {
|
|
|
2762
2781
|
}), m = (e, t, s) => {
|
|
2763
2782
|
const n = w(e);
|
|
2764
2783
|
if (!n.error && !s.error) if (n.isFile) {
|
|
2765
|
-
const n = path$2.dirname(t),
|
|
2784
|
+
const n = path$2.dirname(t), o = u(n, {
|
|
2766
2785
|
recursive: !0
|
|
2767
|
-
}),
|
|
2768
|
-
s.newDirs.push(...
|
|
2786
|
+
}), i = r.get(e).data, a = b(t, i);
|
|
2787
|
+
s.newDirs.push(...o.newDirs), s.renamed.push({
|
|
2769
2788
|
oldPath: e,
|
|
2770
2789
|
newPath: t,
|
|
2771
2790
|
isDirectory: !1,
|
|
@@ -2863,8 +2882,8 @@ const createSystem = e => {
|
|
|
2863
2882
|
u("/");
|
|
2864
2883
|
const S = {
|
|
2865
2884
|
name: "in-memory",
|
|
2866
|
-
version: "2.
|
|
2867
|
-
events:
|
|
2885
|
+
version: "2.14.1",
|
|
2886
|
+
events: i,
|
|
2868
2887
|
access: async e => c(e),
|
|
2869
2888
|
accessSync: c,
|
|
2870
2889
|
addDestory: n,
|
|
@@ -2911,7 +2930,7 @@ const createSystem = e => {
|
|
|
2911
2930
|
readFileSync: p,
|
|
2912
2931
|
realpath: async e => f(e),
|
|
2913
2932
|
realpathSync: f,
|
|
2914
|
-
removeDestory:
|
|
2933
|
+
removeDestory: o,
|
|
2915
2934
|
rename: async (e, t) => {
|
|
2916
2935
|
const r = {
|
|
2917
2936
|
oldPath: e = normalizePath(e),
|
|
@@ -2948,14 +2967,14 @@ const createSystem = e => {
|
|
|
2948
2967
|
removeFileSync: _,
|
|
2949
2968
|
watchDirectory: (e, t) => {
|
|
2950
2969
|
e = l(e);
|
|
2951
|
-
const s = r.get(e),
|
|
2970
|
+
const s = r.get(e), i = () => {
|
|
2952
2971
|
const s = r.get(e);
|
|
2953
2972
|
if (s && s.watcherCallbacks) {
|
|
2954
2973
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2955
2974
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2956
2975
|
}
|
|
2957
2976
|
};
|
|
2958
|
-
return n(
|
|
2977
|
+
return n(i), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2959
2978
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2960
2979
|
basename: path$2.basename(e),
|
|
2961
2980
|
dirname: path$2.dirname(e),
|
|
@@ -2965,20 +2984,20 @@ const createSystem = e => {
|
|
|
2965
2984
|
data: void 0
|
|
2966
2985
|
}), {
|
|
2967
2986
|
close() {
|
|
2968
|
-
i
|
|
2987
|
+
o(i), i();
|
|
2969
2988
|
}
|
|
2970
2989
|
};
|
|
2971
2990
|
},
|
|
2972
2991
|
watchFile: (e, t) => {
|
|
2973
2992
|
e = l(e);
|
|
2974
|
-
const s = r.get(e),
|
|
2993
|
+
const s = r.get(e), i = () => {
|
|
2975
2994
|
const s = r.get(e);
|
|
2976
2995
|
if (s && s.watcherCallbacks) {
|
|
2977
2996
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2978
2997
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2979
2998
|
}
|
|
2980
2999
|
};
|
|
2981
|
-
return n(
|
|
3000
|
+
return n(i), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2982
3001
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2983
3002
|
basename: path$2.basename(e),
|
|
2984
3003
|
dirname: path$2.dirname(e),
|
|
@@ -2988,7 +3007,7 @@ const createSystem = e => {
|
|
|
2988
3007
|
data: void 0
|
|
2989
3008
|
}), {
|
|
2990
3009
|
close() {
|
|
2991
|
-
i
|
|
3010
|
+
o(i), i();
|
|
2992
3011
|
}
|
|
2993
3012
|
};
|
|
2994
3013
|
},
|
|
@@ -3001,18 +3020,18 @@ const createSystem = e => {
|
|
|
3001
3020
|
return "number" == typeof t && (s = s.substr(0, t)), s;
|
|
3002
3021
|
},
|
|
3003
3022
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
3004
|
-
let r, s = 0, n = !1,
|
|
3023
|
+
let r, s = 0, n = !1, o = !1, i = 0;
|
|
3005
3024
|
const a = new Map, l = [], c = [], u = Math.max(Math.min(t, e.hardwareConcurrency), 2) - 1, d = Promise.resolve(), h = e => console.error(e), p = () => {
|
|
3006
3025
|
let t = null;
|
|
3007
|
-
const s = e.getCompilerExecutingPath(),
|
|
3008
|
-
name: "stencil.worker." +
|
|
3026
|
+
const s = e.getCompilerExecutingPath(), o = {
|
|
3027
|
+
name: "stencil.worker." + i++
|
|
3009
3028
|
};
|
|
3010
3029
|
try {
|
|
3011
|
-
t = new Worker(s,
|
|
3030
|
+
t = new Worker(s, o);
|
|
3012
3031
|
} catch (e) {
|
|
3013
3032
|
null == r && (r = new Blob([ `importScripts('${s}');` ], {
|
|
3014
3033
|
type: "application/javascript"
|
|
3015
|
-
})), t = new Worker(URL.createObjectURL(r),
|
|
3034
|
+
})), t = new Worker(URL.createObjectURL(r), o);
|
|
3016
3035
|
}
|
|
3017
3036
|
const l = {
|
|
3018
3037
|
worker: t,
|
|
@@ -3041,7 +3060,7 @@ const createSystem = e => {
|
|
|
3041
3060
|
} else t = p(), c.push(t);
|
|
3042
3061
|
t.activeTasks++, t.sendQueue.push(e);
|
|
3043
3062
|
}, g = () => {
|
|
3044
|
-
|
|
3063
|
+
o = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
3045
3064
|
}, y = (...e) => new Promise(((t, r) => {
|
|
3046
3065
|
if (n) r("task canceled"); else {
|
|
3047
3066
|
const n = {
|
|
@@ -3051,7 +3070,7 @@ const createSystem = e => {
|
|
|
3051
3070
|
l.push(n), a.set(n.stencilId, {
|
|
3052
3071
|
resolve: t,
|
|
3053
3072
|
reject: r
|
|
3054
|
-
}),
|
|
3073
|
+
}), o || (o = !0, d.then(g));
|
|
3055
3074
|
}
|
|
3056
3075
|
}));
|
|
3057
3076
|
return {
|
|
@@ -3082,11 +3101,11 @@ const createSystem = e => {
|
|
|
3082
3101
|
return S.resolveModuleId = e => ((e, t, r) => {
|
|
3083
3102
|
const s = ((e, t, r) => ({
|
|
3084
3103
|
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,
|
|
3104
|
+
const o = normalizeFsPath(s);
|
|
3105
|
+
if ((await t.stat(o)).isFile) n(null, !0); else {
|
|
3106
|
+
if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
|
|
3107
|
+
const r = getNodeModuleFetchUrl(e, packageVersions, o);
|
|
3108
|
+
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
|
|
3090
3109
|
}
|
|
3091
3110
|
n(null, !1);
|
|
3092
3111
|
}
|
|
@@ -3099,7 +3118,7 @@ const createSystem = e => {
|
|
|
3099
3118
|
void s(null, !0);
|
|
3100
3119
|
if (isCommonDirModuleFile(n)) return void s(null, !1);
|
|
3101
3120
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
3102
|
-
const
|
|
3121
|
+
const o = getCommonDirUrl(e, packageVersions, n, r), i = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, o, i);
|
|
3103
3122
|
if (isString(a)) return void s(null, !0);
|
|
3104
3123
|
}
|
|
3105
3124
|
}
|
|
@@ -3118,13 +3137,13 @@ const createSystem = e => {
|
|
|
3118
3137
|
}))(e, null, r.exts);
|
|
3119
3138
|
return s.basedir = path$2.dirname(normalizeFsPath(r.containingFile)), r.packageFilter ? s.packageFilter = r.packageFilter : null !== r.packageFilter && (s.packageFilter = e => (isString(e.main) && "" !== e.main || (e.main = "package.json"),
|
|
3120
3139
|
e)), new Promise(((e, t) => {
|
|
3121
|
-
resolve(r.moduleId, s, ((s, n,
|
|
3140
|
+
resolve(r.moduleId, s, ((s, n, o) => {
|
|
3122
3141
|
if (s) t(s); else {
|
|
3123
3142
|
n = normalizePath(n);
|
|
3124
3143
|
const t = {
|
|
3125
3144
|
moduleId: r.moduleId,
|
|
3126
3145
|
resolveId: n,
|
|
3127
|
-
pkgData:
|
|
3146
|
+
pkgData: o,
|
|
3128
3147
|
pkgDirPath: getPackageDirPath(n, r.moduleId)
|
|
3129
3148
|
};
|
|
3130
3149
|
e(t);
|
|
@@ -3164,7 +3183,7 @@ const createSystem = e => {
|
|
|
3164
3183
|
t = e;
|
|
3165
3184
|
}
|
|
3166
3185
|
}
|
|
3167
|
-
}), !function
|
|
3186
|
+
}), !function o(e) {
|
|
3168
3187
|
return "diskReads" in e && "diskWrites" in e;
|
|
3169
3188
|
}(r)) throw new Error("could not generate TestingSystem");
|
|
3170
3189
|
return r;
|
|
@@ -3336,8 +3355,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3336
3355
|
waitForVisible() {
|
|
3337
3356
|
return new Promise(((e, t) => {
|
|
3338
3357
|
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`),
|
|
3358
|
+
await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
|
|
3359
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3341
3360
|
clearTimeout(r), t(n);
|
|
3342
3361
|
}), s);
|
|
3343
3362
|
}));
|
|
@@ -3345,8 +3364,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3345
3364
|
waitForNotVisible() {
|
|
3346
3365
|
return new Promise(((e, t) => {
|
|
3347
3366
|
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`),
|
|
3367
|
+
await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
|
|
3368
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3350
3369
|
clearTimeout(r), t(n);
|
|
3351
3370
|
}), s);
|
|
3352
3371
|
}));
|
|
@@ -3602,17 +3621,18 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3602
3621
|
}
|
|
3603
3622
|
};
|
|
3604
3623
|
}, exports.createTestRunner = function createTestRunner() {
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3624
|
+
var e;
|
|
3625
|
+
const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
|
|
3626
|
+
return class r extends t {
|
|
3627
|
+
async runTests(e, t, r, s, n, o) {
|
|
3628
|
+
const i = process.env;
|
|
3609
3629
|
if (e = e.filter((e => function t(e, r) {
|
|
3610
3630
|
const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
|
|
3611
3631
|
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,
|
|
3632
|
+
}(e.path, i))), "true" === i.__STENCIL_SCREENSHOT__) {
|
|
3633
|
+
const a = JSON.parse(i.__STENCIL_EMULATE_CONFIGS__);
|
|
3634
|
+
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r, s, n, o);
|
|
3635
|
+
} else await super.runTests(e, t, r, s, n, o);
|
|
3616
3636
|
}
|
|
3617
3637
|
};
|
|
3618
3638
|
}, exports.createTesting = async e => {
|
|
@@ -3624,14 +3644,14 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3624
3644
|
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3625
3645
|
}(e);
|
|
3626
3646
|
const {createCompiler: r} = require("../compiler/stencil.js"), s = await r(e);
|
|
3627
|
-
let n,
|
|
3628
|
-
const
|
|
3647
|
+
let n, o;
|
|
3648
|
+
const i = async () => {
|
|
3629
3649
|
const t = [];
|
|
3630
3650
|
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), n && (n.close && t.push(n.close()),
|
|
3631
|
-
n = null),
|
|
3651
|
+
n = null), o && (o.close && t.push(o.close()), o = null), await Promise.all(t);
|
|
3632
3652
|
};
|
|
3633
3653
|
return {
|
|
3634
|
-
destroy:
|
|
3654
|
+
destroy: i,
|
|
3635
3655
|
run: async (t = {}) => {
|
|
3636
3656
|
let r, a = !1, l = !1, c = null;
|
|
3637
3657
|
const u = [];
|
|
@@ -3654,9 +3674,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3654
3674
|
})), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3655
3675
|
e.devServer.reloadStrategy = null;
|
|
3656
3676
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3657
|
-
if (n = l[0],
|
|
3677
|
+
if (n = l[0], o = l[1], t) {
|
|
3658
3678
|
const r = await t;
|
|
3659
|
-
if (!r || !e.watch && hasError(r && r.diagnostics)) return await
|
|
3679
|
+
if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
|
|
3660
3680
|
}
|
|
3661
3681
|
n && (r.__STENCIL_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__STENCIL_BROWSER_URL__}`),
|
|
3662
3682
|
r.__STENCIL_APP_SCRIPT_URL__ = function d(e, t) {
|
|
@@ -3690,13 +3710,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3690
3710
|
waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
|
|
3691
3711
|
pixelmatchModulePath: s
|
|
3692
3712
|
}), e.flags.updateScreenshot || await r.pullMasterBuild(), n.finish("screenshot, initBuild finished");
|
|
3693
|
-
const
|
|
3694
|
-
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(
|
|
3713
|
+
const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
|
|
3714
|
+
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(i, a);
|
|
3695
3715
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3696
3716
|
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3697
3717
|
try {
|
|
3698
3718
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3699
|
-
let s = await r.completeBuild(
|
|
3719
|
+
let s = await r.completeBuild(i);
|
|
3700
3720
|
if (t.finish("screenshot, completeTimespan finished"), s) {
|
|
3701
3721
|
const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
|
|
3702
3722
|
if (s = await r.publishBuild(s), t.finish("screenshot, publishBuild finished"),
|
|
@@ -3710,7 +3730,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3710
3730
|
}
|
|
3711
3731
|
}
|
|
3712
3732
|
} catch (t) {
|
|
3713
|
-
e.logger.error(t, t.stack);
|
|
3733
|
+
t instanceof Error ? e.logger.error(t, t.stack) : e.logger.error(t);
|
|
3714
3734
|
}
|
|
3715
3735
|
return c;
|
|
3716
3736
|
}(e, r) : await runJest(e, r), e.logger.info(""), c && await c.close();
|
|
@@ -3778,19 +3798,19 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3778
3798
|
const t = process.env;
|
|
3779
3799
|
"true" === t.__STENCIL_SCREENSHOT__ ? e.compareScreenshot = (r, s) => {
|
|
3780
3800
|
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(
|
|
3801
|
+
let o, i = "", a = "";
|
|
3802
|
+
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (i = n.currentSpec.fullName),
|
|
3803
|
+
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (i.length > 0 ? i += ", " + r : i = r,
|
|
3804
|
+
"object" == typeof s && (o = s)) : "object" == typeof r && (o = r), i = i.trim(),
|
|
3805
|
+
o = o || {}, !i) throw new Error(`Invalid screenshot description in "${a}"`);
|
|
3806
|
+
if (n.screenshotDescriptions.has(i)) throw new Error(`Screenshot description "${i}" found in "${a}" cannot be used for multiple screenshots and must be unique. To make screenshot descriptions unique within the same test, use the first argument to "compareScreenshot", such as "compareScreenshot('more to the description')".`);
|
|
3807
|
+
return n.screenshotDescriptions.add(i), async function l(e, t, r, s, n) {
|
|
3788
3808
|
if ("string" != typeof t.__STENCIL_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
|
|
3789
3809
|
if ("string" != typeof t.__STENCIL_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
3790
|
-
const
|
|
3810
|
+
const o = JSON.parse(t.__STENCIL_EMULATE__), i = JSON.parse(t.__STENCIL_SCREENSHOT_BUILD__);
|
|
3791
3811
|
await function a(e) {
|
|
3792
3812
|
return new Promise((t => setTimeout(t, e)));
|
|
3793
|
-
}(
|
|
3813
|
+
}(i.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
|
|
3794
3814
|
window.requestAnimationFrame((() => {
|
|
3795
3815
|
e();
|
|
3796
3816
|
}));
|
|
@@ -3808,11 +3828,11 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3808
3828
|
width: e.clip.width,
|
|
3809
3829
|
height: e.clip.height
|
|
3810
3830
|
}), t;
|
|
3811
|
-
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold :
|
|
3812
|
-
let h =
|
|
3831
|
+
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : i.pixelmatchThreshold;
|
|
3832
|
+
let h = o.viewport.width, p = o.viewport.height;
|
|
3813
3833
|
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,
|
|
3834
|
+
await compareScreenshot(o, i, u, r, h, p, s, d);
|
|
3835
|
+
}(e, t, i, a, o);
|
|
3816
3836
|
} : e.compareScreenshot = async () => ({
|
|
3817
3837
|
mismatchedPixels: 0,
|
|
3818
3838
|
allowableMismatchedPixels: 1,
|
|
@@ -3860,13 +3880,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3860
3880
|
e();
|
|
3861
3881
|
}))));
|
|
3862
3882
|
};
|
|
3863
|
-
const
|
|
3883
|
+
const o = !0 === e.failOnConsoleError, i = !0 === e.failOnNetworkError;
|
|
3864
3884
|
t.on("console", (e => {
|
|
3865
3885
|
"error" === e.type() && (r.push({
|
|
3866
3886
|
type: "error",
|
|
3867
3887
|
message: e.text(),
|
|
3868
3888
|
location: e.location().url
|
|
3869
|
-
}),
|
|
3889
|
+
}), o && fail(new Error(serializeConsoleMessage(e)))), function t(e) {
|
|
3870
3890
|
const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
|
|
3871
3891
|
"debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
|
|
3872
3892
|
}(e);
|
|
@@ -3881,7 +3901,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3881
3901
|
type: "requestfailed",
|
|
3882
3902
|
message: e.failure().errorText,
|
|
3883
3903
|
location: e.url()
|
|
3884
|
-
}),
|
|
3904
|
+
}), i ? fail(new Error(e.failure().errorText)) : console.error("requestfailed", e.url());
|
|
3885
3905
|
})), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
|
|
3886
3906
|
waitUntil: e.waitUntil
|
|
3887
3907
|
}) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
|
|
@@ -3947,7 +3967,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3947
3967
|
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
3948
3968
|
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
3949
3969
|
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
3950
|
-
})),
|
|
3970
|
+
})), o = (e => {
|
|
3951
3971
|
const t = e.some((e => e.htmlTagNames.includes("slot"))), r = e.some((e => "shadow" === e.encapsulation)), s = e.some((e => "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot"))), n = {
|
|
3952
3972
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
3953
3973
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
@@ -4007,8 +4027,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4007
4027
|
return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
|
|
4008
4028
|
n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
|
|
4009
4029
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4010
|
-
if (e.strictBuild ? Object.assign(appData.BUILD,
|
|
4011
|
-
!0 ===
|
|
4030
|
+
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
|
|
4031
|
+
!0 === o[e] && (appData.BUILD[e] = !0);
|
|
4012
4032
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4013
4033
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4014
4034
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
@@ -4038,10 +4058,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4038
4058
|
testing.renderVdom(t, e.template());
|
|
4039
4059
|
} else "string" == typeof e.html && (s.body.innerHTML = e.html);
|
|
4040
4060
|
!1 !== e.flushQueue && await s.waitForChanges();
|
|
4041
|
-
let
|
|
4061
|
+
let i = null;
|
|
4042
4062
|
return Object.defineProperty(s, "root", {
|
|
4043
4063
|
get() {
|
|
4044
|
-
if (null ==
|
|
4064
|
+
if (null == i && (i = findRootComponent(t, s.body)), null != i) return i;
|
|
4045
4065
|
const e = s.body.firstElementChild;
|
|
4046
4066
|
return null != e ? e : null;
|
|
4047
4067
|
}
|