@stencil/core 2.16.1 → 2.17.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 +96 -6
- package/cli/index.js +96 -6
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +524 -121
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +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/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 +1 -1
- 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/shadow-css.js +1 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +4 -0
- package/internal/stencil-public-compiler.d.ts +2 -2
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +140 -5
- package/mock-doc/index.d.ts +76 -1
- package/mock-doc/index.js +140 -5
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +325 -314
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.d.ts +1 -1
- package/testing/index.js +406 -367
- package/testing/mocks.d.ts +22 -2
- package/testing/package.json +1 -1
package/testing/mocks.d.ts
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
|
-
import type { BuildCtx, Cache, CompilerCtx, CompilerSystem, Config } from '@stencil/core/internal';
|
|
1
|
+
import type { BuildCtx, Cache, CompilerCtx, CompilerSystem, Config, Module } from '@stencil/core/internal';
|
|
2
|
+
import { TestingSystem } from './testing-sys';
|
|
2
3
|
import { TestingLogger } from './testing-logger';
|
|
3
4
|
export declare function mockConfig(sys?: CompilerSystem): Config;
|
|
4
5
|
export declare function mockCompilerCtx(config?: Config): CompilerCtx;
|
|
5
6
|
export declare function mockBuildCtx(config?: Config, compilerCtx?: CompilerCtx): BuildCtx;
|
|
6
7
|
export declare function mockCache(config?: Config, compilerCtx?: CompilerCtx): Cache;
|
|
7
8
|
export declare function mockLogger(): TestingLogger;
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Create a {@link CompilerSystem} entity for testing the compiler.
|
|
11
|
+
*
|
|
12
|
+
* This function acts as a thin wrapper around a {@link TestingSystem} entity creation. It exists to provide a logical
|
|
13
|
+
* place in the codebase where we might expect Stencil engineers to reach for when attempting to mock a
|
|
14
|
+
* {@link CompilerSystem} base type. Should there prove to be usage of both this function and the one it wraps,
|
|
15
|
+
* reconsider if this wrapper is necessary.
|
|
16
|
+
*
|
|
17
|
+
* @returns a System instance for testing purposes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function mockCompilerSystem(): TestingSystem;
|
|
9
20
|
export declare function mockDocument(html?: string): Document;
|
|
10
21
|
export declare function mockWindow(html?: string): Window;
|
|
22
|
+
/**
|
|
23
|
+
* This gives you a mock Module, an interface which is the internal compiler
|
|
24
|
+
* representation of a module. It includes a bunch of information necessary for
|
|
25
|
+
* compilation, this mock basically sets sane defaults for all those values.
|
|
26
|
+
*
|
|
27
|
+
* @param mod is an override module that you can supply to set particular values
|
|
28
|
+
* @returns a module object ready to use in tests!
|
|
29
|
+
*/
|
|
30
|
+
export declare const mockModule: (mod?: Partial<Module>) => Module;
|