@stencil/core 2.18.0 → 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 (61) hide show
  1. package/cli/index.cjs +261 -206
  2. package/cli/index.d.ts +1 -0
  3. package/cli/index.js +261 -206
  4. package/cli/package.json +1 -1
  5. package/compiler/package.json +1 -1
  6. package/compiler/stencil.d.ts +2 -2
  7. package/compiler/stencil.js +48945 -47701
  8. package/compiler/stencil.min.js +2 -2
  9. package/dependencies.json +1 -1
  10. package/dev-server/client/index.d.ts +2 -2
  11. package/dev-server/client/index.js +241 -241
  12. package/dev-server/client/package.json +1 -1
  13. package/dev-server/connector.html +3 -3
  14. package/dev-server/index.d.ts +1 -1
  15. package/dev-server/index.js +2 -2
  16. package/dev-server/package.json +1 -1
  17. package/dev-server/server-process.js +1230 -1199
  18. package/internal/app-data/package.json +1 -1
  19. package/internal/client/css-shim.js +2 -2
  20. package/internal/client/dom.js +1 -1
  21. package/internal/client/index.js +619 -601
  22. package/internal/client/package.json +1 -1
  23. package/internal/client/patch-browser.js +1 -1
  24. package/internal/client/patch-esm.js +1 -1
  25. package/internal/client/polyfills/css-shim.js +1 -1
  26. package/internal/client/shadow-css.js +1 -1
  27. package/internal/hydrate/index.js +119 -119
  28. package/internal/hydrate/package.json +1 -1
  29. package/internal/hydrate/runner.js +100 -100
  30. package/internal/package.json +1 -1
  31. package/internal/stencil-core/index.d.ts +8 -10
  32. package/internal/stencil-private.d.ts +77 -34
  33. package/internal/stencil-public-compiler.d.ts +2 -2
  34. package/internal/stencil-public-runtime.d.ts +15 -4
  35. package/internal/testing/index.js +148 -148
  36. package/internal/testing/package.json +1 -1
  37. package/mock-doc/index.cjs +898 -898
  38. package/mock-doc/index.js +898 -898
  39. package/mock-doc/package.json +1 -1
  40. package/package.json +19 -26
  41. package/readme.md +27 -33
  42. package/screenshot/index.d.ts +1 -1
  43. package/screenshot/index.js +3 -3
  44. package/screenshot/package.json +1 -1
  45. package/screenshot/pixel-match.js +983 -849
  46. package/sys/node/glob.js +1 -1
  47. package/sys/node/index.d.ts +2 -0
  48. package/sys/node/index.js +374 -373
  49. package/sys/node/package.json +1 -1
  50. package/sys/node/worker.js +1 -1
  51. package/testing/index.d.ts +6 -6
  52. package/testing/index.js +345 -345
  53. package/testing/jest/jest-config.d.ts +1 -1
  54. package/testing/matchers/index.d.ts +3 -3
  55. package/testing/mock-fetch.d.ts +1 -1
  56. package/testing/mocks.d.ts +2 -2
  57. package/testing/package.json +1 -1
  58. package/testing/puppeteer/puppeteer-element.d.ts +2 -2
  59. package/testing/puppeteer/puppeteer-events.d.ts +1 -1
  60. package/testing/testing-logger.d.ts +1 -1
  61. package/testing/testing.d.ts +1 -1
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Testing v2.18.0 | 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()");
@@ -808,21 +774,6 @@ function mockLogger() {
808
774
  return new TestingLogger;
809
775
  }
810
776
 
811
- function findRootComponent(e, t) {
812
- if (null != t) {
813
- const r = t.children, s = r.length;
814
- for (let t = 0; t < s; t++) {
815
- const s = r[t];
816
- if (e.has(s.nodeName.toLowerCase())) return s;
817
- }
818
- for (let t = 0; t < s; t++) {
819
- const s = findRootComponent(e, r[t]);
820
- if (null != s) return s;
821
- }
822
- }
823
- return null;
824
- }
825
-
826
777
  async function initPageEvents(e) {
827
778
  e._e2eEvents = new Map, e._e2eEventIds = 0, e.spyOnEvent = pageSpyOnEvent.bind(e, e),
828
779
  await e.exposeFunction("stencilOnEvent", ((t, r) => {
@@ -1182,9 +1133,58 @@ function serializeConsoleMessage(e) {
1182
1133
  }(e.location())}`;
1183
1134
  }
1184
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
+
1185
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;
1186
1186
 
1187
- 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) => ({
1188
1188
  ...formatPropertiesRuntimeMember(e.properties),
1189
1189
  ...formatStatesRuntimeMember(e.states),
1190
1190
  ...t ? formatMethodsRuntimeMember(e.methods) : {}
@@ -1300,15 +1300,16 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
1300
1300
  const r = e.substring(0, t), s = e.substring(t).split("/"), n = s.length;
1301
1301
  return n > 0 && !s[n - 1] && s.pop(), [ r, ...s ];
1302
1302
  }, normalizeFsPath = e => normalizePath(e.split("?")[0].replace(/\0/g, "")), flattenDiagnosticMessageText = (e, t) => {
1303
+ var r, s;
1303
1304
  if ("string" == typeof t) return t;
1304
1305
  if (void 0 === t) return "";
1305
- const r = [], s = e.file.fileName.includes("stencil.config");
1306
- s && r.push(2322);
1307
- let n = "";
1308
- if (!r.includes(t.code) && (n = t.messageText, isIterable(t.next))) for (const r of t.next) n += flattenDiagnosticMessageText(e, r);
1309
- return s && (n = n.replace("type 'StencilConfig'", "Stencil Config"), n = n.replace("Object literal may only specify known properties, but ", ""),
1310
- n = n.replace("Object literal may only specify known properties, and ", "")), n.trim();
1311
- }, 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");
1312
1313
 
1313
1314
  let _tsCompilerOptions = null, _tsCompilerOptionsKey = null;
1314
1315
 
@@ -1719,7 +1720,13 @@ const FETCH_DEFAULT_PATH = "/mock-fetch-data", HtmlSerializer = {
1719
1720
  outerHtml: !0
1720
1721
  }),
1721
1722
  test: e => null != e && (e instanceof HTMLElement || e instanceof index_cjs.MockNode)
1722
- };
1723
+ }, createConfigFlags = (e = {}) => ({
1724
+ task: null,
1725
+ args: [],
1726
+ knownArgs: [],
1727
+ unknownArgs: [],
1728
+ ...e
1729
+ });
1723
1730
 
1724
1731
  class BuildContext {
1725
1732
  constructor(e, t) {
@@ -1905,7 +1912,46 @@ class Cache {
1905
1912
  }
1906
1913
  }
1907
1914
 
1908
- 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 => {
1909
1955
  const t = {
1910
1956
  filesToDelete: [],
1911
1957
  filesToWrite: [],
@@ -1958,12 +2004,76 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
1958
2004
  const r = t.dirsToDelete.indexOf(e);
1959
2005
  r > -1 && t.dirsToDelete.splice(r, 1);
1960
2006
  }
1961
- return t.dirsToDelete = t.dirsToDelete.filter((e => "/" !== e && !0 !== e.endsWith(":/"))),
1962
- t.dirsToEnsure = t.dirsToEnsure.filter((t => {
1963
- const r = e.get(t);
1964
- return (null == r || !0 !== r.exists || !0 !== r.isDirectory) && "/" !== t && !t.endsWith(":/");
1965
- })), t;
1966
- }, 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
+ }
1967
2077
 
1968
2078
  (posix = {
1969
2079
  resolve: function e() {
@@ -2085,46 +2195,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
2085
2195
  posix: null
2086
2196
  }).posix = posix, pathBrowserify = posix;
2087
2197
 
2088
- const buildEvents = () => {
2089
- const e = [], t = t => {
2090
- const r = e.findIndex((e => e.callback === t));
2091
- return r > -1 && (e.splice(r, 1), !0);
2092
- };
2093
- return {
2094
- emit: (t, r) => {
2095
- const s = t.toLowerCase().trim(), n = e.slice();
2096
- for (const e of n) if (null == e.eventName) try {
2097
- e.callback(t, r);
2098
- } catch (e) {
2099
- console.error(e);
2100
- } else if (e.eventName === s) try {
2101
- e.callback(r);
2102
- } catch (e) {
2103
- console.error(e);
2104
- }
2105
- },
2106
- on: (r, s) => {
2107
- if ("function" == typeof r) {
2108
- const s = null, n = r;
2109
- return e.push({
2110
- eventName: s,
2111
- callback: n
2112
- }), () => t(n);
2113
- }
2114
- if ("string" == typeof r && "function" == typeof s) {
2115
- const n = r.toLowerCase().trim(), o = s;
2116
- return e.push({
2117
- eventName: n,
2118
- callback: o
2119
- }), () => t(o);
2120
- }
2121
- return () => !1;
2122
- },
2123
- unsubscribeAll: () => {
2124
- e.length = 0;
2125
- }
2126
- };
2127
- }, 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);
2128
2199
 
2129
2200
  IS_NODE_ENV && process.platform;
2130
2201
 
@@ -2132,74 +2203,7 @@ const IS_BROWSER_ENV = "undefined" != typeof location && "undefined" != typeof n
2132
2203
 
2133
2204
  IS_NODE_ENV && require, IS_NODE_ENV && process.cwd;
2134
2205
 
2135
- 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) => {
2136
- const r = normalizePath(e).split("/"), s = (e => {
2137
- e.startsWith("~") && (e = e.substring(1));
2138
- const t = e.split("/"), r = {
2139
- moduleId: null,
2140
- filePath: null,
2141
- scope: null,
2142
- scopeSubModuleId: null
2143
- };
2144
- return e.startsWith("@") && t.length > 1 ? (r.moduleId = t.slice(0, 2).join("/"),
2145
- r.filePath = t.slice(2).join("/"), r.scope = t[0], r.scopeSubModuleId = t[1]) : (r.moduleId = t[0],
2146
- r.filePath = t.slice(1).join("/")), r;
2147
- })(t);
2148
- for (let e = r.length - 1; e >= 1; e--) if ("node_modules" === r[e - 1]) if (s.scope) {
2149
- if (r[e] === s.scope && r[e + 1] === s.scopeSubModuleId) return r.slice(0, e + 2).join("/");
2150
- } else if (r[e] === s.moduleId) return r.slice(0, e + 1).join("/");
2151
- return null;
2152
- }, packageVersions = new Map, known404Urls = new Set, getCommonDirUrl = (e, t, r, s) => getNodeModuleFetchUrl(e, t, r) + "/" + s, getNodeModuleFetchUrl = (e, t, r) => {
2153
- let s = (r = normalizePath(r)).split("/").filter((e => e.length));
2154
- const n = s.lastIndexOf("node_modules");
2155
- n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
2156
- let o = s.shift();
2157
- o.startsWith("@") && (o += "/" + s.shift());
2158
- const i = s.join("/");
2159
- return "@stencil/core" === o ? ((e, t) => {
2160
- let r = (t = normalizePath(t)).split("/");
2161
- const s = r.lastIndexOf("node_modules");
2162
- s > -1 && s < r.length - 1 && (r = r.slice(s + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
2163
- t = r.join("/"));
2164
- const n = new URL("../", e).href;
2165
- return new URL("./" + t, n).href;
2166
- })(e.getCompilerExecutingPath(), i) : e.getRemoteModuleUrl({
2167
- moduleId: o,
2168
- version: t.get(o),
2169
- path: i
2170
- });
2171
- }, 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) => {
2172
- if (!((e => {
2173
- if (!(e => e.endsWith(".d.ts"))(t = e) && t.endsWith(".ts") || (e => e.endsWith(".tsx"))(e)) return !0;
2174
- var t;
2175
- const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
2176
- return !("node_modules" !== s || !isCommonDirModuleFile(n));
2177
- })(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
2178
- const o = await ((e, t, r) => e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r))(e, s);
2179
- if (o) {
2180
- if (o.ok) {
2181
- const i = await o.clone().text();
2182
- return await (async (e, t, r, s, n, o) => {
2183
- r.endsWith("package.json") && ((e, t) => {
2184
- try {
2185
- const r = JSON.parse(t);
2186
- r.name && r.version && ((e, t, r) => {
2187
- e.set(t, r);
2188
- })(e, r.name, r.version);
2189
- } catch (e) {}
2190
- })(o, n);
2191
- let i = path$2.dirname(s);
2192
- for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
2193
- i = path$2.dirname(i);
2194
- t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
2195
- })(e, t, s, n, i, r), i;
2196
- }
2197
- 404 === o.status && known404Urls.add(s);
2198
- }
2199
- } catch (e) {
2200
- console.error(e);
2201
- }
2202
- };
2206
+ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db";
2203
2207
 
2204
2208
  caller = function() {
2205
2209
  var e, t = Error.prepareStackTrace;
@@ -2694,7 +2698,74 @@ defaultIsFile = function e(t) {
2694
2698
  b;
2695
2699
  }, async.core = core_1, async.isCore = isCore, async.sync = sync, resolve = async;
2696
2700
 
2697
- 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 => {
2698
2769
  const t = e && e.logger ? e.logger : (() => {
2699
2770
  let e = IS_BROWSER_ENV, t = "info";
2700
2771
  return {
@@ -2883,7 +2954,7 @@ const createSystem = e => {
2883
2954
  u("/");
2884
2955
  const S = {
2885
2956
  name: "in-memory",
2886
- version: "2.18.0",
2957
+ version: "2.18.1",
2887
2958
  events: i,
2888
2959
  access: async e => c(e),
2889
2960
  accessSync: c,
@@ -3191,78 +3262,6 @@ const createSystem = e => {
3191
3262
  return r;
3192
3263
  };
3193
3264
 
3194
- class TestingLogger {
3195
- constructor() {
3196
- this.isEnabled = !1;
3197
- }
3198
- setLevel(e) {}
3199
- getLevel() {
3200
- return "info";
3201
- }
3202
- enableColors(e) {}
3203
- emoji(e) {
3204
- return "";
3205
- }
3206
- info(...e) {
3207
- this.isEnabled && console.log(...e);
3208
- }
3209
- warn(...e) {
3210
- this.isEnabled && console.warn(...e);
3211
- }
3212
- error(...e) {
3213
- this.isEnabled && console.error(...e);
3214
- }
3215
- debug(...e) {
3216
- this.isEnabled && console.log(...e);
3217
- }
3218
- color(e, t) {}
3219
- red(e) {
3220
- return e;
3221
- }
3222
- green(e) {
3223
- return e;
3224
- }
3225
- yellow(e) {
3226
- return e;
3227
- }
3228
- blue(e) {
3229
- return e;
3230
- }
3231
- magenta(e) {
3232
- return e;
3233
- }
3234
- cyan(e) {
3235
- return e;
3236
- }
3237
- gray(e) {
3238
- return e;
3239
- }
3240
- bold(e) {
3241
- return e;
3242
- }
3243
- dim(e) {
3244
- return e;
3245
- }
3246
- bgRed(e) {
3247
- return e;
3248
- }
3249
- createTimeSpan(e, t = !1) {
3250
- return {
3251
- duration: () => 0,
3252
- finish: () => 0
3253
- };
3254
- }
3255
- printDiagnostics(e) {}
3256
- }
3257
-
3258
- const createConfigFlags = (e = {}) => ({
3259
- task: null,
3260
- args: [],
3261
- knownArgs: [],
3262
- unknownArgs: [],
3263
- ...e
3264
- });
3265
-
3266
3265
  class EventSpy {
3267
3266
  constructor(e) {
3268
3267
  this.eventName = e, this.events = [], this.cursor = 0, this.queuedHandler = [];
@@ -3585,7 +3584,7 @@ class E2EElement extends index_cjs.MockHTMLElement {
3585
3584
  }
3586
3585
  }
3587
3586
 
3588
- 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";
3589
3588
 
3590
3589
  exports.MockHeaders = MockHeaders, exports.MockRequest = MockRequest, exports.MockResponse = MockResponse,
3591
3590
  exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment() {
@@ -3997,20 +3996,21 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3997
3996
  }, n = e.components.map((e => {
3998
3997
  if (null == e.COMPILER_META) throw new Error('Invalid component class: Missing static "COMPILER_META" property.');
3999
3998
  t.add(e.COMPILER_META.tagName), e.isProxied = !1, function r(e) {
4000
- "function" == typeof e.prototype.__componentWillLoad && (e.prototype.componentWillLoad = e.prototype.__componentWillLoad,
4001
- e.prototype.__componentWillLoad = null), "function" == typeof e.prototype.__componentWillUpdate && (e.prototype.componentWillUpdate = e.prototype.__componentWillUpdate,
4002
- e.prototype.__componentWillUpdate = null), "function" == typeof e.prototype.__componentWillRender && (e.prototype.componentWillRender = e.prototype.__componentWillRender,
4003
- 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,
4004
4004
  e.prototype.componentWillLoad = function() {
4005
4005
  const e = this.__componentWillLoad();
4006
4006
  return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
4007
4007
  e;
4008
- }), "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,
4009
4009
  e.prototype.componentWillUpdate = function() {
4010
4010
  const e = this.__componentWillUpdate();
4011
4011
  return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
4012
4012
  e;
4013
- }), "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,
4014
4014
  e.prototype.componentWillRender = function() {
4015
4015
  const e = this.__componentWillRender();
4016
4016
  return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),