@stencil/core 4.18.3 → 4.19.0-dev.1719512589.a83fbd7

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 (47) hide show
  1. package/cli/index.cjs +43 -16
  2. package/cli/index.js +43 -16
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +187 -77
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +3 -3
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +2 -2
  12. package/dev-server/ws.js +1 -1
  13. package/internal/app-data/package.json +1 -1
  14. package/internal/client/index.js +534 -507
  15. package/internal/client/package.json +3 -1
  16. package/internal/client/patch-browser.js +1 -1
  17. package/internal/hydrate/index.js +108 -50
  18. package/internal/hydrate/package.json +1 -1
  19. package/internal/hydrate/runner.d.ts +29 -11
  20. package/internal/hydrate/runner.js +239 -260
  21. package/internal/package.json +1 -1
  22. package/internal/stencil-private.d.ts +39 -14
  23. package/internal/stencil-public-compiler.d.ts +21 -0
  24. package/internal/stencil-public-runtime.d.ts +0 -2
  25. package/internal/testing/index.js +439 -407
  26. package/internal/testing/package.json +1 -1
  27. package/mock-doc/index.cjs +137 -131
  28. package/mock-doc/index.d.ts +18 -4
  29. package/mock-doc/index.js +137 -131
  30. package/mock-doc/package.json +1 -1
  31. package/package.json +57 -6
  32. package/screenshot/index.js +1 -1
  33. package/screenshot/package.json +1 -1
  34. package/screenshot/pixel-match.js +1 -1
  35. package/sys/node/index.js +10 -10
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +95 -16
  39. package/testing/jest/jest-27-and-under/matchers/events.d.ts +4 -0
  40. package/testing/jest/jest-27-and-under/matchers/index.d.ts +2 -1
  41. package/testing/jest/jest-28/matchers/events.d.ts +4 -0
  42. package/testing/jest/jest-28/matchers/index.d.ts +2 -1
  43. package/testing/jest/jest-29/matchers/events.d.ts +4 -0
  44. package/testing/jest/jest-29/matchers/index.d.ts +2 -1
  45. package/testing/mocks.d.ts +9 -9
  46. package/testing/package.json +1 -1
  47. package/testing/puppeteer/puppeteer-declarations.d.ts +11 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Compiler v4.18.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Compiler v4.19.0-dev.1719512589.a83fbd7 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;
@@ -115662,18 +115662,18 @@ ${lanes.join("\n")}
115662
115662
  0
115663
115663
  /* Call */
115664
115664
  );
115665
- const isPromise2 = !!getAwaitedTypeOfPromise(type);
115666
- if (callSignatures.length === 0 && !isPromise2) {
115665
+ const isPromise = !!getAwaitedTypeOfPromise(type);
115666
+ if (callSignatures.length === 0 && !isPromise) {
115667
115667
  return;
115668
115668
  }
115669
115669
  const testedNode = isIdentifier(location) ? location : isPropertyAccessExpression(location) ? location.name : void 0;
115670
115670
  const testedSymbol = testedNode && getSymbolAtLocation(testedNode);
115671
- if (!testedSymbol && !isPromise2) {
115671
+ if (!testedSymbol && !isPromise) {
115672
115672
  return;
115673
115673
  }
115674
115674
  const isUsed = testedSymbol && isBinaryExpression(condExpr2.parent) && isSymbolUsedInBinaryExpressionChain(condExpr2.parent, testedSymbol) || testedSymbol && body2 && isSymbolUsedInConditionBody(condExpr2, body2, testedNode, testedSymbol);
115675
115675
  if (!isUsed) {
115676
- if (isPromise2) {
115676
+ if (isPromise) {
115677
115677
  errorAndMaybeSuggestAwait(
115678
115678
  location,
115679
115679
  /*maybeMissingAwait*/
@@ -231091,16 +231091,16 @@ ${e.message}`;
231091
231091
  var typescript_5_4_5_bundle_cache_min_default = ts;
231092
231092
 
231093
231093
  // src/version.ts
231094
- var buildId = "1716921701";
231095
- var minfyJsId = "terser5.31.0_7";
231094
+ var buildId = "1719512589";
231095
+ var minfyJsId = "terser5.31.1_7";
231096
231096
  var optimizeCssId = "autoprefixer10.4.19_postcss8.4.38_7";
231097
231097
  var parse5Version = "7.1.2";
231098
231098
  var rollupVersion = "2.56.3";
231099
231099
  var jqueryVersion = "4.0.0-pre";
231100
- var terserVersion = "5.31.0";
231100
+ var terserVersion = "5.31.1";
231101
231101
  var typescriptVersion = "5.4.5";
231102
- var vermoji = "\u{1F604}";
231103
- var version = "4.18.3";
231102
+ var vermoji = "\u{1F3A1}";
231103
+ var version = "4.19.0-dev.1719512589.a83fbd7";
231104
231104
  var versions = {
231105
231105
  stencil: version,
231106
231106
  parse5: parse5Version,
@@ -231392,7 +231392,6 @@ var isNumber = (v) => typeof v === "number";
231392
231392
  var isObject = (val) => val != null && typeof val === "object" && Array.isArray(val) === false;
231393
231393
  var isString = (v) => typeof v === "string";
231394
231394
  var isIterable = (v) => isDefined(v) && isFunction(v[Symbol.iterator]);
231395
- var isPromise = (v) => !!v && (typeof v === "object" || typeof v === "function") && typeof v.then === "function";
231396
231395
 
231397
231396
  // src/utils/is-glob.ts
231398
231397
  var isGlob = (str) => {
@@ -234128,7 +234127,7 @@ var TYPE_LIBRARY = {};
234128
234127
  function addToLibrary(type, typeName, checker, pathToTypeModule) {
234129
234128
  pathToTypeModule = relative(process.cwd(), pathToTypeModule);
234130
234129
  if (pathToTypeModule.startsWith("node_modules")) {
234131
- return "";
234130
+ return "node_modules::" + typeName;
234132
234131
  }
234133
234132
  const id = getTypeId(pathToTypeModule, typeName);
234134
234133
  if (!type.isTypeParameter() && !(id in TYPE_LIBRARY)) {
@@ -237067,9 +237066,10 @@ function replace(options) {
237067
237066
  }
237068
237067
  var functionValues = mapToFunctions(replacements);
237069
237068
  var keys2 = Object.keys(functionValues).sort(longest).map(escape3);
237070
- var lookahead2 = preventAssignment ? "(?!\\s*(=[^=]|:[^:]))" : "";
237069
+ var lookbehind = preventAssignment ? "(?<!\\b(?:const|let|var)\\s*)" : "";
237070
+ var lookahead2 = preventAssignment ? "(?!\\s*=[^=])" : "";
237071
237071
  var pattern = new RegExp(
237072
- delimiters[0] + "(" + keys2.join("|") + ")" + delimiters[1] + lookahead2,
237072
+ "" + lookbehind + delimiters[0] + "(" + keys2.join("|") + ")" + delimiters[1] + lookahead2,
237073
237073
  "g"
237074
237074
  );
237075
237075
  return {
@@ -239883,7 +239883,7 @@ var SourceMapGenerator = class _SourceMapGenerator {
239883
239883
  }
239884
239884
  };
239885
239885
 
239886
- // scripts/build/terser-5_31_0-bundle-cache.min.js
239886
+ // scripts/build/terser-5_31_1-bundle-cache.min.js
239887
239887
  function characters(e) {
239888
239888
  return e.split("");
239889
239889
  }
@@ -242577,7 +242577,7 @@ def_transform(AST_Node, noop2), def_transform(AST_LabeledStatement, function(e,
242577
242577
  }
242578
242578
  function u(e2, t2) {
242579
242579
  e2.DEFMETHOD("to_mozilla_ast", function(e3) {
242580
- return this, n4 = t2(this, e3), i2 = this.start, o2 = this.end, i2 && o2 ? (null != i2.pos && null != o2.endpos && (n4.range = [i2.pos, o2.endpos]), i2.line && (n4.loc = { start: { line: i2.line, column: i2.col }, end: o2.endline ? { line: o2.endline, column: o2.endcol } : null }, i2.file && (n4.loc.source = i2.file)), n4) : n4;
242580
+ return n4 = t2(this, e3), i2 = this.start, o2 = this.end, i2 && o2 ? (null != i2.pos && null != o2.endpos && (n4.range = [i2.pos, o2.endpos]), i2.line && (n4.loc = { start: { line: i2.line, column: i2.col }, end: o2.endline ? { line: o2.endline, column: o2.endcol } : null }, i2.file && (n4.loc.source = i2.file)), n4) : n4;
242581
242581
  var n4, i2, o2;
242582
242582
  });
242583
242583
  }
@@ -243985,7 +243985,10 @@ function has_break_or_continue(e, t) {
243985
243985
  return t instanceof AST_LabeledStatement && i.push(t), i.push(e), e.body.walk(i), n3;
243986
243986
  }
243987
243987
  function maintain_this_binding(e, t, n3) {
243988
- return e instanceof AST_UnaryPrefix && "delete" == e.operator || e instanceof AST_Call && e.expression === t && (n3 instanceof AST_Chain || n3 instanceof AST_PropAccess || n3 instanceof AST_SymbolRef && "eval" == n3.name) ? make_sequence(t, [make_node(AST_Number, t, { value: 0 }), n3]) : n3;
243988
+ return requires_sequence_to_maintain_binding(e, t, n3) ? make_sequence(t, [make_node(AST_Number, t, { value: 0 }), n3]) : n3;
243989
+ }
243990
+ function requires_sequence_to_maintain_binding(e, t, n3) {
243991
+ return e instanceof AST_UnaryPrefix && "delete" == e.operator || e instanceof AST_Call && e.expression === t && (n3 instanceof AST_Chain || n3 instanceof AST_PropAccess || n3 instanceof AST_SymbolRef && "eval" == n3.name);
243989
243992
  }
243990
243993
  function is_func_expr(e) {
243991
243994
  return e instanceof AST_Arrow || e instanceof AST_Function;
@@ -244837,6 +244840,23 @@ def_eval(AST_PropAccess, function(e, t) {
244837
244840
  return t && make_sequence(this, t);
244838
244841
  });
244839
244842
  var r_keep_assign = /keep_assign/;
244843
+ function is_used_in_expression(e) {
244844
+ for (let t, n3, i = -1; t = e.parent(i), n3 = e.parent(i + 1); i++) {
244845
+ if (!(n3 instanceof AST_Sequence)) {
244846
+ if (n3 instanceof AST_Unary) {
244847
+ const e2 = n3.operator;
244848
+ if ("void" === e2) return false;
244849
+ if ("typeof" === e2 || "+" === e2 || "-" === e2 || "!" === e2 || "~" === e2) continue;
244850
+ }
244851
+ return true;
244852
+ }
244853
+ if (n3.expressions.indexOf(t) !== n3.expressions.length - 1) {
244854
+ const t2 = e.parent(i + 2);
244855
+ return !(n3.expressions.length > 2 || 1 === n3.expressions.length || !requires_sequence_to_maintain_binding(t2, n3, n3.expressions[1]));
244856
+ }
244857
+ }
244858
+ return true;
244859
+ }
244840
244860
  function def_reduce_vars(e, t) {
244841
244861
  e.DEFMETHOD("reduce_vars", t);
244842
244862
  }
@@ -244952,11 +244972,14 @@ AST_Scope.DEFMETHOD("drop_unused", function(e) {
244952
244972
  var f = new TreeTransformer(function(u2, c2, _2) {
244953
244973
  var p2 = f.parent();
244954
244974
  if (i) {
244955
- const e2 = o(u2);
244956
- if (e2 instanceof AST_SymbolRef) {
244957
- var d = e2.definition(), m = r.has(d.id);
244975
+ const t2 = o(u2);
244976
+ if (t2 instanceof AST_SymbolRef) {
244977
+ var d = t2.definition(), m = r.has(d.id);
244958
244978
  if (u2 instanceof AST_Assign) {
244959
- if (!m || a.has(d.id) && a.get(d.id) !== u2) return maintain_this_binding(p2, u2, u2.right.transform(f));
244979
+ if (!m || a.has(d.id) && a.get(d.id) !== u2) {
244980
+ const t3 = u2.right.transform(f);
244981
+ return m || t3.has_side_effects(e) || is_used_in_expression(f) ? maintain_this_binding(p2, u2, t3) : _2 ? MAP.skip : make_node(AST_Number, u2, { value: 0 });
244982
+ }
244960
244983
  } else if (!m) return _2 ? MAP.skip : make_node(AST_Number, u2, { value: 0 });
244961
244984
  }
244962
244985
  }
@@ -245025,6 +245048,13 @@ AST_Scope.DEFMETHOD("drop_unused", function(e) {
245025
245048
  return l = u2, c2(u2, this), l = e2, u2;
245026
245049
  }
245027
245050
  }
245051
+ }, function(e2, t2) {
245052
+ if (e2 instanceof AST_Sequence) switch (e2.expressions.length) {
245053
+ case 0:
245054
+ return t2 ? MAP.skip : make_node(AST_Number, e2, { value: 0 });
245055
+ case 1:
245056
+ return e2.expressions[0];
245057
+ }
245028
245058
  });
245029
245059
  function p(e2, n4) {
245030
245060
  var i2;
@@ -248023,10 +248053,17 @@ import { createWorker } from '${WORKER_HELPER_ID}';
248023
248053
  export const workerName = '${workerName}';
248024
248054
  export const workerMsgId = '${workerMsgId}';
248025
248055
  export const workerPath = /*@__PURE__*/import.meta.ROLLUP_FILE_URL_${referenceId};
248026
- const blob = new Blob(['importScripts("' + workerPath + '")'], { type: 'text/javascript' });
248027
- const url = URL.createObjectURL(blob);
248028
- export const worker = /*@__PURE__*/createWorker(url, workerName, workerMsgId);
248029
- URL.revokeObjectURL(url);
248056
+ export let worker;
248057
+ try {
248058
+ // first try directly starting the worker with the URL
248059
+ worker = /*@__PURE__*/createWorker(workerPath, workerName, workerMsgId);
248060
+ } catch(e) {
248061
+ // probably a cross-origin issue, try using a Blob instead
248062
+ const blob = new Blob(['importScripts("' + workerPath + '")'], { type: 'text/javascript' });
248063
+ const url = URL.createObjectURL(blob);
248064
+ worker = /*@__PURE__*/createWorker(url, workerName, workerMsgId);
248065
+ URL.revokeObjectURL(url);
248066
+ }
248030
248067
  `;
248031
248068
  };
248032
248069
  var getMockedWorkerMain = () => {
@@ -248158,7 +248195,8 @@ var getRollupOptions = (config, compilerCtx, buildCtx, bundleOpts) => {
248158
248195
  treeshake: getTreeshakeOption(config, bundleOpts),
248159
248196
  preserveEntrySignatures: (_c = bundleOpts.preserveEntrySignatures) != null ? _c : "strict",
248160
248197
  onwarn: createOnWarnFn(buildCtx.diagnostics),
248161
- cache: compilerCtx.rollupCache.get(bundleOpts.id)
248198
+ cache: compilerCtx.rollupCache.get(bundleOpts.id),
248199
+ external: config.rollupConfig.inputOptions.external
248162
248200
  };
248163
248201
  return rollupOptions;
248164
248202
  };
@@ -249751,7 +249789,7 @@ var getBuildFeatures = (cmps) => {
249751
249789
  member: cmps.some((c) => c.hasMember),
249752
249790
  method: cmps.some((c) => c.hasMethod),
249753
249791
  mode: cmps.some((c) => c.hasMode),
249754
- observeAttribute: cmps.some((c) => c.hasAttribute),
249792
+ observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback),
249755
249793
  prop: cmps.some((c) => c.hasProp),
249756
249794
  propBoolean: cmps.some((c) => c.hasPropBoolean),
249757
249795
  propNumber: cmps.some((c) => c.hasPropNumber),
@@ -250553,12 +250591,17 @@ var writeHydrateOutputs = (config, compilerCtx, buildCtx, outputTargets, rollupO
250553
250591
  var writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rollupOutput) => {
250554
250592
  const hydratePackageName = await getHydratePackageName(config, compilerCtx);
250555
250593
  const hydrateAppDirPath = outputTarget.dir;
250594
+ if (!hydrateAppDirPath) {
250595
+ throw new Error(`outputTarget config missing the "dir" property`);
250596
+ }
250556
250597
  const hydrateCoreIndexPath = join(hydrateAppDirPath, "index.js");
250598
+ const hydrateCoreIndexPathESM = join(hydrateAppDirPath, "index.mjs");
250557
250599
  const hydrateCoreIndexDtsFilePath = join(hydrateAppDirPath, "index.d.ts");
250558
250600
  const pkgJsonPath = join(hydrateAppDirPath, "package.json");
250559
250601
  const pkgJsonCode = getHydratePackageJson(
250560
250602
  config,
250561
250603
  hydrateCoreIndexPath,
250604
+ hydrateCoreIndexPathESM,
250562
250605
  hydrateCoreIndexDtsFilePath,
250563
250606
  hydratePackageName
250564
250607
  );
@@ -250577,24 +250620,32 @@ var writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rol
250577
250620
  })
250578
250621
  );
250579
250622
  };
250580
- var getHydratePackageJson = (config, hydrateAppFilePath, hydrateDtsFilePath, hydratePackageName) => {
250623
+ var getHydratePackageJson = (config, hydrateAppFilePathCJS, hydrateAppFilePathESM, hydrateDtsFilePath, hydratePackageName) => {
250581
250624
  const pkg = {
250582
250625
  name: hydratePackageName,
250583
250626
  description: `${config.namespace} component hydration app.`,
250584
- main: (0, import_path26.basename)(hydrateAppFilePath),
250585
- types: (0, import_path26.basename)(hydrateDtsFilePath)
250627
+ main: (0, import_path26.basename)(hydrateAppFilePathCJS),
250628
+ types: (0, import_path26.basename)(hydrateDtsFilePath),
250629
+ exports: {
250630
+ ".": {
250631
+ require: `./${(0, import_path26.basename)(hydrateAppFilePathCJS)}`,
250632
+ import: `./${(0, import_path26.basename)(hydrateAppFilePathESM)}`
250633
+ }
250634
+ }
250586
250635
  };
250587
250636
  return JSON.stringify(pkg, null, 2);
250588
250637
  };
250589
250638
  var getHydratePackageName = async (config, compilerCtx) => {
250639
+ const directoryName = (0, import_path26.basename)(config.rootDir);
250590
250640
  try {
250591
250641
  const rootPkgFilePath = join(config.rootDir, "package.json");
250592
250642
  const pkgStr = await compilerCtx.fs.readFile(rootPkgFilePath);
250593
250643
  const pkgData = JSON.parse(pkgStr);
250594
- return `${pkgData.name}/hydrate`;
250644
+ const scope = pkgData.name || directoryName;
250645
+ return `${scope}/hydrate`;
250595
250646
  } catch (e) {
250596
250647
  }
250597
- return `${config.fsNamespace}/hydrate`;
250648
+ return `${config.fsNamespace || directoryName}/hydrate`;
250598
250649
  };
250599
250650
  var copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
250600
250651
  const packageDir = join(config.sys.getCompilerExecutingPath(), "..", "..");
@@ -250604,6 +250655,15 @@ var copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
250604
250655
  };
250605
250656
 
250606
250657
  // src/compiler/output-targets/dist-hydrate-script/generate-hydrate-app.ts
250658
+ var buildHydrateAppFor = async (format, rollupBuild, config, compilerCtx, buildCtx, outputTargets) => {
250659
+ const file = format === "esm" ? "index.mjs" : "index.js";
250660
+ const rollupOutput = await rollupBuild.generate({
250661
+ banner: generatePreamble(config),
250662
+ format,
250663
+ file
250664
+ });
250665
+ await writeHydrateOutputs(config, compilerCtx, buildCtx, outputTargets, rollupOutput);
250666
+ };
250607
250667
  var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) => {
250608
250668
  try {
250609
250669
  const packageDir = join(config.sys.getCompilerExecutingPath(), "..", "..");
@@ -250611,6 +250671,7 @@ var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) =>
250611
250671
  const mockDoc = join(packageDir, "mock-doc", "index.js");
250612
250672
  const rollupOptions = {
250613
250673
  ...config.rollupConfig.inputOptions,
250674
+ external: ["stream"],
250614
250675
  input,
250615
250676
  inlineDynamicImports: true,
250616
250677
  plugins: [
@@ -250637,12 +250698,10 @@ var generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) =>
250637
250698
  onwarn: createOnWarnFn(buildCtx.diagnostics)
250638
250699
  };
250639
250700
  const rollupAppBuild = await rollup(rollupOptions);
250640
- const rollupOutput = await rollupAppBuild.generate({
250641
- banner: generatePreamble(config),
250642
- format: "cjs",
250643
- file: "index.js"
250644
- });
250645
- await writeHydrateOutputs(config, compilerCtx, buildCtx, outputTargets, rollupOutput);
250701
+ await Promise.all([
250702
+ buildHydrateAppFor("cjs", rollupAppBuild, config, compilerCtx, buildCtx, outputTargets),
250703
+ buildHydrateAppFor("esm", rollupAppBuild, config, compilerCtx, buildCtx, outputTargets)
250704
+ ]);
250646
250705
  } catch (e) {
250647
250706
  if (!buildCtx.hasError) {
250648
250707
  loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
@@ -252622,7 +252681,7 @@ var validateRollupConfig = (config) => {
252622
252681
  if (rollupConfig.inputOptions && isObject(rollupConfig.inputOptions)) {
252623
252682
  cleanRollupConfig = {
252624
252683
  ...cleanRollupConfig,
252625
- inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake"])
252684
+ inputOptions: pluck(rollupConfig.inputOptions, ["context", "moduleContext", "treeshake", "external"])
252626
252685
  };
252627
252686
  }
252628
252687
  if (rollupConfig.outputOptions && isObject(rollupConfig.outputOptions)) {
@@ -252849,6 +252908,7 @@ var validateConfig = (userConfig = {}, bootstrapConfig) => {
252849
252908
  devMode,
252850
252909
  extras: config.extras || {},
252851
252910
  flags,
252911
+ generateExportMaps: isBoolean(config.generateExportMaps) ? config.generateExportMaps : false,
252852
252912
  hashFileNames,
252853
252913
  hashedFileNameLength: (_c = config.hashedFileNameLength) != null ? _c : DEFAULT_HASHED_FILENAME_LENGTH,
252854
252914
  hydratedFlag: validateHydrated(config),
@@ -254171,6 +254231,9 @@ export interface CustomElementsDefineOptions {
254171
254231
  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
254172
254232
  }
254173
254233
  export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
254234
+ /**
254235
+ * @deprecated
254236
+ */
254174
254237
  export declare function applyPolyfills(): Promise<void>;
254175
254238
 
254176
254239
  /**
@@ -254366,7 +254429,7 @@ var updateTypeName = (currentTypeName, typeAlias) => {
254366
254429
  return currentTypeName;
254367
254430
  }
254368
254431
  const endingStrChar = "(?!(\"|'|`))";
254369
- const typeNameRegex = new RegExp(`${typeAlias.localName}\\b${endingStrChar}`, "g");
254432
+ const typeNameRegex = new RegExp(`\\b${typeAlias.localName}\\b${endingStrChar}`, "g");
254370
254433
  return currentTypeName.replace(typeNameRegex, typeAlias.importName);
254371
254434
  };
254372
254435
  var copyStencilCoreDts = async (config, compilerCtx) => {
@@ -254661,6 +254724,9 @@ var updateImportReferenceFactory = (typeCounts, filePath, config) => {
254661
254724
  }
254662
254725
  const newTypeName = getIncrementTypeName(typeName);
254663
254726
  existingTypeImportData[importResolvedFile].push({
254727
+ // Since we create a unique ID for each type for documentation generation purposes, we can parse
254728
+ // that ID to get the original name for the export
254729
+ originalName: typeReference.id.split("::").pop(),
254664
254730
  localName: typeName,
254665
254731
  importName: newTypeName
254666
254732
  });
@@ -254716,10 +254782,10 @@ var generateComponentTypesFile = (config, buildCtx, areTypesInternal) => {
254716
254782
  importFilePath = normalizePath("./" + relative(config.srcDir, filePath)).replace(/\.(tsx|ts)$/, "");
254717
254783
  }
254718
254784
  return `{ ${typeData.sort(sortImportNames).map((td2) => {
254719
- if (td2.localName === td2.importName) {
254720
- return `${td2.importName}`;
254785
+ if (td2.originalName === td2.importName) {
254786
+ return `${td2.originalName}`;
254721
254787
  } else {
254722
- return `${td2.localName} as ${td2.importName}`;
254788
+ return `${td2.originalName} as ${td2.importName}`;
254723
254789
  }
254724
254790
  }).join(`, `)} } from "${importFilePath}";`;
254725
254791
  });
@@ -258120,10 +258186,11 @@ var runTsProgram = async (config, compilerCtx, buildCtx, tsBuilder) => {
258120
258186
  const typesOutputTarget = config.outputTargets.filter(isOutputTargetDistTypes);
258121
258187
  const emittedDts = [];
258122
258188
  const emitCallback = (emitFilePath, data2, _w, _e, tsSourceFiles) => {
258189
+ if (emitFilePath.includes("e2e.") || emitFilePath.includes("spec.") || emitFilePath.endsWith("e2e.d.ts") || emitFilePath.endsWith("spec.d.ts")) {
258190
+ return;
258191
+ }
258123
258192
  if (emitFilePath.endsWith(".js") || emitFilePath.endsWith("js.map")) {
258124
258193
  updateModule(config, compilerCtx, buildCtx, tsSourceFiles[0], data2, emitFilePath, tsTypeChecker, null);
258125
- } else if (emitFilePath.endsWith(".e2e.d.ts") || emitFilePath.endsWith(".spec.d.ts") || emitFilePath === "e2e.d.ts" || emitFilePath === "spec.d.ts") {
258126
- return;
258127
258194
  } else if (emitFilePath.endsWith(".d.ts")) {
258128
258195
  const srcDtsPath = normalizePath(tsSourceFiles[0].fileName);
258129
258196
  const relativeEmitFilepath = getRelativeDts(config, srcDtsPath, emitFilePath);
@@ -258761,19 +258828,25 @@ var packageJsonWarn = (config, compilerCtx, buildCtx, msg, jsonField) => {
258761
258828
  var PRIMARY_PACKAGE_TARGET_CONFIGS = {
258762
258829
  dist: {
258763
258830
  getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js"))),
258764
- getTypesPath: (rootDir, outputTargetConfig) => normalizePath(relative(rootDir, join(outputTargetConfig.typesDir, "index.d.ts")))
258831
+ getTypesPath: (rootDir, outputTargetConfig) => normalizePath(relative(rootDir, join(outputTargetConfig.typesDir, "index.d.ts"))),
258832
+ getMainPath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.cjs.js")))
258765
258833
  },
258766
258834
  "dist-collection": {
258767
- getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js")))
258835
+ getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js"))),
258836
+ getTypesPath: () => null,
258837
+ getMainPath: () => null
258768
258838
  },
258769
258839
  "dist-custom-elements": {
258770
258840
  getModulePath: (rootDir, outputTargetDir) => normalizePath(relative(rootDir, join(outputTargetDir, "index.js"))),
258771
258841
  getTypesPath: (rootDir, outputTargetConfig) => {
258772
258842
  return outputTargetConfig.generateTypeDeclarations ? normalizePath(relative(rootDir, join(outputTargetConfig.dir, "index.d.ts"))) : null;
258773
- }
258843
+ },
258844
+ getMainPath: () => null
258774
258845
  },
258775
258846
  "dist-types": {
258776
- getTypesPath: (rootDir, outputTargetConfig) => normalizePath(relative(rootDir, join(outputTargetConfig.typesDir, "index.d.ts")))
258847
+ getModulePath: () => null,
258848
+ getTypesPath: (rootDir, outputTargetConfig) => normalizePath(relative(rootDir, join(outputTargetConfig.typesDir, "index.d.ts"))),
258849
+ getMainPath: () => null
258777
258850
  }
258778
258851
  };
258779
258852
  var validatePrimaryPackageOutputTarget = (config, compilerCtx, buildCtx) => {
@@ -258963,6 +259036,58 @@ var validateBuildFiles = (config, compilerCtx, buildCtx) => {
258963
259036
  ]);
258964
259037
  };
258965
259038
 
259039
+ // src/compiler/build/write-export-maps.ts
259040
+ var import_child_process = require("child_process");
259041
+ var writeExportMaps = (config, buildCtx) => {
259042
+ var _a;
259043
+ const eligiblePrimaryTargets = config.outputTargets.filter(isEligiblePrimaryPackageOutputTarget);
259044
+ if (eligiblePrimaryTargets.length > 0) {
259045
+ const primaryTarget = (_a = eligiblePrimaryTargets.find((o) => o.isPrimaryPackageOutputTarget)) != null ? _a : eligiblePrimaryTargets[0];
259046
+ const outputTargetConfig = PRIMARY_PACKAGE_TARGET_CONFIGS[primaryTarget.type];
259047
+ if (outputTargetConfig.getModulePath) {
259048
+ const importPath = outputTargetConfig.getModulePath(config.rootDir, primaryTarget.dir);
259049
+ if (importPath) {
259050
+ (0, import_child_process.execSync)(`npm pkg set "exports[.][import]"="${importPath}"`);
259051
+ }
259052
+ }
259053
+ if (outputTargetConfig.getMainPath) {
259054
+ const requirePath = outputTargetConfig.getMainPath(config.rootDir, primaryTarget.dir);
259055
+ if (requirePath) {
259056
+ (0, import_child_process.execSync)(`npm pkg set "exports[.][require]"="${requirePath}"`);
259057
+ }
259058
+ }
259059
+ if (outputTargetConfig.getTypesPath) {
259060
+ const typesPath = outputTargetConfig.getTypesPath(config.rootDir, primaryTarget);
259061
+ if (typesPath) {
259062
+ (0, import_child_process.execSync)(`npm pkg set "exports[.][types]"="${typesPath}"`);
259063
+ }
259064
+ }
259065
+ }
259066
+ const distLazyLoader = config.outputTargets.find(isOutputTargetDistLazyLoader);
259067
+ if (distLazyLoader != null) {
259068
+ let outDir = relative(config.rootDir, distLazyLoader.dir);
259069
+ if (!outDir.startsWith(".")) {
259070
+ outDir = "./" + outDir;
259071
+ }
259072
+ (0, import_child_process.execSync)(`npm pkg set "exports[./loader][import]"="${outDir}/index.js"`);
259073
+ (0, import_child_process.execSync)(`npm pkg set "exports[./loader][require]"="${outDir}/index.cjs"`);
259074
+ (0, import_child_process.execSync)(`npm pkg set "exports[./loader][types]"="${outDir}/index.d.ts"`);
259075
+ }
259076
+ const distCustomElements = config.outputTargets.find(isOutputTargetDistCustomElements);
259077
+ if (distCustomElements != null) {
259078
+ let outDir = relative(config.rootDir, distCustomElements.dir);
259079
+ if (!outDir.startsWith(".")) {
259080
+ outDir = "./" + outDir;
259081
+ }
259082
+ buildCtx.components.forEach((cmp) => {
259083
+ (0, import_child_process.execSync)(`npm pkg set "exports[./${cmp.tagName}][import]"="${outDir}/${cmp.tagName}.js"`);
259084
+ if (distCustomElements.generateTypeDeclarations) {
259085
+ (0, import_child_process.execSync)(`npm pkg set "exports[./${cmp.tagName}][types]"="${outDir}/${cmp.tagName}.d.ts"`);
259086
+ }
259087
+ });
259088
+ }
259089
+ };
259090
+
258966
259091
  // src/compiler/build/write-build.ts
258967
259092
  var writeBuild = async (config, compilerCtx, buildCtx) => {
258968
259093
  const timeSpan = buildCtx.createTimeSpan(`writeBuildFiles started`, true);
@@ -258977,6 +259102,9 @@ var writeBuild = async (config, compilerCtx, buildCtx) => {
258977
259102
  await compilerCtx.cache.commit();
258978
259103
  buildCtx.debug(`in-memory-fs: ${compilerCtx.fs.getMemoryStats()}`);
258979
259104
  buildCtx.debug(`cache: ${compilerCtx.cache.getMemoryStats()}`);
259105
+ if (config.generateExportMaps) {
259106
+ writeExportMaps(config, buildCtx);
259107
+ }
258980
259108
  await outputServiceWorkers(config, buildCtx);
258981
259109
  await validateBuildFiles(config, compilerCtx, buildCtx);
258982
259110
  } catch (e) {
@@ -261855,10 +261983,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
261855
261983
  }
261856
261984
  if (typeof prerenderConfig.beforeHydrate === "function") {
261857
261985
  try {
261858
- const rtn = prerenderConfig.beforeHydrate(doc, url);
261859
- if (isPromise(rtn)) {
261860
- await rtn;
261861
- }
261986
+ await prerenderConfig.beforeHydrate(doc, url);
261862
261987
  } catch (e) {
261863
261988
  catchError(results.diagnostics, e);
261864
261989
  }
@@ -261883,7 +262008,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
261883
262008
  excludeStaticComponents(doc, hydrateOpts, hydrateResults);
261884
262009
  }
261885
262010
  if (hydrateOpts.addModulePreloads) {
261886
- if (!prerenderRequest.isDebug) {
262011
+ if (!prerenderRequest.isDebug && componentGraph) {
261887
262012
  addModulePreloads(doc, hydrateOpts, hydrateResults, componentGraph);
261888
262013
  }
261889
262014
  } else {
@@ -261920,10 +262045,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
261920
262045
  }
261921
262046
  if (typeof prerenderConfig.afterHydrate === "function") {
261922
262047
  try {
261923
- const rtn = prerenderConfig.afterHydrate(doc, url, results);
261924
- if (isPromise(rtn)) {
261925
- await rtn;
261926
- }
262048
+ await prerenderConfig.afterHydrate(doc, url, results);
261927
262049
  } catch (e) {
261928
262050
  catchError(results.diagnostics, e);
261929
262051
  }
@@ -261935,7 +262057,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
261935
262057
  }
261936
262058
  return results;
261937
262059
  }
261938
- const html = hydrateApp.serializeDocumentToString(doc, hydrateOpts);
262060
+ const html = await hydrateApp.serializeDocumentToString(doc, hydrateOpts);
261939
262061
  prerenderEnsureDir(sys, prerenderCtx2, results.filePath);
261940
262062
  const writePromise = sys.writeFile(results.filePath, html);
261941
262063
  if (Array.isArray(hydrateResults.staticData) && hydrateResults.staticData.length > 0) {
@@ -262635,17 +262757,13 @@ var prerenderUrl = async (results, manager, url) => {
262635
262757
  var import_mock_doc3 = require("../mock-doc/index.cjs");
262636
262758
  var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager) => {
262637
262759
  try {
262638
- if (!isString(srcIndexHtmlPath)) {
262760
+ if (!isString(srcIndexHtmlPath) && outputTarget.indexHtml) {
262639
262761
  srcIndexHtmlPath = outputTarget.indexHtml;
262640
262762
  }
262641
262763
  let templateHtml;
262642
262764
  if (isFunction(prerenderConfig.loadTemplate)) {
262643
262765
  const loadTemplateResult = prerenderConfig.loadTemplate(srcIndexHtmlPath);
262644
- if (isPromise(loadTemplateResult)) {
262645
- templateHtml = await loadTemplateResult;
262646
- } else {
262647
- templateHtml = loadTemplateResult;
262648
- }
262766
+ templateHtml = await loadTemplateResult;
262649
262767
  } else {
262650
262768
  templateHtml = await config.sys.readFile(srcIndexHtmlPath);
262651
262769
  }
@@ -262658,7 +262776,7 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
262658
262776
  staticSite = !hasStencilScript(doc);
262659
262777
  }
262660
262778
  doc.documentElement.classList.add("hydrated");
262661
- if (hydrateOpts.inlineExternalStyleSheets && !isDebug) {
262779
+ if (hydrateOpts.inlineExternalStyleSheets && !isDebug && outputTarget.appDir) {
262662
262780
  try {
262663
262781
  await inlineExternalStyleSheets(config.sys, outputTarget.appDir, doc);
262664
262782
  } catch (e) {
@@ -262672,7 +262790,7 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
262672
262790
  catchError(diagnostics, e);
262673
262791
  }
262674
262792
  }
262675
- if (hydrateOpts.minifyStyleElements && !isDebug) {
262793
+ if (hydrateOpts.minifyStyleElements && !isDebug && outputTarget.baseUrl) {
262676
262794
  try {
262677
262795
  const baseUrl = new URL(outputTarget.baseUrl, manager.devServerHostUrl);
262678
262796
  await minifyStyleElements(config.sys, outputTarget.appDir, doc, baseUrl, true);
@@ -262682,20 +262800,12 @@ var generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug,
262682
262800
  }
262683
262801
  if (isFunction(prerenderConfig.beforeSerializeTemplate)) {
262684
262802
  const beforeSerializeResults = prerenderConfig.beforeSerializeTemplate(doc);
262685
- if (isPromise(beforeSerializeResults)) {
262686
- doc = await beforeSerializeResults;
262687
- } else {
262688
- doc = beforeSerializeResults;
262689
- }
262803
+ doc = await beforeSerializeResults;
262690
262804
  }
262691
262805
  let html = (0, import_mock_doc3.serializeNodeToHtml)(doc);
262692
262806
  if (isFunction(prerenderConfig.afterSerializeTemplate)) {
262693
262807
  const afterSerializeResults = prerenderConfig.afterSerializeTemplate(html);
262694
- if (isPromise(afterSerializeResults)) {
262695
- html = await afterSerializeResults;
262696
- } else {
262697
- html = afterSerializeResults;
262698
- }
262808
+ html = await afterSerializeResults;
262699
262809
  }
262700
262810
  return {
262701
262811
  html,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Dev Server Client v4.18.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Dev Server Client v4.19.0-dev.1719512589.a83fbd7 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/dev-server/client/app-error.css
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/dev-server/client",
3
- "version": "4.18.3",
3
+ "version": "4.19.0-dev.1719512589.a83fbd7",
4
4
  "description": "Stencil Dev Server Client.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",