@stencil/core 5.0.0-alpha.8 → 5.0.0-beta.0

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 (50) hide show
  1. package/README.md +94 -0
  2. package/dist/app-data/index.d.ts +2 -0
  3. package/dist/{runtime/app-data → app-data}/index.js +5 -2
  4. package/dist/client-BRu0GtRn.mjs +2368 -0
  5. package/dist/compiler/index.d.mts +167 -3
  6. package/dist/compiler/index.mjs +3 -3
  7. package/dist/compiler/utils/index.d.mts +272 -2
  8. package/dist/compiler/utils/index.mjs +4 -3
  9. package/dist/{compiler-B3pUYg_P.mjs → compiler-NrvbUOX1.mjs} +2904 -1269
  10. package/dist/declarations/stencil-ext-modules.d.ts +5 -5
  11. package/dist/declarations/stencil-public-compiler.d.ts +208 -62
  12. package/dist/declarations/stencil-public-docs.d.ts +9 -0
  13. package/dist/declarations/stencil-public-runtime.d.ts +91 -6
  14. package/dist/fragment-Di1hWOC8.mjs +4 -0
  15. package/dist/{regular-expression-CFVJOTUh.mjs → helpers-Cpp3qc3u.mjs} +31 -15
  16. package/dist/index-BOrz3rbJ.d.mts +100 -0
  17. package/dist/{index-BuveMLxy.d.ts → index-DnISpqrd.d.ts} +150 -10
  18. package/dist/{index-CVhWFUM0.d.mts → index-RrQfiPWK.d.mts} +490 -841
  19. package/dist/index.d.mts +4 -0
  20. package/dist/index.mjs +91 -2
  21. package/dist/jsx-runtime.mjs +2 -1
  22. package/dist/{node-10UamZmn.mjs → node-75gQKkFz.mjs} +60 -58
  23. package/dist/{chunk-z9aeyW2b.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
  24. package/dist/runtime/client/lazy.js +483 -347
  25. package/dist/runtime/client/runtime.d.ts +150 -39
  26. package/dist/runtime/client/runtime.js +483 -347
  27. package/dist/runtime/index.d.ts +6 -32
  28. package/dist/runtime/index.js +482 -345
  29. package/dist/runtime/server/index.d.mts +81 -9
  30. package/dist/runtime/server/index.mjs +419 -193
  31. package/dist/runtime/server/runner.d.mts +3 -0
  32. package/dist/runtime/server/runner.mjs +321 -338
  33. package/dist/signals/index.d.ts +2 -0
  34. package/dist/signals/index.js +5 -2
  35. package/dist/sys/node/index.d.mts +1 -2
  36. package/dist/sys/node/index.mjs +1 -1
  37. package/dist/sys/node/worker.d.mts +1 -1
  38. package/dist/sys/node/worker.mjs +6 -3
  39. package/dist/testing/index.d.mts +4716 -105
  40. package/dist/testing/index.mjs +7744 -791
  41. package/dist/util-IKfWWLJo.mjs +724 -0
  42. package/dist/validation-DAdGTrys.mjs +791 -0
  43. package/package.json +33 -33
  44. package/dist/client-Dd-NB5Ei.mjs +0 -4833
  45. package/dist/index-ch-cf-bZ.d.mts +0 -205
  46. package/dist/runtime/app-data/index.d.ts +0 -2
  47. package/dist/validation-ByxKj8bC.mjs +0 -1458
  48. /package/{LICENSE.md → LICENSE} +0 -0
  49. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
  50. /package/dist/{runtime/app-globals → app-globals}/index.js +0 -0
@@ -1,24 +1,24 @@
1
- declare module "*.css" {
1
+ declare module "*.css?stencil" {
2
2
  const src: () => string;
3
3
  export default src;
4
4
  }
5
5
 
6
- declare module "*.svg" {
6
+ declare module "*.svg?stencil" {
7
7
  const src: string;
8
8
  export default src;
9
9
  }
10
10
 
11
- declare module "*.txt" {
11
+ declare module "*.txt?stencil" {
12
12
  const src: string;
13
13
  export default src;
14
14
  }
15
15
 
16
- declare module "*.frag" {
16
+ declare module "*.frag?stencil" {
17
17
  const src: string;
18
18
  export default src;
19
19
  }
20
20
 
21
- declare module "*.vert" {
21
+ declare module "*.vert?stencil" {
22
22
  const src: string;
23
23
  export default src;
24
24
  }
@@ -1,5 +1,6 @@
1
1
  import { ListenTargetOptions, ResolutionHandler } from "./stencil-public-runtime.js";
2
- import { InputOptions, SourceMap as RolldownSourceMap } from "rolldown";
2
+ import { InputOptions, Plugin, SourceMap } from "rolldown";
3
+ import "typescript";
3
4
  //#region src/utils/result.d.ts
4
5
  /**
5
6
  * A Result wraps up a success state and a failure state, allowing you to
@@ -46,15 +47,6 @@ type Err<T> = {
46
47
  isErr: true;
47
48
  value: T;
48
49
  };
49
- /**
50
- * Create an `Ok` given a value. This doesn't do any checking that the value is
51
- * 'ok-ish' since doing so would make an undue assumption about what is 'ok'.
52
- * Instead, this trusts the user to determine, at the call site, whether
53
- * something is `ok()` or `err()`.
54
- *
55
- * @param value the value to wrap up in an `Ok`
56
- * @returns an Ok wrapping the value
57
- */
58
50
  //#endregion
59
51
  //#region src/compiler/sys/in-memory-fs.d.ts
60
52
  /**
@@ -231,10 +223,6 @@ declare const createInMemoryFs: (sys: CompilerSystem) => {
231
223
  * `[ source, destination ]`
232
224
  */
233
225
  type FileCopyTuple = [string, string];
234
- /**
235
- * Collected instructions for all pending filesystem operations saved
236
- * to the in-memory filesystem.
237
- */
238
226
  /**
239
227
  * Results from committing pending filesystem operations
240
228
  */
@@ -245,14 +233,6 @@ interface FsCommitResults {
245
233
  dirsDeleted: string[];
246
234
  dirsAdded: string[];
247
235
  }
248
- /**
249
- * Given the current state of the in-memory proxy filesystem, collect all of
250
- * the changes that need to be made in order to commit the currently-pending
251
- * operations (e.g. write, copy, delete) to the OS filesystem.
252
- *
253
- * @param items the storage data structure for the in-memory FS cache
254
- * @returns a collection of all the operations that need to be done
255
- */
256
236
  //#endregion
257
237
  //#region src/declarations/stencil-public-docs.d.ts
258
238
  /**
@@ -275,6 +255,13 @@ interface JsonDocs {
275
255
  * The metadata for the JSDocs for each component in a Stencil project
276
256
  */
277
257
  components: JsonDocsComponent[];
258
+ /**
259
+ * Project-level usage content, collected from markdown files in a `usage`
260
+ * directory at the project's {@link Config.srcDir} root (as opposed to
261
+ * per-component usage content, which lives in {@link JsonDocsComponent.usage}).
262
+ * Keyed by file name (without extension), same shape as component usage.
263
+ */
264
+ usage?: JsonDocsUsage;
278
265
  /**
279
266
  * The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
280
267
  */
@@ -655,7 +642,7 @@ interface StyleDoc {
655
642
  }
656
643
  //#endregion
657
644
  //#region src/declarations/stencil-private.d.ts
658
- interface SourceMap {
645
+ interface SourceMap$1 {
659
646
  file: string;
660
647
  mappings: string;
661
648
  names: string[];
@@ -679,6 +666,8 @@ interface BuildFeatures {
679
666
  shadowDelegatesFocus: boolean;
680
667
  shadowModeClosed: boolean;
681
668
  shadowSlotAssignmentManual: boolean;
669
+ shadowClonable: boolean;
670
+ shadowSerializable: boolean;
682
671
  scoped: boolean;
683
672
  /**
684
673
  * Every component has a render function
@@ -695,6 +684,8 @@ interface BuildFeatures {
695
684
  vdomKey: boolean;
696
685
  vdomListener: boolean;
697
686
  vdomPropOrAttr: boolean;
687
+ /** True when at least one component uses the explicit `attr:`/`prop:` JSX prefix. */
688
+ vdomPropOrAttrPrefix: boolean;
698
689
  vdomRef: boolean;
699
690
  vdomStyle: boolean;
700
691
  vdomText: boolean;
@@ -913,7 +904,7 @@ interface RolldownChunkResult {
913
904
  isBrowserLoader: boolean;
914
905
  imports: string[];
915
906
  moduleFormat: ModuleFormat;
916
- map?: RolldownSourceMap;
907
+ map?: SourceMap;
917
908
  }
918
909
  interface BundleModule {
919
910
  entryKey: string;
@@ -1092,6 +1083,7 @@ interface ComponentCompilerFeatures {
1092
1083
  hasVdomKey: boolean;
1093
1084
  hasVdomListener: boolean;
1094
1085
  hasVdomPropOrAttr: boolean;
1086
+ hasVdomPropOrAttrPrefix: boolean;
1095
1087
  hasVdomRef: boolean;
1096
1088
  hasVdomRender: boolean;
1097
1089
  hasVdomStyle: boolean;
@@ -1102,6 +1094,7 @@ interface ComponentCompilerFeatures {
1102
1094
  htmlAttrNames: string[];
1103
1095
  htmlTagNames: string[];
1104
1096
  htmlParts: string[];
1097
+ htmlSlots: string[];
1105
1098
  isUpdateable: boolean;
1106
1099
  /**
1107
1100
  * A plain component is one that doesn't have:
@@ -1174,6 +1167,16 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
1174
1167
  properties: ComponentCompilerProperty[];
1175
1168
  serializers: ComponentCompilerChangeHandler[];
1176
1169
  shadowDelegatesFocus: boolean;
1170
+ /**
1171
+ * Whether the shadow root is preserved when the host element is deep-cloned via
1172
+ * `Node.cloneNode(true)`. Only applicable when encapsulation is 'shadow'.
1173
+ */
1174
+ shadowClonable: boolean;
1175
+ /**
1176
+ * Whether the shadow root is marked serializable for `Element.getHTML({ serializableShadowRoots: true })`.
1177
+ * Only applicable when encapsulation is 'shadow'.
1178
+ */
1179
+ shadowSerializable: boolean;
1177
1180
  /**
1178
1181
  * Shadow DOM mode. 'open' (default) or 'closed'.
1179
1182
  * Only applicable when encapsulation is 'shadow'.
@@ -1510,6 +1513,7 @@ interface Module {
1510
1513
  htmlAttrNames: string[];
1511
1514
  htmlTagNames: string[];
1512
1515
  htmlParts: string[];
1516
+ htmlSlots: string[];
1513
1517
  isCollectionDependency: boolean;
1514
1518
  isLegacy: boolean;
1515
1519
  jsFilePath: string;
@@ -1534,6 +1538,7 @@ interface Module {
1534
1538
  hasVdomKey: boolean;
1535
1539
  hasVdomListener: boolean;
1536
1540
  hasVdomPropOrAttr: boolean;
1541
+ hasVdomPropOrAttrPrefix: boolean;
1537
1542
  hasVdomRef: boolean;
1538
1543
  hasVdomRender: boolean;
1539
1544
  hasVdomStyle: boolean;
@@ -1541,6 +1546,28 @@ interface Module {
1541
1546
  hasVdomXlink: boolean;
1542
1547
  hasSignalsImport: boolean;
1543
1548
  }
1549
+ interface Plugin$1 {
1550
+ name?: string;
1551
+ pluginType?: string;
1552
+ load?: (id: string, context: PluginCtx) => Promise<string> | string;
1553
+ resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
1554
+ transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults;
1555
+ }
1556
+ type PluginTransformResults = PluginTransformationDescriptor | string | null;
1557
+ interface PluginTransformationDescriptor {
1558
+ code?: string;
1559
+ map?: string;
1560
+ id?: string;
1561
+ diagnostics?: Diagnostic[];
1562
+ dependencies?: string[];
1563
+ }
1564
+ interface PluginCtx {
1565
+ config: Config;
1566
+ sys: CompilerSystem;
1567
+ fs: InMemoryFileSystem;
1568
+ cache: Cache;
1569
+ diagnostics: Diagnostic[];
1570
+ }
1544
1571
  interface PrerenderUrlResults {
1545
1572
  anchorUrls: string[];
1546
1573
  diagnostics: Diagnostic[];
@@ -1677,7 +1704,7 @@ interface CompilerWorkerContext {
1677
1704
  prepareModule(input: string, minifyOpts: any): Promise<{
1678
1705
  output: string;
1679
1706
  diagnostics: Diagnostic[];
1680
- sourceMap?: SourceMap;
1707
+ sourceMap?: SourceMap$1;
1681
1708
  }>;
1682
1709
  prerenderWorker(prerenderRequest: PrerenderUrlRequest): Promise<PrerenderUrlResults>;
1683
1710
  transformCssToEsm(input: TransformCssToEsmInput): Promise<TransformCssToEsmOutput>;
@@ -1783,11 +1810,12 @@ interface StencilConfig {
1783
1810
  */
1784
1811
  outputTargets?: OutputTarget[];
1785
1812
  /**
1786
- * The plugins config can be used to add your own rolldown plugins.
1787
- * By default, Stencil does not come with Sass or PostCSS support.
1813
+ * The plugins config can be used to add your own rolldown plugins, or Stencil's own
1814
+ * legacy `resolveId`/`load`/`transform` style plugins (identified by a `pluginType`
1815
+ * property). By default, Stencil does not come with Sass or PostCSS support.
1788
1816
  * However, either can be added using the plugin array.
1789
1817
  */
1790
- plugins?: any[];
1818
+ plugins?: (Plugin$1 | Plugin)[];
1791
1819
  /**
1792
1820
  * Generate js source map files for all bundles.
1793
1821
  * Set to `true` to always generate source maps, `false` to never generate source maps.
@@ -1807,11 +1835,6 @@ interface StencilConfig {
1807
1835
  * This behavior defaults to `true`, but may be opted-out of by setting this flag to `false`.
1808
1836
  */
1809
1837
  transformAliasedImportPaths?: boolean;
1810
- /**
1811
- * When `true`, Stencil will suppress diagnostics which warn about public members using reserved names
1812
- * (for example, decorating a method named `focus` with `@Method()`). Defaults to `false`.
1813
- */
1814
- suppressReservedPublicNameWarnings?: boolean;
1815
1838
  /**
1816
1839
  * Passes custom configuration down to the "@rolldown/plugin-node-resolve" that Stencil uses under the hood.
1817
1840
  * For further information: https://stenciljs.com/docs/module-bundling
@@ -1837,7 +1860,8 @@ interface StencilConfig {
1837
1860
  */
1838
1861
  logger?: Logger;
1839
1862
  /**
1840
- * Compatibility and workaround flags for framework integration and bundler edge cases.
1863
+ * Compatibility and workaround flags for framework/bundler edge cases
1864
+ * and rarely-needed diagnostic suppressions.
1841
1865
  */
1842
1866
  compat?: ConfigCompat;
1843
1867
  /**
@@ -1908,8 +1932,8 @@ interface StencilConfig {
1908
1932
  maxConcurrentWorkers?: number;
1909
1933
  preamble?: string;
1910
1934
  rolldownPlugins?: {
1911
- before?: any[];
1912
- after?: any[];
1935
+ before?: Plugin[];
1936
+ after?: Plugin[];
1913
1937
  };
1914
1938
  entryComponentsHint?: string[];
1915
1939
  buildLogFilePath?: string;
@@ -1963,6 +1987,23 @@ interface StencilConfig {
1963
1987
  * Set whether unused dependencies should be excluded from the built output.
1964
1988
  */
1965
1989
  excludeUnusedDependencies?: boolean;
1990
+ /**
1991
+ * Declares the set of valid style "modes" (e.g. `ios`, `md`) used by mode-keyed
1992
+ * `styleUrls`/`styles` in `@Component()`. When set, the compiler validates that
1993
+ * every mode key used in a component matches one of these entries, catching typos
1994
+ * at build time. Entries marked `required` must be present on every component that
1995
+ * defines any mode-keyed styles.
1996
+ *
1997
+ * @example
1998
+ * ```ts
1999
+ * export const config: Config = {
2000
+ * modes: ['ios', { mode: 'md', required: true }],
2001
+ * };
2002
+ * ```
2003
+ *
2004
+ * @default []
2005
+ */
2006
+ modes?: (string | ModeConfig)[];
1966
2007
  /**
1967
2008
  * Explicitly declare which npm packages are Stencil collections to be re-bundled into this project.
1968
2009
  *
@@ -1980,7 +2021,6 @@ interface StencilConfig {
1980
2021
  * @default []
1981
2022
  */
1982
2023
  collections?: string[];
1983
- stencilCoreResolvedId?: string;
1984
2024
  }
1985
2025
  /**
1986
2026
  * DOM patches for light-dom / scoped components that use `<slot>`.
@@ -1998,14 +2038,20 @@ interface StencilConfig {
1998
2038
  * for granular control.
1999
2039
  */
2000
2040
  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). */
2041
+ /** Patches `childNodes`/`children` getters to return only slotted content. */
2042
+ childNodes?: boolean;
2043
+ /** Patches `cloneNode()` to correctly deep-clone slotted content. */
2044
+ cloneNode?: boolean;
2045
+ /** Patches `appendChild()`, `insertBefore()`, and `removeChild()` to route to the correct slot. */
2046
+ domMutations?: boolean;
2047
+ /** Patches `textContent` to act like shadow DOM (reads/writes slotted text only). */
2004
2048
  textContent?: boolean;
2005
2049
  };
2006
2050
  /**
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.
2051
+ * Compatibility and workaround flags, primarily for shielding non-shadow DOM components
2052
+ * from consuming frameworks that mutate internals they don't know about, plus other
2053
+ * framework/bundler integration edge cases and rarely-needed diagnostic suppressions.
2054
+ * These are opt-in behaviors that aren't needed by every project.
2009
2055
  */
2010
2056
  interface ConfigCompat {
2011
2057
  /**
@@ -2036,6 +2082,15 @@ interface ConfigCompat {
2036
2082
  * See {@link LightDomPatches} for granular control. Defaults to `true`.
2037
2083
  */
2038
2084
  lightDomPatches?: boolean | LightDomPatches;
2085
+ /**
2086
+ * When `true`, Stencil will suppress diagnostics which warn about public members using reserved names
2087
+ * (for example, decorating a method named `focus` with `@Method()`). Defaults to `false`.
2088
+ */
2089
+ suppressPublicNameWarnings?: boolean;
2090
+ /**
2091
+ * When `true`, Stencil will suppress diagnostics which warn about event names conflicting with native DOM event names. Defaults to `false`.
2092
+ */
2093
+ suppressEventNameWarnings?: boolean;
2039
2094
  }
2040
2095
  interface Config extends StencilConfig {
2041
2096
  buildAppCore?: boolean;
@@ -2135,7 +2190,7 @@ type UnvalidatedConfig = Loose<Config>;
2135
2190
  * type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
2136
2191
  * ```
2137
2192
  */
2138
- type RequireFields<T, K extends keyof T> = T & { [P in K]-?: T[P] };
2193
+ type RequireFields<T, K extends keyof T> = T & { [P in K]-?: T[P]; };
2139
2194
  /**
2140
2195
  * Fields in {@link Config} to make required for {@link ValidatedConfig}
2141
2196
  */
@@ -2154,6 +2209,17 @@ type ValidatedConfig = RequireFields<Config, StrictConfigFields> & {
2154
2209
  devMode: boolean;
2155
2210
  sourceMap: boolean;
2156
2211
  };
2212
+ interface ModeConfig {
2213
+ /**
2214
+ * The mode name, matched against `styleUrls`/`styles` object keys in `@Component()`.
2215
+ */
2216
+ mode: string;
2217
+ /**
2218
+ * When `true`, every component that defines mode-keyed `styleUrls` or `styles`
2219
+ * must include this mode. Defaults to `false`.
2220
+ */
2221
+ required?: boolean;
2222
+ }
2157
2223
  interface HydratedFlag {
2158
2224
  /**
2159
2225
  * Defaults to `hydrated`.
@@ -3714,6 +3780,22 @@ interface OutputTargetDocsReadme extends OutputTargetBase {
3714
3780
  overwriteExisting?: boolean | 'if-missing';
3715
3781
  footer?: string;
3716
3782
  strict?: boolean;
3783
+ /**
3784
+ * Add extra columns to the generated Properties/Events tables, e.g. to
3785
+ * surface custom JSDoc tags as a column of their own.
3786
+ */
3787
+ customColumns?: {
3788
+ props?: DocsReadmeCustomColumn<JsonDocsProp>[];
3789
+ events?: DocsReadmeCustomColumn<JsonDocsEvent>[];
3790
+ };
3791
+ }
3792
+ /**
3793
+ * A custom column to render in a `docs-readme` Properties/Events table.
3794
+ * `content` is invoked once per row.
3795
+ */
3796
+ interface DocsReadmeCustomColumn<T> {
3797
+ header: string;
3798
+ content: (member: T, cmp: JsonDocsComponent) => string;
3717
3799
  }
3718
3800
  interface OutputTargetDocsJson extends OutputTargetBase {
3719
3801
  type: 'docs-json';
@@ -3754,6 +3836,35 @@ interface OutputTargetDocsCustom extends OutputTargetBase {
3754
3836
  generator: (docs: JsonDocs, config: Config) => void | Promise<void>;
3755
3837
  strict?: boolean;
3756
3838
  }
3839
+ /**
3840
+ * Output target for generating an [Agent Skill](https://agentskills.io)
3841
+ * (`SKILL.md` + per-component reference files) describing a component
3842
+ * library, so AI coding agents can consume its API and usage examples
3843
+ * directly.
3844
+ */
3845
+ interface OutputTargetDocsAgentSkill extends OutputTargetBase {
3846
+ type: 'docs-agent-skill';
3847
+ /**
3848
+ * The root directory where the skill (`SKILL.md` + `components/*.md`) is written.
3849
+ *
3850
+ * defaults to `dist/skill`
3851
+ */
3852
+ dir?: string;
3853
+ /**
3854
+ * The skill's name, used in the `SKILL.md` frontmatter.
3855
+ *
3856
+ * Defaults to a kebab-cased form of {@link Config.namespace}.
3857
+ */
3858
+ name?: string;
3859
+ /**
3860
+ * The skill's description, used in the `SKILL.md` frontmatter - this is the
3861
+ * text agents use to decide when to load the skill.
3862
+ *
3863
+ * Defaults to an auto-generated sentence built from the project's
3864
+ * {@link JsonDocs.usage} (if present) or its component tags.
3865
+ */
3866
+ description?: string;
3867
+ }
3757
3868
  interface OutputTargetStats extends OutputTargetBase {
3758
3869
  type: 'stats';
3759
3870
  file?: string;
@@ -3981,7 +4092,7 @@ interface OutputTargetWww extends OutputTargetBase {
3981
4092
  */
3982
4093
  hashedFileNameLength?: number;
3983
4094
  }
3984
- type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetLoaderBundle | OutputTargetStandalone | OutputTargetSsr | OutputTargetSsrWasm | OutputTargetCollection | OutputTargetTypes | OutputTargetGlobalStyle | OutputTargetAssets | OutputTargetDistLazy | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustomElementsManifest | OutputTargetWww | OutputTargetStats;
4095
+ type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetLoaderBundle | OutputTargetStandalone | OutputTargetSsr | OutputTargetSsrWasm | OutputTargetCollection | OutputTargetTypes | OutputTargetGlobalStyle | OutputTargetAssets | OutputTargetDistLazy | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustomElementsManifest | OutputTargetDocsAgentSkill | OutputTargetWww | OutputTargetStats;
3985
4096
  /**
3986
4097
  * A post-validation form of {@link OutputTargetWww} where `serviceWorker`
3987
4098
  * has been normalized - `true` is resolved to a {@link ServiceWorkerConfig}.
@@ -4198,9 +4309,11 @@ interface CompilerRequestResponse {
4198
4309
  interface TranspileOptions {
4199
4310
  /**
4200
4311
  * A component can be defined as a custom element by using `customelement`, or the
4201
- * component class can be exported by using `module`. Default is `customelement`.
4312
+ * component class can be exported by using `module`. Set to `null` to leave the
4313
+ * class's own export as-is (used with `componentMetadata: 'compilerstatic'` for
4314
+ * unit-testing preprocessors). Default is `customelement`.
4202
4315
  */
4203
- componentExport?: 'customelement' | 'module' | string | undefined;
4316
+ componentExport?: 'customelement' | 'module' | string | null | undefined;
4204
4317
  /**
4205
4318
  * Sets how and if component metadata should be assigned on the compiled
4206
4319
  * component output. The `compilerstatic` value will set the metadata to
@@ -4235,8 +4348,11 @@ interface TranspileOptions {
4235
4348
  /**
4236
4349
  * How component styles should be associated to the component. The `static`
4237
4350
  * setting will assign the styles as a static getter on the component class.
4351
+ * Set to `null` to skip the assignment entirely (and leave any `styleUrl`
4352
+ * import unresolved) - useful for unit-testing preprocessors that don't
4353
+ * need real stylesheets.
4238
4354
  */
4239
- style?: 'static' | string | undefined;
4355
+ style?: 'static' | string | null | undefined;
4240
4356
  /**
4241
4357
  * How style data should be added for imports. For example, the `queryparams` value
4242
4358
  * adds the component's tagname and encapsulation info as querystring parameter
@@ -4297,27 +4413,50 @@ interface TranspileOptions {
4297
4413
  */
4298
4414
  additionalTagTransformers?: boolean;
4299
4415
  /**
4300
- * A map of virtual file paths to source text for modules that the component
4301
- * under transpilation extends from. When provided, `transpile()` builds a
4302
- * minimal multi-file TypeScript program from these sources so that
4303
- * {@link https://stenciljs.com/docs/component-lifecycle inheritance chains}
4304
- * can be resolved without requiring the parent files to exist on disk.
4305
- *
4306
- * Keys are the same import paths used in the component's `import` statements
4307
- * (relative paths are resolved against `currentDirectory`). Values are the
4308
- * TypeScript/JavaScript source text of that module.
4416
+ * Callback used to resolve parent-class source for inheritance-chain analysis.
4417
+ * Called when a component's `extends` clause references a class from another
4418
+ * module. Return the resolved absolute path and source text of that module,
4419
+ * or `null` to skip inheritance resolution for that specifier.
4309
4420
  *
4310
4421
  * @example
4311
4422
  * ```ts
4312
4423
  * transpile(myComponentCode, {
4313
- * extraFiles: {
4314
- * './base-component.ts': baseComponentSourceText,
4424
+ * resolveImport: (specifier, importer) => {
4425
+ * const resolved = require.resolve(specifier, { paths: [path.dirname(importer)] });
4426
+ * return { code: fs.readFileSync(resolved, 'utf8'), path: resolved };
4315
4427
  * },
4316
4428
  * });
4317
4429
  * ```
4318
4430
  */
4319
- extraFiles?: Record<string, string>;
4431
+ resolveImport?: (specifier: string, importer: string) => {
4432
+ code: string;
4433
+ path: string;
4434
+ } | null;
4435
+ /**
4436
+ * When `true` class declarations at the end of a `@Component` inheritance chain
4437
+ * * that have no `extends` clause * will get `extends HTMLElement` injected, and a minimal
4438
+ * `constructor() { super(); }`. Any stencil static meta-getters are also stripped.
4439
+ */
4440
+ transformAsBaseClass?: boolean;
4441
+ /**
4442
+ * Overrides for Stencil's BUILD feature flags in the generated output.
4443
+ * When set, a BUILD mutation statement is prepended to the compiled code so
4444
+ * that the specified flags take effect for this component at runtime.
4445
+ */
4446
+ buildOverrides?: BuildOverrides;
4320
4447
  }
4448
+ /**
4449
+ * Keys of {@link BuildConditionals} that can be meaningfully overridden at
4450
+ * transpile time — config-driven flags that are not derived from component
4451
+ * scanning or runtime environment detection.
4452
+ */
4453
+ type BuildOverrideKeys = 'hotModuleReplacement' | 'signalBacking' | 'vdomSignals' | 'lightDomPatches' | 'slotChildNodes' | 'slotCloneNode' | 'slotDomMutations' | 'slotTextContent' | 'lifecycleDOMEvents' | 'initializeNextTick';
4454
+ /**
4455
+ * Subset of Stencil's BUILD feature flags that can be overridden at transpile
4456
+ * time. Derived from {@link BuildConditionals} via `Pick` so the field list
4457
+ * and types stay in sync with the authoritative definition.
4458
+ */
4459
+ type BuildOverrides = Pick<BuildConditionals, BuildOverrideKeys>;
4321
4460
  type CompileTarget = 'latest' | 'esnext' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | 'es2015' | string | undefined;
4322
4461
  interface TranspileResults {
4323
4462
  code: string;
@@ -4344,9 +4483,16 @@ interface TransformOptions {
4344
4483
  styleImportData: 'queryparams' | null;
4345
4484
  target?: string;
4346
4485
  /**
4347
- * @see {@link TranspileOptions.extraFiles}
4486
+ * @see {@link TranspileOptions.resolveImport}
4348
4487
  */
4349
- extraFiles?: Record<string, string>;
4488
+ resolveImport?: (specifier: string, importer: string) => {
4489
+ code: string;
4490
+ path: string;
4491
+ } | null;
4492
+ /** @see {@link TranspileOptions.transformAsBaseClass} */
4493
+ transformAsBaseClass?: boolean;
4494
+ /** @see {@link TranspileOptions.buildOverrides} */
4495
+ buildOverrides?: BuildOverrides;
4350
4496
  }
4351
4497
  interface CompileScriptMinifyOptions {
4352
4498
  target?: CompileTarget;
@@ -4367,4 +4513,4 @@ interface CliInitOptions {
4367
4513
  sys: CompilerSystem;
4368
4514
  }
4369
4515
  //#endregion
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 };
4516
+ export { AutoprefixerOptions, BuildEmitEvents, BuildEvents, BuildLog, BuildNoChangeResults, BuildOnEventRemove, BuildOnEvents, BuildOutput, BuildOverrides, 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, DocsReadmeCustomColumn, 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, ModeConfig, NodeResolveConfig, OptimizeCssInput, OptimizeCssOutput, OptimizeJsInput, OptimizeJsOutput, OutputTarget, OutputTargetAssets, OutputTargetBase, OutputTargetBaseNext, OutputTargetBuild, OutputTargetCollection, OutputTargetCopy, OutputTargetCustom, OutputTargetDistLazy, OutputTargetDocsAgentSkill, 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 };
@@ -1,3 +1,5 @@
1
+ import "rolldown";
2
+ import "typescript";
1
3
  //#region src/declarations/stencil-private.d.ts
2
4
  /**
3
5
  * Information about a type used in a Stencil component or exported
@@ -123,6 +125,13 @@ interface JsonDocs {
123
125
  * The metadata for the JSDocs for each component in a Stencil project
124
126
  */
125
127
  components: JsonDocsComponent[];
128
+ /**
129
+ * Project-level usage content, collected from markdown files in a `usage`
130
+ * directory at the project's {@link Config.srcDir} root (as opposed to
131
+ * per-component usage content, which lives in {@link JsonDocsComponent.usage}).
132
+ * Keyed by file name (without extension), same shape as component usage.
133
+ */
134
+ usage?: JsonDocsUsage;
126
135
  /**
127
136
  * The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
128
137
  */