@stencil/core 4.18.2 → 4.18.3

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 +27 -12
  2. package/cli/index.js +27 -12
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +828 -662
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +52 -40
  12. package/internal/app-data/package.json +1 -1
  13. package/internal/client/index.js +34 -16
  14. package/internal/client/package.json +1 -1
  15. package/internal/client/patch-browser.js +1 -1
  16. package/internal/hydrate/index.js +32 -16
  17. package/internal/hydrate/package.json +1 -1
  18. package/internal/hydrate/runner.js +66 -58
  19. package/internal/package.json +1 -1
  20. package/internal/stencil-private.d.ts +3 -3
  21. package/internal/stencil-public-compiler.d.ts +3 -3
  22. package/internal/testing/index.js +31 -15
  23. package/internal/testing/package.json +1 -1
  24. package/mock-doc/index.cjs +66 -58
  25. package/mock-doc/index.d.ts +36 -30
  26. package/mock-doc/index.js +66 -58
  27. package/mock-doc/package.json +1 -1
  28. package/package.json +14 -17
  29. package/screenshot/index.js +1 -1
  30. package/screenshot/package.json +1 -1
  31. package/screenshot/pixel-match.js +4 -1
  32. package/sys/node/autoprefixer.js +2 -2
  33. package/sys/node/glob.js +1 -1
  34. package/sys/node/index.js +2 -2
  35. package/sys/node/node-fetch.js +10 -2
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +6 -3
  39. package/testing/mock-fetch.d.ts +4 -4
  40. package/testing/package.json +1 -1
package/cli/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil CLI (CommonJS) v4.18.2 | MIT Licensed | https://stenciljs.com
2
+ Stencil CLI (CommonJS) v4.18.3 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;
@@ -3001,7 +3001,7 @@ var findConfig = async (opts) => {
3001
3001
  if (!sys.platformPath.isAbsolute(configPath)) {
3002
3002
  configPath = normalizePath(sys.platformPath.join(cwd, configPath));
3003
3003
  } else {
3004
- configPath = normalizePath(opts.configPath);
3004
+ configPath = normalizePath(configPath);
3005
3005
  }
3006
3006
  } else {
3007
3007
  configPath = rootDir;
@@ -3133,7 +3133,7 @@ var taskPrerender = async (coreCompiler, config) => {
3133
3133
  return config.sys.exit(1);
3134
3134
  }
3135
3135
  const srcIndexHtmlPath = config.srcIndexHtml;
3136
- const diagnostics = await runPrerenderTask(coreCompiler, config, hydrateAppFilePath, null, srcIndexHtmlPath);
3136
+ const diagnostics = await runPrerenderTask(coreCompiler, config, hydrateAppFilePath, void 0, srcIndexHtmlPath);
3137
3137
  config.logger.printDiagnostics(diagnostics);
3138
3138
  if (diagnostics.some((d) => d.level === "error")) {
3139
3139
  return config.sys.exit(1);
@@ -3164,6 +3164,11 @@ var taskWatch = async (coreCompiler, config) => {
3164
3164
  const versionChecker = startCheckVersion(config, coreCompiler.version);
3165
3165
  const compiler = await coreCompiler.createCompiler(config);
3166
3166
  const watcher = await compiler.createWatcher();
3167
+ if (!config.sys.getDevServerExecutingPath || !config.sys.dynamicImport || !config.sys.onProcessInterrupt) {
3168
+ throw new Error(
3169
+ `Environment doesn't provide required functions: getDevServerExecutingPath, dynamicImport, onProcessInterrupt`
3170
+ );
3171
+ }
3167
3172
  if (config.flags.serve) {
3168
3173
  const devServerPath = config.sys.getDevServerExecutingPath();
3169
3174
  const { start } = await config.sys.dynamicImport(devServerPath);
@@ -3322,8 +3327,8 @@ function hasAppTarget(config) {
3322
3327
  );
3323
3328
  }
3324
3329
  function isUsingYarn(sys) {
3325
- var _a;
3326
- return ((_a = sys.getEnvironmentVar("npm_execpath")) == null ? void 0 : _a.includes("yarn")) || false;
3330
+ var _a, _b;
3331
+ return ((_b = (_a = sys.getEnvironmentVar) == null ? void 0 : _a.call(sys, "npm_execpath")) == null ? void 0 : _b.includes("yarn")) || false;
3327
3332
  }
3328
3333
  function getActiveTargets(config) {
3329
3334
  const result = config.outputTargets.map((t) => t.type);
@@ -3461,14 +3466,15 @@ async function npmPackages(sys, ionicPackages) {
3461
3466
  });
3462
3467
  }
3463
3468
  async function yarnPackages(sys, ionicPackages) {
3469
+ var _a;
3464
3470
  const appRootDir = sys.getCurrentDirectory();
3465
3471
  const yarnLock = sys.readFileSync(sys.resolvePath(appRootDir + "/yarn.lock"));
3466
- const yarnLockYml = sys.parseYarnLockFile(yarnLock);
3472
+ const yarnLockYml = (_a = sys.parseYarnLockFile) == null ? void 0 : _a.call(sys, yarnLock);
3467
3473
  return ionicPackages.map(([k, v]) => {
3468
- var _a;
3474
+ var _a2;
3469
3475
  const identifiedVersion = `${k}@${v}`;
3470
- let version = (_a = yarnLockYml.object[identifiedVersion]) == null ? void 0 : _a.version;
3471
- version = version.includes("undefined") ? sanitizeDeclaredVersion(identifiedVersion) : version;
3476
+ let version = (_a2 = yarnLockYml == null ? void 0 : yarnLockYml.object[identifiedVersion]) == null ? void 0 : _a2.version;
3477
+ version = version && version.includes("undefined") ? sanitizeDeclaredVersion(identifiedVersion) : version;
3472
3478
  return `${k}@${version}`;
3473
3479
  });
3474
3480
  }
@@ -3501,6 +3507,9 @@ async function sendTelemetry(sys, config, data) {
3501
3507
  metrics: [data],
3502
3508
  sent_at: now
3503
3509
  };
3510
+ if (!sys.fetch) {
3511
+ throw new Error("No fetch implementation available");
3512
+ }
3504
3513
  const response = await sys.fetch("https://api.ionicjs.com/events/metrics", {
3505
3514
  method: "POST",
3506
3515
  headers: {
@@ -3557,7 +3566,7 @@ var taskBuild = async (coreCompiler, config) => {
3557
3566
  config,
3558
3567
  results.hydrateAppFilePath,
3559
3568
  results.componentGraph,
3560
- null
3569
+ void 0
3561
3570
  );
3562
3571
  config.logger.printDiagnostics(prerenderDiagnostics);
3563
3572
  if (prerenderDiagnostics.some((d) => d.level === "error")) {
@@ -3868,6 +3877,11 @@ var taskServe = async (config) => {
3868
3877
  config.devServer.websocket = false;
3869
3878
  config.maxConcurrentWorkers = 1;
3870
3879
  config.devServer.root = isString(config.flags.root) ? config.flags.root : config.sys.getCurrentDirectory();
3880
+ if (!config.sys.getDevServerExecutingPath || !config.sys.dynamicImport || !config.sys.onProcessInterrupt) {
3881
+ throw new Error(
3882
+ `Environment doesn't provide required functions: getDevServerExecutingPath, dynamicImport, onProcessInterrupt`
3883
+ );
3884
+ }
3871
3885
  const devServerPath = config.sys.getDevServerExecutingPath();
3872
3886
  const { start } = await config.sys.dynamicImport(devServerPath);
3873
3887
  const devServer = await start(config.devServer, config.logger);
@@ -3886,6 +3900,7 @@ var taskServe = async (config) => {
3886
3900
 
3887
3901
  // src/cli/task-test.ts
3888
3902
  var taskTest = async (config) => {
3903
+ var _a;
3889
3904
  config.buildDocs = false;
3890
3905
  const testingRunOpts = {
3891
3906
  e2e: !!config.flags.e2e,
@@ -3905,8 +3920,8 @@ var taskTest = async (config) => {
3905
3920
  );
3906
3921
  }
3907
3922
  }
3908
- const diagnostics = await config.sys.lazyRequire.ensure(config.rootDir, ensureModuleIds);
3909
- if (diagnostics.length > 0) {
3923
+ const diagnostics = await ((_a = config.sys.lazyRequire) == null ? void 0 : _a.ensure(config.rootDir, ensureModuleIds));
3924
+ if (diagnostics && diagnostics.length > 0) {
3910
3925
  config.logger.printDiagnostics(diagnostics);
3911
3926
  return config.sys.exit(1);
3912
3927
  }
package/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil CLI v4.18.2 | MIT Licensed | https://stenciljs.com
2
+ Stencil CLI v4.18.3 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -2995,7 +2995,7 @@ var findConfig = async (opts) => {
2995
2995
  if (!sys.platformPath.isAbsolute(configPath)) {
2996
2996
  configPath = normalizePath(sys.platformPath.join(cwd, configPath));
2997
2997
  } else {
2998
- configPath = normalizePath(opts.configPath);
2998
+ configPath = normalizePath(configPath);
2999
2999
  }
3000
3000
  } else {
3001
3001
  configPath = rootDir;
@@ -3127,7 +3127,7 @@ var taskPrerender = async (coreCompiler, config) => {
3127
3127
  return config.sys.exit(1);
3128
3128
  }
3129
3129
  const srcIndexHtmlPath = config.srcIndexHtml;
3130
- const diagnostics = await runPrerenderTask(coreCompiler, config, hydrateAppFilePath, null, srcIndexHtmlPath);
3130
+ const diagnostics = await runPrerenderTask(coreCompiler, config, hydrateAppFilePath, void 0, srcIndexHtmlPath);
3131
3131
  config.logger.printDiagnostics(diagnostics);
3132
3132
  if (diagnostics.some((d) => d.level === "error")) {
3133
3133
  return config.sys.exit(1);
@@ -3158,6 +3158,11 @@ var taskWatch = async (coreCompiler, config) => {
3158
3158
  const versionChecker = startCheckVersion(config, coreCompiler.version);
3159
3159
  const compiler = await coreCompiler.createCompiler(config);
3160
3160
  const watcher = await compiler.createWatcher();
3161
+ if (!config.sys.getDevServerExecutingPath || !config.sys.dynamicImport || !config.sys.onProcessInterrupt) {
3162
+ throw new Error(
3163
+ `Environment doesn't provide required functions: getDevServerExecutingPath, dynamicImport, onProcessInterrupt`
3164
+ );
3165
+ }
3161
3166
  if (config.flags.serve) {
3162
3167
  const devServerPath = config.sys.getDevServerExecutingPath();
3163
3168
  const { start } = await config.sys.dynamicImport(devServerPath);
@@ -3316,8 +3321,8 @@ function hasAppTarget(config) {
3316
3321
  );
3317
3322
  }
3318
3323
  function isUsingYarn(sys) {
3319
- var _a;
3320
- return ((_a = sys.getEnvironmentVar("npm_execpath")) == null ? void 0 : _a.includes("yarn")) || false;
3324
+ var _a, _b;
3325
+ return ((_b = (_a = sys.getEnvironmentVar) == null ? void 0 : _a.call(sys, "npm_execpath")) == null ? void 0 : _b.includes("yarn")) || false;
3321
3326
  }
3322
3327
  function getActiveTargets(config) {
3323
3328
  const result = config.outputTargets.map((t) => t.type);
@@ -3455,14 +3460,15 @@ async function npmPackages(sys, ionicPackages) {
3455
3460
  });
3456
3461
  }
3457
3462
  async function yarnPackages(sys, ionicPackages) {
3463
+ var _a;
3458
3464
  const appRootDir = sys.getCurrentDirectory();
3459
3465
  const yarnLock = sys.readFileSync(sys.resolvePath(appRootDir + "/yarn.lock"));
3460
- const yarnLockYml = sys.parseYarnLockFile(yarnLock);
3466
+ const yarnLockYml = (_a = sys.parseYarnLockFile) == null ? void 0 : _a.call(sys, yarnLock);
3461
3467
  return ionicPackages.map(([k, v]) => {
3462
- var _a;
3468
+ var _a2;
3463
3469
  const identifiedVersion = `${k}@${v}`;
3464
- let version = (_a = yarnLockYml.object[identifiedVersion]) == null ? void 0 : _a.version;
3465
- version = version.includes("undefined") ? sanitizeDeclaredVersion(identifiedVersion) : version;
3470
+ let version = (_a2 = yarnLockYml == null ? void 0 : yarnLockYml.object[identifiedVersion]) == null ? void 0 : _a2.version;
3471
+ version = version && version.includes("undefined") ? sanitizeDeclaredVersion(identifiedVersion) : version;
3466
3472
  return `${k}@${version}`;
3467
3473
  });
3468
3474
  }
@@ -3495,6 +3501,9 @@ async function sendTelemetry(sys, config, data) {
3495
3501
  metrics: [data],
3496
3502
  sent_at: now
3497
3503
  };
3504
+ if (!sys.fetch) {
3505
+ throw new Error("No fetch implementation available");
3506
+ }
3498
3507
  const response = await sys.fetch("https://api.ionicjs.com/events/metrics", {
3499
3508
  method: "POST",
3500
3509
  headers: {
@@ -3551,7 +3560,7 @@ var taskBuild = async (coreCompiler, config) => {
3551
3560
  config,
3552
3561
  results.hydrateAppFilePath,
3553
3562
  results.componentGraph,
3554
- null
3563
+ void 0
3555
3564
  );
3556
3565
  config.logger.printDiagnostics(prerenderDiagnostics);
3557
3566
  if (prerenderDiagnostics.some((d) => d.level === "error")) {
@@ -3862,6 +3871,11 @@ var taskServe = async (config) => {
3862
3871
  config.devServer.websocket = false;
3863
3872
  config.maxConcurrentWorkers = 1;
3864
3873
  config.devServer.root = isString(config.flags.root) ? config.flags.root : config.sys.getCurrentDirectory();
3874
+ if (!config.sys.getDevServerExecutingPath || !config.sys.dynamicImport || !config.sys.onProcessInterrupt) {
3875
+ throw new Error(
3876
+ `Environment doesn't provide required functions: getDevServerExecutingPath, dynamicImport, onProcessInterrupt`
3877
+ );
3878
+ }
3865
3879
  const devServerPath = config.sys.getDevServerExecutingPath();
3866
3880
  const { start } = await config.sys.dynamicImport(devServerPath);
3867
3881
  const devServer = await start(config.devServer, config.logger);
@@ -3880,6 +3894,7 @@ var taskServe = async (config) => {
3880
3894
 
3881
3895
  // src/cli/task-test.ts
3882
3896
  var taskTest = async (config) => {
3897
+ var _a;
3883
3898
  config.buildDocs = false;
3884
3899
  const testingRunOpts = {
3885
3900
  e2e: !!config.flags.e2e,
@@ -3899,8 +3914,8 @@ var taskTest = async (config) => {
3899
3914
  );
3900
3915
  }
3901
3916
  }
3902
- const diagnostics = await config.sys.lazyRequire.ensure(config.rootDir, ensureModuleIds);
3903
- if (diagnostics.length > 0) {
3917
+ const diagnostics = await ((_a = config.sys.lazyRequire) == null ? void 0 : _a.ensure(config.rootDir, ensureModuleIds));
3918
+ if (diagnostics && diagnostics.length > 0) {
3904
3919
  config.logger.printDiagnostics(diagnostics);
3905
3920
  return config.sys.exit(1);
3906
3921
  }
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/cli",
3
- "version": "4.18.2",
3
+ "version": "4.18.3",
4
4
  "description": "Stencil CLI.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/compiler",
3
- "version": "4.18.2",
3
+ "version": "4.18.3",
4
4
  "description": "Stencil Compiler.",
5
5
  "main": "./stencil.js",
6
6
  "types": "./stencil.d.ts",