@stencil/core 2.11.0-0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.cjs +20 -4
- package/cli/index.js +20 -4
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +211 -483
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +1 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +1 -1
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +11 -7
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +2 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-public-compiler.d.ts +1 -1
- package/internal/stencil-public-runtime.d.ts +6 -4
- package/internal/testing/index.js +15 -13
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +20 -2
- package/mock-doc/index.d.ts +1 -0
- package/mock-doc/index.js +20 -2
- package/mock-doc/package.json +1 -1
- package/package.json +6 -6
- package/readme.md +52 -85
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +2 -2
- package/sys/node/index.js +17 -16
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +419 -390
- package/testing/jest/jest-config.d.ts +11 -0
- package/testing/jest/jest-environment.d.ts +1 -0
- package/testing/jest/jest-preprocessor.d.ts +56 -8
- package/testing/jest/jest-runner.d.ts +4 -0
- package/testing/jest-preset.js +5 -0
- package/testing/package.json +1 -1
package/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Testing v2.
|
|
2
|
+
Stencil Testing v2.13.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
function _lazyRequire(e) {
|
|
5
5
|
return new Proxy({}, {
|
|
@@ -45,28 +45,28 @@ async function startPuppeteerBrowser(e) {
|
|
|
45
45
|
Array.isArray(e.testing.browserArgs) && e.logger.debug(`puppeteer args: ${e.testing.browserArgs.join(" ")}`),
|
|
46
46
|
"boolean" == typeof e.testing.browserDevtools && e.logger.debug(`puppeteer devtools: ${e.testing.browserDevtools}`),
|
|
47
47
|
"number" == typeof e.testing.browserSlowMo && e.logger.debug(`puppeteer slowMo: ${e.testing.browserSlowMo}`);
|
|
48
|
-
const
|
|
48
|
+
const o = {
|
|
49
49
|
ignoreHTTPSErrors: !0,
|
|
50
50
|
slowMo: e.testing.browserSlowMo
|
|
51
51
|
};
|
|
52
|
-
let
|
|
53
|
-
if (e.testing.browserWSEndpoint)
|
|
52
|
+
let i;
|
|
53
|
+
if (e.testing.browserWSEndpoint) i = await n.connect({
|
|
54
54
|
browserWSEndpoint: e.testing.browserWSEndpoint,
|
|
55
|
-
...
|
|
55
|
+
...o
|
|
56
56
|
}); else {
|
|
57
57
|
const t = {
|
|
58
58
|
args: e.testing.browserArgs,
|
|
59
59
|
headless: e.testing.browserHeadless,
|
|
60
60
|
devtools: e.testing.browserDevtools,
|
|
61
|
-
...
|
|
61
|
+
...o
|
|
62
62
|
};
|
|
63
63
|
e.testing.browserExecutablePath && (t.executablePath = e.testing.browserExecutablePath),
|
|
64
|
-
|
|
64
|
+
i = await n.launch({
|
|
65
65
|
...t
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
return t.__STENCIL_BROWSER_WS_ENDPOINT__ =
|
|
69
|
-
|
|
68
|
+
return t.__STENCIL_BROWSER_WS_ENDPOINT__ = i.wsEndpoint(), e.logger.debug(`puppeteer browser wsEndpoint: ${t.__STENCIL_BROWSER_WS_ENDPOINT__}`),
|
|
69
|
+
i;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
function getAppStyleUrl(e, t) {
|
|
@@ -76,13 +76,13 @@ function getAppStyleUrl(e, t) {
|
|
|
76
76
|
function getAppUrl(e, t, r) {
|
|
77
77
|
const s = e.outputTargets.find(isOutputTargetWww);
|
|
78
78
|
if (s) {
|
|
79
|
-
const e = s.buildDir, n = path$2.join(e, r),
|
|
80
|
-
return new URL(
|
|
79
|
+
const e = s.buildDir, n = path$2.join(e, r), o = path$2.relative(s.dir, n);
|
|
80
|
+
return new URL(o, t).href;
|
|
81
81
|
}
|
|
82
82
|
const n = e.outputTargets.find(isOutputTargetDistLazy);
|
|
83
83
|
if (n) {
|
|
84
|
-
const s = n.esmDir,
|
|
85
|
-
return new URL(
|
|
84
|
+
const s = n.esmDir, o = path$2.join(s, r), i = path$2.relative(e.rootDir, o);
|
|
85
|
+
return new URL(i, t).href;
|
|
86
86
|
}
|
|
87
87
|
return t;
|
|
88
88
|
}
|
|
@@ -133,8 +133,28 @@ async function runJest(e, t) {
|
|
|
133
133
|
const t = require("yargs"), r = [ ...e.flags.unknownArgs.slice(), ...e.flags.knownArgs.slice() ];
|
|
134
134
|
r.some((e => e.startsWith("--max-workers") || e.startsWith("--maxWorkers"))) || r.push(`--max-workers=${e.maxConcurrentWorkers}`),
|
|
135
135
|
e.flags.devtools && r.push("--runInBand"), e.logger.info(e.logger.magenta(`jest args: ${r.join(" ")}`));
|
|
136
|
-
|
|
137
|
-
if (
|
|
136
|
+
let s = t(r).argv;
|
|
137
|
+
if (s = {
|
|
138
|
+
...s,
|
|
139
|
+
detectLeaks: !1,
|
|
140
|
+
"detect-leaks": !1,
|
|
141
|
+
detectOpenHandles: !1,
|
|
142
|
+
"detect-open-handles": !1,
|
|
143
|
+
errorOnDeprecated: !1,
|
|
144
|
+
"error-on-deprecated": !1,
|
|
145
|
+
listTests: !1,
|
|
146
|
+
"list-tests": !1,
|
|
147
|
+
maxConcurrency: 5,
|
|
148
|
+
"max-concurrency": 5,
|
|
149
|
+
notifyMode: "failure-change",
|
|
150
|
+
"notify-mode": "failure-change",
|
|
151
|
+
passWithNoTests: !1,
|
|
152
|
+
"pass-with-no-tests": !1,
|
|
153
|
+
runTestsByPath: !1,
|
|
154
|
+
"run-tests-by-path": !1,
|
|
155
|
+
testLocationInResults: !1,
|
|
156
|
+
"test-location-in-results": !1
|
|
157
|
+
}, s.config = function n(e) {
|
|
138
158
|
const t = e.testing, r = require("jest-config").defaults, s = Object.keys(r), n = {};
|
|
139
159
|
return Object.keys(t).forEach((e => {
|
|
140
160
|
s.includes(e) && (n[e] = t[e]);
|
|
@@ -145,16 +165,16 @@ async function runJest(e, t) {
|
|
|
145
165
|
isString(t.preset) && (n.preset = t.preset), t.projects && (n.projects = t.projects),
|
|
146
166
|
Array.isArray(t.reporters) && (n.reporters = t.reporters), isString(t.testResultsProcessor) && (n.testResultsProcessor = t.testResultsProcessor),
|
|
147
167
|
t.transform && (n.transform = t.transform), t.verbose && (n.verbose = t.verbose),
|
|
148
|
-
JSON.stringify(n);
|
|
149
|
-
}(e), "string" == typeof
|
|
150
|
-
|
|
168
|
+
n.testRunner = "jest-jasmine2", JSON.stringify(n);
|
|
169
|
+
}(e), "string" == typeof s.maxWorkers) try {
|
|
170
|
+
s.maxWorkers = parseInt(s.maxWorkers, 10);
|
|
151
171
|
} catch (e) {}
|
|
152
|
-
return "string" == typeof
|
|
153
|
-
}(e),
|
|
172
|
+
return "string" == typeof s.ci && (s.ci = "true" === s.ci || "" === s.ci), s;
|
|
173
|
+
}(e), o = function o(e, t) {
|
|
154
174
|
const r = t.projects ? t.projects : [];
|
|
155
175
|
return r.push(e.rootDir), r;
|
|
156
|
-
}(e, n), {runCLI:
|
|
157
|
-
r = !!(await
|
|
176
|
+
}(e, n), {runCLI: i} = require("@jest/core");
|
|
177
|
+
r = !!(await i(n, o)).results.success;
|
|
158
178
|
} catch (t) {
|
|
159
179
|
e.logger.error(`runJest: ${t}`);
|
|
160
180
|
}
|
|
@@ -205,6 +225,64 @@ function formatDiagnostic(e) {
|
|
|
205
225
|
t;
|
|
206
226
|
}
|
|
207
227
|
|
|
228
|
+
function getCompilerOptions(e) {
|
|
229
|
+
if (_tsCompilerOptions) return _tsCompilerOptions;
|
|
230
|
+
if ("string" != typeof e) return null;
|
|
231
|
+
e = normalizePath(e);
|
|
232
|
+
const t = stencil_js.ts.findConfigFile(e, stencil_js.ts.sys.fileExists);
|
|
233
|
+
if (!t) return null;
|
|
234
|
+
const r = stencil_js.ts.readConfigFile(t, stencil_js.ts.sys.readFile);
|
|
235
|
+
if (r.error) throw new Error(formatDiagnostic((e => {
|
|
236
|
+
const t = {
|
|
237
|
+
level: "warn",
|
|
238
|
+
type: "typescript",
|
|
239
|
+
language: "typescript",
|
|
240
|
+
header: "TypeScript",
|
|
241
|
+
code: e.code.toString(),
|
|
242
|
+
messageText: flattenDiagnosticMessageText(e, e.messageText),
|
|
243
|
+
relFilePath: null,
|
|
244
|
+
absFilePath: null,
|
|
245
|
+
lines: []
|
|
246
|
+
};
|
|
247
|
+
if (1 === e.category && (t.level = "error"), e.file) {
|
|
248
|
+
t.absFilePath = e.file.fileName;
|
|
249
|
+
const s = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), n = e.file.getLineAndCharacterOfPosition(e.start), o = {
|
|
250
|
+
lineIndex: n.line,
|
|
251
|
+
lineNumber: n.line + 1,
|
|
252
|
+
text: s[n.line],
|
|
253
|
+
errorCharStart: n.character,
|
|
254
|
+
errorLength: Math.max(e.length, 1)
|
|
255
|
+
};
|
|
256
|
+
if (t.lineNumber = o.lineNumber, t.columnNumber = o.errorCharStart + 1, t.lines.push(o),
|
|
257
|
+
0 === o.errorLength && o.errorCharStart > 0 && (o.errorLength = 1, o.errorCharStart--),
|
|
258
|
+
o.lineIndex > 0) {
|
|
259
|
+
const e = {
|
|
260
|
+
lineIndex: o.lineIndex - 1,
|
|
261
|
+
lineNumber: o.lineNumber - 1,
|
|
262
|
+
text: s[o.lineIndex - 1],
|
|
263
|
+
errorCharStart: -1,
|
|
264
|
+
errorLength: -1
|
|
265
|
+
};
|
|
266
|
+
t.lines.unshift(e);
|
|
267
|
+
}
|
|
268
|
+
if (o.lineIndex + 1 < s.length) {
|
|
269
|
+
const e = {
|
|
270
|
+
lineIndex: o.lineIndex + 1,
|
|
271
|
+
lineNumber: o.lineNumber + 1,
|
|
272
|
+
text: s[o.lineIndex + 1],
|
|
273
|
+
errorCharStart: -1,
|
|
274
|
+
errorLength: -1
|
|
275
|
+
};
|
|
276
|
+
t.lines.push(e);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
var r;
|
|
280
|
+
return t;
|
|
281
|
+
})(r.error)));
|
|
282
|
+
const s = stencil_js.ts.parseJsonConfigFileContent(r.config, stencil_js.ts.sys, e, void 0, t);
|
|
283
|
+
return _tsCompilerOptions = s.options, _tsCompilerOptions;
|
|
284
|
+
}
|
|
285
|
+
|
|
208
286
|
function compareHtml(e, t, r) {
|
|
209
287
|
if (null == e) throw new Error(`expect toEqualHtml() value is "${e}"`);
|
|
210
288
|
if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
|
|
@@ -235,11 +313,11 @@ function compareHtml(e, t, r) {
|
|
|
235
313
|
});
|
|
236
314
|
}
|
|
237
315
|
}
|
|
238
|
-
const
|
|
316
|
+
const o = index_cjs.parseHtmlToFragment(t), i = index_cjs.serializeNodeToHtml(o, {
|
|
239
317
|
prettyHtml: !0,
|
|
240
318
|
excludeTags: [ "body" ]
|
|
241
319
|
});
|
|
242
|
-
return s !==
|
|
320
|
+
return s !== i ? (expect(s).toBe(i), {
|
|
243
321
|
message: () => "HTML does not match",
|
|
244
322
|
pass: !1
|
|
245
323
|
}) : {
|
|
@@ -310,7 +388,7 @@ function assertPath(e) {
|
|
|
310
388
|
}
|
|
311
389
|
|
|
312
390
|
function normalizeStringPosix(e, t) {
|
|
313
|
-
var r, s, n,
|
|
391
|
+
var r, s, n, o = "", i = 0, a = -1, l = 0;
|
|
314
392
|
for (s = 0; s <= e.length; ++s) {
|
|
315
393
|
if (s < e.length) r = e.charCodeAt(s); else {
|
|
316
394
|
if (47 === r) break;
|
|
@@ -318,27 +396,27 @@ function normalizeStringPosix(e, t) {
|
|
|
318
396
|
}
|
|
319
397
|
if (47 === r) {
|
|
320
398
|
if (a === s - 1 || 1 === l) ; else if (a !== s - 1 && 2 === l) {
|
|
321
|
-
if (
|
|
322
|
-
if ((n =
|
|
323
|
-
-1 === n ? (
|
|
399
|
+
if (o.length < 2 || 2 !== i || 46 !== o.charCodeAt(o.length - 1) || 46 !== o.charCodeAt(o.length - 2)) if (o.length > 2) {
|
|
400
|
+
if ((n = o.lastIndexOf("/")) !== o.length - 1) {
|
|
401
|
+
-1 === n ? (o = "", i = 0) : i = (o = o.slice(0, n)).length - 1 - o.lastIndexOf("/"),
|
|
324
402
|
a = s, l = 0;
|
|
325
403
|
continue;
|
|
326
404
|
}
|
|
327
|
-
} else if (2 ===
|
|
328
|
-
|
|
405
|
+
} else if (2 === o.length || 1 === o.length) {
|
|
406
|
+
o = "", i = 0, a = s, l = 0;
|
|
329
407
|
continue;
|
|
330
408
|
}
|
|
331
|
-
t && (
|
|
332
|
-
} else
|
|
409
|
+
t && (o.length > 0 ? o += "/.." : o = "..", i = 2);
|
|
410
|
+
} else o.length > 0 ? o += "/" + e.slice(a + 1, s) : o = e.slice(a + 1, s), i = s - a - 1;
|
|
333
411
|
a = s, l = 0;
|
|
334
412
|
} else 46 === r && -1 !== l ? ++l : l = -1;
|
|
335
413
|
}
|
|
336
|
-
return
|
|
414
|
+
return o;
|
|
337
415
|
}
|
|
338
416
|
|
|
339
417
|
function specifierIncluded$1(e, t) {
|
|
340
|
-
var r, s, n,
|
|
341
|
-
for (r = 0; r < 3; ++r) if ((s = parseInt(
|
|
418
|
+
var r, s, n, o = e.split("."), i = t.split(" "), a = i.length > 1 ? i[0] : "=", l = (i.length > 1 ? i[1] : i[0]).split(".");
|
|
419
|
+
for (r = 0; r < 3; ++r) if ((s = parseInt(o[r] || 0, 10)) !== (n = parseInt(l[r] || 0, 10))) return "<" === a ? s < n : ">=" === a && s >= n;
|
|
342
420
|
return ">=" === a;
|
|
343
421
|
}
|
|
344
422
|
|
|
@@ -350,9 +428,9 @@ function matchesRange$1(e, t) {
|
|
|
350
428
|
}
|
|
351
429
|
|
|
352
430
|
function specifierIncluded(e) {
|
|
353
|
-
var t, r, s, n = e.split(" "),
|
|
354
|
-
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(
|
|
355
|
-
return ">=" ===
|
|
431
|
+
var t, r, s, n = e.split(" "), o = n.length > 1 ? n[0] : "=", i = (n.length > 1 ? n[1] : n[0]).split(".");
|
|
432
|
+
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(i[t] || 0, 10))) return "<" === o ? r < s : ">=" === o && r >= s;
|
|
433
|
+
return ">=" === o;
|
|
356
434
|
}
|
|
357
435
|
|
|
358
436
|
function matchesRange(e) {
|
|
@@ -461,23 +539,23 @@ function mockCompilerCtx(e) {
|
|
|
461
539
|
if (!0 === r.inMemoryOnly) {
|
|
462
540
|
let n = e;
|
|
463
541
|
n.endsWith("/") || (n += "/");
|
|
464
|
-
const
|
|
542
|
+
const o = e.split("/");
|
|
465
543
|
t.forEach(((t, n) => {
|
|
466
544
|
if (!n.startsWith(e)) return;
|
|
467
545
|
const a = n.split("/");
|
|
468
|
-
if ((a.length ===
|
|
546
|
+
if ((a.length === o.length + 1 || r.recursive && a.length > o.length) && t.exists) {
|
|
469
547
|
const e = {
|
|
470
548
|
absPath: n,
|
|
471
|
-
relPath: a[
|
|
549
|
+
relPath: a[o.length],
|
|
472
550
|
isDirectory: t.isDirectory,
|
|
473
551
|
isFile: t.isFile
|
|
474
552
|
};
|
|
475
|
-
|
|
553
|
+
i(r, e) || s.push(e);
|
|
476
554
|
}
|
|
477
555
|
}));
|
|
478
|
-
} else await
|
|
556
|
+
} else await o(e, e, r, s);
|
|
479
557
|
return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
|
|
480
|
-
},
|
|
558
|
+
}, o = async (t, r, s, n) => {
|
|
481
559
|
const a = await e.readDir(r);
|
|
482
560
|
if (a.length > 0) {
|
|
483
561
|
const e = b(r);
|
|
@@ -488,10 +566,10 @@ function mockCompilerCtx(e) {
|
|
|
488
566
|
isDirectory: l.isDirectory,
|
|
489
567
|
isFile: l.isFile
|
|
490
568
|
};
|
|
491
|
-
|
|
569
|
+
i(s, u) || (n.push(u), !0 === s.recursive && !0 === l.isDirectory && await o(t, r, s, n));
|
|
492
570
|
})));
|
|
493
571
|
}
|
|
494
|
-
},
|
|
572
|
+
}, i = (e, t) => {
|
|
495
573
|
if (t.isDirectory) {
|
|
496
574
|
if (Array.isArray(e.excludeDirNames)) {
|
|
497
575
|
const r = path$2.basename(t.absPath);
|
|
@@ -544,26 +622,26 @@ function mockCompilerCtx(e) {
|
|
|
544
622
|
}, d = async (t, s, n) => {
|
|
545
623
|
if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
|
|
546
624
|
if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
|
|
547
|
-
const
|
|
625
|
+
const o = {
|
|
548
626
|
ignored: !1,
|
|
549
627
|
changedContent: !1,
|
|
550
628
|
queuedWrite: !1
|
|
551
629
|
};
|
|
552
|
-
if (!0 === shouldIgnore(t)) return
|
|
553
|
-
const
|
|
554
|
-
if (
|
|
555
|
-
"string" == typeof
|
|
556
|
-
|
|
557
|
-
!1 === n.useCache && (
|
|
630
|
+
if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
|
|
631
|
+
const i = b(t);
|
|
632
|
+
if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
|
|
633
|
+
"string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : o.changedContent = !0,
|
|
634
|
+
i.fileText = s, o.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
|
|
635
|
+
!1 === n.useCache && (i.useCache = !1)), null != n && !0 === n.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
|
|
558
636
|
await h(t, !0); else if (null != n && !0 === n.immediateWrite) {
|
|
559
|
-
if (
|
|
637
|
+
if (o.changedContent || !0 !== n.useCache) {
|
|
560
638
|
const r = await e.readFile(t);
|
|
561
|
-
"string" == typeof r && (
|
|
562
|
-
|
|
639
|
+
"string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
|
|
640
|
+
o.changedContent && (await h(t, !1), await e.writeFile(t, i.fileText));
|
|
563
641
|
}
|
|
564
|
-
} else
|
|
565
|
-
|
|
566
|
-
return
|
|
642
|
+
} else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
|
|
643
|
+
o.queuedWrite = !0);
|
|
644
|
+
return o;
|
|
567
645
|
}, h = async (e, t) => {
|
|
568
646
|
const r = [];
|
|
569
647
|
for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
|
|
@@ -646,12 +724,12 @@ function mockCompilerCtx(e) {
|
|
|
646
724
|
clearDirCache: _,
|
|
647
725
|
clearFileCache: v,
|
|
648
726
|
commit: async () => {
|
|
649
|
-
const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy),
|
|
727
|
+
const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy), o = await y(e.filesToDelete), i = await w(e.dirsToDelete);
|
|
650
728
|
return e.filesToDelete.forEach(v), e.dirsToDelete.forEach(_), {
|
|
651
729
|
filesCopied: n,
|
|
652
730
|
filesWritten: s,
|
|
653
|
-
filesDeleted:
|
|
654
|
-
dirsDeleted:
|
|
731
|
+
filesDeleted: o,
|
|
732
|
+
dirsDeleted: i,
|
|
655
733
|
dirsAdded: r
|
|
656
734
|
};
|
|
657
735
|
},
|
|
@@ -761,19 +839,19 @@ async function initPageEvents(e) {
|
|
|
761
839
|
}
|
|
762
840
|
|
|
763
841
|
async function pageSpyOnEvent(e, t, r) {
|
|
764
|
-
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document,
|
|
765
|
-
return await addE2EListener(e,
|
|
842
|
+
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, o = await e.evaluateHandle(n);
|
|
843
|
+
return await addE2EListener(e, o, t, (e => {
|
|
766
844
|
s.push(e);
|
|
767
845
|
})), s;
|
|
768
846
|
}
|
|
769
847
|
|
|
770
848
|
async function waitForEvent(e, t, r) {
|
|
771
849
|
const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate(((e, t, r) => new Promise(((s, n) => {
|
|
772
|
-
const
|
|
850
|
+
const o = setTimeout((() => {
|
|
773
851
|
n(new Error(`waitForEvent() timeout, eventName: ${t}`));
|
|
774
852
|
}), r);
|
|
775
853
|
e.addEventListener(t, (e => {
|
|
776
|
-
clearTimeout(
|
|
854
|
+
clearTimeout(o), s(window.stencilSerializeEvent(e));
|
|
777
855
|
}), {
|
|
778
856
|
once: !0
|
|
779
857
|
});
|
|
@@ -787,8 +865,8 @@ async function addE2EListener(e, t, r, s) {
|
|
|
787
865
|
eventName: r,
|
|
788
866
|
callback: s
|
|
789
867
|
});
|
|
790
|
-
const
|
|
791
|
-
await
|
|
868
|
+
const o = t.executionContext();
|
|
869
|
+
await o.evaluate(((e, t, r) => {
|
|
792
870
|
e.addEventListener(r, (e => {
|
|
793
871
|
window.stencilOnEvent(t, window.stencilSerializeEvent(e));
|
|
794
872
|
}));
|
|
@@ -844,7 +922,7 @@ function browserContextEvents() {
|
|
|
844
922
|
}
|
|
845
923
|
|
|
846
924
|
async function find(e, t, r) {
|
|
847
|
-
const {lightSelector: s, shadowSelector: n, text:
|
|
925
|
+
const {lightSelector: s, shadowSelector: n, text: o, contains: i} = getSelector(r);
|
|
848
926
|
let a;
|
|
849
927
|
if (a = "string" == typeof s ? await async function l(e, t, r, s) {
|
|
850
928
|
let n = await t.$(r);
|
|
@@ -872,20 +950,20 @@ async function find(e, t, r) {
|
|
|
872
950
|
}(e), s;
|
|
873
951
|
}), t, r, s);
|
|
874
952
|
return n ? n.asElement() : null;
|
|
875
|
-
}(e, t,
|
|
953
|
+
}(e, t, o, i), !a) return null;
|
|
876
954
|
const u = new E2EElement(e, a);
|
|
877
955
|
return await u.e2eSync(), u;
|
|
878
956
|
}
|
|
879
957
|
|
|
880
958
|
async function findAll(e, t, r) {
|
|
881
|
-
const s = [], {lightSelector: n, shadowSelector:
|
|
882
|
-
if (0 ===
|
|
883
|
-
if (
|
|
884
|
-
const r =
|
|
959
|
+
const s = [], {lightSelector: n, shadowSelector: o} = getSelector(r), i = await t.$$(n);
|
|
960
|
+
if (0 === i.length) return s;
|
|
961
|
+
if (o) for (let t = 0; t < i.length; t++) {
|
|
962
|
+
const r = i[t].executionContext(), n = await r.evaluateHandle(((e, t) => {
|
|
885
963
|
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
886
964
|
return e.shadowRoot.querySelectorAll(t);
|
|
887
|
-
}),
|
|
888
|
-
await
|
|
965
|
+
}), i[t], o);
|
|
966
|
+
await i[t].dispose();
|
|
889
967
|
const a = await n.getProperties();
|
|
890
968
|
await n.dispose();
|
|
891
969
|
for (const t of a.values()) {
|
|
@@ -895,8 +973,8 @@ async function findAll(e, t, r) {
|
|
|
895
973
|
await t.e2eSync(), s.push(t);
|
|
896
974
|
}
|
|
897
975
|
}
|
|
898
|
-
} else for (let t = 0; t <
|
|
899
|
-
const r = new E2EElement(e,
|
|
976
|
+
} else for (let t = 0; t < i.length; t++) {
|
|
977
|
+
const r = new E2EElement(e, i[t]);
|
|
900
978
|
await r.e2eSync(), s.push(r);
|
|
901
979
|
}
|
|
902
980
|
return s;
|
|
@@ -935,7 +1013,7 @@ function writeFile(e, t) {
|
|
|
935
1013
|
}));
|
|
936
1014
|
}
|
|
937
1015
|
|
|
938
|
-
async function compareScreenshot(e, t, r, s, n,
|
|
1016
|
+
async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
939
1017
|
const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
|
|
940
1018
|
await async function u(e, t) {
|
|
941
1019
|
await function r(e) {
|
|
@@ -943,7 +1021,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
943
1021
|
fs__default.default.access(e, (e => t(!e)));
|
|
944
1022
|
}));
|
|
945
1023
|
}(e) || await writeFile(e, t);
|
|
946
|
-
}(c, r), r = null,
|
|
1024
|
+
}(c, r), r = null, i && (i = normalizePath(path$2.relative(t.rootDir, i)));
|
|
947
1025
|
const d = function h(e, t) {
|
|
948
1026
|
if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
|
|
949
1027
|
const r = crypto$3.createHash("md5");
|
|
@@ -956,9 +1034,9 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
956
1034
|
device: e.device,
|
|
957
1035
|
userAgent: e.userAgent,
|
|
958
1036
|
desc: s,
|
|
959
|
-
testPath:
|
|
1037
|
+
testPath: i,
|
|
960
1038
|
width: n,
|
|
961
|
-
height:
|
|
1039
|
+
height: o,
|
|
962
1040
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
963
1041
|
hasTouch: e.viewport.hasTouch,
|
|
964
1042
|
isLandscape: e.viewport.isLandscape,
|
|
@@ -972,14 +1050,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
972
1050
|
device: e.device,
|
|
973
1051
|
userAgent: e.userAgent,
|
|
974
1052
|
width: n,
|
|
975
|
-
height:
|
|
1053
|
+
height: o,
|
|
976
1054
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
977
1055
|
hasTouch: e.viewport.hasTouch,
|
|
978
1056
|
isLandscape: e.viewport.isLandscape,
|
|
979
1057
|
isMobile: e.viewport.isMobile,
|
|
980
1058
|
allowableMismatchedPixels: t.allowableMismatchedPixels,
|
|
981
1059
|
allowableMismatchedRatio: t.allowableMismatchedRatio,
|
|
982
|
-
testPath:
|
|
1060
|
+
testPath: i
|
|
983
1061
|
}
|
|
984
1062
|
};
|
|
985
1063
|
if (t.updateMaster) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
|
|
@@ -1001,7 +1079,7 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1001
1079
|
};
|
|
1002
1080
|
p.diff.mismatchedPixels = await async function g(e, t) {
|
|
1003
1081
|
return new Promise(((r, s) => {
|
|
1004
|
-
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL,
|
|
1082
|
+
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, o = setTimeout((() => {
|
|
1005
1083
|
s(`getMismatchedPixels timeout: ${n}ms`);
|
|
1006
1084
|
}), n);
|
|
1007
1085
|
try {
|
|
@@ -1010,14 +1088,14 @@ async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
|
1010
1088
|
env: process.env,
|
|
1011
1089
|
cwd: process.cwd(),
|
|
1012
1090
|
stdio: [ "pipe", "pipe", "pipe", "ipc" ]
|
|
1013
|
-
},
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
})),
|
|
1017
|
-
clearTimeout(
|
|
1018
|
-
})),
|
|
1091
|
+
}, i = child_process$2.fork(e, [], n);
|
|
1092
|
+
i.on("message", (e => {
|
|
1093
|
+
i.kill(), clearTimeout(o), r(e);
|
|
1094
|
+
})), i.on("error", (e => {
|
|
1095
|
+
clearTimeout(o), s(e);
|
|
1096
|
+
})), i.send(t);
|
|
1019
1097
|
} catch (e) {
|
|
1020
|
-
clearTimeout(
|
|
1098
|
+
clearTimeout(o), s(`getMismatchedPixels error: ${e}`);
|
|
1021
1099
|
}
|
|
1022
1100
|
}));
|
|
1023
1101
|
}(t.pixelmatchModulePath, n);
|
|
@@ -1034,9 +1112,9 @@ async function e2eGoTo(e, t, r = {}) {
|
|
|
1034
1112
|
if ("string" != typeof s) throw new Error("invalid gotoTest() browser url");
|
|
1035
1113
|
const n = s + t.substring(1);
|
|
1036
1114
|
r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1037
|
-
const
|
|
1038
|
-
if (!
|
|
1039
|
-
return await waitForStencil(e, r),
|
|
1115
|
+
const o = await e._e2eGoto(n, r);
|
|
1116
|
+
if (!o.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${o.status()}`);
|
|
1117
|
+
return await waitForStencil(e, r), o;
|
|
1040
1118
|
}
|
|
1041
1119
|
|
|
1042
1120
|
async function e2eSetContent(e, t, r = {}) {
|
|
@@ -1045,18 +1123,18 @@ async function e2eSetContent(e, t, r = {}) {
|
|
|
1045
1123
|
const s = [], n = env.__STENCIL_APP_SCRIPT_URL__;
|
|
1046
1124
|
if ("string" != typeof n) throw new Error("invalid e2eSetContent() app script url");
|
|
1047
1125
|
s.push("<!doctype html>"), s.push("<html>"), s.push("<head>");
|
|
1048
|
-
const
|
|
1049
|
-
"string" == typeof
|
|
1126
|
+
const o = env.__STENCIL_APP_STYLE_URL__;
|
|
1127
|
+
"string" == typeof o && s.push(`<link rel="stylesheet" href="${o}">`), s.push(`<script type="module" src="${n}"><\/script>`),
|
|
1050
1128
|
s.push("</head>"), s.push("<body>"), s.push(t), s.push("</body>"), s.push("</html>");
|
|
1051
|
-
const
|
|
1129
|
+
const i = env.__STENCIL_BROWSER_URL__;
|
|
1052
1130
|
await e.setRequestInterception(!0), e.on("request", (e => {
|
|
1053
|
-
|
|
1131
|
+
i === e.url() ? e.respond({
|
|
1054
1132
|
status: 200,
|
|
1055
1133
|
contentType: "text/html",
|
|
1056
1134
|
body: s.join("\n")
|
|
1057
1135
|
}) : e.continue();
|
|
1058
1136
|
})), r.waitUntil || (r.waitUntil = env.__STENCIL_BROWSER_WAIT_UNTIL);
|
|
1059
|
-
const a = await e._e2eGoto(
|
|
1137
|
+
const a = await e._e2eGoto(i, r);
|
|
1060
1138
|
if (!a.ok()) throw new Error("Testing unable to load content");
|
|
1061
1139
|
return await waitForStencil(e, r), a;
|
|
1062
1140
|
}
|
|
@@ -1164,8 +1242,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1164
1242
|
}, noop = () => {}, isFunction = e => "function" == typeof e, isString = e => "string" == typeof e, isIterable = e => (e => null != e)(e) && isFunction(e[Symbol.iterator]), windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/, hasError = e => null != e && 0 !== e.length && e.some((e => "error" === e.level && "runtime" !== e.type)), normalizePath = e => {
|
|
1165
1243
|
if ("string" != typeof e) throw new Error("invalid path to normalize");
|
|
1166
1244
|
e = normalizeSlashes(e.trim());
|
|
1167
|
-
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1],
|
|
1168
|
-
return "" ===
|
|
1245
|
+
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], o = s + r.slice(1).join("/");
|
|
1246
|
+
return "" === o ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + o : o;
|
|
1169
1247
|
}, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
|
|
1170
1248
|
if (!Array.isArray(e) || 0 === e.length) return [];
|
|
1171
1249
|
const t = [ e[0] ];
|
|
@@ -1202,8 +1280,8 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1202
1280
|
if (-1 !== r) {
|
|
1203
1281
|
const t = r + "://".length, s = e.indexOf("/", t);
|
|
1204
1282
|
if (-1 !== s) {
|
|
1205
|
-
const n = e.slice(0, r),
|
|
1206
|
-
if ("file" === n && ("" ===
|
|
1283
|
+
const n = e.slice(0, r), o = e.slice(t, s);
|
|
1284
|
+
if ("file" === n && ("" === o || "localhost" === o) && isVolumeCharacter(e.charCodeAt(s + 1))) {
|
|
1207
1285
|
const t = getFileUrlVolumeSeparatorEnd(e, s + 2);
|
|
1208
1286
|
if (-1 !== t) {
|
|
1209
1287
|
if (47 === e.charCodeAt(t)) return ~(t + 1);
|
|
@@ -1235,9 +1313,13 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1235
1313
|
if (!r.includes(t.code) && (n = t.messageText, isIterable(t.next))) for (const r of t.next) n += flattenDiagnosticMessageText(e, r);
|
|
1236
1314
|
return s && (n = n.replace("type 'StencilConfig'", "Stencil Config"), n = n.replace("Object literal may only specify known properties, but ", ""),
|
|
1237
1315
|
n = n.replace("Object literal may only specify known properties, and ", "")), n.trim();
|
|
1238
|
-
}, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www",
|
|
1239
|
-
|
|
1240
|
-
|
|
1316
|
+
}, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www", isJest27TransformOptions = e => "object" == typeof e && e.hasOwnProperty("config");
|
|
1317
|
+
|
|
1318
|
+
let _tsCompilerOptions = null, _tsCompilerOptionsKey = null;
|
|
1319
|
+
|
|
1320
|
+
const jestPreprocessor = {
|
|
1321
|
+
process(e, t, r, s) {
|
|
1322
|
+
if (isJest27TransformOptions(r) && (s = r.config), function n(e, t) {
|
|
1241
1323
|
const r = e.split(".").pop().toLowerCase().split("?")[0];
|
|
1242
1324
|
if ("ts" === r || "tsx" === r || "jsx" === r) return !0;
|
|
1243
1325
|
if ("mjs" === r) return !0;
|
|
@@ -1247,91 +1329,34 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1247
1329
|
}
|
|
1248
1330
|
return "css" === r;
|
|
1249
1331
|
}(t, e)) {
|
|
1250
|
-
const
|
|
1332
|
+
const r = {
|
|
1251
1333
|
file: t,
|
|
1252
|
-
currentDirectory:
|
|
1253
|
-
}, n =
|
|
1254
|
-
n && (n.baseUrl && (
|
|
1255
|
-
const
|
|
1256
|
-
if (
|
|
1257
|
-
const e =
|
|
1334
|
+
currentDirectory: s.rootDir
|
|
1335
|
+
}, n = getCompilerOptions(s.rootDir);
|
|
1336
|
+
n && (n.baseUrl && (r.baseUrl = n.baseUrl), n.paths && (r.paths = n.paths));
|
|
1337
|
+
const o = transpile(e, r), i = o.diagnostics.some((e => "error" === e.level));
|
|
1338
|
+
if (o.diagnostics && i) {
|
|
1339
|
+
const e = o.diagnostics.map(formatDiagnostic).join("\n\n");
|
|
1258
1340
|
throw new Error(e);
|
|
1259
1341
|
}
|
|
1260
|
-
return
|
|
1342
|
+
return o.code;
|
|
1261
1343
|
}
|
|
1262
1344
|
return e;
|
|
1263
1345
|
},
|
|
1264
|
-
getCompilerOptions(e) {
|
|
1265
|
-
return this._tsCompilerOptions || (this._tsCompilerOptions = function t(e) {
|
|
1266
|
-
if ("string" != typeof e) return null;
|
|
1267
|
-
e = normalizePath(e);
|
|
1268
|
-
const t = stencil_js.ts.findConfigFile(e, stencil_js.ts.sys.fileExists);
|
|
1269
|
-
if (!t) return null;
|
|
1270
|
-
const r = stencil_js.ts.readConfigFile(t, stencil_js.ts.sys.readFile);
|
|
1271
|
-
if (r.error) throw new Error(formatDiagnostic((e => {
|
|
1272
|
-
const t = {
|
|
1273
|
-
level: "warn",
|
|
1274
|
-
type: "typescript",
|
|
1275
|
-
language: "typescript",
|
|
1276
|
-
header: "TypeScript",
|
|
1277
|
-
code: e.code.toString(),
|
|
1278
|
-
messageText: flattenDiagnosticMessageText(e, e.messageText),
|
|
1279
|
-
relFilePath: null,
|
|
1280
|
-
absFilePath: null,
|
|
1281
|
-
lines: []
|
|
1282
|
-
};
|
|
1283
|
-
if (1 === e.category && (t.level = "error"), e.file) {
|
|
1284
|
-
t.absFilePath = e.file.fileName;
|
|
1285
|
-
const s = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), n = e.file.getLineAndCharacterOfPosition(e.start), i = {
|
|
1286
|
-
lineIndex: n.line,
|
|
1287
|
-
lineNumber: n.line + 1,
|
|
1288
|
-
text: s[n.line],
|
|
1289
|
-
errorCharStart: n.character,
|
|
1290
|
-
errorLength: Math.max(e.length, 1)
|
|
1291
|
-
};
|
|
1292
|
-
if (t.lineNumber = i.lineNumber, t.columnNumber = i.errorCharStart + 1, t.lines.push(i),
|
|
1293
|
-
0 === i.errorLength && i.errorCharStart > 0 && (i.errorLength = 1, i.errorCharStart--),
|
|
1294
|
-
i.lineIndex > 0) {
|
|
1295
|
-
const e = {
|
|
1296
|
-
lineIndex: i.lineIndex - 1,
|
|
1297
|
-
lineNumber: i.lineNumber - 1,
|
|
1298
|
-
text: s[i.lineIndex - 1],
|
|
1299
|
-
errorCharStart: -1,
|
|
1300
|
-
errorLength: -1
|
|
1301
|
-
};
|
|
1302
|
-
t.lines.unshift(e);
|
|
1303
|
-
}
|
|
1304
|
-
if (i.lineIndex + 1 < s.length) {
|
|
1305
|
-
const e = {
|
|
1306
|
-
lineIndex: i.lineIndex + 1,
|
|
1307
|
-
lineNumber: i.lineNumber + 1,
|
|
1308
|
-
text: s[i.lineIndex + 1],
|
|
1309
|
-
errorCharStart: -1,
|
|
1310
|
-
errorLength: -1
|
|
1311
|
-
};
|
|
1312
|
-
t.lines.push(e);
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
var r;
|
|
1316
|
-
return t;
|
|
1317
|
-
})(r.error)));
|
|
1318
|
-
return stencil_js.ts.parseJsonConfigFileContent(r.config, stencil_js.ts.sys, e, void 0, t).options;
|
|
1319
|
-
}(e)), this._tsCompilerOptions;
|
|
1320
|
-
},
|
|
1321
1346
|
getCacheKey(e, t, r, s) {
|
|
1322
|
-
if (!
|
|
1323
|
-
const e =
|
|
1324
|
-
|
|
1347
|
+
if (isJest27TransformOptions(r) && (s = r.config), !_tsCompilerOptionsKey) {
|
|
1348
|
+
const e = getCompilerOptions(s.rootDir);
|
|
1349
|
+
_tsCompilerOptionsKey = JSON.stringify(e);
|
|
1325
1350
|
}
|
|
1326
|
-
return [ process.version,
|
|
1351
|
+
return [ process.version, _tsCompilerOptionsKey, e, t, r, !!s.instrument, 7 ].join(":");
|
|
1327
1352
|
}
|
|
1328
1353
|
}, deepEqual = function e(t, r) {
|
|
1329
|
-
var s, n,
|
|
1354
|
+
var s, n, o, i, a, l, c, u, d, h;
|
|
1330
1355
|
if (t === r) return !0;
|
|
1331
1356
|
if (t && r && "object" == typeof t && "object" == typeof r) {
|
|
1332
1357
|
if (s = Array.isArray(t), n = Array.isArray(r), s && n) {
|
|
1333
|
-
if ((
|
|
1334
|
-
for (
|
|
1358
|
+
if ((i = t.length) != r.length) return !1;
|
|
1359
|
+
for (o = i; 0 != o--; ) if (!e(t[o], r[o])) return !1;
|
|
1335
1360
|
return !0;
|
|
1336
1361
|
}
|
|
1337
1362
|
if (s != n) return !1;
|
|
@@ -1339,9 +1364,9 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1339
1364
|
if (l && c) return t.getTime() == r.getTime();
|
|
1340
1365
|
if ((u = t instanceof RegExp) != (d = r instanceof RegExp)) return !1;
|
|
1341
1366
|
if (u && d) return t.toString() == r.toString();
|
|
1342
|
-
if ((
|
|
1343
|
-
for (
|
|
1344
|
-
for (
|
|
1367
|
+
if ((i = (h = Object.keys(t)).length) !== Object.keys(r).length) return !1;
|
|
1368
|
+
for (o = i; 0 != o--; ) if (!Object.prototype.hasOwnProperty.call(r, h[o])) return !1;
|
|
1369
|
+
for (o = i; 0 != o--; ) if (!e(t[a = h[o]], r[a])) return !1;
|
|
1345
1370
|
return !0;
|
|
1346
1371
|
}
|
|
1347
1372
|
return t != t && r != r;
|
|
@@ -1739,9 +1764,9 @@ class BuildContext {
|
|
|
1739
1764
|
}
|
|
1740
1765
|
return {
|
|
1741
1766
|
duration: () => r.duration(),
|
|
1742
|
-
finish: (e, s, n,
|
|
1767
|
+
finish: (e, s, n, o) => {
|
|
1743
1768
|
if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
|
|
1744
|
-
r.finish(e, s, n,
|
|
1769
|
+
r.finish(e, s, n, o), !t)) {
|
|
1745
1770
|
const e = {
|
|
1746
1771
|
buildId: this.buildId,
|
|
1747
1772
|
messages: this.buildMessages.slice(),
|
|
@@ -1857,12 +1882,12 @@ class Cache {
|
|
|
1857
1882
|
if (null != t) {
|
|
1858
1883
|
if (e - t < ONE_DAY) return;
|
|
1859
1884
|
const r = this.cacheFs.sys, s = await r.readDir(this.config.cacheDir), n = s.map((e => path$2.join(this.config.cacheDir, e)));
|
|
1860
|
-
let
|
|
1861
|
-
const
|
|
1885
|
+
let o = 0;
|
|
1886
|
+
const i = n.map((async t => {
|
|
1862
1887
|
const s = (await r.stat(t)).mtimeMs;
|
|
1863
|
-
e - s > ONE_WEEK && (await r.removeFile(t),
|
|
1888
|
+
e - s > ONE_WEEK && (await r.removeFile(t), o++);
|
|
1864
1889
|
}));
|
|
1865
|
-
await Promise.all(
|
|
1890
|
+
await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${o}`);
|
|
1866
1891
|
}
|
|
1867
1892
|
this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
|
|
1868
1893
|
}
|
|
@@ -1904,10 +1929,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1904
1929
|
} else if (!0 === e.queueDeleteFromDisk) e.isDirectory && !t.dirsToEnsure.includes(r) ? t.dirsToDelete.push(r) : e.isFile && !t.filesToWrite.includes(r) && t.filesToDelete.push(r); else if ("string" == typeof e.queueCopyFileToDest) {
|
|
1905
1930
|
const s = r, n = e.queueCopyFileToDest;
|
|
1906
1931
|
t.filesToCopy.push([ s, n ]);
|
|
1907
|
-
const
|
|
1908
|
-
t.dirsToEnsure.includes(
|
|
1909
|
-
const
|
|
1910
|
-
|
|
1932
|
+
const o = normalizePath(path$2.dirname(n));
|
|
1933
|
+
t.dirsToEnsure.includes(o) || t.dirsToEnsure.push(o);
|
|
1934
|
+
const i = t.dirsToDelete.indexOf(o);
|
|
1935
|
+
i > -1 && t.dirsToDelete.splice(i, 1);
|
|
1911
1936
|
const a = t.filesToDelete.indexOf(n);
|
|
1912
1937
|
a > -1 && t.filesToDelete.splice(a, 1);
|
|
1913
1938
|
}
|
|
@@ -1940,10 +1965,10 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1940
1965
|
|
|
1941
1966
|
(posix = {
|
|
1942
1967
|
resolve: function e() {
|
|
1943
|
-
var t, r, s, n = "",
|
|
1944
|
-
for (r = arguments.length - 1; r >= -1 && !
|
|
1945
|
-
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n,
|
|
1946
|
-
return n = normalizeStringPosix(n, !
|
|
1968
|
+
var t, r, s, n = "", o = !1;
|
|
1969
|
+
for (r = arguments.length - 1; r >= -1 && !o; r--) r >= 0 ? s = arguments[r] : (void 0 === t && (t = process.cwd()),
|
|
1970
|
+
s = t), assertPath(s), 0 !== s.length && (n = s + "/" + n, o = 47 === s.charCodeAt(0));
|
|
1971
|
+
return n = normalizeStringPosix(n, !o), o ? n.length > 0 ? "/" + n : "/" : n.length > 0 ? n : ".";
|
|
1947
1972
|
},
|
|
1948
1973
|
normalize: function e(t) {
|
|
1949
1974
|
var r, s;
|
|
@@ -1961,70 +1986,70 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1961
1986
|
return void 0 === t ? "." : posix.normalize(t);
|
|
1962
1987
|
},
|
|
1963
1988
|
relative: function e(t, r) {
|
|
1964
|
-
var s, n,
|
|
1989
|
+
var s, n, o, i, a, l, c, u, d, h;
|
|
1965
1990
|
if (assertPath(t), assertPath(r), t === r) return "";
|
|
1966
1991
|
if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
|
|
1967
1992
|
for (s = 1; s < t.length && 47 === t.charCodeAt(s); ++s) ;
|
|
1968
|
-
for (
|
|
1969
|
-
for (l =
|
|
1993
|
+
for (o = (n = t.length) - s, i = 1; i < r.length && 47 === r.charCodeAt(i); ++i) ;
|
|
1994
|
+
for (l = o < (a = r.length - i) ? o : a, c = -1, u = 0; u <= l; ++u) {
|
|
1970
1995
|
if (u === l) {
|
|
1971
1996
|
if (a > l) {
|
|
1972
|
-
if (47 === r.charCodeAt(
|
|
1973
|
-
if (0 === u) return r.slice(
|
|
1974
|
-
} else
|
|
1997
|
+
if (47 === r.charCodeAt(i + u)) return r.slice(i + u + 1);
|
|
1998
|
+
if (0 === u) return r.slice(i + u);
|
|
1999
|
+
} else o > l && (47 === t.charCodeAt(s + u) ? c = u : 0 === u && (c = 0));
|
|
1975
2000
|
break;
|
|
1976
2001
|
}
|
|
1977
|
-
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(
|
|
2002
|
+
if ((d = t.charCodeAt(s + u)) !== r.charCodeAt(i + u)) break;
|
|
1978
2003
|
47 === d && (c = u);
|
|
1979
2004
|
}
|
|
1980
2005
|
for (h = "", u = s + c + 1; u <= n; ++u) u !== n && 47 !== t.charCodeAt(u) || (0 === h.length ? h += ".." : h += "/..");
|
|
1981
|
-
return h.length > 0 ? h + r.slice(
|
|
1982
|
-
r.slice(
|
|
2006
|
+
return h.length > 0 ? h + r.slice(i + c) : (i += c, 47 === r.charCodeAt(i) && ++i,
|
|
2007
|
+
r.slice(i));
|
|
1983
2008
|
},
|
|
1984
2009
|
_makeLong: function e(t) {
|
|
1985
2010
|
return t;
|
|
1986
2011
|
},
|
|
1987
2012
|
dirname: function e(t) {
|
|
1988
|
-
var r, s, n,
|
|
2013
|
+
var r, s, n, o;
|
|
1989
2014
|
if (assertPath(t), 0 === t.length) return ".";
|
|
1990
|
-
for (r = 47 === t.charCodeAt(0), s = -1, n = !0,
|
|
2015
|
+
for (r = 47 === t.charCodeAt(0), s = -1, n = !0, o = t.length - 1; o >= 1; --o) if (47 === t.charCodeAt(o)) {
|
|
1991
2016
|
if (!n) {
|
|
1992
|
-
s =
|
|
2017
|
+
s = o;
|
|
1993
2018
|
break;
|
|
1994
2019
|
}
|
|
1995
2020
|
} else n = !1;
|
|
1996
2021
|
return -1 === s ? r ? "/" : "." : r && 1 === s ? "//" : t.slice(0, s);
|
|
1997
2022
|
},
|
|
1998
2023
|
basename: function e(t, r) {
|
|
1999
|
-
var s, n,
|
|
2024
|
+
var s, n, o, i, a, l, c;
|
|
2000
2025
|
if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
|
|
2001
|
-
if (assertPath(t), s = 0, n = -1,
|
|
2026
|
+
if (assertPath(t), s = 0, n = -1, o = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
|
|
2002
2027
|
if (r.length === t.length && r === t) return "";
|
|
2003
|
-
for (a = r.length - 1, l = -1,
|
|
2004
|
-
if (!
|
|
2005
|
-
s =
|
|
2028
|
+
for (a = r.length - 1, l = -1, i = t.length - 1; i >= 0; --i) if (47 === (c = t.charCodeAt(i))) {
|
|
2029
|
+
if (!o) {
|
|
2030
|
+
s = i + 1;
|
|
2006
2031
|
break;
|
|
2007
2032
|
}
|
|
2008
|
-
} else -1 === l && (
|
|
2033
|
+
} else -1 === l && (o = !1, l = i + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (n = i) : (a = -1,
|
|
2009
2034
|
n = l));
|
|
2010
2035
|
return s === n ? n = l : -1 === n && (n = t.length), t.slice(s, n);
|
|
2011
2036
|
}
|
|
2012
|
-
for (
|
|
2013
|
-
if (!
|
|
2014
|
-
s =
|
|
2037
|
+
for (i = t.length - 1; i >= 0; --i) if (47 === t.charCodeAt(i)) {
|
|
2038
|
+
if (!o) {
|
|
2039
|
+
s = i + 1;
|
|
2015
2040
|
break;
|
|
2016
2041
|
}
|
|
2017
|
-
} else -1 === n && (
|
|
2042
|
+
} else -1 === n && (o = !1, n = i + 1);
|
|
2018
2043
|
return -1 === n ? "" : t.slice(s, n);
|
|
2019
2044
|
},
|
|
2020
2045
|
extname: function e(t) {
|
|
2021
|
-
var r, s, n,
|
|
2022
|
-
for (assertPath(t), r = -1, s = 0, n = -1,
|
|
2023
|
-
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !==
|
|
2046
|
+
var r, s, n, o, i, a, l;
|
|
2047
|
+
for (assertPath(t), r = -1, s = 0, n = -1, o = !0, i = 0, a = t.length - 1; a >= 0; --a) if (47 !== (l = t.charCodeAt(a))) -1 === n && (o = !1,
|
|
2048
|
+
n = a + 1), 46 === l ? -1 === r ? r = a : 1 !== i && (i = 1) : -1 !== r && (i = -1); else if (!o) {
|
|
2024
2049
|
s = a + 1;
|
|
2025
2050
|
break;
|
|
2026
2051
|
}
|
|
2027
|
-
return -1 === r || -1 === n || 0 ===
|
|
2052
|
+
return -1 === r || -1 === n || 0 === i || 1 === i && r === n - 1 && r === s + 1 ? "" : t.slice(r, n);
|
|
2028
2053
|
},
|
|
2029
2054
|
format: function e(t) {
|
|
2030
2055
|
if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
|
|
@@ -2034,7 +2059,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2034
2059
|
}("/", t);
|
|
2035
2060
|
},
|
|
2036
2061
|
parse: function e(t) {
|
|
2037
|
-
var r, s, n,
|
|
2062
|
+
var r, s, n, o, i, a, l, c, u, d;
|
|
2038
2063
|
if (assertPath(t), r = {
|
|
2039
2064
|
root: "",
|
|
2040
2065
|
dir: "",
|
|
@@ -2042,14 +2067,14 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2042
2067
|
ext: "",
|
|
2043
2068
|
name: ""
|
|
2044
2069
|
}, 0 === t.length) return r;
|
|
2045
|
-
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/",
|
|
2046
|
-
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >=
|
|
2047
|
-
l = u + 1), 46 === s ? -1 ===
|
|
2070
|
+
for ((n = 47 === (s = t.charCodeAt(0))) ? (r.root = "/", o = 1) : o = 0, i = -1,
|
|
2071
|
+
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= o; --u) if (47 !== (s = t.charCodeAt(u))) -1 === l && (c = !1,
|
|
2072
|
+
l = u + 1), 46 === s ? -1 === i ? i = u : 1 !== d && (d = 1) : -1 !== i && (d = -1); else if (!c) {
|
|
2048
2073
|
a = u + 1;
|
|
2049
2074
|
break;
|
|
2050
2075
|
}
|
|
2051
|
-
return -1 ===
|
|
2052
|
-
r.base = t.slice(1, l)) : (r.name = t.slice(a,
|
|
2076
|
+
return -1 === i || -1 === l || 0 === d || 1 === d && i === l - 1 && i === a + 1 ? -1 !== l && (r.base = r.name = 0 === a && n ? t.slice(1, l) : t.slice(a, l)) : (0 === a && n ? (r.name = t.slice(1, i),
|
|
2077
|
+
r.base = t.slice(1, l)) : (r.name = t.slice(a, i), r.base = t.slice(a, l)), r.ext = t.slice(i, l)),
|
|
2053
2078
|
a > 0 ? r.dir = t.slice(0, a - 1) : n && (r.dir = "/"), r;
|
|
2054
2079
|
},
|
|
2055
2080
|
sep: "/",
|
|
@@ -2087,21 +2112,21 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2087
2112
|
let s = (r = normalizePath(r)).split("/").filter((e => e.length));
|
|
2088
2113
|
const n = s.lastIndexOf("node_modules");
|
|
2089
2114
|
n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
|
|
2090
|
-
let
|
|
2091
|
-
|
|
2092
|
-
const
|
|
2093
|
-
if ("@stencil/core" ===
|
|
2115
|
+
let o = s.shift();
|
|
2116
|
+
o.startsWith("@") && (o += "/" + s.shift());
|
|
2117
|
+
const i = s.join("/");
|
|
2118
|
+
if ("@stencil/core" === o) {
|
|
2094
2119
|
return ((e, t) => {
|
|
2095
2120
|
let r = (t = normalizePath(t)).split("/");
|
|
2096
2121
|
const s = r.lastIndexOf("node_modules");
|
|
2097
2122
|
return s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
|
|
2098
2123
|
t = r.join("/")), new URL("./" + t, (e => new URL("../", e).href)(e)).href;
|
|
2099
|
-
})(e.getCompilerExecutingPath(),
|
|
2124
|
+
})(e.getCompilerExecutingPath(), i);
|
|
2100
2125
|
}
|
|
2101
2126
|
return e.getRemoteModuleUrl({
|
|
2102
|
-
moduleId:
|
|
2103
|
-
version: t.get(
|
|
2104
|
-
path:
|
|
2127
|
+
moduleId: o,
|
|
2128
|
+
version: t.get(o),
|
|
2129
|
+
path: i
|
|
2105
2130
|
});
|
|
2106
2131
|
}, knownUrlSkips = [ "/@stencil/core/internal.js", "/@stencil/core/internal.json", "/@stencil/core/internal.mjs", "/@stencil/core/internal/stencil-core.js/index.json", "/@stencil/core/internal/stencil-core.js.json", "/@stencil/core/internal/stencil-core.js/package.json", "/@stencil/core.js", "/@stencil/core.json", "/@stencil/core.mjs", "/@stencil/core.css", "/@stencil/core/index.js", "/@stencil/core/index.json", "/@stencil/core/index.mjs", "/@stencil/core/index.css", "/@stencil/package.json" ], fetchModuleAsync = async (e, t, r, s, n) => {
|
|
2107
2132
|
if (!((e => {
|
|
@@ -2110,11 +2135,11 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2110
2135
|
const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
|
|
2111
2136
|
return !("node_modules" !== s || !isCommonDirModuleFile(n));
|
|
2112
2137
|
})(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
|
|
2113
|
-
const
|
|
2114
|
-
if (
|
|
2115
|
-
if (
|
|
2116
|
-
const
|
|
2117
|
-
return await (async (e, t, r, s, n,
|
|
2138
|
+
const o = await ((e, t, r) => (console.trace(t), e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r)))(e, s);
|
|
2139
|
+
if (o) {
|
|
2140
|
+
if (o.ok) {
|
|
2141
|
+
const i = await o.clone().text();
|
|
2142
|
+
return await (async (e, t, r, s, n, o) => {
|
|
2118
2143
|
r.endsWith("package.json") && ((e, t) => {
|
|
2119
2144
|
try {
|
|
2120
2145
|
const r = JSON.parse(t);
|
|
@@ -2122,14 +2147,14 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2122
2147
|
e.set(t, r);
|
|
2123
2148
|
})(e, r.name, r.version);
|
|
2124
2149
|
} catch (e) {}
|
|
2125
|
-
})(
|
|
2126
|
-
let
|
|
2127
|
-
for (;"/" !==
|
|
2128
|
-
|
|
2150
|
+
})(o, n);
|
|
2151
|
+
let i = path$2.dirname(s);
|
|
2152
|
+
for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
|
|
2153
|
+
i = path$2.dirname(i);
|
|
2129
2154
|
t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
|
|
2130
|
-
})(e, t, s, n,
|
|
2155
|
+
})(e, t, s, n, i, r), i;
|
|
2131
2156
|
}
|
|
2132
|
-
404 ===
|
|
2157
|
+
404 === o.status && known404Urls.add(s);
|
|
2133
2158
|
}
|
|
2134
2159
|
} catch (e) {
|
|
2135
2160
|
console.error(e);
|
|
@@ -2152,12 +2177,12 @@ caller = function() {
|
|
|
2152
2177
|
}
|
|
2153
2178
|
}, r.exports), r.exports;
|
|
2154
2179
|
}((function(e) {
|
|
2155
|
-
var t, r, s = "win32" === process.platform, n = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,
|
|
2180
|
+
var t, r, s = "win32" === process.platform, n = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/, o = /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/, i = {
|
|
2156
2181
|
parse: function(e) {
|
|
2157
2182
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2158
2183
|
var t = function r(e) {
|
|
2159
|
-
var t = n.exec(e), r = (t[1] || "") + (t[2] || ""), s = t[3] || "",
|
|
2160
|
-
return [ r,
|
|
2184
|
+
var t = n.exec(e), r = (t[1] || "") + (t[2] || ""), s = t[3] || "", i = o.exec(s);
|
|
2185
|
+
return [ r, i[1], i[2], i[3] ];
|
|
2161
2186
|
}(e);
|
|
2162
2187
|
if (!t || 4 !== t.length) throw new TypeError("Invalid path '" + e + "'");
|
|
2163
2188
|
return {
|
|
@@ -2182,26 +2207,26 @@ caller = function() {
|
|
|
2182
2207
|
ext: r[3],
|
|
2183
2208
|
name: r[2].slice(0, r[2].length - r[3].length)
|
|
2184
2209
|
};
|
|
2185
|
-
}, e.exports = s ?
|
|
2210
|
+
}, e.exports = s ? i.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = i.parse;
|
|
2186
2211
|
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2187
|
-
var s, n,
|
|
2188
|
-
for (/^([A-Za-z]:)/.test(t) ?
|
|
2212
|
+
var s, n, o = "/";
|
|
2213
|
+
for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"), s = [ t ],
|
|
2189
2214
|
n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
|
|
2190
2215
|
return s.reduce((function(e, t) {
|
|
2191
2216
|
return e.concat(r.map((function(e) {
|
|
2192
|
-
return path__default.default.resolve(
|
|
2217
|
+
return path__default.default.resolve(o, t, e);
|
|
2193
2218
|
})));
|
|
2194
2219
|
}), []);
|
|
2195
2220
|
}, nodeModulesPaths = function e(t, r, s) {
|
|
2196
|
-
var n,
|
|
2221
|
+
var n, o = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
|
|
2197
2222
|
return r && "function" == typeof r.paths ? r.paths(s, t, (function() {
|
|
2198
|
-
return getNodeModulesDirs(t,
|
|
2199
|
-
}), r) : (n = getNodeModulesDirs(t,
|
|
2223
|
+
return getNodeModulesDirs(t, o);
|
|
2224
|
+
}), r) : (n = getNodeModulesDirs(t, o), r && r.paths ? n.concat(r.paths) : n);
|
|
2200
2225
|
}, normalizeOptions = function(e, t) {
|
|
2201
2226
|
return t || {};
|
|
2202
2227
|
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2203
2228
|
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2204
|
-
var r, s, n,
|
|
2229
|
+
var r, s, n, o, i, a, l, c = this;
|
|
2205
2230
|
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2206
2231
|
for (r = slice.call(arguments, 1), n = function() {
|
|
2207
2232
|
if (this instanceof s) {
|
|
@@ -2209,8 +2234,8 @@ toStr = Object.prototype.toString, implementation = function e(t) {
|
|
|
2209
2234
|
return Object(e) === e ? e : this;
|
|
2210
2235
|
}
|
|
2211
2236
|
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2212
|
-
},
|
|
2213
|
-
return s = Function("binder", "return function (" +
|
|
2237
|
+
}, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
|
|
2238
|
+
return s = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this,arguments); }")(n),
|
|
2214
2239
|
c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
|
|
2215
2240
|
l.prototype = null), s;
|
|
2216
2241
|
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
@@ -2335,13 +2360,13 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2335
2360
|
}
|
|
2336
2361
|
}));
|
|
2337
2362
|
}, getPackageCandidates$1 = function e(t, r, s) {
|
|
2338
|
-
var n,
|
|
2339
|
-
for (n = 0; n <
|
|
2340
|
-
return
|
|
2363
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2364
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2365
|
+
return o;
|
|
2341
2366
|
}, async = function e(t, r, s) {
|
|
2342
2367
|
function n(e) {
|
|
2343
2368
|
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) T = path__default.default.resolve(e, t),
|
|
2344
|
-
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package,
|
|
2369
|
+
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, C.package, o) : i(T, C.package, o); else {
|
|
2345
2370
|
if (_ && isCoreModule(t)) return S(null, t);
|
|
2346
2371
|
!function r(e, t, s) {
|
|
2347
2372
|
var n = function() {
|
|
@@ -2359,7 +2384,7 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2359
2384
|
}));
|
|
2360
2385
|
}
|
|
2361
2386
|
}
|
|
2362
|
-
function
|
|
2387
|
+
function o(e, r, s) {
|
|
2363
2388
|
e ? S(e) : r ? S(null, r, s) : l(T, (function(e, r, s) {
|
|
2364
2389
|
if (e) S(e); else if (r) maybeRealpath(f, r, C, (function(e, t) {
|
|
2365
2390
|
e ? S(e) : S(null, t, s);
|
|
@@ -2369,20 +2394,20 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2369
2394
|
}
|
|
2370
2395
|
}));
|
|
2371
2396
|
}
|
|
2372
|
-
function
|
|
2397
|
+
function i(e, t, r) {
|
|
2373
2398
|
var s = t, n = r;
|
|
2374
2399
|
"function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
|
|
2375
|
-
function
|
|
2400
|
+
function o(s, o, a) {
|
|
2376
2401
|
var u, h, p;
|
|
2377
|
-
return c =
|
|
2378
|
-
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l,
|
|
2402
|
+
return c = o, s ? n(s) : a && c && C.pathFilter && (h = (u = path__default.default.relative(a, l)).slice(0, u.length - t[0].length),
|
|
2403
|
+
p = C.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
|
|
2379
2404
|
}
|
|
2380
|
-
function
|
|
2381
|
-
return s ? n(s) :
|
|
2405
|
+
function i(s, o) {
|
|
2406
|
+
return s ? n(s) : o ? n(null, l, c) : void e(t.slice(1), r, c);
|
|
2382
2407
|
}
|
|
2383
2408
|
var l, c;
|
|
2384
2409
|
if (0 === t.length) return n(null, void 0, s);
|
|
2385
|
-
l = r + t[0], (c = s) ?
|
|
2410
|
+
l = r + t[0], (c = s) ? o(null, c) : a(path__default.default.dirname(l), o);
|
|
2386
2411
|
}([ "" ].concat(w), e, s);
|
|
2387
2412
|
}
|
|
2388
2413
|
function a(e, t) {
|
|
@@ -2393,8 +2418,8 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2393
2418
|
if (!s) return a(path__default.default.dirname(e), t);
|
|
2394
2419
|
m(p, n, (function(r, s) {
|
|
2395
2420
|
r && t(r);
|
|
2396
|
-
var
|
|
2397
|
-
|
|
2421
|
+
var o = s;
|
|
2422
|
+
o && C.packageFilter && (o = C.packageFilter(o, n)), t(null, o, e);
|
|
2398
2423
|
}));
|
|
2399
2424
|
}));
|
|
2400
2425
|
}));
|
|
@@ -2403,31 +2428,31 @@ defaultIsFile$1 = function e(t, r) {
|
|
|
2403
2428
|
var s = r, n = t;
|
|
2404
2429
|
"function" == typeof n && (s = n, n = C.package), maybeRealpath(f, e, C, (function(t, r) {
|
|
2405
2430
|
if (t) return s(t);
|
|
2406
|
-
var
|
|
2407
|
-
d(
|
|
2408
|
-
return t ? s(t) : r ? void m(p,
|
|
2431
|
+
var o = path__default.default.join(r, "package.json");
|
|
2432
|
+
d(o, (function(t, r) {
|
|
2433
|
+
return t ? s(t) : r ? void m(p, o, (function(t, r) {
|
|
2409
2434
|
var n, a;
|
|
2410
|
-
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n,
|
|
2411
|
-
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void
|
|
2435
|
+
return t ? s(t) : ((n = r) && C.packageFilter && (n = C.packageFilter(n, o)), n && n.main ? "string" != typeof n.main ? ((a = new TypeError("package “" + n.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2436
|
+
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void i(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2412
2437
|
return t ? s(t) : r ? s(null, r, n) : n ? void l(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2413
|
-
return t ? s(t) : r ? s(null, r, n) : void
|
|
2414
|
-
})) :
|
|
2415
|
-
}))) : void
|
|
2416
|
-
})) :
|
|
2438
|
+
return t ? s(t) : r ? s(null, r, n) : void i(path__default.default.join(e, "index"), n, s);
|
|
2439
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2440
|
+
}))) : void i(path__default.default.join(e, "/index"), n, s));
|
|
2441
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2417
2442
|
}));
|
|
2418
2443
|
}));
|
|
2419
2444
|
}
|
|
2420
2445
|
function c(e, t) {
|
|
2421
|
-
function r(t, r,
|
|
2422
|
-
return t ? e(t) : r ? e(null, r,
|
|
2446
|
+
function r(t, r, o) {
|
|
2447
|
+
return t ? e(t) : r ? e(null, r, o) : void l(n, C.package, s);
|
|
2423
2448
|
}
|
|
2424
2449
|
function s(r, s, n) {
|
|
2425
2450
|
return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
|
|
2426
2451
|
}
|
|
2427
2452
|
if (0 === t.length) return e(null, void 0);
|
|
2428
2453
|
var n = t[0];
|
|
2429
|
-
h(path__default.default.dirname(n), (function
|
|
2430
|
-
return s ? e(s) : a ? void
|
|
2454
|
+
h(path__default.default.dirname(n), (function o(s, a) {
|
|
2455
|
+
return s ? e(s) : a ? void i(n, C.package, r) : c(e, t.slice(1));
|
|
2431
2456
|
}));
|
|
2432
2457
|
}
|
|
2433
2458
|
var u, d, h, p, f, m, g, y, w, _, v, b, E, T, S = s, C = r;
|
|
@@ -2567,64 +2592,64 @@ defaultIsFile = function e(t) {
|
|
|
2567
2592
|
return JSON.parse(s);
|
|
2568
2593
|
} catch (e) {}
|
|
2569
2594
|
}, getPackageCandidates = function e(t, r, s) {
|
|
2570
|
-
var n,
|
|
2571
|
-
for (n = 0; n <
|
|
2572
|
-
return
|
|
2595
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2596
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2597
|
+
return o;
|
|
2573
2598
|
}, sync = function e(t, r) {
|
|
2574
2599
|
function s(e) {
|
|
2575
|
-
var t, r, s,
|
|
2576
|
-
if (l && l.dir && l.pkg &&
|
|
2577
|
-
(r =
|
|
2600
|
+
var t, r, s, o, l = n(path__default.default.dirname(e));
|
|
2601
|
+
if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2602
|
+
(r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2578
2603
|
a(e)) return e;
|
|
2579
|
-
for (s = 0; s < p.length; s++) if (
|
|
2604
|
+
for (s = 0; s < p.length; s++) if (o = e + p[s], a(o)) return o;
|
|
2580
2605
|
}
|
|
2581
2606
|
function n(e) {
|
|
2582
2607
|
var t, r;
|
|
2583
|
-
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e,
|
|
2584
|
-
a(t) ? ((r = d(l, t)) &&
|
|
2608
|
+
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e, i), "package.json"),
|
|
2609
|
+
a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
|
|
2585
2610
|
pkg: r,
|
|
2586
2611
|
dir: e
|
|
2587
2612
|
}) : n(path__default.default.dirname(e));
|
|
2588
2613
|
}
|
|
2589
|
-
function
|
|
2590
|
-
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e,
|
|
2614
|
+
function o(e) {
|
|
2615
|
+
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
|
|
2591
2616
|
if (a(h)) {
|
|
2592
2617
|
try {
|
|
2593
2618
|
t = d(l, h);
|
|
2594
2619
|
} catch (e) {}
|
|
2595
|
-
if (t &&
|
|
2620
|
+
if (t && i.packageFilter && (t = i.packageFilter(t, e)), t && t.main) {
|
|
2596
2621
|
if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2597
2622
|
r;
|
|
2598
2623
|
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2599
2624
|
try {
|
|
2600
2625
|
if (n = s(path__default.default.resolve(e, t.main))) return n;
|
|
2601
|
-
if (c =
|
|
2626
|
+
if (c = o(path__default.default.resolve(e, t.main))) return c;
|
|
2602
2627
|
} catch (e) {}
|
|
2603
2628
|
}
|
|
2604
2629
|
}
|
|
2605
2630
|
return s(path__default.default.join(e, "/index"));
|
|
2606
2631
|
}
|
|
2607
|
-
var
|
|
2632
|
+
var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
|
|
2608
2633
|
if ("string" != typeof t) throw new TypeError("Path must be a string.");
|
|
2609
|
-
if (
|
|
2610
|
-
c =
|
|
2611
|
-
|
|
2612
|
-
if (h =
|
|
2613
|
-
m =
|
|
2614
|
-
y = maybeRealpathSync(u, path__default.default.resolve(m),
|
|
2634
|
+
if (i = normalizeOptions(0, r), a = i.isFile || defaultIsFile, l = i.readFileSync || fs__default.default.readFileSync,
|
|
2635
|
+
c = i.isDirectory || defaultIsDir, u = i.realpathSync || defaultRealpathSync, d = i.readPackageSync || defaultReadPackageSync,
|
|
2636
|
+
i.readFileSync && i.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
2637
|
+
if (h = i.packageIterator, p = i.extensions || [ ".js" ], f = !1 !== i.includeCoreModules,
|
|
2638
|
+
m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || [],
|
|
2639
|
+
y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2615
2640
|
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2616
|
-
_ = s(w) ||
|
|
2641
|
+
_ = s(w) || o(w)) return maybeRealpathSync(u, _, i);
|
|
2617
2642
|
} else {
|
|
2618
2643
|
if (f && isCoreModule(t)) return t;
|
|
2619
2644
|
if (v = function E(e, t) {
|
|
2620
2645
|
var r, n, a, l, u = function() {
|
|
2621
|
-
return getPackageCandidates(e, t,
|
|
2622
|
-
}, d = h ? h(e, t, u,
|
|
2646
|
+
return getPackageCandidates(e, t, i);
|
|
2647
|
+
}, d = h ? h(e, t, u, i) : u();
|
|
2623
2648
|
for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
|
|
2624
2649
|
if (a = s(n)) return a;
|
|
2625
|
-
if (l =
|
|
2650
|
+
if (l = o(n)) return l;
|
|
2626
2651
|
}
|
|
2627
|
-
}(t, y)) return maybeRealpathSync(u, v,
|
|
2652
|
+
}(t, y)) return maybeRealpathSync(u, v, i);
|
|
2628
2653
|
}
|
|
2629
2654
|
throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
|
|
2630
2655
|
b;
|
|
@@ -2661,8 +2686,8 @@ const createSystem = e => {
|
|
|
2661
2686
|
let r = BLUE, s = "Build", n = "";
|
|
2662
2687
|
"error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
|
|
2663
2688
|
s = "Warning"), e.header && (s = e.header);
|
|
2664
|
-
const
|
|
2665
|
-
if (
|
|
2689
|
+
const o = e.relFilePath || e.absFilePath;
|
|
2690
|
+
if (o && (n += o, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
|
|
2666
2691
|
"number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
|
|
2667
2692
|
n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
|
|
2668
2693
|
n += "\n" + e.lineNumber + ": " + e.text;
|
|
@@ -2673,7 +2698,7 @@ const createSystem = e => {
|
|
|
2673
2698
|
})(t, e)));
|
|
2674
2699
|
}
|
|
2675
2700
|
};
|
|
2676
|
-
})(), r = new Map, s = new Set, n = e => s.add(e),
|
|
2701
|
+
})(), r = new Map, s = new Set, n = e => s.add(e), o = e => s.delete(e), i = (() => {
|
|
2677
2702
|
const e = [], t = t => {
|
|
2678
2703
|
const r = e.findIndex((e => e.callback === t));
|
|
2679
2704
|
return r > -1 && (e.splice(r, 1), !0);
|
|
@@ -2700,11 +2725,11 @@ const createSystem = e => {
|
|
|
2700
2725
|
}), () => t(n);
|
|
2701
2726
|
}
|
|
2702
2727
|
if ("string" == typeof r && "function" == typeof s) {
|
|
2703
|
-
const n = r.toLowerCase().trim(),
|
|
2728
|
+
const n = r.toLowerCase().trim(), o = s;
|
|
2704
2729
|
return e.push({
|
|
2705
2730
|
eventName: n,
|
|
2706
|
-
callback:
|
|
2707
|
-
}), () => t(
|
|
2731
|
+
callback: o
|
|
2732
|
+
}), () => t(o);
|
|
2708
2733
|
}
|
|
2709
2734
|
return () => !1;
|
|
2710
2735
|
},
|
|
@@ -2732,8 +2757,8 @@ const createSystem = e => {
|
|
|
2732
2757
|
}, d = (e, t, s) => {
|
|
2733
2758
|
const n = path$2.dirname(e);
|
|
2734
2759
|
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && d(n, t, s);
|
|
2735
|
-
const
|
|
2736
|
-
|
|
2760
|
+
const o = r.get(e);
|
|
2761
|
+
o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
|
|
2737
2762
|
basename: path$2.basename(e),
|
|
2738
2763
|
dirname: n,
|
|
2739
2764
|
isDirectory: !0,
|
|
@@ -2757,10 +2782,10 @@ const createSystem = e => {
|
|
|
2757
2782
|
}), m = (e, t, s) => {
|
|
2758
2783
|
const n = w(e);
|
|
2759
2784
|
if (!n.error && !s.error) if (n.isFile) {
|
|
2760
|
-
const n = path$2.dirname(t),
|
|
2785
|
+
const n = path$2.dirname(t), o = u(n, {
|
|
2761
2786
|
recursive: !0
|
|
2762
|
-
}),
|
|
2763
|
-
s.newDirs.push(...
|
|
2787
|
+
}), i = r.get(e).data, a = b(t, i);
|
|
2788
|
+
s.newDirs.push(...o.newDirs), s.renamed.push({
|
|
2764
2789
|
oldPath: e,
|
|
2765
2790
|
newPath: t,
|
|
2766
2791
|
isDirectory: !1,
|
|
@@ -2858,8 +2883,8 @@ const createSystem = e => {
|
|
|
2858
2883
|
u("/");
|
|
2859
2884
|
const S = {
|
|
2860
2885
|
name: "in-memory",
|
|
2861
|
-
version: "2.
|
|
2862
|
-
events:
|
|
2886
|
+
version: "2.13.0",
|
|
2887
|
+
events: i,
|
|
2863
2888
|
access: async e => c(e),
|
|
2864
2889
|
accessSync: c,
|
|
2865
2890
|
addDestory: n,
|
|
@@ -2906,7 +2931,7 @@ const createSystem = e => {
|
|
|
2906
2931
|
readFileSync: p,
|
|
2907
2932
|
realpath: async e => f(e),
|
|
2908
2933
|
realpathSync: f,
|
|
2909
|
-
removeDestory:
|
|
2934
|
+
removeDestory: o,
|
|
2910
2935
|
rename: async (e, t) => {
|
|
2911
2936
|
const r = {
|
|
2912
2937
|
oldPath: e = normalizePath(e),
|
|
@@ -2943,14 +2968,14 @@ const createSystem = e => {
|
|
|
2943
2968
|
removeFileSync: _,
|
|
2944
2969
|
watchDirectory: (e, t) => {
|
|
2945
2970
|
e = l(e);
|
|
2946
|
-
const s = r.get(e),
|
|
2971
|
+
const s = r.get(e), i = () => {
|
|
2947
2972
|
const s = r.get(e);
|
|
2948
2973
|
if (s && s.watcherCallbacks) {
|
|
2949
2974
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2950
2975
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2951
2976
|
}
|
|
2952
2977
|
};
|
|
2953
|
-
return n(
|
|
2978
|
+
return n(i), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2954
2979
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2955
2980
|
basename: path$2.basename(e),
|
|
2956
2981
|
dirname: path$2.dirname(e),
|
|
@@ -2960,20 +2985,20 @@ const createSystem = e => {
|
|
|
2960
2985
|
data: void 0
|
|
2961
2986
|
}), {
|
|
2962
2987
|
close() {
|
|
2963
|
-
i
|
|
2988
|
+
o(i), i();
|
|
2964
2989
|
}
|
|
2965
2990
|
};
|
|
2966
2991
|
},
|
|
2967
2992
|
watchFile: (e, t) => {
|
|
2968
2993
|
e = l(e);
|
|
2969
|
-
const s = r.get(e),
|
|
2994
|
+
const s = r.get(e), i = () => {
|
|
2970
2995
|
const s = r.get(e);
|
|
2971
2996
|
if (s && s.watcherCallbacks) {
|
|
2972
2997
|
const e = s.watcherCallbacks.indexOf(t);
|
|
2973
2998
|
e > -1 && s.watcherCallbacks.splice(e, 1);
|
|
2974
2999
|
}
|
|
2975
3000
|
};
|
|
2976
|
-
return n(
|
|
3001
|
+
return n(i), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2977
3002
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2978
3003
|
basename: path$2.basename(e),
|
|
2979
3004
|
dirname: path$2.dirname(e),
|
|
@@ -2983,7 +3008,7 @@ const createSystem = e => {
|
|
|
2983
3008
|
data: void 0
|
|
2984
3009
|
}), {
|
|
2985
3010
|
close() {
|
|
2986
|
-
i
|
|
3011
|
+
o(i), i();
|
|
2987
3012
|
}
|
|
2988
3013
|
};
|
|
2989
3014
|
},
|
|
@@ -2996,18 +3021,18 @@ const createSystem = e => {
|
|
|
2996
3021
|
return "number" == typeof t && (s = s.substr(0, t)), s;
|
|
2997
3022
|
},
|
|
2998
3023
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
2999
|
-
let r, s = 0, n = !1,
|
|
3024
|
+
let r, s = 0, n = !1, o = !1, i = 0;
|
|
3000
3025
|
const a = new Map, l = [], c = [], u = Math.max(Math.min(t, e.hardwareConcurrency), 2) - 1, d = Promise.resolve(), h = e => console.error(e), p = () => {
|
|
3001
3026
|
let t = null;
|
|
3002
|
-
const s = e.getCompilerExecutingPath(),
|
|
3003
|
-
name: "stencil.worker." +
|
|
3027
|
+
const s = e.getCompilerExecutingPath(), o = {
|
|
3028
|
+
name: "stencil.worker." + i++
|
|
3004
3029
|
};
|
|
3005
3030
|
try {
|
|
3006
|
-
t = new Worker(s,
|
|
3031
|
+
t = new Worker(s, o);
|
|
3007
3032
|
} catch (e) {
|
|
3008
3033
|
null == r && (r = new Blob([ `importScripts('${s}');` ], {
|
|
3009
3034
|
type: "application/javascript"
|
|
3010
|
-
})), t = new Worker(URL.createObjectURL(r),
|
|
3035
|
+
})), t = new Worker(URL.createObjectURL(r), o);
|
|
3011
3036
|
}
|
|
3012
3037
|
const l = {
|
|
3013
3038
|
worker: t,
|
|
@@ -3036,7 +3061,7 @@ const createSystem = e => {
|
|
|
3036
3061
|
} else t = p(), c.push(t);
|
|
3037
3062
|
t.activeTasks++, t.sendQueue.push(e);
|
|
3038
3063
|
}, g = () => {
|
|
3039
|
-
|
|
3064
|
+
o = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
3040
3065
|
}, y = (...e) => new Promise(((t, r) => {
|
|
3041
3066
|
if (n) r("task canceled"); else {
|
|
3042
3067
|
const n = {
|
|
@@ -3046,7 +3071,7 @@ const createSystem = e => {
|
|
|
3046
3071
|
l.push(n), a.set(n.stencilId, {
|
|
3047
3072
|
resolve: t,
|
|
3048
3073
|
reject: r
|
|
3049
|
-
}),
|
|
3074
|
+
}), o || (o = !0, d.then(g));
|
|
3050
3075
|
}
|
|
3051
3076
|
}));
|
|
3052
3077
|
return {
|
|
@@ -3077,11 +3102,11 @@ const createSystem = e => {
|
|
|
3077
3102
|
return S.resolveModuleId = e => ((e, t, r) => {
|
|
3078
3103
|
const s = ((e, t, r) => ({
|
|
3079
3104
|
async isFile(s, n) {
|
|
3080
|
-
const
|
|
3081
|
-
if ((await t.stat(
|
|
3082
|
-
if (shouldFetchModule(
|
|
3083
|
-
const r = getNodeModuleFetchUrl(e, packageVersions,
|
|
3084
|
-
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r,
|
|
3105
|
+
const o = normalizeFsPath(s);
|
|
3106
|
+
if ((await t.stat(o)).isFile) n(null, !0); else {
|
|
3107
|
+
if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
|
|
3108
|
+
const r = getNodeModuleFetchUrl(e, packageVersions, o);
|
|
3109
|
+
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
|
|
3085
3110
|
}
|
|
3086
3111
|
n(null, !1);
|
|
3087
3112
|
}
|
|
@@ -3094,7 +3119,7 @@ const createSystem = e => {
|
|
|
3094
3119
|
void s(null, !0);
|
|
3095
3120
|
if (isCommonDirModuleFile(n)) return void s(null, !1);
|
|
3096
3121
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
3097
|
-
const
|
|
3122
|
+
const o = getCommonDirUrl(e, packageVersions, n, r), i = getCommonDirName(n, r), a = await fetchModuleAsync(e, t, packageVersions, o, i);
|
|
3098
3123
|
if (isString(a)) return void s(null, !0);
|
|
3099
3124
|
}
|
|
3100
3125
|
}
|
|
@@ -3113,13 +3138,13 @@ const createSystem = e => {
|
|
|
3113
3138
|
}))(e, null, r.exts);
|
|
3114
3139
|
return s.basedir = path$2.dirname(normalizeFsPath(r.containingFile)), r.packageFilter ? s.packageFilter = r.packageFilter : null !== r.packageFilter && (s.packageFilter = e => (isString(e.main) && "" !== e.main || (e.main = "package.json"),
|
|
3115
3140
|
e)), new Promise(((e, t) => {
|
|
3116
|
-
resolve(r.moduleId, s, ((s, n,
|
|
3141
|
+
resolve(r.moduleId, s, ((s, n, o) => {
|
|
3117
3142
|
if (s) t(s); else {
|
|
3118
3143
|
n = normalizePath(n);
|
|
3119
3144
|
const t = {
|
|
3120
3145
|
moduleId: r.moduleId,
|
|
3121
3146
|
resolveId: n,
|
|
3122
|
-
pkgData:
|
|
3147
|
+
pkgData: o,
|
|
3123
3148
|
pkgDirPath: getPackageDirPath(n, r.moduleId)
|
|
3124
3149
|
};
|
|
3125
3150
|
e(t);
|
|
@@ -3159,7 +3184,7 @@ const createSystem = e => {
|
|
|
3159
3184
|
t = e;
|
|
3160
3185
|
}
|
|
3161
3186
|
}
|
|
3162
|
-
}), !function
|
|
3187
|
+
}), !function o(e) {
|
|
3163
3188
|
return "diskReads" in e && "diskWrites" in e;
|
|
3164
3189
|
}(r)) throw new Error("could not generate TestingSystem");
|
|
3165
3190
|
return r;
|
|
@@ -3331,8 +3356,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3331
3356
|
waitForVisible() {
|
|
3332
3357
|
return new Promise(((e, t) => {
|
|
3333
3358
|
const r = setInterval((async () => {
|
|
3334
|
-
await this.isVisible() && (clearInterval(r), clearTimeout(
|
|
3335
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`),
|
|
3359
|
+
await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
|
|
3360
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3336
3361
|
clearTimeout(r), t(n);
|
|
3337
3362
|
}), s);
|
|
3338
3363
|
}));
|
|
@@ -3340,8 +3365,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3340
3365
|
waitForNotVisible() {
|
|
3341
3366
|
return new Promise(((e, t) => {
|
|
3342
3367
|
const r = setInterval((async () => {
|
|
3343
|
-
await this.isVisible() || (clearInterval(r), clearTimeout(
|
|
3344
|
-
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`),
|
|
3368
|
+
await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
|
|
3369
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3345
3370
|
clearTimeout(r), t(n);
|
|
3346
3371
|
}), s);
|
|
3347
3372
|
}));
|
|
@@ -3592,19 +3617,23 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3592
3617
|
} catch (e) {}
|
|
3593
3618
|
}(this.browser), this.browser = null;
|
|
3594
3619
|
}
|
|
3620
|
+
getVmContext() {
|
|
3621
|
+
return super.getVmContext();
|
|
3622
|
+
}
|
|
3595
3623
|
};
|
|
3596
3624
|
}, exports.createTestRunner = function createTestRunner() {
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3625
|
+
var e;
|
|
3626
|
+
const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
|
|
3627
|
+
return class r extends t {
|
|
3628
|
+
async runTests(e, t, r, s, n, o) {
|
|
3629
|
+
const i = process.env;
|
|
3601
3630
|
if (e = e.filter((e => function t(e, r) {
|
|
3602
3631
|
const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
|
|
3603
3632
|
return !("true" !== r.__STENCIL_E2E_TESTS__ || !s) || "true" === r.__STENCIL_SPEC_TESTS__ && !s;
|
|
3604
|
-
}(e.path,
|
|
3605
|
-
const a = JSON.parse(
|
|
3606
|
-
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l],
|
|
3607
|
-
} else await super.runTests(e, t, r, s, n,
|
|
3633
|
+
}(e.path, i))), "true" === i.__STENCIL_SCREENSHOT__) {
|
|
3634
|
+
const a = JSON.parse(i.__STENCIL_EMULATE_CONFIGS__);
|
|
3635
|
+
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r, s, n, o);
|
|
3636
|
+
} else await super.runTests(e, t, r, s, n, o);
|
|
3608
3637
|
}
|
|
3609
3638
|
};
|
|
3610
3639
|
}, exports.createTesting = async e => {
|
|
@@ -3616,14 +3645,14 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3616
3645
|
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3617
3646
|
}(e);
|
|
3618
3647
|
const {createCompiler: r} = require("../compiler/stencil.js"), s = await r(e);
|
|
3619
|
-
let n,
|
|
3620
|
-
const
|
|
3648
|
+
let n, o;
|
|
3649
|
+
const i = async () => {
|
|
3621
3650
|
const t = [];
|
|
3622
3651
|
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), n && (n.close && t.push(n.close()),
|
|
3623
|
-
n = null),
|
|
3652
|
+
n = null), o && (o.close && t.push(o.close()), o = null), await Promise.all(t);
|
|
3624
3653
|
};
|
|
3625
3654
|
return {
|
|
3626
|
-
destroy:
|
|
3655
|
+
destroy: i,
|
|
3627
3656
|
run: async (t = {}) => {
|
|
3628
3657
|
let r, a = !1, l = !1, c = null;
|
|
3629
3658
|
const u = [];
|
|
@@ -3646,9 +3675,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3646
3675
|
})), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3647
3676
|
e.devServer.reloadStrategy = null;
|
|
3648
3677
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3649
|
-
if (n = l[0],
|
|
3678
|
+
if (n = l[0], o = l[1], t) {
|
|
3650
3679
|
const r = await t;
|
|
3651
|
-
if (!r || !e.watch && hasError(r && r.diagnostics)) return await
|
|
3680
|
+
if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
|
|
3652
3681
|
}
|
|
3653
3682
|
n && (r.__STENCIL_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__STENCIL_BROWSER_URL__}`),
|
|
3654
3683
|
r.__STENCIL_APP_SCRIPT_URL__ = function d(e, t) {
|
|
@@ -3682,13 +3711,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3682
3711
|
waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
|
|
3683
3712
|
pixelmatchModulePath: s
|
|
3684
3713
|
}), e.flags.updateScreenshot || await r.pullMasterBuild(), n.finish("screenshot, initBuild finished");
|
|
3685
|
-
const
|
|
3686
|
-
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(
|
|
3714
|
+
const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
|
|
3715
|
+
t.__STENCIL_SCREENSHOT_BUILD__ = r.toJson(i, a);
|
|
3687
3716
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3688
3717
|
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3689
3718
|
try {
|
|
3690
3719
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3691
|
-
let s = await r.completeBuild(
|
|
3720
|
+
let s = await r.completeBuild(i);
|
|
3692
3721
|
if (t.finish("screenshot, completeTimespan finished"), s) {
|
|
3693
3722
|
const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
|
|
3694
3723
|
if (s = await r.publishBuild(s), t.finish("screenshot, publishBuild finished"),
|
|
@@ -3770,19 +3799,19 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3770
3799
|
const t = process.env;
|
|
3771
3800
|
"true" === t.__STENCIL_SCREENSHOT__ ? e.compareScreenshot = (r, s) => {
|
|
3772
3801
|
const n = global;
|
|
3773
|
-
let
|
|
3774
|
-
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (
|
|
3775
|
-
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (
|
|
3776
|
-
"object" == typeof s && (
|
|
3777
|
-
|
|
3778
|
-
if (n.screenshotDescriptions.has(
|
|
3779
|
-
return n.screenshotDescriptions.add(
|
|
3802
|
+
let o, i = "", a = "";
|
|
3803
|
+
if (n.currentSpec && ("string" == typeof n.currentSpec.fullName && (i = n.currentSpec.fullName),
|
|
3804
|
+
"string" == typeof n.currentSpec.testPath && (a = n.currentSpec.testPath)), "string" == typeof r ? (i.length > 0 ? i += ", " + r : i = r,
|
|
3805
|
+
"object" == typeof s && (o = s)) : "object" == typeof r && (o = r), i = i.trim(),
|
|
3806
|
+
o = o || {}, !i) throw new Error(`Invalid screenshot description in "${a}"`);
|
|
3807
|
+
if (n.screenshotDescriptions.has(i)) throw new Error(`Screenshot description "${i}" found in "${a}" cannot be used for multiple screenshots and must be unique. To make screenshot descriptions unique within the same test, use the first argument to "compareScreenshot", such as "compareScreenshot('more to the description')".`);
|
|
3808
|
+
return n.screenshotDescriptions.add(i), async function l(e, t, r, s, n) {
|
|
3780
3809
|
if ("string" != typeof t.__STENCIL_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
|
|
3781
3810
|
if ("string" != typeof t.__STENCIL_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
3782
|
-
const
|
|
3811
|
+
const o = JSON.parse(t.__STENCIL_EMULATE__), i = JSON.parse(t.__STENCIL_SCREENSHOT_BUILD__);
|
|
3783
3812
|
await function a(e) {
|
|
3784
3813
|
return new Promise((t => setTimeout(t, e)));
|
|
3785
|
-
}(
|
|
3814
|
+
}(i.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
|
|
3786
3815
|
window.requestAnimationFrame((() => {
|
|
3787
3816
|
e();
|
|
3788
3817
|
}));
|
|
@@ -3800,11 +3829,11 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3800
3829
|
width: e.clip.width,
|
|
3801
3830
|
height: e.clip.height
|
|
3802
3831
|
}), t;
|
|
3803
|
-
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold :
|
|
3804
|
-
let h =
|
|
3832
|
+
}(n), u = await e.screenshot(l), d = "number" == typeof n.pixelmatchThreshold ? n.pixelmatchThreshold : i.pixelmatchThreshold;
|
|
3833
|
+
let h = o.viewport.width, p = o.viewport.height;
|
|
3805
3834
|
return n && n.clip && ("number" == typeof n.clip.width && (h = n.clip.width), "number" == typeof n.clip.height && (p = n.clip.height)),
|
|
3806
|
-
await compareScreenshot(
|
|
3807
|
-
}(e, t,
|
|
3835
|
+
await compareScreenshot(o, i, u, r, h, p, s, d);
|
|
3836
|
+
}(e, t, i, a, o);
|
|
3808
3837
|
} : e.compareScreenshot = async () => ({
|
|
3809
3838
|
mismatchedPixels: 0,
|
|
3810
3839
|
allowableMismatchedPixels: 1,
|
|
@@ -3852,13 +3881,13 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3852
3881
|
e();
|
|
3853
3882
|
}))));
|
|
3854
3883
|
};
|
|
3855
|
-
const
|
|
3884
|
+
const o = !0 === e.failOnConsoleError, i = !0 === e.failOnNetworkError;
|
|
3856
3885
|
t.on("console", (e => {
|
|
3857
3886
|
"error" === e.type() && (r.push({
|
|
3858
3887
|
type: "error",
|
|
3859
3888
|
message: e.text(),
|
|
3860
3889
|
location: e.location().url
|
|
3861
|
-
}),
|
|
3890
|
+
}), o && fail(new Error(serializeConsoleMessage(e)))), function t(e) {
|
|
3862
3891
|
const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
|
|
3863
3892
|
"debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
|
|
3864
3893
|
}(e);
|
|
@@ -3873,7 +3902,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3873
3902
|
type: "requestfailed",
|
|
3874
3903
|
message: e.failure().errorText,
|
|
3875
3904
|
location: e.url()
|
|
3876
|
-
}),
|
|
3905
|
+
}), i ? fail(new Error(e.failure().errorText)) : console.error("requestfailed", e.url());
|
|
3877
3906
|
})), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
|
|
3878
3907
|
waitUntil: e.waitUntil
|
|
3879
3908
|
}) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
|
|
@@ -3939,7 +3968,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3939
3968
|
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
3940
3969
|
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
3941
3970
|
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
3942
|
-
})),
|
|
3971
|
+
})), o = (e => {
|
|
3943
3972
|
const t = e.some((e => e.htmlTagNames.includes("slot"))), r = e.some((e => "shadow" === e.encapsulation)), s = e.some((e => "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot"))), n = {
|
|
3944
3973
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
3945
3974
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
@@ -3999,8 +4028,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3999
4028
|
return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
|
|
4000
4029
|
n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
|
|
4001
4030
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4002
|
-
if (e.strictBuild ? Object.assign(appData.BUILD,
|
|
4003
|
-
!0 ===
|
|
4031
|
+
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
|
|
4032
|
+
!0 === o[e] && (appData.BUILD[e] = !0);
|
|
4004
4033
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4005
4034
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4006
4035
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
@@ -4030,10 +4059,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4030
4059
|
testing.renderVdom(t, e.template());
|
|
4031
4060
|
} else "string" == typeof e.html && (s.body.innerHTML = e.html);
|
|
4032
4061
|
!1 !== e.flushQueue && await s.waitForChanges();
|
|
4033
|
-
let
|
|
4062
|
+
let i = null;
|
|
4034
4063
|
return Object.defineProperty(s, "root", {
|
|
4035
4064
|
get() {
|
|
4036
|
-
if (null ==
|
|
4065
|
+
if (null == i && (i = findRootComponent(t, s.body)), null != i) return i;
|
|
4037
4066
|
const e = s.body.firstElementChild;
|
|
4038
4067
|
return null != e ? e : null;
|
|
4039
4068
|
}
|