@stencil/core 3.0.0-alpha.0 → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/config-flags.d.ts +16 -16
- package/cli/index.cjs +6 -4
- package/cli/index.js +6 -4
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +434 -251
- package/compiler/lib.dom.iterable.d.ts +7 -13
- package/compiler/lib.es2015.collection.d.ts +62 -1
- package/compiler/lib.es2015.promise.d.ts +9 -4
- package/compiler/lib.es2015.proxy.d.ts +91 -2
- package/compiler/lib.es2015.reflect.d.ts +25 -2
- package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
- package/compiler/lib.es2017.intl.d.ts +16 -1
- package/compiler/lib.es2019.d.ts +1 -0
- package/compiler/lib.es2019.intl.d.ts +25 -0
- package/compiler/lib.es2020.intl.d.ts +31 -6
- package/compiler/lib.es2021.intl.d.ts +11 -3
- package/compiler/lib.es2022.d.ts +1 -0
- package/compiler/lib.es2022.error.d.ts +2 -2
- package/compiler/lib.es2022.sharedmemory.d.ts +27 -0
- package/compiler/lib.es5.d.ts +39 -14
- package/compiler/lib.esnext.intl.d.ts +5 -1
- package/compiler/lib.webworker.d.ts +318 -55
- package/compiler/lib.webworker.iterable.d.ts +11 -3
- package/compiler/package.json +1 -1
- package/compiler/stencil.d.ts +1 -23
- package/compiler/stencil.js +12597 -11461
- package/compiler/stencil.min.js +2 -2
- package/compiler/sys/in-memory-fs.d.ts +3 -3
- package/compiler/transpile.d.ts +32 -0
- package/dependencies.json +3 -1
- package/dev-server/client/app-error.d.ts +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/open-in-editor-api.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 +2 -2
- 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/polyfills/css-shim.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +2 -2
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +4 -4
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +38 -37
- package/internal/stencil-public-compiler.d.ts +27 -27
- package/internal/stencil-public-runtime.d.ts +3 -3
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.d.ts +2 -2
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +8 -8
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +1 -1
- package/sys/node/glob.js +1 -1
- package/sys/node/index.js +31 -44
- package/sys/node/package.json +1 -1
- package/sys/node/prompts.js +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +613 -420
- package/testing/jest/jest-preprocessor.d.ts +3 -3
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-declarations.d.ts +4 -4
- package/testing/puppeteer/puppeteer-element.d.ts +3 -3
- package/testing/testing-utils.d.ts +1 -1
package/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Testing v3.0.0-alpha.
|
|
2
|
+
Stencil Testing v3.0.0-alpha.2 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
function _lazyRequire(e) {
|
|
5
5
|
return new Proxy({}, {
|
|
@@ -36,21 +36,40 @@ function _interopNamespace(e) {
|
|
|
36
36
|
})), t.default = e, Object.freeze(t);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
function createCommonjsModule(e, t, r) {
|
|
40
|
+
return e(r = {
|
|
41
|
+
path: t,
|
|
42
|
+
exports: {},
|
|
43
|
+
require: function(e, t) {
|
|
44
|
+
return function s() {
|
|
45
|
+
throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
46
|
+
}(null == t && r.path);
|
|
47
|
+
}
|
|
48
|
+
}, r.exports), r.exports;
|
|
49
|
+
}
|
|
50
|
+
|
|
39
51
|
async function startPuppeteerBrowser(e) {
|
|
40
52
|
if (!e.flags.e2e) return null;
|
|
41
|
-
const t = process.env, r = e.testing.browserExecutablePath ? "puppeteer-core" : "puppeteer", s = e.sys.lazyRequire.getModulePath(e.rootDir, r), n = e.sys.lazyRequire.require(e.rootDir, s);
|
|
42
|
-
t.__STENCIL_PUPPETEER_MODULE__ = s
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
const t = process.env, r = e.testing.browserExecutablePath ? "puppeteer-core" : "puppeteer", s = e.sys.lazyRequire.getModulePath(e.rootDir, r), n = e.sys.platformPath.join(s, "package.json"), i = e.sys.lazyRequire.require(e.rootDir, s);
|
|
54
|
+
t.__STENCIL_PUPPETEER_MODULE__ = s;
|
|
55
|
+
try {
|
|
56
|
+
const r = e.sys.readFileSync(n, "utf8"), s = JSON.parse(r);
|
|
57
|
+
t.__STENCIL_PUPPETEER_VERSION__ = major_1(s.version);
|
|
58
|
+
} catch (e) {
|
|
59
|
+
console.error(`An error occurred determining the version of Puppeteer installed:\n${e}`),
|
|
60
|
+
t.__STENCIL_PUPPETEER_VERSION__ = void 0;
|
|
61
|
+
}
|
|
62
|
+
t.__STENCIL_BROWSER_WAIT_UNTIL = e.testing.browserWaitUntil, e.flags.devtools && (e.testing.browserDevtools = !0,
|
|
63
|
+
e.testing.browserHeadless = !1, t.__STENCIL_E2E_DEVTOOLS__ = "true"), e.logger.debug(`puppeteer: ${s}`),
|
|
64
|
+
e.logger.debug(`puppeteer headless: ${e.testing.browserHeadless}`), Array.isArray(e.testing.browserArgs) && e.logger.debug(`puppeteer args: ${e.testing.browserArgs.join(" ")}`),
|
|
46
65
|
"boolean" == typeof e.testing.browserDevtools && e.logger.debug(`puppeteer devtools: ${e.testing.browserDevtools}`),
|
|
47
66
|
"number" == typeof e.testing.browserSlowMo && e.logger.debug(`puppeteer slowMo: ${e.testing.browserSlowMo}`);
|
|
48
67
|
const o = {
|
|
49
68
|
ignoreHTTPSErrors: !0,
|
|
50
69
|
slowMo: e.testing.browserSlowMo
|
|
51
70
|
};
|
|
52
|
-
let
|
|
53
|
-
if (e.testing.browserWSEndpoint)
|
|
71
|
+
let a;
|
|
72
|
+
if (e.testing.browserWSEndpoint) a = await i.connect({
|
|
54
73
|
browserWSEndpoint: e.testing.browserWSEndpoint,
|
|
55
74
|
...o
|
|
56
75
|
}); else {
|
|
@@ -61,12 +80,12 @@ async function startPuppeteerBrowser(e) {
|
|
|
61
80
|
...o
|
|
62
81
|
};
|
|
63
82
|
e.testing.browserExecutablePath && (t.executablePath = e.testing.browserExecutablePath),
|
|
64
|
-
|
|
83
|
+
a = await i.launch({
|
|
65
84
|
...t
|
|
66
85
|
});
|
|
67
86
|
}
|
|
68
|
-
return t.__STENCIL_BROWSER_WS_ENDPOINT__ =
|
|
69
|
-
|
|
87
|
+
return t.__STENCIL_BROWSER_WS_ENDPOINT__ = a.wsEndpoint(), e.logger.debug(`puppeteer browser wsEndpoint: ${t.__STENCIL_BROWSER_WS_ENDPOINT__}`),
|
|
88
|
+
a;
|
|
70
89
|
}
|
|
71
90
|
|
|
72
91
|
function transpile(e, t = {}) {
|
|
@@ -118,30 +137,30 @@ function getCompilerOptions(e) {
|
|
|
118
137
|
};
|
|
119
138
|
if (1 === e.category && (t.level = "error"), e.file) {
|
|
120
139
|
t.absFilePath = e.file.fileName;
|
|
121
|
-
const s = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), n = e.file.getLineAndCharacterOfPosition(e.start),
|
|
140
|
+
const s = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), n = e.file.getLineAndCharacterOfPosition(e.start), i = {
|
|
122
141
|
lineIndex: n.line,
|
|
123
142
|
lineNumber: n.line + 1,
|
|
124
143
|
text: s[n.line],
|
|
125
144
|
errorCharStart: n.character,
|
|
126
145
|
errorLength: Math.max(e.length, 1)
|
|
127
146
|
};
|
|
128
|
-
if (t.lineNumber =
|
|
129
|
-
0 ===
|
|
130
|
-
|
|
147
|
+
if (t.lineNumber = i.lineNumber, t.columnNumber = i.errorCharStart + 1, t.lines.push(i),
|
|
148
|
+
0 === i.errorLength && i.errorCharStart > 0 && (i.errorLength = 1, i.errorCharStart--),
|
|
149
|
+
i.lineIndex > 0) {
|
|
131
150
|
const e = {
|
|
132
|
-
lineIndex:
|
|
133
|
-
lineNumber:
|
|
134
|
-
text: s[
|
|
151
|
+
lineIndex: i.lineIndex - 1,
|
|
152
|
+
lineNumber: i.lineNumber - 1,
|
|
153
|
+
text: s[i.lineIndex - 1],
|
|
135
154
|
errorCharStart: -1,
|
|
136
155
|
errorLength: -1
|
|
137
156
|
};
|
|
138
157
|
t.lines.unshift(e);
|
|
139
158
|
}
|
|
140
|
-
if (
|
|
159
|
+
if (i.lineIndex + 1 < s.length) {
|
|
141
160
|
const e = {
|
|
142
|
-
lineIndex:
|
|
143
|
-
lineNumber:
|
|
144
|
-
text: s[
|
|
161
|
+
lineIndex: i.lineIndex + 1,
|
|
162
|
+
lineNumber: i.lineNumber + 1,
|
|
163
|
+
text: s[i.lineIndex + 1],
|
|
145
164
|
errorCharStart: -1,
|
|
146
165
|
errorLength: -1
|
|
147
166
|
};
|
|
@@ -224,7 +243,7 @@ async function runJest(e, t) {
|
|
|
224
243
|
testLocationInResults: !1,
|
|
225
244
|
"test-location-in-results": !1,
|
|
226
245
|
...n
|
|
227
|
-
}, n.config = function
|
|
246
|
+
}, n.config = function i(e) {
|
|
228
247
|
const t = e.testing, r = require("jest-config").defaults, s = Object.keys(r), n = {};
|
|
229
248
|
return Object.keys(t).forEach((e => {
|
|
230
249
|
s.includes(e) && (n[e] = t[e]);
|
|
@@ -240,11 +259,11 @@ async function runJest(e, t) {
|
|
|
240
259
|
n.maxWorkers = parseInt(n.maxWorkers, 10);
|
|
241
260
|
} catch (e) {}
|
|
242
261
|
return "string" == typeof n.ci && (n.ci = "true" === n.ci || "" === n.ci), n;
|
|
243
|
-
}(e),
|
|
262
|
+
}(e), i = function i(e, t) {
|
|
244
263
|
const r = t.projects ? t.projects : [];
|
|
245
264
|
return r.push(e.rootDir), r;
|
|
246
|
-
}(e, n), {runCLI:
|
|
247
|
-
r = !!(await
|
|
265
|
+
}(e, n), {runCLI: o} = require("@jest/core");
|
|
266
|
+
r = !!(await o(n, i)).results.success;
|
|
248
267
|
} catch (t) {
|
|
249
268
|
e.logger.error(`runJest: ${t}`);
|
|
250
269
|
}
|
|
@@ -292,11 +311,11 @@ function compareHtml(e, t, r) {
|
|
|
292
311
|
});
|
|
293
312
|
}
|
|
294
313
|
}
|
|
295
|
-
const
|
|
314
|
+
const i = index_cjs.parseHtmlToFragment(t), o = index_cjs.serializeNodeToHtml(i, {
|
|
296
315
|
prettyHtml: !0,
|
|
297
316
|
excludeTags: [ "body" ]
|
|
298
317
|
});
|
|
299
|
-
return s !==
|
|
318
|
+
return s !== o ? (expect(s).toBe(o), {
|
|
300
319
|
message: () => "HTML does not match",
|
|
301
320
|
pass: !1
|
|
302
321
|
}) : {
|
|
@@ -356,7 +375,7 @@ function assertPath(e) {
|
|
|
356
375
|
}
|
|
357
376
|
|
|
358
377
|
function normalizeStringPosix(e, t) {
|
|
359
|
-
var r, s, n,
|
|
378
|
+
var r, s, n, i = "", o = 0, a = -1, l = 0;
|
|
360
379
|
for (s = 0; s <= e.length; ++s) {
|
|
361
380
|
if (s < e.length) r = e.charCodeAt(s); else {
|
|
362
381
|
if (47 === r) break;
|
|
@@ -364,27 +383,27 @@ function normalizeStringPosix(e, t) {
|
|
|
364
383
|
}
|
|
365
384
|
if (47 === r) {
|
|
366
385
|
if (a === s - 1 || 1 === l) ; else if (a !== s - 1 && 2 === l) {
|
|
367
|
-
if (
|
|
368
|
-
if ((n =
|
|
369
|
-
-1 === n ? (
|
|
386
|
+
if (i.length < 2 || 2 !== o || 46 !== i.charCodeAt(i.length - 1) || 46 !== i.charCodeAt(i.length - 2)) if (i.length > 2) {
|
|
387
|
+
if ((n = i.lastIndexOf("/")) !== i.length - 1) {
|
|
388
|
+
-1 === n ? (i = "", o = 0) : o = (i = i.slice(0, n)).length - 1 - i.lastIndexOf("/"),
|
|
370
389
|
a = s, l = 0;
|
|
371
390
|
continue;
|
|
372
391
|
}
|
|
373
|
-
} else if (2 ===
|
|
374
|
-
|
|
392
|
+
} else if (2 === i.length || 1 === i.length) {
|
|
393
|
+
i = "", o = 0, a = s, l = 0;
|
|
375
394
|
continue;
|
|
376
395
|
}
|
|
377
|
-
t && (
|
|
378
|
-
} else
|
|
396
|
+
t && (i.length > 0 ? i += "/.." : i = "..", o = 2);
|
|
397
|
+
} else i.length > 0 ? i += "/" + e.slice(a + 1, s) : i = e.slice(a + 1, s), o = s - a - 1;
|
|
379
398
|
a = s, l = 0;
|
|
380
399
|
} else 46 === r && -1 !== l ? ++l : l = -1;
|
|
381
400
|
}
|
|
382
|
-
return
|
|
401
|
+
return i;
|
|
383
402
|
}
|
|
384
403
|
|
|
385
404
|
function specifierIncluded$1(e, t) {
|
|
386
|
-
var r, s, n,
|
|
387
|
-
for (r = 0; r < 3; ++r) if ((s = parseInt(
|
|
405
|
+
var r, s, n, i = e.split("."), o = t.split(" "), a = o.length > 1 ? o[0] : "=", l = (o.length > 1 ? o[1] : o[0]).split(".");
|
|
406
|
+
for (r = 0; r < 3; ++r) if ((s = parseInt(i[r] || 0, 10)) !== (n = parseInt(l[r] || 0, 10))) return "<" === a ? s < n : ">=" === a && s >= n;
|
|
388
407
|
return ">=" === a;
|
|
389
408
|
}
|
|
390
409
|
|
|
@@ -396,9 +415,9 @@ function matchesRange$1(e, t) {
|
|
|
396
415
|
}
|
|
397
416
|
|
|
398
417
|
function specifierIncluded(e) {
|
|
399
|
-
var t, r, s, n = e.split(" "),
|
|
400
|
-
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(
|
|
401
|
-
return ">=" ===
|
|
418
|
+
var t, r, s, n = e.split(" "), i = n.length > 1 ? n[0] : "=", o = (n.length > 1 ? n[1] : n[0]).split(".");
|
|
419
|
+
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(o[t] || 0, 10))) return "<" === i ? r < s : ">=" === i && r >= s;
|
|
420
|
+
return ">=" === i;
|
|
402
421
|
}
|
|
403
422
|
|
|
404
423
|
function matchesRange(e) {
|
|
@@ -498,26 +517,26 @@ function mockCompilerCtx(e) {
|
|
|
498
517
|
if (!0 === r.inMemoryOnly) {
|
|
499
518
|
let n = e;
|
|
500
519
|
n.endsWith("/") || (n += "/");
|
|
501
|
-
const
|
|
520
|
+
const o = e.split("/");
|
|
502
521
|
t.forEach(((t, n) => {
|
|
503
522
|
if (!n.startsWith(e)) return;
|
|
504
523
|
const a = n.split("/");
|
|
505
|
-
if ((a.length ===
|
|
524
|
+
if ((a.length === o.length + 1 || r.recursive && a.length > o.length) && t.exists) {
|
|
506
525
|
const e = {
|
|
507
526
|
absPath: n,
|
|
508
|
-
relPath: a[
|
|
527
|
+
relPath: a[o.length],
|
|
509
528
|
isDirectory: t.isDirectory,
|
|
510
529
|
isFile: t.isFile
|
|
511
530
|
};
|
|
512
|
-
|
|
531
|
+
i(r, e) || s.push(e);
|
|
513
532
|
}
|
|
514
533
|
}));
|
|
515
534
|
} else await n(e, e, r, s);
|
|
516
535
|
return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
|
|
517
|
-
}, n = async (t, r, s,
|
|
536
|
+
}, n = async (t, r, s, o) => {
|
|
518
537
|
const a = await e.readDir(r);
|
|
519
538
|
if (a.length > 0) {
|
|
520
|
-
const e =
|
|
539
|
+
const e = _(r);
|
|
521
540
|
e.exists = !0, e.isFile = !1, e.isDirectory = !0, await Promise.all(a.map((async e => {
|
|
522
541
|
const r = normalizePath(e), a = normalizePath(path$2.relative(t, r)), c = await l(r), u = {
|
|
523
542
|
absPath: r,
|
|
@@ -525,10 +544,10 @@ function mockCompilerCtx(e) {
|
|
|
525
544
|
isDirectory: c.isDirectory,
|
|
526
545
|
isFile: c.isFile
|
|
527
546
|
};
|
|
528
|
-
|
|
547
|
+
i(s, u) || (o.push(u), !0 === s.recursive && !0 === c.isDirectory && await n(t, r, s, o));
|
|
529
548
|
})));
|
|
530
549
|
}
|
|
531
|
-
},
|
|
550
|
+
}, i = (e, t) => {
|
|
532
551
|
if (t.isDirectory) {
|
|
533
552
|
if (Array.isArray(e.excludeDirNames)) {
|
|
534
553
|
const r = path$2.basename(t.absPath);
|
|
@@ -539,8 +558,8 @@ function mockCompilerCtx(e) {
|
|
|
539
558
|
if (e.excludeExtensions.some((e => r.endsWith(e)))) return !0;
|
|
540
559
|
}
|
|
541
560
|
return !1;
|
|
542
|
-
},
|
|
543
|
-
const t =
|
|
561
|
+
}, o = async e => {
|
|
562
|
+
const t = _(e);
|
|
544
563
|
t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
|
|
545
564
|
try {
|
|
546
565
|
const t = await s(e, {
|
|
@@ -549,10 +568,10 @@ function mockCompilerCtx(e) {
|
|
|
549
568
|
await Promise.all(t.map((e => e.relPath.endsWith(".gitkeep") ? null : a(e.absPath))));
|
|
550
569
|
} catch (e) {}
|
|
551
570
|
}, a = async e => {
|
|
552
|
-
const t =
|
|
571
|
+
const t = _(e);
|
|
553
572
|
t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
|
|
554
573
|
}, l = async t => {
|
|
555
|
-
const r =
|
|
574
|
+
const r = _(t);
|
|
556
575
|
if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
|
|
557
576
|
const s = await e.stat(t);
|
|
558
577
|
s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
|
|
@@ -566,7 +585,7 @@ function mockCompilerCtx(e) {
|
|
|
566
585
|
size: "number" == typeof r.size ? r.size : 0
|
|
567
586
|
};
|
|
568
587
|
}, c = t => {
|
|
569
|
-
const r =
|
|
588
|
+
const r = _(t);
|
|
570
589
|
if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
|
|
571
590
|
const s = e.statSync(t);
|
|
572
591
|
s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
|
|
@@ -582,26 +601,26 @@ function mockCompilerCtx(e) {
|
|
|
582
601
|
}, u = async (t, s, n) => {
|
|
583
602
|
if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
|
|
584
603
|
if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
|
|
585
|
-
const
|
|
604
|
+
const i = {
|
|
586
605
|
ignored: !1,
|
|
587
606
|
changedContent: !1,
|
|
588
607
|
queuedWrite: !1
|
|
589
608
|
};
|
|
590
|
-
if (!0 === shouldIgnore(t)) return
|
|
591
|
-
const
|
|
592
|
-
if (
|
|
593
|
-
"string" == typeof
|
|
594
|
-
|
|
595
|
-
!1 === n.useCache && (
|
|
609
|
+
if (!0 === shouldIgnore(t)) return i.ignored = !0, i;
|
|
610
|
+
const o = _(t);
|
|
611
|
+
if (o.exists = !0, o.isFile = !0, o.isDirectory = !1, o.queueDeleteFromDisk = !1,
|
|
612
|
+
"string" == typeof o.fileText ? i.changedContent = o.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : i.changedContent = !0,
|
|
613
|
+
o.fileText = s, i.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
|
|
614
|
+
!1 === n.useCache && (o.useCache = !1)), null != n && !0 === n.inMemoryOnly) o.queueWriteToDisk ? i.queuedWrite = !0 : o.queueWriteToDisk = !1,
|
|
596
615
|
await d(t, !0); else if (null != n && !0 === n.immediateWrite) {
|
|
597
|
-
if (
|
|
616
|
+
if (i.changedContent || !0 !== n.useCache) {
|
|
598
617
|
const r = await e.readFile(t);
|
|
599
|
-
"string" == typeof r && (
|
|
600
|
-
|
|
618
|
+
"string" == typeof r && (i.changedContent = o.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
|
|
619
|
+
i.changedContent && (await d(t, !1), await e.writeFile(t, o.fileText));
|
|
601
620
|
}
|
|
602
|
-
} else
|
|
603
|
-
|
|
604
|
-
return
|
|
621
|
+
} else o.queueWriteToDisk || !0 !== i.changedContent || (o.queueWriteToDisk = !0,
|
|
622
|
+
i.queuedWrite = !0);
|
|
623
|
+
return i;
|
|
605
624
|
}, d = async (e, t) => {
|
|
606
625
|
const r = [];
|
|
607
626
|
for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
|
|
@@ -609,22 +628,25 @@ function mockCompilerCtx(e) {
|
|
|
609
628
|
}, h = async (t, r) => {
|
|
610
629
|
const s = [];
|
|
611
630
|
for (const n of t) {
|
|
612
|
-
const t =
|
|
631
|
+
const t = _(n);
|
|
613
632
|
if (!0 !== t.exists || !0 !== t.isDirectory) try {
|
|
614
633
|
t.exists = !0, t.isDirectory = !0, t.isFile = !1, r || await e.createDir(n), s.push(n);
|
|
615
634
|
} catch (e) {}
|
|
616
635
|
}
|
|
617
636
|
return s;
|
|
618
|
-
}, p = t =>
|
|
619
|
-
const
|
|
620
|
-
|
|
621
|
-
|
|
637
|
+
}, p = t => {
|
|
638
|
+
const r = Promise.all(t.map((async t => {
|
|
639
|
+
const [r, s] = t;
|
|
640
|
+
return await e.copyFile(r, s), [ r, s ];
|
|
641
|
+
})));
|
|
642
|
+
return r;
|
|
643
|
+
}, f = e => Promise.all(e.map((async e => {
|
|
622
644
|
if ("string" != typeof e) throw new Error("unable to writeFile without filePath");
|
|
623
645
|
return m(e);
|
|
624
646
|
}))), m = async t => {
|
|
625
|
-
const r =
|
|
647
|
+
const r = _(t);
|
|
626
648
|
if (null == r.fileText) throw new Error(`unable to find item fileText to write: ${t}`);
|
|
627
|
-
return await e.writeFile(t, r.fileText), !1 === r.useCache &&
|
|
649
|
+
return await e.writeFile(t, r.fileText), !1 === r.useCache && E(t), t;
|
|
628
650
|
}, g = async t => await Promise.all(t.map((async t => {
|
|
629
651
|
if ("string" != typeof t) throw new Error("unable to unlink without filePath");
|
|
630
652
|
return await e.removeFile(t), t;
|
|
@@ -635,13 +657,13 @@ function mockCompilerCtx(e) {
|
|
|
635
657
|
}, w = e => {
|
|
636
658
|
e = normalizePath(e), t.forEach(((t, r) => {
|
|
637
659
|
const s = path$2.relative(e, r).split("/")[0];
|
|
638
|
-
s.startsWith(".") || s.startsWith("/") ||
|
|
660
|
+
s.startsWith(".") || s.startsWith("/") || E(r);
|
|
639
661
|
}));
|
|
640
|
-
},
|
|
662
|
+
}, E = e => {
|
|
641
663
|
e = normalizePath(e);
|
|
642
664
|
const r = t.get(e);
|
|
643
665
|
null == r || r.queueWriteToDisk || t.delete(e);
|
|
644
|
-
},
|
|
666
|
+
}, _ = e => {
|
|
645
667
|
e = normalizePath(e);
|
|
646
668
|
let r = t.get(e);
|
|
647
669
|
return null != r || t.set(e, r = {
|
|
@@ -656,25 +678,25 @@ function mockCompilerCtx(e) {
|
|
|
656
678
|
queueWriteToDisk: null,
|
|
657
679
|
useCache: null
|
|
658
680
|
}), r;
|
|
659
|
-
},
|
|
681
|
+
}, v = 5242880;
|
|
660
682
|
return {
|
|
661
683
|
access: async e => {
|
|
662
|
-
const t =
|
|
684
|
+
const t = _(e);
|
|
663
685
|
return "boolean" != typeof t.exists ? (await l(e)).exists : t.exists;
|
|
664
686
|
},
|
|
665
687
|
accessSync: e => {
|
|
666
|
-
const t =
|
|
688
|
+
const t = _(e);
|
|
667
689
|
return "boolean" != typeof t.exists ? c(e).exists : t.exists;
|
|
668
690
|
},
|
|
669
691
|
cancelDeleteDirectoriesFromDisk: e => {
|
|
670
692
|
for (const t of e) {
|
|
671
|
-
const e =
|
|
693
|
+
const e = _(t);
|
|
672
694
|
!0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
|
|
673
695
|
}
|
|
674
696
|
},
|
|
675
697
|
cancelDeleteFilesFromDisk: e => {
|
|
676
698
|
for (const t of e) {
|
|
677
|
-
const e =
|
|
699
|
+
const e = _(t);
|
|
678
700
|
!0 === e.isFile && !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
|
|
679
701
|
}
|
|
680
702
|
},
|
|
@@ -682,19 +704,19 @@ function mockCompilerCtx(e) {
|
|
|
682
704
|
t.clear();
|
|
683
705
|
},
|
|
684
706
|
clearDirCache: w,
|
|
685
|
-
clearFileCache:
|
|
707
|
+
clearFileCache: E,
|
|
686
708
|
commit: async () => {
|
|
687
|
-
const e = getCommitInstructions(t), r = await h(e.dirsToEnsure, !1), s = await f(e.filesToWrite), n = await p(e.filesToCopy),
|
|
688
|
-
return e.filesToDelete.forEach(
|
|
709
|
+
const e = getCommitInstructions(t), r = await h(e.dirsToEnsure, !1), s = await f(e.filesToWrite), n = await p(e.filesToCopy), i = await g(e.filesToDelete), o = await y(e.dirsToDelete);
|
|
710
|
+
return e.filesToDelete.forEach(E), e.dirsToDelete.forEach(w), {
|
|
689
711
|
filesCopied: n,
|
|
690
712
|
filesWritten: s,
|
|
691
|
-
filesDeleted:
|
|
692
|
-
dirsDeleted:
|
|
713
|
+
filesDeleted: i,
|
|
714
|
+
dirsDeleted: o,
|
|
693
715
|
dirsAdded: r
|
|
694
716
|
};
|
|
695
717
|
},
|
|
696
718
|
copyFile: async (e, t) => {
|
|
697
|
-
|
|
719
|
+
_(e).queueCopyFileToDest = t;
|
|
698
720
|
},
|
|
699
721
|
emptyDirs: async e => {
|
|
700
722
|
e = e.filter(isString).map(normalizePath).reduce(((e, t) => (e.includes(t) || e.push(t),
|
|
@@ -707,7 +729,7 @@ function mockCompilerCtx(e) {
|
|
|
707
729
|
const r = e.split("/").length, s = t.split("/").length;
|
|
708
730
|
return r < s ? 1 : r > s ? -1 : 0;
|
|
709
731
|
})), await Promise.all(r.map(a)), e.forEach((e => {
|
|
710
|
-
const t =
|
|
732
|
+
const t = _(e);
|
|
711
733
|
t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk = !0, t.queueDeleteFromDisk = !1;
|
|
712
734
|
}));
|
|
713
735
|
},
|
|
@@ -721,30 +743,30 @@ function mockCompilerCtx(e) {
|
|
|
721
743
|
});
|
|
722
744
|
})), e.forEach((e => e.files.sort())), e.sort(((e, t) => e.type < t.type ? -1 : e.type > t.type ? 1 : 0));
|
|
723
745
|
},
|
|
724
|
-
getItem:
|
|
746
|
+
getItem: _,
|
|
725
747
|
getMemoryStats: () => `data length: ${t.size}`,
|
|
726
748
|
readFile: async (t, r) => {
|
|
727
749
|
if (null == r || !0 === r.useCache || void 0 === r.useCache) {
|
|
728
|
-
const e =
|
|
750
|
+
const e = _(t);
|
|
729
751
|
if (e.exists && "string" == typeof e.fileText) return e.fileText;
|
|
730
752
|
}
|
|
731
|
-
const s = await e.readFile(t), n =
|
|
732
|
-
return "string" == typeof s ? s.length <
|
|
753
|
+
const s = await e.readFile(t), n = _(t);
|
|
754
|
+
return "string" == typeof s ? s.length < v && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
|
|
733
755
|
n.fileText = s) : n.exists = !1, s;
|
|
734
756
|
},
|
|
735
757
|
readFileSync: (t, r) => {
|
|
736
758
|
if (null == r || !0 === r.useCache || void 0 === r.useCache) {
|
|
737
|
-
const e =
|
|
759
|
+
const e = _(t);
|
|
738
760
|
if (e.exists && "string" == typeof e.fileText) return e.fileText;
|
|
739
761
|
}
|
|
740
|
-
const s = e.readFileSync(t), n =
|
|
741
|
-
return "string" == typeof s ? s.length <
|
|
762
|
+
const s = e.readFileSync(t), n = _(t);
|
|
763
|
+
return "string" == typeof s ? s.length < v && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
|
|
742
764
|
n.fileText = s) : n.exists = !1, s;
|
|
743
765
|
},
|
|
744
766
|
readdir: s,
|
|
745
767
|
remove: async e => {
|
|
746
768
|
const t = await l(e);
|
|
747
|
-
!0 === t.isDirectory ? await
|
|
769
|
+
!0 === t.isDirectory ? await o(e) : !0 === t.isFile && await a(e);
|
|
748
770
|
},
|
|
749
771
|
stat: l,
|
|
750
772
|
statSync: c,
|
|
@@ -787,19 +809,19 @@ async function initPageEvents(e) {
|
|
|
787
809
|
}
|
|
788
810
|
|
|
789
811
|
async function pageSpyOnEvent(e, t, r) {
|
|
790
|
-
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document,
|
|
791
|
-
return await addE2EListener(e,
|
|
812
|
+
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, i = await e.evaluateHandle(n);
|
|
813
|
+
return await addE2EListener(e, i, t, (e => {
|
|
792
814
|
s.push(e);
|
|
793
815
|
})), s;
|
|
794
816
|
}
|
|
795
817
|
|
|
796
818
|
async function waitForEvent(e, t, r) {
|
|
797
819
|
const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate(((e, t, r) => new Promise(((s, n) => {
|
|
798
|
-
const
|
|
820
|
+
const i = setTimeout((() => {
|
|
799
821
|
n(new Error(`waitForEvent() timeout, eventName: ${t}`));
|
|
800
822
|
}), r);
|
|
801
823
|
e.addEventListener(t, (e => {
|
|
802
|
-
clearTimeout(
|
|
824
|
+
clearTimeout(i), s(window.stencilSerializeEvent(e));
|
|
803
825
|
}), {
|
|
804
826
|
once: !0
|
|
805
827
|
});
|
|
@@ -812,13 +834,11 @@ async function addE2EListener(e, t, r, s) {
|
|
|
812
834
|
e._e2eEvents.set(n, {
|
|
813
835
|
eventName: r,
|
|
814
836
|
callback: s
|
|
815
|
-
})
|
|
816
|
-
const o = t.executionContext();
|
|
817
|
-
await o.evaluate(((e, t, r) => {
|
|
837
|
+
}), await t.evaluate(((e, t, r) => {
|
|
818
838
|
e.addEventListener(r, (e => {
|
|
819
839
|
window.stencilOnEvent(t, window.stencilSerializeEvent(e));
|
|
820
840
|
}));
|
|
821
|
-
}),
|
|
841
|
+
}), n, r);
|
|
822
842
|
}
|
|
823
843
|
|
|
824
844
|
function browserContextEvents() {
|
|
@@ -870,7 +890,7 @@ function browserContextEvents() {
|
|
|
870
890
|
}
|
|
871
891
|
|
|
872
892
|
async function find(e, t, r) {
|
|
873
|
-
const {lightSelector: s, shadowSelector: n, text:
|
|
893
|
+
const {lightSelector: s, shadowSelector: n, text: i, contains: o} = getSelector(r);
|
|
874
894
|
let a;
|
|
875
895
|
if (a = "string" == typeof s ? await async function l(e, t, r, s) {
|
|
876
896
|
let n = await t.$(r);
|
|
@@ -898,20 +918,20 @@ async function find(e, t, r) {
|
|
|
898
918
|
}(e), s;
|
|
899
919
|
}), t, r, s);
|
|
900
920
|
return n ? n.asElement() : null;
|
|
901
|
-
}(e, t,
|
|
921
|
+
}(e, t, i, o), !a) return null;
|
|
902
922
|
const u = new E2EElement(e, a);
|
|
903
923
|
return await u.e2eSync(), u;
|
|
904
924
|
}
|
|
905
925
|
|
|
906
926
|
async function findAll(e, t, r) {
|
|
907
|
-
const s = [], {lightSelector: n, shadowSelector:
|
|
908
|
-
if (0 ===
|
|
909
|
-
if (
|
|
910
|
-
const r =
|
|
927
|
+
const s = [], {lightSelector: n, shadowSelector: i} = getSelector(r), o = await t.$$(n);
|
|
928
|
+
if (0 === o.length) return s;
|
|
929
|
+
if (i) for (let t = 0; t < o.length; t++) {
|
|
930
|
+
const r = getPuppeteerExecution(o[t]), n = await r.evaluateHandle(((e, t) => {
|
|
911
931
|
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
912
932
|
return e.shadowRoot.querySelectorAll(t);
|
|
913
|
-
}),
|
|
914
|
-
await
|
|
933
|
+
}), o[t], i);
|
|
934
|
+
await o[t].dispose();
|
|
915
935
|
const a = await n.getProperties();
|
|
916
936
|
await n.dispose();
|
|
917
937
|
for (const t of a.values()) {
|
|
@@ -921,8 +941,8 @@ async function findAll(e, t, r) {
|
|
|
921
941
|
await t.e2eSync(), s.push(t);
|
|
922
942
|
}
|
|
923
943
|
}
|
|
924
|
-
} else for (let t = 0; t <
|
|
925
|
-
const r = new E2EElement(e,
|
|
944
|
+
} else for (let t = 0; t < o.length; t++) {
|
|
945
|
+
const r = new E2EElement(e, o[t]);
|
|
926
946
|
await r.e2eSync(), s.push(r);
|
|
927
947
|
}
|
|
928
948
|
return s;
|
|
@@ -945,6 +965,10 @@ function getSelector(e) {
|
|
|
945
965
|
return t;
|
|
946
966
|
}
|
|
947
967
|
|
|
968
|
+
function getPuppeteerExecution(e) {
|
|
969
|
+
return parseInt(process.env.__STENCIL_PUPPETEER_VERSION__, 10) >= 17 ? e.frame : e.executionContext();
|
|
970
|
+
}
|
|
971
|
+
|
|
948
972
|
async function writeScreenshotData(e, t) {
|
|
949
973
|
const r = function s(e, t) {
|
|
950
974
|
const r = `${t}.json`;
|
|
@@ -961,15 +985,16 @@ function writeFile(e, t) {
|
|
|
961
985
|
}));
|
|
962
986
|
}
|
|
963
987
|
|
|
964
|
-
async function compareScreenshot(e, t, r, s, n,
|
|
988
|
+
async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
965
989
|
const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
|
|
966
990
|
await async function u(e, t) {
|
|
967
|
-
await function
|
|
991
|
+
const r = await function s(e) {
|
|
968
992
|
return new Promise((t => {
|
|
969
993
|
fs__default.default.access(e, (e => t(!e)));
|
|
970
994
|
}));
|
|
971
|
-
}(e)
|
|
972
|
-
|
|
995
|
+
}(e);
|
|
996
|
+
r || await writeFile(e, t);
|
|
997
|
+
}(c, r), r = null, o && (o = normalizePath(path$2.relative(t.rootDir, o)));
|
|
973
998
|
const d = function h(e, t) {
|
|
974
999
|
if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
|
|
975
1000
|
const r = crypto$3.createHash("md5");
|
|
@@ -982,9 +1007,9 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
982
1007
|
device: e.device,
|
|
983
1008
|
userAgent: e.userAgent,
|
|
984
1009
|
desc: s,
|
|
985
|
-
testPath:
|
|
1010
|
+
testPath: o,
|
|
986
1011
|
width: n,
|
|
987
|
-
height:
|
|
1012
|
+
height: i,
|
|
988
1013
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
989
1014
|
hasTouch: e.viewport.hasTouch,
|
|
990
1015
|
isLandscape: e.viewport.isLandscape,
|
|
@@ -998,14 +1023,14 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
998
1023
|
device: e.device,
|
|
999
1024
|
userAgent: e.userAgent,
|
|
1000
1025
|
width: n,
|
|
1001
|
-
height:
|
|
1026
|
+
height: i,
|
|
1002
1027
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1003
1028
|
hasTouch: e.viewport.hasTouch,
|
|
1004
1029
|
isLandscape: e.viewport.isLandscape,
|
|
1005
1030
|
isMobile: e.viewport.isMobile,
|
|
1006
1031
|
allowableMismatchedPixels: t.allowableMismatchedPixels,
|
|
1007
1032
|
allowableMismatchedRatio: t.allowableMismatchedRatio,
|
|
1008
|
-
testPath:
|
|
1033
|
+
testPath: o
|
|
1009
1034
|
}
|
|
1010
1035
|
};
|
|
1011
1036
|
if (t.updateMaster) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
|
|
@@ -1027,7 +1052,7 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
1027
1052
|
};
|
|
1028
1053
|
p.diff.mismatchedPixels = await async function g(e, t) {
|
|
1029
1054
|
return new Promise(((r, s) => {
|
|
1030
|
-
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL,
|
|
1055
|
+
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, i = setTimeout((() => {
|
|
1031
1056
|
s(`getMismatchedPixels timeout: ${n}ms`);
|
|
1032
1057
|
}), n);
|
|
1033
1058
|
try {
|
|
@@ -1036,14 +1061,14 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
1036
1061
|
env: process.env,
|
|
1037
1062
|
cwd: process.cwd(),
|
|
1038
1063
|
stdio: [ "pipe", "pipe", "pipe", "ipc" ]
|
|
1039
|
-
},
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
})),
|
|
1043
|
-
clearTimeout(
|
|
1044
|
-
})),
|
|
1064
|
+
}, o = child_process$2.fork(e, [], n);
|
|
1065
|
+
o.on("message", (e => {
|
|
1066
|
+
o.kill(), clearTimeout(i), r(e);
|
|
1067
|
+
})), o.on("error", (e => {
|
|
1068
|
+
clearTimeout(i), s(e);
|
|
1069
|
+
})), o.send(t);
|
|
1045
1070
|
} catch (e) {
|
|
1046
|
-
clearTimeout(
|
|
1071
|
+
clearTimeout(i), s(`getMismatchedPixels error: ${e}`);
|
|
1047
1072
|
}
|
|
1048
1073
|
}));
|
|
1049
1074
|
}(t.pixelmatchModulePath, n);
|
|
@@ -1060,9 +1085,9 @@ async function e2eGoTo(e, t, r = {}) {
|
|
|
1060
1085
|
if ("string" != typeof s) throw new Error("invalid gotoTest() browser url");
|
|
1061
1086
|
const n = s + t.substring(1);
|
|
1062
1087
|
r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1063
|
-
const
|
|
1064
|
-
if (!
|
|
1065
|
-
return await waitForStencil(e, r),
|
|
1088
|
+
const i = await e._e2eGoto(n, r);
|
|
1089
|
+
if (!i.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${i.status()}`);
|
|
1090
|
+
return await waitForStencil(e, r), i;
|
|
1066
1091
|
}
|
|
1067
1092
|
|
|
1068
1093
|
async function e2eSetContent(e, t, r = {}) {
|
|
@@ -1071,18 +1096,18 @@ async function e2eSetContent(e, t, r = {}) {
|
|
|
1071
1096
|
const s = [], n = env.__STENCIL_APP_SCRIPT_URL__;
|
|
1072
1097
|
if ("string" != typeof n) throw new Error("invalid e2eSetContent() app script url");
|
|
1073
1098
|
s.push("<!doctype html>"), s.push("<html>"), s.push("<head>");
|
|
1074
|
-
const
|
|
1075
|
-
"string" == typeof
|
|
1099
|
+
const i = env.__STENCIL_APP_STYLE_URL__;
|
|
1100
|
+
"string" == typeof i && s.push(`<link rel="stylesheet" href="${i}">`), s.push(`<script type="module" src="${n}"><\/script>`),
|
|
1076
1101
|
s.push("</head>"), s.push("<body>"), s.push(t), s.push("</body>"), s.push("</html>");
|
|
1077
|
-
const
|
|
1102
|
+
const o = env.__STENCIL_BROWSER_URL__;
|
|
1078
1103
|
await e.setRequestInterception(!0), e.on("request", (e => {
|
|
1079
|
-
|
|
1104
|
+
o === e.url() ? e.respond({
|
|
1080
1105
|
status: 200,
|
|
1081
1106
|
contentType: "text/html",
|
|
1082
1107
|
body: s.join("\n")
|
|
1083
1108
|
}) : e.continue();
|
|
1084
1109
|
})), r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1085
|
-
const a = await e._e2eGoto(
|
|
1110
|
+
const a = await e._e2eGoto(o, r);
|
|
1086
1111
|
if (!a.ok()) throw new Error("Testing unable to load content");
|
|
1087
1112
|
return await waitForStencil(e, r), a;
|
|
1088
1113
|
}
|
|
@@ -1173,20 +1198,196 @@ function getAppStyleUrl(e, t) {
|
|
|
1173
1198
|
function getAppUrl(e, t, r) {
|
|
1174
1199
|
const s = e.outputTargets.find(isOutputTargetWww);
|
|
1175
1200
|
if (s) {
|
|
1176
|
-
const e = s.buildDir, n = path$2.join(e, r),
|
|
1177
|
-
return new URL(
|
|
1201
|
+
const e = s.buildDir, n = path$2.join(e, r), i = path$2.relative(s.dir, n);
|
|
1202
|
+
return new URL(i, t).href;
|
|
1178
1203
|
}
|
|
1179
1204
|
const n = e.outputTargets.find(isOutputTargetDistLazy);
|
|
1180
1205
|
if (n) {
|
|
1181
|
-
const s = n.esmDir,
|
|
1182
|
-
return new URL(
|
|
1206
|
+
const s = n.esmDir, i = path$2.join(s, r), o = path$2.relative(e.rootDir, i);
|
|
1207
|
+
return new URL(o, t).href;
|
|
1183
1208
|
}
|
|
1184
1209
|
return t;
|
|
1185
1210
|
}
|
|
1186
1211
|
|
|
1187
|
-
var posix, pathBrowserify, caller, pathParse, parse, getNodeModulesDirs, nodeModulesPaths, normalizeOptions, ERROR_MESSAGE, slice, toStr, implementation, functionBind, src, isCoreModule, realpathFS$1, defaultIsFile$1, defaultIsDir$1, defaultRealpath, maybeRealpath, defaultReadPackage, getPackageCandidates$1, async, current, core, mod, core_1, isCore, realpathFS, defaultIsFile, defaultIsDir, defaultRealpathSync, maybeRealpathSync, defaultReadPackageSync, getPackageCandidates, sync, resolve;
|
|
1212
|
+
var debug_1, constants$2, re_1, parseOptions_1, identifiers, semver, major_1, posix, pathBrowserify, caller, pathParse, parse, getNodeModulesDirs, nodeModulesPaths, normalizeOptions, ERROR_MESSAGE, slice, toStr, implementation, functionBind, src, isCoreModule, realpathFS$1, defaultIsFile$1, defaultIsDir$1, defaultRealpath, maybeRealpath, defaultReadPackage, getPackageCandidates$1, async, current, core, mod, core_1, isCore, realpathFS, defaultIsFile, defaultIsDir, defaultRealpathSync, maybeRealpathSync, defaultReadPackageSync, getPackageCandidates, sync, resolve;
|
|
1213
|
+
|
|
1214
|
+
const stencil_js = require("../compiler/stencil.js"), appData = _lazyRequire("@stencil/core/internal/app-data"), testing = _lazyRequire("@stencil/core/internal/testing"), index_cjs = _lazyRequire("../mock-doc/index.cjs"), path$2 = require("path"), crypto$3 = require("crypto"), os$2 = require("os"), process$3 = require("process"), fs$2 = require("fs"), index_js = _lazyRequire("../dev-server/index.js"), child_process$2 = require("child_process"), path__default = _interopDefaultLegacy(path$2), os__namespace = _interopNamespace(os$2), process__namespace = _interopNamespace(process$3), fs__default = _interopDefaultLegacy(fs$2), debug = ("object" == typeof process && process.env,
|
|
1215
|
+
() => {});
|
|
1216
|
+
|
|
1217
|
+
debug_1 = debug;
|
|
1218
|
+
|
|
1219
|
+
const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
1220
|
+
|
|
1221
|
+
constants$2 = {
|
|
1222
|
+
SEMVER_SPEC_VERSION: "2.0.0",
|
|
1223
|
+
MAX_LENGTH: 256,
|
|
1224
|
+
MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
|
|
1225
|
+
MAX_SAFE_COMPONENT_LENGTH: 16
|
|
1226
|
+
}, re_1 = createCommonjsModule((function(e, t) {
|
|
1227
|
+
const {MAX_SAFE_COMPONENT_LENGTH: r} = constants$2, s = (t = e.exports = {}).re = [], n = t.src = [], i = t.t = {};
|
|
1228
|
+
let o = 0;
|
|
1229
|
+
const a = (e, t, r) => {
|
|
1230
|
+
const a = o++;
|
|
1231
|
+
debug_1(e, a, t), i[e] = a, n[a] = t, s[a] = new RegExp(t, r ? "g" : void 0);
|
|
1232
|
+
};
|
|
1233
|
+
a("NUMERICIDENTIFIER", "0|[1-9]\\d*"), a("NUMERICIDENTIFIERLOOSE", "[0-9]+"), a("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*"),
|
|
1234
|
+
a("MAINVERSION", `(${n[i.NUMERICIDENTIFIER]})\\.(${n[i.NUMERICIDENTIFIER]})\\.(${n[i.NUMERICIDENTIFIER]})`),
|
|
1235
|
+
a("MAINVERSIONLOOSE", `(${n[i.NUMERICIDENTIFIERLOOSE]})\\.(${n[i.NUMERICIDENTIFIERLOOSE]})\\.(${n[i.NUMERICIDENTIFIERLOOSE]})`),
|
|
1236
|
+
a("PRERELEASEIDENTIFIER", `(?:${n[i.NUMERICIDENTIFIER]}|${n[i.NONNUMERICIDENTIFIER]})`),
|
|
1237
|
+
a("PRERELEASEIDENTIFIERLOOSE", `(?:${n[i.NUMERICIDENTIFIERLOOSE]}|${n[i.NONNUMERICIDENTIFIER]})`),
|
|
1238
|
+
a("PRERELEASE", `(?:-(${n[i.PRERELEASEIDENTIFIER]}(?:\\.${n[i.PRERELEASEIDENTIFIER]})*))`),
|
|
1239
|
+
a("PRERELEASELOOSE", `(?:-?(${n[i.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[i.PRERELEASEIDENTIFIERLOOSE]})*))`),
|
|
1240
|
+
a("BUILDIDENTIFIER", "[0-9A-Za-z-]+"), a("BUILD", `(?:\\+(${n[i.BUILDIDENTIFIER]}(?:\\.${n[i.BUILDIDENTIFIER]})*))`),
|
|
1241
|
+
a("FULLPLAIN", `v?${n[i.MAINVERSION]}${n[i.PRERELEASE]}?${n[i.BUILD]}?`), a("FULL", `^${n[i.FULLPLAIN]}$`),
|
|
1242
|
+
a("LOOSEPLAIN", `[v=\\s]*${n[i.MAINVERSIONLOOSE]}${n[i.PRERELEASELOOSE]}?${n[i.BUILD]}?`),
|
|
1243
|
+
a("LOOSE", `^${n[i.LOOSEPLAIN]}$`), a("GTLT", "((?:<|>)?=?)"), a("XRANGEIDENTIFIERLOOSE", `${n[i.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),
|
|
1244
|
+
a("XRANGEIDENTIFIER", `${n[i.NUMERICIDENTIFIER]}|x|X|\\*`), a("XRANGEPLAIN", `[v=\\s]*(${n[i.XRANGEIDENTIFIER]})(?:\\.(${n[i.XRANGEIDENTIFIER]})(?:\\.(${n[i.XRANGEIDENTIFIER]})(?:${n[i.PRERELEASE]})?${n[i.BUILD]}?)?)?`),
|
|
1245
|
+
a("XRANGEPLAINLOOSE", `[v=\\s]*(${n[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[i.XRANGEIDENTIFIERLOOSE]})(?:${n[i.PRERELEASELOOSE]})?${n[i.BUILD]}?)?)?`),
|
|
1246
|
+
a("XRANGE", `^${n[i.GTLT]}\\s*${n[i.XRANGEPLAIN]}$`), a("XRANGELOOSE", `^${n[i.GTLT]}\\s*${n[i.XRANGEPLAINLOOSE]}$`),
|
|
1247
|
+
a("COERCE", `(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),
|
|
1248
|
+
a("COERCERTL", n[i.COERCE], !0), a("LONETILDE", "(?:~>?)"), a("TILDETRIM", `(\\s*)${n[i.LONETILDE]}\\s+`, !0),
|
|
1249
|
+
t.tildeTrimReplace = "$1~", a("TILDE", `^${n[i.LONETILDE]}${n[i.XRANGEPLAIN]}$`),
|
|
1250
|
+
a("TILDELOOSE", `^${n[i.LONETILDE]}${n[i.XRANGEPLAINLOOSE]}$`), a("LONECARET", "(?:\\^)"),
|
|
1251
|
+
a("CARETTRIM", `(\\s*)${n[i.LONECARET]}\\s+`, !0), t.caretTrimReplace = "$1^", a("CARET", `^${n[i.LONECARET]}${n[i.XRANGEPLAIN]}$`),
|
|
1252
|
+
a("CARETLOOSE", `^${n[i.LONECARET]}${n[i.XRANGEPLAINLOOSE]}$`), a("COMPARATORLOOSE", `^${n[i.GTLT]}\\s*(${n[i.LOOSEPLAIN]})$|^$`),
|
|
1253
|
+
a("COMPARATOR", `^${n[i.GTLT]}\\s*(${n[i.FULLPLAIN]})$|^$`), a("COMPARATORTRIM", `(\\s*)${n[i.GTLT]}\\s*(${n[i.LOOSEPLAIN]}|${n[i.XRANGEPLAIN]})`, !0),
|
|
1254
|
+
t.comparatorTrimReplace = "$1$2$3", a("HYPHENRANGE", `^\\s*(${n[i.XRANGEPLAIN]})\\s+-\\s+(${n[i.XRANGEPLAIN]})\\s*$`),
|
|
1255
|
+
a("HYPHENRANGELOOSE", `^\\s*(${n[i.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[i.XRANGEPLAINLOOSE]})\\s*$`),
|
|
1256
|
+
a("STAR", "(<|>)?=?\\s*\\*"), a("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), a("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
1257
|
+
}));
|
|
1258
|
+
|
|
1259
|
+
const opts = [ "includePrerelease", "loose", "rtl" ];
|
|
1260
|
+
|
|
1261
|
+
parseOptions_1 = e => e ? "object" != typeof e ? {
|
|
1262
|
+
loose: !0
|
|
1263
|
+
} : opts.filter((t => e[t])).reduce(((e, t) => (e[t] = !0, e)), {}) : {};
|
|
1264
|
+
|
|
1265
|
+
const numeric = /^[0-9]+$/, compareIdentifiers$1 = (e, t) => {
|
|
1266
|
+
const r = numeric.test(e), s = numeric.test(t);
|
|
1267
|
+
return r && s && (e = +e, t = +t), e === t ? 0 : r && !s ? -1 : s && !r ? 1 : e < t ? -1 : 1;
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
identifiers = {
|
|
1271
|
+
compareIdentifiers: compareIdentifiers$1,
|
|
1272
|
+
rcompareIdentifiers: (e, t) => compareIdentifiers$1(t, e)
|
|
1273
|
+
};
|
|
1274
|
+
|
|
1275
|
+
const {MAX_LENGTH, MAX_SAFE_INTEGER} = constants$2, {re, t} = re_1, {compareIdentifiers} = identifiers;
|
|
1276
|
+
|
|
1277
|
+
class SemVer {
|
|
1278
|
+
constructor(e, r) {
|
|
1279
|
+
if (r = parseOptions_1(r), e instanceof SemVer) {
|
|
1280
|
+
if (e.loose === !!r.loose && e.includePrerelease === !!r.includePrerelease) return e;
|
|
1281
|
+
e = e.version;
|
|
1282
|
+
} else if ("string" != typeof e) throw new TypeError(`Invalid Version: ${e}`);
|
|
1283
|
+
if (e.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
1284
|
+
debug_1("SemVer", e, r), this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease;
|
|
1285
|
+
const s = e.trim().match(r.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
1286
|
+
if (!s) throw new TypeError(`Invalid Version: ${e}`);
|
|
1287
|
+
if (this.raw = e, this.major = +s[1], this.minor = +s[2], this.patch = +s[3], this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
1288
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
1289
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
1290
|
+
s[4] ? this.prerelease = s[4].split(".").map((e => {
|
|
1291
|
+
if (/^[0-9]+$/.test(e)) {
|
|
1292
|
+
const t = +e;
|
|
1293
|
+
if (t >= 0 && t < MAX_SAFE_INTEGER) return t;
|
|
1294
|
+
}
|
|
1295
|
+
return e;
|
|
1296
|
+
})) : this.prerelease = [], this.build = s[5] ? s[5].split(".") : [], this.format();
|
|
1297
|
+
}
|
|
1298
|
+
format() {
|
|
1299
|
+
return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`),
|
|
1300
|
+
this.version;
|
|
1301
|
+
}
|
|
1302
|
+
toString() {
|
|
1303
|
+
return this.version;
|
|
1304
|
+
}
|
|
1305
|
+
compare(e) {
|
|
1306
|
+
if (debug_1("SemVer.compare", this.version, this.options, e), !(e instanceof SemVer)) {
|
|
1307
|
+
if ("string" == typeof e && e === this.version) return 0;
|
|
1308
|
+
e = new SemVer(e, this.options);
|
|
1309
|
+
}
|
|
1310
|
+
return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
|
|
1311
|
+
}
|
|
1312
|
+
compareMain(e) {
|
|
1313
|
+
return e instanceof SemVer || (e = new SemVer(e, this.options)), compareIdentifiers(this.major, e.major) || compareIdentifiers(this.minor, e.minor) || compareIdentifiers(this.patch, e.patch);
|
|
1314
|
+
}
|
|
1315
|
+
comparePre(e) {
|
|
1316
|
+
if (e instanceof SemVer || (e = new SemVer(e, this.options)), this.prerelease.length && !e.prerelease.length) return -1;
|
|
1317
|
+
if (!this.prerelease.length && e.prerelease.length) return 1;
|
|
1318
|
+
if (!this.prerelease.length && !e.prerelease.length) return 0;
|
|
1319
|
+
let t = 0;
|
|
1320
|
+
do {
|
|
1321
|
+
const r = this.prerelease[t], s = e.prerelease[t];
|
|
1322
|
+
if (debug_1("prerelease compare", t, r, s), void 0 === r && void 0 === s) return 0;
|
|
1323
|
+
if (void 0 === s) return 1;
|
|
1324
|
+
if (void 0 === r) return -1;
|
|
1325
|
+
if (r !== s) return compareIdentifiers(r, s);
|
|
1326
|
+
} while (++t);
|
|
1327
|
+
}
|
|
1328
|
+
compareBuild(e) {
|
|
1329
|
+
e instanceof SemVer || (e = new SemVer(e, this.options));
|
|
1330
|
+
let t = 0;
|
|
1331
|
+
do {
|
|
1332
|
+
const r = this.build[t], s = e.build[t];
|
|
1333
|
+
if (debug_1("prerelease compare", t, r, s), void 0 === r && void 0 === s) return 0;
|
|
1334
|
+
if (void 0 === s) return 1;
|
|
1335
|
+
if (void 0 === r) return -1;
|
|
1336
|
+
if (r !== s) return compareIdentifiers(r, s);
|
|
1337
|
+
} while (++t);
|
|
1338
|
+
}
|
|
1339
|
+
inc(e, t) {
|
|
1340
|
+
switch (e) {
|
|
1341
|
+
case "premajor":
|
|
1342
|
+
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t);
|
|
1343
|
+
break;
|
|
1344
|
+
|
|
1345
|
+
case "preminor":
|
|
1346
|
+
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t);
|
|
1347
|
+
break;
|
|
1348
|
+
|
|
1349
|
+
case "prepatch":
|
|
1350
|
+
this.prerelease.length = 0, this.inc("patch", t), this.inc("pre", t);
|
|
1351
|
+
break;
|
|
1352
|
+
|
|
1353
|
+
case "prerelease":
|
|
1354
|
+
0 === this.prerelease.length && this.inc("patch", t), this.inc("pre", t);
|
|
1355
|
+
break;
|
|
1356
|
+
|
|
1357
|
+
case "major":
|
|
1358
|
+
0 === this.minor && 0 === this.patch && 0 !== this.prerelease.length || this.major++,
|
|
1359
|
+
this.minor = 0, this.patch = 0, this.prerelease = [];
|
|
1360
|
+
break;
|
|
1361
|
+
|
|
1362
|
+
case "minor":
|
|
1363
|
+
0 === this.patch && 0 !== this.prerelease.length || this.minor++, this.patch = 0,
|
|
1364
|
+
this.prerelease = [];
|
|
1365
|
+
break;
|
|
1366
|
+
|
|
1367
|
+
case "patch":
|
|
1368
|
+
0 === this.prerelease.length && this.patch++, this.prerelease = [];
|
|
1369
|
+
break;
|
|
1370
|
+
|
|
1371
|
+
case "pre":
|
|
1372
|
+
if (0 === this.prerelease.length) this.prerelease = [ 0 ]; else {
|
|
1373
|
+
let e = this.prerelease.length;
|
|
1374
|
+
for (;--e >= 0; ) "number" == typeof this.prerelease[e] && (this.prerelease[e]++,
|
|
1375
|
+
e = -2);
|
|
1376
|
+
-1 === e && this.prerelease.push(0);
|
|
1377
|
+
}
|
|
1378
|
+
t && (0 === compareIdentifiers(this.prerelease[0], t) ? isNaN(this.prerelease[1]) && (this.prerelease = [ t, 0 ]) : this.prerelease = [ t, 0 ]);
|
|
1379
|
+
break;
|
|
1380
|
+
|
|
1381
|
+
default:
|
|
1382
|
+
throw new Error(`invalid increment argument: ${e}`);
|
|
1383
|
+
}
|
|
1384
|
+
return this.format(), this.raw = this.version, this;
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
semver = SemVer, major_1 = (e, t) => new semver(e, t).major;
|
|
1188
1389
|
|
|
1189
|
-
const
|
|
1390
|
+
const formatComponentRuntimeMembers = (e, t = !0) => ({
|
|
1190
1391
|
...formatPropertiesRuntimeMember(e.properties),
|
|
1191
1392
|
...formatStatesRuntimeMember(e.states),
|
|
1192
1393
|
...t ? formatMethodsRuntimeMember(e.methods) : {}
|
|
@@ -1239,8 +1440,8 @@ const stencil_js = require("../compiler/stencil.js"), appData = _lazyRequire("@s
|
|
|
1239
1440
|
}, 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 => {
|
|
1240
1441
|
if ("string" != typeof e) throw new Error("invalid path to normalize");
|
|
1241
1442
|
e = normalizeSlashes(e.trim());
|
|
1242
|
-
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1],
|
|
1243
|
-
return "" ===
|
|
1443
|
+
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], i = s + r.slice(1).join("/");
|
|
1444
|
+
return "" === i ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + i : i;
|
|
1244
1445
|
}, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
|
|
1245
1446
|
if (!Array.isArray(e) || 0 === e.length) return [];
|
|
1246
1447
|
const t = [ e[0] ];
|
|
@@ -1277,8 +1478,8 @@ const stencil_js = require("../compiler/stencil.js"), appData = _lazyRequire("@s
|
|
|
1277
1478
|
if (-1 !== r) {
|
|
1278
1479
|
const t = r + "://".length, s = e.indexOf("/", t);
|
|
1279
1480
|
if (-1 !== s) {
|
|
1280
|
-
const n = e.slice(0, r),
|
|
1281
|
-
if ("file" === n && ("" ===
|
|
1481
|
+
const n = e.slice(0, r), i = e.slice(t, s);
|
|
1482
|
+
if ("file" === n && ("" === i || "localhost" === i) && isVolumeCharacter(e.charCodeAt(s + 1))) {
|
|
1282
1483
|
const t = getFileUrlVolumeSeparatorEnd(e, s + 2);
|
|
1283
1484
|
if (-1 !== t) {
|
|
1284
1485
|
if (47 === e.charCodeAt(t)) return ~(t + 1);
|
|
@@ -1305,12 +1506,12 @@ const stencil_js = require("../compiler/stencil.js"), appData = _lazyRequire("@s
|
|
|
1305
1506
|
var r, s;
|
|
1306
1507
|
if ("string" == typeof t) return t;
|
|
1307
1508
|
if (void 0 === t) return "";
|
|
1308
|
-
const n = [],
|
|
1309
|
-
|
|
1310
|
-
let
|
|
1311
|
-
if (!n.includes(t.code) && (
|
|
1312
|
-
return
|
|
1313
|
-
|
|
1509
|
+
const n = [], i = (null !== (s = null === (r = e.file) || void 0 === r ? void 0 : r.fileName) && void 0 !== s ? s : "").includes("stencil.config");
|
|
1510
|
+
i && n.push(2322);
|
|
1511
|
+
let o = "";
|
|
1512
|
+
if (!n.includes(t.code) && (o = t.messageText, isIterable(t.next))) for (const r of t.next) o += flattenDiagnosticMessageText(e, r);
|
|
1513
|
+
return i && (o = o.replace("type 'StencilConfig'", "Stencil Config"), o = o.replace("Object literal may only specify known properties, but ", ""),
|
|
1514
|
+
o = o.replace("Object literal may only specify known properties, and ", "")), o.trim();
|
|
1314
1515
|
}, isJest27TransformOptions = e => null != e && "object" == typeof e && e.hasOwnProperty("config");
|
|
1315
1516
|
|
|
1316
1517
|
let _tsCompilerOptions = null, _tsCompilerOptionsKey = null;
|
|
@@ -1334,12 +1535,12 @@ const jestPreprocessor = {
|
|
|
1334
1535
|
currentDirectory: s.rootDir
|
|
1335
1536
|
}, n = getCompilerOptions(s.rootDir);
|
|
1336
1537
|
n && (n.baseUrl && (r.baseUrl = n.baseUrl), n.paths && (r.paths = n.paths));
|
|
1337
|
-
const
|
|
1338
|
-
if (
|
|
1339
|
-
const e =
|
|
1538
|
+
const i = transpile(e, r), o = i.diagnostics.some((e => "error" === e.level));
|
|
1539
|
+
if (i.diagnostics && o) {
|
|
1540
|
+
const e = i.diagnostics.map(formatDiagnostic).join("\n\n");
|
|
1340
1541
|
throw new Error(e);
|
|
1341
1542
|
}
|
|
1342
|
-
return
|
|
1543
|
+
return i.code;
|
|
1343
1544
|
}
|
|
1344
1545
|
return e;
|
|
1345
1546
|
},
|
|
@@ -1355,10 +1556,10 @@ const jestPreprocessor = {
|
|
|
1355
1556
|
if (t === r) return !0;
|
|
1356
1557
|
if (t && r && "object" == typeof t && "object" == typeof r) {
|
|
1357
1558
|
const s = Array.isArray(t), n = Array.isArray(r);
|
|
1358
|
-
let
|
|
1559
|
+
let i, o, a;
|
|
1359
1560
|
if (s && n) {
|
|
1360
|
-
if (
|
|
1361
|
-
for (
|
|
1561
|
+
if (o = t.length, o != r.length) return !1;
|
|
1562
|
+
for (i = o; 0 != i--; ) if (!e(t[i], r[i])) return !1;
|
|
1362
1563
|
return !0;
|
|
1363
1564
|
}
|
|
1364
1565
|
if (s != n) return !1;
|
|
@@ -1369,9 +1570,9 @@ const jestPreprocessor = {
|
|
|
1369
1570
|
if (u != d) return !1;
|
|
1370
1571
|
if (u && d) return t.toString() == r.toString();
|
|
1371
1572
|
const h = Object.keys(t);
|
|
1372
|
-
if (
|
|
1373
|
-
for (
|
|
1374
|
-
for (
|
|
1573
|
+
if (o = h.length, o !== Object.keys(r).length) return !1;
|
|
1574
|
+
for (i = o; 0 != i--; ) if (!Object.prototype.hasOwnProperty.call(r, h[i])) return !1;
|
|
1575
|
+
for (i = o; 0 != i--; ) if (a = h[i], !e(t[a], r[a])) return !1;
|
|
1375
1576
|
return !0;
|
|
1376
1577
|
}
|
|
1377
1578
|
return t != t && r != r;
|
|
@@ -1775,9 +1976,9 @@ class BuildContext {
|
|
|
1775
1976
|
}
|
|
1776
1977
|
return {
|
|
1777
1978
|
duration: () => r.duration(),
|
|
1778
|
-
finish: (e, s, n,
|
|
1979
|
+
finish: (e, s, n, i) => {
|
|
1779
1980
|
if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
|
|
1780
|
-
r.finish(e, s, n,
|
|
1981
|
+
r.finish(e, s, n, i), !t)) {
|
|
1781
1982
|
const e = {
|
|
1782
1983
|
buildId: this.buildId,
|
|
1783
1984
|
messages: this.buildMessages.slice(),
|
|
@@ -1893,12 +2094,12 @@ class Cache {
|
|
|
1893
2094
|
if (null != t) {
|
|
1894
2095
|
if (e - t < ONE_DAY) return;
|
|
1895
2096
|
const r = this.cacheFs.sys, s = await r.readDir(this.config.cacheDir), n = s.map((e => path$2.join(this.config.cacheDir, e)));
|
|
1896
|
-
let
|
|
1897
|
-
const
|
|
2097
|
+
let i = 0;
|
|
2098
|
+
const o = n.map((async t => {
|
|
1898
2099
|
const s = (await r.stat(t)).mtimeMs;
|
|
1899
|
-
e - s > ONE_WEEK && (await r.removeFile(t),
|
|
2100
|
+
e - s > ONE_WEEK && (await r.removeFile(t), i++);
|
|
1900
2101
|
}));
|
|
1901
|
-
await Promise.all(
|
|
2102
|
+
await Promise.all(o), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${i}`);
|
|
1902
2103
|
}
|
|
1903
2104
|
this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
|
|
1904
2105
|
}
|
|
@@ -1941,11 +2142,11 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1941
2142
|
}), () => t(n);
|
|
1942
2143
|
}
|
|
1943
2144
|
if ("string" == typeof r && "function" == typeof s) {
|
|
1944
|
-
const n = r.toLowerCase().trim(),
|
|
2145
|
+
const n = r.toLowerCase().trim(), i = s;
|
|
1945
2146
|
return e.push({
|
|
1946
2147
|
eventName: n,
|
|
1947
|
-
callback:
|
|
1948
|
-
}), () => t(
|
|
2148
|
+
callback: i
|
|
2149
|
+
}), () => t(i);
|
|
1949
2150
|
}
|
|
1950
2151
|
return () => !1;
|
|
1951
2152
|
},
|
|
@@ -1979,10 +2180,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1979
2180
|
} 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) {
|
|
1980
2181
|
const s = r, n = e.queueCopyFileToDest;
|
|
1981
2182
|
t.filesToCopy.push([ s, n ]);
|
|
1982
|
-
const
|
|
1983
|
-
t.dirsToEnsure.includes(
|
|
1984
|
-
const
|
|
1985
|
-
|
|
2183
|
+
const i = normalizePath(path$2.dirname(n));
|
|
2184
|
+
t.dirsToEnsure.includes(i) || t.dirsToEnsure.push(i);
|
|
2185
|
+
const o = t.dirsToDelete.indexOf(i);
|
|
2186
|
+
o > -1 && t.dirsToDelete.splice(o, 1);
|
|
1986
2187
|
const a = t.filesToDelete.indexOf(n);
|
|
1987
2188
|
a > -1 && t.filesToDelete.splice(a, 1);
|
|
1988
2189
|
}
|
|
@@ -2079,10 +2280,10 @@ class TestingLogger {
|
|
|
2079
2280
|
|
|
2080
2281
|
(posix = {
|
|
2081
2282
|
resolve: function e() {
|
|
2082
|
-
var t, r, s, n = "",
|
|
2083
|
-
for (r = arguments.length - 1; r >= -1 && !
|
|
2084
|
-
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n,
|
|
2085
|
-
return n = normalizeStringPosix(n, !
|
|
2283
|
+
var t, r, s, n = "", i = !1;
|
|
2284
|
+
for (r = arguments.length - 1; r >= -1 && !i; r--) r >= 0 ? s = arguments[r] : (void 0 === t && (t = process.cwd()),
|
|
2285
|
+
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n, i = 47 === s.charCodeAt(0));
|
|
2286
|
+
return n = normalizeStringPosix(n, !i), i ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
|
|
2086
2287
|
},
|
|
2087
2288
|
normalize: function e(t) {
|
|
2088
2289
|
var r, s;
|
|
@@ -2100,70 +2301,70 @@ class TestingLogger {
|
|
|
2100
2301
|
return void 0 === t ? "." : posix.normalize(t);
|
|
2101
2302
|
},
|
|
2102
2303
|
relative: function e(t, r) {
|
|
2103
|
-
var s, n,
|
|
2304
|
+
var s, n, i, o, a, l, c, u, d, h;
|
|
2104
2305
|
if (assertPath(t), assertPath(r), t === r) return "";
|
|
2105
2306
|
if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
|
|
2106
2307
|
for (s = 1; s < t.length && 47 === t.charCodeAt(s); ++s) ;
|
|
2107
|
-
for (
|
|
2108
|
-
for (l =
|
|
2308
|
+
for (i = (n = t.length) - s, o = 1; o < r.length && 47 === r.charCodeAt(o); ++o) ;
|
|
2309
|
+
for (l = i < (a = r.length - o) ? i : a, c = -1, u = 0; u <= l; ++u) {
|
|
2109
2310
|
if (u === l) {
|
|
2110
2311
|
if (a > l) {
|
|
2111
|
-
if (47 === r.charCodeAt(
|
|
2112
|
-
if (0 === u) return r.slice(
|
|
2113
|
-
} else
|
|
2312
|
+
if (47 === r.charCodeAt(o + u)) return r.slice(o + u + 1);
|
|
2313
|
+
if (0 === u) return r.slice(o + u);
|
|
2314
|
+
} else i > l && (47 === t.charCodeAt(s + u) ? c = u : 0 === u && (c = 0));
|
|
2114
2315
|
break;
|
|
2115
2316
|
}
|
|
2116
|
-
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(
|
|
2317
|
+
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(o + u)) break;
|
|
2117
2318
|
47 === d && (c = u);
|
|
2118
2319
|
}
|
|
2119
2320
|
for (h = "", u = s + c + 1; u <= n; ++u) u !== n && 47 !== t.charCodeAt(u) || (0 === h.length ? h += ".." : h += "/..");
|
|
2120
|
-
return h.length > 0 ? h + r.slice(
|
|
2121
|
-
r.slice(
|
|
2321
|
+
return h.length > 0 ? h + r.slice(o + c) : (o += c, 47 === r.charCodeAt(o) && ++o,
|
|
2322
|
+
r.slice(o));
|
|
2122
2323
|
},
|
|
2123
2324
|
_makeLong: function e(t) {
|
|
2124
2325
|
return t;
|
|
2125
2326
|
},
|
|
2126
2327
|
dirname: function e(t) {
|
|
2127
|
-
var r, s, n,
|
|
2328
|
+
var r, s, n, i;
|
|
2128
2329
|
if (assertPath(t), 0 === t.length) return ".";
|
|
2129
|
-
for (r = 47 === t.charCodeAt(0), s = -1, n = !0,
|
|
2330
|
+
for (r = 47 === t.charCodeAt(0), s = -1, n = !0, i = t.length - 1; i >= 1; --i) if (47 === t.charCodeAt(i)) {
|
|
2130
2331
|
if (!n) {
|
|
2131
|
-
s =
|
|
2332
|
+
s = i;
|
|
2132
2333
|
break;
|
|
2133
2334
|
}
|
|
2134
2335
|
} else n = !1;
|
|
2135
2336
|
return -1 === s ? r ? "/" : "." : r && 1 === s ? "//" : t.slice(0, s);
|
|
2136
2337
|
},
|
|
2137
2338
|
basename: function e(t, r) {
|
|
2138
|
-
var s, n,
|
|
2339
|
+
var s, n, i, o, a, l, c;
|
|
2139
2340
|
if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
|
|
2140
|
-
if (assertPath(t), s = 0, n = -1,
|
|
2341
|
+
if (assertPath(t), s = 0, n = -1, i = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
|
|
2141
2342
|
if (r.length === t.length && r === t) return "";
|
|
2142
|
-
for (a = r.length - 1, l = -1,
|
|
2143
|
-
if (!
|
|
2144
|
-
s =
|
|
2343
|
+
for (a = r.length - 1, l = -1, o = t.length - 1; o >= 0; --o) if (47 === (c = t.charCodeAt(o))) {
|
|
2344
|
+
if (!i) {
|
|
2345
|
+
s = o + 1;
|
|
2145
2346
|
break;
|
|
2146
2347
|
}
|
|
2147
|
-
} else -1 === l && (
|
|
2348
|
+
} else -1 === l && (i = !1, l = o + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (n = o) : (a = -1,
|
|
2148
2349
|
n = l));
|
|
2149
2350
|
return s === n ? n = l : -1 === n && (n = t.length), t.slice(s, n);
|
|
2150
2351
|
}
|
|
2151
|
-
for (
|
|
2152
|
-
if (!
|
|
2153
|
-
s =
|
|
2352
|
+
for (o = t.length - 1; o >= 0; --o) if (47 === t.charCodeAt(o)) {
|
|
2353
|
+
if (!i) {
|
|
2354
|
+
s = o + 1;
|
|
2154
2355
|
break;
|
|
2155
2356
|
}
|
|
2156
|
-
} else -1 === n && (
|
|
2357
|
+
} else -1 === n && (i = !1, n = o + 1);
|
|
2157
2358
|
return -1 === n ? "" : t.slice(s, n);
|
|
2158
2359
|
},
|
|
2159
2360
|
extname: function e(t) {
|
|
2160
|
-
var r, s, n,
|
|
2161
|
-
for (assertPath(t), r = -1, s = 0, n = -1,
|
|
2162
|
-
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !==
|
|
2361
|
+
var r, s, n, i, o, a, l;
|
|
2362
|
+
for (assertPath(t), r = -1, s = 0, n = -1, i = !0, o = 0, a = t.length - 1; a >= 0; --a) if (47 !== (l = t.charCodeAt(a))) -1 === n && (i = !1,
|
|
2363
|
+
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !== o && (o = 1) : -1 !== r && (o = -1); else if (!i) {
|
|
2163
2364
|
s = a + 1;
|
|
2164
2365
|
break;
|
|
2165
2366
|
}
|
|
2166
|
-
return -1 === r || -1 === n || 0 ===
|
|
2367
|
+
return -1 === r || -1 === n || 0 === o || 1 === o && r === n - 1 && r === s + 1 ? "" : t.slice(r, n);
|
|
2167
2368
|
},
|
|
2168
2369
|
format: function e(t) {
|
|
2169
2370
|
if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
|
|
@@ -2173,7 +2374,7 @@ class TestingLogger {
|
|
|
2173
2374
|
}("/", t);
|
|
2174
2375
|
},
|
|
2175
2376
|
parse: function e(t) {
|
|
2176
|
-
var r, s, n,
|
|
2377
|
+
var r, s, n, i, o, a, l, c, u, d;
|
|
2177
2378
|
if (assertPath(t), r = {
|
|
2178
2379
|
root: "",
|
|
2179
2380
|
dir: "",
|
|
@@ -2181,14 +2382,14 @@ class TestingLogger {
|
|
|
2181
2382
|
ext: "",
|
|
2182
2383
|
name: ""
|
|
2183
2384
|
}, 0 === t.length) return r;
|
|
2184
|
-
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/",
|
|
2185
|
-
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >=
|
|
2186
|
-
l = u + 1), 46 === s ? -1 ===
|
|
2385
|
+
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/", i = 1) : i = 0, o = -1,
|
|
2386
|
+
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= i; --u) if (47 !== (s = t.charCodeAt(u))) -1 === l && (c = !1,
|
|
2387
|
+
l = u + 1), 46 === s ? -1 === o ? o = u : 1 !== d && (d = 1) : -1 !== o && (d = -1); else if (!c) {
|
|
2187
2388
|
a = u + 1;
|
|
2188
2389
|
break;
|
|
2189
2390
|
}
|
|
2190
|
-
return -1 ===
|
|
2191
|
-
r.base = t.slice(1, l)) : (r.name = t.slice(a,
|
|
2391
|
+
return -1 === o || -1 === l || 0 === d || 1 === d && o === l - 1 && o === a + 1 ? -1 !== l && (r.base = r.name = 0 === a && n ? t.slice(1, l) : t.slice(a, l)) : (0 === a && n ? (r.name = t.slice(1, o),
|
|
2392
|
+
r.base = t.slice(1, l)) : (r.name = t.slice(a, o), r.base = t.slice(a, l)), r.ext = t.slice(o, l)),
|
|
2192
2393
|
a > 0 ? r.dir = t.slice(0, a - 1) : n && (r.dir = "/"), r;
|
|
2193
2394
|
},
|
|
2194
2395
|
sep: "/",
|
|
@@ -2212,18 +2413,8 @@ caller = function() {
|
|
|
2212
2413
|
return Error.prepareStackTrace = function(e, t) {
|
|
2213
2414
|
return t;
|
|
2214
2415
|
}, e = (new Error).stack, Error.prepareStackTrace = t, e[2].getFileName();
|
|
2215
|
-
}, pathParse =
|
|
2216
|
-
|
|
2217
|
-
path: t,
|
|
2218
|
-
exports: {},
|
|
2219
|
-
require: function(e, t) {
|
|
2220
|
-
return function s() {
|
|
2221
|
-
throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
2222
|
-
}(null == t && r.path);
|
|
2223
|
-
}
|
|
2224
|
-
}, r.exports), r.exports;
|
|
2225
|
-
}((function(e) {
|
|
2226
|
-
var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, o = {
|
|
2416
|
+
}, pathParse = createCommonjsModule((function(e) {
|
|
2417
|
+
var t, r, s = "win32" === process.platform, n = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, i = {
|
|
2227
2418
|
parse: function(e) {
|
|
2228
2419
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2229
2420
|
var t = function r(e) {
|
|
@@ -2252,26 +2443,26 @@ caller = function() {
|
|
|
2252
2443
|
ext: r[4],
|
|
2253
2444
|
name: r[3]
|
|
2254
2445
|
};
|
|
2255
|
-
}, e.exports = s ?
|
|
2446
|
+
}, e.exports = s ? i.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = i.parse;
|
|
2256
2447
|
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2257
|
-
var s, n,
|
|
2258
|
-
for (/^([A-Za-z]:)/.test(t) ?
|
|
2448
|
+
var s, n, i = "/";
|
|
2449
|
+
for (/^([A-Za-z]:)/.test(t) ? i = "" : /^\\\\/.test(t) && (i = "\\\\"), s = [ t ],
|
|
2259
2450
|
n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
|
|
2260
2451
|
return s.reduce((function(e, t) {
|
|
2261
2452
|
return e.concat(r.map((function(e) {
|
|
2262
|
-
return path__default.default.resolve(
|
|
2453
|
+
return path__default.default.resolve(i, t, e);
|
|
2263
2454
|
})));
|
|
2264
2455
|
}), []);
|
|
2265
2456
|
}, nodeModulesPaths = function e(t, r, s) {
|
|
2266
|
-
var n,
|
|
2457
|
+
var n, i = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
|
|
2267
2458
|
return r && "function" == typeof r.paths ? r.paths(s, t, (function() {
|
|
2268
|
-
return getNodeModulesDirs(t,
|
|
2269
|
-
}), r) : (n = getNodeModulesDirs(t,
|
|
2459
|
+
return getNodeModulesDirs(t, i);
|
|
2460
|
+
}), r) : (n = getNodeModulesDirs(t, i), r && r.paths ? n.concat(r.paths) : n);
|
|
2270
2461
|
}, normalizeOptions = function(e, t) {
|
|
2271
2462
|
return t || {};
|
|
2272
2463
|
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2273
2464
|
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2274
|
-
var r, s, n,
|
|
2465
|
+
var r, s, n, i, o, a, l, c = this;
|
|
2275
2466
|
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2276
2467
|
for (r = slice.call(arguments, 1), n = function() {
|
|
2277
2468
|
if (this instanceof s) {
|
|
@@ -2279,8 +2470,8 @@ toStr = Object.prototype.toString, implementation = function e(t) {
|
|
|
2279
2470
|
return Object(e) === e ? e : this;
|
|
2280
2471
|
}
|
|
2281
2472
|
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2282
|
-
},
|
|
2283
|
-
return s = Function("binder", "return function (" +
|
|
2473
|
+
}, i = Math.max(0, c.length - r.length), o = [], a = 0; a < i; a++) o.push("$" + a);
|
|
2474
|
+
return s = Function("binder", "return function (" + o.join(",") + "){ return binder.apply(this,arguments); }")(n),
|
|
2284
2475
|
c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
|
|
2285
2476
|
l.prototype = null), s;
|
|
2286
2477
|
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
@@ -2405,14 +2596,14 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2405
2596
|
}
|
|
2406
2597
|
}));
|
|
2407
2598
|
}, getPackageCandidates$1 = function e(t, r, s) {
|
|
2408
|
-
var n,
|
|
2409
|
-
for (n = 0; n <
|
|
2410
|
-
return
|
|
2599
|
+
var n, i = nodeModulesPaths(r, s, t);
|
|
2600
|
+
for (n = 0; n < i.length; n++) i[n] = path__default.default.join(i[n], t);
|
|
2601
|
+
return i;
|
|
2411
2602
|
}, async = function e(t, r, s) {
|
|
2412
2603
|
function n(e) {
|
|
2413
2604
|
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) T = path__default.default.resolve(e, t),
|
|
2414
|
-
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package,
|
|
2415
|
-
if (
|
|
2605
|
+
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package, i) : o(T, C.package, i); else {
|
|
2606
|
+
if (E && isCoreModule(t)) return S(null, t);
|
|
2416
2607
|
!function r(e, t, s) {
|
|
2417
2608
|
var n = function() {
|
|
2418
2609
|
return getPackageCandidates$1(e, t, C);
|
|
@@ -2423,36 +2614,36 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2423
2614
|
if (r) return maybeRealpath(f, r, C, (function(e, t) {
|
|
2424
2615
|
e ? S(e) : S(null, t, s);
|
|
2425
2616
|
}));
|
|
2426
|
-
var n = new Error("Cannot find module '" + t + "' from '" +
|
|
2617
|
+
var n = new Error("Cannot find module '" + t + "' from '" + v + "'");
|
|
2427
2618
|
n.code = "MODULE_NOT_FOUND", S(n);
|
|
2428
2619
|
}
|
|
2429
2620
|
}));
|
|
2430
2621
|
}
|
|
2431
2622
|
}
|
|
2432
|
-
function
|
|
2623
|
+
function i(e, r, s) {
|
|
2433
2624
|
e ? S(e) : r ? S(null, r, s) : l(T, (function(e, r, s) {
|
|
2434
2625
|
if (e) S(e); else if (r) maybeRealpath(f, r, C, (function(e, t) {
|
|
2435
2626
|
e ? S(e) : S(null, t, s);
|
|
2436
2627
|
})); else {
|
|
2437
|
-
var n = new Error("Cannot find module '" + t + "' from '" +
|
|
2628
|
+
var n = new Error("Cannot find module '" + t + "' from '" + v + "'");
|
|
2438
2629
|
n.code = "MODULE_NOT_FOUND", S(n);
|
|
2439
2630
|
}
|
|
2440
2631
|
}));
|
|
2441
2632
|
}
|
|
2442
|
-
function
|
|
2633
|
+
function o(e, t, r) {
|
|
2443
2634
|
var s = t, n = r;
|
|
2444
2635
|
"function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
|
|
2445
|
-
function
|
|
2636
|
+
function i(s, i, a) {
|
|
2446
2637
|
var u, h, p;
|
|
2447
|
-
return c =
|
|
2448
|
-
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l,
|
|
2638
|
+
return c = i, s ? n(s) : a && c && C.pathFilter && (h = (u = path__default.default.relative(a, l)).slice(0, u.length - t[0].length),
|
|
2639
|
+
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, o);
|
|
2449
2640
|
}
|
|
2450
|
-
function
|
|
2451
|
-
return s ? n(s) :
|
|
2641
|
+
function o(s, i) {
|
|
2642
|
+
return s ? n(s) : i ? n(null, l, c) : void e(t.slice(1), r, c);
|
|
2452
2643
|
}
|
|
2453
2644
|
var l, c;
|
|
2454
2645
|
if (0 === t.length) return n(null, void 0, s);
|
|
2455
|
-
l = r + t[0], (c = s) ?
|
|
2646
|
+
l = r + t[0], (c = s) ? i(null, c) : a(path__default.default.dirname(l), i);
|
|
2456
2647
|
}([ "" ].concat(w), e, s);
|
|
2457
2648
|
}
|
|
2458
2649
|
function a(e, t) {
|
|
@@ -2463,8 +2654,8 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2463
2654
|
if (!s) return a(path__default.default.dirname(e), t);
|
|
2464
2655
|
m(p, n, (function(r, s) {
|
|
2465
2656
|
r && t(r);
|
|
2466
|
-
var
|
|
2467
|
-
|
|
2657
|
+
var i = s;
|
|
2658
|
+
i && C.packageFilter && (i = C.packageFilter(i, n)), t(null, i, e);
|
|
2468
2659
|
}));
|
|
2469
2660
|
}));
|
|
2470
2661
|
}));
|
|
@@ -2473,34 +2664,34 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2473
2664
|
var s = r, n = t;
|
|
2474
2665
|
"function" == typeof n && (s = n, n = C.package), maybeRealpath(f, e, C, (function(t, r) {
|
|
2475
2666
|
if (t) return s(t);
|
|
2476
|
-
var
|
|
2477
|
-
d(
|
|
2478
|
-
return t ? s(t) : r ? void m(p,
|
|
2667
|
+
var i = path__default.default.join(r, "package.json");
|
|
2668
|
+
d(i, (function(t, r) {
|
|
2669
|
+
return t ? s(t) : r ? void m(p, i, (function(t, r) {
|
|
2479
2670
|
var n, a;
|
|
2480
|
-
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n,
|
|
2481
|
-
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void
|
|
2671
|
+
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n, i)), n && n.main ? "string" != typeof n.main ? ((a = new TypeError("package “" + n.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2672
|
+
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void o(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2482
2673
|
return t ? s(t) : r ? s(null, r, n) : n ? void l(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2483
|
-
return t ? s(t) : r ? s(null, r, n) : void
|
|
2484
|
-
})) :
|
|
2485
|
-
}))) : void
|
|
2486
|
-
})) :
|
|
2674
|
+
return t ? s(t) : r ? s(null, r, n) : void o(path__default.default.join(e, "index"), n, s);
|
|
2675
|
+
})) : o(path__default.default.join(e, "index"), n, s);
|
|
2676
|
+
}))) : void o(path__default.default.join(e, "/index"), n, s));
|
|
2677
|
+
})) : o(path__default.default.join(e, "index"), n, s);
|
|
2487
2678
|
}));
|
|
2488
2679
|
}));
|
|
2489
2680
|
}
|
|
2490
2681
|
function c(e, t) {
|
|
2491
|
-
function r(t, r,
|
|
2492
|
-
return t ? e(t) : r ? e(null, r,
|
|
2682
|
+
function r(t, r, i) {
|
|
2683
|
+
return t ? e(t) : r ? e(null, r, i) : void l(n, C.package, s);
|
|
2493
2684
|
}
|
|
2494
2685
|
function s(r, s, n) {
|
|
2495
2686
|
return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
|
|
2496
2687
|
}
|
|
2497
2688
|
if (0 === t.length) return e(null, void 0);
|
|
2498
2689
|
var n = t[0];
|
|
2499
|
-
h(path__default.default.dirname(n), (function
|
|
2500
|
-
return s ? e(s) : a ? void
|
|
2690
|
+
h(path__default.default.dirname(n), (function i(s, a) {
|
|
2691
|
+
return s ? e(s) : a ? void o(n, C.package, r) : c(e, t.slice(1));
|
|
2501
2692
|
}));
|
|
2502
2693
|
}
|
|
2503
|
-
var u, d, h, p, f, m, g, y, w, _, v, b,
|
|
2694
|
+
var u, d, h, p, f, m, g, y, w, E, _, v, b, T, S = s, C = r;
|
|
2504
2695
|
return "function" == typeof r && (S = C, C = {}), "string" != typeof t ? (u = new TypeError("Path must be a string."),
|
|
2505
2696
|
process.nextTick((function() {
|
|
2506
2697
|
S(u);
|
|
@@ -2509,9 +2700,9 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2509
2700
|
m = C.readPackage || defaultReadPackage, C.readFile && C.readPackage ? (g = new TypeError("`readFile` and `readPackage` are mutually exclusive."),
|
|
2510
2701
|
process.nextTick((function() {
|
|
2511
2702
|
S(g);
|
|
2512
|
-
}))) : (y = C.packageIterator, w = C.extensions || [ ".js" ],
|
|
2513
|
-
|
|
2514
|
-
|
|
2703
|
+
}))) : (y = C.packageIterator, w = C.extensions || [ ".js" ], E = !1 !== C.includeCoreModules,
|
|
2704
|
+
_ = C.basedir || path__default.default.dirname(caller()), v = C.filename || _, C.paths = C.paths || [],
|
|
2705
|
+
b = path__default.default.resolve(_), void maybeRealpath(f, b, C, (function(e, t) {
|
|
2515
2706
|
e ? S(e) : n(t);
|
|
2516
2707
|
}))));
|
|
2517
2708
|
};
|
|
@@ -2637,67 +2828,67 @@ defaultIsFile = function e(t) {
|
|
|
2637
2828
|
return JSON.parse(s);
|
|
2638
2829
|
} catch (e) {}
|
|
2639
2830
|
}, getPackageCandidates = function e(t, r, s) {
|
|
2640
|
-
var n,
|
|
2641
|
-
for (n = 0; n <
|
|
2642
|
-
return
|
|
2831
|
+
var n, i = nodeModulesPaths(r, s, t);
|
|
2832
|
+
for (n = 0; n < i.length; n++) i[n] = path__default.default.join(i[n], t);
|
|
2833
|
+
return i;
|
|
2643
2834
|
}, sync = function e(t, r) {
|
|
2644
2835
|
function s(e) {
|
|
2645
|
-
var t, r, s,
|
|
2646
|
-
if (l && l.dir && l.pkg &&
|
|
2647
|
-
(r =
|
|
2836
|
+
var t, r, s, i, l = n(path__default.default.dirname(e));
|
|
2837
|
+
if (l && l.dir && l.pkg && o.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2838
|
+
(r = o.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2648
2839
|
a(e)) return e;
|
|
2649
|
-
for (s = 0; s < p.length; s++) if (
|
|
2840
|
+
for (s = 0; s < p.length; s++) if (i = e + p[s], a(i)) return i;
|
|
2650
2841
|
}
|
|
2651
2842
|
function n(e) {
|
|
2652
2843
|
var t, r;
|
|
2653
|
-
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e,
|
|
2654
|
-
a(t) ? ((r = d(l, t)) &&
|
|
2844
|
+
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e, o), "package.json"),
|
|
2845
|
+
a(t) ? ((r = d(l, t)) && o.packageFilter && (r = o.packageFilter(r, e)), {
|
|
2655
2846
|
pkg: r,
|
|
2656
2847
|
dir: e
|
|
2657
2848
|
}) : n(path__default.default.dirname(e));
|
|
2658
2849
|
}
|
|
2659
|
-
function
|
|
2660
|
-
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e,
|
|
2850
|
+
function i(e) {
|
|
2851
|
+
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, o), "/package.json");
|
|
2661
2852
|
if (a(h)) {
|
|
2662
2853
|
try {
|
|
2663
2854
|
t = d(l, h);
|
|
2664
2855
|
} catch (e) {}
|
|
2665
|
-
if (t &&
|
|
2856
|
+
if (t && o.packageFilter && (t = o.packageFilter(t, e)), t && t.main) {
|
|
2666
2857
|
if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2667
2858
|
r;
|
|
2668
2859
|
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2669
2860
|
try {
|
|
2670
2861
|
if (n = s(path__default.default.resolve(e, t.main))) return n;
|
|
2671
|
-
if (c =
|
|
2862
|
+
if (c = i(path__default.default.resolve(e, t.main))) return c;
|
|
2672
2863
|
} catch (e) {}
|
|
2673
2864
|
}
|
|
2674
2865
|
}
|
|
2675
2866
|
return s(path__default.default.join(e, "/index"));
|
|
2676
2867
|
}
|
|
2677
|
-
var
|
|
2868
|
+
var o, a, l, c, u, d, h, p, f, m, g, y, w, E, _, v;
|
|
2678
2869
|
if ("string" != typeof t) throw new TypeError("Path must be a string.");
|
|
2679
|
-
if (
|
|
2680
|
-
c =
|
|
2681
|
-
|
|
2682
|
-
if (h =
|
|
2683
|
-
m =
|
|
2684
|
-
y = maybeRealpathSync(u, path__default.default.resolve(m),
|
|
2870
|
+
if (o = normalizeOptions(0, r), a = o.isFile || defaultIsFile, l = o.readFileSync || fs__default.default.readFileSync,
|
|
2871
|
+
c = o.isDirectory || defaultIsDir, u = o.realpathSync || defaultRealpathSync, d = o.readPackageSync || defaultReadPackageSync,
|
|
2872
|
+
o.readFileSync && o.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
2873
|
+
if (h = o.packageIterator, p = o.extensions || [ ".js" ], f = !1 !== o.includeCoreModules,
|
|
2874
|
+
m = o.basedir || path__default.default.dirname(caller()), g = o.filename || m, o.paths = o.paths || [],
|
|
2875
|
+
y = maybeRealpathSync(u, path__default.default.resolve(m), o), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2685
2876
|
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2686
|
-
|
|
2877
|
+
E = s(w) || i(w)) return maybeRealpathSync(u, E, o);
|
|
2687
2878
|
} else {
|
|
2688
2879
|
if (f && isCoreModule(t)) return t;
|
|
2689
|
-
if (
|
|
2880
|
+
if (_ = function b(e, t) {
|
|
2690
2881
|
var r, n, a, l, u = function() {
|
|
2691
|
-
return getPackageCandidates(e, t,
|
|
2692
|
-
}, d = h ? h(e, t, u,
|
|
2882
|
+
return getPackageCandidates(e, t, o);
|
|
2883
|
+
}, d = h ? h(e, t, u, o) : u();
|
|
2693
2884
|
for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
|
|
2694
2885
|
if (a = s(n)) return a;
|
|
2695
|
-
if (l =
|
|
2886
|
+
if (l = i(n)) return l;
|
|
2696
2887
|
}
|
|
2697
|
-
}(t, y)) return maybeRealpathSync(u,
|
|
2888
|
+
}(t, y), _) return maybeRealpathSync(u, _, o);
|
|
2698
2889
|
}
|
|
2699
|
-
throw (
|
|
2700
|
-
|
|
2890
|
+
throw (v = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
|
|
2891
|
+
v;
|
|
2701
2892
|
}, async.core = core_1, async.isCore = isCore, async.sync = sync, resolve = async;
|
|
2702
2893
|
|
|
2703
2894
|
const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json", ".md" ], COMMON_DIR_FILENAMES = [ "package.json", "index.js", "index.mjs" ], getCommonDirName = (e, t) => e + "/" + t, isCommonDirModuleFile = e => COMMON_DIR_MODULE_EXTS.some((t => e.endsWith(t))), shouldFetchModule = e => IS_FETCH_ENV && IS_BROWSER_ENV && isNodeModulePath(e), isNodeModulePath = e => normalizePath(e).split("/").includes("node_modules"), getPackageDirPath = (e, t) => {
|
|
@@ -2721,20 +2912,20 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2721
2912
|
let s = (r = normalizePath(r)).split("/").filter((e => e.length));
|
|
2722
2913
|
const n = s.lastIndexOf("node_modules");
|
|
2723
2914
|
n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
|
|
2724
|
-
let
|
|
2725
|
-
|
|
2726
|
-
const
|
|
2727
|
-
return "@stencil/core" ===
|
|
2915
|
+
let i = s.shift();
|
|
2916
|
+
i.startsWith("@") && (i += "/" + s.shift());
|
|
2917
|
+
const o = s.join("/");
|
|
2918
|
+
return "@stencil/core" === i ? ((e, t) => {
|
|
2728
2919
|
let r = (t = normalizePath(t)).split("/");
|
|
2729
2920
|
const s = r.lastIndexOf("node_modules");
|
|
2730
2921
|
s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
|
|
2731
2922
|
t = r.join("/"));
|
|
2732
2923
|
const n = new URL("../", e).href;
|
|
2733
2924
|
return new URL("./" + t, n).href;
|
|
2734
|
-
})(e.getCompilerExecutingPath(),
|
|
2735
|
-
moduleId:
|
|
2736
|
-
version: t.get(
|
|
2737
|
-
path:
|
|
2925
|
+
})(e.getCompilerExecutingPath(), o) : e.getRemoteModuleUrl({
|
|
2926
|
+
moduleId: i,
|
|
2927
|
+
version: t.get(i),
|
|
2928
|
+
path: o
|
|
2738
2929
|
});
|
|
2739
2930
|
}, 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) => {
|
|
2740
2931
|
if (!((e => {
|
|
@@ -2743,11 +2934,11 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2743
2934
|
const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
|
|
2744
2935
|
return !("node_modules" !== s || !isCommonDirModuleFile(n));
|
|
2745
2936
|
})(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
|
|
2746
|
-
const
|
|
2747
|
-
if (
|
|
2748
|
-
if (
|
|
2749
|
-
const
|
|
2750
|
-
return await (async (e, t, r, s, n,
|
|
2937
|
+
const i = await ((e, t, r) => e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r))(e, s);
|
|
2938
|
+
if (i) {
|
|
2939
|
+
if (i.ok) {
|
|
2940
|
+
const o = await i.clone().text();
|
|
2941
|
+
return await (async (e, t, r, s, n, i) => {
|
|
2751
2942
|
r.endsWith("package.json") && ((e, t) => {
|
|
2752
2943
|
try {
|
|
2753
2944
|
const r = JSON.parse(t);
|
|
@@ -2755,14 +2946,14 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2755
2946
|
e.set(t, r);
|
|
2756
2947
|
})(e, r.name, r.version);
|
|
2757
2948
|
} catch (e) {}
|
|
2758
|
-
})(
|
|
2759
|
-
let
|
|
2760
|
-
for (;"/" !==
|
|
2761
|
-
|
|
2949
|
+
})(i, n);
|
|
2950
|
+
let o = path$2.dirname(s);
|
|
2951
|
+
for (;"/" !== o && "" !== o; ) t ? (t.clearFileCache(o), await t.sys.createDir(o)) : await e.createDir(o),
|
|
2952
|
+
o = path$2.dirname(o);
|
|
2762
2953
|
t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
|
|
2763
|
-
})(e, t, s, n,
|
|
2954
|
+
})(e, t, s, n, o, r), o;
|
|
2764
2955
|
}
|
|
2765
|
-
404 ===
|
|
2956
|
+
404 === i.status && known404Urls.add(s);
|
|
2766
2957
|
}
|
|
2767
2958
|
} catch (e) {
|
|
2768
2959
|
console.error(e);
|
|
@@ -2799,8 +2990,8 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2799
2990
|
let r = BLUE, s = "Build", n = "";
|
|
2800
2991
|
"error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
|
|
2801
2992
|
s = "Warning"), e.header && (s = e.header);
|
|
2802
|
-
const
|
|
2803
|
-
if (
|
|
2993
|
+
const i = e.relFilePath || e.absFilePath;
|
|
2994
|
+
if (i && (n += i, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
|
|
2804
2995
|
"number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
|
|
2805
2996
|
n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
|
|
2806
2997
|
n += "\n" + e.lineNumber + ": " + e.text;
|
|
@@ -2811,7 +3002,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2811
3002
|
})(t, e)));
|
|
2812
3003
|
}
|
|
2813
3004
|
};
|
|
2814
|
-
})(), s = new Map, n = new Set,
|
|
3005
|
+
})(), s = new Map, n = new Set, i = e => n.add(e), o = e => n.delete(e), a = buildEvents(), l = IS_BROWSER_ENV && navigator.hardwareConcurrency || 1, c = e => {
|
|
2815
3006
|
if ("/" === e || "" === e) return "/";
|
|
2816
3007
|
const t = path$2.dirname(e), r = path$2.basename(e);
|
|
2817
3008
|
return t.endsWith("/") ? normalizePath(`${t}${r}`) : normalizePath(`${t}/${r}`);
|
|
@@ -2831,15 +3022,15 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2831
3022
|
}, h = (e, t, r) => {
|
|
2832
3023
|
const n = path$2.dirname(e);
|
|
2833
3024
|
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && h(n, t, r);
|
|
2834
|
-
const
|
|
2835
|
-
|
|
3025
|
+
const i = s.get(e);
|
|
3026
|
+
i ? (i.isDirectory = !0, i.isFile = !1) : (s.set(e, {
|
|
2836
3027
|
basename: path$2.basename(e),
|
|
2837
3028
|
dirname: n,
|
|
2838
3029
|
isDirectory: !0,
|
|
2839
3030
|
isFile: !1,
|
|
2840
3031
|
watcherCallbacks: null,
|
|
2841
3032
|
data: void 0
|
|
2842
|
-
}), r.newDirs.push(e),
|
|
3033
|
+
}), r.newDirs.push(e), v(e, new Set));
|
|
2843
3034
|
}, p = e => {
|
|
2844
3035
|
e = c(e);
|
|
2845
3036
|
const t = [], r = s.get(e);
|
|
@@ -2854,12 +3045,12 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2854
3045
|
path: c(e),
|
|
2855
3046
|
error: null
|
|
2856
3047
|
}), g = (e, t, r) => {
|
|
2857
|
-
const n =
|
|
3048
|
+
const n = E(e);
|
|
2858
3049
|
if (!n.error && !r.error) if (n.isFile) {
|
|
2859
|
-
const n = path$2.dirname(t),
|
|
3050
|
+
const n = path$2.dirname(t), i = d(n, {
|
|
2860
3051
|
recursive: !0
|
|
2861
|
-
}),
|
|
2862
|
-
r.newDirs.push(...
|
|
3052
|
+
}), o = s.get(e).data, a = b(t, o);
|
|
3053
|
+
r.newDirs.push(...i.newDirs), r.renamed.push({
|
|
2863
3054
|
oldPath: e,
|
|
2864
3055
|
newPath: t,
|
|
2865
3056
|
isDirectory: !1,
|
|
@@ -2897,13 +3088,13 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2897
3088
|
if (t && t.recursive) for (const e of n) {
|
|
2898
3089
|
const n = s.get(e);
|
|
2899
3090
|
if (n) if (n.isDirectory) w(e, t, r); else if (n.isFile) {
|
|
2900
|
-
const t =
|
|
3091
|
+
const t = _(e);
|
|
2901
3092
|
t.error ? r.error = t.error : r.removedFiles.push(e);
|
|
2902
3093
|
}
|
|
2903
3094
|
} else if (n.length > 0) return void (r.error = "cannot delete directory that contains files/subdirectories");
|
|
2904
|
-
s.delete(e),
|
|
3095
|
+
s.delete(e), v(e, new Set), r.removedDirs.push(e);
|
|
2905
3096
|
}
|
|
2906
|
-
},
|
|
3097
|
+
}, E = e => {
|
|
2907
3098
|
e = c(e);
|
|
2908
3099
|
const t = s.get(e);
|
|
2909
3100
|
return t && (t.isDirectory || t.isFile && "string" == typeof t.data) ? {
|
|
@@ -2919,7 +3110,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2919
3110
|
size: 0,
|
|
2920
3111
|
error: `ENOENT: no such file or directory, statSync '${e}'`
|
|
2921
3112
|
};
|
|
2922
|
-
},
|
|
3113
|
+
}, _ = e => {
|
|
2923
3114
|
e = c(e);
|
|
2924
3115
|
const t = {
|
|
2925
3116
|
basename: path$2.basename(e),
|
|
@@ -2929,14 +3120,14 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2929
3120
|
}, r = s.get(e);
|
|
2930
3121
|
if (r) {
|
|
2931
3122
|
if (r.watcherCallbacks) for (const t of r.watcherCallbacks) t(e, "fileDelete");
|
|
2932
|
-
s.delete(e),
|
|
3123
|
+
s.delete(e), v(e, new Set);
|
|
2933
3124
|
}
|
|
2934
3125
|
return t;
|
|
2935
|
-
},
|
|
3126
|
+
}, v = (e, t) => {
|
|
2936
3127
|
const r = c(path$2.dirname(e)), n = s.get(r);
|
|
2937
3128
|
if (n && n.isDirectory && n.watcherCallbacks) for (const t of n.watcherCallbacks) t(e, null);
|
|
2938
|
-
t.has(r) || (t.add(r),
|
|
2939
|
-
},
|
|
3129
|
+
t.has(r) || (t.add(r), v(r, t));
|
|
3130
|
+
}, b = (e, t) => {
|
|
2940
3131
|
const r = {
|
|
2941
3132
|
path: e = c(e),
|
|
2942
3133
|
error: null
|
|
@@ -2951,18 +3142,18 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
2951
3142
|
isFile: !0,
|
|
2952
3143
|
watcherCallbacks: null,
|
|
2953
3144
|
data: t
|
|
2954
|
-
}),
|
|
3145
|
+
}), v(e, new Set);
|
|
2955
3146
|
return r;
|
|
2956
3147
|
}, T = "undefined" != typeof self ? null === self || void 0 === self ? void 0 : self.fetch : "undefined" != typeof window ? null === window || void 0 === window ? void 0 : window.fetch : "undefined" != typeof global ? null === global || void 0 === global ? void 0 : global.fetch : void 0, S = Promise.resolve();
|
|
2957
3148
|
d("/");
|
|
2958
3149
|
const C = {
|
|
2959
3150
|
name: "in-memory",
|
|
2960
|
-
version: "3.0.0-alpha.
|
|
3151
|
+
version: "3.0.0-alpha.2",
|
|
2961
3152
|
events: a,
|
|
2962
3153
|
access: async e => u(e),
|
|
2963
3154
|
accessSync: u,
|
|
2964
|
-
addDestroy:
|
|
2965
|
-
copyFile: async (e, t) => (
|
|
3155
|
+
addDestroy: i,
|
|
3156
|
+
copyFile: async (e, t) => (b(t, f(e)), !0),
|
|
2966
3157
|
createDir: async (e, t) => d(e, t),
|
|
2967
3158
|
createDirSync: d,
|
|
2968
3159
|
homeDir: () => os__namespace.homedir(),
|
|
@@ -3005,7 +3196,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3005
3196
|
readFileSync: f,
|
|
3006
3197
|
realpath: async e => m(e),
|
|
3007
3198
|
realpathSync: m,
|
|
3008
|
-
removeDestroy:
|
|
3199
|
+
removeDestroy: o,
|
|
3009
3200
|
rename: async (e, t) => {
|
|
3010
3201
|
const r = {
|
|
3011
3202
|
oldPath: e = normalizePath(e),
|
|
@@ -3018,7 +3209,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3018
3209
|
isFile: !1,
|
|
3019
3210
|
isDirectory: !1,
|
|
3020
3211
|
error: null
|
|
3021
|
-
}, s =
|
|
3212
|
+
}, s = E(e);
|
|
3022
3213
|
if (s.error) r.error = `${e} does not exist`; else if (s.isFile ? r.isFile = !0 : s.isDirectory && (r.isDirectory = !0),
|
|
3023
3214
|
g(e, t, r), !r.error) if (r.isDirectory) {
|
|
3024
3215
|
const t = y(e, {
|
|
@@ -3026,7 +3217,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3026
3217
|
});
|
|
3027
3218
|
t.error ? r.error = t.error : (r.oldDirs.push(...t.removedDirs), r.oldFiles.push(...t.removedFiles));
|
|
3028
3219
|
} else if (r.isFile) {
|
|
3029
|
-
const t =
|
|
3220
|
+
const t = _(e);
|
|
3030
3221
|
t.error ? r.error = t.error : r.oldFiles.push(e);
|
|
3031
3222
|
}
|
|
3032
3223
|
return r;
|
|
@@ -3035,11 +3226,11 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3035
3226
|
resolvePath: e => c(e),
|
|
3036
3227
|
removeDir: async (e, t = {}) => y(e, t),
|
|
3037
3228
|
removeDirSync: y,
|
|
3038
|
-
stat: async e =>
|
|
3039
|
-
statSync:
|
|
3229
|
+
stat: async e => E(e),
|
|
3230
|
+
statSync: E,
|
|
3040
3231
|
tmpDirSync: () => "/.tmp",
|
|
3041
|
-
removeFile: async e =>
|
|
3042
|
-
removeFileSync:
|
|
3232
|
+
removeFile: async e => _(e),
|
|
3233
|
+
removeFileSync: _,
|
|
3043
3234
|
watchDirectory: (e, t) => {
|
|
3044
3235
|
e = c(e);
|
|
3045
3236
|
const r = s.get(e), n = () => {
|
|
@@ -3049,7 +3240,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3049
3240
|
e > -1 && r.watcherCallbacks.splice(e, 1);
|
|
3050
3241
|
}
|
|
3051
3242
|
};
|
|
3052
|
-
return
|
|
3243
|
+
return i(n), r ? (r.isDirectory = !0, r.isFile = !1, r.watcherCallbacks = r.watcherCallbacks || [],
|
|
3053
3244
|
r.watcherCallbacks.push(t)) : s.set(e, {
|
|
3054
3245
|
basename: path$2.basename(e),
|
|
3055
3246
|
dirname: path$2.dirname(e),
|
|
@@ -3059,7 +3250,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3059
3250
|
data: void 0
|
|
3060
3251
|
}), {
|
|
3061
3252
|
close() {
|
|
3062
|
-
|
|
3253
|
+
o(n), n();
|
|
3063
3254
|
}
|
|
3064
3255
|
};
|
|
3065
3256
|
},
|
|
@@ -3072,7 +3263,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3072
3263
|
e > -1 && r.watcherCallbacks.splice(e, 1);
|
|
3073
3264
|
}
|
|
3074
3265
|
};
|
|
3075
|
-
return
|
|
3266
|
+
return i(n), r ? (r.isDirectory = !1, r.isFile = !0, r.watcherCallbacks = r.watcherCallbacks || [],
|
|
3076
3267
|
r.watcherCallbacks.push(t)) : s.set(e, {
|
|
3077
3268
|
basename: path$2.basename(e),
|
|
3078
3269
|
dirname: path$2.dirname(e),
|
|
@@ -3082,31 +3273,31 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3082
3273
|
data: void 0
|
|
3083
3274
|
}), {
|
|
3084
3275
|
close() {
|
|
3085
|
-
|
|
3276
|
+
o(n), n();
|
|
3086
3277
|
}
|
|
3087
3278
|
};
|
|
3088
3279
|
},
|
|
3089
3280
|
watchTimeout: 32,
|
|
3090
|
-
writeFile: async (e, t) =>
|
|
3091
|
-
writeFileSync:
|
|
3281
|
+
writeFile: async (e, t) => b(e, t),
|
|
3282
|
+
writeFileSync: b,
|
|
3092
3283
|
generateContentHash: async (e, t) => {
|
|
3093
3284
|
const r = await crypto.subtle.digest("SHA-256", (new TextEncoder).encode(e));
|
|
3094
3285
|
let s = Array.from(new Uint8Array(r)).map((e => e.toString(16).padStart(2, "0"))).join("");
|
|
3095
3286
|
return "number" == typeof t && (s = s.slice(0, t)), s;
|
|
3096
3287
|
},
|
|
3097
3288
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
3098
|
-
let r, s = 0, n = !1,
|
|
3289
|
+
let r, s = 0, n = !1, i = !1, o = 0;
|
|
3099
3290
|
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 = () => {
|
|
3100
3291
|
let t = null;
|
|
3101
|
-
const s = e.getCompilerExecutingPath(),
|
|
3102
|
-
name: "stencil.worker." +
|
|
3292
|
+
const s = e.getCompilerExecutingPath(), i = {
|
|
3293
|
+
name: "stencil.worker." + o++
|
|
3103
3294
|
};
|
|
3104
3295
|
try {
|
|
3105
|
-
t = new Worker(s,
|
|
3296
|
+
t = new Worker(s, i);
|
|
3106
3297
|
} catch (e) {
|
|
3107
3298
|
null == r && (r = new Blob([ `importScripts('${s}');` ], {
|
|
3108
3299
|
type: "application/javascript"
|
|
3109
|
-
})), t = new Worker(URL.createObjectURL(r),
|
|
3300
|
+
})), t = new Worker(URL.createObjectURL(r), i);
|
|
3110
3301
|
}
|
|
3111
3302
|
const l = {
|
|
3112
3303
|
worker: t,
|
|
@@ -3135,7 +3326,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3135
3326
|
} else t = p(), c.push(t);
|
|
3136
3327
|
t.activeTasks++, t.sendQueue.push(e);
|
|
3137
3328
|
}, g = () => {
|
|
3138
|
-
|
|
3329
|
+
i = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
3139
3330
|
}, y = (...e) => new Promise(((t, r) => {
|
|
3140
3331
|
if (n) r("task canceled"); else {
|
|
3141
3332
|
const n = {
|
|
@@ -3145,7 +3336,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3145
3336
|
l.push(n), a.set(n.stencilId, {
|
|
3146
3337
|
resolve: t,
|
|
3147
3338
|
reject: r
|
|
3148
|
-
}),
|
|
3339
|
+
}), i || (i = !0, d.then(g));
|
|
3149
3340
|
}
|
|
3150
3341
|
}));
|
|
3151
3342
|
return {
|
|
@@ -3176,11 +3367,11 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3176
3367
|
return C.resolveModuleId = e => ((e, t, r) => {
|
|
3177
3368
|
const s = ((e, t, r) => ({
|
|
3178
3369
|
async isFile(s, n) {
|
|
3179
|
-
const
|
|
3180
|
-
if ((await t.stat(
|
|
3181
|
-
if (shouldFetchModule(
|
|
3182
|
-
const r = getNodeModuleFetchUrl(e, packageVersions,
|
|
3183
|
-
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r,
|
|
3370
|
+
const i = normalizeFsPath(s);
|
|
3371
|
+
if ((await t.stat(i)).isFile) n(null, !0); else {
|
|
3372
|
+
if (shouldFetchModule(i) && r.some((e => i.endsWith(e)))) {
|
|
3373
|
+
const r = getNodeModuleFetchUrl(e, packageVersions, i);
|
|
3374
|
+
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, i));
|
|
3184
3375
|
}
|
|
3185
3376
|
n(null, !1);
|
|
3186
3377
|
}
|
|
@@ -3193,7 +3384,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3193
3384
|
void s(null, !0);
|
|
3194
3385
|
if (isCommonDirModuleFile(n)) return void s(null, !1);
|
|
3195
3386
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
3196
|
-
const
|
|
3387
|
+
const i = getCommonDirUrl(e, packageVersions, n, r), o = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, i, o);
|
|
3197
3388
|
if (isString(a)) return void s(null, !0);
|
|
3198
3389
|
}
|
|
3199
3390
|
}
|
|
@@ -3212,13 +3403,13 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3212
3403
|
}))(e, null, r.exts);
|
|
3213
3404
|
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"),
|
|
3214
3405
|
e)), new Promise(((e, t) => {
|
|
3215
|
-
resolve(r.moduleId, s, ((s, n,
|
|
3406
|
+
resolve(r.moduleId, s, ((s, n, i) => {
|
|
3216
3407
|
if (s) t(s); else {
|
|
3217
3408
|
n = normalizePath(n);
|
|
3218
3409
|
const t = {
|
|
3219
3410
|
moduleId: r.moduleId,
|
|
3220
3411
|
resolveId: n,
|
|
3221
|
-
pkgData:
|
|
3412
|
+
pkgData: i,
|
|
3222
3413
|
pkgDirPath: getPackageDirPath(n, r.moduleId)
|
|
3223
3414
|
};
|
|
3224
3415
|
e(t);
|
|
@@ -3259,7 +3450,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3259
3450
|
t = e;
|
|
3260
3451
|
}
|
|
3261
3452
|
}
|
|
3262
|
-
}), !function
|
|
3453
|
+
}), !function i(e) {
|
|
3263
3454
|
return "diskReads" in e && "diskWrites" in e;
|
|
3264
3455
|
}(r)) throw new Error("could not generate TestingSystem");
|
|
3265
3456
|
return r;
|
|
@@ -3303,13 +3494,13 @@ class EventSpy {
|
|
|
3303
3494
|
}
|
|
3304
3495
|
|
|
3305
3496
|
class E2EElement extends index_cjs.MockHTMLElement {
|
|
3497
|
+
_queueAction(e) {
|
|
3498
|
+
this._queuedActions.push(e);
|
|
3499
|
+
}
|
|
3306
3500
|
constructor(e, t) {
|
|
3307
3501
|
super(null, null), this._page = e, this._elmHandle = t, this._queuedActions = [],
|
|
3308
3502
|
e._e2eElements.push(this);
|
|
3309
3503
|
}
|
|
3310
|
-
_queueAction(e) {
|
|
3311
|
-
this._queuedActions.push(e);
|
|
3312
|
-
}
|
|
3313
3504
|
find(e) {
|
|
3314
3505
|
return find(this._page, this._elmHandle, e);
|
|
3315
3506
|
}
|
|
@@ -3347,7 +3538,7 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3347
3538
|
this._validate();
|
|
3348
3539
|
let e = !1;
|
|
3349
3540
|
try {
|
|
3350
|
-
const t = this._elmHandle
|
|
3541
|
+
const t = getPuppeteerExecution(this._elmHandle);
|
|
3351
3542
|
e = await t.evaluate((e => new Promise((t => {
|
|
3352
3543
|
window.requestAnimationFrame((() => {
|
|
3353
3544
|
if (e.isConnected) {
|
|
@@ -3367,8 +3558,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3367
3558
|
waitForVisible() {
|
|
3368
3559
|
return new Promise(((e, t) => {
|
|
3369
3560
|
const r = setInterval((async () => {
|
|
3370
|
-
await this.isVisible() && (clearInterval(r), clearTimeout(
|
|
3371
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`),
|
|
3561
|
+
await this.isVisible() && (clearInterval(r), clearTimeout(i), e());
|
|
3562
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), i = setTimeout((() => {
|
|
3372
3563
|
clearTimeout(r), t(n);
|
|
3373
3564
|
}), s);
|
|
3374
3565
|
}));
|
|
@@ -3376,8 +3567,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3376
3567
|
waitForNotVisible() {
|
|
3377
3568
|
return new Promise(((e, t) => {
|
|
3378
3569
|
const r = setInterval((async () => {
|
|
3379
|
-
await this.isVisible() || (clearInterval(r), clearTimeout(
|
|
3380
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`),
|
|
3570
|
+
await this.isVisible() || (clearInterval(r), clearTimeout(i), e());
|
|
3571
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), i = setTimeout((() => {
|
|
3381
3572
|
clearTimeout(r), t(n);
|
|
3382
3573
|
}), s);
|
|
3383
3574
|
}));
|
|
@@ -3396,7 +3587,7 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3396
3587
|
}
|
|
3397
3588
|
async getProperty(e) {
|
|
3398
3589
|
this._validate();
|
|
3399
|
-
const t = this._elmHandle
|
|
3590
|
+
const t = getPuppeteerExecution(this._elmHandle);
|
|
3400
3591
|
return await t.evaluate(((e, t) => e[t]), this._elmHandle, e);
|
|
3401
3592
|
}
|
|
3402
3593
|
setProperty(e, t) {
|
|
@@ -3553,7 +3744,7 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3553
3744
|
}
|
|
3554
3745
|
async e2eRunActions() {
|
|
3555
3746
|
if (0 === this._queuedActions.length) return;
|
|
3556
|
-
const e = this._elmHandle
|
|
3747
|
+
const e = getPuppeteerExecution(this._elmHandle), t = await e.evaluate(((e, t) => e.componentOnReady().then((() => {
|
|
3557
3748
|
let r = null;
|
|
3558
3749
|
return t.forEach((t => {
|
|
3559
3750
|
if (t.methodName) r = e[t.methodName].apply(e, t.methodArgs); else if (t.setPropertyName) e[t.setPropertyName] = t.setPropertyValue; else if (t.setAttributeName) e.setAttribute(t.setAttributeName, t.setAttributeValue); else if (t.removeAttribute) e.removeAttribute(t.removeAttribute); else if (t.toggleAttributeName) "boolean" == typeof t.toggleAttributeForce ? e.toggleAttribute(t.toggleAttributeName, t.toggleAttributeForce) : e.toggleAttribute(t.toggleAttributeName); else if (t.classAdd) e.classList.add(t.classAdd); else if (t.classRemove) e.classList.remove(t.classRemove); else if (t.classToggle) e.classList.toggle(t.classToggle); else if (t.eventName) {
|
|
@@ -3568,7 +3759,7 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3568
3759
|
return this._queuedActions.length = 0, t;
|
|
3569
3760
|
}
|
|
3570
3761
|
async e2eSync() {
|
|
3571
|
-
const e = this._elmHandle
|
|
3762
|
+
const e = getPuppeteerExecution(this._elmHandle), {outerHTML: t, shadowRootHTML: r} = await e.evaluate((e => ({
|
|
3572
3763
|
outerHTML: e.outerHTML,
|
|
3573
3764
|
shadowRootHTML: e.shadowRoot ? e.shadowRoot.innerHTML : null
|
|
3574
3765
|
})), this._elmHandle);
|
|
@@ -3636,15 +3827,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3636
3827
|
var e;
|
|
3637
3828
|
const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
|
|
3638
3829
|
return class r extends t {
|
|
3639
|
-
async runTests(e, t, r, s, n,
|
|
3640
|
-
const
|
|
3830
|
+
async runTests(e, t, r, s, n, i) {
|
|
3831
|
+
const o = process.env;
|
|
3641
3832
|
if (e = e.filter((e => function t(e, r) {
|
|
3642
3833
|
const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
|
|
3643
3834
|
return !("true" !== r.__STENCIL_E2E_TESTS__ || !s) || "true" === r.__STENCIL_SPEC_TESTS__ && !s;
|
|
3644
|
-
}(e.path,
|
|
3645
|
-
const a = JSON.parse(
|
|
3646
|
-
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l],
|
|
3647
|
-
} else await super.runTests(e, t, r, s, n,
|
|
3835
|
+
}(e.path, o))), "true" === o.__STENCIL_SCREENSHOT__) {
|
|
3836
|
+
const a = JSON.parse(o.__STENCIL_EMULATE_CONFIGS__);
|
|
3837
|
+
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], o), await super.runTests(e, t, r, s, n, i);
|
|
3838
|
+
} else await super.runTests(e, t, r, s, n, i);
|
|
3648
3839
|
}
|
|
3649
3840
|
};
|
|
3650
3841
|
}, exports.createTesting = async e => {
|
|
@@ -3656,14 +3847,14 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3656
3847
|
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3657
3848
|
}(e);
|
|
3658
3849
|
const {createCompiler: r} = require("../compiler/stencil.js"), s = await r(e);
|
|
3659
|
-
let n,
|
|
3660
|
-
const
|
|
3850
|
+
let n, i;
|
|
3851
|
+
const o = async () => {
|
|
3661
3852
|
const t = [];
|
|
3662
3853
|
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), n && (n.close && t.push(n.close()),
|
|
3663
|
-
n = null),
|
|
3854
|
+
n = null), i && (i.close && t.push(i.close()), i = null), await Promise.all(t);
|
|
3664
3855
|
};
|
|
3665
3856
|
return {
|
|
3666
|
-
destroy:
|
|
3857
|
+
destroy: o,
|
|
3667
3858
|
run: async (t = {}) => {
|
|
3668
3859
|
let r, a = !1, l = !1, c = null;
|
|
3669
3860
|
const u = [];
|
|
@@ -3686,9 +3877,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3686
3877
|
})), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3687
3878
|
e.devServer.reloadStrategy = null;
|
|
3688
3879
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3689
|
-
if (n = l[0],
|
|
3880
|
+
if (n = l[0], i = l[1], t) {
|
|
3690
3881
|
const r = await t;
|
|
3691
|
-
if (!r || !e.watch && hasError(r && r.diagnostics)) return await
|
|
3882
|
+
if (!r || !e.watch && hasError(r && r.diagnostics)) return await o(), !1;
|
|
3692
3883
|
}
|
|
3693
3884
|
n && (r.__STENCIL_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__STENCIL_BROWSER_URL__}`),
|
|
3694
3885
|
r.__STENCIL_APP_SCRIPT_URL__ = function d(e, t) {
|
|
@@ -3722,13 +3913,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3722
3913
|
waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
|
|
3723
3914
|
pixelmatchModulePath: s
|
|
3724
3915
|
}), e.flags.updateScreenshot || await r.pullMasterBuild(), n.finish("screenshot, initBuild finished");
|
|
3725
|
-
const
|
|
3726
|
-
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(
|
|
3916
|
+
const i = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), o = i[0], a = i[1];
|
|
3917
|
+
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(o, a);
|
|
3727
3918
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3728
3919
|
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3729
3920
|
try {
|
|
3730
3921
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3731
|
-
let s = await r.completeBuild(
|
|
3922
|
+
let s = await r.completeBuild(o);
|
|
3732
3923
|
if (t.finish("screenshot, completeTimespan finished"), s) {
|
|
3733
3924
|
const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
|
|
3734
3925
|
if (s = await r.publishBuild(s), t.finish("screenshot, publishBuild finished"),
|
|
@@ -3862,19 +4053,19 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3862
4053
|
const t = process.env;
|
|
3863
4054
|
"true" === t.__STENCIL_SCREENSHOT__ ? e.compareScreenshot = (r, s) => {
|
|
3864
4055
|
const n = global;
|
|
3865
|
-
let
|
|
3866
|
-
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (
|
|
3867
|
-
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (
|
|
3868
|
-
"object" == typeof s && (
|
|
3869
|
-
|
|
3870
|
-
if (n.screenshotDescriptions.has(
|
|
3871
|
-
return n.screenshotDescriptions.add(
|
|
4056
|
+
let i, o = "", a = "";
|
|
4057
|
+
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (o = n.currentSpec.fullName),
|
|
4058
|
+
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (o.length > 0 ? o += ", " + r : o = r,
|
|
4059
|
+
"object" == typeof s && (i = s)) : "object" == typeof r && (i = r), o = o.trim(),
|
|
4060
|
+
i = i || {}, !o) throw new Error(`Invalid screenshot description in "${a}"`);
|
|
4061
|
+
if (n.screenshotDescriptions.has(o)) throw new Error(`Screenshot description "${o}" found in "${a}" cannot be used for multiple screenshots and must be unique. To make screenshot descriptions unique within the same test, use the first argument to "compareScreenshot", such as "compareScreenshot('more to the description')".`);
|
|
4062
|
+
return n.screenshotDescriptions.add(o), async function l(e, t, r, s, n) {
|
|
3872
4063
|
if ("string" != typeof t.__STENCIL_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
|
|
3873
4064
|
if ("string" != typeof t.__STENCIL_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
3874
|
-
const
|
|
4065
|
+
const i = JSON.parse(t.__STENCIL_EMULATE__), o = JSON.parse(t.__STENCIL_SCREENSHOT_BUILD__);
|
|
3875
4066
|
await function a(e) {
|
|
3876
4067
|
return new Promise((t => setTimeout(t, e)));
|
|
3877
|
-
}(
|
|
4068
|
+
}(o.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
|
|
3878
4069
|
window.requestAnimationFrame((() => {
|
|
3879
4070
|
e();
|
|
3880
4071
|
}));
|
|
@@ -3892,11 +4083,11 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3892
4083
|
width: e.clip.width,
|
|
3893
4084
|
height: e.clip.height
|
|
3894
4085
|
}), t;
|
|
3895
|
-
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold :
|
|
3896
|
-
let h =
|
|
4086
|
+
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : o.pixelmatchThreshold;
|
|
4087
|
+
let h = i.viewport.width, p = i.viewport.height;
|
|
3897
4088
|
return n && n.clip && ("number" == typeof n.clip.width && (h = n.clip.width), "number" == typeof n.clip.height && (p = n.clip.height)),
|
|
3898
|
-
await compareScreenshot(
|
|
3899
|
-
}(e, t,
|
|
4089
|
+
await compareScreenshot(i, o, u, r, h, p, s, d);
|
|
4090
|
+
}(e, t, o, a, i);
|
|
3900
4091
|
} : e.compareScreenshot = async () => ({
|
|
3901
4092
|
mismatchedPixels: 0,
|
|
3902
4093
|
allowableMismatchedPixels: 1,
|
|
@@ -3944,13 +4135,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3944
4135
|
e();
|
|
3945
4136
|
}))));
|
|
3946
4137
|
};
|
|
3947
|
-
const
|
|
4138
|
+
const i = !0 === e.failOnConsoleError, o = !0 === e.failOnNetworkError;
|
|
3948
4139
|
t.on("console", (e => {
|
|
3949
4140
|
if ("error" === e.type() && (r.push({
|
|
3950
4141
|
type: "error",
|
|
3951
4142
|
message: e.text(),
|
|
3952
4143
|
location: e.location().url
|
|
3953
|
-
}),
|
|
4144
|
+
}), i)) throw new Error(serializeConsoleMessage(e));
|
|
3954
4145
|
!function t(e) {
|
|
3955
4146
|
const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
|
|
3956
4147
|
"debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
|
|
@@ -3966,7 +4157,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3966
4157
|
type: "requestfailed",
|
|
3967
4158
|
message: e.failure().errorText,
|
|
3968
4159
|
location: e.url()
|
|
3969
|
-
}),
|
|
4160
|
+
}), o) throw new Error(e.failure().errorText);
|
|
3970
4161
|
console.error("requestfailed", e.url());
|
|
3971
4162
|
})), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
|
|
3972
4163
|
waitUntil: e.waitUntil
|
|
@@ -3999,7 +4190,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3999
4190
|
}, n = e.components.map((e => {
|
|
4000
4191
|
if (null == e.COMPILER_META) throw new Error('Invalid component class: Missing static "COMPILER_META" property.');
|
|
4001
4192
|
t.add(e.COMPILER_META.tagName), e.isProxied = !1, function r(e) {
|
|
4002
|
-
var t, r, s, n,
|
|
4193
|
+
var t, r, s, n, i, o;
|
|
4003
4194
|
"function" == typeof (null === (t = e.prototype) || void 0 === t ? void 0 : t.__componentWillLoad) && (e.prototype.componentWillLoad = e.prototype.__componentWillLoad,
|
|
4004
4195
|
e.prototype.__componentWillLoad = null), "function" == typeof (null === (r = e.prototype) || void 0 === r ? void 0 : r.__componentWillUpdate) && (e.prototype.componentWillUpdate = e.prototype.__componentWillUpdate,
|
|
4005
4196
|
e.prototype.__componentWillUpdate = null), "function" == typeof (null === (s = e.prototype) || void 0 === s ? void 0 : s.__componentWillRender) && (e.prototype.componentWillRender = e.prototype.__componentWillRender,
|
|
@@ -4008,12 +4199,12 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4008
4199
|
const e = this.__componentWillLoad();
|
|
4009
4200
|
return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
|
|
4010
4201
|
e;
|
|
4011
|
-
}), "function" == typeof (null === (
|
|
4202
|
+
}), "function" == typeof (null === (i = e.prototype) || void 0 === i ? void 0 : i.componentWillUpdate) && (e.prototype.__componentWillUpdate = e.prototype.componentWillUpdate,
|
|
4012
4203
|
e.prototype.componentWillUpdate = function() {
|
|
4013
4204
|
const e = this.__componentWillUpdate();
|
|
4014
4205
|
return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
|
|
4015
4206
|
e;
|
|
4016
|
-
}), "function" == typeof (null === (
|
|
4207
|
+
}), "function" == typeof (null === (o = e.prototype) || void 0 === o ? void 0 : o.componentWillRender) && (e.prototype.__componentWillRender = e.prototype.componentWillRender,
|
|
4017
4208
|
e.prototype.componentWillRender = function() {
|
|
4018
4209
|
const e = this.__componentWillRender();
|
|
4019
4210
|
return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
|
|
@@ -4027,14 +4218,16 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4027
4218
|
t[e.modeName] = e.styleStr;
|
|
4028
4219
|
})), e.style = t;
|
|
4029
4220
|
} else 1 === n.length && (e.style = n[0].styleStr);
|
|
4030
|
-
|
|
4221
|
+
testing.registerModule(s, e);
|
|
4222
|
+
const i = ((e, t) => [ e, t.map((e => ((e, t) => {
|
|
4031
4223
|
let r = 0;
|
|
4032
4224
|
"shadow" === e.encapsulation ? (r |= 1, e.shadowDelegatesFocus && (r |= 16)) : "scoped" === e.encapsulation && (r |= 2),
|
|
4033
4225
|
"shadow" !== e.encapsulation && e.htmlTagNames.includes("slot") && (r |= 4), e.hasMode && (r |= 32);
|
|
4034
4226
|
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
4035
4227
|
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
4036
4228
|
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
4037
|
-
|
|
4229
|
+
return i;
|
|
4230
|
+
})), i = (e => {
|
|
4038
4231
|
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 = {
|
|
4039
4232
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
4040
4233
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
@@ -4094,8 +4287,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4094
4287
|
return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
|
|
4095
4288
|
n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
|
|
4096
4289
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4097
|
-
if (e.strictBuild ? Object.assign(appData.BUILD,
|
|
4098
|
-
!0 ===
|
|
4290
|
+
if (e.strictBuild ? Object.assign(appData.BUILD, i) : Object.keys(i).forEach((e => {
|
|
4291
|
+
!0 === i[e] && (appData.BUILD[e] = !0);
|
|
4099
4292
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4100
4293
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4101
4294
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
@@ -4125,10 +4318,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4125
4318
|
testing.renderVdom(t, e.template());
|
|
4126
4319
|
} else "string" == typeof e.html && (s.body.innerHTML = e.html);
|
|
4127
4320
|
!1 !== e.flushQueue && await s.waitForChanges();
|
|
4128
|
-
let
|
|
4321
|
+
let o = null;
|
|
4129
4322
|
return Object.defineProperty(s, "root", {
|
|
4130
4323
|
get() {
|
|
4131
|
-
if (null ==
|
|
4324
|
+
if (null == o && (o = findRootComponent(t, s.body)), null != o) return o;
|
|
4132
4325
|
const e = s.body.firstElementChild;
|
|
4133
4326
|
return null != e ? e : null;
|
|
4134
4327
|
}
|