@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.
Files changed (39) hide show
  1. package/cli/index.cjs +96 -6
  2. package/cli/index.js +96 -6
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +524 -121
  6. package/compiler/stencil.min.js +2 -2
  7. package/dependencies.json +1 -1
  8. package/dev-server/client/index.js +1 -1
  9. package/dev-server/client/package.json +1 -1
  10. package/dev-server/connector.html +2 -2
  11. package/dev-server/index.js +1 -1
  12. package/dev-server/package.json +1 -1
  13. package/dev-server/server-process.js +2 -2
  14. package/internal/app-data/package.json +1 -1
  15. package/internal/client/css-shim.js +1 -1
  16. package/internal/client/dom.js +1 -1
  17. package/internal/client/index.js +1 -1
  18. package/internal/client/package.json +1 -1
  19. package/internal/client/patch-browser.js +1 -1
  20. package/internal/client/patch-esm.js +1 -1
  21. package/internal/client/shadow-css.js +1 -1
  22. package/internal/hydrate/package.json +1 -1
  23. package/internal/package.json +1 -1
  24. package/internal/stencil-private.d.ts +4 -0
  25. package/internal/stencil-public-compiler.d.ts +2 -2
  26. package/internal/testing/package.json +1 -1
  27. package/mock-doc/index.cjs +140 -5
  28. package/mock-doc/index.d.ts +76 -1
  29. package/mock-doc/index.js +140 -5
  30. package/mock-doc/package.json +1 -1
  31. package/package.json +1 -1
  32. package/screenshot/package.json +1 -1
  33. package/sys/node/index.js +325 -314
  34. package/sys/node/package.json +1 -1
  35. package/sys/node/worker.js +1 -1
  36. package/testing/index.d.ts +1 -1
  37. package/testing/index.js +406 -367
  38. package/testing/mocks.d.ts +22 -2
  39. package/testing/package.json +1 -1
@@ -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
- export declare function mockStencilSystem(): CompilerSystem;
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;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/testing",
3
- "version": "2.16.1",
3
+ "version": "2.17.0",
4
4
  "description": "Stencil testing suite.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",