@stencil/core 2.19.3 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/cli/config-flags.d.ts +16 -16
  2. package/cli/index.cjs +6 -4
  3. package/cli/index.js +6 -4
  4. package/cli/package.json +1 -1
  5. package/compiler/lib.dom.d.ts +434 -251
  6. package/compiler/lib.dom.iterable.d.ts +7 -13
  7. package/compiler/lib.es2015.collection.d.ts +62 -1
  8. package/compiler/lib.es2015.promise.d.ts +9 -4
  9. package/compiler/lib.es2015.proxy.d.ts +91 -2
  10. package/compiler/lib.es2015.reflect.d.ts +25 -2
  11. package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
  12. package/compiler/lib.es2017.intl.d.ts +16 -1
  13. package/compiler/lib.es2019.d.ts +1 -0
  14. package/compiler/lib.es2019.intl.d.ts +25 -0
  15. package/compiler/lib.es2020.intl.d.ts +31 -6
  16. package/compiler/lib.es2021.intl.d.ts +11 -3
  17. package/compiler/lib.es2022.d.ts +1 -0
  18. package/compiler/lib.es2022.error.d.ts +2 -2
  19. package/compiler/lib.es2022.sharedmemory.d.ts +27 -0
  20. package/compiler/lib.es5.d.ts +39 -14
  21. package/compiler/lib.esnext.intl.d.ts +5 -1
  22. package/compiler/lib.webworker.d.ts +318 -55
  23. package/compiler/lib.webworker.iterable.d.ts +11 -3
  24. package/compiler/package.json +1 -1
  25. package/compiler/stencil.d.ts +1 -23
  26. package/compiler/stencil.js +6307 -5165
  27. package/compiler/stencil.min.js +2 -2
  28. package/compiler/sys/in-memory-fs.d.ts +3 -3
  29. package/compiler/transpile.d.ts +32 -0
  30. package/dependencies.json +3 -1
  31. package/dev-server/client/app-error.d.ts +1 -1
  32. package/dev-server/client/index.js +1 -1
  33. package/dev-server/client/package.json +1 -1
  34. package/dev-server/connector.html +2 -2
  35. package/dev-server/index.js +1 -1
  36. package/dev-server/open-in-editor-api.js +1 -1
  37. package/dev-server/package.json +1 -1
  38. package/dev-server/server-process.js +2 -2
  39. package/internal/app-data/package.json +1 -1
  40. package/internal/client/css-shim.js +2 -2
  41. package/internal/client/dom.js +1 -1
  42. package/internal/client/index.js +8 -2
  43. package/internal/client/package.json +1 -1
  44. package/internal/client/patch-browser.js +1 -1
  45. package/internal/client/patch-esm.js +1 -1
  46. package/internal/client/polyfills/css-shim.js +1 -1
  47. package/internal/client/shadow-css.js +1 -1
  48. package/internal/hydrate/index.js +2 -2
  49. package/internal/hydrate/package.json +1 -1
  50. package/internal/hydrate/runner.d.ts +1 -1
  51. package/internal/hydrate/runner.js +4 -4
  52. package/internal/package.json +1 -1
  53. package/internal/stencil-private.d.ts +37 -37
  54. package/internal/stencil-public-compiler.d.ts +26 -26
  55. package/internal/stencil-public-runtime.d.ts +39 -3
  56. package/internal/testing/package.json +1 -1
  57. package/mock-doc/index.cjs +6 -6
  58. package/mock-doc/index.d.ts +2 -2
  59. package/mock-doc/index.js +6 -6
  60. package/mock-doc/package.json +1 -1
  61. package/package.json +17 -17
  62. package/screenshot/package.json +1 -1
  63. package/sys/node/autoprefixer.js +1 -1
  64. package/sys/node/glob.js +1 -1
  65. package/sys/node/index.js +29 -42
  66. package/sys/node/package.json +1 -1
  67. package/sys/node/prompts.js +1 -1
  68. package/sys/node/worker.js +1 -1
  69. package/testing/index.js +30 -22
  70. package/testing/jest/jest-preprocessor.d.ts +3 -3
  71. package/testing/package.json +1 -1
  72. package/testing/puppeteer/puppeteer-declarations.d.ts +5 -5
  73. package/testing/testing-utils.d.ts +1 -1
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Testing v2.19.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Testing v2.21.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _lazyRequire(e) {
5
5
  return new Proxy({}, {
@@ -198,11 +198,13 @@ async function runJest(e, t) {
198
198
  e.flags.ci || e.flags.e2e ? t.__STENCIL_DEFAULT_TIMEOUT__ = "30000" : t.__STENCIL_DEFAULT_TIMEOUT__ = "15000",
199
199
  e.flags.devtools && (t.__STENCIL_DEFAULT_TIMEOUT__ = "300000000"), e.logger.debug(`default timeout: ${t.__STENCIL_DEFAULT_TIMEOUT__}`);
200
200
  const n = function n(e) {
201
- const t = require("yargs"), r = [ ...e.flags.knownArgs.slice(), ...e.flags.unknownArgs.slice() ];
201
+ const t = require("yargs"), r = e.flags.knownArgs.slice();
202
202
  r.some((e => e.startsWith("--max-workers") || e.startsWith("--maxWorkers"))) || r.push(`--max-workers=${e.maxConcurrentWorkers}`),
203
- e.flags.devtools && r.push("--runInBand"), e.logger.info(e.logger.magenta(`jest args: ${r.join(" ")}`));
204
- let s = t(r).argv;
205
- if (s = {
203
+ e.flags.devtools && r.push("--runInBand");
204
+ const s = [ ...r, ...e.flags.unknownArgs ];
205
+ e.logger.info(e.logger.magenta(`jest args: ${s.join(" ")}`));
206
+ let n = t(s).argv;
207
+ if (n = {
206
208
  detectLeaks: !1,
207
209
  "detect-leaks": !1,
208
210
  detectOpenHandles: !1,
@@ -221,8 +223,8 @@ async function runJest(e, t) {
221
223
  "run-tests-by-path": !1,
222
224
  testLocationInResults: !1,
223
225
  "test-location-in-results": !1,
224
- ...s
225
- }, s.config = function n(e) {
226
+ ...n
227
+ }, n.config = function o(e) {
226
228
  const t = e.testing, r = require("jest-config").defaults, s = Object.keys(r), n = {};
227
229
  return Object.keys(t).forEach((e => {
228
230
  s.includes(e) && (n[e] = t[e]);
@@ -234,10 +236,10 @@ async function runJest(e, t) {
234
236
  Array.isArray(t.reporters) && (n.reporters = t.reporters), isString(t.testResultsProcessor) && (n.testResultsProcessor = t.testResultsProcessor),
235
237
  t.transform && (n.transform = t.transform), t.verbose && (n.verbose = t.verbose),
236
238
  n.testRunner = "jest-jasmine2", JSON.stringify(n);
237
- }(e), "string" == typeof s.maxWorkers) try {
238
- s.maxWorkers = parseInt(s.maxWorkers, 10);
239
+ }(e), "string" == typeof n.maxWorkers) try {
240
+ n.maxWorkers = parseInt(n.maxWorkers, 10);
239
241
  } catch (e) {}
240
- return "string" == typeof s.ci && (s.ci = "true" === s.ci || "" === s.ci), s;
242
+ return "string" == typeof n.ci && (n.ci = "true" === n.ci || "" === n.ci), n;
241
243
  }(e), o = function o(e, t) {
242
244
  const r = t.projects ? t.projects : [];
243
245
  return r.push(e.rootDir), r;
@@ -613,10 +615,13 @@ function mockCompilerCtx(e) {
613
615
  } catch (e) {}
614
616
  }
615
617
  return s;
616
- }, p = t => Promise.all(t.map((async t => {
617
- const [r, s] = t;
618
- return await e.copyFile(r, s), [ r, s ];
619
- }))), f = e => Promise.all(e.map((async e => {
618
+ }, p = t => {
619
+ const r = Promise.all(t.map((async t => {
620
+ const [r, s] = t;
621
+ return await e.copyFile(r, s), [ r, s ];
622
+ })));
623
+ return r;
624
+ }, f = e => Promise.all(e.map((async e => {
620
625
  if ("string" != typeof e) throw new Error("unable to writeFile without filePath");
621
626
  return m(e);
622
627
  }))), m = async t => {
@@ -962,11 +967,12 @@ function writeFile(e, t) {
962
967
  async function compareScreenshot(e, t, r, s, n, o, i, a) {
963
968
  const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
964
969
  await async function u(e, t) {
965
- await function r(e) {
970
+ const r = await function s(e) {
966
971
  return new Promise((t => {
967
972
  fs__default.default.access(e, (e => t(!e)));
968
973
  }));
969
- }(e) || await writeFile(e, t);
974
+ }(e);
975
+ r || await writeFile(e, t);
970
976
  }(c, r), r = null, i && (i = normalizePath(path$2.relative(t.rootDir, i)));
971
977
  const d = function h(e, t) {
972
978
  if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
@@ -2692,7 +2698,7 @@ defaultIsFile = function e(t) {
2692
2698
  if (a = s(n)) return a;
2693
2699
  if (l = o(n)) return l;
2694
2700
  }
2695
- }(t, y)) return maybeRealpathSync(u, v, i);
2701
+ }(t, y), v) return maybeRealpathSync(u, v, i);
2696
2702
  }
2697
2703
  throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
2698
2704
  b;
@@ -2955,7 +2961,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
2955
2961
  d("/");
2956
2962
  const C = {
2957
2963
  name: "in-memory",
2958
- version: "2.19.3",
2964
+ version: "2.21.0",
2959
2965
  events: a,
2960
2966
  access: async e => u(e),
2961
2967
  accessSync: u,
@@ -3301,13 +3307,13 @@ class EventSpy {
3301
3307
  }
3302
3308
 
3303
3309
  class E2EElement extends index_cjs.MockHTMLElement {
3310
+ _queueAction(e) {
3311
+ this._queuedActions.push(e);
3312
+ }
3304
3313
  constructor(e, t) {
3305
3314
  super(null, null), this._page = e, this._elmHandle = t, this._queuedActions = [],
3306
3315
  e._e2eElements.push(this);
3307
3316
  }
3308
- _queueAction(e) {
3309
- this._queuedActions.push(e);
3310
- }
3311
3317
  find(e) {
3312
3318
  return find(this._page, this._elmHandle, e);
3313
3319
  }
@@ -4025,13 +4031,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
4025
4031
  t[e.modeName] = e.styleStr;
4026
4032
  })), e.style = t;
4027
4033
  } else 1 === n.length && (e.style = n[0].styleStr);
4028
- return testing.registerModule(s, e), ((e, t) => [ e, t.map((e => ((e, t) => {
4034
+ testing.registerModule(s, e);
4035
+ const o = ((e, t) => [ e, t.map((e => ((e, t) => {
4029
4036
  let r = 0;
4030
4037
  "shadow" === e.encapsulation ? (r |= 1, e.shadowDelegatesFocus && (r |= 16)) : "scoped" === e.encapsulation && (r |= 2),
4031
4038
  "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot") && (r |= 4), e.hasMode && (r |= 32);
4032
4039
  const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
4033
4040
  return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
4034
4041
  })(e, !0))) ])(s, [ e.COMPILER_META ]);
4042
+ return o;
4035
4043
  })), o = (e => {
4036
4044
  const t = e.some((e => e.htmlTagNames.includes("slot"))), r = e.some((e => "shadow" === e.encapsulation)), s = e.some((e => "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot"))), n = {
4037
4045
  allRenderFn: e.every((e => e.hasRenderFn)),
@@ -1,12 +1,12 @@
1
- declare type Jest26CacheKeyOptions = {
1
+ type Jest26CacheKeyOptions = {
2
2
  instrument: boolean;
3
3
  rootDir: string;
4
4
  };
5
- declare type Jest26Config = {
5
+ type Jest26Config = {
6
6
  instrument: boolean;
7
7
  rootDir: string;
8
8
  };
9
- declare type Jest27TransformOptions = {
9
+ type Jest27TransformOptions = {
10
10
  config: Jest26Config;
11
11
  };
12
12
  export declare const jestPreprocessor: {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/testing",
3
- "version": "2.19.3",
3
+ "version": "2.21.0",
4
4
  "description": "Stencil testing suite.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -7,7 +7,7 @@ import type { ClickOptions, HTTPResponse as PuppeteerHTTPResponse, Page, Screens
7
7
  * migrate to a newer minor version of Stencil without requiring a Puppeteer upgrade/major version of Stencil. This type
8
8
  * should be removed as a part of the Stencil 3.0 release.
9
9
  */
10
- export declare type HTTPResponse = PuppeteerHTTPResponse;
10
+ export type HTTPResponse = PuppeteerHTTPResponse;
11
11
  /**
12
12
  * These types help with declaration merging as a part of Stencil's migration from Puppeteer v5.4.3 to v10.0.0. In
13
13
  * v10.0.0, `WaitForOptions` is a renamed version of `NavigationOptions` from v5.4.3, who has had its type hierarchy
@@ -31,7 +31,7 @@ declare module 'puppeteer' {
31
31
  * This type was once exported by Puppeteer, but has since moved to an object literal in (Puppeteer’s) native types.
32
32
  * Re-create it here as a named type to use across multiple Stencil-related testing files.
33
33
  */
34
- export declare type PageCloseOptions = {
34
+ export type PageCloseOptions = {
35
35
  runBeforeUnload?: boolean;
36
36
  };
37
37
  export interface NewE2EPageOptions extends WaitForOptions {
@@ -40,8 +40,8 @@ export interface NewE2EPageOptions extends WaitForOptions {
40
40
  failOnConsoleError?: boolean;
41
41
  failOnNetworkError?: boolean;
42
42
  }
43
- declare type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
44
- declare type PuppeteerPage = Omit<Page, 'bringToFront' | 'browser' | 'screenshot' | 'emulate' | 'emulateMedia' | 'frames' | 'goBack' | 'goForward' | 'isClosed' | 'mainFrame' | 'pdf' | 'reload' | 'target' | 'title' | 'viewport' | 'waitForNavigation' | 'screenshot' | 'workers' | 'addListener' | 'prependListener' | 'prependOnceListener' | 'removeAllListeners' | 'setMaxListeners' | 'getMaxListeners' | 'listeners' | 'rawListeners' | 'emit' | 'eventNames' | 'listenerCount' | '$x' | 'waitForXPath'>;
43
+ type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
44
+ type PuppeteerPage = Omit<Page, 'bringToFront' | 'browser' | 'screenshot' | 'emulate' | 'emulateMedia' | 'frames' | 'goBack' | 'goForward' | 'isClosed' | 'mainFrame' | 'pdf' | 'reload' | 'target' | 'title' | 'viewport' | 'waitForNavigation' | 'screenshot' | 'workers' | 'addListener' | 'prependListener' | 'prependOnceListener' | 'removeAllListeners' | 'setMaxListeners' | 'getMaxListeners' | 'listeners' | 'rawListeners' | 'emit' | 'eventNames' | 'listenerCount' | '$x' | 'waitForXPath'>;
45
45
  export interface PageDiagnostic {
46
46
  type: 'error' | 'pageerror' | 'requestfailed';
47
47
  message?: string;
@@ -401,7 +401,7 @@ export interface E2EElementInternal extends E2EElement {
401
401
  e2eRunActions(): Promise<unknown>;
402
402
  e2eSync(): Promise<void>;
403
403
  }
404
- export declare type FindSelector = string | FindSelectorOptions;
404
+ export type FindSelector = string | FindSelectorOptions;
405
405
  export interface FindSelectorOptions {
406
406
  /**
407
407
  * Finds an element with text content matching this
@@ -65,7 +65,7 @@ interface ConsoleMocker {
65
65
  * as its argument and returns a `Promise`, the value of which is returns by `withSilentWarn`
66
66
  * as well.
67
67
  */
68
- declare type SilentWarnFunc<T> = (mock: jest.Mock<typeof console.warn>) => Promise<T>;
68
+ type SilentWarnFunc<T> = (mock: jest.Mock<typeof console.warn>) => Promise<T>;
69
69
  /**
70
70
  * Wrap a single callback with a silent `console.warn`. The callback passed in
71
71
  * receives the mocking function as an argument, so you can easily make assertions