@stencil/core 5.0.0-alpha.4 → 5.0.0-alpha.5

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 (36) hide show
  1. package/dist/{client-Dti6fFpE.mjs → client-Dnio47yQ.mjs} +81 -10
  2. package/dist/compiler/index.d.mts +2 -2
  3. package/dist/compiler/index.mjs +2 -2
  4. package/dist/compiler/utils/index.d.mts +2 -2
  5. package/dist/compiler/utils/index.mjs +3 -3
  6. package/dist/{compiler-BYRrEeD-.mjs → compiler-Dxri2g8Z.mjs} +15313 -14822
  7. package/dist/declarations/stencil-public-compiler.d.ts +288 -132
  8. package/dist/declarations/stencil-public-compiler.js +2 -3
  9. package/dist/declarations/stencil-public-runtime.d.ts +2 -0
  10. package/dist/{index-hS-KBdAP.d.ts → index-D-XN9HW_.d.ts} +1 -1
  11. package/dist/{index-BwTaN1Nq.d.mts → index-D5zaocDq.d.mts} +357 -189
  12. package/dist/{index-CyrGY82h.d.ts → index-D61XZw0f.d.ts} +2 -2
  13. package/dist/{index-9LTuoSiw.d.mts → index-Dat4djoo.d.mts} +1 -1
  14. package/dist/index.mjs +1 -1
  15. package/dist/{jsx-runtime-DlDkTqps.d.ts → jsx-runtime-B3vQbWIW.d.ts} +1 -1
  16. package/dist/jsx-runtime.d.ts +1 -1
  17. package/dist/jsx-runtime.js +1 -1
  18. package/dist/{node-BF2jSfWg.mjs → node-pj6rF4Wt.mjs} +66 -69
  19. package/dist/{regular-expression-D5pGVpCu.mjs → regular-expression-D0_N0PGa.mjs} +44 -26
  20. package/dist/runtime/app-data/index.d.ts +1 -1
  21. package/dist/runtime/client/index.d.ts +41 -8
  22. package/dist/runtime/client/index.js +105 -31
  23. package/dist/runtime/index.d.ts +29 -5
  24. package/dist/runtime/index.js +2 -2
  25. package/dist/runtime/server/index.d.mts +56 -25
  26. package/dist/runtime/server/index.mjs +122 -37
  27. package/dist/runtime/server/runner.d.mts +40 -26
  28. package/dist/runtime/server/runner.mjs +28 -22
  29. package/dist/{runtime-COEYYPyw.js → runtime-CKyUrF4i.js} +104 -30
  30. package/dist/sys/node/index.d.mts +1 -1
  31. package/dist/sys/node/index.mjs +1 -1
  32. package/dist/sys/node/worker.mjs +2 -2
  33. package/dist/testing/index.d.mts +2 -2
  34. package/dist/testing/index.mjs +15 -15
  35. package/dist/{validation-Byxie0Uk.mjs → validation-BA8nzXu_.mjs} +82 -58
  36. package/package.json +11 -12
@@ -486,6 +486,7 @@ declare namespace JSXBase {
486
486
  importance?: 'low' | 'auto' | 'high';
487
487
  height?: number | string;
488
488
  loading?: 'lazy' | 'auto' | 'eager';
489
+ referrerPolicy?: ReferrerPolicy;
489
490
  sizes?: string;
490
491
  src?: string;
491
492
  srcSet?: string;
@@ -1361,7 +1362,6 @@ interface BuildConditionals extends Partial<BuildFeatures> {
1361
1362
  attachStyles?: boolean;
1362
1363
  experimentalSlotFixes?: boolean;
1363
1364
  experimentalScopedSlotChanges?: boolean;
1364
- addGlobalStyleToComponents?: boolean | 'client';
1365
1365
  }
1366
1366
  interface ComponentConstructor {
1367
1367
  is?: string;
@@ -1888,4 +1888,4 @@ interface PlatformRuntime {
1888
1888
  }
1889
1889
  type ChildType = VNode | number | string;
1890
1890
  //#endregion
1891
- export { ResolutionHandler as _, ComponentRuntimeMeta as a, HostRef as c, RenderNode as d, RuntimeRef as f, JSXBase as g, HTMLStencilElement as h, ComponentRuntimeHostListener as i, LazyBundlesRuntimeData as l, FunctionalComponent as m, ChildType as n, ComponentRuntimeMetaCompact as o, CustomElementsDefineOptions as p, ComponentConstructor as r, HostElement as s, BuildConditionals as t, PlatformRuntime as u, TagTransformer as v, VNode as y };
1891
+ export { JSXBase as _, ComponentRuntimeHostListener as a, VNode as b, HostElement as c, PlatformRuntime as d, RenderNode as f, HTMLStencilElement as g, FunctionalComponent as h, ComponentConstructorChangeHandlers as i, HostRef as l, CustomElementsDefineOptions as m, ChildType as n, ComponentRuntimeMeta as o, RuntimeRef as p, ComponentConstructor as r, ComponentRuntimeMetaCompact as s, BuildConditionals as t, LazyBundlesRuntimeData as u, ResolutionHandler as v, TagTransformer as y };
@@ -1,4 +1,4 @@
1
- import { Tt as HostElement, ca as FunctionalComponent, da as TagTransformer, fa as UserBuildConditionals, hn as RuntimeRef, la as RafCallback, p as ChildType, pa as VNode, sa as ErrorHandler, ua as ResolutionHandler } from "./index-BwTaN1Nq.mjs";
1
+ import { Tt as HostElement, da as RafCallback, fa as ResolutionHandler, ha as VNode, la as ErrorHandler, ma as UserBuildConditionals, p as ChildType, pa as TagTransformer, sn as RuntimeRef, ua as FunctionalComponent } from "./index-D5zaocDq.mjs";
2
2
 
3
3
  //#region src/client/client-build.d.ts
4
4
  declare const Build: UserBuildConditionals;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { A as Element, C as setPlatformHelpers, D as AttachInternals, F as PropSerialize, I as State, L as Watch, M as Listen, N as Method, O as AttrDeserialize, P as Prop, R as resolveVar, S as writeTask, T as setErrorHandler, _ as getElement, a as Mixin, b as setAssetPath, c as forceUpdate, f as getMode, g as h, h as Host, i as render, j as Event, k as Component, l as getRenderingRef, n as setTagTransformer, o as Fragment, p as setMode, r as transformTag, v as getShadowRoot, x as readTask, y as getAssetPath, z as Build } from "./client-Dti6fFpE.mjs";
1
+ import { A as Element, C as setPlatformHelpers, D as AttachInternals, F as PropSerialize, I as State, L as Watch, M as Listen, N as Method, O as AttrDeserialize, P as Prop, R as resolveVar, S as writeTask, T as setErrorHandler, _ as getElement, a as Mixin, b as setAssetPath, c as forceUpdate, f as getMode, g as h, h as Host, i as render, j as Event, k as Component, l as getRenderingRef, n as setTagTransformer, o as Fragment, p as setMode, r as transformTag, v as getShadowRoot, x as readTask, y as getAssetPath, z as Build } from "./client-Dnio47yQ.mjs";
2
2
  export { AttachInternals, AttrDeserialize, Build, Component, Element, Event, Fragment, Host, Listen, Method, Mixin, Prop, PropSerialize, State, Watch, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, h, readTask, render, resolveVar, setAssetPath, setErrorHandler, setMode, setPlatformHelpers, setTagTransformer, transformTag, writeTask };
@@ -1,4 +1,4 @@
1
- import { m as FunctionalComponent, y as VNode } from "./index-CyrGY82h.js";
1
+ import { b as VNode, h as FunctionalComponent } from "./index-D61XZw0f.js";
2
2
 
3
3
  //#region src/runtime/fragment.d.ts
4
4
  declare const Fragment: FunctionalComponent;
@@ -1,2 +1,2 @@
1
- import { n as jsxs, r as Fragment, t as jsx } from "./jsx-runtime-DlDkTqps.js";
1
+ import { n as jsxs, r as Fragment, t as jsx } from "./jsx-runtime-B3vQbWIW.js";
2
2
  export { Fragment, jsx, jsxs };
@@ -1,2 +1,2 @@
1
- import { d as Fragment, n as jsx, r as jsxs } from "./runtime-COEYYPyw.js";
1
+ import { d as Fragment, n as jsx, r as jsxs } from "./runtime-CKyUrF4i.js";
2
2
  export { Fragment, jsx, jsxs };
@@ -1,25 +1,25 @@
1
1
  import { n as __require } from "./chunk-CjcI7cDX.mjs";
2
- import "./client-Dti6fFpE.mjs";
3
- import { h as noop, i as flatOne, l as isFunction, p as isString } from "./regular-expression-D5pGVpCu.mjs";
4
- import { bt as isGlob, dt as TASK_CANCELED_MSG, ft as buildError, ht as catchError, rt as normalizePath, vt as shouldIgnoreError } from "./validation-Byxie0Uk.mjs";
5
- import path from "node:path";
2
+ import "./client-Dnio47yQ.mjs";
3
+ import { h as noop, i as flatOne, l as isFunction, p as isString } from "./regular-expression-D0_N0PGa.mjs";
4
+ import { bt as isGlob, dt as TASK_CANCELED_MSG, ft as buildError, ht as catchError, rt as normalizePath, vt as shouldIgnoreError } from "./validation-BA8nzXu_.mjs";
5
+ import fs from "node:fs";
6
+ import nodePath from "node:path";
6
7
  import { pathToFileURL } from "node:url";
7
- import path$1 from "path";
8
- import fs from "graceful-fs";
8
+ import path from "path";
9
+ import * as cp from "child_process";
9
10
  import chalk from "chalk";
10
11
  import { createHash } from "node:crypto";
11
12
  import * as os from "node:os";
12
13
  import { cpus, freemem, platform, release, tmpdir, totalmem } from "node:os";
13
14
  import * as parcelWatcher from "@parcel/watcher";
14
- import { glob } from "glob";
15
- import { promisify } from "util";
15
+ import { glob } from "tinyglobby";
16
+ import { copyFile, mkdir, readdir, stat } from "node:fs/promises";
16
17
  import semverLte from "semver/functions/lte.js";
17
18
  import major from "semver/functions/major.js";
18
19
  import satisfies from "semver/functions/satisfies.js";
19
20
  import { cpus as cpus$1, tmpdir as tmpdir$1 } from "os";
20
21
  import semverLt from "semver/functions/lt.js";
21
22
  import { EventEmitter } from "events";
22
- import * as cp from "child_process";
23
23
  //#region src/compiler/events.ts
24
24
  const buildEvents = () => {
25
25
  const evCallbacks = [];
@@ -106,7 +106,7 @@ const LOG_LEVELS = [
106
106
  /**
107
107
  * The collection of valid export behaviors.
108
108
  * Used to generate a type for typed configs as well as output target validation
109
- * for the `dist-custom-elements` output target.
109
+ * for the `standalone` output target.
110
110
  *
111
111
  * Adding a value to this const array will automatically add it as a valid option on the
112
112
  * output target configuration for `customElementsExportBehavior`.
@@ -115,8 +115,7 @@ const LOG_LEVELS = [
115
115
  * - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
116
116
  * functionality allows consumers to bypass the explicit call to define a component, its children, its children's
117
117
  * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
118
- * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory. This behavior was added to allow easy migration
119
- * from `dist-custom-elements-bundle` to `dist-custom-elements`.
118
+ * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory.
120
119
  * - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.
121
120
  */
122
121
  const CustomElementsExportBehaviorOptions = [
@@ -676,7 +675,7 @@ function createNodeLoggerSys() {
676
675
  return Math.max(Math.min(terminalWidth, max_columns), min_columns);
677
676
  };
678
677
  const memoryUsage = () => process.memoryUsage().rss;
679
- const relativePath = (from, to) => path$1.relative(from, to);
678
+ const relativePath = (from, to) => path.relative(from, to);
680
679
  const writeLogs = (logFilePath, log, append) => {
681
680
  if (append) try {
682
681
  fs.accessSync(logFilePath);
@@ -734,12 +733,6 @@ function setupNodeProcess(c) {
734
733
  });
735
734
  }
736
735
  //#endregion
737
- //#region src/sys/node/node-fs-promisify.ts
738
- const copyFile = promisify(fs.copyFile);
739
- const mkdir = promisify(fs.mkdir);
740
- const readdir = promisify(fs.readdir);
741
- const stat = promisify(fs.stat);
742
- //#endregion
743
736
  //#region src/sys/node/node-copy-tasks.ts
744
737
  /**
745
738
  * Copy a file with retry logic for transient Windows errors (EBUSY, EPERM, EACCES).
@@ -794,15 +787,15 @@ async function nodeCopyTasks(copyTasks, srcDir) {
794
787
  async function processGlobs(copyTask, srcDir) {
795
788
  return isGlob(copyTask.src) ? await processGlobTask(copyTask, srcDir) : [{
796
789
  src: getSrcAbsPath(srcDir, copyTask.src),
797
- dest: copyTask.keepDirStructure ? path$1.join(copyTask.dest, copyTask.src) : copyTask.dest,
790
+ dest: copyTask.keepDirStructure ? path.join(copyTask.dest, copyTask.src) : copyTask.dest,
798
791
  warn: copyTask.warn,
799
792
  ignore: copyTask.ignore,
800
793
  keepDirStructure: copyTask.keepDirStructure
801
794
  }];
802
795
  }
803
796
  function getSrcAbsPath(srcDir, src) {
804
- if (path$1.isAbsolute(src)) return src;
805
- return path$1.join(srcDir, src);
797
+ if (path.isAbsolute(src)) return src;
798
+ return path.join(srcDir, src);
806
799
  }
807
800
  async function processGlobTask(copyTask, srcDir) {
808
801
  return (await asyncGlob(copyTask.src, {
@@ -812,9 +805,9 @@ async function processGlobTask(copyTask, srcDir) {
812
805
  })).map((globRelPath) => createGlobCopyTask(copyTask, srcDir, globRelPath));
813
806
  }
814
807
  function createGlobCopyTask(copyTask, srcDir, globRelPath) {
815
- const dest = path$1.join(copyTask.dest, copyTask.keepDirStructure ? globRelPath : path$1.basename(globRelPath));
808
+ const dest = path.join(copyTask.dest, copyTask.keepDirStructure ? globRelPath : path.basename(globRelPath));
816
809
  return {
817
- src: path$1.join(srcDir, globRelPath),
810
+ src: path.join(srcDir, globRelPath),
818
811
  dest,
819
812
  ignore: copyTask.ignore,
820
813
  warn: copyTask.warn,
@@ -844,8 +837,8 @@ async function processCopyTaskDirectory(results, allCopyTasks, copyTask) {
844
837
  const dirItems = await readdir(copyTask.src);
845
838
  await Promise.all(dirItems.map(async (dirItem) => {
846
839
  await processCopyTask(results, allCopyTasks, {
847
- src: path$1.join(copyTask.src, dirItem),
848
- dest: path$1.join(copyTask.dest, dirItem),
840
+ src: path.join(copyTask.src, dirItem),
841
+ dest: path.join(copyTask.dest, dirItem),
849
842
  warn: copyTask.warn
850
843
  });
851
844
  }));
@@ -856,7 +849,7 @@ async function processCopyTaskDirectory(results, allCopyTasks, copyTask) {
856
849
  function ensureDirs(copyTasks) {
857
850
  const mkDirs = [];
858
851
  copyTasks.forEach((copyTask) => {
859
- addMkDir(mkDirs, path$1.dirname(copyTask.dest));
852
+ addMkDir(mkDirs, path.dirname(copyTask.dest));
860
853
  });
861
854
  mkDirs.sort((a, b) => {
862
855
  const partsA = a.split("/").length;
@@ -874,13 +867,17 @@ function addMkDir(mkDirs, destDir) {
874
867
  if (destDir === ROOT_DIR || destDir + "/" === ROOT_DIR || destDir === "") return;
875
868
  if (!mkDirs.includes(destDir)) mkDirs.push(destDir);
876
869
  }
877
- const ROOT_DIR = normalizePath(path$1.resolve("/"));
870
+ const ROOT_DIR = normalizePath(path.resolve("/"));
878
871
  function shouldIgnore({ src, ignore = [] }) {
879
872
  const filePath = src.trim().toLowerCase();
880
873
  return ignore.some((ignoreFile) => filePath.endsWith(ignoreFile));
881
874
  }
882
- function asyncGlob(pattern, opts) {
883
- return glob(pattern, opts);
875
+ function asyncGlob(pattern, opts = {}) {
876
+ const { nodir, ...rest } = opts;
877
+ return glob(pattern, {
878
+ ...rest,
879
+ onlyFiles: nodir ?? true
880
+ });
884
881
  }
885
882
  //#endregion
886
883
  //#region src/sys/node/node-lazy-require.ts
@@ -942,7 +939,7 @@ var NodeLazyRequire = class {
942
939
  }
943
940
  getModulePath(fromDir, moduleId) {
944
941
  const modulePath = this.nodeResolveModule.resolveModule(fromDir, moduleId);
945
- return path$1.dirname(modulePath);
942
+ return path.dirname(modulePath);
946
943
  }
947
944
  };
948
945
  //#endregion
@@ -956,18 +953,18 @@ var NodeResolveModule = class {
956
953
  if (opts && opts.manuallyResolve) return this.resolveModuleManually(fromDir, moduleId, cacheKey);
957
954
  if (moduleId.startsWith("@types/")) return this.resolveTypesModule(fromDir, moduleId, cacheKey);
958
955
  const Module = __require("module");
959
- fromDir = path$1.resolve(fromDir);
960
- const fromFile = path$1.join(fromDir, "noop.js");
956
+ fromDir = path.resolve(fromDir);
957
+ const fromFile = path.join(fromDir, "noop.js");
961
958
  let dir = normalizePath(Module._resolveFilename(moduleId, {
962
959
  id: fromFile,
963
960
  filename: fromFile,
964
961
  paths: Module._nodeModulePaths(fromDir)
965
962
  }));
966
- const root = normalizePath(path$1.parse(fromDir).root);
963
+ const root = normalizePath(path.parse(fromDir).root);
967
964
  let packageJsonFilePath;
968
965
  while (dir !== root) {
969
- dir = normalizePath(path$1.dirname(dir));
970
- packageJsonFilePath = path$1.join(dir, "package.json");
966
+ dir = normalizePath(path.dirname(dir));
967
+ packageJsonFilePath = path.join(dir, "package.json");
971
968
  if (!fs.existsSync(packageJsonFilePath)) continue;
972
969
  this.resolveModuleCache.set(cacheKey, packageJsonFilePath);
973
970
  return packageJsonFilePath;
@@ -976,12 +973,12 @@ var NodeResolveModule = class {
976
973
  }
977
974
  resolveTypesModule(fromDir, moduleId, cacheKey) {
978
975
  const moduleSplt = moduleId.split("/");
979
- const root = normalizePath(path$1.parse(fromDir).root);
980
- let dir = normalizePath(path$1.join(fromDir, "noop.js"));
976
+ const root = normalizePath(path.parse(fromDir).root);
977
+ let dir = normalizePath(path.join(fromDir, "noop.js"));
981
978
  let typesPackageJsonFilePath;
982
979
  while (dir !== root) {
983
- dir = normalizePath(path$1.dirname(dir));
984
- typesPackageJsonFilePath = path$1.join(dir, "node_modules", moduleSplt[0], moduleSplt[1], "package.json");
980
+ dir = normalizePath(path.dirname(dir));
981
+ typesPackageJsonFilePath = path.join(dir, "node_modules", moduleSplt[0], moduleSplt[1], "package.json");
985
982
  if (!fs.existsSync(typesPackageJsonFilePath)) continue;
986
983
  this.resolveModuleCache.set(cacheKey, typesPackageJsonFilePath);
987
984
  return typesPackageJsonFilePath;
@@ -989,12 +986,12 @@ var NodeResolveModule = class {
989
986
  throw new Error(`error loading "${moduleId}" from "${fromDir}"`);
990
987
  }
991
988
  resolveModuleManually(fromDir, moduleId, cacheKey) {
992
- const root = normalizePath(path$1.parse(fromDir).root);
993
- let dir = normalizePath(path$1.join(fromDir, "noop.js"));
989
+ const root = normalizePath(path.parse(fromDir).root);
990
+ let dir = normalizePath(path.join(fromDir, "noop.js"));
994
991
  let packageJsonFilePath;
995
992
  while (dir !== root) {
996
- dir = normalizePath(path$1.dirname(dir));
997
- packageJsonFilePath = path$1.join(dir, "node_modules", moduleId, "package.json");
993
+ dir = normalizePath(path.dirname(dir));
994
+ packageJsonFilePath = path.join(dir, "node_modules", moduleId, "package.json");
998
995
  if (!fs.existsSync(packageJsonFilePath)) continue;
999
996
  this.resolveModuleCache.set(cacheKey, packageJsonFilePath);
1000
997
  return packageJsonFilePath;
@@ -1080,7 +1077,7 @@ function setLastCheck() {
1080
1077
  });
1081
1078
  }
1082
1079
  function getLastCheckStoragePath() {
1083
- return path$1.join(tmpdir$1(), "stencil_last_version_node.json");
1080
+ return path.join(tmpdir$1(), "stencil_last_version_node.json");
1084
1081
  }
1085
1082
  function printUpdateMessage(logger, currentVersion, latestVersion) {
1086
1083
  const installMessage = `npm install @stencil/core`;
@@ -1388,7 +1385,7 @@ function createNodeSys(c = {}) {
1388
1385
  const sysCpus = cpus();
1389
1386
  const hardwareConcurrency = sysCpus.length;
1390
1387
  const osPlatform = platform();
1391
- const compilerExecutingPath = path.join(__dirname, "compiler", "index.mjs");
1388
+ const compilerExecutingPath = nodePath.join(__dirname, "compiler", "index.mjs");
1392
1389
  const runInterruptsCallbacks = () => {
1393
1390
  const returnValues = [];
1394
1391
  let cb;
@@ -1439,8 +1436,8 @@ function createNodeSys(c = {}) {
1439
1436
  return new Promise((resolve) => {
1440
1437
  if (opts) fs.mkdir(p, opts, (err) => {
1441
1438
  resolve({
1442
- basename: path.basename(p),
1443
- dirname: path.dirname(p),
1439
+ basename: nodePath.basename(p),
1440
+ dirname: nodePath.dirname(p),
1444
1441
  path: p,
1445
1442
  newDirs: [],
1446
1443
  error: err
@@ -1448,8 +1445,8 @@ function createNodeSys(c = {}) {
1448
1445
  });
1449
1446
  else fs.mkdir(p, (err) => {
1450
1447
  resolve({
1451
- basename: path.basename(p),
1452
- dirname: path.dirname(p),
1448
+ basename: nodePath.basename(p),
1449
+ dirname: nodePath.dirname(p),
1453
1450
  path: p,
1454
1451
  newDirs: [],
1455
1452
  error: err
@@ -1459,8 +1456,8 @@ function createNodeSys(c = {}) {
1459
1456
  },
1460
1457
  createDirSync(p, opts) {
1461
1458
  const results = {
1462
- basename: path.basename(p),
1463
- dirname: path.dirname(p),
1459
+ basename: nodePath.basename(p),
1460
+ dirname: nodePath.dirname(p),
1464
1461
  path: p,
1465
1462
  newDirs: [],
1466
1463
  error: null
@@ -1473,7 +1470,7 @@ function createNodeSys(c = {}) {
1473
1470
  return results;
1474
1471
  },
1475
1472
  createWorkerController(maxConcurrentWorkers) {
1476
- return new NodeWorkerController(path.join(__dirname, "sys", "node", "worker.mjs"), maxConcurrentWorkers);
1473
+ return new NodeWorkerController(nodePath.join(__dirname, "sys", "node", "worker.mjs"), maxConcurrentWorkers);
1477
1474
  },
1478
1475
  async destroy() {
1479
1476
  const waits = [];
@@ -1532,13 +1529,13 @@ function createNodeSys(c = {}) {
1532
1529
  onProcessInterrupt: (cb) => {
1533
1530
  if (!onInterruptsCallbacks.includes(cb)) onInterruptsCallbacks.push(cb);
1534
1531
  },
1535
- platformPath: path,
1532
+ platformPath: nodePath,
1536
1533
  readDir(p) {
1537
1534
  return new Promise((resolve) => {
1538
1535
  fs.readdir(p, (err, files) => {
1539
1536
  if (err) resolve([]);
1540
1537
  else resolve(files.map((f) => {
1541
- return normalizePath(path.join(p, f));
1538
+ return normalizePath(nodePath.join(p, f));
1542
1539
  }));
1543
1540
  });
1544
1541
  });
@@ -1549,7 +1546,7 @@ function createNodeSys(c = {}) {
1549
1546
  readDirSync(p) {
1550
1547
  try {
1551
1548
  return fs.readdirSync(p).map((f) => {
1552
- return normalizePath(path.join(p, f));
1549
+ return normalizePath(nodePath.join(p, f));
1553
1550
  });
1554
1551
  } catch {}
1555
1552
  return [];
@@ -1626,8 +1623,8 @@ function createNodeSys(c = {}) {
1626
1623
  force: true
1627
1624
  }, (err) => {
1628
1625
  resolve({
1629
- basename: path.basename(p),
1630
- dirname: path.dirname(p),
1626
+ basename: nodePath.basename(p),
1627
+ dirname: nodePath.dirname(p),
1631
1628
  path: p,
1632
1629
  removedDirs: [],
1633
1630
  removedFiles: [],
@@ -1636,8 +1633,8 @@ function createNodeSys(c = {}) {
1636
1633
  });
1637
1634
  else fs.rmdir(p, (err) => {
1638
1635
  resolve({
1639
- basename: path.basename(p),
1640
- dirname: path.dirname(p),
1636
+ basename: nodePath.basename(p),
1637
+ dirname: nodePath.dirname(p),
1641
1638
  path: p,
1642
1639
  removedDirs: [],
1643
1640
  removedFiles: [],
@@ -1654,8 +1651,8 @@ function createNodeSys(c = {}) {
1654
1651
  });
1655
1652
  else fs.rmdirSync(p);
1656
1653
  return {
1657
- basename: path.basename(p),
1658
- dirname: path.dirname(p),
1654
+ basename: nodePath.basename(p),
1655
+ dirname: nodePath.dirname(p),
1659
1656
  path: p,
1660
1657
  removedDirs: [],
1661
1658
  removedFiles: [],
@@ -1663,8 +1660,8 @@ function createNodeSys(c = {}) {
1663
1660
  };
1664
1661
  } catch (e) {
1665
1662
  return {
1666
- basename: path.basename(p),
1667
- dirname: path.dirname(p),
1663
+ basename: nodePath.basename(p),
1664
+ dirname: nodePath.dirname(p),
1668
1665
  path: p,
1669
1666
  removedDirs: [],
1670
1667
  removedFiles: [],
@@ -1676,8 +1673,8 @@ function createNodeSys(c = {}) {
1676
1673
  return new Promise((resolve) => {
1677
1674
  fs.unlink(p, (err) => {
1678
1675
  resolve({
1679
- basename: path.basename(p),
1680
- dirname: path.dirname(p),
1676
+ basename: nodePath.basename(p),
1677
+ dirname: nodePath.dirname(p),
1681
1678
  path: p,
1682
1679
  error: err
1683
1680
  });
@@ -1686,8 +1683,8 @@ function createNodeSys(c = {}) {
1686
1683
  },
1687
1684
  removeFileSync(p) {
1688
1685
  const results = {
1689
- basename: path.basename(p),
1690
- dirname: path.dirname(p),
1686
+ basename: nodePath.basename(p),
1687
+ dirname: nodePath.dirname(p),
1691
1688
  path: p,
1692
1689
  error: null
1693
1690
  };
@@ -1762,7 +1759,7 @@ function createNodeSys(c = {}) {
1762
1759
  sys.watchFile = (filePath, callback) => {
1763
1760
  logger?.debug(`NODE_SYS_DEBUG::watchFile ${filePath}`);
1764
1761
  const normalizedPath = normalizePath(filePath);
1765
- const dirPath = path.dirname(filePath);
1762
+ const dirPath = nodePath.dirname(filePath);
1766
1763
  const subscriptionPromise = parcelWatcher.subscribe(dirPath, (err, events) => {
1767
1764
  if (err) {
1768
1765
  logger?.error(`Watch error for ${filePath}: ${err.message}`);
@@ -93,37 +93,48 @@ const COPY = "copy";
93
93
  */
94
94
  const CUSTOM = "custom";
95
95
  /**
96
- * Constant for the 'dist' output target
96
+ * Constant for the 'loader-bundle' output target
97
+ * (formerly 'dist' in v4)
97
98
  */
98
- const DIST = "dist";
99
+ const LOADER_BUNDLE = "loader-bundle";
99
100
  /**
100
- * Constant for the 'dist-collection' output target
101
+ * Constant for the 'standalone' output target
102
+ * (formerly 'dist-custom-elements' in v4)
101
103
  */
102
- const DIST_COLLECTION = "dist-collection";
104
+ const STANDALONE = "standalone";
103
105
  /**
104
- * Constant for the 'dist-custom-elements' output target
106
+ * Constant for the 'ssr' output target
107
+ * (formerly 'dist-hydrate-script' in v4)
105
108
  */
106
- const DIST_CUSTOM_ELEMENTS = "dist-custom-elements";
109
+ const SSR = "ssr";
107
110
  /**
108
- * Constant for the 'dist-types' output target
111
+ * Constant for the 'stencil-rebundle' output target
112
+ * (formerly 'dist-collection' sub-output in v4)
113
+ *
114
+ * Contains transpiled source + metadata for downstream Stencil projects
115
+ * to re-compile/bundle.
109
116
  */
110
- const DIST_TYPES = "dist-types";
117
+ const STENCIL_REBUNDLE = "stencil-rebundle";
111
118
  /**
112
- * Constant for the 'dist-hydrate-script' output target
119
+ * Constant for the 'types' output target
120
+ * (formerly 'dist-types' sub-output in v4)
113
121
  */
114
- const DIST_HYDRATE_SCRIPT = "dist-hydrate-script";
122
+ const TYPES = "types";
115
123
  /**
116
- * Constant for the 'dist-lazy' output target
124
+ * Constant for the 'global-style' output target
125
+ * Outputs global styles to a unified location available to all distributions.
117
126
  */
118
- const DIST_LAZY = "dist-lazy";
127
+ const GLOBAL_STYLE = "global-style";
119
128
  /**
120
- * Constant for the 'dist-lazy-loader' output target
129
+ * Constant for the 'assets' output target
130
+ * Copies component assetsDirs to a unified location available to all distributions.
121
131
  */
122
- const DIST_LAZY_LOADER = "dist-lazy-loader";
132
+ const ASSETS = "assets";
123
133
  /**
124
- * Constant for the 'dist-global-styles' output target
134
+ * Internal constant for the 'dist-lazy' output target
135
+ * (used by loader-bundle and www)
125
136
  */
126
- const DIST_GLOBAL_STYLES = "dist-global-styles";
137
+ const DIST_LAZY = "dist-lazy";
127
138
  /**
128
139
  * Constant for the 'docs-custom' output target
129
140
  */
@@ -155,18 +166,25 @@ const WWW = "www";
155
166
  /**
156
167
  * Valid output targets to specify in a Stencil config.
157
168
  *
158
- * Note that there are some output targets (e.g. `DIST_TYPES`) which are
159
- * programmatically set as output targets by the compiler when other output
160
- * targets (in that case `DIST`) are set, but which are _not_ supported in a
161
- * Stencil config. This is enforced in the output target validation code.
169
+ * Note that some internal output targets (e.g. `DIST_LAZY`, `DIST_GLOBAL_STYLES`)
170
+ * are programmatically created by the compiler and are not user-configurable.
171
+ *
172
+ * In v5, `TYPES` and `STENCIL_REBUNDLE` are auto-generated in production builds unless explicitly configured.
162
173
  */
163
174
  const VALID_CONFIG_OUTPUT_TARGETS = [
164
175
  "www",
165
- DIST,
166
- DIST_COLLECTION,
167
- DIST_CUSTOM_ELEMENTS,
168
- DIST_LAZY,
169
- DIST_HYDRATE_SCRIPT,
176
+ LOADER_BUNDLE,
177
+ STANDALONE,
178
+ "ssr",
179
+ STENCIL_REBUNDLE,
180
+ TYPES,
181
+ GLOBAL_STYLE,
182
+ ASSETS,
183
+ "dist",
184
+ "dist-custom-elements",
185
+ "dist-hydrate-script",
186
+ "dist-collection",
187
+ "dist-types",
170
188
  DOCS_JSON,
171
189
  DOCS_README,
172
190
  DOCS_VSCODE,
@@ -412,4 +430,4 @@ const escapeRegExpSpecialCharacters = (text) => {
412
430
  return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
413
431
  };
414
432
  //#endregion
415
- export { XLINK_NS as $, DIST_CUSTOM_ELEMENTS as A, DOCS_VSCODE as B, CMP_FLAGS as C, DEFAULT_STYLE_MODE as D, CUSTOM as E, DIST_TYPES as F, LISTENER_FLAGS as G, GENERATED_DTS as H, DOCS_CUSTOM as I, STATS as J, MEMBER_FLAGS as K, DOCS_CUSTOM_ELEMENTS_MANIFEST as L, DIST_HYDRATE_SCRIPT as M, DIST_LAZY as N, DIST as O, DIST_LAZY_LOADER as P, WWW as Q, DOCS_JSON as R, queryNonceMetaTagContent as S, COPY as T, HOST_FLAGS as U, EVENT_FLAGS as V, HTML_NS as W, VALID_CONFIG_OUTPUT_TARGETS as X, SVG_NS as Y, WATCH_FLAGS as Z, sortBy as _, fromEntries as a, toTitleCase as b, isDef as c, isNumber as d, isObject as f, pluck as g, noop as h, flatOne as i, DIST_GLOBAL_STYLES as j, DIST_COLLECTION as k, isFunction as l, mergeIntoWith as m, dashToPascalCase as n, isBoolean as o, isString as p, NODE_TYPES as q, escapeWithPattern as r, isComplexType as s, escapeRegExpSpecialCharacters as t, isIterable as u, toCamelCase as v, COLLECTION_MANIFEST_FILE_NAME as w, unique as x, toDashCase as y, DOCS_README as z };
433
+ export { XLINK_NS as $, DOCS_CUSTOM as A, LISTENER_FLAGS as B, ASSETS as C, CUSTOM as D, COPY as E, EVENT_FLAGS as F, STANDALONE as G, MEMBER_FLAGS as H, GENERATED_DTS as I, SVG_NS as J, STATS as K, GLOBAL_STYLE as L, DOCS_JSON as M, DOCS_README as N, DEFAULT_STYLE_MODE as O, DOCS_VSCODE as P, WWW as Q, HOST_FLAGS as R, queryNonceMetaTagContent as S, COLLECTION_MANIFEST_FILE_NAME as T, NODE_TYPES as U, LOADER_BUNDLE as V, SSR as W, VALID_CONFIG_OUTPUT_TARGETS as X, TYPES as Y, WATCH_FLAGS as Z, sortBy as _, fromEntries as a, toTitleCase as b, isDef as c, isNumber as d, isObject as f, pluck as g, noop as h, flatOne as i, DOCS_CUSTOM_ELEMENTS_MANIFEST as j, DIST_LAZY as k, isFunction as l, mergeIntoWith as m, dashToPascalCase as n, isBoolean as o, isString as p, STENCIL_REBUNDLE as q, escapeWithPattern as r, isComplexType as s, escapeRegExpSpecialCharacters as t, isIterable as u, toCamelCase as v, CMP_FLAGS as w, unique as x, toDashCase as y, HTML_NS as z };
@@ -1,2 +1,2 @@
1
- import { n as Env, r as NAMESPACE, t as BUILD } from "../../index-hS-KBdAP.js";
1
+ import { n as Env, r as NAMESPACE, t as BUILD } from "../../index-D-XN9HW_.js";
2
2
  export { BUILD, Env, NAMESPACE };
@@ -497,6 +497,7 @@ declare namespace JSXBase {
497
497
  importance?: 'low' | 'auto' | 'high';
498
498
  height?: number | string;
499
499
  loading?: 'lazy' | 'auto' | 'eager';
500
+ referrerPolicy?: ReferrerPolicy;
500
501
  sizes?: string;
501
502
  src?: string;
502
503
  srcSet?: string;
@@ -1284,7 +1285,7 @@ interface CustomElementsDefineOptions {
1284
1285
  }
1285
1286
  //#endregion
1286
1287
  //#region src/declarations/stencil-public-compiler.d.ts
1287
- interface HydrateDocumentOptions {
1288
+ interface SsrDocumentOptions {
1288
1289
  /**
1289
1290
  * Build ID that will be added to `<html data-stencil-build="BUILD_ID">`. By default
1290
1291
  * a random ID will be generated
@@ -1301,7 +1302,7 @@ interface HydrateDocumentOptions {
1301
1302
  * JavaScript to read the structure of the HTML and rebuild each
1302
1303
  * component. Defaults to `true`.
1303
1304
  */
1304
- clientHydrateAnnotations?: boolean;
1305
+ clientSsrAnnotations?: boolean;
1305
1306
  /**
1306
1307
  * Constrain `setTimeout()` to 1ms, but still async. Also
1307
1308
  * only allows `setInterval()` to fire once, also constrained to 1ms.
@@ -1400,10 +1401,14 @@ interface HydrateDocumentOptions {
1400
1401
  default: 'declarative-shadow-dom' | 'scoped';
1401
1402
  } | boolean;
1402
1403
  }
1403
- interface SerializeDocumentOptions extends HydrateDocumentOptions {
1404
+ interface SerializeDocumentOptions extends SsrDocumentOptions {
1404
1405
  /**
1405
1406
  * Runs after the `document` has been hydrated.
1406
1407
  */
1408
+ afterSsr?(document: any): any | Promise<any>;
1409
+ /**
1410
+ * @deprecated Use `afterSsr` instead.
1411
+ */
1407
1412
  afterHydrate?(document: any): any | Promise<any>;
1408
1413
  /**
1409
1414
  * Sets an approximate line width the HTML should attempt to stay within.
@@ -1416,6 +1421,10 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
1416
1421
  /**
1417
1422
  * Runs before the `document` has been hydrated.
1418
1423
  */
1424
+ beforeSsr?(document: any): any | Promise<any>;
1425
+ /**
1426
+ * @deprecated Use `beforeSsr` instead.
1427
+ */
1419
1428
  beforeHydrate?(document: any): any | Promise<any>;
1420
1429
  /**
1421
1430
  * Format the HTML in a nicely indented format.
@@ -1453,7 +1462,7 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
1453
1462
  */
1454
1463
  modes?: ResolutionHandler[];
1455
1464
  }
1456
- interface HydrateFactoryOptions extends SerializeDocumentOptions {
1465
+ interface SsrFactoryOptions extends SerializeDocumentOptions {
1457
1466
  serializeToHtml: boolean;
1458
1467
  destroyWindow: boolean;
1459
1468
  destroyDocument: boolean;
@@ -2122,7 +2131,7 @@ declare const setErrorHandler: (handler: ErrorHandler) => ErrorHandler;
2122
2131
  //#region src/client/client-style.d.ts
2123
2132
  declare const styles: StyleMap;
2124
2133
  declare const modeResolutionChain: ResolutionHandler[];
2125
- declare const setScopedSSR: (_opts: HydrateFactoryOptions) => void;
2134
+ declare const setScopedSsr: (_opts: SsrFactoryOptions) => void;
2126
2135
  declare const needsScopedSSR: () => boolean;
2127
2136
  //#endregion
2128
2137
  //#region src/client/client-task-queue.d.ts
@@ -2154,12 +2163,12 @@ declare const supportsMutableAdoptedStyleSheets: boolean;
2154
2163
  declare const getAssetPath: (path: string) => string;
2155
2164
  declare const setAssetPath: (path: string) => string;
2156
2165
  //#endregion
2157
- //#region src/runtime/bootstrap-custom-element.d.ts
2166
+ //#region src/runtime/bootstrap-standalone.d.ts
2158
2167
  declare const defineCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => void;
2159
2168
  declare const proxyCustomElement: (Cstr: any, compactMeta: ComponentRuntimeMetaCompact) => any;
2160
2169
  declare const forceModeUpdate: (elm: RenderNode) => void;
2161
2170
  //#endregion
2162
- //#region src/runtime/bootstrap-lazy.d.ts
2171
+ //#region src/runtime/bootstrap-loader.d.ts
2163
2172
  declare const bootstrapLazy: (lazyBundles: LazyBundlesRuntimeData, options?: CustomElementsDefineOptions) => void;
2164
2173
  //#endregion
2165
2174
  //#region src/runtime/connected-callback.d.ts
@@ -2211,6 +2220,30 @@ declare const getMode: (ref: RuntimeRef) => string;
2211
2220
  */
2212
2221
  declare const setNonce: (nonce: string) => string;
2213
2222
  //#endregion
2223
+ //#region src/runtime/normalize-watchers.d.ts
2224
+ /**
2225
+ * Normalizes watcher metadata to the current `{ [methodName]: flags }[]` format.
2226
+ *
2227
+ * Prior to Stencil 4.39.x (PR #6484), the `@Watch()` compiler emitted watcher
2228
+ * handlers as a plain string array: `{ "min": ["minChanged"] }`. The new format
2229
+ * wraps each entry in an object that carries option flags (e.g. `immediate`):
2230
+ * `{ "min": [{ "minChanged": 0 }] }`.
2231
+ *
2232
+ * When a library (e.g. Ionic Framework) was compiled with an older Stencil compiler
2233
+ * but consumed by an app using a newer Stencil runtime, the runtime's
2234
+ * `Object.entries(watcher)` call receives a string and misinterprets its character
2235
+ * indices as method names, causing:
2236
+ * `TypeError: instance[watchMethodName] is not a function`
2237
+ *
2238
+ * This helper should be used at `$watchers$` assignment sites that need to
2239
+ * accept both legacy and current compiler metadata so downstream code on those
2240
+ * paths can safely assume the new object format.
2241
+ *
2242
+ * @param raw The raw watcher map from compiled metadata (new or legacy format).
2243
+ * @returns A normalized watcher map in the `{ [methodName]: flags }[]` format, or `undefined` if `raw` is `undefined` or empty.
2244
+ */
2245
+ declare const normalizeWatchers: (raw: ComponentConstructorChangeHandlers | undefined) => ComponentConstructorChangeHandlers | undefined;
2246
+ //#endregion
2214
2247
  //#region src/runtime/parse-property-value.d.ts
2215
2248
  /**
2216
2249
  * Parse a new property value for a given property type.
@@ -2369,4 +2402,4 @@ declare const insertVdomAnnotations: (doc: Document, staticComponents: string[])
2369
2402
  */
2370
2403
  declare const renderVdom: (hostRef: HostRef, renderFnResults: VNode | VNode[], isInitialLoad?: boolean) => void;
2371
2404
  //#endregion
2372
- export { AttachInternals, AttrDeserialize, BUILD, Build, Component, Element$1 as Element, Env, Event, Fragment, H, H as HTMLElement, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Listen, Method, Mixin, NAMESPACE, Prop, PropSerialize, STENCIL_DEV_MODE, State, Watch, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getShadowRoot, getValue, h, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, render, renderVdom, resolveVar, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setPlatformOptions, setScopedSSR, setTagTransformer, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, supportsShadow, transformTag, win, writeTask };
2405
+ export { AttachInternals, AttrDeserialize, BUILD, Build, Component, Element$1 as Element, Env, Event, Fragment, H, H as HTMLElement, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Listen, Method, Mixin, NAMESPACE, Prop, PropSerialize, STENCIL_DEV_MODE, State, Watch, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getShadowRoot, getValue, h, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, normalizeWatchers, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, render, renderVdom, resolveVar, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setPlatformOptions, setScopedSsr, setTagTransformer, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, supportsShadow, transformTag, win, writeTask };