@stencil/core 5.0.0-beta.9 → 5.0.0-rc.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 (40) hide show
  1. package/dist/app-data/index.d.ts +1 -1
  2. package/dist/app-data/index.js +1 -0
  3. package/dist/{client-BRu0GtRn.mjs → client-ClM4H9-P.mjs} +204 -76
  4. package/dist/compiler/browser.d.ts +120 -81
  5. package/dist/compiler/browser.js +964 -402
  6. package/dist/compiler/index.d.mts +110 -2
  7. package/dist/compiler/index.mjs +3 -3
  8. package/dist/compiler/utils/index.d.mts +2 -2
  9. package/dist/compiler/utils/index.mjs +3 -3
  10. package/dist/{compiler-wLrjuSOK.mjs → compiler-DFanjq9z.mjs} +5300 -3005
  11. package/dist/declarations/stencil-public-compiler.d.ts +178 -133
  12. package/dist/declarations/stencil-public-docs.d.ts +23 -0
  13. package/dist/declarations/stencil-public-runtime.d.ts +81 -59
  14. package/dist/{index-BvF31nqP.d.mts → index-DvfFOkiJ.d.mts} +220 -133
  15. package/dist/{index-BXAcVN2j.d.ts → index-XQHZl0MW.d.ts} +70 -57
  16. package/dist/{index-BAP9T4CB.d.mts → index-aBMJC5F9.d.mts} +6 -2
  17. package/dist/index.d.mts +3 -0
  18. package/dist/index.mjs +1 -1
  19. package/dist/jsx-runtime.d.mts +6 -0
  20. package/dist/jsx-runtime.mjs +1 -1
  21. package/dist/{node-75gQKkFz.mjs → node-DJP8JuAS.mjs} +42 -48
  22. package/dist/runtime/client/lazy.js +522 -262
  23. package/dist/runtime/client/runtime.d.ts +100 -68
  24. package/dist/runtime/client/runtime.js +522 -262
  25. package/dist/runtime/index.d.ts +6 -6
  26. package/dist/runtime/index.js +521 -261
  27. package/dist/runtime/server/index.d.mts +36 -12
  28. package/dist/runtime/server/index.mjs +635 -304
  29. package/dist/runtime/server/runner.d.mts +49 -6
  30. package/dist/runtime/server/runner.mjs +385 -87
  31. package/dist/signals/index.d.ts +11 -2
  32. package/dist/signals/index.js +15 -35
  33. package/dist/sys/node/index.d.mts +1 -1
  34. package/dist/sys/node/index.mjs +1 -1
  35. package/dist/sys/node/worker.mjs +2 -2
  36. package/dist/testing/index.d.mts +152 -124
  37. package/dist/testing/index.mjs +535 -269
  38. package/dist/{util-IKfWWLJo.mjs → util-C-H1H84W.mjs} +8 -1
  39. package/dist/{validation-DAdGTrys.mjs → validation-ByYYKvnS.mjs} +37 -3
  40. package/package.json +8 -4
@@ -1,4 +1,4 @@
1
- import { batch, computed, effect, signal, untracked } from "@preact/signals-core";
1
+ import * as SignalsCore from "@preact/signals-core";
2
2
  //#region src/app-data/index.ts
3
3
  /**
4
4
  * A collection of default build flags for a Stencil project.
@@ -98,40 +98,11 @@ const BUILD = {
98
98
  shadowSlotAssignmentManual: false,
99
99
  shadowClonable: true,
100
100
  shadowSerializable: true,
101
+ shadowReferenceTarget: true,
101
102
  initializeNextTick: false,
102
103
  asyncLoading: true,
103
104
  asyncQueue: false
104
105
  };
105
- BUILD.isDev, BUILD.isTesting;
106
- const MEMBER_FLAGS = {
107
- String: 1,
108
- Number: 2,
109
- Boolean: 4,
110
- Any: 8,
111
- Unknown: 16,
112
- State: 32,
113
- Method: 64,
114
- Event: 128,
115
- Element: 256,
116
- ReflectAttr: 512,
117
- Mutable: 1024,
118
- Getter: 2048,
119
- Setter: 4096,
120
- Prop: 31,
121
- HasAttribute: 31,
122
- PropLike: 63
123
- };
124
- //#endregion
125
- //#region src/client/client-host-ref.ts
126
- /**
127
- * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
128
- *
129
- * @param ref the runtime ref of interest
130
- * @returns the Host reference (if found) or undefined
131
- */
132
- const getHostRef = (ref) => {
133
- if (ref.__s_ghr) return ref.__s_ghr();
134
- };
135
106
  //#endregion
136
107
  //#region src/client/client-log.ts
137
108
  const STENCIL_DEV_MODE = BUILD.isTesting ? ["STENCIL:"] : ["%cstencil", "color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"];
@@ -140,6 +111,16 @@ const consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
140
111
  (typeof window !== "undefined" ? window : {}).HTMLElement;
141
112
  BUILD.constructableCSS;
142
113
  //#endregion
114
+ //#region src/runtime/signals-core.ts
115
+ const getCore = () => globalThis[Symbol.for("stencil.preact-signals-core")] ??= SignalsCore;
116
+ const batch = (fn) => getCore().batch(fn);
117
+ const computed = (fn, options) => getCore().computed(fn, options);
118
+ const effect = (fn, options) => getCore().effect(fn, options);
119
+ const untracked = (fn) => getCore().untracked(fn);
120
+ function signal(value, options) {
121
+ return getCore().signal(value, options);
122
+ }
123
+ //#endregion
143
124
  //#region src/runtime/signals.ts
144
125
  const STENCIL_SIGNALS_SYMBOL = Symbol.for("stencil.signals");
145
126
  BUILD.lazyLoad || globalThis.HTMLElement;
@@ -163,13 +144,12 @@ BUILD.lazyLoad || globalThis.HTMLElement;
163
144
  * @returns the `ReadonlySignal` for the prop, or `null` if not found / not signal-backed
164
145
  */
165
146
  const getSignal = (elm, prop) => {
166
- const hostRef = getHostRef(elm);
167
- if (!hostRef?.$signalValues$) {
147
+ const signals = elm[STENCIL_SIGNALS_SYMBOL];
148
+ if (!signals) {
168
149
  if (BUILD.isDev) consoleDevWarn(`getSignal('${prop}'): element <${elm.tagName.toLowerCase()}> is not signal-backed. Ensure signalBacking is true in stencil.config.ts.`);
169
150
  return null;
170
151
  }
171
- if (!((hostRef.$cmpMeta$?.$members$?.[prop]?.[0] ?? 0) & MEMBER_FLAGS.Prop)) return null;
172
- return hostRef.$signalValues$.get(prop) ?? null;
152
+ return signals.get(prop) ?? null;
173
153
  };
174
154
  /**
175
155
  * Marks a class method as a reactive effect. Wraps the method in `effect()` after
@@ -1,4 +1,4 @@
1
- import { J as CompilerSystem, jt as Logger } from "../../index-BvF31nqP.mjs";
1
+ import { Bt as Logger, nt as CompilerSystem } from "../../index-DvfFOkiJ.mjs";
2
2
  //#region src/sys/node/logger/index.d.ts
3
3
  /**
4
4
  * Create a logger to run in a Node environment
@@ -1,2 +1,2 @@
1
- import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-75gQKkFz.mjs";
1
+ import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-DJP8JuAS.mjs";
2
2
  export { createNodeLogger, createNodeSys, setupNodeProcess };
@@ -1,5 +1,5 @@
1
- import { l as createWorkerMessageHandler } from "../../compiler-wLrjuSOK.mjs";
2
- import { t as createNodeSys } from "../../node-75gQKkFz.mjs";
1
+ import { l as createWorkerMessageHandler } from "../../compiler-DFanjq9z.mjs";
2
+ import { t as createNodeSys } from "../../node-DJP8JuAS.mjs";
3
3
  //#region src/sys/node/node-worker-thread.ts
4
4
  /**
5
5
  * Initialize a worker thread, setting up various machinery for managing
@@ -394,6 +394,11 @@ interface JsonDocsComponent {
394
394
  * A deprecation reason/description found following a `@deprecated` tag
395
395
  */
396
396
  deprecation?: string;
397
+ /**
398
+ * `true` if this is a "CSS-only component"
399
+ * discovered in .css file via `@component`-marked JSDoc block
400
+ */
401
+ cssOnly?: boolean;
397
402
  }
398
403
  interface JsonDocsDependencyGraph {
399
404
  [tagName: string]: string[];
@@ -553,6 +558,16 @@ interface JsonDocsStyle {
553
558
  * The annotation used in the JSDoc of the style (e.g. `@prop`)
554
559
  */
555
560
  annotation: string;
561
+ /**
562
+ * The CSS `syntax` descriptor for a custom property, if it was registered via a native
563
+ * `@property` at-rule (e.g. `"<length>"`).
564
+ */
565
+ syntax?: string;
566
+ /**
567
+ * The `initial-value` descriptor for a custom property, if it was registered via a native
568
+ * `@property` at-rule.
569
+ */
570
+ default?: string;
556
571
  /**
557
572
  * The mode associated with the style
558
573
  */
@@ -639,6 +654,14 @@ interface StyleDoc {
639
654
  * The Stencil style-mode that is associated with this property.
640
655
  */
641
656
  mode: string | undefined;
657
+ /**
658
+ * The CSS `syntax` descriptor, if this property was registered via a native `@property` at-rule.
659
+ */
660
+ syntax?: string;
661
+ /**
662
+ * The `initial-value` descriptor, if this property was registered via a native `@property` at-rule.
663
+ */
664
+ default?: string;
642
665
  }
643
666
  //#endregion
644
667
  //#region src/declarations/stencil-public-runtime.d.ts
@@ -919,10 +942,18 @@ interface StencilConfig {
919
942
  * Will generate {@link https://nodejs.org/api/packages.html#packages_exports export map} entry points
920
943
  * for each component in the build when `true`.
921
944
  *
922
- * Defaults to `true` for "no-config" projects (no `stencil.config.ts`/`.js` file), and `false`
923
- * whenever a config file is present - set this explicitly to opt an existing project in or out.
945
+ * @default false
924
946
  */
925
947
  generateExportMaps?: boolean;
948
+ /**
949
+ * Set to `false` to disable discovery of "CSS-only components" - pure-CSS custom-element
950
+ * definitions marked with a `@component` JSDoc tag in `.css` files under `srcDir`. No JS
951
+ * class, never registered via `customElements.define()` - just a documented,
952
+ * type-checked tag name and its CSS custom properties/attribute variants.
953
+ *
954
+ * Defaults to `true`.
955
+ */
956
+ enableCssOnlyComponents?: boolean;
926
957
  /**
927
958
  * The namespace config is a string representing a namespace for the app.
928
959
  * For apps that are not meant to be a library of reusable components,
@@ -965,7 +996,7 @@ interface StencilConfig {
965
996
  */
966
997
  transformAliasedImportPaths?: boolean;
967
998
  /**
968
- * Passes custom configuration down to the "@rolldown/plugin-node-resolve" that Stencil uses under the hood.
999
+ * Passes custom configuration to Rolldown's module resolution (its `resolve` option), e.g. `alias`.
969
1000
  * For further information: https://stenciljs.com/docs/module-bundling
970
1001
  */
971
1002
  nodeResolve?: NodeResolveConfig;
@@ -1180,7 +1211,7 @@ type LightDomPatches = {
1180
1211
  childNodes?: boolean;
1181
1212
  /** Patches `cloneNode()` to correctly deep-clone slotted content. */
1182
1213
  cloneNode?: boolean;
1183
- /** Patches `appendChild()`, `insertBefore()`, and `removeChild()` to route to the correct slot. */
1214
+ /** Patches `appendChild()`, `insertBefore()`, and `removeChild()` to route to the correct slot, and the `innerHTML` / `innerText` setters to replace only slotted content. */
1184
1215
  domMutations?: boolean;
1185
1216
  /** Patches `textContent` to act like shadow DOM (reads/writes slotted text only). */
1186
1217
  textContent?: boolean;
@@ -1245,11 +1276,6 @@ interface Config extends StencilConfig {
1245
1276
  tsWatchOptions?: any;
1246
1277
  _isValidated?: boolean;
1247
1278
  _isTesting?: boolean;
1248
- /**
1249
- * Internal flag set when --docs CLI flag is used.
1250
- * Forces docs output targets to build even in dev mode.
1251
- */
1252
- _docsFlag?: boolean;
1253
1279
  /**
1254
1280
  * Whether running in a CI environment (disables interactive features, adjusts worker count)
1255
1281
  */
@@ -1500,7 +1526,8 @@ interface DevServerConfig extends StencilDevServerConfig {
1500
1526
  * reloading updates.
1501
1527
  */
1502
1528
  excludeHmr?: string[];
1503
- historyApiFallback?: HistoryApiFallback;
1529
+ /** Serve `index` for page requests that match no file (single-page app routes). `null` turns it off. */
1530
+ historyApiFallback?: HistoryApiFallback | null;
1504
1531
  openBrowser?: boolean;
1505
1532
  prerenderConfig?: string;
1506
1533
  protocol?: 'http' | 'https';
@@ -1532,7 +1559,7 @@ interface CompilerSystem {
1532
1559
  name: 'node' | 'in-memory';
1533
1560
  version: string;
1534
1561
  events?: BuildEvents;
1535
- details?: SystemDetails;
1562
+ details: SystemDetails;
1536
1563
  /**
1537
1564
  * Add a callback which will be ran when destroy() is called.
1538
1565
  */
@@ -1545,14 +1572,15 @@ interface CompilerSystem {
1545
1572
  * SYNC! Always returns a boolean, does not throw.
1546
1573
  */
1547
1574
  accessSync(p: string): boolean;
1548
- applyGlobalPatch?(fromDir: string): Promise<void>;
1549
1575
  applyPrerenderGlobalPatch?(opts: {
1550
1576
  devServerHostUrl: string;
1551
1577
  window: any;
1552
1578
  }): void;
1553
- cacheStorage?: CacheStorage;
1554
- checkVersion?: (logger: Logger, currentVersion: string) => Promise<() => void>;
1555
- copy?(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
1579
+ /**
1580
+ * Check npm for a newer Stencil version. Resolves a function that logs the result.
1581
+ */
1582
+ checkVersion(logger: Logger, currentVersion: string): Promise<() => void>;
1583
+ copy(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
1556
1584
  /**
1557
1585
  * Always returns a boolean if the files were copied or not. Does not throw.
1558
1586
  */
@@ -1577,7 +1605,7 @@ interface CompilerSystem {
1577
1605
  /**
1578
1606
  * Each platform has a different way to dynamically import modules.
1579
1607
  */
1580
- dynamicImport?(p: string): Promise<any>;
1608
+ dynamicImport(p: string): Promise<any>;
1581
1609
  /**
1582
1610
  * Creates the worker controller for the current system.
1583
1611
  *
@@ -1591,20 +1619,14 @@ interface CompilerSystem {
1591
1619
  * process.exit()
1592
1620
  */
1593
1621
  exit(exitCode: number): Promise<void>;
1594
- /**
1595
- * Optionally provide a fetch() function rather than using the built-in fetch().
1596
- * First arg is a url string or Request object (RequestInfo).
1597
- * Second arg is the RequestInit. Returns the Response object
1598
- */
1599
- fetch?(input: string | any, init?: any): Promise<any>;
1600
1622
  /**
1601
1623
  * Generates a sha1 digest encoded as HEX
1602
1624
  */
1603
- generateContentHash?(content: string | any, length?: number): Promise<string>;
1625
+ generateContentHash(content: string | any, length?: number): Promise<string>;
1604
1626
  /**
1605
1627
  * Generates a sha1 digest encoded as HEX from a file path
1606
1628
  */
1607
- generateFileHash?(filePath: string | any, length?: number): Promise<string>;
1629
+ generateFileHash(filePath: string | any, length?: number): Promise<string>;
1608
1630
  /**
1609
1631
  * Get the current directory.
1610
1632
  */
@@ -1613,7 +1635,6 @@ interface CompilerSystem {
1613
1635
  * The compiler's executing path.
1614
1636
  */
1615
1637
  getCompilerExecutingPath(): string;
1616
- getEnvironmentVar?(key: string): string;
1617
1638
  /**
1618
1639
  * Gets the absolute file path when for a dependency module.
1619
1640
  */
@@ -1652,11 +1673,7 @@ interface CompilerSystem {
1652
1673
  * Normalize file system path.
1653
1674
  */
1654
1675
  normalizePath(p: string): string;
1655
- onProcessInterrupt?(cb: () => void): void;
1656
- parseYarnLockFile?: (content: string) => {
1657
- type: 'success' | 'merge' | 'conflict';
1658
- object: any;
1659
- };
1676
+ onProcessInterrupt(cb: () => void): void;
1660
1677
  platformPath: PlatformPath;
1661
1678
  /**
1662
1679
  * All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
@@ -1692,6 +1709,9 @@ interface CompilerSystem {
1692
1709
  * Rename old path to new path. Does not throw.
1693
1710
  */
1694
1711
  rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;
1712
+ /**
1713
+ * Assigned by the compiler. Used by plugins (e.g. `@stencil/sass`) to resolve `~` imports.
1714
+ */
1695
1715
  resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;
1696
1716
  resolvePath(p: string): string;
1697
1717
  /**
@@ -1874,6 +1894,7 @@ interface CompilerBuildResults {
1874
1894
  buildId: number;
1875
1895
  componentGraph?: BuildResultsComponentGraph;
1876
1896
  components: ComponentCompilerMeta[];
1897
+ cssOnlyComponents: ComponentCompilerMeta[];
1877
1898
  diagnostics: Diagnostic[];
1878
1899
  dirsAdded: string[];
1879
1900
  dirsDeleted: string[];
@@ -1890,6 +1911,15 @@ interface CompilerBuildResults {
1890
1911
  namespace: string;
1891
1912
  fsNamespace: string;
1892
1913
  outputs: BuildOutput[];
1914
+ /**
1915
+ * Absolute paths to every global stylesheet, in cascade order: each `global-style` output
1916
+ * target's compiled CSS in the order those targets are declared in `config.outputTargets` - or,
1917
+ * with none configured, the generated `{fsNamespace}.css` holding Stencil's auto-placed CSS (when
1918
+ * emitted). Unlike `outputs`, which groups files by type and sorts them alphabetically, this
1919
+ * preserves author-intended order for consumers like the dev-server's auto-generated component
1920
+ * preview.
1921
+ */
1922
+ globalStyleFiles: string[];
1893
1923
  rootDir: string;
1894
1924
  srcDir: string;
1895
1925
  timestamp: string;
@@ -1905,6 +1935,7 @@ interface HotModuleReplacement {
1905
1935
  componentsUpdated?: string[];
1906
1936
  excludeHmr?: string[];
1907
1937
  externalStylesUpdated?: string[];
1938
+ globalStylesUpdated?: HmrGlobalStyleUpdate[];
1908
1939
  imagesUpdated?: string[];
1909
1940
  indexHtmlUpdated?: boolean;
1910
1941
  inlineStylesUpdated?: HmrStyleUpdate[];
@@ -1919,6 +1950,15 @@ interface HmrStyleUpdate {
1919
1950
  styleTag: string;
1920
1951
  styleText: string;
1921
1952
  }
1953
+ /**
1954
+ * A live-reload update for a `global-style` output target's CSS. Applied on
1955
+ * the client by matching `fileName` against the `<link>` that loads it and
1956
+ * inserting/updating an adjacent `<style>` override
1957
+ */
1958
+ interface HmrGlobalStyleUpdate {
1959
+ fileName: string;
1960
+ styleText: string;
1961
+ }
1922
1962
  type BuildOnEventRemove = () => boolean;
1923
1963
  interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
1924
1964
  unsubscribeAll(): void;
@@ -2073,7 +2113,9 @@ interface CopyTask {
2073
2113
  /**
2074
2114
  * Additional glob patterns to exclude from the copy operation, merged with
2075
2115
  * the built-in defaults: `__mocks__`, `__fixtures__`, `dist`, hidden dirs,
2076
- * `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`.
2116
+ * `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`. For a directory
2117
+ * `src`, patterns match paths relative to that directory; an explicitly
2118
+ * named `src` file is never ignored.
2077
2119
  */
2078
2120
  ignore?: string[];
2079
2121
  /**
@@ -2311,7 +2353,7 @@ interface OutputTargetCollection extends OutputTargetBaseNext {
2311
2353
  * When `true` this flag will transform aliased import paths defined in
2312
2354
  * a project's `tsconfig.json` to relative import paths in the compiled output.
2313
2355
  *
2314
- * Paths will be left in aliased format if `false` or `undefined`.
2356
+ * Paths will be left in aliased format if `false`. Defaults to `true`.
2315
2357
  *
2316
2358
  * @example
2317
2359
  * // tsconfig.json
@@ -2413,11 +2455,11 @@ interface OutputTargetGlobalStyle extends OutputTargetBaseNext {
2413
2455
  * Controls whether this global stylesheet is injected into component shadow DOMs
2414
2456
  * as a constructable stylesheet at runtime.
2415
2457
  *
2416
- * - `'none'` (default): Don't inject - stylesheet must be loaded externally (e.g., via `<link>`)
2458
+ * - `'none'`: Don't inject - stylesheet must be loaded externally (e.g., via `<link>`)
2417
2459
  * - `'client'`: Inject only in client builds, not SSR (reduces SSR output size)
2418
2460
  * - `'all'`: Inject in both client and SSR builds
2419
2461
  *
2420
- * @default 'none'
2462
+ * @default 'client' when the stylesheet comes from `globalStyle` (or an auto-detected `src/global.*`), 'none' when `input` is set
2421
2463
  */
2422
2464
  inject?: 'none' | 'client' | 'all';
2423
2465
  }
@@ -2475,6 +2517,10 @@ interface OutputTargetSsr extends OutputTargetBase {
2475
2517
  */
2476
2518
  cjs?: boolean;
2477
2519
  }
2520
+ /**
2521
+ * Compiles the SSR hydrate app to a WASM plugin (via `extism-js`/QuickJS-ng) that can run
2522
+ * outside of Node
2523
+ */
2478
2524
  interface OutputTargetSsrWasm extends OutputTargetBase {
2479
2525
  type: 'ssr-wasm';
2480
2526
  /** Output directory. @default 'dist/ssr-wasm' */
@@ -2585,9 +2631,11 @@ interface OutputTargetDocsCustomElementsManifest extends OutputTargetBase {
2585
2631
  type: 'docs-custom-elements-manifest';
2586
2632
  /**
2587
2633
  * The file path where the custom-elements.json manifest will be written.
2588
- * Defaults to 'custom-elements.json' in the root directory.
2634
+ * Defaults to 'dist/custom-elements.json'.
2635
+ *
2636
+ * The `customElements` field of the project's `package.json` is set to this path.
2589
2637
  */
2590
- file: string;
2638
+ file?: string;
2591
2639
  strict?: boolean;
2592
2640
  }
2593
2641
  interface OutputTargetDocsCustom extends OutputTargetBase {
@@ -2612,7 +2660,7 @@ interface OutputTargetDocsAgentSkill extends OutputTargetBase {
2612
2660
  /**
2613
2661
  * The skill's name, used in the `SKILL.md` frontmatter.
2614
2662
  *
2615
- * Defaults to a kebab-cased form of {@link Config.namespace}.
2663
+ * Defaults to {@link Config.namespace}, lowercased, with anything other than letters and numbers replaced by `-`.
2616
2664
  */
2617
2665
  name?: string;
2618
2666
  /**
@@ -2675,10 +2723,8 @@ interface OutputTargetStandalone extends OutputTargetBaseNext {
2675
2723
  type: 'standalone';
2676
2724
  empty?: boolean;
2677
2725
  /**
2678
- * Triggers the following behaviors when enabled:
2679
- * 1. All `@stencil/core/*` module references are treated as external during bundling.
2680
- * 2. File names are not hashed.
2681
- * 3. File minification will follow the behavior defined at the root of the Stencil config.
2726
+ * When `true`, all `@stencil/core/*` module references are treated as external
2727
+ * during bundling rather than being included in the generated output.
2682
2728
  *
2683
2729
  * @default false
2684
2730
  */
@@ -2742,8 +2788,10 @@ interface OutputTargetBase {
2742
2788
  * This improves dev build times by not generating production-only artifacts.
2743
2789
  *
2744
2790
  * Defaults vary by output target type:
2745
- * - `loader-bundle`: `false` (always builds)
2746
- * - `standalone`: `true` (skips in dev)
2791
+ * - `loader-bundle`: `true` (skips the npm distribution files; the browser bundle always builds)
2792
+ * - `standalone`: `true` if `loader-bundle` is also configured, otherwise `false`
2793
+ * - `types`, `collection`, `ssr-wasm`: `true` (skips in dev)
2794
+ * - `assets`, `global-style`: `false` (always runs)
2747
2795
  * - `ssr`: `true` (skips in dev, unless `devServer.ssr` is enabled)
2748
2796
  * - `docs-*`: `true` (skips in dev)
2749
2797
  * - `custom`: `true` (skips in dev)
@@ -2913,10 +2961,6 @@ interface Diagnostic {
2913
2961
  relFilePath?: string | undefined;
2914
2962
  type: string;
2915
2963
  }
2916
- interface CacheStorage {
2917
- get(key: string): Promise<any>;
2918
- set(key: string, value: any): Promise<void>;
2919
- }
2920
2964
  /**
2921
2965
  * Input for CSS optimization functions, including the input CSS
2922
2966
  * string and a few boolean options which turn on or off various
@@ -2964,8 +3008,35 @@ interface LazyRequire {
2964
3008
  require(fromDir: string, moduleId: string): any;
2965
3009
  getModulePath(fromDir: string, moduleId: string): string;
2966
3010
  }
3011
+ /**
3012
+ * A Stencil `resolveId`/`load`/`transform` plugin, as accepted by {@link StencilConfig.plugins}.
3013
+ */
3014
+ interface Plugin$1 {
3015
+ name?: string;
3016
+ pluginType?: string;
3017
+ load?: (id: string, context: PluginCtx) => Promise<string> | string;
3018
+ resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
3019
+ transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults;
3020
+ }
3021
+ type PluginTransformResults = PluginTransformationDescriptor | string | null;
3022
+ interface PluginTransformationDescriptor {
3023
+ code?: string;
3024
+ map?: string;
3025
+ id?: string;
3026
+ diagnostics?: Diagnostic[];
3027
+ dependencies?: string[];
3028
+ }
3029
+ interface PluginCtx {
3030
+ config: Config;
3031
+ sys: CompilerSystem;
3032
+ fs: InMemoryFileSystem;
3033
+ cache: Cache;
3034
+ diagnostics: Diagnostic[];
3035
+ }
2967
3036
  //#endregion
2968
3037
  //#region src/declarations/stencil-private.d.ts
3038
+ /** Build-time virtual `@import`s a `global-style` input can use to place Stencil-generated CSS. */
3039
+ type StencilVirtualImport = 'stencil-hydrate' | 'stencil-component-globals' | 'stencil-css-components';
2969
3040
  interface SourceMap$1 {
2970
3041
  file: string;
2971
3042
  mappings: string;
@@ -2992,6 +3063,7 @@ interface BuildFeatures {
2992
3063
  shadowSlotAssignmentManual: boolean;
2993
3064
  shadowClonable: boolean;
2994
3065
  shadowSerializable: boolean;
3066
+ shadowReferenceTarget: boolean;
2995
3067
  scoped: boolean;
2996
3068
  /**
2997
3069
  * Every component has a render function
@@ -3104,6 +3176,7 @@ interface BuildCtx {
3104
3176
  esmComponentBundle: ReadonlyArray<BundleModule>;
3105
3177
  commonJsComponentBundle: ReadonlyArray<BundleModule>;
3106
3178
  components: ComponentCompilerMeta[];
3179
+ cssOnlyComponents: ComponentCompilerMeta[];
3107
3180
  componentGraph: Map<string, string[]>;
3108
3181
  config: ValidatedConfig;
3109
3182
  createTimeSpan(msg: string, debug?: boolean): LoggerTimeSpan;
@@ -3152,6 +3225,9 @@ interface BuildCtx {
3152
3225
  */
3153
3226
  stylesPromise: Promise<string>;
3154
3227
  stylesUpdated: BuildStyleUpdate[];
3228
+ globalStylesUpdated: BuildGlobalStyleLinkUpdate[];
3229
+ /** Absolute path of the generated `{fsNamespace}.css`, when this build emitted one */
3230
+ stencilCssFile?: string;
3155
3231
  timeSpan: LoggerTimeSpan;
3156
3232
  timestamp: string;
3157
3233
  transpileBuildCount: number;
@@ -3164,6 +3240,14 @@ interface BuildStyleUpdate {
3164
3240
  styleText: string;
3165
3241
  styleMode: string;
3166
3242
  }
3243
+ /**
3244
+ * A live-reload update for a `global-style` output target's CSS, matched on
3245
+ * the client by `fileName` against the `<link>`
3246
+ */
3247
+ interface BuildGlobalStyleLinkUpdate {
3248
+ fileName: string;
3249
+ styleText: string;
3250
+ }
3167
3251
  type BuildTask = any;
3168
3252
  interface CompilerBuildStats {
3169
3253
  timestamp: string;
@@ -3305,6 +3389,12 @@ interface CompilerCtx {
3305
3389
  cssModuleImports: Map<string, string[]>;
3306
3390
  /** Cache of built global styles, keyed by input file path */
3307
3391
  globalStyleCache: Map<string, string>;
3392
+ /** Cache of discovered CSS-only components from the last scan, keyed by absolute .css file path */
3393
+ cssOnlyComponentsCache: Map<string, ComponentCompilerMeta[]>;
3394
+ /** Contents of the last auto-placed `stencil-*` CSS, used to detect changes for HMR */
3395
+ stencilCss?: string;
3396
+ /** Virtual imports found in each built global style (post-preprocessing), keyed by input path */
3397
+ globalStyleVirtualImports: Map<string, Set<StencilVirtualImport>>;
3308
3398
  collections: CollectionCompilerMeta[];
3309
3399
  compilerOptions: any;
3310
3400
  events: BuildEvents;
@@ -3450,7 +3540,7 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
3450
3540
  * Custom states to initialize on the ElementInternals.states CustomStateSet.
3451
3541
  * These are defined via @AttachInternals({ states: {...} }).
3452
3542
  */
3453
- attachInternalsCustomStates: ComponentCompilerCustomState[];
3543
+ attachInternalsCustomStates: JsonDocsCustomState[];
3454
3544
  componentClassName: string;
3455
3545
  /**
3456
3546
  * A list of web component tag names that are either:
@@ -3511,6 +3601,11 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
3511
3601
  * using HTMLSlotElement.assign(). Only applicable when encapsulation is 'shadow'.
3512
3602
  */
3513
3603
  slotAssignment: 'manual' | null;
3604
+ /**
3605
+ * `id` of the element within the shadow root that IDREFs targeting the host resolve to.
3606
+ * Only applicable when encapsulation is 'shadow'.
3607
+ */
3608
+ shadowReferenceTarget: string | null;
3514
3609
  /**
3515
3610
  * Per-component slot patches for non-shadow DOM components.
3516
3611
  * These patches enable proper slot behavior without native Shadow DOM.
@@ -3520,7 +3615,7 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
3520
3615
  sourceFilePath: string;
3521
3616
  sourceMapPath: string;
3522
3617
  states: ComponentCompilerState[];
3523
- styleDocs: CompilerStyleDoc[];
3618
+ styleDocs: StyleDoc[];
3524
3619
  styles: StyleCompiler[];
3525
3620
  globalStyles: ComponentGlobalStyle[];
3526
3621
  tagName: string;
@@ -3723,20 +3818,6 @@ interface ComponentCompilerState {
3723
3818
  * Custom states are exposed via the ElementInternals.states CustomStateSet
3724
3819
  * and can be targeted with the CSS :state() pseudo-class.
3725
3820
  */
3726
- interface ComponentCompilerCustomState {
3727
- /**
3728
- * The name of the custom state (without dashes)
3729
- */
3730
- name: string;
3731
- /**
3732
- * The initial value of the state
3733
- */
3734
- initialValue: boolean;
3735
- /**
3736
- * Optional JSDoc description for the state
3737
- */
3738
- docs: string;
3739
- }
3740
3821
  /**
3741
3822
  * Representation of JSDoc that is pulled off a node in the AST
3742
3823
  */
@@ -3748,44 +3829,7 @@ interface CompilerJsDoc {
3748
3829
  /**
3749
3830
  * Tags included in the JSDoc
3750
3831
  */
3751
- tags: CompilerJsDocTagInfo[];
3752
- }
3753
- /**
3754
- * Representation of a tag that exists in a JSDoc
3755
- */
3756
- interface CompilerJsDocTagInfo {
3757
- /**
3758
- * The name of the tag - e.g. `@deprecated`
3759
- */
3760
- name: string;
3761
- /**
3762
- * Additional text that is associated with the tag - e.g. `@deprecated use v2 of this API`
3763
- */
3764
- text?: string;
3765
- }
3766
- /**
3767
- * The (internal) representation of a CSS block comment in a CSS, Sass, etc. file. This data structure is used during
3768
- * the initial compilation phases of Stencil, as a piece of {@link ComponentCompilerMeta}.
3769
- */
3770
- interface CompilerStyleDoc {
3771
- /**
3772
- * The name of the CSS property
3773
- */
3774
- name: string;
3775
- /**
3776
- * The user-defined description of the CSS property
3777
- */
3778
- docs: string;
3779
- /**
3780
- * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
3781
- * Used to inform Stencil where the start of a new property's description starts (and where the previous description
3782
- * ends).
3783
- */
3784
- annotation: 'prop';
3785
- /**
3786
- * The Stencil style-mode that is associated with this property.
3787
- */
3788
- mode: string;
3832
+ tags: JsonDocsTag[];
3789
3833
  }
3790
3834
  interface CompilerAssetDir {
3791
3835
  absolutePath?: string;
@@ -3816,6 +3860,8 @@ interface HostElement extends HTMLElement {
3816
3860
  host?: Element;
3817
3861
  forceUpdate?: () => void;
3818
3862
  __s_ghr?: () => HostRef;
3863
+ /** attaches the component's shadow root if it needs one and doesn't have one yet */
3864
+ __attachShadow?: () => void;
3819
3865
  /**
3820
3866
  * Unique stencil id for this element
3821
3867
  */
@@ -3954,28 +4000,6 @@ interface Module {
3954
4000
  hasVdomXlink: boolean;
3955
4001
  hasSignalsImport: boolean;
3956
4002
  }
3957
- interface Plugin$1 {
3958
- name?: string;
3959
- pluginType?: string;
3960
- load?: (id: string, context: PluginCtx) => Promise<string> | string;
3961
- resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
3962
- transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults;
3963
- }
3964
- type PluginTransformResults = PluginTransformationDescriptor | string | null;
3965
- interface PluginTransformationDescriptor {
3966
- code?: string;
3967
- map?: string;
3968
- id?: string;
3969
- diagnostics?: Diagnostic[];
3970
- dependencies?: string[];
3971
- }
3972
- interface PluginCtx {
3973
- config: Config;
3974
- sys: CompilerSystem;
3975
- fs: InMemoryFileSystem;
3976
- cache: Cache;
3977
- diagnostics: Diagnostic[];
3978
- }
3979
4003
  interface PrerenderUrlResults {
3980
4004
  anchorUrls: string[];
3981
4005
  diagnostics: Diagnostic[];
@@ -4259,6 +4283,10 @@ interface ComponentRuntimeMeta {
4259
4283
  * Information about which class members have attribute > prop deserializers attached on the component.
4260
4284
  */
4261
4285
  $deserializers$?: ComponentConstructorChangeHandlers;
4286
+ /**
4287
+ * `id` of the element within the shadow root that IDREFs targeting the host resolve to.
4288
+ */
4289
+ $referenceTarget$?: string;
4262
4290
  }
4263
4291
  /**
4264
4292
  * A mapping of the names of members on the component to some runtime-specific
@@ -4927,4 +4955,4 @@ declare const Host: {};
4927
4955
  //#region src/testing/platform/index.d.ts
4928
4956
  declare const setMode: (handler: (elm: any) => string | undefined | null) => void;
4929
4957
  //#endregion
4930
- export { Build, Env, Fragment, Host, Mixin, ReactiveControllerHost, type SpecPage, createEvent, createTestingSystem, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, h, mockCompilerSystem, mockComponentMeta, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, newSpecPage, readTask, registerHost, registerInstance, setAssetPath, setErrorHandler, setMode, setupConsoleMocker, shuffleArray, writeTask };
4958
+ export { Build, Env, Fragment, Host, Mixin, type NewSpecPageOptions, ReactiveControllerHost, type SpecPage, createEvent, createTestingSystem, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, h, mockCompilerSystem, mockComponentMeta, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, newSpecPage, readTask, registerHost, registerInstance, setAssetPath, setErrorHandler, setMode, setupConsoleMocker, shuffleArray, writeTask };