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

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 (43) hide show
  1. package/dist/{client-Dnio47yQ.mjs → client-Dd-NB5Ei.mjs} +2324 -2125
  2. package/dist/compiler/index.d.mts +5 -5
  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-Dxri2g8Z.mjs → compiler-BmT_yLHU.mjs} +13458 -12695
  7. package/dist/declarations/stencil-public-compiler.d.ts +273 -144
  8. package/dist/declarations/stencil-public-docs.d.ts +10 -0
  9. package/dist/declarations/stencil-public-runtime.d.ts +49 -12
  10. package/dist/{index-D61XZw0f.d.ts → index-BuveMLxy.d.ts} +82 -31
  11. package/dist/{index-D5zaocDq.d.mts → index-CVhWFUM0.d.mts} +249 -204
  12. package/dist/{index-Dat4djoo.d.mts → index-ch-cf-bZ.d.mts} +13 -2
  13. package/dist/index.d.mts +0 -1
  14. package/dist/index.mjs +1 -1
  15. package/dist/jsx-runtime.d.mts +18 -0
  16. package/dist/jsx-runtime.mjs +2 -0
  17. package/dist/{node-pj6rF4Wt.mjs → node-10UamZmn.mjs} +59 -55
  18. package/dist/{regular-expression-D0_N0PGa.mjs → regular-expression-CFVJOTUh.mjs} +83 -8
  19. package/dist/runtime/app-data/index.d.ts +1 -1
  20. package/dist/runtime/app-data/index.js +15 -9
  21. package/dist/{runtime-CKyUrF4i.js → runtime/client/lazy.js} +2539 -2199
  22. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +49 -40
  23. package/dist/runtime/client/{index.js → runtime.js} +2401 -2185
  24. package/dist/runtime/index.d.ts +20 -3
  25. package/dist/runtime/index.js +4956 -2
  26. package/dist/runtime/server/index.d.mts +30 -39
  27. package/dist/runtime/server/index.mjs +2369 -2185
  28. package/dist/runtime/server/runner.d.mts +4 -6
  29. package/dist/runtime/server/runner.mjs +307 -361
  30. package/dist/signals/index.d.ts +47 -0
  31. package/dist/signals/index.js +199 -0
  32. package/dist/sys/node/index.d.mts +1 -1
  33. package/dist/sys/node/index.mjs +1 -1
  34. package/dist/sys/node/worker.mjs +2 -2
  35. package/dist/testing/index.d.mts +97 -3
  36. package/dist/testing/index.mjs +199 -50
  37. package/dist/{validation-BA8nzXu_.mjs → validation-ByxKj8bC.mjs} +21 -32
  38. package/package.json +41 -27
  39. package/dist/index-D-XN9HW_.d.ts +0 -30
  40. package/dist/jsx-runtime-B3vQbWIW.d.ts +0 -28
  41. package/dist/jsx-runtime.d.ts +0 -2
  42. package/dist/jsx-runtime.js +0 -2
  43. /package/dist/{chunk-CjcI7cDX.mjs → chunk-z9aeyW2b.mjs} +0 -0
@@ -1,4 +1,5 @@
1
1
  import { ListenTargetOptions, ResolutionHandler } from "./stencil-public-runtime.js";
2
+ import { InputOptions, SourceMap as RolldownSourceMap } from "rolldown";
2
3
  //#region src/utils/result.d.ts
3
4
  /**
4
5
  * A Result wraps up a success state and a failure state, allowing you to
@@ -670,6 +671,103 @@ interface PrintLine {
670
671
  errorCharStart: number;
671
672
  errorLength?: number;
672
673
  }
674
+ interface BuildFeatures {
675
+ style: boolean;
676
+ mode: boolean;
677
+ formAssociated: boolean;
678
+ shadowDom: boolean;
679
+ shadowDelegatesFocus: boolean;
680
+ shadowModeClosed: boolean;
681
+ shadowSlotAssignmentManual: boolean;
682
+ scoped: boolean;
683
+ /**
684
+ * Every component has a render function
685
+ */
686
+ allRenderFn: boolean;
687
+ /**
688
+ * At least one component has a render function
689
+ */
690
+ hasRenderFn: boolean;
691
+ vdomRender: boolean;
692
+ vdomAttribute: boolean;
693
+ vdomClass: boolean;
694
+ vdomFunctional: boolean;
695
+ vdomKey: boolean;
696
+ vdomListener: boolean;
697
+ vdomPropOrAttr: boolean;
698
+ vdomRef: boolean;
699
+ vdomStyle: boolean;
700
+ vdomText: boolean;
701
+ vdomXlink: boolean;
702
+ vdomSignals: boolean;
703
+ slotRelocation: boolean;
704
+ patchAll: boolean;
705
+ patchChildren: boolean;
706
+ patchClone: boolean;
707
+ patchInsert: boolean;
708
+ slot: boolean;
709
+ svg: boolean;
710
+ element: boolean;
711
+ event: boolean;
712
+ hostListener: boolean;
713
+ hostListenerTargetWindow: boolean;
714
+ hostListenerTargetDocument: boolean;
715
+ hostListenerTargetBody: boolean;
716
+ hostListenerTarget: boolean;
717
+ method: boolean;
718
+ prop: boolean;
719
+ propChangeCallback: boolean;
720
+ propMutable: boolean;
721
+ state: boolean;
722
+ member: boolean;
723
+ updatable: boolean;
724
+ propBoolean: boolean;
725
+ propNumber: boolean;
726
+ propString: boolean;
727
+ serializer: boolean;
728
+ deserializer: boolean;
729
+ lifecycle: boolean;
730
+ asyncLoading: boolean;
731
+ observeAttribute: boolean;
732
+ reflect: boolean;
733
+ taskQueue: boolean;
734
+ }
735
+ interface BuildConditionals extends Partial<BuildFeatures> {
736
+ hotModuleReplacement?: boolean;
737
+ isDebug?: boolean;
738
+ isTesting?: boolean;
739
+ isDev?: boolean;
740
+ devTools?: boolean;
741
+ invisiblePrehydration?: boolean;
742
+ hydrateServerSide?: boolean;
743
+ hydrateClientSide?: boolean;
744
+ lifecycleDOMEvents?: boolean;
745
+ cssAnnotations?: boolean;
746
+ lazyLoad?: boolean;
747
+ profile?: boolean;
748
+ constructableCSS?: boolean;
749
+ /** True when `compat.lightDomPatches === true` - enables `applyLightDomPatches` shortcut. */
750
+ lightDomPatches?: boolean;
751
+ /** Patch `childNodes`/`children` getters on light-dom slotted components. */
752
+ slotChildNodes?: boolean;
753
+ /** Patch `cloneNode()` on light-dom slotted components. */
754
+ slotCloneNode?: boolean;
755
+ /** Patch `appendChild`/`insertBefore`/`removeChild` on light-dom slotted components. */
756
+ slotDomMutations?: boolean;
757
+ /** Patch `textContent` on light-dom slotted components. */
758
+ slotTextContent?: boolean;
759
+ hydratedAttribute?: boolean;
760
+ hydratedClass?: boolean;
761
+ hydratedSelectorName?: string;
762
+ /** True when a global-style input contains `@import "stencil-hydrate"` - suppresses dynamic style injection in the loader. */
763
+ staticHydrationStyles?: boolean;
764
+ initializeNextTick?: boolean;
765
+ asyncQueue?: boolean;
766
+ additionalTagTransformers?: boolean | 'prod';
767
+ signalBacking?: boolean;
768
+ /** True when JSX signal bypass is active - text nodes and attributes backed by Signal objects update the DOM directly. Auto-enabled when `signalBacking: true`. */
769
+ vdomSignals?: boolean;
770
+ }
673
771
  type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
674
772
  interface RolldownResultModule {
675
773
  id: string;
@@ -718,12 +816,14 @@ interface BuildCtx {
718
816
  ssrAppFilePath: string;
719
817
  indexBuildCount: number;
720
818
  indexDoc: Document;
819
+ /** All non-entry HTML files found in srcDir, keyed by path relative to srcDir */
820
+ htmlDocs: Map<string, Document>;
721
821
  isRebuild: boolean;
722
822
  /**
723
823
  * A collection of Stencil's intermediate representation of components, tied to the current build
724
824
  */
725
825
  moduleFiles: Module[];
726
- packageJson: PackageJsonData;
826
+ packageJson: PackageJsonData | null;
727
827
  pendingCopyTasks: Promise<CopyResults>[];
728
828
  progress(task: BuildTask): void;
729
829
  requiresFullBuild: boolean;
@@ -767,8 +867,6 @@ interface CompilerBuildStats {
767
867
  options: {
768
868
  minifyJs: boolean;
769
869
  minifyCss: boolean;
770
- hashFileNames: boolean;
771
- hashedFileNameLength: number;
772
870
  };
773
871
  formats: {
774
872
  esmBrowser: ReadonlyArray<CompilerBuildStatBundle>;
@@ -817,16 +915,6 @@ interface RolldownChunkResult {
817
915
  moduleFormat: ModuleFormat;
818
916
  map?: RolldownSourceMap;
819
917
  }
820
- interface RolldownSourceMap {
821
- file: string;
822
- mappings: string;
823
- names: string[];
824
- sources: string[];
825
- sourcesContent: string[];
826
- version: number;
827
- toString(): string;
828
- toUrl(): string;
829
- }
830
918
  interface BundleModule {
831
919
  entryKey: string;
832
920
  rolldownResult: RolldownChunkResult;
@@ -862,6 +950,7 @@ interface CollectionCompilerMeta {
862
950
  bundles?: {
863
951
  components: string[];
864
952
  }[];
953
+ buildFlags?: Partial<BuildConditionals>;
865
954
  }
866
955
  interface CollectionCompilerVersion {
867
956
  name: string;
@@ -1008,6 +1097,7 @@ interface ComponentCompilerFeatures {
1008
1097
  hasVdomStyle: boolean;
1009
1098
  hasVdomText: boolean;
1010
1099
  hasVdomXlink: boolean;
1100
+ hasSignalsImport: boolean;
1011
1101
  hasWatchCallback: boolean;
1012
1102
  htmlAttrNames: string[];
1013
1103
  htmlTagNames: string[];
@@ -1105,6 +1195,7 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
1105
1195
  states: ComponentCompilerState[];
1106
1196
  styleDocs: CompilerStyleDoc[];
1107
1197
  styles: StyleCompiler[];
1198
+ globalStyles: ComponentGlobalStyle[];
1108
1199
  tagName: string;
1109
1200
  virtualProperties: ComponentCompilerVirtualProperty[];
1110
1201
  watchers: ComponentCompilerChangeHandler[];
@@ -1121,7 +1212,7 @@ type Encapsulation = 'shadow' | 'scoped' | 'none';
1121
1212
  * These enable proper slot behavior when not using native Shadow DOM.
1122
1213
  */
1123
1214
  interface ComponentPatches {
1124
- /** Apply all slot patches (equivalent to experimentalSlotFixes) */
1215
+ /** Apply all slot patches (equivalent to lightDomPatches) */
1125
1216
  all?: boolean;
1126
1217
  /** Patch child node accessors (children, firstChild, lastChild, etc.) */
1127
1218
  children?: boolean;
@@ -1181,6 +1272,11 @@ interface ComponentCompilerPropertyComplexType {
1181
1272
  * annotation in the original source file.
1182
1273
  */
1183
1274
  references: ComponentCompilerTypeReferences;
1275
+ /**
1276
+ * @internal TypeScript AST node used for semantic type analysis during compilation.
1277
+ * Not serialized, only used internally for improved type renaming logic.
1278
+ */
1279
+ _astNode?: any;
1184
1280
  }
1185
1281
  /**
1186
1282
  * A record of `ComponentCompilerTypeReference` entities.
@@ -1274,6 +1370,11 @@ interface ComponentCompilerMethodComplexType {
1274
1370
  parameters: JsonDocMethodParameter[];
1275
1371
  references: ComponentCompilerTypeReferences;
1276
1372
  return: string;
1373
+ /**
1374
+ * @internal TypeScript AST method node used for semantic type analysis during compilation.
1375
+ * Not serialized, only used internally for improved type renaming logic.
1376
+ */
1377
+ _astNode?: any;
1277
1378
  }
1278
1379
  interface ComponentCompilerChangeHandler {
1279
1380
  propName: string;
@@ -1438,6 +1539,7 @@ interface Module {
1438
1539
  hasVdomStyle: boolean;
1439
1540
  hasVdomText: boolean;
1440
1541
  hasVdomXlink: boolean;
1542
+ hasSignalsImport: boolean;
1441
1543
  }
1442
1544
  interface PrerenderUrlResults {
1443
1545
  anchorUrls: string[];
@@ -1470,6 +1572,12 @@ interface ExternalStyleCompiler {
1470
1572
  relativePath: string;
1471
1573
  originalComponentPath: string;
1472
1574
  }
1575
+ interface ComponentGlobalStyle {
1576
+ /** Absolute path to the CSS file, or null for inline styles */
1577
+ absolutePath: string | null;
1578
+ /** Raw inline CSS string, or null for file-based styles */
1579
+ styleStr: string | null;
1580
+ }
1473
1581
  /**
1474
1582
  * Input CSS to be transformed into ESM
1475
1583
  */
@@ -1534,9 +1642,7 @@ interface PackageJsonData {
1534
1642
  module?: string;
1535
1643
  'jsnext:main'?: string;
1536
1644
  unpkg?: string;
1537
- /** @deprecated Use `stencilRebundle` instead. Kept for reading v4 dependencies. */
1538
1645
  collection?: string;
1539
- stencilRebundle?: string;
1540
1646
  types?: string;
1541
1647
  files?: string[];
1542
1648
  ['dist-tags']?: {
@@ -1661,20 +1767,6 @@ interface StencilConfig {
1661
1767
  * @default false
1662
1768
  */
1663
1769
  generateExportMaps?: boolean;
1664
- /**
1665
- * When the hashFileNames config is set to true, and it is a production build,
1666
- * the hashedFileNameLength config is used to determine how many characters the file name's hash should be.
1667
- */
1668
- hashedFileNameLength?: number;
1669
- /**
1670
- * During production builds, the content of each generated file is hashed to represent the content,
1671
- * and the hashed value is used as the filename. If the content isn't updated between builds,
1672
- * then it receives the same filename. When the content is updated, then the filename is different.
1673
- *
1674
- * By doing this, deployed apps can "forever-cache" the build directory and take full advantage of
1675
- * content delivery networks (CDNs) and heavily caching files for faster apps.
1676
- */
1677
- hashFileNames?: boolean;
1678
1770
  /**
1679
1771
  * The namespace config is a string representing a namespace for the app.
1680
1772
  * For apps that are not meant to be a library of reusable components,
@@ -1745,11 +1837,17 @@ interface StencilConfig {
1745
1837
  */
1746
1838
  logger?: Logger;
1747
1839
  /**
1748
- * Config to add extra runtime for DOM features that require more polyfills. Note
1749
- * that not all DOM APIs are fully polyfilled when using the slot polyfill. These
1750
- * are opt-in since not all users will require the additional runtime.
1840
+ * Compatibility and workaround flags for framework integration and bundler edge cases.
1841
+ */
1842
+ compat?: ConfigCompat;
1843
+ /**
1844
+ * Replace `@State` and `@Prop` internals with `@preact/signals-core` signal primitives.
1845
+ * Enables cross-framework reactive interop - component state becomes subscribable by
1846
+ * Solid, Angular, Preact and any TC39-signal-compatible library without event/attribute
1847
+ * roundtrips. No API changes required in component code.
1848
+ * Defaults to `false`.
1751
1849
  */
1752
- extras?: ConfigExtras;
1850
+ signalBacking?: boolean;
1753
1851
  /**
1754
1852
  * The hydrated flag identifies if a component and all of its child components
1755
1853
  * have finished hydrating. This helps prevent any flash of unstyled content (FOUC)
@@ -1865,14 +1963,56 @@ interface StencilConfig {
1865
1963
  * Set whether unused dependencies should be excluded from the built output.
1866
1964
  */
1867
1965
  excludeUnusedDependencies?: boolean;
1966
+ /**
1967
+ * Explicitly declare which npm packages are Stencil collections to be re-bundled into this project.
1968
+ *
1969
+ * Without this option, collection ingestion is triggered only by a side-effect import:
1970
+ * ```ts
1971
+ * import '@ionic/core';
1972
+ * ```
1973
+ * @example
1974
+ * ```ts
1975
+ * export const config: Config = {
1976
+ * collections: ['@ionic/core', '@my-org/design-system'],
1977
+ * };
1978
+ * ```
1979
+ *
1980
+ * @default []
1981
+ */
1982
+ collections?: string[];
1868
1983
  stencilCoreResolvedId?: string;
1869
1984
  }
1870
- interface ConfigExtrasBase {
1985
+ /**
1986
+ * DOM patches for light-dom / scoped components that use `<slot>`.
1987
+ *
1988
+ * These patches shield the component's slot machinery from framework DOM mutations
1989
+ * (e.g. when Angular or React insert / remove nodes they route directly to the host
1990
+ * element, bypassing the slot polyfill) and prevent hydration errors when a framework
1991
+ * encounters Stencil's internal slot reference nodes during SSR reconciliation.
1992
+ *
1993
+ * Patches are only applied at runtime when a component is both non-shadow **and**
1994
+ * declares at least one `<slot>`, so enabling them has no effect on pure shadow-DOM
1995
+ * components.
1996
+ *
1997
+ * Set to `true` (default) to enable all patches, `false` to disable all, or an object
1998
+ * for granular control.
1999
+ */
2000
+ type LightDomPatches = {
2001
+ /** Patches `childNodes`/`children` getters to return only slotted content. */childNodes?: boolean; /** Patches `cloneNode()` to correctly deep-clone slotted content. */
2002
+ cloneNode?: boolean; /** Patches `appendChild()`, `insertBefore()`, and `removeChild()` to route to the correct slot. */
2003
+ domMutations?: boolean; /** Patches `textContent` to act like shadow DOM (reads/writes slotted text only). */
2004
+ textContent?: boolean;
2005
+ };
2006
+ /**
2007
+ * Compatibility and workaround flags for framework integration and bundler edge cases.
2008
+ * These are opt-in runtime behaviors that aren't needed by every project.
2009
+ */
2010
+ interface ConfigCompat {
1871
2011
  /**
1872
2012
  * Projects that use a Stencil library built using the `dist` output target may have trouble lazily
1873
2013
  * loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
1874
2014
  * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
1875
- * the size of the compiled output. Defaults to `false`.
2015
+ * the size of the compiled output. Defaults to `true`.
1876
2016
  */
1877
2017
  enableImportInjection?: boolean;
1878
2018
  /**
@@ -1887,53 +2027,16 @@ interface ConfigExtrasBase {
1887
2027
  */
1888
2028
  initializeNextTick?: boolean;
1889
2029
  /**
1890
- * Adds `transformTag` calls to css strings and querySelector(All) calls
2030
+ * Adds `transformTag` calls to css strings and querySelector(All) calls.
2031
+ * Use `'prod'` to enable only in production builds.
1891
2032
  */
1892
2033
  additionalTagTransformers?: boolean | 'prod';
1893
2034
  /**
1894
- * Experimental flag.
1895
- * Updates the behavior of scoped components to align more closely with the behavior of the native
1896
- * Shadow DOM when using `slot`s.
1897
- * Defaults to `false`.
2035
+ * DOM patches for light-dom / scoped components that use `<slot>`.
2036
+ * See {@link LightDomPatches} for granular control. Defaults to `true`.
1898
2037
  */
1899
- experimentalScopedSlotChanges?: boolean;
2038
+ lightDomPatches?: boolean | LightDomPatches;
1900
2039
  }
1901
- type ConfigExtrasSlotFixes<ExperimentalFixesEnabled extends boolean, IndividualFlags extends boolean> = {
1902
- /**
1903
- * By default, the slot polyfill does not update `appendChild()` so that it appends
1904
- * new child nodes into the correct child slot like how shadow dom works. This is an opt-in
1905
- * polyfill for those who need it when using `element.appendChild(node)` and expecting the
1906
- * child to be appended in the same location shadow dom would. This is not required for
1907
- * IE11 or Edge 18, but can be enabled if the app is using `appendChild()`. Defaults to `false`.
1908
- */
1909
- appendChildSlotFix?: IndividualFlags;
1910
- /**
1911
- * By default, the runtime does not polyfill `cloneNode()` when cloning a component
1912
- * that uses the slot polyfill. This is an opt-in polyfill for those who need it.
1913
- * This is not required for IE11 or Edge 18, but can be enabled if the app is using
1914
- * `cloneNode()` and unexpected node are being cloned due to the slot polyfill
1915
- * simulating shadow dom. Defaults to `false`.
1916
- */
1917
- cloneNodeFix?: IndividualFlags;
1918
- /**
1919
- * Experimental flag to align the behavior of invoking `textContent` on a scoped component to act more like a
1920
- * component that uses the shadow DOM. Defaults to `false`
1921
- */
1922
- scopedSlotTextContentFix?: IndividualFlags;
1923
- /**
1924
- * For browsers that do not support shadow dom (IE11 and Edge 18 and below), slot is polyfilled
1925
- * to simulate the same behavior. However, the host element's `childNodes` and `children`
1926
- * getters are not patched to only show the child nodes and elements of the default slot.
1927
- * Defaults to `false`.
1928
- */
1929
- slotChildNodesFix?: IndividualFlags;
1930
- /**
1931
- * Enables all slot-related fixes such as {@link slotChildNodesFix}, and
1932
- * {@link scopedSlotTextContentFix}.
1933
- */
1934
- experimentalSlotFixes?: ExperimentalFixesEnabled;
1935
- };
1936
- type ConfigExtras = ConfigExtrasBase & (ConfigExtrasSlotFixes<true, true> | ConfigExtrasSlotFixes<false, boolean>);
1937
2040
  interface Config extends StencilConfig {
1938
2041
  buildAppCore?: boolean;
1939
2042
  configPath?: string;
@@ -2036,7 +2139,7 @@ type RequireFields<T, K extends keyof T> = T & { [P in K]-?: T[P] };
2036
2139
  /**
2037
2140
  * Fields in {@link Config} to make required for {@link ValidatedConfig}
2038
2141
  */
2039
- type StrictConfigFields = keyof Pick<Config, 'cacheDir' | 'devServer' | 'extras' | 'fsNamespace' | 'hashFileNames' | 'hashedFileNameLength' | 'hydratedFlag' | 'logLevel' | 'logger' | 'minifyCss' | 'minifyJs' | 'namespace' | 'outputTargets' | 'packageJsonFilePath' | 'rolldownConfig' | 'rootDir' | 'srcDir' | 'srcIndexHtml' | 'sys' | 'transformAliasedImportPaths'>;
2142
+ type StrictConfigFields = keyof Pick<Config, 'cacheDir' | 'devServer' | 'compat' | 'fsNamespace' | 'hydratedFlag' | 'logLevel' | 'logger' | 'minifyCss' | 'minifyJs' | 'namespace' | 'outputTargets' | 'packageJsonFilePath' | 'rolldownConfig' | 'rootDir' | 'srcDir' | 'srcIndexHtml' | 'sys' | 'transformAliasedImportPaths'>;
2040
2143
  /**
2041
2144
  * A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
2042
2145
  * When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
@@ -2867,18 +2970,18 @@ interface ResolveModuleIdResults {
2867
2970
  * A controller which provides for communication and coordination between
2868
2971
  * threaded workers.
2869
2972
  */
2870
- interface WorkerMainController {
2973
+ interface WorkerMainController<T extends Record<string, (...args: any[]) => Promise<any>> = Record<string, (...args: any[]) => Promise<any>>> {
2871
2974
  /**
2872
2975
  * Send a given set of arguments to a worker
2873
2976
  */
2874
- send(...args: any[]): Promise<any>;
2977
+ send<K extends keyof T>(methodName: K, ...args: Parameters<T[K]>): ReturnType<T[K]>;
2875
2978
  /**
2876
2979
  * Handle a particular method
2877
2980
  *
2878
2981
  * @param name of the method to be passed to a worker
2879
2982
  * @returns a Promise wrapping the results
2880
2983
  */
2881
- handler(name: string): (...args: any[]) => Promise<any>;
2984
+ handler<K extends keyof T>(name: K): T[K];
2882
2985
  /**
2883
2986
  * Destroy the worker represented by this instance, rejecting all outstanding
2884
2987
  * tasks and killing the child process.
@@ -2945,6 +3048,7 @@ interface BuildNoChangeResults {
2945
3048
  interface CompilerBuildResults {
2946
3049
  buildId: number;
2947
3050
  componentGraph?: BuildResultsComponentGraph;
3051
+ components: ComponentCompilerMeta[];
2948
3052
  diagnostics: Diagnostic[];
2949
3053
  dirsAdded: string[];
2950
3054
  dirsDeleted: string[];
@@ -2959,6 +3063,7 @@ interface CompilerBuildResults {
2959
3063
  ssrAppFilePath?: string;
2960
3064
  isRebuild: boolean;
2961
3065
  namespace: string;
3066
+ fsNamespace: string;
2962
3067
  outputs: BuildOutput[];
2963
3068
  rootDir: string;
2964
3069
  srcDir: string;
@@ -3141,8 +3246,9 @@ interface CopyTask {
3141
3246
  */
3142
3247
  dest?: string;
3143
3248
  /**
3144
- * An optional array of glob patterns to exclude from the copy operation.
3145
- * @default ['**\/__mocks__/**', '**\/__fixtures__/**', '**\/dist/**', '**\/.{idea,git,cache,output,temp}/**', '**\/.ds_store', '**\/.gitignore', '**\/desktop.ini', '**\/thumbs.db']
3249
+ * Additional glob patterns to exclude from the copy operation, merged with
3250
+ * the built-in defaults: `__mocks__`, `__fixtures__`, `dist`, hidden dirs,
3251
+ * `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`.
3146
3252
  */
3147
3253
  ignore?: string[];
3148
3254
  /**
@@ -3221,39 +3327,12 @@ interface StencilDocsConfig {
3221
3327
  };
3222
3328
  };
3223
3329
  }
3224
- interface NodeResolveConfig {
3225
- exportConditions?: string[];
3226
- browser?: boolean;
3227
- moduleDirectories?: string[];
3228
- modulePaths?: string[];
3229
- dedupe?: string[] | ((importee: string) => boolean);
3230
- extensions?: readonly string[];
3231
- jail?: string;
3232
- mainFields?: readonly string[];
3233
- modulesOnly?: boolean;
3234
- preferBuiltins?: boolean | ((module: string) => boolean);
3235
- resolveOnly?: ReadonlyArray<string | RegExp> | null | ((module: string) => boolean);
3236
- rootDir?: string;
3237
- allowExportsFolderMapping?: boolean;
3238
- }
3330
+ /** Options for rolldown's built-in module resolver, passed directly to rolldown's `resolve` input option. */
3331
+ type NodeResolveConfig = NonNullable<InputOptions['resolve']>;
3239
3332
  interface RolldownConfig {
3240
- inputOptions?: RolldownInputOptions;
3241
- outputOptions?: RolldownOutputOptions;
3242
- }
3243
- interface RolldownInputOptions {
3244
- context?: string;
3245
- moduleContext?: ((id: string) => string) | {
3246
- [id: string]: string;
3247
- };
3248
3333
  treeshake?: boolean;
3249
- maxParallelFileOps?: number;
3250
3334
  external?: (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | undefined);
3251
3335
  }
3252
- interface RolldownOutputOptions {
3253
- globals?: {
3254
- [name: string]: string;
3255
- } | ((name: string) => string);
3256
- }
3257
3336
  /**
3258
3337
  * This sets the log level hierarchy for our terminal logger, ranging from
3259
3338
  * most to least verbose.
@@ -3359,6 +3438,28 @@ interface OutputTargetLoaderBundle extends OutputTargetBaseNext {
3359
3438
  * @default 'loader' (relative to output directory)
3360
3439
  */
3361
3440
  loaderPath?: string;
3441
+ /**
3442
+ * Hash the filenames of generated chunks based on their content.
3443
+ * Enables forever-caching of CDN-served bundles.
3444
+ *
3445
+ * @default true in production, false in dev mode
3446
+ */
3447
+ hashFileNames?: boolean;
3448
+ /**
3449
+ * Number of characters to use for the content hash in filenames.
3450
+ *
3451
+ * @default 8
3452
+ */
3453
+ hashedFileNameLength?: number;
3454
+ /**
3455
+ * When `true`, marks `@stencil/core` as an external dependency in the bundler (ESM/CJS)
3456
+ * distribution output. Consumers must provide `@stencil/core` themselves.
3457
+ *
3458
+ * Has no effect on the browser/CDN build - the runtime is always bundled there.
3459
+ *
3460
+ * @default false
3461
+ */
3462
+ externalRuntime?: boolean;
3362
3463
  }
3363
3464
  /**
3364
3465
  * Output target for generating Stencil component source for downstream re-bundling.
@@ -3372,14 +3473,14 @@ interface OutputTargetLoaderBundle extends OutputTargetBaseNext {
3372
3473
  * @example
3373
3474
  * ```typescript
3374
3475
  * {
3375
- * type: 'stencil-rebundle',
3376
- * dir: 'dist/stencil-rebundle',
3476
+ * type: 'collection',
3477
+ * dir: 'dist/collection',
3377
3478
  * transformAliasedImportPaths: true
3378
3479
  * }
3379
3480
  * ```
3380
3481
  */
3381
- interface OutputTargetStencilRebundle extends OutputTargetBaseNext {
3382
- type: 'stencil-rebundle';
3482
+ interface OutputTargetCollection extends OutputTargetBaseNext {
3483
+ type: 'collection';
3383
3484
  empty?: boolean;
3384
3485
  /**
3385
3486
  * When `true` this flag will transform aliased import paths defined in
@@ -3433,6 +3534,12 @@ interface OutputTargetDistLazy extends OutputTargetBase {
3433
3534
  loaderDir?: string;
3434
3535
  typesDir?: string;
3435
3536
  empty?: boolean;
3537
+ /** Inherited from parent output target (loader-bundle or www). Only meaningful for browser builds. */
3538
+ hashFileNames?: boolean;
3539
+ /** Inherited from parent output target (loader-bundle or www). */
3540
+ hashedFileNameLength?: number;
3541
+ /** Inherited from loader-bundle. When true, @stencil/core is external in this bundler output. */
3542
+ externalRuntime?: boolean;
3436
3543
  }
3437
3544
  /**
3438
3545
  * Output target for global styles.
@@ -3543,6 +3650,13 @@ interface OutputTargetSsr extends OutputTargetBase {
3543
3650
  */
3544
3651
  cjs?: boolean;
3545
3652
  }
3653
+ interface OutputTargetSsrWasm extends OutputTargetBase {
3654
+ type: 'ssr-wasm';
3655
+ /** Output directory. @default 'dist/ssr-wasm' */
3656
+ dir?: string;
3657
+ empty?: boolean;
3658
+ minify?: boolean;
3659
+ }
3546
3660
  interface OutputTargetCustom extends OutputTargetBase {
3547
3661
  type: 'custom';
3548
3662
  name: string;
@@ -3696,7 +3810,7 @@ interface OutputTargetStandalone extends OutputTargetBaseNext {
3696
3810
  * 2. File names are not hashed.
3697
3811
  * 3. File minification will follow the behavior defined at the root of the Stencil config.
3698
3812
  *
3699
- * @default true
3813
+ * @default false
3700
3814
  */
3701
3815
  externalRuntime?: boolean;
3702
3816
  copy?: CopyTask[];
@@ -3767,7 +3881,7 @@ interface OutputTargetBase {
3767
3881
  */
3768
3882
  skipInDev?: boolean;
3769
3883
  }
3770
- type OutputTargetBuild = OutputTargetStencilRebundle | OutputTargetDistLazy;
3884
+ type OutputTargetBuild = OutputTargetCollection | OutputTargetDistLazy;
3771
3885
  interface OutputTargetCopy extends OutputTargetBase {
3772
3886
  type: 'copy';
3773
3887
  dir: string;
@@ -3846,15 +3960,35 @@ interface OutputTargetWww extends OutputTargetBase {
3846
3960
  */
3847
3961
  prerenderConfig?: string;
3848
3962
  /**
3849
- * Service worker config for production builds. During development builds
3850
- * service worker script will be injected to automatically deregister existing
3851
- * service workers. When set to `false` neither a service worker registration
3852
- * or deregistration will be added to the index.html.
3963
+ * Service worker config for production builds. In development mode, a script
3964
+ * to deregister existing service workers is always injected. Defaults to
3965
+ * `null` (disabled). Set to `true` to enable with default settings, or provide
3966
+ * a config object for custom settings.
3853
3967
  */
3854
- serviceWorker?: ServiceWorkerConfig | null | false;
3968
+ serviceWorker?: ServiceWorkerConfig | true | null;
3855
3969
  appDir?: string;
3970
+ /**
3971
+ * Hash the filenames of generated chunks based on their content.
3972
+ * Enables forever-caching of CDN-served bundles.
3973
+ *
3974
+ * @default true in production, false in dev mode
3975
+ */
3976
+ hashFileNames?: boolean;
3977
+ /**
3978
+ * Number of characters to use for the content hash in filenames.
3979
+ *
3980
+ * @default 8
3981
+ */
3982
+ hashedFileNameLength?: number;
3856
3983
  }
3857
- type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetLoaderBundle | OutputTargetStandalone | OutputTargetSsr | OutputTargetStencilRebundle | OutputTargetTypes | OutputTargetGlobalStyle | OutputTargetAssets | OutputTargetDistLazy | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustomElementsManifest | OutputTargetWww | OutputTargetStats;
3984
+ type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetLoaderBundle | OutputTargetStandalone | OutputTargetSsr | OutputTargetSsrWasm | OutputTargetCollection | OutputTargetTypes | OutputTargetGlobalStyle | OutputTargetAssets | OutputTargetDistLazy | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustomElementsManifest | OutputTargetWww | OutputTargetStats;
3985
+ /**
3986
+ * A post-validation form of {@link OutputTargetWww} where `serviceWorker`
3987
+ * has been normalized - `true` is resolved to a {@link ServiceWorkerConfig}.
3988
+ */
3989
+ type ValidatedOutputTargetWww = Omit<OutputTargetWww, 'serviceWorker'> & {
3990
+ serviceWorker?: ServiceWorkerConfig | null;
3991
+ };
3858
3992
  /**
3859
3993
  * Our custom configuration interface for generated caching Service Workers
3860
3994
  * using the Workbox library (see https://developer.chrome.com/docs/workbox/).
@@ -3902,12 +4036,6 @@ interface LoadConfigInit {
3902
4036
  configPath?: string;
3903
4037
  logger?: Logger;
3904
4038
  sys?: CompilerSystem;
3905
- /**
3906
- * When set to true, if the "tsconfig.json" file is not found
3907
- * it'll automatically generate and save a default tsconfig
3908
- * within the root directory.
3909
- */
3910
- initTsConfig?: boolean;
3911
4039
  }
3912
4040
  /**
3913
4041
  * Results from an attempt to load a config. The values on this interface
@@ -3949,17 +4077,6 @@ interface WorkerOptions {
3949
4077
  maxConcurrentTasksPerWorker?: number;
3950
4078
  logger?: Logger;
3951
4079
  }
3952
- interface RolldownInterface {
3953
- rolldown: {
3954
- (config: any): Promise<any>;
3955
- };
3956
- plugins: {
3957
- nodeResolve(opts: any): any;
3958
- replace(opts: any): any;
3959
- commonjs(opts: any): any;
3960
- json(): any;
3961
- };
3962
- }
3963
4080
  interface ResolveModuleOptions {
3964
4081
  manuallyResolve?: boolean;
3965
4082
  packageJson?: boolean;
@@ -4041,6 +4158,18 @@ interface Compiler {
4041
4158
  createWatcher(): Promise<CompilerWatcher>;
4042
4159
  destroy(): Promise<void>;
4043
4160
  sys: CompilerSystem;
4161
+ /**
4162
+ * @internal - Testing only. Access to the in-memory filesystem
4163
+ */
4164
+ fs?: InMemoryFileSystem;
4165
+ /**
4166
+ * @internal - Testing only. Access to the validated configuration
4167
+ */
4168
+ config?: ValidatedConfig;
4169
+ /**
4170
+ * @internal - Testing only. Access to the compiler context
4171
+ */
4172
+ compilerCtx?: CompilerCtx;
4044
4173
  }
4045
4174
  interface CompilerWatcher extends BuildOnEvents {
4046
4175
  start: () => Promise<WatcherCloseResults>;
@@ -4081,7 +4210,7 @@ interface TranspileOptions {
4081
4210
  componentMetadata?: 'runtimestatic' | 'compilerstatic' | string | undefined;
4082
4211
  /**
4083
4212
  * The actual internal import path for any `@stencil/core` imports.
4084
- * Default is `@stencil/core/runtime/client`.
4213
+ * Default is `@stencil/core/runtime/client/standalone`.
4085
4214
  */
4086
4215
  coreImportPath?: string;
4087
4216
  /**
@@ -4238,4 +4367,4 @@ interface CliInitOptions {
4238
4367
  sys: CompilerSystem;
4239
4368
  }
4240
4369
  //#endregion
4241
- export { AutoprefixerOptions, BuildEmitEvents, BuildEvents, BuildLog, BuildNoChangeResults, BuildOnEventRemove, BuildOnEvents, BuildOutput, BuildResultsComponentGraph, CacheStorage, CliInitOptions, CompileScriptMinifyOptions, CompileTarget, Compiler, CompilerBuildResults, CompilerBuildStart, CompilerDependency, CompilerEventBuildFinish, CompilerEventBuildLog, CompilerEventBuildNoChange, CompilerEventBuildStart, CompilerEventDirAdd, CompilerEventDirDelete, CompilerEventFileAdd, CompilerEventFileDelete, CompilerEventFileUpdate, CompilerEventFsChange, CompilerEventName, CompilerFileWatcher, CompilerFileWatcherCallback, CompilerFileWatcherEvent, CompilerFsStats, CompilerRequest, CompilerRequestResponse, CompilerSystem, CompilerSystemCreateDirectoryOptions, CompilerSystemCreateDirectoryResults, CompilerSystemRealpathResults, CompilerSystemRemoveDirectoryOptions, CompilerSystemRemoveDirectoryResults, CompilerSystemRemoveFileResults, CompilerSystemRenameResults, CompilerSystemRenamedPath, CompilerSystemWriteFileResults, CompilerWatcher, Config, ConfigBundle, ConfigExtras, CopyResults, CopyTask, Credentials, CustomElementsExportBehavior, CustomElementsExportBehaviorOptions, DevServer, DevServerConfig, DevServerEditor, Diagnostic, FsWatchResults, HistoryApiFallback, HmrStyleUpdate, HotModuleReplacement, HydrateDocumentOptions, HydrateFactoryOptions, HydratedFlag, JsonDocMethodParameter, JsonDocs, JsonDocsComponent, JsonDocsCustomState, JsonDocsDependencyGraph, JsonDocsEvent, JsonDocsListener, JsonDocsMethod, JsonDocsMethodReturn, JsonDocsPart, JsonDocsProp, JsonDocsSlot, JsonDocsStyle, JsonDocsTag, JsonDocsTypeLibrary, JsonDocsUsage, JsonDocsValue, LOG_LEVELS, LazyRequire, LoadConfigInit, LoadConfigResults, LogLevel, Logger, LoggerLineUpdater, LoggerTimeSpan, NodeResolveConfig, OptimizeCssInput, OptimizeCssOutput, OptimizeJsInput, OptimizeJsOutput, OutputTarget, OutputTargetAssets, OutputTargetBase, OutputTargetBaseNext, OutputTargetBuild, OutputTargetCopy, OutputTargetCustom, OutputTargetDistLazy, OutputTargetDocsCustom, OutputTargetDocsCustomElementsManifest, OutputTargetDocsJson, OutputTargetDocsReadme, OutputTargetDocsVscode, OutputTargetGlobalStyle, OutputTargetLoaderBundle, OutputTargetSsr, OutputTargetStandalone, OutputTargetStats, OutputTargetStencilRebundle, OutputTargetTypes, OutputTargetWww, PageReloadStrategy, ParsedPath, PlatformPath, PrerenderConfig, PrerenderHydrateOptions, PrerenderOptions, PrerenderResults, PrerenderStartOptions, ResolveModuleIdOptions, ResolveModuleIdResults, ResolveModuleOptions, RobotsTxtOpts, RobotsTxtResults, RolldownConfig, RolldownInputOptions, RolldownInterface, RolldownOutputOptions, SerializeDocumentOptions, ServiceWorkerConfig, SitemapXmpOpts, SitemapXmpResults, SsrDocumentOptions, SsrFactoryOptions, StencilConfig, StencilDevServerConfig, StencilDocsConfig, StyleDoc, SystemDetails, TransformOptions, TranspileOnlyResults, TranspileOptions, TranspileResults, UnvalidatedConfig, ValidatedConfig, WatcherCloseResults, WorkerMainController, WorkerOptions };
4370
+ export { AutoprefixerOptions, BuildEmitEvents, BuildEvents, BuildLog, BuildNoChangeResults, BuildOnEventRemove, BuildOnEvents, BuildOutput, BuildResultsComponentGraph, CacheStorage, CliInitOptions, CompileScriptMinifyOptions, CompileTarget, Compiler, CompilerBuildResults, CompilerBuildStart, CompilerDependency, CompilerEventBuildFinish, CompilerEventBuildLog, CompilerEventBuildNoChange, CompilerEventBuildStart, CompilerEventDirAdd, CompilerEventDirDelete, CompilerEventFileAdd, CompilerEventFileDelete, CompilerEventFileUpdate, CompilerEventFsChange, CompilerEventName, CompilerFileWatcher, CompilerFileWatcherCallback, CompilerFileWatcherEvent, CompilerFsStats, CompilerRequest, CompilerRequestResponse, CompilerSystem, CompilerSystemCreateDirectoryOptions, CompilerSystemCreateDirectoryResults, CompilerSystemRealpathResults, CompilerSystemRemoveDirectoryOptions, CompilerSystemRemoveDirectoryResults, CompilerSystemRemoveFileResults, CompilerSystemRenameResults, CompilerSystemRenamedPath, CompilerSystemWriteFileResults, CompilerWatcher, Config, ConfigBundle, ConfigCompat, CopyResults, CopyTask, Credentials, CustomElementsExportBehavior, CustomElementsExportBehaviorOptions, DevServer, DevServerConfig, DevServerEditor, Diagnostic, FsWatchResults, HistoryApiFallback, HmrStyleUpdate, HotModuleReplacement, HydrateDocumentOptions, HydrateFactoryOptions, HydratedFlag, JsonDocMethodParameter, JsonDocs, JsonDocsComponent, JsonDocsCustomState, JsonDocsDependencyGraph, JsonDocsEvent, JsonDocsListener, JsonDocsMethod, JsonDocsMethodReturn, JsonDocsPart, JsonDocsProp, JsonDocsSlot, JsonDocsStyle, JsonDocsTag, JsonDocsTypeLibrary, JsonDocsUsage, JsonDocsValue, LOG_LEVELS, LazyRequire, LightDomPatches, LoadConfigInit, LoadConfigResults, LogLevel, Logger, LoggerLineUpdater, LoggerTimeSpan, NodeResolveConfig, OptimizeCssInput, OptimizeCssOutput, OptimizeJsInput, OptimizeJsOutput, OutputTarget, OutputTargetAssets, OutputTargetBase, OutputTargetBaseNext, OutputTargetBuild, OutputTargetCollection, OutputTargetCopy, OutputTargetCustom, OutputTargetDistLazy, OutputTargetDocsCustom, OutputTargetDocsCustomElementsManifest, OutputTargetDocsJson, OutputTargetDocsReadme, OutputTargetDocsVscode, OutputTargetGlobalStyle, OutputTargetLoaderBundle, OutputTargetSsr, OutputTargetSsrWasm, OutputTargetStandalone, OutputTargetStats, OutputTargetTypes, OutputTargetWww, PageReloadStrategy, ParsedPath, PlatformPath, PrerenderConfig, PrerenderHydrateOptions, PrerenderOptions, PrerenderResults, PrerenderStartOptions, ResolveModuleIdOptions, ResolveModuleIdResults, ResolveModuleOptions, RobotsTxtOpts, RobotsTxtResults, RolldownConfig, SerializeDocumentOptions, ServiceWorkerConfig, SitemapXmpOpts, SitemapXmpResults, SsrDocumentOptions, SsrFactoryOptions, StencilConfig, StencilDevServerConfig, StencilDocsConfig, StyleDoc, SystemDetails, TransformOptions, TranspileOnlyResults, TranspileOptions, TranspileResults, UnvalidatedConfig, ValidatedConfig, ValidatedOutputTargetWww, WatcherCloseResults, WorkerMainController, WorkerOptions };