@stencil/core 2.17.4 → 2.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/cli/index.cjs +285 -220
  2. package/cli/index.d.ts +1 -0
  3. package/cli/index.js +285 -220
  4. package/cli/package.json +1 -1
  5. package/compiler/lib.dom.d.ts +620 -89
  6. package/compiler/lib.dom.iterable.d.ts +27 -3
  7. package/compiler/lib.es2015.core.d.ts +3 -3
  8. package/compiler/lib.es2015.iterable.d.ts +2 -1
  9. package/compiler/lib.es2015.reflect.d.ts +1 -1
  10. package/compiler/lib.es2020.bigint.d.ts +7 -5
  11. package/compiler/lib.es2020.d.ts +2 -0
  12. package/compiler/lib.es2020.date.d.ts +44 -0
  13. package/compiler/lib.es2020.intl.d.ts +51 -11
  14. package/compiler/lib.es2020.number.d.ts +30 -0
  15. package/compiler/lib.es2021.intl.d.ts +106 -4
  16. package/compiler/lib.es2022.array.d.ts +123 -0
  17. package/compiler/lib.es2022.d.ts +26 -0
  18. package/compiler/lib.es2022.error.d.ts +75 -0
  19. package/compiler/lib.es2022.full.d.ts +25 -0
  20. package/compiler/lib.es2022.intl.d.ts +111 -0
  21. package/compiler/lib.es2022.object.d.ts +28 -0
  22. package/compiler/lib.es2022.string.d.ts +27 -0
  23. package/compiler/lib.es5.d.ts +25 -19
  24. package/compiler/lib.esnext.d.ts +1 -1
  25. package/compiler/lib.esnext.intl.d.ts +4 -1
  26. package/compiler/lib.webworker.d.ts +236 -40
  27. package/compiler/lib.webworker.iterable.d.ts +10 -3
  28. package/compiler/package.json +1 -1
  29. package/compiler/stencil.d.ts +2 -2
  30. package/compiler/stencil.js +47263 -45624
  31. package/compiler/stencil.min.js +2 -2
  32. package/compiler/sys/in-memory-fs.d.ts +218 -0
  33. package/dependencies.json +10 -1
  34. package/dev-server/client/index.d.ts +2 -2
  35. package/dev-server/client/index.js +241 -241
  36. package/dev-server/client/package.json +1 -1
  37. package/dev-server/connector.html +3 -3
  38. package/dev-server/index.d.ts +1 -1
  39. package/dev-server/index.js +2 -2
  40. package/dev-server/package.json +1 -1
  41. package/dev-server/server-process.js +1198 -1167
  42. package/internal/app-data/package.json +1 -1
  43. package/internal/client/css-shim.js +2 -2
  44. package/internal/client/dom.js +1 -1
  45. package/internal/client/index.js +1022 -824
  46. package/internal/client/package.json +1 -1
  47. package/internal/client/patch-browser.js +1 -1
  48. package/internal/client/patch-esm.js +1 -1
  49. package/internal/client/polyfills/css-shim.js +1 -1
  50. package/internal/client/shadow-css.js +1 -1
  51. package/internal/hydrate/index.js +119 -119
  52. package/internal/hydrate/package.json +1 -1
  53. package/internal/hydrate/runner.d.ts +1 -1
  54. package/internal/hydrate/runner.js +100 -100
  55. package/internal/package.json +1 -1
  56. package/internal/stencil-core/index.d.ts +8 -10
  57. package/internal/stencil-private.d.ts +77 -138
  58. package/internal/stencil-public-compiler.d.ts +44 -10
  59. package/internal/stencil-public-runtime.d.ts +15 -4
  60. package/internal/testing/index.js +148 -148
  61. package/internal/testing/package.json +1 -1
  62. package/mock-doc/index.cjs +534 -518
  63. package/mock-doc/index.d.ts +13 -12
  64. package/mock-doc/index.js +534 -518
  65. package/mock-doc/package.json +1 -1
  66. package/package.json +23 -32
  67. package/readme.md +27 -33
  68. package/screenshot/index.d.ts +1 -1
  69. package/screenshot/index.js +13 -13
  70. package/screenshot/package.json +1 -1
  71. package/screenshot/pixel-match.js +983 -849
  72. package/sys/node/glob.js +1 -1
  73. package/sys/node/index.d.ts +2 -0
  74. package/sys/node/index.js +374 -373
  75. package/sys/node/package.json +1 -1
  76. package/sys/node/worker.js +1 -1
  77. package/testing/index.d.ts +6 -6
  78. package/testing/index.js +427 -441
  79. package/testing/jest/jest-config.d.ts +1 -1
  80. package/testing/matchers/index.d.ts +3 -3
  81. package/testing/mock-fetch.d.ts +1 -1
  82. package/testing/mocks.d.ts +2 -2
  83. package/testing/package.json +1 -1
  84. package/testing/puppeteer/puppeteer-element.d.ts +2 -2
  85. package/testing/puppeteer/puppeteer-events.d.ts +1 -1
  86. package/testing/testing-logger.d.ts +1 -1
  87. package/testing/testing-utils.d.ts +5 -4
  88. package/testing/testing.d.ts +1 -1
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Testing v2.17.4 | MIT Licensed | https://stenciljs.com
2
+ Stencil Testing v2.18.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _lazyRequire(e) {
5
5
  return new Proxy({}, {
@@ -69,22 +69,90 @@ async function startPuppeteerBrowser(e) {
69
69
  i;
70
70
  }
71
71
 
72
- function getAppStyleUrl(e, t) {
73
- return e.globalStyle ? getAppUrl(e, t, `${e.fsNamespace}.css`) : null;
72
+ function transpile(e, t = {}) {
73
+ t = {
74
+ ...t,
75
+ componentExport: null,
76
+ componentMetadata: "compilerstatic",
77
+ coreImportPath: isString(t.coreImportPath) ? t.coreImportPath : "@stencil/core/internal/testing",
78
+ currentDirectory: t.currentDirectory || process.cwd(),
79
+ module: "cjs",
80
+ proxy: null,
81
+ sourceMap: "inline",
82
+ style: null,
83
+ styleImportData: "queryparams",
84
+ target: "es2015"
85
+ };
86
+ try {
87
+ const e = process.versions.node.split(".");
88
+ parseInt(e[0], 10) >= 10 && (t.target = "es2017");
89
+ } catch (e) {}
90
+ return stencil_js.transpileSync(e, t);
74
91
  }
75
92
 
76
- function getAppUrl(e, t, r) {
77
- const s = e.outputTargets.find(isOutputTargetWww);
78
- if (s) {
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
- }
82
- const n = e.outputTargets.find(isOutputTargetDistLazy);
83
- if (n) {
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
- }
87
- return t;
93
+ function formatDiagnostic(e) {
94
+ let t = "";
95
+ return e.relFilePath && (t += e.relFilePath, "number" == typeof e.lineNumber && (t += ":" + e.lineNumber + 1,
96
+ "number" == typeof e.columnNumber && (t += ":" + e.columnNumber)), t += "\n"), t += e.messageText,
97
+ t;
98
+ }
99
+
100
+ function getCompilerOptions(e) {
101
+ if (_tsCompilerOptions) return _tsCompilerOptions;
102
+ if ("string" != typeof e) return null;
103
+ e = normalizePath(e);
104
+ const t = stencil_js.ts.findConfigFile(e, stencil_js.ts.sys.fileExists);
105
+ if (!t) return null;
106
+ const r = stencil_js.ts.readConfigFile(t, stencil_js.ts.sys.readFile);
107
+ if (r.error) throw new Error(formatDiagnostic((e => {
108
+ const t = {
109
+ level: "warn",
110
+ type: "typescript",
111
+ language: "typescript",
112
+ header: "TypeScript",
113
+ code: e.code.toString(),
114
+ messageText: flattenDiagnosticMessageText(e, e.messageText),
115
+ relFilePath: null,
116
+ absFilePath: null,
117
+ lines: []
118
+ };
119
+ if (1 === e.category && (t.level = "error"), e.file) {
120
+ 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), o = {
122
+ lineIndex: n.line,
123
+ lineNumber: n.line + 1,
124
+ text: s[n.line],
125
+ errorCharStart: n.character,
126
+ errorLength: Math.max(e.length, 1)
127
+ };
128
+ if (t.lineNumber = o.lineNumber, t.columnNumber = o.errorCharStart + 1, t.lines.push(o),
129
+ 0 === o.errorLength && o.errorCharStart > 0 && (o.errorLength = 1, o.errorCharStart--),
130
+ o.lineIndex > 0) {
131
+ const e = {
132
+ lineIndex: o.lineIndex - 1,
133
+ lineNumber: o.lineNumber - 1,
134
+ text: s[o.lineIndex - 1],
135
+ errorCharStart: -1,
136
+ errorLength: -1
137
+ };
138
+ t.lines.unshift(e);
139
+ }
140
+ if (o.lineIndex + 1 < s.length) {
141
+ const e = {
142
+ lineIndex: o.lineIndex + 1,
143
+ lineNumber: o.lineNumber + 1,
144
+ text: s[o.lineIndex + 1],
145
+ errorCharStart: -1,
146
+ errorLength: -1
147
+ };
148
+ t.lines.push(e);
149
+ }
150
+ }
151
+ var r;
152
+ return t;
153
+ })(r.error)));
154
+ const s = stencil_js.ts.parseJsonConfigFileContent(r.config, stencil_js.ts.sys, e, void 0, t);
155
+ return _tsCompilerOptions = s.options, _tsCompilerOptions;
88
156
  }
89
157
 
90
158
  function setScreenshotEmulateData(e, t) {
@@ -181,106 +249,15 @@ async function runJest(e, t) {
181
249
  return r;
182
250
  }
183
251
 
184
- function createBuildId() {
185
- const e = new Date;
186
- let t = e.getFullYear() + "";
187
- return t += ("0" + (e.getMonth() + 1)).slice(-2), t += ("0" + e.getDate()).slice(-2),
188
- t += ("0" + e.getHours()).slice(-2), t += ("0" + e.getMinutes()).slice(-2), t += ("0" + e.getSeconds()).slice(-2),
189
- t;
190
- }
191
-
192
- function createBuildMessage() {
193
- const e = new Date;
194
- let t = e.getFullYear() + "-";
195
- return t += ("0" + (e.getMonth() + 1)).slice(-2) + "-", t += ("0" + e.getDate()).slice(-2) + " ",
196
- t += ("0" + e.getHours()).slice(-2) + ":", t += ("0" + e.getMinutes()).slice(-2) + ":",
197
- t += ("0" + e.getSeconds()).slice(-2), `Build: ${t}`;
198
- }
199
-
200
- function transpile(e, t = {}) {
201
- t = {
202
- ...t,
203
- componentExport: null,
204
- componentMetadata: "compilerstatic",
205
- coreImportPath: isString(t.coreImportPath) ? t.coreImportPath : "@stencil/core/internal/testing",
206
- currentDirectory: t.currentDirectory || process.cwd(),
207
- module: "cjs",
208
- proxy: null,
209
- sourceMap: "inline",
210
- style: null,
211
- styleImportData: "queryparams",
212
- target: "es2015"
252
+ function toHaveClasses(e, t) {
253
+ if (!e) throw new Error("expect toHaveClasses value is null");
254
+ if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
255
+ if (1 !== e.nodeType) throw new Error("expect toHaveClasses value is not an element");
256
+ const r = t.every((t => e.classList.contains(t)));
257
+ return {
258
+ message: () => `expected to ${r ? "not " : ""}have css classes "${t.join(" ")}", but className is "${e.className}"`,
259
+ pass: r
213
260
  };
214
- try {
215
- const e = process.versions.node.split(".");
216
- parseInt(e[0], 10) >= 10 && (t.target = "es2017");
217
- } catch (e) {}
218
- return stencil_js.transpileSync(e, t);
219
- }
220
-
221
- function formatDiagnostic(e) {
222
- let t = "";
223
- return e.relFilePath && (t += e.relFilePath, "number" == typeof e.lineNumber && (t += ":" + e.lineNumber + 1,
224
- "number" == typeof e.columnNumber && (t += ":" + e.columnNumber)), t += "\n"), t += e.messageText,
225
- t;
226
- }
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
261
  }
285
262
 
286
263
  function compareHtml(e, t, r) {
@@ -326,17 +303,6 @@ function compareHtml(e, t, r) {
326
303
  };
327
304
  }
328
305
 
329
- function toHaveClasses(e, t) {
330
- if (!e) throw new Error("expect toHaveClasses value is null");
331
- if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
332
- if (1 !== e.nodeType) throw new Error("expect toHaveClasses value is not an element");
333
- const r = t.every((t => e.classList.contains(t)));
334
- return {
335
- message: () => `expected to ${r ? "not " : ""}have css classes "${t.join(" ")}", but className is "${e.className}"`,
336
- pass: r
337
- };
338
- }
339
-
340
306
  async function globalMockFetch(e) {
341
307
  let t;
342
308
  if (null == e) throw new Error("missing url input for mock fetch()");
@@ -524,58 +490,43 @@ function mockCompilerCtx(e) {
524
490
  return Object.defineProperty(t, "fs", {
525
491
  get() {
526
492
  return null == this._fs && (this._fs = (e => {
527
- const t = new Map, r = new Map, s = async e => {
528
- const t = b(e);
529
- if ("boolean" == typeof t.exists) return {
530
- exists: t.exists,
531
- isDirectory: t.isDirectory,
532
- isFile: t.isFile
533
- };
534
- const r = {
535
- exists: !1,
536
- isDirectory: !1,
537
- isFile: !1
538
- }, s = await c(e);
539
- return s ? (t.exists = s.exists, t.isDirectory = s.isDirectory, t.isFile = s.isFile,
540
- r.exists = t.exists, r.isDirectory = t.isDirectory, r.isFile = t.isFile) : t.exists = !1,
541
- r;
542
- }, n = async (e, r = {}) => {
493
+ const t = new Map, r = new Map, s = async (e, r = {}) => {
543
494
  e = normalizePath(e);
544
495
  const s = [];
545
496
  if (!0 === r.inMemoryOnly) {
546
497
  let n = e;
547
498
  n.endsWith("/") || (n += "/");
548
- const o = e.split("/");
499
+ const i = e.split("/");
549
500
  t.forEach(((t, n) => {
550
501
  if (!n.startsWith(e)) return;
551
502
  const a = n.split("/");
552
- if ((a.length === o.length + 1 || r.recursive && a.length > o.length) && t.exists) {
503
+ if ((a.length === i.length + 1 || r.recursive && a.length > i.length) && t.exists) {
553
504
  const e = {
554
505
  absPath: n,
555
- relPath: a[o.length],
506
+ relPath: a[i.length],
556
507
  isDirectory: t.isDirectory,
557
508
  isFile: t.isFile
558
509
  };
559
- i(r, e) || s.push(e);
510
+ o(r, e) || s.push(e);
560
511
  }
561
512
  }));
562
- } else await o(e, e, r, s);
513
+ } else await n(e, e, r, s);
563
514
  return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
564
- }, o = async (t, r, s, n) => {
515
+ }, n = async (t, r, s, i) => {
565
516
  const a = await e.readDir(r);
566
517
  if (a.length > 0) {
567
- const e = b(r);
518
+ const e = v(r);
568
519
  e.exists = !0, e.isFile = !1, e.isDirectory = !0, await Promise.all(a.map((async e => {
569
- const r = normalizePath(e), a = normalizePath(path$2.relative(t, r)), l = await c(r), u = {
520
+ const r = normalizePath(e), a = normalizePath(path$2.relative(t, r)), c = await l(r), u = {
570
521
  absPath: r,
571
522
  relPath: a,
572
- isDirectory: l.isDirectory,
573
- isFile: l.isFile
523
+ isDirectory: c.isDirectory,
524
+ isFile: c.isFile
574
525
  };
575
- i(s, u) || (n.push(u), !0 === s.recursive && !0 === l.isDirectory && await o(t, r, s, n));
526
+ o(s, u) || (i.push(u), !0 === s.recursive && !0 === c.isDirectory && await n(t, r, s, i));
576
527
  })));
577
528
  }
578
- }, i = (e, t) => {
529
+ }, o = (e, t) => {
579
530
  if (t.isDirectory) {
580
531
  if (Array.isArray(e.excludeDirNames)) {
581
532
  const r = path$2.basename(t.absPath);
@@ -586,20 +537,20 @@ function mockCompilerCtx(e) {
586
537
  if (e.excludeExtensions.some((e => r.endsWith(e)))) return !0;
587
538
  }
588
539
  return !1;
589
- }, a = async e => {
590
- const t = b(e);
540
+ }, i = async e => {
541
+ const t = v(e);
591
542
  t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
592
543
  try {
593
- const t = await n(e, {
544
+ const t = await s(e, {
594
545
  recursive: !0
595
546
  });
596
- await Promise.all(t.map((e => e.relPath.endsWith(".gitkeep") ? null : l(e.absPath))));
547
+ await Promise.all(t.map((e => e.relPath.endsWith(".gitkeep") ? null : a(e.absPath))));
597
548
  } catch (e) {}
598
- }, l = async e => {
599
- const t = b(e);
549
+ }, a = async e => {
550
+ const t = v(e);
600
551
  t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
601
- }, c = async t => {
602
- const r = b(t);
552
+ }, l = async t => {
553
+ const r = v(t);
603
554
  if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
604
555
  const s = await e.stat(t);
605
556
  s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
@@ -612,8 +563,8 @@ function mockCompilerCtx(e) {
612
563
  isDirectory: !!r.isDirectory,
613
564
  size: "number" == typeof r.size ? r.size : 0
614
565
  };
615
- }, u = t => {
616
- const r = b(t);
566
+ }, c = t => {
567
+ const r = v(t);
617
568
  if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
618
569
  const s = e.statSync(t);
619
570
  s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
@@ -623,9 +574,10 @@ function mockCompilerCtx(e) {
623
574
  return {
624
575
  exists: !!r.exists,
625
576
  isFile: !!r.isFile,
626
- isDirectory: !!r.isDirectory
577
+ isDirectory: !!r.isDirectory,
578
+ size: r.size
627
579
  };
628
- }, d = async (t, s, n) => {
580
+ }, u = async (t, s, n) => {
629
581
  if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
630
582
  if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
631
583
  const o = {
@@ -634,60 +586,60 @@ function mockCompilerCtx(e) {
634
586
  queuedWrite: !1
635
587
  };
636
588
  if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
637
- const i = b(t);
589
+ const i = v(t);
638
590
  if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
639
591
  "string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : o.changedContent = !0,
640
592
  i.fileText = s, o.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
641
593
  !1 === n.useCache && (i.useCache = !1)), null != n && !0 === n.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
642
- await h(t, !0); else if (null != n && !0 === n.immediateWrite) {
594
+ await d(t, !0); else if (null != n && !0 === n.immediateWrite) {
643
595
  if (o.changedContent || !0 !== n.useCache) {
644
596
  const r = await e.readFile(t);
645
597
  "string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
646
- o.changedContent && (await h(t, !1), await e.writeFile(t, i.fileText));
598
+ o.changedContent && (await d(t, !1), await e.writeFile(t, i.fileText));
647
599
  }
648
600
  } else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
649
601
  o.queuedWrite = !0);
650
602
  return o;
651
- }, h = async (e, t) => {
603
+ }, d = async (e, t) => {
652
604
  const r = [];
653
605
  for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
654
- r.reverse(), await p(r, t);
655
- }, p = async (t, r) => {
606
+ r.reverse(), await h(r, t);
607
+ }, h = async (t, r) => {
656
608
  const s = [];
657
609
  for (const n of t) {
658
- const t = b(n);
610
+ const t = v(n);
659
611
  if (!0 !== t.exists || !0 !== t.isDirectory) try {
660
612
  t.exists = !0, t.isDirectory = !0, t.isFile = !1, r || await e.createDir(n), s.push(n);
661
613
  } catch (e) {}
662
614
  }
663
615
  return s;
664
- }, f = t => Promise.all(t.map((async t => {
665
- const r = t[0], s = t[1];
616
+ }, p = t => Promise.all(t.map((async t => {
617
+ const [r, s] = t;
666
618
  return await e.copyFile(r, s), [ r, s ];
667
- }))), m = e => Promise.all(e.map((async e => {
619
+ }))), f = e => Promise.all(e.map((async e => {
668
620
  if ("string" != typeof e) throw new Error("unable to writeFile without filePath");
669
- return g(e);
670
- }))), g = async t => {
671
- const r = b(t);
621
+ return m(e);
622
+ }))), m = async t => {
623
+ const r = v(t);
672
624
  if (null == r.fileText) throw new Error(`unable to find item fileText to write: ${t}`);
673
- return await e.writeFile(t, r.fileText), !1 === r.useCache && v(t), t;
674
- }, y = async t => await Promise.all(t.map((async t => {
625
+ return await e.writeFile(t, r.fileText), !1 === r.useCache && _(t), t;
626
+ }, g = async t => await Promise.all(t.map((async t => {
675
627
  if ("string" != typeof t) throw new Error("unable to unlink without filePath");
676
628
  return await e.removeFile(t), t;
677
- }))), w = async t => {
629
+ }))), y = async t => {
678
630
  const r = [];
679
631
  for (const s of t) await e.removeDir(s), r.push(s);
680
632
  return r;
681
- }, _ = e => {
633
+ }, w = e => {
682
634
  e = normalizePath(e), t.forEach(((t, r) => {
683
635
  const s = path$2.relative(e, r).split("/")[0];
684
- s.startsWith(".") || s.startsWith("/") || v(r);
636
+ s.startsWith(".") || s.startsWith("/") || _(r);
685
637
  }));
686
- }, v = e => {
638
+ }, _ = e => {
687
639
  e = normalizePath(e);
688
640
  const r = t.get(e);
689
641
  null == r || r.queueWriteToDisk || t.delete(e);
690
- }, b = e => {
642
+ }, v = e => {
691
643
  e = normalizePath(e);
692
644
  let r = t.get(e);
693
645
  return null != r || t.set(e, r = {
@@ -702,36 +654,36 @@ function mockCompilerCtx(e) {
702
654
  queueWriteToDisk: null,
703
655
  useCache: null
704
656
  }), r;
705
- }, E = 5242880;
657
+ }, b = 5242880;
706
658
  return {
707
- access: async e => (await s(e)).exists,
659
+ access: async e => {
660
+ const t = v(e);
661
+ return "boolean" != typeof t.exists ? (await l(e)).exists : t.exists;
662
+ },
708
663
  accessSync: e => {
709
- const t = b(e);
710
- if ("boolean" != typeof t.exists) {
711
- const r = u(e);
712
- t.exists = r.exists, t.isDirectory = r.isDirectory, t.isFile = r.isFile;
713
- }
714
- return t.exists;
664
+ const t = v(e);
665
+ return "boolean" != typeof t.exists ? c(e).exists : t.exists;
715
666
  },
716
- accessData: s,
717
667
  cancelDeleteDirectoriesFromDisk: e => {
718
668
  for (const t of e) {
719
- const e = b(t);
669
+ const e = v(t);
720
670
  !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
721
671
  }
722
672
  },
723
673
  cancelDeleteFilesFromDisk: e => {
724
674
  for (const t of e) {
725
- const e = b(t);
675
+ const e = v(t);
726
676
  !0 === e.isFile && !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
727
677
  }
728
678
  },
729
- clearCache: () => t.clear(),
730
- clearDirCache: _,
731
- clearFileCache: v,
679
+ clearCache: () => {
680
+ t.clear();
681
+ },
682
+ clearDirCache: w,
683
+ clearFileCache: _,
732
684
  commit: async () => {
733
- 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);
734
- return e.filesToDelete.forEach(v), e.dirsToDelete.forEach(_), {
685
+ const e = getCommitInstructions(t), r = await h(e.dirsToEnsure, !1), s = await f(e.filesToWrite), n = await p(e.filesToCopy), o = await g(e.filesToDelete), i = await y(e.dirsToDelete);
686
+ return e.filesToDelete.forEach(_), e.dirsToDelete.forEach(w), {
735
687
  filesCopied: n,
736
688
  filesWritten: s,
737
689
  filesDeleted: o,
@@ -740,20 +692,20 @@ function mockCompilerCtx(e) {
740
692
  };
741
693
  },
742
694
  copyFile: async (e, t) => {
743
- b(e).queueCopyFileToDest = t;
695
+ v(e).queueCopyFileToDest = t;
744
696
  },
745
697
  emptyDirs: async e => {
746
698
  e = e.filter(isString).map(normalizePath).reduce(((e, t) => (e.includes(t) || e.push(t),
747
699
  e)), []);
748
- const t = await Promise.all(e.map((e => n(e, {
700
+ const t = await Promise.all(e.map((e => s(e, {
749
701
  recursive: !0
750
702
  })))), r = [];
751
703
  for (const e of t) for (const t of e) r.includes(t.absPath) || r.push(t.absPath);
752
704
  r.sort(((e, t) => {
753
705
  const r = e.split("/").length, s = t.split("/").length;
754
706
  return r < s ? 1 : r > s ? -1 : 0;
755
- })), await Promise.all(r.map(l)), e.forEach((e => {
756
- const t = b(e);
707
+ })), await Promise.all(r.map(a)), e.forEach((e => {
708
+ const t = v(e);
757
709
  t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk = !0, t.queueDeleteFromDisk = !1;
758
710
  }));
759
711
  },
@@ -767,42 +719,41 @@ function mockCompilerCtx(e) {
767
719
  });
768
720
  })), e.forEach((e => e.files.sort())), e.sort(((e, t) => e.type < t.type ? -1 : e.type > t.type ? 1 : 0));
769
721
  },
770
- getItem: b,
722
+ getItem: v,
771
723
  getMemoryStats: () => `data length: ${t.size}`,
772
- keys: () => Array.from(t.keys()).sort(),
773
724
  readFile: async (t, r) => {
774
725
  if (null == r || !0 === r.useCache || void 0 === r.useCache) {
775
- const e = b(t);
726
+ const e = v(t);
776
727
  if (e.exists && "string" == typeof e.fileText) return e.fileText;
777
728
  }
778
- const s = await e.readFile(t), n = b(t);
779
- return "string" == typeof s ? s.length < E && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
729
+ const s = await e.readFile(t), n = v(t);
730
+ return "string" == typeof s ? s.length < b && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
780
731
  n.fileText = s) : n.exists = !1, s;
781
732
  },
782
733
  readFileSync: (t, r) => {
783
734
  if (null == r || !0 === r.useCache || void 0 === r.useCache) {
784
- const e = b(t);
735
+ const e = v(t);
785
736
  if (e.exists && "string" == typeof e.fileText) return e.fileText;
786
737
  }
787
- const s = e.readFileSync(t), n = b(t);
788
- return "string" == typeof s ? s.length < E && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
738
+ const s = e.readFileSync(t), n = v(t);
739
+ return "string" == typeof s ? s.length < b && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
789
740
  n.fileText = s) : n.exists = !1, s;
790
741
  },
791
- readdir: n,
742
+ readdir: s,
792
743
  remove: async e => {
793
- const t = await c(e);
794
- !0 === t.isDirectory ? await a(e) : !0 === t.isFile && await l(e);
744
+ const t = await l(e);
745
+ !0 === t.isDirectory ? await i(e) : !0 === t.isFile && await a(e);
795
746
  },
796
- stat: c,
797
- statSync: u,
747
+ stat: l,
748
+ statSync: c,
798
749
  sys: e,
799
- writeFile: d,
750
+ writeFile: u,
800
751
  writeFiles: (e, t) => {
801
752
  const r = [];
802
753
  return isIterable(e) ? e.forEach(((e, s) => {
803
- r.push(d(s, e, t));
754
+ r.push(u(s, e, t));
804
755
  })) : Object.keys(e).map((s => {
805
- r.push(d(s, e[s], t));
756
+ r.push(u(s, e[s], t));
806
757
  })), Promise.all(r);
807
758
  }
808
759
  };
@@ -823,21 +774,6 @@ function mockLogger() {
823
774
  return new TestingLogger;
824
775
  }
825
776
 
826
- function findRootComponent(e, t) {
827
- if (null != t) {
828
- const r = t.children, s = r.length;
829
- for (let t = 0; t < s; t++) {
830
- const s = r[t];
831
- if (e.has(s.nodeName.toLowerCase())) return s;
832
- }
833
- for (let t = 0; t < s; t++) {
834
- const s = findRootComponent(e, r[t]);
835
- if (null != s) return s;
836
- }
837
- }
838
- return null;
839
- }
840
-
841
777
  async function initPageEvents(e) {
842
778
  e._e2eEvents = new Map, e._e2eEventIds = 0, e.spyOnEvent = pageSpyOnEvent.bind(e, e),
843
779
  await e.exposeFunction("stencilOnEvent", ((t, r) => {
@@ -1197,9 +1133,58 @@ function serializeConsoleMessage(e) {
1197
1133
  }(e.location())}`;
1198
1134
  }
1199
1135
 
1136
+ function findRootComponent(e, t) {
1137
+ if (null != t) {
1138
+ const r = t.children, s = r.length;
1139
+ for (let t = 0; t < s; t++) {
1140
+ const s = r[t];
1141
+ if (e.has(s.nodeName.toLowerCase())) return s;
1142
+ }
1143
+ for (let t = 0; t < s; t++) {
1144
+ const s = findRootComponent(e, r[t]);
1145
+ if (null != s) return s;
1146
+ }
1147
+ }
1148
+ return null;
1149
+ }
1150
+
1151
+ function createBuildId() {
1152
+ const e = new Date;
1153
+ let t = e.getFullYear() + "";
1154
+ return t += ("0" + (e.getMonth() + 1)).slice(-2), t += ("0" + e.getDate()).slice(-2),
1155
+ t += ("0" + e.getHours()).slice(-2), t += ("0" + e.getMinutes()).slice(-2), t += ("0" + e.getSeconds()).slice(-2),
1156
+ t;
1157
+ }
1158
+
1159
+ function createBuildMessage() {
1160
+ const e = new Date;
1161
+ let t = e.getFullYear() + "-";
1162
+ return t += ("0" + (e.getMonth() + 1)).slice(-2) + "-", t += ("0" + e.getDate()).slice(-2) + " ",
1163
+ t += ("0" + e.getHours()).slice(-2) + ":", t += ("0" + e.getMinutes()).slice(-2) + ":",
1164
+ t += ("0" + e.getSeconds()).slice(-2), `Build: ${t}`;
1165
+ }
1166
+
1167
+ function getAppStyleUrl(e, t) {
1168
+ return e.globalStyle ? getAppUrl(e, t, `${e.fsNamespace}.css`) : null;
1169
+ }
1170
+
1171
+ function getAppUrl(e, t, r) {
1172
+ const s = e.outputTargets.find(isOutputTargetWww);
1173
+ if (s) {
1174
+ const e = s.buildDir, n = path$2.join(e, r), o = path$2.relative(s.dir, n);
1175
+ return new URL(o, t).href;
1176
+ }
1177
+ const n = e.outputTargets.find(isOutputTargetDistLazy);
1178
+ if (n) {
1179
+ const s = n.esmDir, o = path$2.join(s, r), i = path$2.relative(e.rootDir, o);
1180
+ return new URL(i, t).href;
1181
+ }
1182
+ return t;
1183
+ }
1184
+
1200
1185
  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;
1201
1186
 
1202
- const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"), stencil_js = require("../compiler/stencil.js"), appData = _lazyRequire("@stencil/core/internal/app-data"), index_cjs = _lazyRequire("../mock-doc/index.cjs"), testing = _lazyRequire("@stencil/core/internal/testing"), process$3 = require("process"), os$2 = require("os"), fs$2 = require("fs"), crypto$3 = require("crypto"), child_process$2 = require("child_process"), path__default = _interopDefaultLegacy(path$2), process__namespace = _interopNamespace(process$3), os__namespace = _interopNamespace(os$2), fs__default = _interopDefaultLegacy(fs$2), formatComponentRuntimeMembers = (e, t = !0) => ({
1187
+ 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), formatComponentRuntimeMembers = (e, t = !0) => ({
1203
1188
  ...formatPropertiesRuntimeMember(e.properties),
1204
1189
  ...formatStatesRuntimeMember(e.states),
1205
1190
  ...t ? formatMethodsRuntimeMember(e.methods) : {}
@@ -1315,15 +1300,16 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
1315
1300
  const r = e.substring(0, t), s = e.substring(t).split("/"), n = s.length;
1316
1301
  return n > 0 && !s[n - 1] && s.pop(), [ r, ...s ];
1317
1302
  }, normalizeFsPath = e => normalizePath(e.split("?")[0].replace(/\0/g, "")), flattenDiagnosticMessageText = (e, t) => {
1303
+ var r, s;
1318
1304
  if ("string" == typeof t) return t;
1319
1305
  if (void 0 === t) return "";
1320
- const r = [], s = e.file.fileName.includes("stencil.config");
1321
- s && r.push(2322);
1322
- let n = "";
1323
- if (!r.includes(t.code) && (n = t.messageText, isIterable(t.next))) for (const r of t.next) n += flattenDiagnosticMessageText(e, r);
1324
- return s && (n = n.replace("type 'StencilConfig'", "Stencil Config"), n = n.replace("Object literal may only specify known properties, but ", ""),
1325
- n = n.replace("Object literal may only specify known properties, and ", "")), n.trim();
1326
- }, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www", isJest27TransformOptions = e => null != e && "object" == typeof e && e.hasOwnProperty("config");
1306
+ const n = [], o = (null !== (s = null === (r = e.file) || void 0 === r ? void 0 : r.fileName) && void 0 !== s ? s : "").includes("stencil.config");
1307
+ o && n.push(2322);
1308
+ let i = "";
1309
+ if (!n.includes(t.code) && (i = t.messageText, isIterable(t.next))) for (const r of t.next) i += flattenDiagnosticMessageText(e, r);
1310
+ return o && (i = i.replace("type 'StencilConfig'", "Stencil Config"), i = i.replace("Object literal may only specify known properties, but ", ""),
1311
+ i = i.replace("Object literal may only specify known properties, and ", "")), i.trim();
1312
+ }, isJest27TransformOptions = e => null != e && "object" == typeof e && e.hasOwnProperty("config");
1327
1313
 
1328
1314
  let _tsCompilerOptions = null, _tsCompilerOptionsKey = null;
1329
1315
 
@@ -1734,7 +1720,13 @@ const FETCH_DEFAULT_PATH = "/mock-fetch-data", HtmlSerializer = {
1734
1720
  outerHtml: !0
1735
1721
  }),
1736
1722
  test: e => null != e && (e instanceof HTMLElement || e instanceof index_cjs.MockNode)
1737
- };
1723
+ }, createConfigFlags = (e = {}) => ({
1724
+ task: null,
1725
+ args: [],
1726
+ knownArgs: [],
1727
+ unknownArgs: [],
1728
+ ...e
1729
+ });
1738
1730
 
1739
1731
  class BuildContext {
1740
1732
  constructor(e, t) {
@@ -1920,7 +1912,46 @@ class Cache {
1920
1912
  }
1921
1913
  }
1922
1914
 
1923
- const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY = "last_clear_expired_cache", CACHE_DIR_README = '# Stencil Cache Directory\n\nThis directory contains files which the compiler has\ncached for faster builds. To disable caching, please set\n"enableCache: false" within the stencil config.\n\nTo change the cache directory, please update the\n"cacheDir" property within the stencil config.\n', getCommitInstructions = e => {
1915
+ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY = "last_clear_expired_cache", CACHE_DIR_README = '# Stencil Cache Directory\n\nThis directory contains files which the compiler has\ncached for faster builds. To disable caching, please set\n"enableCache: false" within the stencil config.\n\nTo change the cache directory, please update the\n"cacheDir" property within the stencil config.\n', buildEvents = () => {
1916
+ const e = [], t = t => {
1917
+ const r = e.findIndex((e => e.callback === t));
1918
+ return r > -1 && (e.splice(r, 1), !0);
1919
+ };
1920
+ return {
1921
+ emit: (t, r) => {
1922
+ const s = t.toLowerCase().trim(), n = e.slice();
1923
+ for (const e of n) if (null == e.eventName) try {
1924
+ e.callback(t, r);
1925
+ } catch (e) {
1926
+ console.error(e);
1927
+ } else if (e.eventName === s) try {
1928
+ e.callback(r);
1929
+ } catch (e) {
1930
+ console.error(e);
1931
+ }
1932
+ },
1933
+ on: (r, s) => {
1934
+ if ("function" == typeof r) {
1935
+ const s = null, n = r;
1936
+ return e.push({
1937
+ eventName: s,
1938
+ callback: n
1939
+ }), () => t(n);
1940
+ }
1941
+ if ("string" == typeof r && "function" == typeof s) {
1942
+ const n = r.toLowerCase().trim(), o = s;
1943
+ return e.push({
1944
+ eventName: n,
1945
+ callback: o
1946
+ }), () => t(o);
1947
+ }
1948
+ return () => !1;
1949
+ },
1950
+ unsubscribeAll: () => {
1951
+ e.length = 0;
1952
+ }
1953
+ };
1954
+ }, getCommitInstructions = e => {
1924
1955
  const t = {
1925
1956
  filesToDelete: [],
1926
1957
  filesToWrite: [],
@@ -1973,12 +2004,76 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
1973
2004
  const r = t.dirsToDelete.indexOf(e);
1974
2005
  r > -1 && t.dirsToDelete.splice(r, 1);
1975
2006
  }
1976
- return t.dirsToDelete = t.dirsToDelete.filter((e => "/" !== e && !0 !== e.endsWith(":/"))),
1977
- t.dirsToEnsure = t.dirsToEnsure.filter((t => {
1978
- const r = e.get(t);
1979
- return (null == r || !0 !== r.exists || !0 !== r.isDirectory) && "/" !== t && !t.endsWith(":/");
1980
- })), t;
1981
- }, shouldIgnore = e => (e = e.trim().toLowerCase(), IGNORE.some((t => e.endsWith(t)))), IGNORE = [ ".ds_store", ".gitignore", "desktop.ini", "thumbs.db" ];
2007
+ return t.dirsToDelete = t.dirsToDelete.filter((e => "/" !== e && !0 !== e.endsWith(":/"))),
2008
+ t.dirsToEnsure = t.dirsToEnsure.filter((t => {
2009
+ const r = e.get(t);
2010
+ return (null == r || !0 !== r.exists || !0 !== r.isDirectory) && "/" !== t && !t.endsWith(":/");
2011
+ })), t;
2012
+ }, shouldIgnore = e => (e = e.trim().toLowerCase(), IGNORE.some((t => e.endsWith(t)))), IGNORE = [ ".ds_store", ".gitignore", "desktop.ini", "thumbs.db" ];
2013
+
2014
+ class TestingLogger {
2015
+ constructor() {
2016
+ this.isEnabled = !1;
2017
+ }
2018
+ setLevel(e) {}
2019
+ getLevel() {
2020
+ return "info";
2021
+ }
2022
+ enableColors(e) {}
2023
+ emoji(e) {
2024
+ return "";
2025
+ }
2026
+ info(...e) {
2027
+ this.isEnabled && console.log(...e);
2028
+ }
2029
+ warn(...e) {
2030
+ this.isEnabled && console.warn(...e);
2031
+ }
2032
+ error(...e) {
2033
+ this.isEnabled && console.error(...e);
2034
+ }
2035
+ debug(...e) {
2036
+ this.isEnabled && console.log(...e);
2037
+ }
2038
+ color(e, t) {}
2039
+ red(e) {
2040
+ return e;
2041
+ }
2042
+ green(e) {
2043
+ return e;
2044
+ }
2045
+ yellow(e) {
2046
+ return e;
2047
+ }
2048
+ blue(e) {
2049
+ return e;
2050
+ }
2051
+ magenta(e) {
2052
+ return e;
2053
+ }
2054
+ cyan(e) {
2055
+ return e;
2056
+ }
2057
+ gray(e) {
2058
+ return e;
2059
+ }
2060
+ bold(e) {
2061
+ return e;
2062
+ }
2063
+ dim(e) {
2064
+ return e;
2065
+ }
2066
+ bgRed(e) {
2067
+ return e;
2068
+ }
2069
+ createTimeSpan(e, t = !1) {
2070
+ return {
2071
+ duration: () => 0,
2072
+ finish: () => 0
2073
+ };
2074
+ }
2075
+ printDiagnostics(e) {}
2076
+ }
1982
2077
 
1983
2078
  (posix = {
1984
2079
  resolve: function e() {
@@ -2100,46 +2195,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
2100
2195
  posix: null
2101
2196
  }).posix = posix, pathBrowserify = posix;
2102
2197
 
2103
- const buildEvents = () => {
2104
- const e = [], t = t => {
2105
- const r = e.findIndex((e => e.callback === t));
2106
- return r > -1 && (e.splice(r, 1), !0);
2107
- };
2108
- return {
2109
- emit: (t, r) => {
2110
- const s = t.toLowerCase().trim(), n = e.slice();
2111
- for (const e of n) if (null == e.eventName) try {
2112
- e.callback(t, r);
2113
- } catch (e) {
2114
- console.error(e);
2115
- } else if (e.eventName === s) try {
2116
- e.callback(r);
2117
- } catch (e) {
2118
- console.error(e);
2119
- }
2120
- },
2121
- on: (r, s) => {
2122
- if ("function" == typeof r) {
2123
- const s = null, n = r;
2124
- return e.push({
2125
- eventName: s,
2126
- callback: n
2127
- }), () => t(n);
2128
- }
2129
- if ("string" == typeof r && "function" == typeof s) {
2130
- const n = r.toLowerCase().trim(), o = s;
2131
- return e.push({
2132
- eventName: n,
2133
- callback: o
2134
- }), () => t(o);
2135
- }
2136
- return () => !1;
2137
- },
2138
- unsubscribeAll: () => {
2139
- e.length = 0;
2140
- }
2141
- };
2142
- }, IS_NODE_ENV = !("undefined" == typeof global || "function" != typeof require || !global.process || "string" != typeof __filename || global.origin && "string" == typeof global.origin);
2198
+ const IS_NODE_ENV = !("undefined" == typeof global || "function" != typeof require || !global.process || "string" != typeof __filename || global.origin && "string" == typeof global.origin);
2143
2199
 
2144
2200
  IS_NODE_ENV && process.platform;
2145
2201
 
@@ -2147,74 +2203,7 @@ const IS_BROWSER_ENV = "undefined" != typeof location && "undefined" != typeof n
2147
2203
 
2148
2204
  IS_NODE_ENV && require, IS_NODE_ENV && process.cwd;
2149
2205
 
2150
- const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", 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) => {
2151
- const r = normalizePath(e).split("/"), s = (e => {
2152
- e.startsWith("~") && (e = e.substring(1));
2153
- const t = e.split("/"), r = {
2154
- moduleId: null,
2155
- filePath: null,
2156
- scope: null,
2157
- scopeSubModuleId: null
2158
- };
2159
- return e.startsWith("@") && t.length > 1 ? (r.moduleId = t.slice(0, 2).join("/"),
2160
- r.filePath = t.slice(2).join("/"), r.scope = t[0], r.scopeSubModuleId = t[1]) : (r.moduleId = t[0],
2161
- r.filePath = t.slice(1).join("/")), r;
2162
- })(t);
2163
- for (let e = r.length - 1; e >= 1; e--) if ("node_modules" === r[e - 1]) if (s.scope) {
2164
- if (r[e] === s.scope && r[e + 1] === s.scopeSubModuleId) return r.slice(0, e + 2).join("/");
2165
- } else if (r[e] === s.moduleId) return r.slice(0, e + 1).join("/");
2166
- return null;
2167
- }, packageVersions = new Map, known404Urls = new Set, getCommonDirUrl = (e, t, r, s) => getNodeModuleFetchUrl(e, t, r) + "/" + s, getNodeModuleFetchUrl = (e, t, r) => {
2168
- let s = (r = normalizePath(r)).split("/").filter((e => e.length));
2169
- const n = s.lastIndexOf("node_modules");
2170
- n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
2171
- let o = s.shift();
2172
- o.startsWith("@") && (o += "/" + s.shift());
2173
- const i = s.join("/");
2174
- return "@stencil/core" === o ? ((e, t) => {
2175
- let r = (t = normalizePath(t)).split("/");
2176
- const s = r.lastIndexOf("node_modules");
2177
- s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
2178
- t = r.join("/"));
2179
- const n = new URL("../", e).href;
2180
- return new URL("./" + t, n).href;
2181
- })(e.getCompilerExecutingPath(), i) : e.getRemoteModuleUrl({
2182
- moduleId: o,
2183
- version: t.get(o),
2184
- path: i
2185
- });
2186
- }, 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) => {
2187
- if (!((e => {
2188
- if (!(e => e.endsWith(".d.ts"))(t = e) && t.endsWith(".ts") || (e => e.endsWith(".tsx"))(e)) return !0;
2189
- var t;
2190
- const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
2191
- return !("node_modules" !== s || !isCommonDirModuleFile(n));
2192
- })(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
2193
- const o = await ((e, t, r) => e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r))(e, s);
2194
- if (o) {
2195
- if (o.ok) {
2196
- const i = await o.clone().text();
2197
- return await (async (e, t, r, s, n, o) => {
2198
- r.endsWith("package.json") && ((e, t) => {
2199
- try {
2200
- const r = JSON.parse(t);
2201
- r.name && r.version && ((e, t, r) => {
2202
- e.set(t, r);
2203
- })(e, r.name, r.version);
2204
- } catch (e) {}
2205
- })(o, n);
2206
- let i = path$2.dirname(s);
2207
- for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
2208
- i = path$2.dirname(i);
2209
- t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
2210
- })(e, t, s, n, i, r), i;
2211
- }
2212
- 404 === o.status && known404Urls.add(s);
2213
- }
2214
- } catch (e) {
2215
- console.error(e);
2216
- }
2217
- };
2206
+ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db";
2218
2207
 
2219
2208
  caller = function() {
2220
2209
  var e, t = Error.prepareStackTrace;
@@ -2709,7 +2698,74 @@ defaultIsFile = function e(t) {
2709
2698
  b;
2710
2699
  }, async.core = core_1, async.isCore = isCore, async.sync = sync, resolve = async;
2711
2700
 
2712
- const createSystem = e => {
2701
+ 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) => {
2702
+ const r = normalizePath(e).split("/"), s = (e => {
2703
+ e.startsWith("~") && (e = e.substring(1));
2704
+ const t = e.split("/"), r = {
2705
+ moduleId: null,
2706
+ filePath: null,
2707
+ scope: null,
2708
+ scopeSubModuleId: null
2709
+ };
2710
+ return e.startsWith("@") && t.length > 1 ? (r.moduleId = t.slice(0, 2).join("/"),
2711
+ r.filePath = t.slice(2).join("/"), r.scope = t[0], r.scopeSubModuleId = t[1]) : (r.moduleId = t[0],
2712
+ r.filePath = t.slice(1).join("/")), r;
2713
+ })(t);
2714
+ for (let e = r.length - 1; e >= 1; e--) if ("node_modules" === r[e - 1]) if (s.scope) {
2715
+ if (r[e] === s.scope && r[e + 1] === s.scopeSubModuleId) return r.slice(0, e + 2).join("/");
2716
+ } else if (r[e] === s.moduleId) return r.slice(0, e + 1).join("/");
2717
+ return null;
2718
+ }, packageVersions = new Map, known404Urls = new Set, getCommonDirUrl = (e, t, r, s) => getNodeModuleFetchUrl(e, t, r) + "/" + s, getNodeModuleFetchUrl = (e, t, r) => {
2719
+ let s = (r = normalizePath(r)).split("/").filter((e => e.length));
2720
+ const n = s.lastIndexOf("node_modules");
2721
+ n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
2722
+ let o = s.shift();
2723
+ o.startsWith("@") && (o += "/" + s.shift());
2724
+ const i = s.join("/");
2725
+ return "@stencil/core" === o ? ((e, t) => {
2726
+ let r = (t = normalizePath(t)).split("/");
2727
+ const s = r.lastIndexOf("node_modules");
2728
+ s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
2729
+ t = r.join("/"));
2730
+ const n = new URL("../", e).href;
2731
+ return new URL("./" + t, n).href;
2732
+ })(e.getCompilerExecutingPath(), i) : e.getRemoteModuleUrl({
2733
+ moduleId: o,
2734
+ version: t.get(o),
2735
+ path: i
2736
+ });
2737
+ }, 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) => {
2738
+ if (!((e => {
2739
+ if (!(e => e.endsWith(".d.ts"))(t = e) && t.endsWith(".ts") || (e => e.endsWith(".tsx"))(e)) return !0;
2740
+ var t;
2741
+ const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
2742
+ return !("node_modules" !== s || !isCommonDirModuleFile(n));
2743
+ })(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
2744
+ const o = await ((e, t, r) => e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r))(e, s);
2745
+ if (o) {
2746
+ if (o.ok) {
2747
+ const i = await o.clone().text();
2748
+ return await (async (e, t, r, s, n, o) => {
2749
+ r.endsWith("package.json") && ((e, t) => {
2750
+ try {
2751
+ const r = JSON.parse(t);
2752
+ r.name && r.version && ((e, t, r) => {
2753
+ e.set(t, r);
2754
+ })(e, r.name, r.version);
2755
+ } catch (e) {}
2756
+ })(o, n);
2757
+ let i = path$2.dirname(s);
2758
+ for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
2759
+ i = path$2.dirname(i);
2760
+ t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
2761
+ })(e, t, s, n, i, r), i;
2762
+ }
2763
+ 404 === o.status && known404Urls.add(s);
2764
+ }
2765
+ } catch (e) {
2766
+ console.error(e);
2767
+ }
2768
+ }, createSystem = e => {
2713
2769
  const t = e && e.logger ? e.logger : (() => {
2714
2770
  let e = IS_BROWSER_ENV, t = "info";
2715
2771
  return {
@@ -2898,7 +2954,7 @@ const createSystem = e => {
2898
2954
  u("/");
2899
2955
  const S = {
2900
2956
  name: "in-memory",
2901
- version: "2.17.4",
2957
+ version: "2.18.1",
2902
2958
  events: i,
2903
2959
  access: async e => c(e),
2904
2960
  accessSync: c,
@@ -3206,78 +3262,6 @@ const createSystem = e => {
3206
3262
  return r;
3207
3263
  };
3208
3264
 
3209
- class TestingLogger {
3210
- constructor() {
3211
- this.isEnabled = !1;
3212
- }
3213
- setLevel(e) {}
3214
- getLevel() {
3215
- return "info";
3216
- }
3217
- enableColors(e) {}
3218
- emoji(e) {
3219
- return "";
3220
- }
3221
- info(...e) {
3222
- this.isEnabled && console.log(...e);
3223
- }
3224
- warn(...e) {
3225
- this.isEnabled && console.warn(...e);
3226
- }
3227
- error(...e) {
3228
- this.isEnabled && console.error(...e);
3229
- }
3230
- debug(...e) {
3231
- this.isEnabled && console.log(...e);
3232
- }
3233
- color(e, t) {}
3234
- red(e) {
3235
- return e;
3236
- }
3237
- green(e) {
3238
- return e;
3239
- }
3240
- yellow(e) {
3241
- return e;
3242
- }
3243
- blue(e) {
3244
- return e;
3245
- }
3246
- magenta(e) {
3247
- return e;
3248
- }
3249
- cyan(e) {
3250
- return e;
3251
- }
3252
- gray(e) {
3253
- return e;
3254
- }
3255
- bold(e) {
3256
- return e;
3257
- }
3258
- dim(e) {
3259
- return e;
3260
- }
3261
- bgRed(e) {
3262
- return e;
3263
- }
3264
- createTimeSpan(e, t = !1) {
3265
- return {
3266
- duration: () => 0,
3267
- finish: () => 0
3268
- };
3269
- }
3270
- printDiagnostics(e) {}
3271
- }
3272
-
3273
- const createConfigFlags = (e = {}) => ({
3274
- task: null,
3275
- args: [],
3276
- knownArgs: [],
3277
- unknownArgs: [],
3278
- ...e
3279
- });
3280
-
3281
3265
  class EventSpy {
3282
3266
  constructor(e) {
3283
3267
  this.eventName = e, this.events = [], this.cursor = 0, this.queuedHandler = [];
@@ -3600,7 +3584,7 @@ class E2EElement extends index_cjs.MockHTMLElement {
3600
3584
  }
3601
3585
  }
3602
3586
 
3603
- const env = process.env;
3587
+ const env = process.env, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www";
3604
3588
 
3605
3589
  exports.MockHeaders = MockHeaders, exports.MockRequest = MockRequest, exports.MockResponse = MockResponse,
3606
3590
  exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment() {
@@ -3851,6 +3835,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3851
3835
  flags: createConfigFlags(),
3852
3836
  logger: mockLogger(),
3853
3837
  outputTargets: null !== (t = r.outputTargets) && void 0 !== t ? t : [],
3838
+ rootDir: path__default.default.resolve("/"),
3854
3839
  sys: createTestingSystem(),
3855
3840
  testing: {},
3856
3841
  ...e
@@ -4011,20 +3996,21 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
4011
3996
  }, n = e.components.map((e => {
4012
3997
  if (null == e.COMPILER_META) throw new Error('Invalid component class: Missing static "COMPILER_META" property.');
4013
3998
  t.add(e.COMPILER_META.tagName), e.isProxied = !1, function r(e) {
4014
- "function" == typeof e.prototype.__componentWillLoad && (e.prototype.componentWillLoad = e.prototype.__componentWillLoad,
4015
- e.prototype.__componentWillLoad = null), "function" == typeof e.prototype.__componentWillUpdate && (e.prototype.componentWillUpdate = e.prototype.__componentWillUpdate,
4016
- e.prototype.__componentWillUpdate = null), "function" == typeof e.prototype.__componentWillRender && (e.prototype.componentWillRender = e.prototype.__componentWillRender,
4017
- e.prototype.__componentWillRender = null), "function" == typeof e.prototype.componentWillLoad && (e.prototype.__componentWillLoad = e.prototype.componentWillLoad,
3999
+ var t, r, s, n, o, i;
4000
+ "function" == typeof (null === (t = e.prototype) || void 0 === t ? void 0 : t.__componentWillLoad) && (e.prototype.componentWillLoad = e.prototype.__componentWillLoad,
4001
+ e.prototype.__componentWillLoad = null), "function" == typeof (null === (r = e.prototype) || void 0 === r ? void 0 : r.__componentWillUpdate) && (e.prototype.componentWillUpdate = e.prototype.__componentWillUpdate,
4002
+ e.prototype.__componentWillUpdate = null), "function" == typeof (null === (s = e.prototype) || void 0 === s ? void 0 : s.__componentWillRender) && (e.prototype.componentWillRender = e.prototype.__componentWillRender,
4003
+ e.prototype.__componentWillRender = null), "function" == typeof (null === (n = e.prototype) || void 0 === n ? void 0 : n.componentWillLoad) && (e.prototype.__componentWillLoad = e.prototype.componentWillLoad,
4018
4004
  e.prototype.componentWillLoad = function() {
4019
4005
  const e = this.__componentWillLoad();
4020
4006
  return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
4021
4007
  e;
4022
- }), "function" == typeof e.prototype.componentWillUpdate && (e.prototype.__componentWillUpdate = e.prototype.componentWillUpdate,
4008
+ }), "function" == typeof (null === (o = e.prototype) || void 0 === o ? void 0 : o.componentWillUpdate) && (e.prototype.__componentWillUpdate = e.prototype.componentWillUpdate,
4023
4009
  e.prototype.componentWillUpdate = function() {
4024
4010
  const e = this.__componentWillUpdate();
4025
4011
  return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
4026
4012
  e;
4027
- }), "function" == typeof e.prototype.componentWillRender && (e.prototype.__componentWillRender = e.prototype.componentWillRender,
4013
+ }), "function" == typeof (null === (i = e.prototype) || void 0 === i ? void 0 : i.componentWillRender) && (e.prototype.__componentWillRender = e.prototype.componentWillRender,
4028
4014
  e.prototype.componentWillRender = function() {
4029
4015
  const e = this.__componentWillRender();
4030
4016
  return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),