@stencil/core 2.17.2-0 → 2.17.4

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 (40) hide show
  1. package/cli/index.cjs +101 -68
  2. package/cli/index.d.ts +1 -1
  3. package/cli/index.js +101 -68
  4. package/cli/package.json +1 -1
  5. package/compiler/package.json +1 -1
  6. package/compiler/stencil.js +363 -63
  7. package/compiler/stencil.min.js +2 -2
  8. package/dependencies.json +1 -1
  9. package/dev-server/client/index.js +1 -1
  10. package/dev-server/client/package.json +1 -1
  11. package/dev-server/connector.html +2 -2
  12. package/dev-server/index.js +1 -1
  13. package/dev-server/package.json +1 -1
  14. package/dev-server/server-process.js +2 -2
  15. package/internal/app-data/package.json +1 -1
  16. package/internal/client/css-shim.js +1 -1
  17. package/internal/client/dom.js +1 -1
  18. package/internal/client/index.js +1 -1
  19. package/internal/client/package.json +1 -1
  20. package/internal/client/patch-browser.js +1 -1
  21. package/internal/client/patch-esm.js +1 -1
  22. package/internal/client/shadow-css.js +1 -1
  23. package/internal/hydrate/package.json +1 -1
  24. package/internal/package.json +1 -1
  25. package/internal/stencil-private.d.ts +12 -2
  26. package/internal/stencil-public-compiler.d.ts +1 -1
  27. package/internal/testing/package.json +1 -1
  28. package/mock-doc/index.cjs +16 -1
  29. package/mock-doc/index.d.ts +5 -0
  30. package/mock-doc/index.js +16 -1
  31. package/mock-doc/package.json +1 -1
  32. package/package.json +1 -1
  33. package/screenshot/package.json +1 -1
  34. package/sys/node/index.js +1 -1
  35. package/sys/node/package.json +1 -1
  36. package/sys/node/worker.js +1 -1
  37. package/testing/index.js +40 -29
  38. package/testing/jest/jest-config.d.ts +1 -1
  39. package/testing/mocks.d.ts +7 -6
  40. package/testing/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Node System Worker v2.17.2-0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Node System Worker v2.17.4 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _interopNamespace(e) {
5
5
  if (e && e.__esModule) return e;
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Testing v2.17.2-0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Testing v2.17.4 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _lazyRequire(e) {
5
5
  return new Proxy({}, {
@@ -449,38 +449,40 @@ function versionIncluded(e) {
449
449
  return matchesRange(e);
450
450
  }
451
451
 
452
- function mockConfig(e) {
452
+ function mockConfig(e = {}) {
453
453
  const t = path__default.default.resolve("/");
454
- return e || (e = createTestingSystem()), e.getCurrentDirectory = () => t, {
454
+ let {sys: r} = e;
455
+ return r || (r = createTestingSystem()), r.getCurrentDirectory = () => t, {
455
456
  _isTesting: !0,
456
- namespace: "Testing",
457
- rootDir: t,
458
- globalScript: null,
459
- devMode: !0,
460
- enableCache: !1,
461
457
  buildAppCore: !1,
462
458
  buildDist: !0,
463
- flags: createConfigFlags(),
464
- bundles: null,
465
- outputTargets: null,
466
459
  buildEs5: !1,
460
+ bundles: null,
461
+ devMode: !0,
462
+ enableCache: !1,
463
+ extras: {},
464
+ flags: createConfigFlags(),
465
+ globalScript: null,
467
466
  hashFileNames: !1,
468
467
  logger: new TestingLogger,
469
468
  maxConcurrentWorkers: 0,
470
469
  minifyCss: !1,
471
470
  minifyJs: !1,
472
- sys: e,
473
- testing: null,
474
- validateTypes: !1,
475
- extras: {},
471
+ namespace: "Testing",
476
472
  nodeResolve: {
477
473
  customResolveOptions: {}
478
474
  },
479
- sourceMap: !0,
475
+ outputTargets: null,
480
476
  rollupPlugins: {
481
477
  before: [],
482
478
  after: []
483
- }
479
+ },
480
+ rootDir: t,
481
+ sourceMap: !0,
482
+ sys: r,
483
+ testing: null,
484
+ validateTypes: !1,
485
+ ...e
484
486
  };
485
487
  }
486
488
 
@@ -1321,21 +1323,23 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
1321
1323
  if (!r.includes(t.code) && (n = t.messageText, isIterable(t.next))) for (const r of t.next) n += flattenDiagnosticMessageText(e, r);
1322
1324
  return s && (n = n.replace("type 'StencilConfig'", "Stencil Config"), n = n.replace("Object literal may only specify known properties, but ", ""),
1323
1325
  n = n.replace("Object literal may only specify known properties, and ", "")), n.trim();
1324
- }, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www", isJest27TransformOptions = e => "object" == typeof e && e.hasOwnProperty("config");
1326
+ }, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www", isJest27TransformOptions = e => null != e && "object" == typeof e && e.hasOwnProperty("config");
1325
1327
 
1326
1328
  let _tsCompilerOptions = null, _tsCompilerOptionsKey = null;
1327
1329
 
1328
1330
  const jestPreprocessor = {
1329
1331
  process(e, t, r, s) {
1330
- if (isJest27TransformOptions(r) && (s = r.config), function n(e, t) {
1331
- const r = e.split(".").pop().toLowerCase().split("?")[0];
1332
- if ("ts" === r || "tsx" === r || "jsx" === r) return !0;
1333
- if ("mjs" === r) return !0;
1334
- if ("js" === r) {
1332
+ if (isJest27TransformOptions(r) && (s = r.config), !s) throw "Unable to find Jest transformation options.";
1333
+ if (function n(e, t) {
1334
+ var r;
1335
+ const s = (null !== (r = e.split(".").pop()) && void 0 !== r ? r : "").toLowerCase().split("?")[0];
1336
+ if ("ts" === s || "tsx" === s || "jsx" === s) return !0;
1337
+ if ("mjs" === s) return !0;
1338
+ if ("js" === s) {
1335
1339
  if (t.includes("import ") || t.includes("import.") || t.includes("import(")) return !0;
1336
1340
  if (t.includes("export ")) return !0;
1337
1341
  }
1338
- return "css" === r;
1342
+ return "css" === s;
1339
1343
  }(t, e)) {
1340
1344
  const r = {
1341
1345
  file: t,
@@ -1352,7 +1356,8 @@ const jestPreprocessor = {
1352
1356
  return e;
1353
1357
  },
1354
1358
  getCacheKey(e, t, r, s) {
1355
- if (isJest27TransformOptions(r) && (s = r.config), !_tsCompilerOptionsKey) {
1359
+ if (isJest27TransformOptions(r) && (s = r.config), !s) throw "Unable to find Jest transformation options.";
1360
+ if (!_tsCompilerOptionsKey) {
1356
1361
  const e = getCompilerOptions(s.rootDir);
1357
1362
  _tsCompilerOptionsKey = JSON.stringify(e);
1358
1363
  }
@@ -2893,7 +2898,7 @@ const createSystem = e => {
2893
2898
  u("/");
2894
2899
  const S = {
2895
2900
  name: "in-memory",
2896
- version: "2.17.2-0",
2901
+ version: "2.17.4",
2897
2902
  events: i,
2898
2903
  access: async e => c(e),
2899
2904
  accessSync: c,
@@ -3838,11 +3843,17 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
3838
3843
  hasVdomText: !1,
3839
3844
  hasVdomXlink: !1,
3840
3845
  ...e
3841
- }), exports.mockValidatedConfig = function mockValidatedConfig(e) {
3846
+ }), exports.mockValidatedConfig = function mockValidatedConfig(e = {}) {
3847
+ var t;
3848
+ const r = mockConfig(e);
3842
3849
  return {
3843
- ...mockConfig(e),
3850
+ ...r,
3844
3851
  flags: createConfigFlags(),
3845
- logger: mockLogger()
3852
+ logger: mockLogger(),
3853
+ outputTargets: null !== (t = r.outputTargets) && void 0 !== t ? t : [],
3854
+ sys: createTestingSystem(),
3855
+ testing: {},
3856
+ ...e
3846
3857
  };
3847
3858
  }, exports.mockWindow = function mockWindow(e = null) {
3848
3859
  return new index_cjs.MockWindow(e);
@@ -12,5 +12,5 @@ export declare function buildJestArgv(config: d.ValidatedConfig): Config.Argv;
12
12
  * @param config the Stencil config to use while generating Jest CLI arguments
13
13
  * @returns the Jest Config to attach to the `argv` argument
14
14
  */
15
- export declare function buildJestConfig(config: d.Config): string;
15
+ export declare function buildJestConfig(config: d.ValidatedConfig): string;
16
16
  export declare function getProjectListFromCLIArgs(config: d.Config, argv: Config.Argv): Config.Path[];
@@ -1,21 +1,22 @@
1
- import type { BuildCtx, Cache, CompilerCtx, CompilerSystem, Config, LoadConfigInit, ValidatedConfig, Module, UnvalidatedConfig } from '@stencil/core/internal';
1
+ import type { BuildCtx, Cache, CompilerCtx, Config, LoadConfigInit, ValidatedConfig, Module, UnvalidatedConfig } from '@stencil/core/internal';
2
2
  import { TestingSystem } from './testing-sys';
3
3
  import { TestingLogger } from './testing-logger';
4
4
  /**
5
5
  * Creates a mock instance of an internal, validated Stencil configuration object
6
- * @param sys an optional compiler system to associate with the config. If one is not provided, one will be created for
7
6
  * the caller
7
+ * @param overrides a partial implementation of `ValidatedConfig`. Any provided fields will override the defaults
8
+ * provided by this function.
8
9
  * @returns the mock Stencil configuration
9
10
  */
10
- export declare function mockValidatedConfig(sys?: CompilerSystem): ValidatedConfig;
11
+ export declare function mockValidatedConfig(overrides?: Partial<ValidatedConfig>): ValidatedConfig;
11
12
  /**
12
13
  * Creates a mock instance of a Stencil configuration entity. The mocked configuration has no guarantees around the
13
14
  * types/validity of its data.
14
- * @param sys an optional compiler system to associate with the config. If one is not provided, one will be created for
15
- * the caller
15
+ * @param overrides a partial implementation of `UnvalidatedConfig`. Any provided fields will override the defaults
16
+ * provided by this function.
16
17
  * @returns the mock Stencil configuration
17
18
  */
18
- export declare function mockConfig(sys?: CompilerSystem): UnvalidatedConfig;
19
+ export declare function mockConfig(overrides?: Partial<UnvalidatedConfig>): UnvalidatedConfig;
19
20
  /**
20
21
  * Creates a configuration object used to bootstrap a Stencil task invocation
21
22
  *
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/testing",
3
- "version": "2.17.2-0",
3
+ "version": "2.17.4",
4
4
  "description": "Stencil testing suite.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",