@stencil/core 3.0.0-alpha.1 → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/config-flags.d.ts +16 -16
- package/cli/index.cjs +5 -4
- package/cli/index.js +5 -4
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +308 -70
- package/compiler/lib.dom.iterable.d.ts +6 -2
- package/compiler/lib.es2015.promise.d.ts +9 -4
- package/compiler/lib.es2015.proxy.d.ts +1 -1
- package/compiler/lib.es2015.reflect.d.ts +25 -2
- package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
- package/compiler/lib.es2019.d.ts +1 -0
- package/compiler/lib.es2019.intl.d.ts +25 -0
- package/compiler/lib.es2020.intl.d.ts +1 -1
- package/compiler/lib.es5.d.ts +26 -13
- package/compiler/lib.webworker.d.ts +266 -30
- package/compiler/lib.webworker.iterable.d.ts +10 -2
- package/compiler/package.json +1 -1
- package/compiler/stencil.d.ts +1 -23
- package/compiler/stencil.js +1372 -303
- package/compiler/stencil.min.js +2 -2
- package/compiler/sys/in-memory-fs.d.ts +3 -3
- package/compiler/transpile.d.ts +32 -0
- package/dependencies.json +2 -1
- package/dev-server/client/app-error.d.ts +1 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/open-in-editor-api.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +2 -2
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +1 -1
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/polyfills/css-shim.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +2 -2
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +4 -4
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +37 -37
- package/internal/stencil-public-compiler.d.ts +27 -27
- package/internal/stencil-public-runtime.d.ts +3 -3
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.d.ts +2 -2
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +6 -6
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +1 -1
- package/sys/node/glob.js +1 -1
- package/sys/node/index.js +29 -42
- package/sys/node/package.json +1 -1
- package/sys/node/prompts.js +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +19 -13
- package/testing/jest/jest-preprocessor.d.ts +3 -3
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-declarations.d.ts +4 -4
- package/testing/testing-utils.d.ts +1 -1
package/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Testing v3.0.0-alpha.
|
|
2
|
+
Stencil Testing v3.0.0-alpha.2 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
function _lazyRequire(e) {
|
|
5
5
|
return new Proxy({}, {
|
|
@@ -634,10 +634,13 @@ function mockCompilerCtx(e) {
|
|
|
634
634
|
} catch (e) {}
|
|
635
635
|
}
|
|
636
636
|
return s;
|
|
637
|
-
}, p = t =>
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
|
|
637
|
+
}, p = t => {
|
|
638
|
+
const r = Promise.all(t.map((async t => {
|
|
639
|
+
const [r, s] = t;
|
|
640
|
+
return await e.copyFile(r, s), [ r, s ];
|
|
641
|
+
})));
|
|
642
|
+
return r;
|
|
643
|
+
}, f = e => Promise.all(e.map((async e => {
|
|
641
644
|
if ("string" != typeof e) throw new Error("unable to writeFile without filePath");
|
|
642
645
|
return m(e);
|
|
643
646
|
}))), m = async t => {
|
|
@@ -985,11 +988,12 @@ function writeFile(e, t) {
|
|
|
985
988
|
async function compareScreenshot(e, t, r, s, n, i, o, a) {
|
|
986
989
|
const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
|
|
987
990
|
await async function u(e, t) {
|
|
988
|
-
await function
|
|
991
|
+
const r = await function s(e) {
|
|
989
992
|
return new Promise((t => {
|
|
990
993
|
fs__default.default.access(e, (e => t(!e)));
|
|
991
994
|
}));
|
|
992
|
-
}(e)
|
|
995
|
+
}(e);
|
|
996
|
+
r || await writeFile(e, t);
|
|
993
997
|
}(c, r), r = null, o && (o = normalizePath(path$2.relative(t.rootDir, o)));
|
|
994
998
|
const d = function h(e, t) {
|
|
995
999
|
if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
|
|
@@ -2881,7 +2885,7 @@ defaultIsFile = function e(t) {
|
|
|
2881
2885
|
if (a = s(n)) return a;
|
|
2882
2886
|
if (l = i(n)) return l;
|
|
2883
2887
|
}
|
|
2884
|
-
}(t, y)) return maybeRealpathSync(u, _, o);
|
|
2888
|
+
}(t, y), _) return maybeRealpathSync(u, _, o);
|
|
2885
2889
|
}
|
|
2886
2890
|
throw (v = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
|
|
2887
2891
|
v;
|
|
@@ -3144,7 +3148,7 @@ const COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json",
|
|
|
3144
3148
|
d("/");
|
|
3145
3149
|
const C = {
|
|
3146
3150
|
name: "in-memory",
|
|
3147
|
-
version: "3.0.0-alpha.
|
|
3151
|
+
version: "3.0.0-alpha.2",
|
|
3148
3152
|
events: a,
|
|
3149
3153
|
access: async e => u(e),
|
|
3150
3154
|
accessSync: u,
|
|
@@ -3490,13 +3494,13 @@ class EventSpy {
|
|
|
3490
3494
|
}
|
|
3491
3495
|
|
|
3492
3496
|
class E2EElement extends index_cjs.MockHTMLElement {
|
|
3497
|
+
_queueAction(e) {
|
|
3498
|
+
this._queuedActions.push(e);
|
|
3499
|
+
}
|
|
3493
3500
|
constructor(e, t) {
|
|
3494
3501
|
super(null, null), this._page = e, this._elmHandle = t, this._queuedActions = [],
|
|
3495
3502
|
e._e2eElements.push(this);
|
|
3496
3503
|
}
|
|
3497
|
-
_queueAction(e) {
|
|
3498
|
-
this._queuedActions.push(e);
|
|
3499
|
-
}
|
|
3500
3504
|
find(e) {
|
|
3501
3505
|
return find(this._page, this._elmHandle, e);
|
|
3502
3506
|
}
|
|
@@ -4214,13 +4218,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4214
4218
|
t[e.modeName] = e.styleStr;
|
|
4215
4219
|
})), e.style = t;
|
|
4216
4220
|
} else 1 === n.length && (e.style = n[0].styleStr);
|
|
4217
|
-
|
|
4221
|
+
testing.registerModule(s, e);
|
|
4222
|
+
const i = ((e, t) => [ e, t.map((e => ((e, t) => {
|
|
4218
4223
|
let r = 0;
|
|
4219
4224
|
"shadow" === e.encapsulation ? (r |= 1, e.shadowDelegatesFocus && (r |= 16)) : "scoped" === e.encapsulation && (r |= 2),
|
|
4220
4225
|
"shadow" !== e.encapsulation && e.htmlTagNames.includes("slot") && (r |= 4), e.hasMode && (r |= 32);
|
|
4221
4226
|
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
4222
4227
|
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
4223
4228
|
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
4229
|
+
return i;
|
|
4224
4230
|
})), i = (e => {
|
|
4225
4231
|
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 = {
|
|
4226
4232
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
type Jest26CacheKeyOptions = {
|
|
2
2
|
instrument: boolean;
|
|
3
3
|
rootDir: string;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
type Jest26Config = {
|
|
6
6
|
instrument: boolean;
|
|
7
7
|
rootDir: string;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type Jest27TransformOptions = {
|
|
10
10
|
config: Jest26Config;
|
|
11
11
|
};
|
|
12
12
|
export declare const jestPreprocessor: {
|
package/testing/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import type { ClickOptions, HTTPResponse, Page, ScreenshotOptions as PuppeteerSc
|
|
|
5
5
|
* This type was once exported by Puppeteer, but has since moved to an object literal in (Puppeteer’s) native types.
|
|
6
6
|
* Re-create it here as a named type to use across multiple Stencil-related testing files.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type PageCloseOptions = {
|
|
9
9
|
runBeforeUnload?: boolean;
|
|
10
10
|
};
|
|
11
11
|
export interface NewE2EPageOptions extends WaitForOptions {
|
|
@@ -14,8 +14,8 @@ export interface NewE2EPageOptions extends WaitForOptions {
|
|
|
14
14
|
failOnConsoleError?: boolean;
|
|
15
15
|
failOnNetworkError?: boolean;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
18
|
+
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'>;
|
|
19
19
|
export interface PageDiagnostic {
|
|
20
20
|
type: 'error' | 'pageerror' | 'requestfailed';
|
|
21
21
|
message?: string;
|
|
@@ -375,7 +375,7 @@ export interface E2EElementInternal extends E2EElement {
|
|
|
375
375
|
e2eRunActions(): Promise<unknown>;
|
|
376
376
|
e2eSync(): Promise<void>;
|
|
377
377
|
}
|
|
378
|
-
export
|
|
378
|
+
export type FindSelector = string | FindSelectorOptions;
|
|
379
379
|
export interface FindSelectorOptions {
|
|
380
380
|
/**
|
|
381
381
|
* 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
|
-
|
|
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
|