@stencil/core 2.11.0 → 2.14.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.
- package/cli/index.cjs +33 -8
- package/cli/index.js +33 -8
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +2855 -4909
- package/compiler/lib.dom.iterable.d.ts +42 -66
- package/compiler/lib.es2015.core.d.ts +60 -18
- package/compiler/lib.es2015.iterable.d.ts +3 -11
- package/compiler/lib.es2015.promise.d.ts +2 -74
- package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
- package/compiler/lib.es2018.intl.d.ts +23 -11
- package/compiler/lib.es2019.string.d.ts +8 -2
- package/compiler/lib.es2020.bigint.d.ts +2 -2
- package/compiler/lib.es2020.intl.d.ts +173 -114
- package/compiler/lib.es2020.promise.d.ts +2 -3
- package/compiler/lib.es2021.d.ts +1 -0
- package/compiler/lib.es2021.intl.d.ts +44 -0
- package/compiler/lib.es2021.promise.d.ts +8 -1
- package/compiler/lib.es5.d.ts +112 -52
- package/compiler/lib.esnext.intl.d.ts +1 -10
- package/compiler/lib.webworker.d.ts +1013 -1267
- package/compiler/lib.webworker.iterable.d.ts +28 -34
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +391 -112
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +2 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +3 -3
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +16 -5
- 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 +34 -7
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +5 -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 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-public-runtime.d.ts +6 -4
- package/internal/testing/index.js +15 -13
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +33 -3
- package/mock-doc/index.d.ts +4 -3
- package/mock-doc/index.js +33 -3
- package/mock-doc/package.json +1 -1
- package/package.json +7 -7
- package/readme.md +52 -85
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +2 -2
- package/sys/node/index.js +22 -18
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +430 -402
- package/testing/jest/jest-config.d.ts +11 -0
- package/testing/jest/jest-environment.d.ts +1 -0
- package/testing/jest/jest-preprocessor.d.ts +56 -8
- package/testing/jest/jest-runner.d.ts +4 -0
- package/testing/jest-preset.js +5 -0
- package/testing/package.json +1 -1
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type * as d from '@stencil/core/internal';
|
|
2
2
|
import type { Config } from '@jest/types';
|
|
3
|
+
/**
|
|
4
|
+
* Builds the `argv` to be used when programmatically invoking the Jest CLI
|
|
5
|
+
* @param config the Stencil config to use while generating Jest CLI arguments
|
|
6
|
+
* @returns the arguments to pass to the Jest CLI, wrapped in an object
|
|
7
|
+
*/
|
|
3
8
|
export declare function buildJestArgv(config: d.Config): Config.Argv;
|
|
9
|
+
/**
|
|
10
|
+
* Generate a Jest run configuration to be used as a part of the `argv` passed to the Jest CLI when it is invoked
|
|
11
|
+
* programmatically
|
|
12
|
+
* @param config the Stencil config to use while generating Jest CLI arguments
|
|
13
|
+
* @returns the Jest Config to attach to the `argv` argument
|
|
14
|
+
*/
|
|
4
15
|
export declare function buildJestConfig(config: d.Config): string;
|
|
5
16
|
export declare function getProjectListFromCLIArgs(config: d.Config, argv: Config.Argv): Config.Path[];
|
|
@@ -1,11 +1,59 @@
|
|
|
1
|
+
declare type Jest26CacheKeyOptions = {
|
|
2
|
+
instrument: boolean;
|
|
3
|
+
rootDir: string;
|
|
4
|
+
};
|
|
5
|
+
declare type Jest26Config = {
|
|
6
|
+
instrument: boolean;
|
|
7
|
+
rootDir: string;
|
|
8
|
+
};
|
|
9
|
+
declare type Jest27TransformOptions = {
|
|
10
|
+
config: Jest26Config;
|
|
11
|
+
};
|
|
1
12
|
export declare const jestPreprocessor: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Transforms a file to CommonJS to be used by Jest. The API for `process` is described in the
|
|
15
|
+
* ["Writing custom transformers"](https://jestjs.io/docs/code-transformation#writing-custom-transformers)
|
|
16
|
+
* documentation on the jest site. Unfortunately, the URL is not versioned at the time of this writing. For
|
|
17
|
+
* reference, the v27.2 docs were referenced (the most recent available).
|
|
18
|
+
*
|
|
19
|
+
* This function attempts to support several versions of Jest (v23 through v27). Support for earlier versions of Jest
|
|
20
|
+
* will be removed in a future major version of Stencil.
|
|
21
|
+
*
|
|
22
|
+
* @param sourceText the contents of the source file
|
|
23
|
+
* @param sourcePath the path to the source file
|
|
24
|
+
* @param jestConfig the jest configuration when called by Jest 26 and lower. This parameter is folded into
|
|
25
|
+
* `transformOptions` when called by Jest 27+ as a top level `config` property. Calls to this function from Jest 27+
|
|
26
|
+
* will have a `Jest27TransformOptions` shape
|
|
27
|
+
* @param transformOptions an object containing the various transformation options. In Jest 27+ this parameter occurs
|
|
28
|
+
* third in this function signature (and no fourth parameter is formally accepted)
|
|
29
|
+
* @returns the transformed file contents if the file should be transformed. returns the original source otherwise
|
|
30
|
+
*/
|
|
31
|
+
process(sourceText: string, sourcePath: string, jestConfig: Jest26Config | Jest27TransformOptions, transformOptions?: Jest26Config): string;
|
|
32
|
+
/**
|
|
33
|
+
* Generates a key used to cache the results of transforming a file. This helps avoid re-processing a file via the
|
|
34
|
+
* `transform` function unnecessarily (when no changes have occurred). The API for `getCacheKey` is described in the
|
|
35
|
+
* ["Writing custom transformers"](https://jestjs.io/docs/code-transformation#writing-custom-transformers)
|
|
36
|
+
* documentation on the jest site. Unfortunately, the URL is not versioned at the time of this writing. For
|
|
37
|
+
* reference, the v27.2 docs were referenced (the most recent available).
|
|
38
|
+
*
|
|
39
|
+
* This function attempts to support several versions of Jest (v23 through v27). Support for earlier versions of Jest
|
|
40
|
+
* will be removed in a future major version of Stencil.
|
|
41
|
+
*
|
|
42
|
+
* @param sourceText the contents of the source file
|
|
43
|
+
* @param sourcePath the path to the source file
|
|
44
|
+
* @param jestConfigStr a stringified version of the jest configuration when called by Jest 26 and lower. This
|
|
45
|
+
* parameter takes the shape of `transformOptions` when called by Jest 27+.
|
|
46
|
+
* @param transformOptions an object containing the various transformation options. In Jest 27+ this parameter occurs
|
|
47
|
+
* third in this function signature (and no fourth parameter is formally accepted)
|
|
48
|
+
* @returns the key to cache a file with
|
|
49
|
+
*/
|
|
50
|
+
getCacheKey(sourceText: string, sourcePath: string, jestConfigStr: string | Jest27TransformOptions, transformOptions?: Jest26CacheKeyOptions): string;
|
|
10
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* Determines if a file should be transformed prior to being consumed by Jest, based on the file name and its contents
|
|
54
|
+
* @param filePath the path of the file
|
|
55
|
+
* @param sourceText the contents of the file
|
|
56
|
+
* @returns `true` if the file should be transformed, `false` otherwise
|
|
57
|
+
*/
|
|
11
58
|
export declare function shouldTransform(filePath: string, sourceText: string): boolean;
|
|
59
|
+
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type * as d from '@stencil/core/internal';
|
|
2
2
|
export declare function runJest(config: d.Config, env: d.E2EProcessEnv): Promise<boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* Creates a Stencil test runner
|
|
5
|
+
* @returns the test runner
|
|
6
|
+
*/
|
|
3
7
|
export declare function createTestRunner(): any;
|
|
4
8
|
export declare function includeTestFile(testPath: string, env: d.E2EProcessEnv): boolean;
|
|
5
9
|
export declare function getEmulateConfigs(testing: d.TestingConfig, flags: d.ConfigFlags): d.EmulateConfig[];
|
package/testing/jest-preset.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The path's declared below are relative. Specifically, they are relative to the location of this file after
|
|
3
|
+
* compilation of the Stencil compiler has completed. See `scripts/bundles/testing` for the location of this file
|
|
4
|
+
* following compilation.
|
|
5
|
+
*/
|
|
1
6
|
const path = require('path');
|
|
2
7
|
const testingDir = __dirname;
|
|
3
8
|
const rootDir = path.join(testingDir, '..');
|