@stencil/core 2.20.0 → 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 (65) hide show
  1. package/cli/config-flags.d.ts +16 -16
  2. package/cli/index.cjs +5 -4
  3. package/cli/index.js +5 -4
  4. package/cli/package.json +1 -1
  5. package/compiler/lib.dom.d.ts +308 -70
  6. package/compiler/lib.dom.iterable.d.ts +6 -2
  7. package/compiler/lib.es2015.promise.d.ts +9 -4
  8. package/compiler/lib.es2015.proxy.d.ts +1 -1
  9. package/compiler/lib.es2015.reflect.d.ts +25 -2
  10. package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
  11. package/compiler/lib.es2019.d.ts +1 -0
  12. package/compiler/lib.es2019.intl.d.ts +25 -0
  13. package/compiler/lib.es2020.intl.d.ts +1 -1
  14. package/compiler/lib.es5.d.ts +26 -13
  15. package/compiler/lib.webworker.d.ts +266 -30
  16. package/compiler/lib.webworker.iterable.d.ts +10 -2
  17. package/compiler/package.json +1 -1
  18. package/compiler/stencil.d.ts +1 -23
  19. package/compiler/stencil.js +1387 -318
  20. package/compiler/stencil.min.js +2 -2
  21. package/compiler/sys/in-memory-fs.d.ts +3 -3
  22. package/compiler/transpile.d.ts +32 -0
  23. package/dependencies.json +2 -1
  24. package/dev-server/client/app-error.d.ts +1 -1
  25. package/dev-server/client/index.js +1 -1
  26. package/dev-server/client/package.json +1 -1
  27. package/dev-server/connector.html +2 -2
  28. package/dev-server/index.js +1 -1
  29. package/dev-server/open-in-editor-api.js +1 -1
  30. package/dev-server/package.json +1 -1
  31. package/dev-server/server-process.js +2 -2
  32. package/internal/app-data/package.json +1 -1
  33. package/internal/client/css-shim.js +2 -2
  34. package/internal/client/dom.js +1 -1
  35. package/internal/client/index.js +8 -2
  36. package/internal/client/package.json +1 -1
  37. package/internal/client/patch-browser.js +1 -1
  38. package/internal/client/patch-esm.js +1 -1
  39. package/internal/client/polyfills/css-shim.js +1 -1
  40. package/internal/client/shadow-css.js +1 -1
  41. package/internal/hydrate/index.js +2 -2
  42. package/internal/hydrate/package.json +1 -1
  43. package/internal/hydrate/runner.js +4 -4
  44. package/internal/package.json +1 -1
  45. package/internal/stencil-private.d.ts +37 -37
  46. package/internal/stencil-public-compiler.d.ts +26 -26
  47. package/internal/stencil-public-runtime.d.ts +39 -3
  48. package/internal/testing/package.json +1 -1
  49. package/mock-doc/index.cjs +4 -4
  50. package/mock-doc/index.d.ts +2 -2
  51. package/mock-doc/index.js +4 -4
  52. package/mock-doc/package.json +1 -1
  53. package/package.json +7 -7
  54. package/screenshot/package.json +1 -1
  55. package/sys/node/autoprefixer.js +1 -1
  56. package/sys/node/glob.js +1 -1
  57. package/sys/node/index.js +29 -42
  58. package/sys/node/package.json +1 -1
  59. package/sys/node/prompts.js +1 -1
  60. package/sys/node/worker.js +1 -1
  61. package/testing/index.js +19 -13
  62. package/testing/jest/jest-preprocessor.d.ts +3 -3
  63. package/testing/package.json +1 -1
  64. package/testing/puppeteer/puppeteer-declarations.d.ts +5 -5
  65. package/testing/testing-utils.d.ts +1 -1
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Testing v2.20.0 | 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({}, {
@@ -615,10 +615,13 @@ function mockCompilerCtx(e) {
615
615
  } catch (e) {}
616
616
  }
617
617
  return s;
618
- }, p = t => Promise.all(t.map((async t => {
619
- const [r, s] = t;
620
- return await e.copyFile(r, s), [ r, s ];
621
- }))), 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 => {
622
625
  if ("string" != typeof e) throw new Error("unable to writeFile without filePath");
623
626
  return m(e);
624
627
  }))), m = async t => {
@@ -964,11 +967,12 @@ function writeFile(e, t) {
964
967
  async function compareScreenshot(e, t, r, s, n, o, i, a) {
965
968
  const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
966
969
  await async function u(e, t) {
967
- await function r(e) {
970
+ const r = await function s(e) {
968
971
  return new Promise((t => {
969
972
  fs__default.default.access(e, (e => t(!e)));
970
973
  }));
971
- }(e) || await writeFile(e, t);
974
+ }(e);
975
+ r || await writeFile(e, t);
972
976
  }(c, r), r = null, i && (i = normalizePath(path$2.relative(t.rootDir, i)));
973
977
  const d = function h(e, t) {
974
978
  if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
@@ -2694,7 +2698,7 @@ defaultIsFile = function e(t) {
2694
2698
  if (a = s(n)) return a;
2695
2699
  if (l = o(n)) return l;
2696
2700
  }
2697
- }(t, y)) return maybeRealpathSync(u, v, i);
2701
+ }(t, y), v) return maybeRealpathSync(u, v, i);
2698
2702
  }
2699
2703
  throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
2700
2704
  b;
@@ -2957,7 +2961,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
2957
2961
  d("/");
2958
2962
  const C = {
2959
2963
  name: "in-memory",
2960
- version: "2.20.0",
2964
+ version: "2.21.0",
2961
2965
  events: a,
2962
2966
  access: async e => u(e),
2963
2967
  accessSync: u,
@@ -3303,13 +3307,13 @@ class EventSpy {
3303
3307
  }
3304
3308
 
3305
3309
  class E2EElement extends index_cjs.MockHTMLElement {
3310
+ _queueAction(e) {
3311
+ this._queuedActions.push(e);
3312
+ }
3306
3313
  constructor(e, t) {
3307
3314
  super(null, null), this._page = e, this._elmHandle = t, this._queuedActions = [],
3308
3315
  e._e2eElements.push(this);
3309
3316
  }
3310
- _queueAction(e) {
3311
- this._queuedActions.push(e);
3312
- }
3313
3317
  find(e) {
3314
3318
  return find(this._page, this._elmHandle, e);
3315
3319
  }
@@ -4027,13 +4031,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
4027
4031
  t[e.modeName] = e.styleStr;
4028
4032
  })), e.style = t;
4029
4033
  } else 1 === n.length && (e.style = n[0].styleStr);
4030
- 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) => {
4031
4036
  let r = 0;
4032
4037
  "shadow" === e.encapsulation ? (r |= 1, e.shadowDelegatesFocus && (r |= 16)) : "scoped" === e.encapsulation && (r |= 2),
4033
4038
  "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot") && (r |= 4), e.hasMode && (r |= 32);
4034
4039
  const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
4035
4040
  return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
4036
4041
  })(e, !0))) ])(s, [ e.COMPILER_META ]);
4042
+ return o;
4037
4043
  })), o = (e => {
4038
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 = {
4039
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.20.0",
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