@stencil/core 5.0.0-next.0 → 5.0.0-rc.1

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 (58) hide show
  1. package/README.md +94 -0
  2. package/bin/stencil.mjs +1 -1
  3. package/dist/app-data/index.d.ts +2 -0
  4. package/dist/{runtime/app-data → app-data}/index.js +23 -15
  5. package/dist/{runtime/app-globals → app-globals}/index.js +1 -2
  6. package/dist/client-BMtGBEQV.mjs +2498 -0
  7. package/dist/compiler/browser.d.ts +1573 -0
  8. package/dist/compiler/browser.js +16998 -0
  9. package/dist/compiler/index.d.mts +284 -7
  10. package/dist/compiler/index.mjs +3 -9
  11. package/dist/compiler/utils/index.d.mts +272 -3
  12. package/dist/compiler/utils/index.mjs +4 -5
  13. package/dist/{transpile-CJQcQEVa.mjs → compiler-C_Y38j4m.mjs} +20984 -15554
  14. package/dist/declarations/stencil-ext-modules.d.ts +8 -8
  15. package/dist/declarations/stencil-public-compiler.d.ts +1016 -840
  16. package/dist/declarations/stencil-public-compiler.js +3 -5
  17. package/dist/declarations/stencil-public-docs.d.ts +441 -376
  18. package/dist/declarations/stencil-public-docs.js +0 -0
  19. package/dist/declarations/stencil-public-runtime.d.ts +361 -113
  20. package/dist/fragment-Di1hWOC8.mjs +4 -0
  21. package/dist/helpers-pTCZhNi0.mjs +529 -0
  22. package/dist/{index-szczUd2l.d.mts → index-CFiy6MZ3.d.mts} +1471 -2044
  23. package/dist/index-CViiWNQ9.d.mts +104 -0
  24. package/dist/{stencil-private-Cgcr414u.d.ts → index-XQHZl0MW.d.ts} +308 -114
  25. package/dist/index.d.mts +14 -2
  26. package/dist/index.mjs +171 -4
  27. package/dist/jsx-runtime.d.mts +24 -0
  28. package/dist/jsx-runtime.mjs +3 -0
  29. package/dist/mock-doc.mjs +2 -3
  30. package/dist/{node-sys-BGURUNOZ.mjs → node-Bkq8vRnu.mjs} +176 -197
  31. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  32. package/dist/{client-DR9zhmKG.mjs → runtime/client/lazy.js} +3794 -2659
  33. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +516 -227
  34. package/dist/runtime/client/{index.js → runtime.js} +3596 -2857
  35. package/dist/runtime/index.d.ts +90 -72
  36. package/dist/runtime/index.js +3528 -2897
  37. package/dist/runtime/server/index.d.mts +243 -219
  38. package/dist/runtime/server/index.mjs +3770 -3352
  39. package/dist/runtime/server/runner.d.mts +114 -47
  40. package/dist/runtime/server/runner.mjs +12710 -763
  41. package/dist/signals/index.d.ts +58 -0
  42. package/dist/signals/index.js +182 -0
  43. package/dist/sys/node/index.d.mts +1 -3
  44. package/dist/sys/node/index.mjs +2 -7
  45. package/dist/sys/node/worker.d.mts +1 -1
  46. package/dist/sys/node/worker.mjs +3 -12
  47. package/dist/testing/index.d.mts +4763 -12
  48. package/dist/testing/index.mjs +7945 -618
  49. package/dist/util-CP6-333M.mjs +731 -0
  50. package/dist/validation-C1mr0klL.mjs +825 -0
  51. package/package.json +91 -59
  52. package/dist/chunk-ClPoSABd.mjs +0 -21
  53. package/dist/index-Bxo2jCf6.d.mts +0 -77
  54. package/dist/runtime/app-data/index.d.ts +0 -30
  55. package/dist/serialize-BJvhE9aQ.mjs +0 -775
  56. package/dist/validation-BdcPruW_.mjs +0 -1451
  57. /package/{LICENSE.md → LICENSE} +0 -0
  58. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
@@ -1,16 +1,6 @@
1
1
  import { Diagnostic, Node as Node$1 } from "typescript";
2
- import { RollupError, SourceMap } from "rollup";
2
+ import { InputOptions, OutputOptions, Plugin, RolldownError, SourceMap } from "rolldown";
3
3
  import { Serializable } from "child_process";
4
-
5
- //#region src/utils/byte-size.d.ts
6
- /**
7
- * Used to learn the size of a string in bytes.
8
- *
9
- * @param str The string to measure
10
- * @returns number
11
- */
12
- declare const byteSize: (str: string) => number;
13
- //#endregion
14
4
  //#region src/utils/constants.d.ts
15
5
  declare const MEMBER_FLAGS: {
16
6
  readonly String: number;
@@ -44,10 +34,6 @@ declare const LISTENER_FLAGS: {
44
34
  readonly TargetDocument: number;
45
35
  readonly TargetWindow: number;
46
36
  readonly TargetBody: number;
47
- /**
48
- * @deprecated Prevented from new apps, but left in for older collections
49
- */
50
- readonly TargetParent: number;
51
37
  };
52
38
  declare const HOST_FLAGS: {
53
39
  readonly hasConnected: number;
@@ -60,6 +46,23 @@ declare const HOST_FLAGS: {
60
46
  readonly isWatchReady: number;
61
47
  readonly isListenReady: number;
62
48
  readonly needsRerender: number;
49
+ /**
50
+ * Set once this component's real (lazy-loaded) `connectedCallback` has fired for
51
+ * the first time. Lets a descendant skip creating/awaiting a connect-promise for
52
+ * an ancestor that's already connected. See {@link HostRef.$onFirstConnectResolve$}.
53
+ */
54
+ readonly hasFiredConnected: number;
55
+ /**
56
+ * Set when a lazy component's dynamic `import()` fails to resolve a
57
+ * constructor. Distinct from `hasInitializedComponent` being unset, which
58
+ * is true while an initialization attempt is merely queued/in-flight.
59
+ */
60
+ readonly hasFailedLoad: number;
61
+ /**
62
+ * Set while `renderVdom` patches the host, so writes of a serialized reflected value
63
+ * coming from the runtime's own reflection aren't applied back to the prop.
64
+ */
65
+ readonly isReflecting: number;
63
66
  readonly devOnRender: number;
64
67
  readonly devOnDidLoad: number;
65
68
  };
@@ -84,13 +87,6 @@ declare const CMP_FLAGS: {
84
87
  * Used to determine if a component does not use the shadow DOM _and_ has `<slot/>` tags in its markup.
85
88
  */
86
89
  readonly hasSlotRelocation: number;
87
- /**
88
- * Determines if a shim for the shadow DOM is necessary.
89
- *
90
- * The shim should only be needed if a component requires {@link shadowDomEncapsulation} and if any output
91
- * target-specific criteria are met. Refer to this flag's usage to determine each output target's criteria.
92
- */
93
- readonly needsShadowDomShim: number;
94
90
  /**
95
91
  * Determines if `delegatesFocus` is enabled for a component that uses the shadow DOM.
96
92
  * e.g. `shadow: { delegatesFocus: true }` is set on the `@Component()` decorator
@@ -101,10 +97,7 @@ declare const CMP_FLAGS: {
101
97
  */
102
98
  readonly hasMode: number;
103
99
  /**
104
- * Determines if styles must be scoped due to either:
105
- * 1. A component is using scoped stylesheets ({@link scopedCssEncapsulation})
106
- * 2. A component is using the shadow DOM _and_ the output target's rules for requiring a shadow DOM shim have been
107
- * met ({@link needsShadowDomShim})
100
+ * Determines if styles must be scoped - i.e. the component uses scoped stylesheets.
108
101
  */
109
102
  readonly needsScopedEncapsulation: number;
110
103
  /**
@@ -130,6 +123,42 @@ declare const CMP_FLAGS: {
130
123
  * e.g. `shadow: { slotAssignment: 'manual' }` is set on the `@Component()` decorator
131
124
  */
132
125
  readonly shadowSlotAssignmentManual: number;
126
+ /**
127
+ * Determines if the shadow DOM mode is 'closed'.
128
+ * e.g. `encapsulation: { type: 'shadow', mode: 'closed' }` is set on the `@Component()` decorator
129
+ */
130
+ readonly shadowModeClosed: number;
131
+ /**
132
+ * Determines if the component should patch child node accessors for slot handling.
133
+ * e.g. `encapsulation: { type: 'none', patches: ['children'] }`
134
+ */
135
+ readonly patchChildren: number;
136
+ /**
137
+ * Determines if the component should patch cloneNode() for slot handling.
138
+ * e.g. `encapsulation: { type: 'none', patches: ['clone'] }`
139
+ */
140
+ readonly patchClone: number;
141
+ /**
142
+ * Determines if the component should patch appendChild/insertBefore for slot handling.
143
+ * e.g. `encapsulation: { type: 'none', patches: ['insert'] }`
144
+ */
145
+ readonly patchInsert: number;
146
+ /**
147
+ * Determines if the component should apply all slot patches.
148
+ * e.g. `encapsulation: { type: 'none', patches: ['all'] }`
149
+ * Equivalent to the global `experimentalSlotFixes` config option.
150
+ */
151
+ readonly patchAll: number;
152
+ /**
153
+ * Determines if `clonable` is enabled for a component that uses the shadow DOM.
154
+ * e.g. `encapsulation: { type: 'shadow', clonable: true }` is set on the `@Component()` decorator
155
+ */
156
+ readonly shadowClonable: number;
157
+ /**
158
+ * Determines if `serializable` is enabled for a component that uses the shadow DOM.
159
+ * e.g. `encapsulation: { type: 'shadow', serializable: true }` is set on the `@Component()` decorator
160
+ */
161
+ readonly shadowSerializable: number;
133
162
  };
134
163
  /**
135
164
  * Default style mode id
@@ -145,6 +174,7 @@ declare const XLINK_NS = "http://www.w3.org/1999/xlink";
145
174
  * File names and value
146
175
  */
147
176
  declare const COLLECTION_MANIFEST_FILE_NAME = "collection-manifest.json";
177
+ declare const COLLECTION_APP_DATA_FILE_NAME = "app-data.js";
148
178
  /**
149
179
  * Constant for the 'copy' output target
150
180
  */
@@ -154,37 +184,54 @@ declare const COPY = "copy";
154
184
  */
155
185
  declare const CUSTOM = "custom";
156
186
  /**
157
- * Constant for the 'dist' output target
187
+ * Constant for the 'loader-bundle' output target
188
+ * (formerly 'dist' in v4)
158
189
  */
159
- declare const DIST = "dist";
190
+ declare const LOADER_BUNDLE = "loader-bundle";
160
191
  /**
161
- * Constant for the 'dist-collection' output target
192
+ * Constant for the 'standalone' output target
193
+ * (formerly 'dist-custom-elements' in v4)
162
194
  */
163
- declare const DIST_COLLECTION = "dist-collection";
195
+ declare const STANDALONE = "standalone";
164
196
  /**
165
- * Constant for the 'dist-custom-elements' output target
197
+ * Constant for the 'ssr' output target
198
+ * (formerly 'dist-hydrate-script' in v4)
166
199
  */
167
- declare const DIST_CUSTOM_ELEMENTS = "dist-custom-elements";
200
+ declare const SSR = "ssr";
168
201
  /**
169
- * Constant for the 'dist-types' output target
202
+ * Constant for the 'ssr-wasm' output target.
203
+ * Compiles the SSR script to a WASM binary via javy for use in any WASM-capable host
204
+ * (PHP, Java, Ruby, Go, etc.) without requiring a JavaScript runtime.
170
205
  */
171
- declare const DIST_TYPES = "dist-types";
206
+ declare const SSR_WASM = "ssr-wasm";
172
207
  /**
173
- * Constant for the 'dist-hydrate-script' output target
208
+ * Constant for the 'collection' output target
209
+ * (formerly 'dist-collection' sub-output in v4)
210
+ *
211
+ * Contains transpiled source + metadata for downstream Stencil projects
212
+ * to re-compile/bundle.
174
213
  */
175
- declare const DIST_HYDRATE_SCRIPT = "dist-hydrate-script";
214
+ declare const COLLECTION = "collection";
176
215
  /**
177
- * Constant for the 'dist-lazy' output target
216
+ * Constant for the 'types' output target
217
+ * (formerly 'dist-types' sub-output in v4)
178
218
  */
179
- declare const DIST_LAZY = "dist-lazy";
219
+ declare const TYPES = "types";
220
+ /**
221
+ * Constant for the 'global-style' output target
222
+ * Outputs global styles to a unified location available to all distributions.
223
+ */
224
+ declare const GLOBAL_STYLE = "global-style";
180
225
  /**
181
- * Constant for the 'dist-lazy-loader' output target
226
+ * Constant for the 'assets' output target
227
+ * Copies component assetsDirs to a unified location available to all distributions.
182
228
  */
183
- declare const DIST_LAZY_LOADER = "dist-lazy-loader";
229
+ declare const ASSETS = "assets";
184
230
  /**
185
- * Constant for the 'dist-global-styles' output target
231
+ * Internal constant for the 'dist-lazy' output target
232
+ * (used by loader-bundle and www)
186
233
  */
187
- declare const DIST_GLOBAL_STYLES = "dist-global-styles";
234
+ declare const DIST_LAZY = "dist-lazy";
188
235
  /**
189
236
  * Constant for the 'docs-custom' output target
190
237
  */
@@ -205,6 +252,10 @@ declare const DOCS_VSCODE = "docs-vscode";
205
252
  * Constant for the 'docs-custom-elements-manifest' output target
206
253
  */
207
254
  declare const DOCS_CUSTOM_ELEMENTS_MANIFEST = "docs-custom-elements-manifest";
255
+ /**
256
+ * Constant for the 'docs-agent-skill' output target
257
+ */
258
+ declare const DOCS_AGENT_SKILL = "docs-agent-skill";
208
259
  /**
209
260
  * Constant for the 'stats' output target
210
261
  */
@@ -216,13 +267,14 @@ declare const WWW = "www";
216
267
  /**
217
268
  * Valid output targets to specify in a Stencil config.
218
269
  *
219
- * Note that there are some output targets (e.g. `DIST_TYPES`) which are
220
- * programmatically set as output targets by the compiler when other output
221
- * targets (in that case `DIST`) are set, but which are _not_ supported in a
222
- * Stencil config. This is enforced in the output target validation code.
270
+ * Note that some internal output targets (e.g. `DIST_LAZY`, `DIST_GLOBAL_STYLES`)
271
+ * are programmatically created by the compiler and are not user-configurable.
272
+ *
273
+ * In v5, `TYPES` and `COLLECTION` are auto-generated in production builds unless explicitly configured.
223
274
  */
224
- declare const VALID_CONFIG_OUTPUT_TARGETS: readonly ["www", "dist", "dist-collection", "dist-custom-elements", "dist-lazy", "dist-hydrate-script", "docs-json", "docs-readme", "docs-vscode", "docs-custom", "docs-custom-elements-manifest", "copy", "custom", "stats"];
275
+ declare const VALID_CONFIG_OUTPUT_TARGETS: readonly ["www", "loader-bundle", "standalone", "ssr", "ssr-wasm", "collection", "types", "global-style", "assets", "dist", "dist-custom-elements", "dist-hydrate-script", "dist-collection", "dist-types", "docs-json", "docs-readme", "docs-vscode", "docs-custom", "docs-custom-elements-manifest", "docs-agent-skill", "copy", "custom", "stats"];
225
276
  declare const GENERATED_DTS = "components.d.ts";
277
+ declare const STYLE_EXT: string[];
226
278
  /**
227
279
  * DOM Node types
228
280
  *
@@ -247,42 +299,6 @@ declare const NODE_TYPES: {
247
299
  readonly DOCUMENT_FRAGMENT_NODE: 11;
248
300
  readonly NOTATION_NODE: 12;
249
301
  };
250
- /**
251
- * Represents a primitive type.
252
- * Described in https://w3c.github.io/webdriver-bidi/#type-script-PrimitiveProtocolValue.
253
- */
254
- declare const PrimitiveType: {
255
- readonly Undefined: "undefined";
256
- readonly Null: "null";
257
- readonly String: "string";
258
- readonly Number: "number";
259
- readonly SpecialNumber: "number";
260
- readonly Boolean: "boolean";
261
- readonly BigInt: "bigint";
262
- };
263
- type PrimitiveTypeValue = (typeof PrimitiveType)[keyof typeof PrimitiveType];
264
- /**
265
- * Represents a non-primitive type.
266
- * Described in https://w3c.github.io/webdriver-bidi/#type-script-RemoteValue.
267
- * @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead.
268
- */
269
- declare const NonPrimitiveType: {
270
- readonly Array: "array";
271
- readonly Date: "date";
272
- readonly Map: "map";
273
- readonly Object: "object";
274
- readonly RegularExpression: "regexp";
275
- readonly Set: "set";
276
- readonly Channel: "channel";
277
- readonly Symbol: "symbol";
278
- };
279
- type NonPrimitiveTypeValue = (typeof NonPrimitiveType)[keyof typeof NonPrimitiveType];
280
- /** @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead. */
281
- declare const TYPE_CONSTANT = "type";
282
- /** @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead. */
283
- declare const VALUE_CONSTANT = "value";
284
- /** @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead. */
285
- declare const SERIALIZED_PREFIX = "serialized:";
286
302
  //#endregion
287
303
  //#region src/utils/format-component-runtime-meta.d.ts
288
304
  declare const formatLazyBundleRuntimeMeta: (bundleId: any, cmps: ComponentCompilerMeta[]) => LazyBundleRuntimeData;
@@ -297,339 +313,9 @@ declare const formatLazyBundleRuntimeMeta: (bundleId: any, cmps: ComponentCompil
297
313
  declare const formatComponentRuntimeMeta: (compilerMeta: ComponentCompilerMeta, includeMethods: boolean) => ComponentRuntimeMetaCompact;
298
314
  declare const stringifyRuntimeData: (data: any) => string;
299
315
  //#endregion
300
- //#region src/utils/helpers.d.ts
301
- declare const isDef: (v: any) => boolean;
302
- /**
303
- * Convert a string from PascalCase to dash-case
304
- *
305
- * @param str the string to convert
306
- * @returns a converted string
307
- */
308
- declare const toDashCase: (str: string) => string;
309
- /**
310
- * Convert a string from dash-case / kebab-case to PascalCase (or CamelCase,
311
- * or whatever you call it!)
312
- *
313
- * @param str a string to convert
314
- * @returns a converted string
315
- */
316
- declare const dashToPascalCase: (str: string) => string;
317
- /**
318
- * Convert a string to 'camelCase'
319
- *
320
- * @param str the string to convert
321
- * @returns the converted string
322
- */
323
- declare const toCamelCase: (str: string) => string;
324
- /**
325
- * Capitalize the first letter of a string
326
- *
327
- * @param str the string to capitalize
328
- * @returns a capitalized string
329
- */
330
- declare const toTitleCase: (str: string) => string;
331
- /**
332
- * Escapes all occurrences of a specified pattern in a string.
333
- * @description This function replaces all matches of a given pattern in the input text with a specified replacement string.
334
- * It can handle both string and regular expression patterns and allows toggling between global and single-match replacements.
335
- * @param {string} text - The input string to process.
336
- * @param {RegExp | string} pattern - The pattern to search for in the input string. Can be a regular expression or a string.
337
- * @param {string} replacement - The string to replace each match with.
338
- * @param {boolean} [replaceAll=true] - Whether to replace all occurrences (`true`) or just the first occurrence (`false`). Defaults to `true`.
339
- * @returns {string} The processed string with the replacements applied.
340
- * @example
341
- * @see src\utils\util.ts
342
- */
343
- declare const escapeWithPattern: (text: string, pattern: RegExp | string, replacement: string, replaceAll?: boolean) => string;
344
- /**
345
- * This is just a no-op, don't expect it to do anything.
346
- */
347
- declare const noop: () => any;
348
- /**
349
- * Check whether a value is a 'complex type', defined here as an object or a
350
- * function.
351
- *
352
- * @param o the value to check
353
- * @returns whether it's a complex type or not
354
- */
355
- declare const isComplexType: (o: unknown) => boolean;
356
- /**
357
- * Sort an array without mutating it in-place (as `Array.prototype.sort`
358
- * unfortunately does)
359
- *
360
- * @param array the array you'd like to sort
361
- * @param prop a function for deriving sortable values (strings or numbers)
362
- * from array members
363
- * @returns a new array of all items `x` in `array` ordered by `prop(x)`
364
- */
365
- declare const sortBy: <T>(array: T[], prop: (item: T) => string | number) => T[];
366
- /**
367
- * A polyfill of sorts for `Array.prototype.flat` which will return the result
368
- * of calling that method if present and, if not, return an equivalent based on
369
- * `Array.prototype.reduce`.
370
- *
371
- * @param array the array to flatten (one level)
372
- * @returns a flattened array
373
- */
374
- declare const flatOne: <T>(array: T[][]) => T[];
375
- /**
376
- * Deduplicate an array, retaining items at the earliest position in which
377
- * they appear.
378
- *
379
- * So `unique([1,3,2,1,1,4])` would be `[1,3,2,4]`.
380
- *
381
- * @param array the array to deduplicate
382
- * @param predicate an optional function used to generate the key used to
383
- * determine uniqueness
384
- * @returns a new, deduplicated array
385
- */
386
- declare const unique: <T, K>(array: T[], predicate?: (item: T) => K) => T[];
387
- /**
388
- * Merge elements of an array into an existing array, using a predicate to
389
- * determine uniqueness and only adding elements when they are not present in
390
- * the first array.
391
- *
392
- * **Note**: this mutates the target array! This is intentional to avoid
393
- * unnecessary array allocation, but be sure that it's what you want!
394
- *
395
- * @param target the target array, to which new unique items should be added
396
- * @param newItems a list of new items, some (or all!) of which may be added
397
- * @param mergeWith a predicate function which reduces the items in `target`
398
- * and `newItems` to a value which can be equated with `===` for the purposes
399
- * of determining uniqueness
400
- */
401
- declare function mergeIntoWith<T1, T2>(target: T1[], newItems: T1[], mergeWith: (item: T1) => T2): void;
402
- /**
403
- * A utility for building an object from an iterable very similar to
404
- * `Object.fromEntries`
405
- *
406
- * @param entries an iterable object holding entries (key-value tuples) to
407
- * plop into a new object
408
- * @returns an object containing those entries
409
- */
410
- declare const fromEntries: <V>(entries: IterableIterator<[string, V]>) => Record<string, V>;
411
- /**
412
- * Based on a given object, create a new object which has only the specified
413
- * key-value pairs included in it.
414
- *
415
- * @param obj the object from which to take values
416
- * @param keys a set of keys to take
417
- * @returns an object mapping `key` to `obj[key]` if `obj[key]` is truthy for
418
- * every `key` in `keys`
419
- */
420
- declare const pluck: (obj: {
421
- [key: string]: any;
422
- }, keys: string[]) => {
423
- [key: string]: any;
424
- };
425
- declare const isBoolean: (v: any) => v is boolean;
426
- declare const isFunction: (v: any) => v is Function;
427
- declare const isNumber: (v: any) => v is number;
428
- declare const isObject: (val: Object) => val is Object;
429
- declare const isString: (v: any) => v is string;
430
- declare const isIterable: <T>(v: any) => v is Iterable<T>;
431
- //#endregion
432
- //#region src/utils/is-glob.d.ts
433
- /**
434
- * Check if a string is a glob pattern (e.g. 'src/*.js' or something like that)
435
- *
436
- * @param str a string to check
437
- * @returns whether the string is a glob pattern or not
438
- */
439
- declare const isGlob: (str: string) => boolean;
440
- //#endregion
441
- //#region src/utils/is-root-path.d.ts
442
- /**
443
- * Checks if the path is the Operating System (OS) root path, such as "/" or "C:\". This function does not take the OS
444
- * the code is running on into account when performing this evaluation.
445
- * @param p the path to check
446
- * @returns `true` if the path is an OS root path, `false` otherwise
447
- */
448
- declare const isRootPath: (p: string) => boolean;
449
- //#endregion
450
- //#region src/utils/types.d.ts
451
- type Serializeable = string | number | boolean | unknown;
452
- type LocalValueParam = Serializeable | Serializeable[] | [Serializeable, Serializeable][];
453
- type ScriptLocalValue = ScriptPrimitiveProtocolValue | ScriptArrayLocalValue | ScriptDateLocalValue | ScriptSymbolValue | ScriptMapLocalValue | ScriptObjectLocalValue | ScriptRegExpLocalValue | ScriptSetLocalValue;
454
- type ScriptListLocalValue = ScriptLocalValue[];
455
- interface ScriptArrayLocalValue {
456
- type: 'array';
457
- value: ScriptListLocalValue;
458
- }
459
- interface ScriptDateLocalValue {
460
- type: 'date';
461
- value: string;
462
- }
463
- type ScriptMappingLocalValue = (ScriptLocalValue | ScriptLocalValue)[];
464
- interface ScriptMapLocalValue {
465
- type: 'map';
466
- value: ScriptMappingLocalValue;
467
- }
468
- interface ScriptObjectLocalValue {
469
- type: 'object';
470
- value: ScriptMappingLocalValue;
471
- }
472
- interface ScriptRegExpValue {
473
- pattern: string;
474
- flags?: string;
475
- }
476
- interface ScriptRegExpLocalValue {
477
- type: 'regexp';
478
- value: ScriptRegExpValue;
479
- }
480
- interface ScriptSetLocalValue {
481
- type: 'set';
482
- value: ScriptListLocalValue;
483
- }
484
- type ScriptPreloadScript = string;
485
- type ScriptRealm = string;
486
- type ScriptPrimitiveProtocolValue = ScriptUndefinedValue | ScriptNullValue | ScriptStringValue | ScriptNumberValue | ScriptBooleanValue | ScriptBigIntValue;
487
- interface ScriptUndefinedValue {
488
- type: 'undefined';
489
- }
490
- interface ScriptNullValue {
491
- type: 'null';
492
- }
493
- interface ScriptStringValue {
494
- type: 'string';
495
- value: string;
496
- }
497
- interface ScriptSymbolValue {
498
- type: 'symbol';
499
- value: string;
500
- }
501
- type ScriptSpecialNumber = 'NaN' | '-0' | 'Infinity' | '-Infinity';
502
- interface ScriptNumberValue {
503
- type: 'number';
504
- value: number | ScriptSpecialNumber;
505
- }
506
- interface ScriptBooleanValue {
507
- type: 'boolean';
508
- value: boolean;
509
- }
510
- interface ScriptBigIntValue {
511
- type: 'bigint';
512
- value: string;
513
- }
514
- //#endregion
515
- //#region src/utils/local-value.d.ts
516
- /**
517
- * Represents a local value with a specified type and optional value.
518
- * Described in https://w3c.github.io/webdriver-bidi/#type-script-LocalValue
519
- * @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead.
520
- */
521
- declare class LocalValue {
522
- type: PrimitiveTypeValue | NonPrimitiveTypeValue;
523
- value?: Serializeable | Serializeable[] | [Serializeable, Serializeable][];
524
- constructor(type: PrimitiveTypeValue | NonPrimitiveTypeValue, value?: LocalValueParam);
525
- /**
526
- * Creates a new LocalValue object with a string value.
527
- *
528
- * @param {string} value - The string value to be stored in the LocalValue object.
529
- * @returns {LocalValue} - The created LocalValue object.
530
- */
531
- static createStringValue(value: string): LocalValue;
532
- /**
533
- * Creates a new LocalValue object with a number value.
534
- *
535
- * @param {number} value - The number value.
536
- * @returns {LocalValue} - The created LocalValue object.
537
- */
538
- static createNumberValue(value: number): LocalValue;
539
- /**
540
- * Creates a new LocalValue object with a special number value.
541
- *
542
- * @param {number} value - The value of the special number.
543
- * @returns {LocalValue} - The created LocalValue object.
544
- */
545
- static createSpecialNumberValue(value: number): LocalValue;
546
- /**
547
- * Creates a new LocalValue object with an undefined value.
548
- * @returns {LocalValue} - The created LocalValue object.
549
- */
550
- static createUndefinedValue(): LocalValue;
551
- /**
552
- * Creates a new LocalValue object with a null value.
553
- * @returns {LocalValue} - The created LocalValue object.
554
- */
555
- static createNullValue(): LocalValue;
556
- /**
557
- * Creates a new LocalValue object with a boolean value.
558
- *
559
- * @param {boolean} value - The boolean value.
560
- * @returns {LocalValue} - The created LocalValue object.
561
- */
562
- static createBooleanValue(value: boolean): LocalValue;
563
- /**
564
- * Creates a new LocalValue object with a BigInt value.
565
- *
566
- * @param {BigInt} value - The BigInt value.
567
- * @returns {LocalValue} - The created LocalValue object.
568
- */
569
- static createBigIntValue(value: bigint): LocalValue;
570
- /**
571
- * Creates a new LocalValue object with an array.
572
- *
573
- * @param {Array} value - The array.
574
- * @returns {LocalValue} - The created LocalValue object.
575
- */
576
- static createArrayValue(value: Array<unknown>): LocalValue;
577
- /**
578
- * Creates a new LocalValue object with date value.
579
- *
580
- * @param {string} value - The date.
581
- * @returns {LocalValue} - The created LocalValue object.
582
- */
583
- static createDateValue(value: Date): LocalValue;
584
- /**
585
- * Creates a new LocalValue object of map value.
586
- * @param {Map} map - The map.
587
- * @returns {LocalValue} - The created LocalValue object.
588
- */
589
- static createMapValue(map: Map<unknown, unknown>): LocalValue;
590
- /**
591
- * Creates a new LocalValue object from the passed object.
592
- *
593
- * @param object the object to create a LocalValue from
594
- * @returns {LocalValue} - The created LocalValue object.
595
- */
596
- static createObjectValue(object: Record<string | number | symbol, unknown>): LocalValue;
597
- /**
598
- * Creates a new LocalValue object of regular expression value.
599
- *
600
- * @param {string} value - The value of the regular expression.
601
- * @returns {LocalValue} - The created LocalValue object.
602
- */
603
- static createRegularExpressionValue(value: {
604
- pattern: string;
605
- flags: string;
606
- }): LocalValue;
607
- /**
608
- * Creates a new LocalValue object with the specified value.
609
- * @param {Set} value - The value to be set.
610
- * @returns {LocalValue} - The created LocalValue object.
611
- */
612
- static createSetValue(value: ([unknown, unknown] | LocalValue)[]): LocalValue;
613
- /**
614
- * Creates a new LocalValue object with the given channel value
615
- *
616
- * @param {ChannelValue} value - The channel value.
617
- * @returns {LocalValue} - The created LocalValue object.
618
- */
619
- static createChannelValue(value: unknown): LocalValue;
620
- /**
621
- * Creates a new LocalValue object with a Symbol value.
622
- *
623
- * @param {Symbol} symbol - The Symbol value
624
- * @returns {LocalValue} - The created LocalValue object
625
- */
626
- static createSymbolValue(symbol: Symbol): LocalValue;
627
- static getArgument(argument: unknown): LocalValue;
628
- asMap(): ScriptLocalValue;
629
- }
630
- //#endregion
631
- //#region src/utils/logger/logger-rollup.d.ts
632
- declare const loadRollupDiagnostics: (config: ValidatedConfig, compilerCtx: CompilerCtx, buildCtx: BuildCtx, rollupError: RollupError) => void;
316
+ //#region src/utils/logger/logger-rolldown.d.ts
317
+ declare const isRolldownError: (e: unknown) => e is RolldownError;
318
+ declare const loadRolldownDiagnostics: (config: ValidatedConfig, compilerCtx: CompilerCtx, buildCtx: BuildCtx, rolldownError: RolldownError) => void;
633
319
  declare const createOnWarnFn: (diagnostics: Diagnostic$1[], bundleModulesFiles?: Module[]) => (warning: {
634
320
  code?: string;
635
321
  importer?: string;
@@ -648,6 +334,12 @@ declare const augmentDiagnosticWithNode: (d: Diagnostic$1, node: Node$1) => Diag
648
334
  * Ok, so formatting overkill, we know. But whatever, it makes for great
649
335
  * error reporting within a terminal. So, yeah, let's code it up, shall we?
650
336
  */
337
+ /**
338
+ * Convert an array of TypeScript diagnostics to Stencil diagnostic format.
339
+ *
340
+ * @param tsDiagnostics - array of TypeScript diagnostic objects
341
+ * @returns array of Stencil diagnostic objects
342
+ */
651
343
  declare const loadTypeScriptDiagnostics: (tsDiagnostics: readonly Diagnostic[]) => Diagnostic$1[];
652
344
  /**
653
345
  * Convert a TypeScript diagnostic object into our internal, Stencil-specific
@@ -707,7 +399,8 @@ declare const buildWarn: (diagnostics: Diagnostic$1[]) => Diagnostic$1;
707
399
  * @param jsonFilePath the path to the JSON file where the error occurred
708
400
  * @param msg the error message
709
401
  * @param jsonField the key for the field which caused the error, used for finding
710
- * the error line in the original JSON file
402
+ * the error line in the original JSON file. Only root-level keys (with minimal
403
+ * indentation, typically 2 spaces) are highlighted to avoid matching nested keys.
711
404
  * @returns a reference to the newly-created diagnostic
712
405
  */
713
406
  declare const buildJsonFileError: (compilerCtx: CompilerCtx, diagnostics: Diagnostic$1[], jsonFilePath: string, msg: string, jsonField: string) => Diagnostic$1;
@@ -761,39 +454,39 @@ declare const filterExcludedComponents: (components: ComponentCompilerMeta[], co
761
454
  declare const relativeImport: (pathFrom: string, pathTo: string, ext?: string, addPrefix?: boolean) => string;
762
455
  declare const getComponentsDtsSrcFilePath: (config: ValidatedConfig) => string;
763
456
  /**
764
- * Helper to get an appropriate file path for `components.d.ts` for a `"dist"`
765
- * or `"dist-types"` output target.
457
+ * Helper to get an appropriate file path for `components.d.ts` for an output target.
766
458
  *
767
- * @param outputTarget the output target of interest
459
+ * @param typesDir the directory where types are generated
768
460
  * @returns a properly-formatted path
769
461
  */
770
- declare const getComponentsDtsTypesFilePath: (outputTarget: Required<OutputTargetDist> | OutputTargetDistTypes) => string;
771
- declare const isOutputTargetDist: (o: OutputTarget) => o is OutputTargetDist;
772
- declare const isOutputTargetDistCollection: (o: OutputTarget) => o is OutputTargetDistCollection;
773
- declare const isOutputTargetDistCustomElements: (o: OutputTarget) => o is OutputTargetDistCustomElements;
462
+ declare const getComponentsDtsTypesFilePath: (typesDir: string) => string;
463
+ declare const isOutputTargetLoaderBundle: (o: OutputTarget) => o is OutputTargetLoaderBundle;
464
+ declare const isOutputTargetStandalone: (o: OutputTarget) => o is OutputTargetStandalone;
465
+ declare const isOutputTargetSsr: (o: OutputTarget) => o is OutputTargetSsr;
466
+ declare const isOutputTargetSsrWasm: (o: OutputTarget) => o is OutputTargetSsrWasm;
467
+ /**
468
+ * Whether an output target renders components on the server (`ssr` or `ssr-wasm`).
469
+ * When one is present, client builds must be able to hydrate server-rendered markup.
470
+ * @param o the output target to check
471
+ * @returns true if the output target server-renders components
472
+ */
473
+ declare const isOutputTargetServerRenderer: (o: OutputTarget) => o is OutputTargetSsr | OutputTargetSsrWasm;
474
+ declare const isOutputTargetCollection: (o: OutputTarget) => o is OutputTargetCollection;
475
+ declare const isOutputTargetTypes: (o: OutputTarget) => o is OutputTargetTypes;
476
+ declare const isOutputTargetGlobalStyle: (o: OutputTarget) => o is OutputTargetGlobalStyle;
477
+ declare const isOutputTargetAssets: (o: OutputTarget) => o is OutputTargetAssets;
774
478
  declare const isOutputTargetCopy: (o: OutputTarget) => o is OutputTargetCopy;
775
479
  declare const isOutputTargetDistLazy: (o: OutputTarget) => o is OutputTargetDistLazy;
776
- declare const isOutputTargetDistLazyLoader: (o: OutputTarget) => o is OutputTargetDistLazyLoader;
777
- declare const isOutputTargetDistGlobalStyles: (o: OutputTarget) => o is OutputTargetDistGlobalStyles;
778
- declare const isOutputTargetHydrate: (o: OutputTarget) => o is OutputTargetHydrate;
779
480
  declare const isOutputTargetCustom: (o: OutputTarget) => o is OutputTargetCustom;
780
- declare const isOutputTargetDocs: (o: OutputTarget) => o is OutputTargetDocsJson | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustom | OutputTargetDocsCustomElementsManifest;
481
+ declare const isOutputTargetDocs: (o: OutputTarget) => o is OutputTargetDocsJson | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustom | OutputTargetDocsCustomElementsManifest | OutputTargetDocsAgentSkill;
781
482
  declare const isOutputTargetDocsReadme: (o: OutputTarget) => o is OutputTargetDocsReadme;
782
483
  declare const isOutputTargetDocsJson: (o: OutputTarget) => o is OutputTargetDocsJson;
783
484
  declare const isOutputTargetDocsCustom: (o: OutputTarget) => o is OutputTargetDocsCustom;
784
485
  declare const isOutputTargetDocsVscode: (o: OutputTarget) => o is OutputTargetDocsVscode;
785
486
  declare const isOutputTargetDocsCustomElementsManifest: (o: OutputTarget) => o is OutputTargetDocsCustomElementsManifest;
487
+ declare const isOutputTargetDocsAgentSkill: (o: OutputTarget) => o is OutputTargetDocsAgentSkill;
786
488
  declare const isOutputTargetWww: (o: OutputTarget) => o is OutputTargetWww;
787
489
  declare const isOutputTargetStats: (o: OutputTarget) => o is OutputTargetStats;
788
- declare const isOutputTargetDistTypes: (o: OutputTarget) => o is OutputTargetDistTypes;
789
- /**
790
- * Checks whether or not the supplied output target's type matches one of the eligible primary
791
- * package output target types (i.e. it can have `isPrimaryPackageOutputTarget: true` in its config).
792
- *
793
- * @param o The output target to check.
794
- * @returns Whether the output target type is one of the "primary" output targets.
795
- */
796
- declare const isEligiblePrimaryPackageOutputTarget: (o: OutputTarget) => o is EligiblePrimaryPackageOutputTarget;
797
490
  /**
798
491
  * Retrieve the Stencil component compiler metadata from a collection of Stencil {@link d.Module}s
799
492
  * @param moduleFiles the collection of `Module`s to retrieve the metadata from
@@ -808,129 +501,16 @@ type ValidConfigOutputTarget = (typeof VALID_CONFIG_OUTPUT_TARGETS)[number];
808
501
  * @returns whether or not the targetType is a valid, configurable output target.
809
502
  */
810
503
  declare function isValidConfigOutputTarget(targetType: string): targetType is ValidConfigOutputTarget;
811
- //#endregion
812
- //#region src/utils/path.d.ts
813
- /**
814
- * Convert Windows backslash paths to slash paths: foo\\bar ➔ foo/bar
815
- * Forward-slash paths can be used in Windows as long as they're not
816
- * extended-length paths and don't contain any non-ascii characters.
817
- * This was created since the path methods in Node.js outputs \\ paths on Windows.
818
- * @param path the Windows-based path to convert
819
- * @param relativize whether or not a relative path should have `./` prepended
820
- * @returns the converted path
821
- */
822
- declare const normalizePath: (path: string, relativize?: boolean) => string;
823
- /**
824
- * Same as normalizePath(), expect it'll also strip any query strings
825
- * from the path name. So /dir/file.css?tag=cmp-a becomes /dir/file.css
826
- * @param p the path to normalize
827
- * @returns the normalized path, sans any query strings
828
- */
829
- declare const normalizeFsPath: (p: string) => string;
830
- declare const normalizeFsPathQuery: (importPath: string) => {
831
- filePath: string;
832
- ext: string;
833
- format: string;
834
- };
835
- /**
836
- * A wrapped version of node.js' {@link path.relative} which adds our custom
837
- * normalization logic. This solves the relative path between `from` and `to`!
838
- *
839
- * The calculation of the returned path follows that of Node's logic, with one exception - if the calculated path
840
- * results in an empty string, a string of length one with a period (`'.'`) is returned.
841
- *
842
- * @throws the underlying node.js function can throw if either path is not a
843
- * string
844
- * @param from the path where relative resolution starts
845
- * @param to the destination path
846
- * @returns the resolved relative path
847
- */
848
- declare function relative(from: string, to: string): string;
849
- /**
850
- * A wrapped version of node.js' {@link path.join} which adds our custom
851
- * normalization logic. This joins all the arguments (path fragments) into a
852
- * single path.
853
- *
854
- * The calculation of the returned path follows that of Node's logic, with one exception - any trailing slashes will
855
- * be removed from the calculated path.
856
- *
857
- * @throws the underlying node function will throw if any argument is not a
858
- * string
859
- * @param paths the paths to join together
860
- * @returns a joined path!
861
- */
862
- declare function join(...paths: string[]): string;
863
- /**
864
- * A wrapped version of node.js' {@link path.resolve} which adds our custom
865
- * normalization logic. This resolves a path to a given (relative or absolute)
866
- * path.
867
- *
868
- * @throws the underlying node function will throw if any argument is not a
869
- * string
870
- * @param paths a path or path fragments to resolve
871
- * @returns a resolved path!
872
- */
873
- declare function resolve(...paths: string[]): string;
874
- /**
875
- * A wrapped version of node.js' {@link path.normalize} which adds our custom
876
- * normalization logic. This normalizes a path, de-duping repeated segment
877
- * separators and resolving `'..'` segments.
878
- *
879
- * @throws the underlying node function will throw if the argument is not a
880
- * string
881
- * @param toNormalize a path to normalize
882
- * @returns a normalized path!
883
- */
884
- declare function normalize(toNormalize: string): string;
885
- //#endregion
886
- //#region src/utils/query-nonce-meta-tag-content.d.ts
887
- /**
888
- * Helper method for querying a `meta` tag that contains a nonce value
889
- * out of a DOM's head.
890
- *
891
- * @param doc The DOM containing the `head` to query against
892
- * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
893
- * exists or the tag has no content.
894
- */
895
- declare function queryNonceMetaTagContent(doc: Document): string | undefined;
896
- //#endregion
897
- //#region src/utils/regular-expression.d.ts
898
504
  /**
899
- * Utility function that will escape all regular expression special characters in a string.
505
+ * Filter output targets based on devMode and their skipInDev setting.
506
+ * In dev mode, targets with `skipInDev: true` are filtered out.
507
+ * In prod mode, all targets are included.
900
508
  *
901
- * @param text The string potentially containing special characters.
902
- * @returns The string with all special characters escaped.
903
- */
904
- declare const escapeRegExpSpecialCharacters: (text: string) => string;
905
- //#endregion
906
- //#region src/utils/remote-value.d.ts
907
- /**
908
- * RemoteValue class for deserializing LocalValue serialized objects back into their original form
909
- * @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead.
509
+ * @param targets Array of output targets to filter
510
+ * @param devMode Whether we're in dev mode
511
+ * @returns Filtered array of active targets
910
512
  */
911
- declare class RemoteValue {
912
- /**
913
- * Deserializes a LocalValue serialized object back to its original JavaScript representation
914
- *
915
- * @param serialized The serialized LocalValue object
916
- * @returns The original JavaScript value/object
917
- */
918
- static fromLocalValue(serialized: ScriptLocalValue): any;
919
- /**
920
- * Utility method to deserialize multiple LocalValues at once
921
- *
922
- * @param serializedValues Array of serialized LocalValue objects
923
- * @returns Array of deserialized JavaScript values
924
- */
925
- static fromLocalValueArray(serializedValues: ScriptLocalValue[]): any[];
926
- /**
927
- * Verifies if the given object matches the structure of a serialized LocalValue
928
- *
929
- * @param obj Object to verify
930
- * @returns boolean indicating if the object has LocalValue structure
931
- */
932
- static isLocalValueObject(obj: any): boolean;
933
- }
513
+ declare const filterActiveTargets: <T extends OutputTarget>(targets: T[], devMode: boolean) => T[];
934
514
  declare namespace result_d_exports {
935
515
  export { Result, err, map, ok, unwrap, unwrapErr };
936
516
  }
@@ -1046,31 +626,15 @@ declare const unwrap: <T, E>(result: Result<T, E>) => T;
1046
626
  */
1047
627
  declare const unwrapErr: <T, E>(result: Result<T, E>) => E;
1048
628
  //#endregion
1049
- //#region src/utils/serialize.d.ts
1050
- /**
1051
- * Serialize a value to a string that can be deserialized later.
1052
- * @param {unknown} value - The value to serialize.
1053
- * @returns {string} A string that can be deserialized later.
1054
- * @deprecated will be removed in v5. Use `@PropSerialize()` decorator instead.
1055
- */
1056
- declare function serializeProperty(value: unknown): string | number | boolean;
1057
- /**
1058
- * Deserialize a value from a string that was serialized earlier.
1059
- * @param {string} value - The string to deserialize.
1060
- * @returns {unknown} The deserialized value.
1061
- * @deprecated will be removed in v5. Use `@AttrDeserialize()` decorator instead.
1062
- */
1063
- declare function deserializeProperty(value: string): any;
1064
- //#endregion
1065
629
  //#region src/utils/sourcemaps.d.ts
1066
630
  /**
1067
- * Converts a rollup provided source map to one that Stencil can easily understand
1068
- * @param rollupSourceMap the sourcemap to transform
631
+ * Converts a rolldown provided source map to one that Stencil can easily understand
632
+ * @param rolldownSourceMap the sourcemap to transform
1069
633
  * @returns the transformed sourcemap
1070
634
  */
1071
- declare function rollupToStencilSourceMap(rollupSourceMap: null): null;
1072
- declare function rollupToStencilSourceMap(rollupSourceMap: undefined): null;
1073
- declare function rollupToStencilSourceMap(rollupSourceMap: SourceMap): SourceMap$1;
635
+ declare function rolldownToStencilSourceMap(rolldownSourceMap: null): null;
636
+ declare function rolldownToStencilSourceMap(rolldownSourceMap: undefined): null;
637
+ declare function rolldownToStencilSourceMap(rolldownSourceMap: SourceMap): SourceMap$1;
1074
638
  /**
1075
639
  * Generates a string used to link generated code with the original source, to be placed at the end of the generated
1076
640
  * code.
@@ -1092,18 +656,25 @@ declare const getInlineSourceMappingUrlLinker: (sourceMapContents: string) => st
1092
656
  * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}=<url>.map, prepended with a newline
1093
657
  */
1094
658
  declare const getSourceMappingUrlForEndOfFile: (url: string) => string;
1095
- //#endregion
1096
- //#region src/utils/url-paths.d.ts
1097
659
  /**
1098
- * Determines whether a string should be considered a remote url or not.
660
+ * Rolldown source map output options. Stencil appends its own `sourceMappingURL` comment, so the map
661
+ * is `hidden`. A chunk can be written to several directories, so `sources` are made absolute here
662
+ * (query strings stripped) and relative to each destination by {@link relativizeSourceMap}.
663
+ * Virtual modules have no file and keep their id.
1099
664
  *
1100
- * This helper only checks the provided string to evaluate is one of a few pre-defined schemes, and should not be
1101
- * considered all-encompassing
665
+ * @param config the validated Stencil configuration
666
+ * @returns the source map options to spread into Rolldown's output options
667
+ */
668
+ declare const getRolldownSourceMapOptions: (config: ValidatedConfig) => Pick<OutputOptions, "sourcemap" | "sourcemapPathTransform">;
669
+ /**
670
+ * Makes a source map's absolute `sources` relative to where the map is written, and names the
671
+ * file it maps.
1102
672
  *
1103
- * @param p the string to evaluate
1104
- * @returns `true` if the provided string is a remote url, `false` otherwise
673
+ * @param sourceMap the source map, with absolute `sources` from {@link getRolldownSourceMapOptions}
674
+ * @param filePath the path the mapped `.js` file is written to
675
+ * @returns the source map to write next to `filePath`
1105
676
  */
1106
- declare const isRemoteUrl: (p: string) => boolean;
677
+ declare const relativizeSourceMap: (sourceMap: SourceMap$1, filePath: string) => SourceMap$1;
1107
678
  //#endregion
1108
679
  //#region src/utils/util.d.ts
1109
680
  /**
@@ -1203,6 +774,21 @@ declare const parsePackageJson: (pkgJsonStr: string, pkgJsonFilePath: string) =>
1203
774
  declare const readOnlyArrayHasStringMember: <T extends string>(readOnlyArray: ReadonlyArray<T>, maybeMember: T | string) => maybeMember is T;
1204
775
  //#endregion
1205
776
  //#region src/utils/validation.d.ts
777
+ /**
778
+ * The result of an invalid `modes` check on a component's `styleUrls`/`styles`.
779
+ */
780
+ interface ModeValidationError {
781
+ propName: 'styleUrls' | 'styles';
782
+ message: string;
783
+ }
784
+ /**
785
+ * Validates the mode keys used in a component's `styleUrls`/`styles` against a
786
+ * `config.modes` allowlist, if one is declared.
787
+ * @param configModes the `config.modes` allowlist (mixed string/{@link d.ModeConfig} entries)
788
+ * @param componentOptions the `@Component()` decorator options for a single component
789
+ * @returns a validation error if a used mode is unknown or a required mode is missing, undefined otherwise
790
+ */
791
+ declare const validateComponentModes: (configModes: (string | ModeConfig)[] | undefined, componentOptions: Pick<ComponentOptions, "styleUrls" | "styles">) => ModeValidationError | undefined;
1206
792
  /**
1207
793
  * Validates that a component tag meets required naming conventions to be used for a web component
1208
794
  * @param tag the tag to validate
@@ -1385,10 +971,6 @@ declare const createInMemoryFs: (sys: CompilerSystem) => {
1385
971
  * `[ source, destination ]`
1386
972
  */
1387
973
  type FileCopyTuple = [string, string];
1388
- /**
1389
- * Collected instructions for all pending filesystem operations saved
1390
- * to the in-memory filesystem.
1391
- */
1392
974
  /**
1393
975
  * Results from committing pending filesystem operations
1394
976
  */
@@ -1399,14 +981,6 @@ interface FsCommitResults {
1399
981
  dirsDeleted: string[];
1400
982
  dirsAdded: string[];
1401
983
  }
1402
- /**
1403
- * Given the current state of the in-memory proxy filesystem, collect all of
1404
- * the changes that need to be made in order to commit the currently-pending
1405
- * operations (e.g. write, copy, delete) to the OS filesystem.
1406
- *
1407
- * @param items the storage data structure for the in-memory FS cache
1408
- * @returns a collection of all the operations that need to be done
1409
- */
1410
984
  //#endregion
1411
985
  //#region src/declarations/stencil-public-docs.d.ts
1412
986
  /**
@@ -1429,6 +1003,13 @@ interface JsonDocs {
1429
1003
  * The metadata for the JSDocs for each component in a Stencil project
1430
1004
  */
1431
1005
  components: JsonDocsComponent[];
1006
+ /**
1007
+ * Project-level usage content, collected from markdown files in a `usage`
1008
+ * directory at the project's {@link Config.srcDir} root (as opposed to
1009
+ * per-component usage content, which lives in {@link JsonDocsComponent.usage}).
1010
+ * Keyed by file name (without extension), same shape as component usage.
1011
+ */
1012
+ usage?: JsonDocsUsage;
1432
1013
  /**
1433
1014
  * The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
1434
1015
  */
@@ -1561,6 +1142,11 @@ interface JsonDocsComponent {
1561
1142
  * A deprecation reason/description found following a `@deprecated` tag
1562
1143
  */
1563
1144
  deprecation?: string;
1145
+ /**
1146
+ * `true` if this is a "CSS-only component"
1147
+ * discovered in .css file via `@component`-marked JSDoc block
1148
+ */
1149
+ cssOnly?: boolean;
1564
1150
  }
1565
1151
  interface JsonDocsDependencyGraph {
1566
1152
  [tagName: string]: string[];
@@ -1720,6 +1306,16 @@ interface JsonDocsStyle {
1720
1306
  * The annotation used in the JSDoc of the style (e.g. `@prop`)
1721
1307
  */
1722
1308
  annotation: string;
1309
+ /**
1310
+ * The CSS `syntax` descriptor for a custom property, if it was registered via a native
1311
+ * `@property` at-rule (e.g. `"<length>"`).
1312
+ */
1313
+ syntax?: string;
1314
+ /**
1315
+ * The `initial-value` descriptor for a custom property, if it was registered via a native
1316
+ * `@property` at-rule.
1317
+ */
1318
+ default?: string;
1723
1319
  /**
1724
1320
  * The mode associated with the style
1725
1321
  */
@@ -1806,62 +1402,250 @@ interface StyleDoc {
1806
1402
  * The Stencil style-mode that is associated with this property.
1807
1403
  */
1808
1404
  mode: string | undefined;
1405
+ /**
1406
+ * The CSS `syntax` descriptor, if this property was registered via a native `@property` at-rule.
1407
+ */
1408
+ syntax?: string;
1409
+ /**
1410
+ * The `initial-value` descriptor, if this property was registered via a native `@property` at-rule.
1411
+ */
1412
+ default?: string;
1809
1413
  }
1810
1414
  //#endregion
1811
1415
  //#region src/declarations/stencil-public-runtime.d.ts
1812
- type ListenTargetOptions = 'body' | 'document' | 'window';
1813
- interface UserBuildConditionals {
1814
- isDev: boolean;
1815
- isBrowser: boolean;
1816
- isServer: boolean;
1817
- isTesting: boolean;
1818
- }
1819
- type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
1820
- type ErrorHandler = (err: any, element?: HTMLElement) => void;
1821
- interface ComponentInterface {
1822
- connectedCallback?(): void;
1823
- disconnectedCallback?(): void;
1824
- componentWillRender?(): Promise<void> | void;
1825
- componentDidRender?(): void;
1416
+ interface ComponentOptions {
1826
1417
  /**
1827
- * The component is about to load and it has not
1828
- * rendered yet.
1829
- *
1830
- * This is the best place to make any data updates
1831
- * before the first render.
1418
+ * Tag name of the web component. Ideally, the tag name must be globally unique,
1419
+ * so it's recommended to choose an unique prefix for all your components within the same collection.
1832
1420
  *
1833
- * componentWillLoad will only be called once.
1421
+ * In addition, tag name must contain a '-'
1834
1422
  */
1835
- componentWillLoad?(): Promise<void> | void;
1423
+ tag: string;
1836
1424
  /**
1837
- * The component has loaded and has already rendered.
1425
+ * Encapsulation strategy for the component. Determines how styles and DOM are isolated.
1838
1426
  *
1839
- * Updating data in this method will cause the
1840
- * component to re-render.
1427
+ * @example
1428
+ * ```tsx
1429
+ * // Shadow DOM (recommended for isolation)
1430
+ * encapsulation: { type: 'shadow' }
1431
+ * encapsulation: { type: 'shadow', mode: 'closed', delegatesFocus: true }
1841
1432
  *
1842
- * componentDidLoad will only be called once.
1843
- */
1844
- componentDidLoad?(): void;
1845
- /**
1846
- * A `@Prop` or `@State` property changed and a rerender is about to be requested.
1433
+ * // Scoped styles (class-based isolation without Shadow DOM)
1434
+ * encapsulation: { type: 'scoped' }
1847
1435
  *
1848
- * Called multiple times throughout the life of
1849
- * the component as its properties change.
1436
+ * // No encapsulation (light DOM)
1437
+ * encapsulation: { type: 'none' }
1438
+ * encapsulation: { type: 'none', patches: ['all'] } // with slot patches
1439
+ * ```
1850
1440
  *
1851
- * componentShouldUpdate is not called on the first render.
1441
+ * If not specified, defaults to `{ type: 'none' }` (no encapsulation).
1852
1442
  */
1853
- componentShouldUpdate?(newVal: any, oldVal: any, propName: string): boolean | void;
1443
+ encapsulation?: EncapsulationOptions;
1854
1444
  /**
1855
- * The component is about to update and re-render.
1856
- *
1857
- * Called multiple times throughout the life of
1858
- * the component as it updates.
1859
- *
1860
- * componentWillUpdate is not called on the first render.
1445
+ * Relative URL to some external stylesheet file. It should be a `.css` file unless some
1446
+ * external plugin is installed like `@stencil/sass`.
1861
1447
  */
1862
- componentWillUpdate?(): Promise<void> | void;
1448
+ styleUrl?: string;
1863
1449
  /**
1864
- * The component has just re-rendered.
1450
+ * Similar as `styleUrl` but allows to specify different stylesheets for different modes.
1451
+ */
1452
+ styleUrls?: string[] | ModeStyles;
1453
+ /**
1454
+ * String that contains inlined CSS instead of using an external stylesheet.
1455
+ * The performance characteristics of this feature are the same as using an external stylesheet.
1456
+ *
1457
+ * Notice, you can't use sass, or less, only `css` is allowed using `styles`, use `styleUrl` is you need more advanced features.
1458
+ */
1459
+ styles?: string | {
1460
+ [modeName: string]: any;
1461
+ };
1462
+ /**
1463
+ * Array of relative links to folders of assets required by the component.
1464
+ */
1465
+ assetsDirs?: string[];
1466
+ /**
1467
+ * Relative URL to an external stylesheet providing document-level styles for this component.
1468
+ * Unlike `styleUrl`, these styles are not scoped to shadow/scoped DOM - they are collected
1469
+ * at build time and injected wherever `@import "stencil-component-globals"` appears in a global stylesheet.
1470
+ *
1471
+ * Useful for
1472
+ * - pre-first-js-render styles (combatting cumulative layout shift)
1473
+ * - host element and slotted content style
1474
+ * - 'css-only' CEs - those that don't use a JS runtime at all
1475
+ *
1476
+ * @example
1477
+ * ```tsx
1478
+ * @Component({ tag: 'my-button', globalStyleUrl: './my-button.global.css' })
1479
+ * ```
1480
+ */
1481
+ globalStyleUrl?: string;
1482
+ /**
1483
+ * Inline CSS string providing document-level styles for this component.
1484
+ * Collected at build time and injected wherever `@import "stencil-component-globals"` appears.
1485
+ * @see globalStyleUrl
1486
+ */
1487
+ globalStyle?: string;
1488
+ }
1489
+ /**
1490
+ * Shadow DOM encapsulation options for the `encapsulation` property.
1491
+ * Uses native Shadow DOM for style and DOM isolation.
1492
+ */
1493
+ interface ShadowEncapsulation {
1494
+ type: 'shadow';
1495
+ /**
1496
+ * The mode of the shadow root. Defaults to `'open'`.
1497
+ * - `'open'`: The shadow root is accessible via `element.shadowRoot`
1498
+ * - `'closed'`: The shadow root is not accessible via `element.shadowRoot`
1499
+ */
1500
+ mode?: 'open' | 'closed';
1501
+ /**
1502
+ * When set to `true`, specifies behavior that mitigates custom element issues
1503
+ * around focusability. When a non-focusable part of the shadow DOM is clicked, the first
1504
+ * focusable part is given focus, and the shadow host is given any available `:focus` styling.
1505
+ */
1506
+ delegatesFocus?: boolean;
1507
+ /**
1508
+ * Sets the slot assignment mode for the shadow root. When set to `'manual'`, enables imperative
1509
+ * slotting using the `HTMLSlotElement.assign()` method. Defaults to `'named'` for standard
1510
+ * declarative slotting behavior.
1511
+ */
1512
+ slotAssignment?: 'manual' | 'named';
1513
+ /**
1514
+ * When set to `true`, the shadow root is preserved when the host element is deep-cloned via
1515
+ * `Node.cloneNode(true)`. Without this, cloning a shadow host produces an empty shell.
1516
+ */
1517
+ clonable?: boolean;
1518
+ /**
1519
+ * When set to `true`, marks the shadow root as serializable so it is included when the host
1520
+ * element is serialized via `Element.getHTML({ serializableShadowRoots: true })`.
1521
+ */
1522
+ serializable?: boolean;
1523
+ /**
1524
+ * The `id` of an element inside the shadow root that IDREF attributes pointing at the host
1525
+ * (e.g. `<label for>`, `aria-labelledby`, `aria-describedby`) should resolve to instead.
1526
+ * Lets a label or ARIA relationship outside the component target an internal element.
1527
+ *
1528
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/referenceTarget
1529
+ */
1530
+ referenceTarget?: string;
1531
+ }
1532
+ /**
1533
+ * Patch types for non-shadow DOM components that use slots.
1534
+ * - `'all'`: Apply all slot-related patches (equivalent to `lightDomPatches: true`)
1535
+ * - `'children'`: Patch child node accessors (children, firstChild, lastChild, etc.)
1536
+ * - `'clone'`: Patch `cloneNode()` to handle slotted content
1537
+ * - `'insert'`: Patch `appendChild()`, `insertBefore()`, etc. for slot relocation
1538
+ */
1539
+ type SlotPatch = 'all' | 'children' | 'clone' | 'insert';
1540
+ /**
1541
+ * No encapsulation - component renders to light DOM with optional slot patches.
1542
+ */
1543
+ interface NoneEncapsulation {
1544
+ type: 'none';
1545
+ /**
1546
+ * Patches to apply for slot handling in light DOM.
1547
+ * Only relevant if the component uses `<slot>` elements.
1548
+ */
1549
+ patches?: SlotPatch[];
1550
+ }
1551
+ /**
1552
+ * Scoped CSS encapsulation - styles are scoped via class names without Shadow DOM.
1553
+ */
1554
+ interface ScopedEncapsulation {
1555
+ type: 'scoped';
1556
+ /**
1557
+ * Patches to apply for slot handling with scoped styles.
1558
+ * Only relevant if the component uses `<slot>` elements.
1559
+ */
1560
+ patches?: SlotPatch[];
1561
+ }
1562
+ /**
1563
+ * Encapsulation options for the `@Component()` decorator.
1564
+ * Determines how styles and DOM are isolated for the component.
1565
+ */
1566
+ type EncapsulationOptions = ShadowEncapsulation | NoneEncapsulation | ScopedEncapsulation;
1567
+ interface ModeStyles {
1568
+ [modeName: string]: string | string[];
1569
+ }
1570
+ type ListenTargetOptions = 'body' | 'document' | 'window';
1571
+ interface UserBuildConditionals {
1572
+ isDev: boolean;
1573
+ isBrowser: boolean;
1574
+ isServer: boolean;
1575
+ isTesting: boolean;
1576
+ }
1577
+ type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
1578
+ type ErrorHandler = (err: any, element?: HTMLElement) => void;
1579
+ type TagTransformer = (tag: string) => string;
1580
+ /**
1581
+ * A constructor type that can be used as the base for mixin factories.
1582
+ *
1583
+ * ```ts
1584
+ * import { MixedInCtor } from '@stencil/core';
1585
+ *
1586
+ * const AFactoryFn = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
1587
+ * ```
1588
+ */
1589
+ type MixedInCtor<T = {}> = new (...args: any[]) => T;
1590
+ /**
1591
+ * A map of `@Prop`/`@State` property names to their new and previous
1592
+ * values, passed to `componentShouldUpdate` once per render cycle.
1593
+ *
1594
+ * Pass `this` as `T` to type `changes` against your component's own
1595
+ * members, e.g. `componentShouldUpdate(changes: ComponentShouldUpdateChanges<this>)`.
1596
+ */
1597
+ type ComponentShouldUpdateChanges<T = any> = { [K in Extract<keyof T, string>]?: {
1598
+ newVal: T[K];
1599
+ oldVal: T[K];
1600
+ }; };
1601
+ interface ComponentInterface {
1602
+ connectedCallback?(): void;
1603
+ disconnectedCallback?(): void;
1604
+ componentWillRender?(): Promise<void> | void;
1605
+ componentDidRender?(): void;
1606
+ /**
1607
+ * The component is about to load and it has not
1608
+ * rendered yet.
1609
+ *
1610
+ * This is the best place to make any data updates
1611
+ * before the first render.
1612
+ *
1613
+ * componentWillLoad will only be called once.
1614
+ */
1615
+ componentWillLoad?(): Promise<void> | void;
1616
+ /**
1617
+ * The component has loaded and has already rendered.
1618
+ *
1619
+ * Updating data in this method will cause the
1620
+ * component to re-render.
1621
+ *
1622
+ * componentDidLoad will only be called once.
1623
+ */
1624
+ componentDidLoad?(): void;
1625
+ /**
1626
+ * One or more `@Prop` or `@State` properties changed and a rerender is
1627
+ * about to be requested. `changes` contains every property that changed
1628
+ * since the last render, keyed by property name.
1629
+ *
1630
+ * Called once per render cycle, batching all properties that changed
1631
+ * synchronously since the last render.
1632
+ *
1633
+ * Return `false` to prevent the pending render.
1634
+ *
1635
+ * componentShouldUpdate is not called on the first render.
1636
+ */
1637
+ componentShouldUpdate?(changes: ComponentShouldUpdateChanges<this>): boolean | void;
1638
+ /**
1639
+ * The component is about to update and re-render.
1640
+ *
1641
+ * Called multiple times throughout the life of
1642
+ * the component as it updates.
1643
+ *
1644
+ * componentWillUpdate is not called on the first render.
1645
+ */
1646
+ componentWillUpdate?(): Promise<void> | void;
1647
+ /**
1648
+ * The component has just re-rendered.
1865
1649
  *
1866
1650
  * Called multiple times throughout the life of
1867
1651
  * the component as it updates.
@@ -1873,6 +1657,36 @@ interface ComponentInterface {
1873
1657
  render?(): any;
1874
1658
  [memberName: string]: any;
1875
1659
  }
1660
+ /**
1661
+ * A reusable behavior that hooks into a `ReactiveControllerHost`'s lifecycle. Modeled after Lit's
1662
+ * `ReactiveController` pattern: implement the hooks you need, then register an instance with a host
1663
+ * via `host.addController(this)`.
1664
+ */
1665
+ interface ReactiveController {
1666
+ hostConnected?(): void;
1667
+ hostDisconnected?(): void;
1668
+ hostWillLoad?(): Promise<void> | void;
1669
+ hostDidLoad?(): void;
1670
+ hostWillRender?(): Promise<void> | void;
1671
+ hostDidRender?(): void;
1672
+ hostWillUpdate?(): Promise<void> | void;
1673
+ hostDidUpdate?(): void;
1674
+ }
1675
+ /**
1676
+ * The shape added to a component by mixing in `ReactiveControllerHost` (see below).
1677
+ */
1678
+ interface ReactiveControllerHostInterface extends ComponentInterface, HTMLElement {
1679
+ readonly controllers: ReadonlySet<ReactiveController>;
1680
+ addController(controller: ReactiveController): void;
1681
+ removeController(controller: ReactiveController): void;
1682
+ requestUpdate(): void;
1683
+ /**
1684
+ * Resolves once the next pending render commits. Matches the shape of Lit's
1685
+ * `ReactiveControllerHost.updateComplete`, for interop with controllers written against Lit's API
1686
+ * (e.g. `@lit/context`).
1687
+ */
1688
+ readonly updateComplete: Promise<boolean>;
1689
+ }
1876
1690
  interface RafCallback {
1877
1691
  (timeStamp: number): void;
1878
1692
  }
@@ -1917,7 +1731,7 @@ interface FunctionalUtilities {
1917
1731
  map: (children: VNode[], cb: (vnode: ChildNode$1, index: number, array: ChildNode$1[]) => ChildNode$1) => VNode[];
1918
1732
  }
1919
1733
  interface FunctionalComponent<T = {}> {
1920
- (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[] | null;
1734
+ (props: T, children: VNode[], utils: FunctionalUtilities): VNode | null;
1921
1735
  }
1922
1736
  /**
1923
1737
  * A Child VDOM node
@@ -1928,7 +1742,7 @@ interface FunctionalComponent<T = {}> {
1928
1742
  * {@link FunctionalUtilities}).
1929
1743
  */
1930
1744
  interface ChildNode$1 {
1931
- vtag?: string | number | Function;
1745
+ vtag?: string | number | Function | symbol | null;
1932
1746
  vkey?: string | number;
1933
1747
  vtext?: string;
1934
1748
  vchildren?: VNode[];
@@ -1940,13 +1754,15 @@ interface ChildNode$1 {
1940
1754
  */
1941
1755
  interface VNode {
1942
1756
  $flags$: number;
1943
- $tag$: string | number | Function;
1757
+ $tag$: string | number | Function | symbol | null;
1944
1758
  $elm$: any;
1945
1759
  $text$: string;
1946
1760
  $children$: VNode[];
1947
1761
  $attrs$?: any;
1948
1762
  $name$?: string;
1949
1763
  $key$?: string | number;
1764
+ /** Signal reference for vdom bypass: signal text nodes store the signal here. */
1765
+ $signal$?: any;
1950
1766
  }
1951
1767
  //#endregion
1952
1768
  //#region src/declarations/stencil-public-compiler.d.ts
@@ -2034,19 +1850,14 @@ interface StencilConfig {
2034
1850
  */
2035
1851
  generateExportMaps?: boolean;
2036
1852
  /**
2037
- * When the hashFileNames config is set to true, and it is a production build,
2038
- * the hashedFileNameLength config is used to determine how many characters the file name's hash should be.
2039
- */
2040
- hashedFileNameLength?: number;
2041
- /**
2042
- * During production builds, the content of each generated file is hashed to represent the content,
2043
- * and the hashed value is used as the filename. If the content isn't updated between builds,
2044
- * then it receives the same filename. When the content is updated, then the filename is different.
1853
+ * Set to `false` to disable discovery of "CSS-only components" - pure-CSS custom-element
1854
+ * definitions marked with a `@component` JSDoc tag in `.css` files under `srcDir`. No JS
1855
+ * class, never registered via `customElements.define()` - just a documented,
1856
+ * type-checked tag name and its CSS custom properties/attribute variants.
2045
1857
  *
2046
- * By doing this, deployed apps can "forever-cache" the build directory and take full advantage of
2047
- * content delivery networks (CDNs) and heavily caching files for faster apps.
1858
+ * Defaults to `true`.
2048
1859
  */
2049
- hashFileNames?: boolean;
1860
+ enableCssOnlyComponents?: boolean;
2050
1861
  /**
2051
1862
  * The namespace config is a string representing a namespace for the app.
2052
1863
  * For apps that are not meant to be a library of reusable components,
@@ -2063,11 +1874,12 @@ interface StencilConfig {
2063
1874
  */
2064
1875
  outputTargets?: OutputTarget[];
2065
1876
  /**
2066
- * The plugins config can be used to add your own rollup plugins.
2067
- * By default, Stencil does not come with Sass or PostCSS support.
1877
+ * The plugins config can be used to add your own rolldown plugins, or Stencil's own
1878
+ * legacy `resolveId`/`load`/`transform` style plugins (identified by a `pluginType`
1879
+ * property). By default, Stencil does not come with Sass or PostCSS support.
2068
1880
  * However, either can be added using the plugin array.
2069
1881
  */
2070
- plugins?: any[];
1882
+ plugins?: (Plugin$1 | Plugin)[];
2071
1883
  /**
2072
1884
  * Generate js source map files for all bundles.
2073
1885
  * Set to `true` to always generate source maps, `false` to never generate source maps.
@@ -2088,65 +1900,51 @@ interface StencilConfig {
2088
1900
  */
2089
1901
  transformAliasedImportPaths?: boolean;
2090
1902
  /**
2091
- * When `true`, Stencil will suppress diagnostics which warn about public members using reserved names
2092
- * (for example, decorating a method named `focus` with `@Method()`). Defaults to `false`.
2093
- */
2094
- suppressReservedPublicNameWarnings?: boolean;
2095
- /**
2096
- * When `true`, we will validate a project's `package.json` based on the output target the user has designated
2097
- * as `isPrimaryPackageOutputTarget: true` in their Stencil config.
2098
- */
2099
- validatePrimaryPackageOutputTarget?: boolean;
2100
- /**
2101
- * Passes custom configuration down to the "@rollup/plugin-commonjs" that Stencil uses under the hood.
2102
- * For further information: https://stenciljs.com/docs/module-bundling
2103
- */
2104
- commonjs?: BundlingConfig;
2105
- /**
2106
- * Passes custom configuration down to the "@rollup/plugin-node-resolve" that Stencil uses under the hood.
1903
+ * Passes custom configuration to Rolldown's module resolution (its `resolve` option), e.g. `alias`.
2107
1904
  * For further information: https://stenciljs.com/docs/module-bundling
2108
1905
  */
2109
1906
  nodeResolve?: NodeResolveConfig;
2110
1907
  /**
2111
- * Passes custom configuration down to rollup itself, not all rollup options can be overridden.
2112
- */
2113
- rollupConfig?: RollupConfig;
2114
- /**
2115
- * Sets if the ES5 build should be generated or not. Stencil generates a modern build without ES5,
2116
- * whereas this setting to `true` will also create es5 builds for both dev and prod modes. Setting
2117
- * `buildEs5` to `prod` will only build ES5 in prod mode. Basically if the app does not need to run
2118
- * on legacy browsers (IE11 and Edge 18 and below), it's safe to not build ES5, which will also speed
2119
- * up build times. Defaults to `false`.
1908
+ * Passes custom configuration down to rolldown itself, not all rolldown options can be overridden.
2120
1909
  */
2121
- buildEs5?: boolean | 'prod';
1910
+ rolldownConfig?: RolldownConfig;
2122
1911
  /**
2123
- * Sets if the JS browser files are minified or not. Stencil uses `terser` under the hood.
1912
+ * Sets if the JS browser files are minified or not.
2124
1913
  * Defaults to `false` in dev mode and `true` in production mode.
2125
1914
  */
2126
1915
  minifyJs?: boolean;
1916
+ /**
1917
+ * Which minifier to use for JS output when `minifyJs` is enabled.
1918
+ *
1919
+ * - `oxc`: built into rolldown. Much faster than terser. Output may be slightly larger.
1920
+ * - `terser`: slower, but currently produces the smallest output.
1921
+ *
1922
+ * Defaults to `oxc`.
1923
+ */
1924
+ jsMinifier?: 'terser' | 'oxc';
2127
1925
  /**
2128
1926
  * Sets if the CSS is minified or not.
2129
1927
  * Defaults to `false` in dev mode and `true` in production mode.
2130
1928
  */
2131
1929
  minifyCss?: boolean;
2132
- /**
2133
- * Forces Stencil to run in `dev` mode if the value is `true` and `production` mode
2134
- * if it's `false`.
2135
- *
2136
- * Defaults to `false` (ie. production) unless the `--dev` flag is used in the CLI.
2137
- */
2138
- devMode?: boolean;
2139
1930
  /**
2140
1931
  * Object to provide a custom logger. By default a `logger` is already provided for the
2141
1932
  * platform the compiler is running on, such as NodeJS or a browser.
2142
1933
  */
2143
1934
  logger?: Logger;
2144
1935
  /**
2145
- * Config to add extra runtime for DOM features that require more polyfills. Note
2146
- * that not all DOM APIs are fully polyfilled when using the slot polyfill. These
2147
- * are opt-in since not all users will require the additional runtime.
1936
+ * Compatibility and workaround flags for framework/bundler edge cases
1937
+ * and rarely-needed diagnostic suppressions.
1938
+ */
1939
+ compat?: ConfigCompat;
1940
+ /**
1941
+ * Replace `@State` and `@Prop` internals with `@preact/signals-core` signal primitives.
1942
+ * Enables cross-framework reactive interop - component state becomes subscribable by
1943
+ * Solid, Angular, Preact and any TC39-signal-compatible library without event/attribute
1944
+ * roundtrips. No API changes required in component code.
1945
+ * Defaults to `false`.
2148
1946
  */
2149
- extras?: ConfigExtras;
1947
+ signalBacking?: boolean;
2150
1948
  /**
2151
1949
  * The hydrated flag identifies if a component and all of its child components
2152
1950
  * have finished hydrating. This helps prevent any flash of unstyled content (FOUC)
@@ -2204,22 +2002,13 @@ interface StencilConfig {
2204
2002
  docs?: StencilDocsConfig;
2205
2003
  globalScript?: string;
2206
2004
  srcIndexHtml?: string;
2207
- testing?: TestingConfig;
2208
2005
  maxConcurrentWorkers?: number;
2209
2006
  preamble?: string;
2210
- rollupPlugins?: {
2211
- before?: any[];
2212
- after?: any[];
2007
+ rolldownPlugins?: {
2008
+ before?: Plugin[];
2009
+ after?: Plugin[];
2213
2010
  };
2214
2011
  entryComponentsHint?: string[];
2215
- /**
2216
- * Sets whether Stencil will write files to `dist/` during the build or not.
2217
- *
2218
- * By default this value is set to the opposite value of {@link devMode},
2219
- * i.e. it will be `true` when building for production and `false` when
2220
- * building for development.
2221
- */
2222
- buildDist?: boolean;
2223
2012
  buildLogFilePath?: string;
2224
2013
  devInspector?: boolean;
2225
2014
  devServer?: StencilDevServerConfig;
@@ -2247,7 +2036,7 @@ interface StencilConfig {
2247
2036
  * An array of component tag names to exclude from production builds.
2248
2037
  * Useful to remove test, demo or experimental components from final output.
2249
2038
  *
2250
- * **Note:** Exclusion only applies to production builds (default, or when `--prod` is used).
2039
+ * **Note:** Exclusion only applies to production builds (the default).
2251
2040
  * Development builds (with `--dev` flag) will include all components to support local testing.
2252
2041
  *
2253
2042
  * Supports glob patterns for matching multiple components:
@@ -2271,23 +2060,78 @@ interface StencilConfig {
2271
2060
  * Set whether unused dependencies should be excluded from the built output.
2272
2061
  */
2273
2062
  excludeUnusedDependencies?: boolean;
2274
- stencilCoreResolvedId?: string;
2275
- }
2276
- interface ConfigExtrasBase {
2277
2063
  /**
2278
- * Experimental flag. Projects that use a Stencil library built using the `dist` output target may have trouble lazily
2279
- * loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
2280
- * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
2281
- * the size of the compiled output. Defaults to `false`.
2282
- * @deprecated This flag has been deprecated in favor of `enableImportInjection`, which provides the same
2283
- * functionality. `experimentalImportInjection` will be removed in a future major version of Stencil.
2064
+ * Declares the set of valid style "modes" (e.g. `ios`, `md`) used by mode-keyed
2065
+ * `styleUrls`/`styles` in `@Component()`. When set, the compiler validates that
2066
+ * every mode key used in a component matches one of these entries, catching typos
2067
+ * at build time. Entries marked `required` must be present on every component that
2068
+ * defines any mode-keyed styles.
2069
+ *
2070
+ * @example
2071
+ * ```ts
2072
+ * export const config: Config = {
2073
+ * modes: ['ios', { mode: 'md', required: true }],
2074
+ * };
2075
+ * ```
2076
+ *
2077
+ * @default []
2078
+ */
2079
+ modes?: (string | ModeConfig)[];
2080
+ /**
2081
+ * Explicitly declare which npm packages are Stencil collections to be re-bundled into this project.
2082
+ *
2083
+ * Without this option, collection ingestion is triggered only by a side-effect import:
2084
+ * ```ts
2085
+ * import '@ionic/core';
2086
+ * ```
2087
+ * @example
2088
+ * ```ts
2089
+ * export const config: Config = {
2090
+ * collections: ['@ionic/core', '@my-org/design-system'],
2091
+ * };
2092
+ * ```
2093
+ *
2094
+ * @default []
2284
2095
  */
2285
- experimentalImportInjection?: boolean;
2096
+ collections?: string[];
2097
+ }
2098
+ /**
2099
+ * DOM patches for light-dom / scoped components that use `<slot>`.
2100
+ *
2101
+ * These patches shield the component's slot machinery from framework DOM mutations
2102
+ * (e.g. when Angular or React insert / remove nodes they route directly to the host
2103
+ * element, bypassing the slot polyfill) and prevent hydration errors when a framework
2104
+ * encounters Stencil's internal slot reference nodes during SSR reconciliation.
2105
+ *
2106
+ * Patches are only applied at runtime when a component is both non-shadow **and**
2107
+ * declares at least one `<slot>`, so enabling them has no effect on pure shadow-DOM
2108
+ * components.
2109
+ *
2110
+ * Set to `true` (default) to enable all patches, `false` to disable all, or an object
2111
+ * for granular control.
2112
+ */
2113
+ type LightDomPatches = {
2114
+ /** Patches `childNodes`/`children` getters to return only slotted content. */
2115
+ childNodes?: boolean;
2116
+ /** Patches `cloneNode()` to correctly deep-clone slotted content. */
2117
+ cloneNode?: boolean;
2118
+ /** Patches `appendChild()`, `insertBefore()`, and `removeChild()` to route to the correct slot, and the `innerHTML` / `innerText` setters to replace only slotted content. */
2119
+ domMutations?: boolean;
2120
+ /** Patches `textContent` to act like shadow DOM (reads/writes slotted text only). */
2121
+ textContent?: boolean;
2122
+ };
2123
+ /**
2124
+ * Compatibility and workaround flags, primarily for shielding non-shadow DOM components
2125
+ * from consuming frameworks that mutate internals they don't know about, plus other
2126
+ * framework/bundler integration edge cases and rarely-needed diagnostic suppressions.
2127
+ * These are opt-in behaviors that aren't needed by every project.
2128
+ */
2129
+ interface ConfigCompat {
2286
2130
  /**
2287
2131
  * Projects that use a Stencil library built using the `dist` output target may have trouble lazily
2288
2132
  * loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
2289
2133
  * lazily loads components in a way that works with additional bundlers. Setting this flag to `true` will increase
2290
- * the size of the compiled output. Defaults to `false`.
2134
+ * the size of the compiled output. Defaults to `true`.
2291
2135
  */
2292
2136
  enableImportInjection?: boolean;
2293
2137
  /**
@@ -2302,73 +2146,27 @@ interface ConfigExtrasBase {
2302
2146
  */
2303
2147
  initializeNextTick?: boolean;
2304
2148
  /**
2305
- * Enables the tagNameTransform option of `defineCustomElements()`, so the component tagName
2306
- * can be customized at runtime. Defaults to `false`.
2307
- * @deprecated This option has been deprecated in favour of `setTagTransformer` and `transformTag`. It will be removed in a future major version of Stencil.
2308
- */
2309
- tagNameTransform?: boolean;
2310
- /**
2311
- * Adds `transformTag` calls to css strings and querySelector(All) calls
2149
+ * Adds `transformTag` calls to css strings and querySelector(All) calls.
2150
+ * Use `'prod'` to enable only in production builds.
2312
2151
  */
2313
2152
  additionalTagTransformers?: boolean | 'prod';
2314
2153
  /**
2315
- * Experimental flag.
2316
- * Updates the behavior of scoped components to align more closely with the behavior of the native
2317
- * Shadow DOM when using `slot`s.
2318
- * Defaults to `false`.
2319
- */
2320
- experimentalScopedSlotChanges?: boolean;
2321
- /**
2322
- * By default Stencil turns the stylesheet provided to `globalStyle` into a constructable stylesheet
2323
- * and adds it to each component which can be useful for sharing styles efficiently across components.
2324
- * In some cases this can be undesirable:
2325
- * - If `globalStyle` is intended to configure the lightDOM only
2326
- * - If `globalStyle` is large it can bloat the size of SSR output when using declarative-shadow-dom
2327
- * Setting this to `false` will prevent Stencil from adding any `globalStyle` to each component.
2328
- *
2329
- * Defaults to `true`.
2330
- */
2331
- addGlobalStyleToComponents?: boolean;
2332
- }
2333
- type ConfigExtrasSlotFixes<ExperimentalFixesEnabled extends boolean, IndividualFlags extends boolean> = {
2334
- /**
2335
- * By default, the slot polyfill does not update `appendChild()` so that it appends
2336
- * new child nodes into the correct child slot like how shadow dom works. This is an opt-in
2337
- * polyfill for those who need it when using `element.appendChild(node)` and expecting the
2338
- * child to be appended in the same location shadow dom would. This is not required for
2339
- * IE11 or Edge 18, but can be enabled if the app is using `appendChild()`. Defaults to `false`.
2340
- */
2341
- appendChildSlotFix?: IndividualFlags;
2342
- /**
2343
- * By default, the runtime does not polyfill `cloneNode()` when cloning a component
2344
- * that uses the slot polyfill. This is an opt-in polyfill for those who need it.
2345
- * This is not required for IE11 or Edge 18, but can be enabled if the app is using
2346
- * `cloneNode()` and unexpected node are being cloned due to the slot polyfill
2347
- * simulating shadow dom. Defaults to `false`.
2348
- */
2349
- cloneNodeFix?: IndividualFlags;
2350
- /**
2351
- * Experimental flag to align the behavior of invoking `textContent` on a scoped component to act more like a
2352
- * component that uses the shadow DOM. Defaults to `false`
2154
+ * DOM patches for light-dom / scoped components that use `<slot>`.
2155
+ * See {@link LightDomPatches} for granular control. Defaults to `true`.
2353
2156
  */
2354
- scopedSlotTextContentFix?: IndividualFlags;
2157
+ lightDomPatches?: boolean | LightDomPatches;
2355
2158
  /**
2356
- * For browsers that do not support shadow dom (IE11 and Edge 18 and below), slot is polyfilled
2357
- * to simulate the same behavior. However, the host element's `childNodes` and `children`
2358
- * getters are not patched to only show the child nodes and elements of the default slot.
2359
- * Defaults to `false`.
2159
+ * When `true`, Stencil will suppress diagnostics which warn about public members using reserved names
2160
+ * (for example, decorating a method named `focus` with `@Method()`). Defaults to `false`.
2360
2161
  */
2361
- slotChildNodesFix?: IndividualFlags;
2162
+ suppressPublicNameWarnings?: boolean;
2362
2163
  /**
2363
- * Enables all slot-related fixes such as {@link slotChildNodesFix}, and
2364
- * {@link scopedSlotTextContentFix}.
2164
+ * When `true`, Stencil will suppress diagnostics which warn about event names conflicting with native DOM event names. Defaults to `false`.
2365
2165
  */
2366
- experimentalSlotFixes?: ExperimentalFixesEnabled;
2367
- };
2368
- type ConfigExtras = ConfigExtrasBase & (ConfigExtrasSlotFixes<true, true> | ConfigExtrasSlotFixes<false, boolean>);
2166
+ suppressEventNameWarnings?: boolean;
2167
+ }
2369
2168
  interface Config extends StencilConfig {
2370
2169
  buildAppCore?: boolean;
2371
- buildDocs?: boolean;
2372
2170
  configPath?: string;
2373
2171
  writeLog?: boolean;
2374
2172
  devServer?: DevServerConfig;
@@ -2406,10 +2204,6 @@ interface Config extends StencilConfig {
2406
2204
  * Whether to generate service worker
2407
2205
  */
2408
2206
  generateServiceWorker?: boolean;
2409
- /**
2410
- * Whether e2e tests are being run
2411
- */
2412
- e2eTests?: boolean;
2413
2207
  /**
2414
2208
  * Dev server address override
2415
2209
  */
@@ -2449,7 +2243,7 @@ interface Config extends StencilConfig {
2449
2243
  * conforming to a given interface. For best results, pair with a validation
2450
2244
  * function as shown in the example.
2451
2245
  */
2452
- type Loose<T extends Object> = Record<string, any> & Partial<T>;
2246
+ type Loose<T extends object> = Record<string, any> & Partial<T>;
2453
2247
  /**
2454
2248
  * A Loose version of the Config interface. This is intended to let us load a partial config
2455
2249
  * and have type information carry though as we construct an object which is a valid `Config`.
@@ -2464,11 +2258,11 @@ type UnvalidatedConfig = Loose<Config>;
2464
2258
  * type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
2465
2259
  * ```
2466
2260
  */
2467
- type RequireFields<T, K extends keyof T> = T & { [P in K]-?: T[P] };
2261
+ type RequireFields<T, K extends keyof T> = T & { [P in K]-?: T[P]; };
2468
2262
  /**
2469
2263
  * Fields in {@link Config} to make required for {@link ValidatedConfig}
2470
2264
  */
2471
- type StrictConfigFields = keyof Pick<Config, 'buildEs5' | 'cacheDir' | 'devMode' | 'devServer' | 'extras' | 'fsNamespace' | 'hashFileNames' | 'hashedFileNameLength' | 'hydratedFlag' | 'logLevel' | 'logger' | 'minifyCss' | 'minifyJs' | 'namespace' | 'outputTargets' | 'packageJsonFilePath' | 'rollupConfig' | 'rootDir' | 'srcDir' | 'srcIndexHtml' | 'sys' | 'testing' | 'transformAliasedImportPaths' | 'validatePrimaryPackageOutputTarget'>;
2265
+ type StrictConfigFields = keyof Pick<Config, 'cacheDir' | 'devServer' | 'compat' | 'fsNamespace' | 'hydratedFlag' | 'jsMinifier' | 'logLevel' | 'logger' | 'minifyCss' | 'minifyJs' | 'namespace' | 'outputTargets' | 'packageJsonFilePath' | 'rolldownConfig' | 'rootDir' | 'srcDir' | 'srcIndexHtml' | 'sys' | 'transformAliasedImportPaths'>;
2472
2266
  /**
2473
2267
  * A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
2474
2268
  * When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
@@ -2476,8 +2270,24 @@ type StrictConfigFields = keyof Pick<Config, 'buildEs5' | 'cacheDir' | 'devMode'
2476
2270
  * validations have occurred at runtime.
2477
2271
  */
2478
2272
  type ValidatedConfig = RequireFields<Config, StrictConfigFields> & {
2273
+ /**
2274
+ * Whether the build is running in development mode.
2275
+ * Set by the `--dev` CLI flag. Not user-configurable in `stencil.config.ts`.
2276
+ */
2277
+ devMode: boolean;
2479
2278
  sourceMap: boolean;
2480
2279
  };
2280
+ interface ModeConfig {
2281
+ /**
2282
+ * The mode name, matched against `styleUrls`/`styles` object keys in `@Component()`.
2283
+ */
2284
+ mode: string;
2285
+ /**
2286
+ * When `true`, every component that defines mode-keyed `styleUrls` or `styles`
2287
+ * must include this mode. Defaults to `false`.
2288
+ */
2289
+ required?: boolean;
2290
+ }
2481
2291
  interface HydratedFlag {
2482
2292
  /**
2483
2293
  * Defaults to `hydrated`.
@@ -2519,8 +2329,7 @@ interface StencilDevServerConfig {
2519
2329
  * EXPERIMENTAL!
2520
2330
  * During development, node modules can be independently requested and bundled, making for
2521
2331
  * faster build times. This is only available using the Stencil Dev Server throughout
2522
- * development. Production builds and builds with the `es5` flag will override
2523
- * this setting to `false`. Default is `false`.
2332
+ * development. Production builds will override this setting to `false`. Default is `false`.
2524
2333
  */
2525
2334
  experimentalDevModules?: boolean;
2526
2335
  /**
@@ -2621,7 +2430,8 @@ interface DevServerConfig extends StencilDevServerConfig {
2621
2430
  * reloading updates.
2622
2431
  */
2623
2432
  excludeHmr?: string[];
2624
- historyApiFallback?: HistoryApiFallback;
2433
+ /** Serve `index` for page requests that match no file (single-page app routes). `null` turns it off. */
2434
+ historyApiFallback?: HistoryApiFallback | null;
2625
2435
  openBrowser?: boolean;
2626
2436
  prerenderConfig?: string;
2627
2437
  protocol?: 'http' | 'https';
@@ -2681,11 +2491,11 @@ interface PrerenderConfig {
2681
2491
  * Run after each `document` is hydrated, but before it is serialized
2682
2492
  * into an HTML string. Hook is passed the `document` and its `URL`.
2683
2493
  */
2684
- afterHydrate?(document: Document, url: URL, results: PrerenderUrlResults): any | Promise<any>;
2494
+ afterSsr?(document: Document, url: URL, results: PrerenderUrlResults): any | Promise<any>;
2685
2495
  /**
2686
2496
  * Run before each `document` is hydrated. Hook is passed the `document` it's `URL`.
2687
2497
  */
2688
- beforeHydrate?(document: Document, url: URL): any | Promise<any>;
2498
+ beforeSsr?(document: Document, url: URL): any | Promise<any>;
2689
2499
  /**
2690
2500
  * Runs after the template Document object has serialize into an
2691
2501
  * HTML formatted string. Returns an HTML string to be used as the
@@ -2729,9 +2539,9 @@ interface PrerenderConfig {
2729
2539
  */
2730
2540
  filePath?(url: URL, filePath: string): string;
2731
2541
  /**
2732
- * Returns the hydrate options to use for each individual prerendered page.
2542
+ * Returns the prerender options to use for each individual prerendered page.
2733
2543
  */
2734
- hydrateOptions?(url: URL): PrerenderHydrateOptions;
2544
+ prerenderOptions?(url: URL): PrerenderOptions;
2735
2545
  /**
2736
2546
  * Returns the template file's content. The template is the base
2737
2547
  * HTML used for all prerendered pages.
@@ -2755,7 +2565,7 @@ interface PrerenderConfig {
2755
2565
  */
2756
2566
  trailingSlash?: boolean;
2757
2567
  }
2758
- interface HydrateDocumentOptions {
2568
+ interface SsrDocumentOptions {
2759
2569
  /**
2760
2570
  * Build ID that will be added to `<html data-stencil-build="BUILD_ID">`. By default
2761
2571
  * a random ID will be generated
@@ -2772,7 +2582,7 @@ interface HydrateDocumentOptions {
2772
2582
  * JavaScript to read the structure of the HTML and rebuild each
2773
2583
  * component. Defaults to `true`.
2774
2584
  */
2775
- clientHydrateAnnotations?: boolean;
2585
+ clientSsrAnnotations?: boolean;
2776
2586
  /**
2777
2587
  * Constrain `setTimeout()` to 1ms, but still async. Also
2778
2588
  * only allows `setInterval()` to fire once, also constrained to 1ms.
@@ -2805,6 +2615,16 @@ interface HydrateDocumentOptions {
2805
2615
  * Sets `document.referrer`
2806
2616
  */
2807
2617
  referrer?: string;
2618
+ /**
2619
+ * Render into one long-lived mock window, reset between renders, instead of creating a new one
2620
+ * for every call. Skips evaluating the whole SSR platform (runtime and every component)
2621
+ * on each render: most of the cost of rendering a small fragment, and a good part of a whole page.
2622
+ *
2623
+ * Applies to HTML string input (not a `Document`). One window per distinct `serializeShadowRoot` value,
2624
+ * and renders sharing a window run one at a time.
2625
+ * Defaults to `false`, except in the `ssr-wasm` output target, where it defaults to `true`.
2626
+ */
2627
+ reuseWindow?: boolean;
2808
2628
  /**
2809
2629
  * Removes every `<script>` element found in the `document`. Defaults to `false`.
2810
2630
  */
@@ -2871,22 +2691,35 @@ interface HydrateDocumentOptions {
2871
2691
  default: 'declarative-shadow-dom' | 'scoped';
2872
2692
  } | boolean;
2873
2693
  }
2874
- interface SerializeDocumentOptions extends HydrateDocumentOptions {
2694
+ /**
2695
+ * Backwards compat for v4
2696
+ * @deprecated - use SsrDocumentOptions instead
2697
+ */
2698
+ interface HydrateDocumentOptions extends SsrDocumentOptions {}
2699
+ interface SerializeDocumentOptions extends SsrDocumentOptions {
2875
2700
  /**
2876
2701
  * Runs after the `document` has been hydrated.
2877
2702
  */
2703
+ afterSsr?(document: any): any | Promise<any>;
2704
+ /**
2705
+ * @deprecated Use `afterSsr` instead.
2706
+ */
2878
2707
  afterHydrate?(document: any): any | Promise<any>;
2879
2708
  /**
2880
2709
  * Sets an approximate line width the HTML should attempt to stay within.
2881
2710
  * Note that this is "approximate", in that HTML may often not be able
2882
2711
  * to be split at an exact line width. Additionally, new lines created
2883
2712
  * is where HTML naturally already has whitespace, such as before an
2884
- * attribute or spaces between words. Defaults to `100`.
2713
+ * attribute or spaces between words. Defaults to no wrapping (`100` when prerendering).
2885
2714
  */
2886
2715
  approximateLineWidth?: number;
2887
2716
  /**
2888
2717
  * Runs before the `document` has been hydrated.
2889
2718
  */
2719
+ beforeSsr?(document: any): any | Promise<any>;
2720
+ /**
2721
+ * @deprecated Use `beforeSsr` instead.
2722
+ */
2890
2723
  beforeHydrate?(document: any): any | Promise<any>;
2891
2724
  /**
2892
2725
  * Format the HTML in a nicely indented format.
@@ -2895,12 +2728,12 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
2895
2728
  prettyHtml?: boolean;
2896
2729
  /**
2897
2730
  * Remove quotes from attribute values when possible.
2898
- * Defaults to `true`.
2731
+ * Defaults to `false` (`true` when prerendering).
2899
2732
  */
2900
2733
  removeAttributeQuotes?: boolean;
2901
2734
  /**
2902
2735
  * Remove the `=""` from standardized `boolean` attributes,
2903
- * such as `hidden` or `checked`. Defaults to `true`.
2736
+ * such as `hidden` or `checked`. Defaults to `false` (`true` when prerendering).
2904
2737
  */
2905
2738
  removeBooleanAttributeQuotes?: boolean;
2906
2739
  /**
@@ -2909,7 +2742,7 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
2909
2742
  */
2910
2743
  removeEmptyAttributes?: boolean;
2911
2744
  /**
2912
- * Remove HTML comments. Defaults to `true`.
2745
+ * Remove HTML comments. Defaults to `false` (`true` when prerendering).
2913
2746
  */
2914
2747
  removeHtmlComments?: boolean;
2915
2748
  /**
@@ -2924,12 +2757,23 @@ interface SerializeDocumentOptions extends HydrateDocumentOptions {
2924
2757
  */
2925
2758
  modes?: ResolutionHandler[];
2926
2759
  }
2927
- interface HydrateFactoryOptions extends SerializeDocumentOptions {
2760
+ interface SsrFactoryOptions extends SerializeDocumentOptions {
2928
2761
  serializeToHtml: boolean;
2929
2762
  destroyWindow: boolean;
2930
2763
  destroyDocument: boolean;
2764
+ /**
2765
+ * A canonical key for `serializeShadowRoot`, set by the renderer. Renders with the same key
2766
+ * render every component the same way, so they can share an SSR platform.
2767
+ * @internal
2768
+ */
2769
+ serializeShadowRootKey?: string;
2931
2770
  }
2932
- interface PrerenderHydrateOptions extends SerializeDocumentOptions {
2771
+ /**
2772
+ * Backwards compat for v4
2773
+ * @deprecated - use SsrFactoryOptions instead
2774
+ */
2775
+ interface HydrateFactoryOptions extends SsrFactoryOptions {}
2776
+ interface PrerenderOptions extends SerializeDocumentOptions {
2933
2777
  /**
2934
2778
  * Adds `<link rel="modulepreload">` for modules that will eventually be requested.
2935
2779
  * Defaults to `true`.
@@ -2964,6 +2808,11 @@ interface PrerenderHydrateOptions extends SerializeDocumentOptions {
2964
2808
  */
2965
2809
  staticDocument?: boolean;
2966
2810
  }
2811
+ /**
2812
+ * v4 backwards compat
2813
+ * @deprecated - use PrerenderOptions instead
2814
+ */
2815
+ interface PrerenderHydrateOptions extends PrerenderOptions {}
2967
2816
  interface RobotsTxtOpts {
2968
2817
  urls: string[];
2969
2818
  sitemapUrl: string;
@@ -2998,7 +2847,7 @@ interface CompilerSystem {
2998
2847
  name: 'node' | 'in-memory';
2999
2848
  version: string;
3000
2849
  events?: BuildEvents;
3001
- details?: SystemDetails;
2850
+ details: SystemDetails;
3002
2851
  /**
3003
2852
  * Add a callback which will be ran when destroy() is called.
3004
2853
  */
@@ -3011,14 +2860,15 @@ interface CompilerSystem {
3011
2860
  * SYNC! Always returns a boolean, does not throw.
3012
2861
  */
3013
2862
  accessSync(p: string): boolean;
3014
- applyGlobalPatch?(fromDir: string): Promise<void>;
3015
2863
  applyPrerenderGlobalPatch?(opts: {
3016
2864
  devServerHostUrl: string;
3017
2865
  window: any;
3018
2866
  }): void;
3019
- cacheStorage?: CacheStorage;
3020
- checkVersion?: (logger: Logger, currentVersion: string) => Promise<() => void>;
3021
- copy?(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
2867
+ /**
2868
+ * Check npm for a newer Stencil version. Resolves a function that logs the result.
2869
+ */
2870
+ checkVersion(logger: Logger, currentVersion: string): Promise<() => void>;
2871
+ copy(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
3022
2872
  /**
3023
2873
  * Always returns a boolean if the files were copied or not. Does not throw.
3024
2874
  */
@@ -3043,7 +2893,7 @@ interface CompilerSystem {
3043
2893
  /**
3044
2894
  * Each platform has a different way to dynamically import modules.
3045
2895
  */
3046
- dynamicImport?(p: string): Promise<any>;
2896
+ dynamicImport(p: string): Promise<any>;
3047
2897
  /**
3048
2898
  * Creates the worker controller for the current system.
3049
2899
  *
@@ -3053,43 +2903,18 @@ interface CompilerSystem {
3053
2903
  */
3054
2904
  createWorkerController?(maxConcurrentWorkers: number): WorkerMainController;
3055
2905
  encodeToBase64(str: string): string;
3056
- /**
3057
- * @deprecated
3058
- */
3059
- ensureDependencies?(opts: {
3060
- rootDir: string;
3061
- logger: Logger;
3062
- dependencies: CompilerDependency[];
3063
- }): Promise<{
3064
- stencilPath: string;
3065
- diagnostics: Diagnostic$1[];
3066
- }>;
3067
- /**
3068
- * @deprecated
3069
- */
3070
- ensureResources?(opts: {
3071
- rootDir: string;
3072
- logger: Logger;
3073
- dependencies: CompilerDependency[];
3074
- }): Promise<void>;
3075
2906
  /**
3076
2907
  * process.exit()
3077
2908
  */
3078
2909
  exit(exitCode: number): Promise<void>;
3079
- /**
3080
- * Optionally provide a fetch() function rather than using the built-in fetch().
3081
- * First arg is a url string or Request object (RequestInfo).
3082
- * Second arg is the RequestInit. Returns the Response object
3083
- */
3084
- fetch?(input: string | any, init?: any): Promise<any>;
3085
2910
  /**
3086
2911
  * Generates a sha1 digest encoded as HEX
3087
2912
  */
3088
- generateContentHash?(content: string | any, length?: number): Promise<string>;
2913
+ generateContentHash(content: string | any, length?: number): Promise<string>;
3089
2914
  /**
3090
2915
  * Generates a sha1 digest encoded as HEX from a file path
3091
2916
  */
3092
- generateFileHash?(filePath: string | any, length?: number): Promise<string>;
2917
+ generateFileHash(filePath: string | any, length?: number): Promise<string>;
3093
2918
  /**
3094
2919
  * Get the current directory.
3095
2920
  */
@@ -3098,7 +2923,6 @@ interface CompilerSystem {
3098
2923
  * The compiler's executing path.
3099
2924
  */
3100
2925
  getCompilerExecutingPath(): string;
3101
- getEnvironmentVar?(key: string): string;
3102
2926
  /**
3103
2927
  * Gets the absolute file path when for a dependency module.
3104
2928
  */
@@ -3137,11 +2961,7 @@ interface CompilerSystem {
3137
2961
  * Normalize file system path.
3138
2962
  */
3139
2963
  normalizePath(p: string): string;
3140
- onProcessInterrupt?(cb: () => void): void;
3141
- parseYarnLockFile?: (content: string) => {
3142
- type: 'success' | 'merge' | 'conflict';
3143
- object: any;
3144
- };
2964
+ onProcessInterrupt(cb: () => void): void;
3145
2965
  platformPath: PlatformPath;
3146
2966
  /**
3147
2967
  * All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
@@ -3177,6 +2997,9 @@ interface CompilerSystem {
3177
2997
  * Rename old path to new path. Does not throw.
3178
2998
  */
3179
2999
  rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;
3000
+ /**
3001
+ * Assigned by the compiler. Used by plugins (e.g. `@stencil/sass`) to resolve `~` imports.
3002
+ */
3180
3003
  resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;
3181
3004
  resolvePath(p: string): string;
3182
3005
  /**
@@ -3291,18 +3114,18 @@ interface ResolveModuleIdResults {
3291
3114
  * A controller which provides for communication and coordination between
3292
3115
  * threaded workers.
3293
3116
  */
3294
- interface WorkerMainController {
3117
+ interface WorkerMainController<T extends Record<string, (...args: any[]) => Promise<any>> = Record<string, (...args: any[]) => Promise<any>>> {
3295
3118
  /**
3296
3119
  * Send a given set of arguments to a worker
3297
3120
  */
3298
- send(...args: any[]): Promise<any>;
3121
+ send<K extends keyof T>(methodName: K, ...args: Parameters<T[K]>): ReturnType<T[K]>;
3299
3122
  /**
3300
3123
  * Handle a particular method
3301
3124
  *
3302
3125
  * @param name of the method to be passed to a worker
3303
3126
  * @returns a Promise wrapping the results
3304
3127
  */
3305
- handler(name: string): (...args: any[]) => Promise<any>;
3128
+ handler<K extends keyof T>(name: K): T[K];
3306
3129
  /**
3307
3130
  * Destroy the worker represented by this instance, rejecting all outstanding
3308
3131
  * tasks and killing the child process.
@@ -3369,6 +3192,8 @@ interface BuildNoChangeResults {
3369
3192
  interface CompilerBuildResults {
3370
3193
  buildId: number;
3371
3194
  componentGraph?: BuildResultsComponentGraph;
3195
+ components: ComponentCompilerMeta[];
3196
+ cssOnlyComponents: ComponentCompilerMeta[];
3372
3197
  diagnostics: Diagnostic$1[];
3373
3198
  dirsAdded: string[];
3374
3199
  dirsDeleted: string[];
@@ -3380,10 +3205,20 @@ interface CompilerBuildResults {
3380
3205
  hasError: boolean;
3381
3206
  hasSuccessfulBuild: boolean;
3382
3207
  hmr?: HotModuleReplacement;
3383
- hydrateAppFilePath?: string;
3208
+ ssrAppFilePath?: string;
3384
3209
  isRebuild: boolean;
3385
3210
  namespace: string;
3211
+ fsNamespace: string;
3386
3212
  outputs: BuildOutput[];
3213
+ /**
3214
+ * Absolute paths to every global stylesheet, in cascade order: each `global-style` output
3215
+ * target's compiled CSS in the order those targets are declared in `config.outputTargets` - or,
3216
+ * with none configured, the generated `{fsNamespace}.css` holding Stencil's auto-placed CSS (when
3217
+ * emitted). Unlike `outputs`, which groups files by type and sorts them alphabetically, this
3218
+ * preserves author-intended order for consumers like the dev-server's auto-generated component
3219
+ * preview.
3220
+ */
3221
+ globalStyleFiles: string[];
3387
3222
  rootDir: string;
3388
3223
  srcDir: string;
3389
3224
  timestamp: string;
@@ -3399,6 +3234,7 @@ interface HotModuleReplacement {
3399
3234
  componentsUpdated?: string[];
3400
3235
  excludeHmr?: string[];
3401
3236
  externalStylesUpdated?: string[];
3237
+ globalStylesUpdated?: HmrGlobalStyleUpdate[];
3402
3238
  imagesUpdated?: string[];
3403
3239
  indexHtmlUpdated?: boolean;
3404
3240
  inlineStylesUpdated?: HmrStyleUpdate[];
@@ -3413,6 +3249,15 @@ interface HmrStyleUpdate {
3413
3249
  styleTag: string;
3414
3250
  styleText: string;
3415
3251
  }
3252
+ /**
3253
+ * A live-reload update for a `global-style` output target's CSS. Applied on
3254
+ * the client by matching `fileName` against the `<link>` that loads it and
3255
+ * inserting/updating an adjacent `<style>` override
3256
+ */
3257
+ interface HmrGlobalStyleUpdate {
3258
+ fileName: string;
3259
+ styleText: string;
3260
+ }
3416
3261
  type BuildOnEventRemove = () => boolean;
3417
3262
  interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
3418
3263
  unsubscribeAll(): void;
@@ -3543,8 +3388,8 @@ interface ConfigBundle {
3543
3388
  }
3544
3389
  /**
3545
3390
  * A file and/or directory copy operation that may be specified as part of
3546
- * certain output targets for Stencil (in particular `dist`,
3547
- * `dist-custom-elements`, and `www`).
3391
+ * certain output targets for Stencil (in particular `loader-bundle`,
3392
+ * `standalone`, and `www`).
3548
3393
  */
3549
3394
  interface CopyTask {
3550
3395
  /**
@@ -3565,8 +3410,11 @@ interface CopyTask {
3565
3410
  */
3566
3411
  dest?: string;
3567
3412
  /**
3568
- * An optional array of glob patterns to exclude from the copy operation.
3569
- * @default ['**\/__mocks__/**', '**\/__fixtures__/**', '**\/dist/**', '**\/.{idea,git,cache,output,temp}/**', '**\/.ds_store', '**\/.gitignore', '**\/desktop.ini', '**\/thumbs.db']
3413
+ * Additional glob patterns to exclude from the copy operation, merged with
3414
+ * the built-in defaults: `__mocks__`, `__fixtures__`, `dist`, hidden dirs,
3415
+ * `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`. For a directory
3416
+ * `src`, patterns match paths relative to that directory; an explicitly
3417
+ * named `src` file is never ignored.
3570
3418
  */
3571
3419
  ignore?: string[];
3572
3420
  /**
@@ -3645,339 +3493,12 @@ interface StencilDocsConfig {
3645
3493
  };
3646
3494
  };
3647
3495
  }
3648
- interface BundlingConfig {
3649
- /**
3650
- * @deprecated the `namedExports` field is no longer honored by `@rollup/plugin-commonjs` and is not used by Stencil.
3651
- * This field can be safely removed from your Stencil configuration file.
3652
- */
3653
- namedExports?: {
3654
- [key: string]: string[];
3655
- };
3656
- }
3657
- interface NodeResolveConfig {
3658
- exportConditions?: string[];
3659
- browser?: boolean;
3660
- moduleDirectories?: string[];
3661
- modulePaths?: string[];
3662
- dedupe?: string[] | ((importee: string) => boolean);
3663
- extensions?: readonly string[];
3664
- jail?: string;
3665
- mainFields?: readonly string[];
3666
- modulesOnly?: boolean;
3667
- preferBuiltins?: boolean | ((module: string) => boolean);
3668
- resolveOnly?: ReadonlyArray<string | RegExp> | null | ((module: string) => boolean);
3669
- rootDir?: string;
3670
- allowExportsFolderMapping?: boolean;
3671
- /**
3672
- * @see https://github.com/browserify/resolve#resolveid-opts-cb
3673
- * @deprecated the `customResolveOptions` field is no longer honored in future versions of
3674
- * `@rollup/plugin-node-resolve`. If you are currently using it, please open a new issue in the Stencil repo to
3675
- * describe your use case & provide input (https://github.com/stenciljs/core/issues/new/choose)
3676
- */
3677
- customResolveOptions?: {
3678
- basedir?: string;
3679
- package?: string;
3680
- extensions?: string[];
3681
- readFile?: Function;
3682
- isFile?: Function;
3683
- isDirectory?: Function;
3684
- packageFilter?: Function;
3685
- pathFilter?: Function;
3686
- paths?: Function | string[];
3687
- moduleDirectory?: string | string[];
3688
- preserveSymlinks?: boolean;
3689
- };
3690
- }
3691
- interface RollupConfig {
3692
- inputOptions?: RollupInputOptions;
3693
- outputOptions?: RollupOutputOptions;
3694
- }
3695
- interface RollupInputOptions {
3696
- context?: string;
3697
- moduleContext?: ((id: string) => string) | {
3698
- [id: string]: string;
3699
- };
3496
+ /** Options for rolldown's built-in module resolver, passed directly to rolldown's `resolve` input option. */
3497
+ type NodeResolveConfig = NonNullable<InputOptions['resolve']>;
3498
+ interface RolldownConfig {
3700
3499
  treeshake?: boolean;
3701
- maxParallelFileOps?: number;
3702
3500
  external?: (string | RegExp)[] | string | RegExp | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | undefined);
3703
3501
  }
3704
- interface RollupOutputOptions {
3705
- globals?: {
3706
- [name: string]: string;
3707
- } | ((name: string) => string);
3708
- }
3709
- interface Testing {
3710
- run(opts: TestingRunOptions): Promise<boolean>;
3711
- destroy(): Promise<void>;
3712
- }
3713
- declare type Path = string;
3714
- declare type TransformerConfig = [string, Record<string, unknown>];
3715
- /**
3716
- * Options for initiating a run of Stencil tests (spec and/or end-to-end)
3717
- */
3718
- interface TestingRunOptions {
3719
- /**
3720
- * If true, run end-to-end tests
3721
- */
3722
- e2e?: boolean;
3723
- /**
3724
- * If true, run screenshot tests
3725
- */
3726
- screenshot?: boolean;
3727
- /**
3728
- * If true, run spec tests
3729
- */
3730
- spec?: boolean;
3731
- /**
3732
- * If true, update 'golden' screenshots. Otherwise, compare against priori.
3733
- */
3734
- updateScreenshot?: boolean;
3735
- }
3736
- interface JestConfig {
3737
- /**
3738
- * This option tells Jest that all imported modules in your tests should be mocked automatically.
3739
- * All modules used in your tests will have a replacement implementation, keeping the API surface. Default: false
3740
- */
3741
- automock?: boolean;
3742
- /**
3743
- * By default, Jest runs all tests and produces all errors into the console upon completion.
3744
- * The bail config option can be used here to have Jest stop running tests after the first failure. Default: false
3745
- */
3746
- bail?: boolean | number;
3747
- /**
3748
- * The directory where Jest should store its cached dependency information. Jest attempts to scan your dependency tree once (up-front)
3749
- * and cache it in order to ease some of the filesystem raking that needs to happen while running tests. This config option lets you
3750
- * customize where Jest stores that cache data on disk. Default: "/tmp/<path>"
3751
- */
3752
- cacheDirectory?: string;
3753
- /**
3754
- * Automatically clear mock calls and instances between every test. Equivalent to calling jest.clearAllMocks()
3755
- * between each test. This does not remove any mock implementation that may have been provided. Default: false
3756
- */
3757
- clearMocks?: boolean;
3758
- /**
3759
- * Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
3760
- * executed files with coverage collection statements, it may significantly slow down your tests. Default: false
3761
- */
3762
- collectCoverage?: boolean;
3763
- /**
3764
- * An array of glob patterns indicating a set of files for which coverage information should be collected.
3765
- * If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
3766
- * for this file and it's never required in the test suite. Default: undefined
3767
- */
3768
- collectCoverageFrom?: any[];
3769
- /**
3770
- * The directory where Jest should output its coverage files. Default: undefined
3771
- */
3772
- coverageDirectory?: string;
3773
- /**
3774
- * An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path matches
3775
- * any of the patterns, coverage information will be skipped. These pattern strings match against the full path.
3776
- * Use the <rootDir> string token to include the path to your project's root directory to prevent it from accidentally
3777
- * ignoring all of your files in different environments that may have different root directories.
3778
- * Example: ["<rootDir>/build/", "<rootDir>/node_modules/"]. Default: ["/node_modules/"]
3779
- */
3780
- coveragePathIgnorePatterns?: any[];
3781
- /**
3782
- * A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
3783
- * Default: `["json", "lcov", "text"]`
3784
- */
3785
- coverageReporters?: any[];
3786
- /**
3787
- * This will be used to configure minimum threshold enforcement for coverage results. Thresholds can be specified as global,
3788
- * as a glob, and as a directory or file path. If thresholds aren't met, jest will fail. Thresholds specified as a positive
3789
- * number are taken to be the minimum percentage required. Thresholds specified as a negative number represent the maximum
3790
- * number of uncovered entities allowed. Default: undefined
3791
- */
3792
- coverageThreshold?: any;
3793
- errorOnDeprecated?: boolean;
3794
- forceCoverageMatch?: any[];
3795
- globals?: any;
3796
- globalSetup?: string;
3797
- globalTeardown?: string;
3798
- /**
3799
- * An array of directory names to be searched recursively up from the requiring module's location. Setting this option will
3800
- * override the default, if you wish to still search node_modules for packages include it along with any other
3801
- * options: ["node_modules", "bower_components"]. Default: ["node_modules"]
3802
- */
3803
- moduleDirectories?: string[];
3804
- /**
3805
- * An array of file extensions your modules use. If you require modules without specifying a file extension,
3806
- * these are the extensions Jest will look for. Default: ['ts', 'tsx', 'js', 'json']
3807
- */
3808
- moduleFileExtensions?: string[];
3809
- moduleNameMapper?: any;
3810
- modulePaths?: any[];
3811
- modulePathIgnorePatterns?: any[];
3812
- notify?: boolean;
3813
- notifyMode?: string;
3814
- preset?: string;
3815
- prettierPath?: string;
3816
- projects?: any;
3817
- reporters?: any;
3818
- resetMocks?: boolean;
3819
- resetModules?: boolean;
3820
- resolver?: Path | null;
3821
- restoreMocks?: boolean;
3822
- rootDir?: string;
3823
- roots?: any[];
3824
- runner?: string;
3825
- /**
3826
- * The paths to modules that run some code to configure or set up the testing environment before each test.
3827
- * Since every test runs in its own environment, these scripts will be executed in the testing environment
3828
- * immediately before executing the test code itself. Default: []
3829
- */
3830
- setupFiles?: string[];
3831
- setupFilesAfterEnv?: string[];
3832
- snapshotSerializers?: any[];
3833
- testEnvironment?: string;
3834
- testEnvironmentOptions?: any;
3835
- testMatch?: string[];
3836
- testPathIgnorePatterns?: string[];
3837
- testPreset?: string;
3838
- testRegex?: string[];
3839
- testResultsProcessor?: string;
3840
- testRunner?: string;
3841
- testURL?: string;
3842
- timers?: string;
3843
- transform?: {
3844
- [regex: string]: Path | TransformerConfig;
3845
- };
3846
- transformIgnorePatterns?: any[];
3847
- unmockedModulePathPatterns?: any[];
3848
- verbose?: boolean;
3849
- watchPathIgnorePatterns?: any[];
3850
- }
3851
- interface TestingConfig extends JestConfig {
3852
- /**
3853
- * The `allowableMismatchedPixels` value is used to determine an acceptable
3854
- * number of pixels that can be mismatched before the image is considered
3855
- * to have changes. Realistically, two screenshots representing the same
3856
- * content may have a small number of pixels that are not identical due to
3857
- * anti-aliasing, which is perfectly normal. If the `allowableMismatchedRatio`
3858
- * is provided it will take precedence, otherwise `allowableMismatchedPixels`
3859
- * will be used.
3860
- */
3861
- allowableMismatchedPixels?: number;
3862
- /**
3863
- * The `allowableMismatchedRatio` ranges from `0` to `1` and is used to
3864
- * determine an acceptable ratio of pixels that can be mismatched before
3865
- * the image is considered to have changes. Realistically, two screenshots
3866
- * representing the same content may have a small number of pixels that
3867
- * are not identical due to anti-aliasing, which is perfectly normal. The
3868
- * `allowableMismatchedRatio` is the number of pixels that were mismatched,
3869
- * divided by the total number of pixels in the screenshot. For example,
3870
- * a ratio value of `0.06` means 6% of the pixels can be mismatched before
3871
- * the image is considered to have changes. If the `allowableMismatchedRatio`
3872
- * is provided it will take precedence, otherwise `allowableMismatchedPixels`
3873
- * will be used.
3874
- */
3875
- allowableMismatchedRatio?: number;
3876
- /**
3877
- * Matching threshold while comparing two screenshots. Value ranges from `0` to `1`.
3878
- * Smaller values make the comparison more sensitive. The `pixelmatchThreshold`
3879
- * value helps to ignore anti-aliasing. Default: `0.1`
3880
- */
3881
- pixelmatchThreshold?: number;
3882
- /**
3883
- * Additional arguments to pass to the browser instance.
3884
- */
3885
- browserArgs?: string[];
3886
- /**
3887
- * Path to a Chromium or Chrome executable to run instead of the bundled Chromium.
3888
- * @default env.PUPPETEER_EXECUTABLE_PATH || env.CHROME_PATH || puppeteer.computeExecutablePath()
3889
- */
3890
- browserExecutablePath?: string;
3891
- /**
3892
- * Url of remote Chrome instance to use instead of local Chrome.
3893
- */
3894
- browserWSEndpoint?: string;
3895
- /**
3896
- * The browser channel to use for e2e tests (stable, beta, dev or canary).
3897
- * @default 'chrome'
3898
- */
3899
- browserChannel?: 'chrome' | 'chrome-beta' | 'chrome-dev' | 'chrome-canary';
3900
- /**
3901
- * Whether to run browser e2e tests in headless mode using Chrome Headless Shell
3902
- * @ref https://developer.chrome.com/blog/chrome-headless-shell
3903
- * @default shell
3904
- */
3905
- browserHeadless?: boolean | 'shell';
3906
- /**
3907
- * Slows down e2e browser operations by the specified amount of milliseconds.
3908
- * Useful so that you can see what is going on.
3909
- */
3910
- browserSlowMo?: number;
3911
- /**
3912
- * By default, all E2E pages wait until the "load" event, this global setting can be used
3913
- * to change the default `waitUntil` behavior.
3914
- */
3915
- browserWaitUntil?: 'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2';
3916
- /**
3917
- * Whether to auto-open a DevTools panel for each tab.
3918
- * If this option is true, the headless option will be set false
3919
- */
3920
- browserDevtools?: boolean;
3921
- /**
3922
- * Array of browser emulations to be used during _screenshot_ tests. A full screenshot
3923
- * test is ran for each emulation.
3924
- *
3925
- * To emulate a device display for your e2e tests, use the `setViewport` method on a test's E2E page.
3926
- * An example can be found in [the Stencil docs](https://stenciljs.com/docs/end-to-end-testing#emulate-a-display).
3927
- */
3928
- emulate?: EmulateConfig[];
3929
- /**
3930
- * Path to the Screenshot Connector module.
3931
- */
3932
- screenshotConnector?: string;
3933
- /**
3934
- * Timeout for the pixelmatch worker to resolve (in ms).
3935
- * @default 2500
3936
- */
3937
- screenshotTimeout?: number | null;
3938
- /**
3939
- * Amount of time in milliseconds to wait before a screenshot is taken.
3940
- */
3941
- waitBeforeScreenshot?: number;
3942
- }
3943
- interface EmulateConfig {
3944
- /**
3945
- * Predefined device descriptor name, such as "iPhone X" or "Nexus 10".
3946
- * For a complete list please see: https://github.com/puppeteer/puppeteer/blob/main/src/common/DeviceDescriptors.ts
3947
- */
3948
- device?: string;
3949
- /**
3950
- * User-Agent to be used. Defaults to the user-agent of the installed Puppeteer version.
3951
- */
3952
- userAgent?: string;
3953
- viewport?: EmulateViewport;
3954
- }
3955
- interface EmulateViewport {
3956
- /**
3957
- * Page width in pixels.
3958
- */
3959
- width: number;
3960
- /**
3961
- * page height in pixels.
3962
- */
3963
- height: number;
3964
- /**
3965
- * Specify device scale factor (can be thought of as dpr). Defaults to 1.
3966
- */
3967
- deviceScaleFactor?: number;
3968
- /**
3969
- * Whether the meta viewport tag is taken into account. Defaults to false.
3970
- */
3971
- isMobile?: boolean;
3972
- /**
3973
- * Specifies if viewport supports touch events. Defaults to false
3974
- */
3975
- hasTouch?: boolean;
3976
- /**
3977
- * Specifies if viewport is in landscape mode. Defaults to false.
3978
- */
3979
- isLandscape?: boolean;
3980
- }
3981
3502
  /**
3982
3503
  * This sets the log level hierarchy for our terminal logger, ranging from
3983
3504
  * most to least verbose.
@@ -4042,54 +3563,96 @@ interface LoggerTimeSpan {
4042
3563
  duration(): number;
4043
3564
  finish(finishedMsg: string, color?: string, bold?: boolean, newLineSuffix?: boolean): number;
4044
3565
  }
4045
- interface OutputTargetDist extends OutputTargetValidationConfig {
4046
- type: 'dist';
3566
+ /**
3567
+ * Output target for generating lazy-loaded component bundles with a loader infrastructure.
3568
+ * This creates an optimized distribution for CDN usage and applications that benefit from
3569
+ * lazy-loading components on demand.
3570
+ *
3571
+ * Formerly known as 'dist' in v4.
3572
+ *
3573
+ * @example
3574
+ * ```typescript
3575
+ * {
3576
+ * type: 'loader-bundle',
3577
+ * dir: 'dist/loader-bundle'
3578
+ * }
3579
+ * ```
3580
+ */
3581
+ interface OutputTargetLoaderBundle extends OutputTargetBaseNext {
3582
+ type: 'loader-bundle';
3583
+ /**
3584
+ * Directory where lazy-loaded bundles will be written.
3585
+ * @default '' (root of output directory)
3586
+ */
4047
3587
  buildDir?: string;
4048
- collectionDir?: string | null;
3588
+ copy?: CopyTask[];
3589
+ empty?: boolean;
4049
3590
  /**
4050
- * When `true` this flag will transform aliased import paths defined in
4051
- * a project's `tsconfig.json` to relative import paths in the compiled output's
4052
- * `dist-collection` bundle if it is generated (i.e. `collectionDir` is set).
4053
- *
4054
- * Paths will be left in aliased format if `false`.
3591
+ * Whether to generate CommonJS (CJS) bundles.
4055
3592
  *
4056
- * @example
4057
- * // tsconfig.json
4058
- * {
4059
- * paths: {
4060
- * "@utils/*": ['/src/utils/*']
4061
- * }
4062
- * }
3593
+ * When `true`, generates CJS output in `cjs/` subdirectory.
3594
+ * When `false` (default in v5+), only ESM bundles are generated.
4063
3595
  *
4064
- * // Source file
4065
- * import * as dateUtils from '@utils/date-utils';
4066
- * // Output file
4067
- * import * as dateUtils from '../utils/date-utils';
3596
+ * @default false
4068
3597
  */
4069
- transformAliasedImportPathsInCollection?: boolean | null;
4070
- typesDir?: string;
3598
+ cjs?: boolean;
4071
3599
  /**
4072
- * Provide a custom path for the ESM loader directory, containing files you can import
3600
+ * Custom path for the loader directory; files you can import
4073
3601
  * in an initiation script within your application to register all your components for
4074
3602
  * lazy loading.
4075
3603
  *
4076
- * @default /dist/loader
3604
+ * @default 'loader' (relative to output directory)
4077
3605
  */
4078
- esmLoaderPath?: string;
4079
- copy?: CopyTask[];
4080
- polyfills?: boolean;
4081
- empty?: boolean;
3606
+ loaderPath?: string;
3607
+ /**
3608
+ * Hash the filenames of generated chunks based on their content.
3609
+ * Enables forever-caching of CDN-served bundles.
3610
+ *
3611
+ * @default true in production, false in dev mode
3612
+ */
3613
+ hashFileNames?: boolean;
3614
+ /**
3615
+ * Number of characters to use for the content hash in filenames.
3616
+ *
3617
+ * @default 8
3618
+ */
3619
+ hashedFileNameLength?: number;
3620
+ /**
3621
+ * When `true`, marks `@stencil/core` as an external dependency in the bundler (ESM/CJS)
3622
+ * distribution output. Consumers must provide `@stencil/core` themselves.
3623
+ *
3624
+ * Has no effect on the browser/CDN build - the runtime is always bundled there.
3625
+ *
3626
+ * @default false
3627
+ */
3628
+ externalRuntime?: boolean;
4082
3629
  }
4083
- interface OutputTargetDistCollection extends OutputTargetValidationConfig {
4084
- type: 'dist-collection';
3630
+ /**
3631
+ * Output target for generating Stencil component source for downstream re-bundling.
3632
+ * This output contains transpiled source code, component metadata, and configuration
3633
+ * that downstream Stencil projects can re-compile and bundle.
3634
+ *
3635
+ * Formerly 'dist-collection' sub-output in v4, now a first-class output target in v5.
3636
+ *
3637
+ * In production builds, this output is auto-generated unless explicitly configured.
3638
+ *
3639
+ * @example
3640
+ * ```typescript
3641
+ * {
3642
+ * type: 'collection',
3643
+ * dir: 'dist/collection',
3644
+ * transformAliasedImportPaths: true
3645
+ * }
3646
+ * ```
3647
+ */
3648
+ interface OutputTargetCollection extends OutputTargetBaseNext {
3649
+ type: 'collection';
4085
3650
  empty?: boolean;
4086
- dir: string;
4087
- collectionDir: string;
4088
3651
  /**
4089
3652
  * When `true` this flag will transform aliased import paths defined in
4090
3653
  * a project's `tsconfig.json` to relative import paths in the compiled output.
4091
3654
  *
4092
- * Paths will be left in aliased format if `false` or `undefined`.
3655
+ * Paths will be left in aliased format if `false`. Defaults to `true`.
4093
3656
  *
4094
3657
  * @example
4095
3658
  * // tsconfig.json
@@ -4106,49 +3669,135 @@ interface OutputTargetDistCollection extends OutputTargetValidationConfig {
4106
3669
  */
4107
3670
  transformAliasedImportPaths?: boolean | null;
4108
3671
  }
4109
- interface OutputTargetDistTypes extends OutputTargetValidationConfig {
4110
- type: 'dist-types';
4111
- dir: string;
4112
- typesDir: string;
3672
+ /**
3673
+ * Output target for generating TypeScript type definitions (.d.ts files).
3674
+ *
3675
+ * Formerly a sub-output of 'dist' and 'dist-custom-elements' in v4,
3676
+ * now a first-class output target in v5 that can be shared across multiple outputs.
3677
+ *
3678
+ * In production builds, this output is auto-generated unless explicitly configured.
3679
+ *
3680
+ * @example
3681
+ * ```typescript
3682
+ * {
3683
+ * type: 'types',
3684
+ * dir: 'dist/types'
3685
+ * }
3686
+ * ```
3687
+ */
3688
+ interface OutputTargetTypes extends OutputTargetBaseNext {
3689
+ type: 'types';
3690
+ empty?: boolean;
4113
3691
  }
4114
3692
  interface OutputTargetDistLazy extends OutputTargetBase {
4115
3693
  type: 'dist-lazy';
4116
3694
  dir?: string;
4117
3695
  esmDir?: string;
4118
- esmEs5Dir?: string;
4119
- systemDir?: string;
4120
3696
  cjsDir?: string;
4121
- polyfills?: boolean;
4122
3697
  isBrowserBuild?: boolean;
4123
3698
  esmIndexFile?: string;
4124
3699
  cjsIndexFile?: string;
4125
- systemLoaderFile?: string;
4126
- legacyLoaderFile?: string;
3700
+ loaderDir?: string;
3701
+ typesDir?: string;
4127
3702
  empty?: boolean;
3703
+ /** Inherited from parent output target (loader-bundle or www). Only meaningful for browser builds. */
3704
+ hashFileNames?: boolean;
3705
+ /** Inherited from parent output target (loader-bundle or www). */
3706
+ hashedFileNameLength?: number;
3707
+ /** Inherited from loader-bundle. When true, @stencil/core is external in this bundler output. */
3708
+ externalRuntime?: boolean;
4128
3709
  }
4129
- interface OutputTargetDistGlobalStyles extends OutputTargetBase {
4130
- type: 'dist-global-styles';
4131
- file: string;
4132
- }
4133
- interface OutputTargetDistLazyLoader extends OutputTargetBase {
4134
- type: 'dist-lazy-loader';
4135
- dir: string;
4136
- esmDir: string;
4137
- esmEs5Dir?: string;
4138
- cjsDir: string;
4139
- componentDts: string;
4140
- empty: boolean;
4141
- }
4142
- interface OutputTargetHydrate extends OutputTargetBase {
4143
- type: 'dist-hydrate-script';
4144
- dir?: string;
3710
+ /**
3711
+ * Output target for global styles.
3712
+ * Generates a CSS file from an input stylesheet.
3713
+ *
3714
+ * Can be configured in two ways:
3715
+ * 1. **Implicit** (backwards compat): Set `globalStyle` in the config and this output is auto-generated
3716
+ * 2. **Explicit**: Define this output target with an `input` property
3717
+ *
3718
+ * Multiple `global-style` outputs are supported for building separate CSS bundles.
3719
+ *
3720
+ * @example
3721
+ * ```typescript
3722
+ * // Explicit configuration with custom input/output
3723
+ * {
3724
+ * type: 'global-style',
3725
+ * input: './src/theme.css',
3726
+ * fileName: 'theme.css',
3727
+ * dir: 'dist/assets',
3728
+ * copyToLoaderBrowser: false
3729
+ * }
3730
+ * ```
3731
+ */
3732
+ interface OutputTargetGlobalStyle extends OutputTargetBaseNext {
3733
+ type: 'global-style';
4145
3734
  /**
4146
- * Whether to generate a package.json file in the hydrate output directory.
4147
- * Defaults to `true`
4148
- * @deprecated
4149
- * In the next major release, the `package.json` file will be completely removed from the `dist-hydrate-script` output (use `exports` from your library's main `package.json`)
3735
+ * Path to the input CSS file to compile.
3736
+ * When specified, this takes precedence over the `globalStyle` config option.
3737
+ *
3738
+ * If neither `input` nor `globalStyle` config is set, no CSS will be built.
4150
3739
  */
4151
- generatePackageJson?: boolean;
3740
+ input?: string;
3741
+ /**
3742
+ * Output filename for the compiled CSS.
3743
+ * @default '{namespace}.css' when using globalStyle config, or basename of input file
3744
+ */
3745
+ fileName?: string;
3746
+ /**
3747
+ * When `true`, also copies the global style CSS to the loader-bundle browser directory
3748
+ * for backwards compatibility with existing CDN consumers who have hardcoded CSS paths.
3749
+ *
3750
+ * @default true
3751
+ */
3752
+ copyToLoaderBrowser?: boolean;
3753
+ /**
3754
+ * Controls whether this global stylesheet is injected into component shadow DOMs
3755
+ * as a constructable stylesheet at runtime.
3756
+ *
3757
+ * - `'none'`: Don't inject - stylesheet must be loaded externally (e.g., via `<link>`)
3758
+ * - `'client'`: Inject only in client builds, not SSR (reduces SSR output size)
3759
+ * - `'all'`: Inject in both client and SSR builds
3760
+ *
3761
+ * @default 'client' when the stylesheet comes from `globalStyle` (or an auto-detected `src/global.*`), 'none' when `input` is set
3762
+ */
3763
+ inject?: 'none' | 'client' | 'all';
3764
+ }
3765
+ /**
3766
+ * Output target for component assets.
3767
+ * Copies all component `assetsDirs` to a unified location.
3768
+ *
3769
+ * auto-generated when components have `assetsDirs` unless explicitly configured.
3770
+ * The output is placed in `dist/assets/` by default and is available to all distribution strategies.
3771
+ *
3772
+ * @example
3773
+ * ```typescript
3774
+ * {
3775
+ * type: 'assets',
3776
+ * dir: 'dist/assets'
3777
+ * }
3778
+ * ```
3779
+ */
3780
+ interface OutputTargetAssets extends OutputTargetBaseNext {
3781
+ type: 'assets';
3782
+ }
3783
+ /**
3784
+ * Output target for server-side rendering (SSR) and hydration.
3785
+ * Generates a script that can be used for SSR and static site generation (prerendering).
3786
+ *
3787
+ * Formerly known as 'dist-hydrate-script' in v4.
3788
+ *
3789
+ * @example
3790
+ * ```typescript
3791
+ * {
3792
+ * type: 'ssr',
3793
+ * dir: 'dist/ssr',
3794
+ * minify: true
3795
+ * }
3796
+ * ```
3797
+ */
3798
+ interface OutputTargetSsr extends OutputTargetBase {
3799
+ type: 'ssr';
3800
+ dir?: string;
4152
3801
  /**
4153
3802
  * Module IDs that should not be bundled into the script.
4154
3803
  * By default, all node builtin's, such as `fs` or `path`
@@ -4157,6 +3806,26 @@ interface OutputTargetHydrate extends OutputTargetBase {
4157
3806
  external?: string[];
4158
3807
  empty?: boolean;
4159
3808
  minify?: boolean;
3809
+ /**
3810
+ * Whether to generate CommonJS (CJS) bundles.
3811
+ *
3812
+ * When `true`, generates CJS output as `index.cjs` alongside ESM `index.js`.
3813
+ * When `false` (default in v5+), only ESM bundles are generated.
3814
+ *
3815
+ * @default false
3816
+ */
3817
+ cjs?: boolean;
3818
+ }
3819
+ /**
3820
+ * Compiles the SSR hydrate app to a WASM plugin (via `extism-js`/QuickJS-ng) that can run
3821
+ * outside of Node
3822
+ */
3823
+ interface OutputTargetSsrWasm extends OutputTargetBase {
3824
+ type: 'ssr-wasm';
3825
+ /** Output directory. @default 'dist/ssr-wasm' */
3826
+ dir?: string;
3827
+ empty?: boolean;
3828
+ minify?: boolean;
4160
3829
  }
4161
3830
  interface OutputTargetCustom extends OutputTargetBase {
4162
3831
  type: 'custom';
@@ -4215,6 +3884,22 @@ interface OutputTargetDocsReadme extends OutputTargetBase {
4215
3884
  overwriteExisting?: boolean | 'if-missing';
4216
3885
  footer?: string;
4217
3886
  strict?: boolean;
3887
+ /**
3888
+ * Add extra columns to the generated Properties/Events tables, e.g. to
3889
+ * surface custom JSDoc tags as a column of their own.
3890
+ */
3891
+ customColumns?: {
3892
+ props?: DocsReadmeCustomColumn<JsonDocsProp>[];
3893
+ events?: DocsReadmeCustomColumn<JsonDocsEvent>[];
3894
+ };
3895
+ }
3896
+ /**
3897
+ * A custom column to render in a `docs-readme` Properties/Events table.
3898
+ * `content` is invoked once per row.
3899
+ */
3900
+ interface DocsReadmeCustomColumn<T> {
3901
+ header: string;
3902
+ content: (member: T, cmp: JsonDocsComponent) => string;
4218
3903
  }
4219
3904
  interface OutputTargetDocsJson extends OutputTargetBase {
4220
3905
  type: 'docs-json';
@@ -4245,9 +3930,11 @@ interface OutputTargetDocsCustomElementsManifest extends OutputTargetBase {
4245
3930
  type: 'docs-custom-elements-manifest';
4246
3931
  /**
4247
3932
  * The file path where the custom-elements.json manifest will be written.
4248
- * Defaults to 'custom-elements.json' in the root directory.
3933
+ * Defaults to 'dist/custom-elements.json'.
3934
+ *
3935
+ * The `customElements` field of the project's `package.json` is set to this path.
4249
3936
  */
4250
- file: string;
3937
+ file?: string;
4251
3938
  strict?: boolean;
4252
3939
  }
4253
3940
  interface OutputTargetDocsCustom extends OutputTargetBase {
@@ -4255,18 +3942,46 @@ interface OutputTargetDocsCustom extends OutputTargetBase {
4255
3942
  generator: (docs: JsonDocs, config: Config) => void | Promise<void>;
4256
3943
  strict?: boolean;
4257
3944
  }
3945
+ /**
3946
+ * Output target for generating an [Agent Skill](https://agentskills.io)
3947
+ * (`SKILL.md` + per-component reference files) describing a component
3948
+ * library, so AI coding agents can consume its API and usage examples
3949
+ * directly.
3950
+ */
3951
+ interface OutputTargetDocsAgentSkill extends OutputTargetBase {
3952
+ type: 'docs-agent-skill';
3953
+ /**
3954
+ * The root directory where the skill (`SKILL.md` + `components/*.md`) is written.
3955
+ *
3956
+ * defaults to `dist/skill`
3957
+ */
3958
+ dir?: string;
3959
+ /**
3960
+ * The skill's name, used in the `SKILL.md` frontmatter.
3961
+ *
3962
+ * Defaults to {@link Config.namespace}, lowercased, with anything other than letters and numbers replaced by `-`.
3963
+ */
3964
+ name?: string;
3965
+ /**
3966
+ * The skill's description, used in the `SKILL.md` frontmatter - this is the
3967
+ * text agents use to decide when to load the skill.
3968
+ *
3969
+ * Defaults to an auto-generated sentence built from the project's
3970
+ * {@link JsonDocs.usage} (if present) or its component tags.
3971
+ */
3972
+ description?: string;
3973
+ }
4258
3974
  interface OutputTargetStats extends OutputTargetBase {
4259
3975
  type: 'stats';
4260
3976
  file?: string;
4261
3977
  }
4262
- interface OutputTargetBaseNext {
4263
- type: string;
3978
+ interface OutputTargetBaseNext extends OutputTargetBase {
4264
3979
  dir?: string;
4265
3980
  }
4266
3981
  /**
4267
3982
  * The collection of valid export behaviors.
4268
3983
  * Used to generate a type for typed configs as well as output target validation
4269
- * for the `dist-custom-elements` output target.
3984
+ * for the `standalone` output target.
4270
3985
  *
4271
3986
  * Adding a value to this const array will automatically add it as a valid option on the
4272
3987
  * output target configuration for `customElementsExportBehavior`.
@@ -4275,8 +3990,7 @@ interface OutputTargetBaseNext {
4275
3990
  * - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
4276
3991
  * functionality allows consumers to bypass the explicit call to define a component, its children, its children's
4277
3992
  * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
4278
- * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory. This behavior was added to allow easy migration
4279
- * from `dist-custom-elements-bundle` to `dist-custom-elements`.
3993
+ * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory.
4280
3994
  * - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.
4281
3995
  */
4282
3996
  declare const CustomElementsExportBehaviorOptions: readonly ["default", "auto-define-custom-elements", "bundle", "single-export-module"];
@@ -4285,23 +3999,38 @@ declare const CustomElementsExportBehaviorOptions: readonly ["default", "auto-de
4285
3999
  * This is used on the output target config for intellisense in typed configs.
4286
4000
  */
4287
4001
  type CustomElementsExportBehavior = (typeof CustomElementsExportBehaviorOptions)[number];
4288
- interface OutputTargetDistCustomElements extends OutputTargetValidationConfig {
4289
- type: 'dist-custom-elements';
4002
+ /**
4003
+ * Output target for generating standalone component modules.
4004
+ * Each component is output as an individual ES module that can be directly imported.
4005
+ *
4006
+ * This output target is ideal for npm consumption and tree-shaking, as consumers
4007
+ * can import only the components they need.
4008
+ *
4009
+ * Formerly known as 'dist-custom-elements' in v4.
4010
+ *
4011
+ * @example
4012
+ * ```typescript
4013
+ * {
4014
+ * type: 'standalone',
4015
+ * dir: 'dist/standalone',
4016
+ * externalRuntime: true,
4017
+ * autoLoader: true
4018
+ * }
4019
+ * ```
4020
+ */
4021
+ interface OutputTargetStandalone extends OutputTargetBaseNext {
4022
+ type: 'standalone';
4290
4023
  empty?: boolean;
4291
4024
  /**
4292
- * Triggers the following behaviors when enabled:
4293
- * 1. All `@stencil/core/*` module references are treated as external during bundling.
4294
- * 2. File names are not hashed.
4295
- * 3. File minification will follow the behavior defined at the root of the Stencil config.
4025
+ * When `true`, all `@stencil/core/*` module references are treated as external
4026
+ * during bundling rather than being included in the generated output.
4027
+ *
4028
+ * @default false
4296
4029
  */
4297
4030
  externalRuntime?: boolean;
4298
4031
  copy?: CopyTask[];
4299
4032
  includeGlobalScripts?: boolean;
4300
4033
  minify?: boolean;
4301
- /**
4302
- * Enables the generation of type definition files for the output target.
4303
- */
4304
- generateTypeDeclarations?: boolean;
4305
4034
  /**
4306
4035
  * Define the export/definition behavior for the output target's generated output.
4307
4036
  * This controls if/how custom elements will be defined or where components will be exported from.
@@ -4312,6 +4041,8 @@ interface OutputTargetDistCustomElements extends OutputTargetValidationConfig {
4312
4041
  * Generate an auto-loader script that uses MutationObserver to lazily load
4313
4042
  * and define custom elements as they appear in the DOM.
4314
4043
  *
4044
+ * @default true
4045
+ *
4315
4046
  * When set to `true`, generates a `loader.js` file that auto-starts on import.
4316
4047
  * Can also be configured with an object for more control:
4317
4048
  * - `fileName`: Custom filename for the loader (default: 'loader.js')
@@ -4351,27 +4082,47 @@ interface OutputTargetBase {
4351
4082
  * A unique string to differentiate one output target from another
4352
4083
  */
4353
4084
  type: string;
4354
- }
4355
- /**
4356
- * Output targets that can have validation for common `package.json` field values
4357
- * (module, types, etc.). This allows them to be marked for validation in a project's Stencil config.
4358
- */
4359
- interface OutputTargetValidationConfig extends OutputTargetBaseNext {
4360
- isPrimaryPackageOutputTarget?: boolean;
4361
- }
4362
- type EligiblePrimaryPackageOutputTarget = OutputTargetDist | OutputTargetDistCustomElements | OutputTargetDistCollection | OutputTargetDistTypes;
4363
- type OutputTargetBuild = OutputTargetDistCollection | OutputTargetDistLazy;
4085
+ /**
4086
+ * When `true`, this output target will be skipped during development builds (`--dev`).
4087
+ * This improves dev build times by not generating production-only artifacts.
4088
+ *
4089
+ * Defaults vary by output target type:
4090
+ * - `loader-bundle`: `true` (skips the npm distribution files; the browser bundle always builds)
4091
+ * - `standalone`: `true` if `loader-bundle` is also configured, otherwise `false`
4092
+ * - `types`, `collection`, `ssr-wasm`: `true` (skips in dev)
4093
+ * - `assets`, `global-style`: `false` (always runs)
4094
+ * - `ssr`: `true` (skips in dev, unless `devServer.ssr` is enabled)
4095
+ * - `docs-*`: `true` (skips in dev)
4096
+ * - `custom`: `true` (skips in dev)
4097
+ * - `www`, `copy`, `stats`: `false` (always runs)
4098
+ */
4099
+ skipInDev?: boolean;
4100
+ }
4101
+ type OutputTargetBuild = OutputTargetCollection | OutputTargetDistLazy;
4364
4102
  interface OutputTargetCopy extends OutputTargetBase {
4365
4103
  type: 'copy';
4366
4104
  dir: string;
4367
4105
  copy?: CopyTask[];
4368
- copyAssets?: 'collection' | 'dist';
4369
4106
  }
4370
4107
  interface OutputTargetWww extends OutputTargetBase {
4371
4108
  /**
4372
4109
  * Webapp output target.
4373
4110
  */
4374
4111
  type: 'www';
4112
+ /**
4113
+ * Choose how components are bundled for the www output.
4114
+ *
4115
+ * - `'loader'` (default): Uses the loader-bundle architecture with chunk
4116
+ * splitting and a loader infrastructure. Best for production apps with many
4117
+ * components where you want optimal loading performance.
4118
+ *
4119
+ * - `'standalone'`: Uses standalone component modules with an auto-loader that
4120
+ * uses MutationObserver to dynamically import components as they appear in
4121
+ * the DOM. Simpler architecture, easier debugging, one module per component.
4122
+ *
4123
+ * Default: `'loader'`
4124
+ */
4125
+ bundleMode?: 'loader' | 'standalone';
4375
4126
  /**
4376
4127
  * The directory to write the app's JavaScript and CSS build
4377
4128
  * files to. The default is to place this directory as a child
@@ -4414,17 +4165,11 @@ interface OutputTargetWww extends OutputTargetBase {
4414
4165
  * Default: `/`
4415
4166
  */
4416
4167
  baseUrl?: string;
4417
- /**
4418
- * By default, stencil will include all the polyfills required by legacy browsers in the ES5 build.
4419
- * If it's `false`, stencil will not emit this polyfills anymore and it's your responsibility to provide them before
4420
- * stencil initializes.
4421
- */
4422
- polyfills?: boolean;
4423
4168
  /**
4424
4169
  * Path to an external node module which has exports of the prerender config object.
4425
4170
  * ```
4426
4171
  * module.exports = {
4427
- * afterHydrate(document, url) {
4172
+ * afterSsr(document, url) {
4428
4173
  * document.title = `URL: ${url.href}`;
4429
4174
  * }
4430
4175
  * }
@@ -4432,15 +4177,35 @@ interface OutputTargetWww extends OutputTargetBase {
4432
4177
  */
4433
4178
  prerenderConfig?: string;
4434
4179
  /**
4435
- * Service worker config for production builds. During development builds
4436
- * service worker script will be injected to automatically deregister existing
4437
- * service workers. When set to `false` neither a service worker registration
4438
- * or deregistration will be added to the index.html.
4180
+ * Service worker config for production builds. In development mode, a script
4181
+ * to deregister existing service workers is always injected. Defaults to
4182
+ * `null` (disabled). Set to `true` to enable with default settings, or provide
4183
+ * a config object for custom settings.
4439
4184
  */
4440
- serviceWorker?: ServiceWorkerConfig | null | false;
4185
+ serviceWorker?: ServiceWorkerConfig | true | null;
4441
4186
  appDir?: string;
4187
+ /**
4188
+ * Hash the filenames of generated chunks based on their content.
4189
+ * Enables forever-caching of CDN-served bundles.
4190
+ *
4191
+ * @default true in production, false in dev mode
4192
+ */
4193
+ hashFileNames?: boolean;
4194
+ /**
4195
+ * Number of characters to use for the content hash in filenames.
4196
+ *
4197
+ * @default 8
4198
+ */
4199
+ hashedFileNameLength?: number;
4442
4200
  }
4443
- type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetDist | OutputTargetDistCollection | OutputTargetDistCustomElements | OutputTargetDistLazy | OutputTargetDistGlobalStyles | OutputTargetDistLazyLoader | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustomElementsManifest | OutputTargetWww | OutputTargetHydrate | OutputTargetStats | OutputTargetDistTypes;
4201
+ type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetLoaderBundle | OutputTargetStandalone | OutputTargetSsr | OutputTargetSsrWasm | OutputTargetCollection | OutputTargetTypes | OutputTargetGlobalStyle | OutputTargetAssets | OutputTargetDistLazy | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetDocsCustomElementsManifest | OutputTargetDocsAgentSkill | OutputTargetWww | OutputTargetStats;
4202
+ /**
4203
+ * A post-validation form of {@link OutputTargetWww} where `serviceWorker`
4204
+ * has been normalized - `true` is resolved to a {@link ServiceWorkerConfig}.
4205
+ */
4206
+ type ValidatedOutputTargetWww = Omit<OutputTargetWww, 'serviceWorker'> & {
4207
+ serviceWorker?: ServiceWorkerConfig | null;
4208
+ };
4444
4209
  /**
4445
4210
  * Our custom configuration interface for generated caching Service Workers
4446
4211
  * using the Workbox library (see https://developer.chrome.com/docs/workbox/).
@@ -4488,12 +4253,6 @@ interface LoadConfigInit {
4488
4253
  configPath?: string;
4489
4254
  logger?: Logger;
4490
4255
  sys?: CompilerSystem;
4491
- /**
4492
- * When set to true, if the "tsconfig.json" file is not found
4493
- * it'll automatically generate and save a default tsconfig
4494
- * within the root directory.
4495
- */
4496
- initTsConfig?: boolean;
4497
4256
  }
4498
4257
  /**
4499
4258
  * Results from an attempt to load a config. The values on this interface
@@ -4526,33 +4285,18 @@ interface Diagnostic$1 {
4526
4285
  relFilePath?: string | undefined;
4527
4286
  type: string;
4528
4287
  }
4529
- interface CacheStorage {
4530
- get(key: string): Promise<any>;
4531
- set(key: string, value: any): Promise<void>;
4532
- }
4533
4288
  interface WorkerOptions {
4534
4289
  maxConcurrentWorkers?: number;
4535
4290
  maxConcurrentTasksPerWorker?: number;
4536
4291
  logger?: Logger;
4537
4292
  }
4538
- interface RollupInterface {
4539
- rollup: {
4540
- (config: any): Promise<any>;
4541
- };
4542
- plugins: {
4543
- nodeResolve(opts: any): any;
4544
- replace(opts: any): any;
4545
- commonjs(opts: any): any;
4546
- json(): any;
4547
- };
4548
- }
4549
4293
  interface ResolveModuleOptions {
4550
4294
  manuallyResolve?: boolean;
4551
4295
  packageJson?: boolean;
4552
4296
  }
4553
4297
  interface PrerenderStartOptions {
4554
4298
  buildId?: string;
4555
- hydrateAppFilePath?: string;
4299
+ ssrAppFilePath?: string;
4556
4300
  componentGraph?: BuildResultsComponentGraph;
4557
4301
  srcIndexHtmlPath?: string;
4558
4302
  }
@@ -4577,14 +4321,26 @@ interface OptimizeCssInput {
4577
4321
  resolveUrl?: (url: string) => Promise<string> | string;
4578
4322
  }
4579
4323
  /**
4580
- * This is not a real interface describing the options which can
4581
- * be passed to autoprefixer, for that see the docs, here:
4582
- * https://github.com/postcss/autoprefixer#options
4324
+ * Options for autoprefixing CSS via Lightning CSS.
4583
4325
  *
4584
- * Instead, this basically just serves as a label type to track
4585
- * that arguments are being passed consistently.
4326
+ * The `targets` field accepts a browserslist query array. When omitted,
4327
+ * Stencil uses a modern default browser list suitable for Stencil v5+.
4328
+ *
4329
+ * @example
4330
+ * ```ts
4331
+ * autoprefixer: {
4332
+ * targets: ['last 2 Chrome versions', 'last 2 Safari versions', 'iOS >= 14'],
4333
+ * }
4334
+ * ```
4586
4335
  */
4587
- type AutoprefixerOptions = Object;
4336
+ interface AutoprefixerOptions {
4337
+ /**
4338
+ * A browserslist query array describing which browsers to generate vendor
4339
+ * prefixes for. Defaults to a modern set of browsers appropriate for
4340
+ * Stencil v5+.
4341
+ */
4342
+ targets?: string[];
4343
+ }
4588
4344
  /**
4589
4345
  * Output from CSS optimization functions, wrapping up optimized
4590
4346
  * CSS and any diagnostics produced during optimization.
@@ -4596,7 +4352,7 @@ interface OptimizeCssOutput {
4596
4352
  interface OptimizeJsInput {
4597
4353
  input: string;
4598
4354
  filePath?: string;
4599
- target?: 'es5' | 'latest';
4355
+ target?: 'latest';
4600
4356
  pretty?: boolean;
4601
4357
  sourceMap?: boolean;
4602
4358
  }
@@ -4610,61 +4366,23 @@ interface LazyRequire {
4610
4366
  require(fromDir: string, moduleId: string): any;
4611
4367
  getModulePath(fromDir: string, moduleId: string): string;
4612
4368
  }
4613
- /**
4614
- * @deprecated This interface is no longer used by Stencil
4615
- * TODO(STENCIL-743): Remove this interface
4616
- */
4617
- interface FsWatcherItem {
4618
- close(): void;
4619
- }
4620
- /**
4621
- * @deprecated This interface is no longer used by Stencil
4622
- * TODO(STENCIL-743): Remove this interface
4623
- */
4624
- interface MakeDirectoryOptions {
4625
- /**
4626
- * Indicates whether parent folders should be created.
4627
- * @default false
4628
- */
4629
- recursive?: boolean;
4630
- /**
4631
- * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
4632
- * @default 0o777.
4633
- */
4634
- mode?: number;
4635
- }
4636
- /**
4637
- * @deprecated This interface is no longer used by Stencil
4638
- * TODO(STENCIL-743): Remove this interface
4639
- */
4640
- interface FsStats {
4641
- isFile(): boolean;
4642
- isDirectory(): boolean;
4643
- isBlockDevice(): boolean;
4644
- isCharacterDevice(): boolean;
4645
- isSymbolicLink(): boolean;
4646
- isFIFO(): boolean;
4647
- isSocket(): boolean;
4648
- dev: number;
4649
- ino: number;
4650
- mode: number;
4651
- nlink: number;
4652
- uid: number;
4653
- gid: number;
4654
- rdev: number;
4655
- size: number;
4656
- blksize: number;
4657
- blocks: number;
4658
- atime: Date;
4659
- mtime: Date;
4660
- ctime: Date;
4661
- birthtime: Date;
4662
- }
4663
4369
  interface Compiler {
4664
4370
  build(): Promise<CompilerBuildResults>;
4665
4371
  createWatcher(): Promise<CompilerWatcher>;
4666
4372
  destroy(): Promise<void>;
4667
4373
  sys: CompilerSystem;
4374
+ /**
4375
+ * @internal - Testing only. Access to the in-memory filesystem
4376
+ */
4377
+ fs?: InMemoryFileSystem;
4378
+ /**
4379
+ * @internal - Testing only. Access to the validated configuration
4380
+ */
4381
+ config?: ValidatedConfig;
4382
+ /**
4383
+ * @internal - Testing only. Access to the compiler context
4384
+ */
4385
+ compilerCtx?: CompilerCtx;
4668
4386
  }
4669
4387
  interface CompilerWatcher extends BuildOnEvents {
4670
4388
  start: () => Promise<WatcherCloseResults>;
@@ -4693,9 +4411,11 @@ interface CompilerRequestResponse {
4693
4411
  interface TranspileOptions {
4694
4412
  /**
4695
4413
  * A component can be defined as a custom element by using `customelement`, or the
4696
- * component class can be exported by using `module`. Default is `customelement`.
4414
+ * component class can be exported by using `module`. Set to `null` to leave the
4415
+ * class's own export as-is (used with `componentMetadata: 'compilerstatic'` for
4416
+ * unit-testing preprocessors). Default is `customelement`.
4697
4417
  */
4698
- componentExport?: 'customelement' | 'module' | string | undefined;
4418
+ componentExport?: 'customelement' | 'module' | string | null | undefined;
4699
4419
  /**
4700
4420
  * Sets how and if component metadata should be assigned on the compiled
4701
4421
  * component output. The `compilerstatic` value will set the metadata to
@@ -4705,7 +4425,7 @@ interface TranspileOptions {
4705
4425
  componentMetadata?: 'runtimestatic' | 'compilerstatic' | string | undefined;
4706
4426
  /**
4707
4427
  * The actual internal import path for any `@stencil/core` imports.
4708
- * Default is `@stencil/core/runtime/client`.
4428
+ * Default is `@stencil/core/runtime/client/standalone`.
4709
4429
  */
4710
4430
  coreImportPath?: string;
4711
4431
  /**
@@ -4730,8 +4450,11 @@ interface TranspileOptions {
4730
4450
  /**
4731
4451
  * How component styles should be associated to the component. The `static`
4732
4452
  * setting will assign the styles as a static getter on the component class.
4453
+ * Set to `null` to skip the assignment entirely (and leave any `styleUrl`
4454
+ * import unresolved) - useful for unit-testing preprocessors that don't
4455
+ * need real stylesheets.
4733
4456
  */
4734
- style?: 'static' | string | undefined;
4457
+ style?: 'static' | string | null | undefined;
4735
4458
  /**
4736
4459
  * How style data should be added for imports. For example, the `queryparams` value
4737
4460
  * adds the component's tagname and encapsulation info as querystring parameter
@@ -4741,8 +4464,8 @@ interface TranspileOptions {
4741
4464
  */
4742
4465
  styleImportData?: 'queryparams' | string | undefined;
4743
4466
  /**
4744
- * The JavaScript source target TypeScript should to transpile to. Values can be
4745
- * `latest`, `esnext`, `es2017`, `es2015`, or `es5`. Defaults to `latest`.
4467
+ * The JavaScript source target TypeScript should transpile to. Values can be
4468
+ * `latest`, `esnext`, `es2020`, `es2017`, or `es2015`. Defaults to `latest`.
4746
4469
  */
4747
4470
  target?: CompileTarget;
4748
4471
  /**
@@ -4791,8 +4514,58 @@ interface TranspileOptions {
4791
4514
  * Adds `transformTag` calls to css strings and querySelector(All) calls
4792
4515
  */
4793
4516
  additionalTagTransformers?: boolean;
4517
+ /**
4518
+ * Callback used to resolve parent-class source for inheritance-chain analysis.
4519
+ * Called when a component's `extends` clause references a class from another
4520
+ * module. Return the resolved absolute path and source text of that module,
4521
+ * or `null` to skip inheritance resolution for that specifier.
4522
+ *
4523
+ * @example
4524
+ * ```ts
4525
+ * transpile(myComponentCode, {
4526
+ * resolveImport: (specifier, importer) => {
4527
+ * const resolved = require.resolve(specifier, { paths: [path.dirname(importer)] });
4528
+ * return { code: fs.readFileSync(resolved, 'utf8'), path: resolved };
4529
+ * },
4530
+ * });
4531
+ * ```
4532
+ */
4533
+ resolveImport?: (specifier: string, importer: string) => {
4534
+ code: string;
4535
+ path: string;
4536
+ } | null;
4537
+ /**
4538
+ * When `true` class declarations at the end of a `@Component` inheritance chain
4539
+ * * that have no `extends` clause * will get `extends HTMLElement` injected, and a minimal
4540
+ * `constructor() { super(); }`. Any stencil static meta-getters are also stripped.
4541
+ */
4542
+ transformAsBaseClass?: boolean;
4543
+ /**
4544
+ * Overrides for Stencil's BUILD feature flags in the generated output.
4545
+ * When set, a BUILD mutation statement is prepended to the compiled code so
4546
+ * that the specified flags take effect for this component at runtime.
4547
+ */
4548
+ buildOverrides?: BuildOverrides;
4549
+ /**
4550
+ * When `true`, a `.css`/`.scss` transpile also collects CSS custom-property docs
4551
+ * onto {@link TranspileResults.styleDocs}. Off by default, since it costs an extra parse
4552
+ * of the style text.
4553
+ */
4554
+ docs?: boolean;
4794
4555
  }
4795
- type CompileTarget = 'latest' | 'esnext' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | 'es2015' | 'es5' | string | undefined;
4556
+ /**
4557
+ * Keys of {@link BuildConditionals} that can be meaningfully overridden at
4558
+ * transpile time — config-driven flags that are not derived from component
4559
+ * scanning or runtime environment detection.
4560
+ */
4561
+ type BuildOverrideKeys = 'isDev' | 'isTesting' | 'hotModuleReplacement' | 'signalBacking' | 'vdomSignals' | 'lightDomPatches' | 'slotChildNodes' | 'slotCloneNode' | 'slotDomMutations' | 'slotTextContent' | 'lifecycleDOMEvents' | 'initializeNextTick';
4562
+ /**
4563
+ * Subset of Stencil's BUILD feature flags that can be overridden at transpile
4564
+ * time. Derived from {@link BuildConditionals} via `Pick` so the field list
4565
+ * and types stay in sync with the authoritative definition.
4566
+ */
4567
+ type BuildOverrides = Pick<BuildConditionals, BuildOverrideKeys>;
4568
+ type CompileTarget = 'latest' | 'esnext' | 'es2022' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | string | undefined;
4796
4569
  interface TranspileResults {
4797
4570
  code: string;
4798
4571
  data?: any[];
@@ -4804,6 +4577,7 @@ interface TranspileResults {
4804
4577
  inputFilePath: string;
4805
4578
  map: any;
4806
4579
  outputFilePath: string;
4580
+ styleDocs?: StyleDoc[];
4807
4581
  }
4808
4582
  interface TransformOptions {
4809
4583
  coreImportPath: string;
@@ -4817,6 +4591,17 @@ interface TransformOptions {
4817
4591
  style: 'static' | null;
4818
4592
  styleImportData: 'queryparams' | null;
4819
4593
  target?: string;
4594
+ /**
4595
+ * @see {@link TranspileOptions.resolveImport}
4596
+ */
4597
+ resolveImport?: (specifier: string, importer: string) => {
4598
+ code: string;
4599
+ path: string;
4600
+ } | null;
4601
+ /** @see {@link TranspileOptions.transformAsBaseClass} */
4602
+ transformAsBaseClass?: boolean;
4603
+ /** @see {@link TranspileOptions.buildOverrides} */
4604
+ buildOverrides?: BuildOverrides;
4820
4605
  }
4821
4606
  interface CompileScriptMinifyOptions {
4822
4607
  target?: CompileTarget;
@@ -4836,16 +4621,35 @@ interface CliInitOptions {
4836
4621
  logger: Logger;
4837
4622
  sys: CompilerSystem;
4838
4623
  }
4624
+ /**
4625
+ * A Stencil `resolveId`/`load`/`transform` plugin, as accepted by {@link StencilConfig.plugins}.
4626
+ */
4627
+ interface Plugin$1 {
4628
+ name?: string;
4629
+ pluginType?: string;
4630
+ load?: (id: string, context: PluginCtx) => Promise<string> | string;
4631
+ resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
4632
+ transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults;
4633
+ }
4634
+ type PluginTransformResults = PluginTransformationDescriptor | string | null;
4635
+ interface PluginTransformationDescriptor {
4636
+ code?: string;
4637
+ map?: string;
4638
+ id?: string;
4639
+ diagnostics?: Diagnostic$1[];
4640
+ dependencies?: string[];
4641
+ }
4642
+ interface PluginCtx {
4643
+ config: Config;
4644
+ sys: CompilerSystem;
4645
+ fs: InMemoryFileSystem;
4646
+ cache: Cache;
4647
+ diagnostics: Diagnostic$1[];
4648
+ }
4839
4649
  //#endregion
4840
4650
  //#region src/declarations/stencil-private.d.ts
4841
- interface DocData {
4842
- hostIds: number;
4843
- rootLevelIds: number;
4844
- staticComponents: Set<string>;
4845
- }
4846
- type StencilDocument = Document & {
4847
- _stencilDocData: DocData;
4848
- };
4651
+ /** Build-time virtual `@import`s a `global-style` input can use to place Stencil-generated CSS. */
4652
+ type StencilVirtualImport = 'stencil-hydrate' | 'stencil-component-globals' | 'stencil-css-components';
4849
4653
  interface SourceMap$1 {
4850
4654
  file: string;
4851
4655
  mappings: string;
@@ -4862,38 +4666,17 @@ interface PrintLine {
4862
4666
  errorCharStart: number;
4863
4667
  errorLength?: number;
4864
4668
  }
4865
- interface AssetsMeta {
4866
- absolutePath: string;
4867
- cmpRelativePath: string;
4868
- originalComponentPath: string;
4869
- }
4870
- interface ParsedImport {
4871
- importPath: string;
4872
- basename: string;
4873
- ext: string;
4874
- data: ImportData;
4875
- }
4876
- interface ImportData {
4877
- tag?: string;
4878
- encapsulation?: string;
4879
- mode?: string;
4880
- }
4881
- interface SerializeImportData extends ImportData {
4882
- importeePath: string;
4883
- importerPath?: string;
4884
- /**
4885
- * True if this is a node module import (e.g. using ~ prefix like ~foo/style.css)
4886
- * These should be treated as bare module specifiers and not have ./ prepended
4887
- */
4888
- isNodeModule?: boolean;
4889
- }
4890
4669
  interface BuildFeatures {
4891
4670
  style: boolean;
4892
4671
  mode: boolean;
4893
4672
  formAssociated: boolean;
4894
4673
  shadowDom: boolean;
4895
4674
  shadowDelegatesFocus: boolean;
4675
+ shadowModeClosed: boolean;
4896
4676
  shadowSlotAssignmentManual: boolean;
4677
+ shadowClonable: boolean;
4678
+ shadowSerializable: boolean;
4679
+ shadowReferenceTarget: boolean;
4897
4680
  scoped: boolean;
4898
4681
  /**
4899
4682
  * Every component has a render function
@@ -4910,11 +4693,18 @@ interface BuildFeatures {
4910
4693
  vdomKey: boolean;
4911
4694
  vdomListener: boolean;
4912
4695
  vdomPropOrAttr: boolean;
4696
+ /** True when at least one component uses the explicit `attr:`/`prop:` JSX prefix. */
4697
+ vdomPropOrAttrPrefix: boolean;
4913
4698
  vdomRef: boolean;
4914
4699
  vdomStyle: boolean;
4915
4700
  vdomText: boolean;
4916
4701
  vdomXlink: boolean;
4702
+ vdomSignals: boolean;
4917
4703
  slotRelocation: boolean;
4704
+ patchAll: boolean;
4705
+ patchChildren: boolean;
4706
+ patchClone: boolean;
4707
+ patchInsert: boolean;
4918
4708
  slot: boolean;
4919
4709
  svg: boolean;
4920
4710
  element: boolean;
@@ -4923,10 +4713,6 @@ interface BuildFeatures {
4923
4713
  hostListenerTargetWindow: boolean;
4924
4714
  hostListenerTargetDocument: boolean;
4925
4715
  hostListenerTargetBody: boolean;
4926
- /**
4927
- * @deprecated Prevented from new apps, but left in for older collections
4928
- */
4929
- hostListenerTargetParent: boolean;
4930
4716
  hostListenerTarget: boolean;
4931
4717
  method: boolean;
4932
4718
  prop: boolean;
@@ -4960,33 +4746,34 @@ interface BuildConditionals extends Partial<BuildFeatures> {
4960
4746
  lazyLoad?: boolean;
4961
4747
  profile?: boolean;
4962
4748
  constructableCSS?: boolean;
4963
- appendChildSlotFix?: boolean;
4964
- slotChildNodesFix?: boolean;
4965
- scopedSlotTextContentFix?: boolean;
4966
- cloneNodeFix?: boolean;
4749
+ /** True when `compat.lightDomPatches === true` - enables `applyLightDomPatches` shortcut. */
4750
+ lightDomPatches?: boolean;
4751
+ /** Patch `childNodes`/`children` getters on light-dom slotted components. */
4752
+ slotChildNodes?: boolean;
4753
+ /** Patch `cloneNode()` on light-dom slotted components. */
4754
+ slotCloneNode?: boolean;
4755
+ /** Patch `appendChild`/`insertBefore`/`removeChild` on light-dom slotted components. */
4756
+ slotDomMutations?: boolean;
4757
+ /** Patch `textContent` on light-dom slotted components. */
4758
+ slotTextContent?: boolean;
4967
4759
  hydratedAttribute?: boolean;
4968
4760
  hydratedClass?: boolean;
4969
4761
  hydratedSelectorName?: string;
4762
+ /** True when a global-style input contains `@import "stencil-hydrate"` - suppresses dynamic style injection in the loader. */
4763
+ staticHydrationStyles?: boolean;
4970
4764
  initializeNextTick?: boolean;
4971
- shadowDomShim?: boolean;
4972
4765
  asyncQueue?: boolean;
4973
- transformTagName?: boolean;
4974
4766
  additionalTagTransformers?: boolean | 'prod';
4975
- attachStyles?: boolean;
4976
- experimentalSlotFixes?: boolean;
4977
- experimentalScopedSlotChanges?: boolean;
4978
- addGlobalStyleToComponents?: boolean;
4767
+ signalBacking?: boolean;
4768
+ /** True when JSX signal bypass is active - text nodes and attributes backed by Signal objects update the DOM directly. Auto-enabled when `signalBacking: true`. */
4769
+ vdomSignals?: boolean;
4979
4770
  }
4980
4771
  type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
4981
- interface RollupResultModule {
4772
+ interface RolldownResultModule {
4982
4773
  id: string;
4983
4774
  }
4984
- interface RollupResults {
4985
- modules: RollupResultModule[];
4986
- }
4987
- interface UpdatedLazyBuildCtx {
4988
- name: 'esm-browser' | 'esm' | 'cjs' | 'system';
4989
- buildCtx: BuildCtx;
4775
+ interface RolldownResults {
4776
+ modules: RolldownResultModule[];
4990
4777
  }
4991
4778
  interface BuildCtx {
4992
4779
  buildId: number;
@@ -5000,10 +4787,9 @@ interface BuildCtx {
5000
4787
  compilerCtx: CompilerCtx;
5001
4788
  esmBrowserComponentBundle: ReadonlyArray<BundleModule>;
5002
4789
  esmComponentBundle: ReadonlyArray<BundleModule>;
5003
- es5ComponentBundle: ReadonlyArray<BundleModule>;
5004
- systemComponentBundle: ReadonlyArray<BundleModule>;
5005
4790
  commonJsComponentBundle: ReadonlyArray<BundleModule>;
5006
4791
  components: ComponentCompilerMeta[];
4792
+ cssOnlyComponents: ComponentCompilerMeta[];
5007
4793
  componentGraph: Map<string, string[]>;
5008
4794
  config: ValidatedConfig;
5009
4795
  createTimeSpan(msg: string, debug?: boolean): LoggerTimeSpan;
@@ -5028,19 +4814,21 @@ interface BuildCtx {
5028
4814
  hasScriptChanges: boolean;
5029
4815
  hasStyleChanges: boolean;
5030
4816
  hasWarning: boolean;
5031
- hydrateAppFilePath: string;
4817
+ ssrAppFilePath: string;
5032
4818
  indexBuildCount: number;
5033
4819
  indexDoc: Document;
4820
+ /** All non-entry HTML files found in srcDir, keyed by path relative to srcDir */
4821
+ htmlDocs: Map<string, Document>;
5034
4822
  isRebuild: boolean;
5035
4823
  /**
5036
4824
  * A collection of Stencil's intermediate representation of components, tied to the current build
5037
4825
  */
5038
4826
  moduleFiles: Module[];
5039
- packageJson: PackageJsonData;
4827
+ packageJson: PackageJsonData | null;
5040
4828
  pendingCopyTasks: Promise<CopyResults>[];
5041
4829
  progress(task: BuildTask): void;
5042
4830
  requiresFullBuild: boolean;
5043
- rollupResults?: RollupResults;
4831
+ rolldownResults?: RolldownResults;
5044
4832
  scriptsAdded: string[];
5045
4833
  scriptsDeleted: string[];
5046
4834
  startTime: number;
@@ -5050,6 +4838,9 @@ interface BuildCtx {
5050
4838
  */
5051
4839
  stylesPromise: Promise<string>;
5052
4840
  stylesUpdated: BuildStyleUpdate[];
4841
+ globalStylesUpdated: BuildGlobalStyleLinkUpdate[];
4842
+ /** Absolute path of the generated `{fsNamespace}.css`, when this build emitted one */
4843
+ stencilCssFile?: string;
5053
4844
  timeSpan: LoggerTimeSpan;
5054
4845
  timestamp: string;
5055
4846
  transpileBuildCount: number;
@@ -5062,6 +4853,14 @@ interface BuildStyleUpdate {
5062
4853
  styleText: string;
5063
4854
  styleMode: string;
5064
4855
  }
4856
+ /**
4857
+ * A live-reload update for a `global-style` output target's CSS, matched on
4858
+ * the client by `fileName` against the `<link>`
4859
+ */
4860
+ interface BuildGlobalStyleLinkUpdate {
4861
+ fileName: string;
4862
+ styleText: string;
4863
+ }
5065
4864
  type BuildTask = any;
5066
4865
  interface CompilerBuildStats {
5067
4866
  timestamp: string;
@@ -5080,20 +4879,15 @@ interface CompilerBuildStats {
5080
4879
  options: {
5081
4880
  minifyJs: boolean;
5082
4881
  minifyCss: boolean;
5083
- hashFileNames: boolean;
5084
- hashedFileNameLength: number;
5085
- buildEs5: boolean | 'prod';
5086
4882
  };
5087
4883
  formats: {
5088
4884
  esmBrowser: ReadonlyArray<CompilerBuildStatBundle>;
5089
4885
  esm: ReadonlyArray<CompilerBuildStatBundle>;
5090
- es5: ReadonlyArray<CompilerBuildStatBundle>;
5091
- system: ReadonlyArray<CompilerBuildStatBundle>;
5092
4886
  commonjs: ReadonlyArray<CompilerBuildStatBundle>;
5093
4887
  };
5094
4888
  components: BuildComponent[];
5095
4889
  entries: EntryModule[];
5096
- rollupResults: RollupResults;
4890
+ rolldownResults: RolldownResults;
5097
4891
  sourceGraph?: BuildSourceGraph;
5098
4892
  componentGraph: BuildResultsComponentGraph;
5099
4893
  collections: CompilerBuildStatCollection[];
@@ -5119,20 +4913,7 @@ interface BuildComponent {
5119
4913
  dependencyOf?: string[];
5120
4914
  dependencies?: string[];
5121
4915
  }
5122
- type SourceTarget = 'es5' | 'es2017' | 'latest';
5123
- /**
5124
- * A note regarding Rollup types:
5125
- * As of this writing, there is no great way to import external types for packages that are directly embedded in the
5126
- * Stencil source. As a result, some types are duplicated here for Rollup that will be used within the codebase.
5127
- * Updates to rollup may require these typings to be updated.
5128
- */
5129
- type RollupResult = RollupChunkResult | RollupAssetResult;
5130
- interface RollupAssetResult {
5131
- type: 'asset';
5132
- fileName: string;
5133
- content: string;
5134
- }
5135
- interface RollupChunkResult {
4916
+ interface RolldownChunkResult {
5136
4917
  type: 'chunk';
5137
4918
  entryKey: string;
5138
4919
  fileName: string;
@@ -5144,29 +4925,11 @@ interface RollupChunkResult {
5144
4925
  isBrowserLoader: boolean;
5145
4926
  imports: string[];
5146
4927
  moduleFormat: ModuleFormat;
5147
- map?: RollupSourceMap;
4928
+ map?: SourceMap;
5148
4929
  }
5149
- interface RollupSourceMap {
5150
- file: string;
5151
- mappings: string;
5152
- names: string[];
5153
- sources: string[];
5154
- sourcesContent: string[];
5155
- version: number;
5156
- toString(): string;
5157
- toUrl(): string;
5158
- }
5159
- /**
5160
- * Result of Stencil compressing, mangling, and otherwise 'minifying' JavaScript
5161
- */
5162
- type OptimizeJsResult = {
5163
- output: string;
5164
- diagnostics: Diagnostic$1[];
5165
- sourceMap?: SourceMap$1;
5166
- };
5167
4930
  interface BundleModule {
5168
4931
  entryKey: string;
5169
- rollupResult: RollupChunkResult;
4932
+ rolldownResult: RolldownChunkResult;
5170
4933
  cmps: ComponentCompilerMeta[];
5171
4934
  output: BundleModuleOutput;
5172
4935
  }
@@ -5199,41 +4962,31 @@ interface CollectionCompilerMeta {
5199
4962
  bundles?: {
5200
4963
  components: string[];
5201
4964
  }[];
4965
+ buildFlags?: Partial<BuildConditionals>;
5202
4966
  }
5203
4967
  interface CollectionCompilerVersion {
5204
4968
  name: string;
5205
4969
  version: string;
5206
4970
  typescriptVersion?: string;
5207
4971
  }
5208
- interface CollectionManifest {
5209
- entries?: CollectionComponentEntryPath[];
5210
- /**
5211
- * Paths to mixin/abstract class modules that can be extended by consuming projects.
5212
- * These are modules that contain classes with Stencil static members (properties, states, etc.)
5213
- * but are not components themselves (no @Component decorator / tag name).
5214
- */
5215
- mixins?: CollectionComponentEntryPath[];
5216
- collections?: CollectionDependencyManifest[];
5217
- global?: string;
5218
- compiler?: CollectionCompilerVersion;
5219
- bundles?: CollectionBundleManifest[];
5220
- }
5221
- type CollectionComponentEntryPath = string;
5222
- interface CollectionBundleManifest {
5223
- components: string[];
5224
- }
5225
- interface CollectionDependencyManifest {
5226
- name: string;
5227
- tags: string[];
5228
- }
5229
- interface CollectionCompiler {
5230
- name: string;
5231
- version: string;
5232
- typescriptVersion?: string;
5233
- }
5234
- interface CollectionDependencyData {
5235
- name: string;
5236
- tags: string[];
4972
+ /**
4973
+ * A memoized result of the SASS + Lightning CSS transformation for a single stylesheet, keyed by
4974
+ * the annotated Rolldown import id (e.g. `/path/to/comp.scss?tag=ion-button&encapsulation=shadow`).
4975
+ *
4976
+ * Storing this allows all output targets (customElements, lazy, hydrate) that process the same
4977
+ * stylesheets to share a single computation instead of repeating it N times.
4978
+ */
4979
+ interface CssTransformCacheEntry {
4980
+ /** Resolved file ID after plugin (SASS) transforms */
4981
+ pluginTransformId: string;
4982
+ /** CSS source produced by the SASS / plugin pipeline */
4983
+ pluginTransformCode: string;
4984
+ /** File dependencies discovered during the SASS transform (e.g. `@import`-ed partials) */
4985
+ pluginTransformDependencies: string[];
4986
+ /** Diagnostics emitted during the plugin transform pass */
4987
+ pluginTransformDiagnostics: Diagnostic$1[];
4988
+ /** Full output of the subsequent `transformCssToEsm` call */
4989
+ cssTransformOutput: TransformCssToEsmOutput;
5237
4990
  }
5238
4991
  interface CompilerCtx {
5239
4992
  version: number;
@@ -5247,7 +5000,14 @@ interface CompilerCtx {
5247
5000
  addWatchFile: (path: string) => void;
5248
5001
  cache: Cache;
5249
5002
  cssModuleImports: Map<string, string[]>;
5250
- cachedGlobalStyle: string;
5003
+ /** Cache of built global styles, keyed by input file path */
5004
+ globalStyleCache: Map<string, string>;
5005
+ /** Cache of discovered CSS-only components from the last scan, keyed by absolute .css file path */
5006
+ cssOnlyComponentsCache: Map<string, ComponentCompilerMeta[]>;
5007
+ /** Contents of the last auto-placed `stencil-*` CSS, used to detect changes for HMR */
5008
+ stencilCss?: string;
5009
+ /** Virtual imports found in each built global style (post-preprocessing), keyed by input path */
5010
+ globalStyleVirtualImports: Map<string, Set<StencilVirtualImport>>;
5251
5011
  collections: CollectionCompilerMeta[];
5252
5012
  compilerOptions: any;
5253
5013
  events: BuildEvents;
@@ -5261,14 +5021,40 @@ interface CompilerCtx {
5261
5021
  moduleMap: ModuleMap;
5262
5022
  nodeMap: NodeMap;
5263
5023
  resolvedCollections: Set<string>;
5264
- rollupCacheHydrate: any;
5265
- rollupCacheLazy: any;
5266
- rollupCacheNative: any;
5024
+ rolldownCacheSsr: any;
5025
+ rolldownCacheLazy: any;
5026
+ rolldownCacheNative: any;
5267
5027
  styleModeNames: Set<string>;
5268
5028
  changedModules: Set<string>;
5269
5029
  changedFiles: Set<string>;
5270
5030
  worker?: CompilerWorkerContext;
5271
- rollupCache: Map<string, any>;
5031
+ rolldownCache: Map<string, any>;
5032
+ /**
5033
+ * Cross-build cache for {@link ts.transpileModule} results.
5034
+ * Keyed by `"${bundleId}:${normalizedFilePath}"`. Invalidated for any
5035
+ * file that appears in {@link changedModules} after TypeScript re-emits.
5036
+ * @see transpileCache in compiler-ctx.ts
5037
+ */
5038
+ transpileCache: Map<string, {
5039
+ outputText: string;
5040
+ sourceMapText: string | null;
5041
+ }>;
5042
+ /**
5043
+ * Cross-build cache of the last style text pushed to the HMR client.
5044
+ * Keyed by getScopeId result (e.g. "ion-accordion$ios"). Used by
5045
+ * extTransformsPlugin to avoid re-pushing unchanged styles on every rebuild.
5046
+ */
5047
+ prevStylesMap: Map<string, string>;
5048
+ /**
5049
+ * Cross-output-target cache for the SASS + Lightning CSS computation.
5050
+ * Keyed by the annotated Rolldown import id. Null entries indicate that the
5051
+ * source file could not be read (propagated as a `null` return from the
5052
+ * transform hook).
5053
+ *
5054
+ * Entries are invalidated in `invalidateRolldownCaches` whenever a
5055
+ * source file or one of its SASS dependencies is modified.
5056
+ */
5057
+ cssTransformCache: Map<string, CssTransformCacheEntry | null>;
5272
5058
  reset(): void;
5273
5059
  }
5274
5060
  type NodeMap = WeakMap<any, ComponentCompilerMeta>;
@@ -5299,14 +5085,14 @@ interface ComponentCompilerFeatures {
5299
5085
  hasListenerTargetWindow: boolean;
5300
5086
  hasListenerTargetDocument: boolean;
5301
5087
  hasListenerTargetBody: boolean;
5302
- /**
5303
- * @deprecated Prevented from new apps, but left in for older collections
5304
- */
5305
- hasListenerTargetParent: boolean;
5306
5088
  hasMember: boolean;
5307
5089
  hasMethod: boolean;
5308
5090
  hasMode: boolean;
5309
5091
  hasModernPropertyDecls: boolean;
5092
+ hasPatchAll: boolean;
5093
+ hasPatchChildren: boolean;
5094
+ hasPatchClone: boolean;
5095
+ hasPatchInsert: boolean;
5310
5096
  hasProp: boolean;
5311
5097
  hasPropBoolean: boolean;
5312
5098
  hasPropNumber: boolean;
@@ -5324,15 +5110,18 @@ interface ComponentCompilerFeatures {
5324
5110
  hasVdomKey: boolean;
5325
5111
  hasVdomListener: boolean;
5326
5112
  hasVdomPropOrAttr: boolean;
5113
+ hasVdomPropOrAttrPrefix: boolean;
5327
5114
  hasVdomRef: boolean;
5328
5115
  hasVdomRender: boolean;
5329
5116
  hasVdomStyle: boolean;
5330
5117
  hasVdomText: boolean;
5331
5118
  hasVdomXlink: boolean;
5119
+ hasSignalsImport: boolean;
5332
5120
  hasWatchCallback: boolean;
5333
5121
  htmlAttrNames: string[];
5334
5122
  htmlTagNames: string[];
5335
5123
  htmlParts: string[];
5124
+ htmlSlots: string[];
5336
5125
  isUpdateable: boolean;
5337
5126
  /**
5338
5127
  * A plain component is one that doesn't have:
@@ -5364,7 +5153,7 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
5364
5153
  * Custom states to initialize on the ElementInternals.states CustomStateSet.
5365
5154
  * These are defined via @AttachInternals({ states: {...} }).
5366
5155
  */
5367
- attachInternalsCustomStates: ComponentCompilerCustomState[];
5156
+ attachInternalsCustomStates: JsonDocsCustomState[];
5368
5157
  componentClassName: string;
5369
5158
  /**
5370
5159
  * A list of web component tag names that are either:
@@ -5405,16 +5194,43 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
5405
5194
  properties: ComponentCompilerProperty[];
5406
5195
  serializers: ComponentCompilerChangeHandler[];
5407
5196
  shadowDelegatesFocus: boolean;
5197
+ /**
5198
+ * Whether the shadow root is preserved when the host element is deep-cloned via
5199
+ * `Node.cloneNode(true)`. Only applicable when encapsulation is 'shadow'.
5200
+ */
5201
+ shadowClonable: boolean;
5202
+ /**
5203
+ * Whether the shadow root is marked serializable for `Element.getHTML({ serializableShadowRoots: true })`.
5204
+ * Only applicable when encapsulation is 'shadow'.
5205
+ */
5206
+ shadowSerializable: boolean;
5207
+ /**
5208
+ * Shadow DOM mode. 'open' (default) or 'closed'.
5209
+ * Only applicable when encapsulation is 'shadow'.
5210
+ */
5211
+ shadowMode: 'open' | 'closed' | null;
5408
5212
  /**
5409
5213
  * Slot assignment mode for shadow DOM. 'manual', enables imperative slotting
5410
5214
  * using HTMLSlotElement.assign(). Only applicable when encapsulation is 'shadow'.
5411
5215
  */
5412
5216
  slotAssignment: 'manual' | null;
5217
+ /**
5218
+ * `id` of the element within the shadow root that IDREFs targeting the host resolve to.
5219
+ * Only applicable when encapsulation is 'shadow'.
5220
+ */
5221
+ shadowReferenceTarget: string | null;
5222
+ /**
5223
+ * Per-component slot patches for non-shadow DOM components.
5224
+ * These patches enable proper slot behavior without native Shadow DOM.
5225
+ * Only applicable when encapsulation is 'none' or 'scoped'.
5226
+ */
5227
+ patches: ComponentPatches | null;
5413
5228
  sourceFilePath: string;
5414
5229
  sourceMapPath: string;
5415
5230
  states: ComponentCompilerState[];
5416
- styleDocs: CompilerStyleDoc[];
5231
+ styleDocs: StyleDoc[];
5417
5232
  styles: StyleCompiler[];
5233
+ globalStyles: ComponentGlobalStyle[];
5418
5234
  tagName: string;
5419
5235
  virtualProperties: ComponentCompilerVirtualProperty[];
5420
5236
  watchers: ComponentCompilerChangeHandler[];
@@ -5426,6 +5242,20 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
5426
5242
  * 3. 'none' - a basic HTML element
5427
5243
  */
5428
5244
  type Encapsulation = 'shadow' | 'scoped' | 'none';
5245
+ /**
5246
+ * Per-component slot patches for non-shadow DOM components.
5247
+ * These enable proper slot behavior when not using native Shadow DOM.
5248
+ */
5249
+ interface ComponentPatches {
5250
+ /** Apply all slot patches (equivalent to lightDomPatches) */
5251
+ all?: boolean;
5252
+ /** Patch child node accessors (children, firstChild, lastChild, etc.) */
5253
+ children?: boolean;
5254
+ /** Patch cloneNode() to handle slotted content */
5255
+ clone?: boolean;
5256
+ /** Patch appendChild(), insertBefore(), etc. for slot relocation */
5257
+ insert?: boolean;
5258
+ }
5429
5259
  /**
5430
5260
  * Intermediate Representation (IR) of a static property on a Stencil component
5431
5261
  */
@@ -5477,6 +5307,11 @@ interface ComponentCompilerPropertyComplexType {
5477
5307
  * annotation in the original source file.
5478
5308
  */
5479
5309
  references: ComponentCompilerTypeReferences;
5310
+ /**
5311
+ * @internal TypeScript AST node used for semantic type analysis during compilation.
5312
+ * Not serialized, only used internally for improved type renaming logic.
5313
+ */
5314
+ _astNode?: any;
5480
5315
  }
5481
5316
  /**
5482
5317
  * A record of `ComponentCompilerTypeReference` entities.
@@ -5570,6 +5405,11 @@ interface ComponentCompilerMethodComplexType {
5570
5405
  parameters: JsonDocMethodParameter[];
5571
5406
  references: ComponentCompilerTypeReferences;
5572
5407
  return: string;
5408
+ /**
5409
+ * @internal TypeScript AST method node used for semantic type analysis during compilation.
5410
+ * Not serialized, only used internally for improved type renaming logic.
5411
+ */
5412
+ _astNode?: any;
5573
5413
  }
5574
5414
  interface ComponentCompilerChangeHandler {
5575
5415
  propName: string;
@@ -5580,31 +5420,17 @@ interface ComponentCompilerChangeHandler {
5580
5420
  }
5581
5421
  interface ComponentCompilerMethod extends ComponentCompilerStaticMethod {
5582
5422
  name: string;
5583
- internal: boolean;
5584
- }
5585
- interface ComponentCompilerState {
5586
- name: string;
5587
- }
5588
- /**
5589
- * Metadata about a custom state defined via @AttachInternals({ states: {...} })
5590
- *
5591
- * Custom states are exposed via the ElementInternals.states CustomStateSet
5592
- * and can be targeted with the CSS :state() pseudo-class.
5593
- */
5594
- interface ComponentCompilerCustomState {
5595
- /**
5596
- * The name of the custom state (without dashes)
5597
- */
5598
- name: string;
5599
- /**
5600
- * The initial value of the state
5601
- */
5602
- initialValue: boolean;
5603
- /**
5604
- * Optional JSDoc description for the state
5605
- */
5606
- docs: string;
5423
+ internal: boolean;
5424
+ }
5425
+ interface ComponentCompilerState {
5426
+ name: string;
5607
5427
  }
5428
+ /**
5429
+ * Metadata about a custom state defined via @AttachInternals({ states: {...} })
5430
+ *
5431
+ * Custom states are exposed via the ElementInternals.states CustomStateSet
5432
+ * and can be targeted with the CSS :state() pseudo-class.
5433
+ */
5608
5434
  /**
5609
5435
  * Representation of JSDoc that is pulled off a node in the AST
5610
5436
  */
@@ -5616,73 +5442,13 @@ interface CompilerJsDoc {
5616
5442
  /**
5617
5443
  * Tags included in the JSDoc
5618
5444
  */
5619
- tags: CompilerJsDocTagInfo[];
5620
- }
5621
- /**
5622
- * Representation of a tag that exists in a JSDoc
5623
- */
5624
- interface CompilerJsDocTagInfo {
5625
- /**
5626
- * The name of the tag - e.g. `@deprecated`
5627
- */
5628
- name: string;
5629
- /**
5630
- * Additional text that is associated with the tag - e.g. `@deprecated use v2 of this API`
5631
- */
5632
- text?: string;
5633
- }
5634
- /**
5635
- * The (internal) representation of a CSS block comment in a CSS, Sass, etc. file. This data structure is used during
5636
- * the initial compilation phases of Stencil, as a piece of {@link ComponentCompilerMeta}.
5637
- */
5638
- interface CompilerStyleDoc {
5639
- /**
5640
- * The name of the CSS property
5641
- */
5642
- name: string;
5643
- /**
5644
- * The user-defined description of the CSS property
5645
- */
5646
- docs: string;
5647
- /**
5648
- * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
5649
- * Used to inform Stencil where the start of a new property's description starts (and where the previous description
5650
- * ends).
5651
- */
5652
- annotation: 'prop';
5653
- /**
5654
- * The Stencil style-mode that is associated with this property.
5655
- */
5656
- mode: string;
5445
+ tags: JsonDocsTag[];
5657
5446
  }
5658
5447
  interface CompilerAssetDir {
5659
5448
  absolutePath?: string;
5660
5449
  cmpRelativePath?: string;
5661
5450
  originalComponentPath?: string;
5662
5451
  }
5663
- interface ComponentCompilerData {
5664
- exportLine: string;
5665
- filePath: string;
5666
- cmp: ComponentCompilerMeta;
5667
- uniqueComponentClassName?: string;
5668
- importLine?: string;
5669
- }
5670
- interface ComponentConstructor {
5671
- is?: string;
5672
- properties?: ComponentConstructorProperties;
5673
- watchers?: ComponentConstructorChangeHandlers;
5674
- events?: ComponentConstructorEvent[];
5675
- listeners?: ComponentConstructorListener[];
5676
- style?: string;
5677
- styleId?: string;
5678
- encapsulation?: ComponentConstructorEncapsulation;
5679
- observedAttributes?: string[];
5680
- cmpMeta?: ComponentRuntimeMeta;
5681
- isProxied?: boolean;
5682
- isStyleRegistered?: boolean;
5683
- serializers?: ComponentConstructorChangeHandlers;
5684
- deserializers?: ComponentConstructorChangeHandlers;
5685
- }
5686
5452
  /**
5687
5453
  * A mapping from class member names to a list of methods which are watching
5688
5454
  * them.
@@ -5692,48 +5458,6 @@ interface ComponentConstructorChangeHandlers {
5692
5458
  [methodName: string]: number;
5693
5459
  }[];
5694
5460
  }
5695
- interface ComponentTestingConstructor extends ComponentConstructor {
5696
- COMPILER_META: ComponentCompilerMeta;
5697
- prototype?: {
5698
- componentWillLoad?: Function;
5699
- componentWillUpdate?: Function;
5700
- componentWillRender?: Function;
5701
- __componentWillLoad?: Function | null;
5702
- __componentWillUpdate?: Function | null;
5703
- __componentWillRender?: Function | null;
5704
- };
5705
- }
5706
- interface ComponentNativeConstructor extends ComponentConstructor {
5707
- cmpMeta: ComponentRuntimeMeta;
5708
- }
5709
- type ComponentConstructorEncapsulation = 'shadow' | 'scoped' | 'none';
5710
- interface ComponentConstructorProperties {
5711
- [propName: string]: ComponentConstructorProperty;
5712
- }
5713
- interface ComponentConstructorProperty {
5714
- attribute?: string;
5715
- elementRef?: boolean;
5716
- method?: boolean;
5717
- mutable?: boolean;
5718
- reflect?: boolean;
5719
- state?: boolean;
5720
- type?: ComponentConstructorPropertyType;
5721
- watchCallbacks?: string[];
5722
- }
5723
- type ComponentConstructorPropertyType = StringConstructor | BooleanConstructor | NumberConstructor | 'string' | 'boolean' | 'number';
5724
- interface ComponentConstructorEvent {
5725
- name: string;
5726
- method: string;
5727
- bubbles: boolean;
5728
- cancelable: boolean;
5729
- composed: boolean;
5730
- }
5731
- interface ComponentConstructorListener {
5732
- name: string;
5733
- method: string;
5734
- capture?: boolean;
5735
- passive?: boolean;
5736
- }
5737
5461
  interface EntryModule {
5738
5462
  entryKey: string;
5739
5463
  cmps: ComponentCompilerMeta[];
@@ -5748,7 +5472,9 @@ interface HostElement extends HTMLElement {
5748
5472
  disconnectedCallback?: () => void;
5749
5473
  host?: Element;
5750
5474
  forceUpdate?: () => void;
5751
- __stencil__getHostRef?: () => HostRef;
5475
+ __s_ghr?: () => HostRef;
5476
+ /** attaches the component's shadow root if it needs one and doesn't have one yet */
5477
+ __attachShadow?: () => void;
5752
5478
  /**
5753
5479
  * Unique stencil id for this element
5754
5480
  */
@@ -5802,9 +5528,18 @@ interface HostElement extends HTMLElement {
5802
5528
  * must be resolved for the top, ancestor component to be fully hydrated
5803
5529
  */
5804
5530
  ['s-p']?: Promise<void>[];
5531
+ /**
5532
+ * Pending Connects:
5533
+ * A list of {@link HostRef.$onFirstConnectPromise$} promises for descendants that
5534
+ * were already registered with this component (their nearest Stencil ancestor) by
5535
+ * the time this component's own initial `componentWillLoad` was scheduled. Awaited
5536
+ * so this component's `componentWillLoad` can't fire before those descendants'
5537
+ * real `connectedCallback`s have.
5538
+ */
5539
+ ['s-pc']?: Promise<void>[];
5805
5540
  componentOnReady?: () => Promise<this>;
5806
5541
  }
5807
- interface HydrateResults {
5542
+ interface SsrResults {
5808
5543
  buildId: string;
5809
5544
  diagnostics: Diagnostic$1[];
5810
5545
  url: string;
@@ -5816,62 +5551,46 @@ interface HydrateResults {
5816
5551
  search: string | null;
5817
5552
  hash: string | null;
5818
5553
  html: string | null;
5819
- components: HydrateComponent[];
5820
- anchors: HydrateAnchorElement[];
5821
- imgs: HydrateImgElement[];
5822
- scripts: HydrateScriptElement[];
5823
- styles: HydrateStyleElement[];
5824
- staticData: HydrateStaticData[];
5554
+ components: SsrComponent[];
5555
+ anchors: SsrAnchorElement[];
5556
+ imgs: SsrImgElement[];
5557
+ scripts: SsrScriptElement[];
5558
+ styles: SsrStyleElement[];
5559
+ staticData: SsrStaticData[];
5825
5560
  title: string | null;
5826
5561
  hydratedCount: number;
5827
5562
  httpStatus: number | null;
5828
5563
  }
5829
- interface HydrateComponent {
5564
+ interface SsrComponent {
5830
5565
  tag: string;
5831
5566
  mode: string;
5832
5567
  count: number;
5833
5568
  depth: number;
5834
5569
  }
5835
- interface HydrateElement {
5570
+ interface SsrElement {
5836
5571
  [attrName: string]: string | undefined;
5837
5572
  }
5838
- interface HydrateAnchorElement extends HydrateElement {
5573
+ interface SsrAnchorElement extends SsrElement {
5839
5574
  href?: string;
5840
5575
  target?: string;
5841
5576
  }
5842
- interface HydrateImgElement extends HydrateElement {
5577
+ interface SsrImgElement extends SsrElement {
5843
5578
  src?: string;
5844
5579
  }
5845
- interface HydrateScriptElement extends HydrateElement {
5580
+ interface SsrScriptElement extends SsrElement {
5846
5581
  src?: string;
5847
5582
  type?: string;
5848
5583
  }
5849
- interface HydrateStyleElement extends HydrateElement {
5584
+ interface SsrStyleElement extends SsrElement {
5850
5585
  id?: string;
5851
5586
  href?: string;
5852
5587
  content?: string;
5853
5588
  }
5854
- interface HydrateStaticData {
5589
+ interface SsrStaticData {
5855
5590
  id: string;
5856
5591
  type: string;
5857
5592
  content: string;
5858
5593
  }
5859
- interface JsDoc {
5860
- name: string;
5861
- documentation: string;
5862
- type: string;
5863
- tags: JSDocTagInfo[];
5864
- default?: string;
5865
- parameters?: JsDoc[];
5866
- returns?: {
5867
- type: string;
5868
- documentation: string;
5869
- };
5870
- }
5871
- interface JSDocTagInfo {
5872
- name: string;
5873
- text?: string;
5874
- }
5875
5594
  /**
5876
5595
  * A mapping from a TypeScript or JavaScript source file path on disk, to a Stencil {@link Module}.
5877
5596
  *
@@ -5913,6 +5632,7 @@ interface Module {
5913
5632
  htmlAttrNames: string[];
5914
5633
  htmlTagNames: string[];
5915
5634
  htmlParts: string[];
5635
+ htmlSlots: string[];
5916
5636
  isCollectionDependency: boolean;
5917
5637
  isLegacy: boolean;
5918
5638
  jsFilePath: string;
@@ -5937,33 +5657,13 @@ interface Module {
5937
5657
  hasVdomKey: boolean;
5938
5658
  hasVdomListener: boolean;
5939
5659
  hasVdomPropOrAttr: boolean;
5660
+ hasVdomPropOrAttrPrefix: boolean;
5940
5661
  hasVdomRef: boolean;
5941
5662
  hasVdomRender: boolean;
5942
5663
  hasVdomStyle: boolean;
5943
5664
  hasVdomText: boolean;
5944
5665
  hasVdomXlink: boolean;
5945
- }
5946
- interface Plugin {
5947
- name?: string;
5948
- pluginType?: string;
5949
- load?: (id: string, context: PluginCtx) => Promise<string> | string;
5950
- resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
5951
- transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults;
5952
- }
5953
- type PluginTransformResults = PluginTransformationDescriptor | string | null;
5954
- interface PluginTransformationDescriptor {
5955
- code?: string;
5956
- map?: string;
5957
- id?: string;
5958
- diagnostics?: Diagnostic$1[];
5959
- dependencies?: string[];
5960
- }
5961
- interface PluginCtx {
5962
- config: Config;
5963
- sys: CompilerSystem;
5964
- fs: InMemoryFileSystem;
5965
- cache: Cache;
5966
- diagnostics: Diagnostic$1[];
5666
+ hasSignalsImport: boolean;
5967
5667
  }
5968
5668
  interface PrerenderUrlResults {
5969
5669
  anchorUrls: string[];
@@ -5976,7 +5676,7 @@ interface PrerenderUrlRequest {
5976
5676
  baseUrl: string;
5977
5677
  componentGraphPath: string;
5978
5678
  devServerHostUrl: string;
5979
- hydrateAppFilePath: string;
5679
+ ssrAppFilePath: string;
5980
5680
  isDebug: boolean;
5981
5681
  prerenderConfigPath: string;
5982
5682
  staticSite: boolean;
@@ -5984,27 +5684,6 @@ interface PrerenderUrlRequest {
5984
5684
  url: string;
5985
5685
  writeToFilePath: string;
5986
5686
  }
5987
- interface PrerenderManager {
5988
- config: Config;
5989
- prerenderUrlWorker: (prerenderRequest: PrerenderUrlRequest) => Promise<PrerenderUrlResults>;
5990
- devServerHostUrl: string;
5991
- diagnostics: Diagnostic$1[];
5992
- hydrateAppFilePath: string;
5993
- isDebug: boolean;
5994
- logCount: number;
5995
- outputTarget: OutputTargetWww;
5996
- prerenderConfig: PrerenderConfig;
5997
- prerenderConfigPath: string;
5998
- progressLogger?: LoggerLineUpdater;
5999
- resolve: Function;
6000
- staticSite: boolean;
6001
- templateId: string;
6002
- componentGraphPath: string;
6003
- urlsProcessing: Set<string>;
6004
- urlsPending: Set<string>;
6005
- urlsCompleted: Set<string>;
6006
- maxConcurrency: number;
6007
- }
6008
5687
  /**
6009
5688
  * Generic node that represents all of the
6010
5689
  * different types of nodes we'd see when rendering
@@ -6042,6 +5721,11 @@ interface RenderNode extends HostElement {
6042
5721
  * Slot name of either the slot itself or the slotted node
6043
5722
  */
6044
5723
  ['s-sn']?: string;
5724
+ /**
5725
+ * `slot` attribute of a `<slot>` reference rendered as a text node (no fallback content),
5726
+ * since text nodes can't carry real DOM attributes.
5727
+ */
5728
+ ['s-sa']?: string;
6045
5729
  /**
6046
5730
  * Host element tag name:
6047
5731
  * The tag name of the host element that this
@@ -6094,64 +5778,64 @@ interface RenderNode extends HostElement {
6094
5778
  * Used to know the components encapsulation.
6095
5779
  * empty "" for shadow, "c" from scoped
6096
5780
  */
6097
- ['s-en']?: '' | /*shadow*/'c';
5781
+ ['s-en']?: '' | /*shadow*/ 'c';
6098
5782
  /**
6099
5783
  * On a `scoped: true` component
6100
- * with `experimentalSlotFixes` flag enabled,
5784
+ * with `lightDomPatches` flag enabled,
6101
5785
  * returns the internal `childNodes` of the component
6102
5786
  */
6103
5787
  readonly __childNodes?: NodeListOf<ChildNode>;
6104
5788
  /**
6105
5789
  * On a `scoped: true` component
6106
- * with `experimentalSlotFixes` flag enabled,
5790
+ * with `lightDomPatches` flag enabled,
6107
5791
  * returns the internal `children` of the component
6108
5792
  */
6109
5793
  readonly __children?: HTMLCollectionOf<Element>;
6110
5794
  /**
6111
5795
  * On a `scoped: true` component
6112
- * with `experimentalSlotFixes` flag enabled,
5796
+ * with `lightDomPatches` flag enabled,
6113
5797
  * returns the internal `firstChild` of the component
6114
5798
  */
6115
5799
  readonly __firstChild?: ChildNode;
6116
5800
  /**
6117
5801
  * On a `scoped: true` component
6118
- * with `experimentalSlotFixes` flag enabled,
5802
+ * with `lightDomPatches` flag enabled,
6119
5803
  * returns the internal `lastChild` of the component
6120
5804
  */
6121
5805
  readonly __lastChild?: ChildNode;
6122
5806
  /**
6123
5807
  * On a `scoped: true` component
6124
- * with `experimentalSlotFixes` flag enabled,
5808
+ * with `lightDomPatches` flag enabled,
6125
5809
  * returns the internal `textContent` of the component
6126
5810
  */
6127
5811
  __textContent?: string;
6128
5812
  /**
6129
5813
  * On a `scoped: true` component
6130
- * with `experimentalSlotFixes` flag enabled,
5814
+ * with `lightDomPatches` flag enabled,
6131
5815
  * gives access to the original `append` method
6132
5816
  */
6133
5817
  __append?: (...nodes: (Node | string)[]) => void;
6134
5818
  /**
6135
5819
  * On a `scoped: true` component
6136
- * with `experimentalSlotFixes` flag enabled,
5820
+ * with `lightDomPatches` flag enabled,
6137
5821
  * gives access to the original `prepend` method
6138
5822
  */
6139
5823
  __prepend?: (...nodes: (Node | string)[]) => void;
6140
5824
  /**
6141
5825
  * On a `scoped: true` component
6142
- * with `experimentalSlotFixes` flag enabled,
5826
+ * with `lightDomPatches` flag enabled,
6143
5827
  * gives access to the original `appendChild` method
6144
5828
  */
6145
5829
  __appendChild?: <T extends Node>(newChild: T) => T;
6146
5830
  /**
6147
5831
  * On a `scoped: true` component
6148
- * with `experimentalSlotFixes` flag enabled,
5832
+ * with `lightDomPatches` flag enabled,
6149
5833
  * gives access to the original `insertBefore` method
6150
5834
  */
6151
5835
  __insertBefore?: <T extends Node>(node: T, child: Node | null) => T;
6152
5836
  /**
6153
5837
  * On a `scoped: true` component
6154
- * with `experimentalSlotFixes` flag enabled,
5838
+ * with `lightDomPatches` flag enabled,
6155
5839
  * gives access to the original `removeChild` method
6156
5840
  */
6157
5841
  __removeChild?: <T extends Node>(child: T) => T;
@@ -6189,40 +5873,58 @@ interface PatchedSlotNode extends Node {
6189
5873
  ['s-sr']?: boolean;
6190
5874
  /**
6191
5875
  * On a `scoped: true` component
6192
- * with `experimentalSlotFixes` flag enabled,
5876
+ * with `lightDomPatches` flag enabled,
6193
5877
  * returns the actual `parentNode` of the component
6194
5878
  */
6195
5879
  __parentNode?: RenderNode;
6196
5880
  /**
6197
5881
  * On a `scoped: true` component
6198
- * with `experimentalSlotFixes` flag enabled,
5882
+ * with `lightDomPatches` flag enabled,
6199
5883
  * returns the actual `nextSibling` of the component
6200
5884
  */
6201
5885
  __nextSibling?: RenderNode;
6202
5886
  /**
6203
5887
  * On a `scoped: true` component
6204
- * with `experimentalSlotFixes` flag enabled,
5888
+ * with `lightDomPatches` flag enabled,
6205
5889
  * returns the actual `previousSibling` of the component
6206
5890
  */
6207
5891
  __previousSibling?: RenderNode;
6208
5892
  /**
6209
5893
  * On a `scoped: true` component
6210
- * with `experimentalSlotFixes` flag enabled,
5894
+ * with `lightDomPatches` flag enabled,
6211
5895
  * returns the actual `nextElementSibling` of the component
6212
5896
  */
6213
5897
  __nextElementSibling?: RenderNode;
6214
5898
  /**
6215
5899
  * On a `scoped: true` component
6216
- * with `experimentalSlotFixes` flag enabled,
5900
+ * with `lightDomPatches` flag enabled,
6217
5901
  * returns the actual `nextElementSibling` of the component
6218
5902
  */
6219
5903
  __previousElementSibling?: RenderNode;
6220
5904
  }
6221
5905
  type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
6222
- type LazyBundleRuntimeData = [/** bundleIds */string, ComponentRuntimeMetaCompact[]];
6223
- type ComponentRuntimeMetaCompact = [/** flags */number, /** tagname */string, /** members */{
5906
+ type LazyBundleRuntimeData = [
5907
+ /** bundleIds */
5908
+ string, ComponentRuntimeMetaCompact[]];
5909
+ type ComponentRuntimeMetaCompact = [
5910
+ /** flags */
5911
+ number,
5912
+ /** tagname */
5913
+ string,
5914
+ /** members */
5915
+ {
6224
5916
  [memberName: string]: ComponentRuntimeMember;
6225
- }?, /** listeners */ComponentRuntimeHostListener[]?, /** watchers */ComponentConstructorChangeHandlers?, /** serializers */ComponentConstructorChangeHandlers?, /** deserializers */ComponentConstructorChangeHandlers?];
5917
+ }?,
5918
+ /** listeners */
5919
+ ComponentRuntimeHostListener[]?,
5920
+ /** watchers */
5921
+ ComponentConstructorChangeHandlers?,
5922
+ /** serializers */
5923
+ ComponentConstructorChangeHandlers?,
5924
+ /** deserializers */
5925
+ ComponentConstructorChangeHandlers?,
5926
+ /** shadow root reference target */
5927
+ string?];
6226
5928
  /**
6227
5929
  * Runtime metadata for a Stencil component
6228
5930
  */
@@ -6269,6 +5971,10 @@ interface ComponentRuntimeMeta {
6269
5971
  * Information about which class members have attribute > prop deserializers attached on the component.
6270
5972
  */
6271
5973
  $deserializers$?: ComponentConstructorChangeHandlers;
5974
+ /**
5975
+ * `id` of the element within the shadow root that IDREFs targeting the host resolve to.
5976
+ */
5977
+ $referenceTarget$?: string;
6272
5978
  }
6273
5979
  /**
6274
5980
  * A mapping of the names of members on the component to some runtime-specific
@@ -6314,7 +6020,7 @@ type ComponentRuntimeReflectingAttr = [string, string | undefined];
6314
6020
  * associated {@link HostRef} instance.
6315
6021
  */
6316
6022
  type RuntimeRef = HostElement | {
6317
- __stencil__getHostRef?: () => HostRef;
6023
+ __s_ghr?: () => HostRef;
6318
6024
  };
6319
6025
  /**
6320
6026
  * Interface used to track an Element, it's virtual Node (`VNode`), and other data
@@ -6325,6 +6031,14 @@ interface HostRef {
6325
6031
  $cmpMeta$: ComponentRuntimeMeta;
6326
6032
  $hostElement$: HostElement;
6327
6033
  $instanceValues$?: Map<string, any>;
6034
+ /**
6035
+ * Prop/state changes accumulated since the last render, flushed to
6036
+ * `componentShouldUpdate` once per render cycle.
6037
+ */
6038
+ $queuedPropChanges$?: ComponentShouldUpdateChanges;
6039
+ $signalValues$?: Map<string, import('@preact/signals-core').Signal<any>>;
6040
+ /** Dispose function that tears down all signal effects for this component. */
6041
+ $signalCleanup$?: () => void;
6328
6042
  $serializerValues$?: Map<string, string>;
6329
6043
  $lazyInstance$?: ComponentInterface;
6330
6044
  /**
@@ -6357,6 +6071,21 @@ interface HostRef {
6357
6071
  * It is called after {@link HostRef.$onInstancePromise$} resolves.
6358
6072
  */
6359
6073
  $onRenderResolve$?: () => void;
6074
+ /**
6075
+ * A promise that resolves once this component's real `connectedCallback` has fired
6076
+ * for the first time. Created lazily - either by a descendant that needs to wait for
6077
+ * this component's connection before firing its own real `connectedCallback`
6078
+ * ({@link HOST_FLAGS.hasFiredConnected}), or by this component registering itself
6079
+ * with its nearest Stencil ancestor's `s-pc` list. This is what lets a component's
6080
+ * real `connectedCallback` (and, transitively, a pending ancestor's initial
6081
+ * `componentWillLoad`) stay ordered correctly regardless of which of an
6082
+ * ancestor/descendant pair's lazy module happens to resolve first.
6083
+ */
6084
+ $onFirstConnectPromise$?: Promise<void>;
6085
+ /**
6086
+ * A callback which resolves {@link HostRef.$onFirstConnectPromise$}
6087
+ */
6088
+ $onFirstConnectResolve$?: () => void;
6360
6089
  $vnode$?: VNode;
6361
6090
  $queuedListeners$?: [string, any][];
6362
6091
  $rmListeners$?: (() => void)[];
@@ -6366,51 +6095,12 @@ interface HostRef {
6366
6095
  * Defer connectedCallback until after first render for components with slot relocation.
6367
6096
  */
6368
6097
  $deferredConnectedCallback$?: boolean;
6369
- }
6370
- interface PlatformRuntime {
6371
- /**
6372
- * This number is used to hold a series of bitflags for various features we
6373
- * support within the runtime. The flags which this value is intended to store are
6374
- * documented in the {@link PLATFORM_FLAGS} enum.
6375
- */
6376
- $flags$: number;
6377
- /**
6378
- * Holds a map of nodes to be hydrated.
6379
- */
6380
- $orgLocNodes$?: Map<string, RenderNode>;
6381
- /**
6382
- * Holds the resource url for given platform environment.
6383
- */
6384
- $resourcesUrl$: string;
6385
- /**
6386
- * The nonce value to be applied to all script/style tags at runtime.
6387
- * If `null`, the nonce attribute will not be applied.
6388
- */
6389
- $nonce$?: string | null;
6390
- /**
6391
- * A utility function that executes a given function and returns the result.
6392
- * @param c The callback function to execute
6393
- */
6394
- jmp: (c: Function) => any;
6395
- /**
6396
- * A wrapper for {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame `requestAnimationFrame`}
6397
- */
6398
- raf: (c: FrameRequestCallback) => number;
6399
- /**
6400
- * A wrapper for {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener `addEventListener`}
6401
- */
6402
- ael: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
6403
- /**
6404
- * A wrapper for {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener `removeEventListener`}
6405
- */
6406
- rel: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
6407
6098
  /**
6408
- * A wrapper for creating a {@link https://developer.mozilla.org/docs/Web/API/CustomEvent `CustomEvent`}
6099
+ * The number of times this host's lazy component load has failed and been retried.
6100
+ * Used to give up retrying after {@link MAX_LAZY_LOAD_RETRIES} failed attempts.
6409
6101
  */
6410
- ce: (eventName: string, opts?: any) => CustomEvent;
6102
+ $loadRetryCount$?: number;
6411
6103
  }
6412
- type StyleMap = Map<string, CSSStyleSheet | string>;
6413
- type RootAppliedStyleMap = WeakMap<Element, Set<string>>;
6414
6104
  interface StyleCompiler {
6415
6105
  modeName: string;
6416
6106
  styleId: string;
@@ -6423,28 +6113,11 @@ interface ExternalStyleCompiler {
6423
6113
  relativePath: string;
6424
6114
  originalComponentPath: string;
6425
6115
  }
6426
- interface CompilerModeStyles {
6427
- [modeName: string]: string[];
6428
- }
6429
- interface CssImportData {
6430
- srcImport: string;
6431
- updatedImport?: string;
6432
- url: string;
6433
- filePath: string;
6434
- altFilePath?: string;
6435
- styleText?: string | null;
6436
- modifiers?: string;
6437
- }
6438
- interface CssToEsmImportData {
6439
- srcImportText: string;
6440
- varName: string;
6441
- url: string;
6442
- filePath: string;
6443
- /**
6444
- * True if this is a node module import (e.g. using ~ prefix like ~foo/style.css)
6445
- * These should be treated as bare module specifiers and not have ./ prepended
6446
- */
6447
- isNodeModule?: boolean;
6116
+ interface ComponentGlobalStyle {
6117
+ /** Absolute path to the CSS file, or null for inline styles */
6118
+ absolutePath: string | null;
6119
+ /** Raw inline CSS string, or null for file-based styles */
6120
+ styleStr: string | null;
6448
6121
  }
6449
6122
  /**
6450
6123
  * Input CSS to be transformed into ESM
@@ -6491,10 +6164,17 @@ interface TransformCssToEsmOutput {
6491
6164
  varName: string;
6492
6165
  importPath: string;
6493
6166
  }[];
6167
+ /**
6168
+ * Whether `output` itself has an observable side effect (a plain, untagged CSS file's
6169
+ * generated module self-injects CSSStyleSheets; a Stencil component's tagged `styleUrl`
6170
+ * output doesn't)
6171
+ */
6172
+ moduleSideEffects?: boolean;
6494
6173
  }
6495
6174
  interface PackageJsonData {
6496
6175
  name?: string;
6497
6176
  version?: string;
6177
+ type?: 'module' | 'commonjs';
6498
6178
  main?: string;
6499
6179
  exports?: {
6500
6180
  [key: string]: string | {
@@ -6508,7 +6188,6 @@ interface PackageJsonData {
6508
6188
  browser?: string;
6509
6189
  module?: string;
6510
6190
  'jsnext:main'?: string;
6511
- 'collection:main'?: string;
6512
6191
  unpkg?: string;
6513
6192
  collection?: string;
6514
6193
  types?: string;
@@ -6533,219 +6212,6 @@ interface PackageJsonData {
6533
6212
  license?: string;
6534
6213
  keywords?: string[];
6535
6214
  }
6536
- interface Workbox {
6537
- generateSW(swConfig: any): Promise<any>;
6538
- generateFileManifest(): Promise<any>;
6539
- getFileManifestEntries(): Promise<any>;
6540
- injectManifest(swConfig: any): Promise<any>;
6541
- copyWorkboxLibraries(wwwDir: string): Promise<any>;
6542
- }
6543
- interface SerializedEvent {
6544
- bubbles: boolean;
6545
- cancelBubble: boolean;
6546
- cancelable: boolean;
6547
- composed: boolean;
6548
- currentTarget: any;
6549
- defaultPrevented: boolean;
6550
- detail: any;
6551
- eventPhase: any;
6552
- isTrusted: boolean;
6553
- returnValue: any;
6554
- srcElement: any;
6555
- target: any;
6556
- timeStamp: number;
6557
- type: string;
6558
- isSerializedEvent: boolean;
6559
- }
6560
- interface EventInitDict {
6561
- bubbles?: boolean;
6562
- cancelable?: boolean;
6563
- composed?: boolean;
6564
- detail?: any;
6565
- }
6566
- interface AnyHTMLElement extends HTMLElement {
6567
- [key: string]: any;
6568
- }
6569
- interface SpecPage {
6570
- /**
6571
- * Mocked testing `document.body`.
6572
- */
6573
- body: HTMLBodyElement;
6574
- /**
6575
- * Mocked testing `document`.
6576
- */
6577
- doc: HTMLDocument;
6578
- /**
6579
- * The first component found within the mocked `document.body`. If a component isn't found, then it'll return `document.body.firstElementChild`.
6580
- */
6581
- root?: AnyHTMLElement;
6582
- /**
6583
- * Similar to `root`, except returns the component instance. If a root component was not found it'll return `null`.
6584
- */
6585
- rootInstance?: any;
6586
- /**
6587
- * Convenience function to set `document.body.innerHTML` and `waitForChanges()`. Function argument should be a HTML string.
6588
- */
6589
- setContent: (html: string) => Promise<any>;
6590
- /**
6591
- * After changes have been made to a component, such as a update to a property or attribute, the test page does not automatically apply the changes. In order to wait for, and apply the update, call `await page.waitForChanges()`.
6592
- */
6593
- waitForChanges: () => Promise<any>;
6594
- /**
6595
- * Mocked testing `window`.
6596
- */
6597
- win: Window;
6598
- build: BuildConditionals;
6599
- flushLoadModule: (bundleId?: string) => Promise<any>;
6600
- flushQueue: () => Promise<any>;
6601
- styles: Map<string, string>;
6602
- }
6603
- /**
6604
- * Options pertaining to the creation and functionality of a {@link SpecPage}
6605
- */
6606
- interface NewSpecPageOptions {
6607
- /**
6608
- * An array of components to test. Component classes can be imported into the spec file, then their reference should be added to the `component` array in order to be used throughout the test.
6609
- */
6610
- components: any[];
6611
- /**
6612
- * Sets the mocked `document.cookie`.
6613
- */
6614
- cookie?: string;
6615
- /**
6616
- * Sets the mocked `dir` attribute on `<html>`.
6617
- */
6618
- direction?: string;
6619
- /**
6620
- * If `false`, do not flush the render queue on initial test setup.
6621
- */
6622
- flushQueue?: boolean;
6623
- /**
6624
- * The initial HTML used to generate the test. This can be useful to construct a collection of components working together, and assign HTML attributes. This value sets the mocked `document.body.innerHTML`.
6625
- */
6626
- html?: string;
6627
- /**
6628
- * The initial JSX used to generate the test.
6629
- * Use `template` when you want to initialize a component using their properties, instead of their HTML attributes.
6630
- * It will render the specified template (JSX) into `document.body`.
6631
- */
6632
- template?: () => any;
6633
- /**
6634
- * Sets the mocked `lang` attribute on `<html>`.
6635
- */
6636
- language?: string;
6637
- /**
6638
- * Useful for debugging hydrating components client-side. Sets that the `html` option already includes annotated prerender attributes and comments.
6639
- */
6640
- hydrateClientSide?: boolean;
6641
- /**
6642
- * Useful for debugging hydrating components server-side. The output HTML will also include prerender annotations.
6643
- */
6644
- hydrateServerSide?: boolean;
6645
- /**
6646
- * Sets the mocked `document.referrer`.
6647
- */
6648
- referrer?: string;
6649
- /**
6650
- * Manually set if the mocked document supports Shadow DOM or not. Default is `true`.
6651
- */
6652
- supportsShadowDom?: boolean;
6653
- /**
6654
- * When a component is pre-rendered it includes HTML annotations, such as `s-id` attributes and `<!-t.0->` comments. This information is used by client-side hydrating. Default is `false`.
6655
- */
6656
- includeAnnotations?: boolean;
6657
- /**
6658
- * Sets the mocked browser's `location.href`.
6659
- */
6660
- url?: string;
6661
- /**
6662
- * Sets the mocked browser's `navigator.userAgent`.
6663
- */
6664
- userAgent?: string;
6665
- /**
6666
- * By default, any changes to component properties and attributes must `page.waitForChanges()` in order to test the updates. As an option, `autoApplyChanges` continuously flushes the queue on the background. Default is `false`.
6667
- */
6668
- autoApplyChanges?: boolean;
6669
- /**
6670
- * By default, styles are not attached to the DOM and they are not reflected in the serialized HTML.
6671
- * Setting this option to `true` will include the component's styles in the serializable output.
6672
- */
6673
- attachStyles?: boolean;
6674
- /**
6675
- * Set {@link BuildConditionals} for testing based off the metadata of the component under test.
6676
- * When `true` all `BuildConditionals` will be assigned to the global testing `BUILD` object, regardless of their
6677
- * value. When `false`, only `BuildConditionals` with a value of `true` will be assigned to the `BUILD` object.
6678
- */
6679
- strictBuild?: boolean;
6680
- /**
6681
- * Default values to be set on the platform runtime object {@see PlatformRuntime} when creating
6682
- * the spec page.
6683
- */
6684
- platform?: Partial<PlatformRuntime>;
6685
- }
6686
- /**
6687
- * A record of `TypesMemberNameData` entities.
6688
- *
6689
- * Each key in this record is intended to be the path to a file that declares one or more types used by a component.
6690
- * However, this is not enforced by the type system - users of this interface should not make any assumptions regarding
6691
- * the format of the path used as a key (relative vs. absolute)
6692
- */
6693
- interface TypesImportData {
6694
- [key: string]: TypesMemberNameData[];
6695
- }
6696
- /**
6697
- * A type describing how Stencil may alias an imported type to avoid naming collisions when performing operations such
6698
- * as generating `components.d.ts` files.
6699
- */
6700
- interface TypesMemberNameData {
6701
- /**
6702
- * The original name of the import before any aliasing was applied.
6703
- *
6704
- * i.e. if a component imports a type as follows:
6705
- * `import { MyType as MyCoolType } from './my-type';`
6706
- *
6707
- * the `originalName` would be 'MyType'. If the import is not aliased, then `originalName` and `localName` will be the same.
6708
- */
6709
- originalName: string;
6710
- /**
6711
- * The name of the type as it's used within a file.
6712
- */
6713
- localName: string;
6714
- /**
6715
- * An alias that Stencil may apply to the `localName` to avoid naming collisions. This name does not appear in the
6716
- * file that is using `localName`.
6717
- */
6718
- importName?: string;
6719
- /**
6720
- * Whether this is a default import/export (e.g., `import MyEnum from './my-enum'`)
6721
- * vs a named import/export (e.g., `import { MyType } from './my-type'`)
6722
- */
6723
- isDefault?: boolean;
6724
- }
6725
- interface TypesModule {
6726
- isDep: boolean;
6727
- tagName: string;
6728
- tagNameAsPascal: string;
6729
- htmlElementName: string;
6730
- component: string;
6731
- jsx: string;
6732
- element: string;
6733
- explicitAttributes: string | null;
6734
- explicitProperties: string | null;
6735
- requiredProps: Array<{
6736
- name: string;
6737
- type: string;
6738
- complexType?: ComponentCompilerProperty['complexType'];
6739
- }> | null;
6740
- }
6741
- type TypeInfo = {
6742
- name: string;
6743
- type: string;
6744
- optional: boolean;
6745
- required: boolean;
6746
- internal: boolean;
6747
- jsdoc?: string;
6748
- }[];
6749
6215
  type ChildType = VNode | number | string;
6750
6216
  type PropsType = VNodeProdData | number | string | null;
6751
6217
  interface VNodeProdData {
@@ -6768,7 +6234,7 @@ interface VNodeProdData {
6768
6234
  */
6769
6235
  interface CompilerWorkerContext {
6770
6236
  optimizeCss(inputOpts: OptimizeCssInput): Promise<OptimizeCssOutput>;
6771
- prepareModule(input: string, minifyOpts: any, transpile: boolean, inlineHelpers: boolean): Promise<{
6237
+ prepareModule(input: string, minifyOpts: any): Promise<{
6772
6238
  output: string;
6773
6239
  diagnostics: Diagnostic$1[];
6774
6240
  sourceMap?: SourceMap$1;
@@ -6799,33 +6265,6 @@ type MsgToWorker<T extends WorkerContextMethod> = IPCSerializable<{
6799
6265
  method: T;
6800
6266
  args: Parameters<CompilerWorkerContext[T]>;
6801
6267
  }>;
6802
- /**
6803
- * A manifest for a job that a worker thread should carry out, as determined by
6804
- * and dispatched from the main thread. This includes the name of the task to do
6805
- * and any arguments necessary to carry it out properly.
6806
- *
6807
- * This message must satisfy {@link CPSerializable} so it can be sent from the
6808
- * main thread to a worker thread via an IPC channel
6809
- */
6810
- type MsgFromWorker<T extends WorkerContextMethod> = IPCSerializable<{
6811
- stencilId?: number;
6812
- stencilRtnValue: ReturnType<CompilerWorkerContext[T]>;
6813
- stencilRtnError: string | null;
6814
- }>;
6815
- /**
6816
- * A description of a task which should be passed to a worker in another
6817
- * thread. This interface differs from {@link MsgToWorker} in that it doesn't
6818
- * have to be serializable for transmission through an IPC channel, so we can
6819
- * hold things like a `resolve` and `reject` callback to use when the task
6820
- * completes.
6821
- */
6822
- interface CompilerWorkerTask {
6823
- stencilId: number;
6824
- inputArgs: any[];
6825
- resolve: (val: any) => any;
6826
- reject: (msg: string) => any;
6827
- retries: number;
6828
- }
6829
6268
  /**
6830
6269
  * A handler for IPC messages from the main thread to a worker thread. This
6831
6270
  * involves dispatching an action specified by a {@link MsgToWorker} object to a
@@ -6835,17 +6274,5 @@ interface CompilerWorkerTask {
6835
6274
  * @returns the return value of the specified function
6836
6275
  */
6837
6276
  type WorkerMsgHandler = <T extends WorkerContextMethod>(msgToWorker: MsgToWorker<T>) => ReturnType<CompilerWorkerContext[T]>;
6838
- interface TranspileModuleResults {
6839
- sourceFilePath: string;
6840
- code: string;
6841
- map: any;
6842
- diagnostics: Diagnostic$1[];
6843
- moduleFile: Module;
6844
- }
6845
- interface ValidateTypesResults {
6846
- diagnostics: Diagnostic$1[];
6847
- dirPaths: string[];
6848
- filePaths: string[];
6849
- }
6850
6277
  //#endregion
6851
- export { ComponentCompilerVirtualProperty as $, isTsxFile as $a, SitemapXmpResults as $i, CompilerEventBuildFinish as $n, hasError as $o, LazyRequire as $r, toDashCase as $s, PluginTransformationDescriptor as $t, CompilerStyleDoc as A, JsonDocsMethod as Aa, NonPrimitiveType as Ac, OutputTargetHydrate as Ai, VNodeProdData as An, isOutputTargetDistCollection as Ao, CopyResults as Ar, ScriptStringValue as As, HydrateScriptElement as At, ComponentCompilerMeta as B, StyleDoc as Ba, WATCH_FLAGS as Bc, PrerenderStartOptions as Bi, BuildOnEventRemove as Bn, isOutputTargetDocsReadme as Bo, EmulateConfig as Br, isBoolean as Bs, ModuleMap as Bt, CompilerBuildStatBundle as C, JsonDocMethodParameter as Ca, EVENT_FLAGS as Cc, OutputTargetDistLazyLoader as Ci, TransformCssToEsmOutput as Cn, getComponentsDtsSrcFilePath as Co, CompilerSystemRenameResults as Cr, ScriptPreloadScript as Cs, HostElement as Ct, CompilerJsDoc as D, JsonDocsDependencyGraph as Da, LISTENER_FLAGS as Dc, OutputTargetDocsJson as Di, TypesMemberNameData as Dn, isOutputTargetCopy as Do, Config as Dr, ScriptRegExpValue as Ds, HydrateElement as Dt, CompilerCtx as E, JsonDocsCustomState as Ea, HTML_NS as Ec, OutputTargetDocsCustomElementsManifest as Ei, TypesImportData as En, isEligiblePrimaryPackageOutputTarget as Eo, CompilerWatcher as Er, ScriptRegExpLocalValue as Es, HydrateComponent as Et, ComponentCompilerData as F, JsonDocsStyle as Fa, STATS as Fc, Path as Fi, AutoprefixerOptions as Fn, isOutputTargetDistTypes as Fo, DevServer as Fr, isGlob as Fs, JsDoc as Ft, ComponentCompilerPropertyType as G, createJsVarName as Ga, RobotsTxtResults as Gi, CacheStorage as Gn, isValidConfigOutputTarget as Go, HistoryApiFallback as Gr, isNumber as Gs, OptimizeJsResult as Gt, ComponentCompilerMethodComplexType as H, validateComponentTag as Ha, XLINK_NS as Hc, ResolveModuleIdResults as Hi, BuildOutput as Hn, isOutputTargetHydrate as Ho, FsStats as Hr, isDef as Hs, MsgToWorker as Ht, ComponentCompilerEvent as I, JsonDocsTag as Ia, SVG_NS as Ic, PlatformPath as Ii, BuildEmitEvents as In, isOutputTargetDocs as Io, DevServerConfig as Ir, dashToPascalCase as Is, LazyBundleRuntimeData as It, ComponentCompilerStaticEvent as J, hasDependency as Ja, RollupInterface as Ji, CompileTarget as Jn, TASK_CANCELED_MSG as Jo, HydrateDocumentOptions as Jr, mergeIntoWith as Js, PatchedSlotNode as Jt, ComponentCompilerReferencedType as K, generatePreamble as Ka, RollupConfig as Ki, CliInitOptions as Kn, relativeImport as Ko, HmrStyleUpdate as Kr, isObject as Ks, PackageJsonData as Kt, ComponentCompilerEventComplexType as L, JsonDocsTypeLibrary as La, TYPE_CONSTANT as Lc, PrerenderConfig as Li, BuildEvents as Ln, isOutputTargetDocsCustom as Lo, DevServerEditor as Lr, escapeWithPattern as Ls, LazyBundlesRuntimeData as Lt, CompilerWorkerTask as M, JsonDocsPart as Ma, PrimitiveType as Mc, OutputTargetWww as Mi, Workbox as Mn, isOutputTargetDistGlobalStyles as Mo, Credentials as Mr, ScriptUndefinedValue as Ms, HydrateStyleElement as Mt, ComponentCompilerChangeHandler as N, JsonDocsProp as Na, PrimitiveTypeValue as Nc, PageReloadStrategy as Ni, WorkerContextMethod as Nn, isOutputTargetDistLazy as No, CustomElementsExportBehavior as Nr, Serializeable as Ns, ImportData as Nt, CompilerJsDocTagInfo as O, JsonDocsEvent as Oa, MEMBER_FLAGS as Oc, OutputTargetDocsReadme as Oi, TypesModule as On, isOutputTargetCustom as Oo, ConfigBundle as Or, ScriptSetLocalValue as Os, HydrateImgElement as Ot, ComponentCompilerCustomState as P, JsonDocsSlot as Pa, SERIALIZED_PREFIX as Pc, ParsedPath as Pi, WorkerMsgHandler as Pn, isOutputTargetDistLazyLoader as Po, CustomElementsExportBehaviorOptions as Pr, isRootPath as Ps, JSDocTagInfo as Pt, ComponentCompilerTypeReferences as Q, isTsFile as Qa, SitemapXmpOpts as Qi, CompilerDependency as Qn, catchError as Qo, LOG_LEVELS as Qr, toCamelCase as Qs, PluginTransformResults as Qt, ComponentCompilerFeatures as R, JsonDocsUsage as Ra, VALID_CONFIG_OUTPUT_TARGETS as Rc, PrerenderHydrateOptions as Ri, BuildLog as Rn, isOutputTargetDocsCustomElementsManifest as Ro, Diagnostic$1 as Rr, flatOne as Rs, Module as Rt, CompilerAssetDir as S, VNode as Sa, DOCS_VSCODE as Sc, OutputTargetDistLazy as Si, TransformCssToEsmInput as Sn, filterExcludedComponents as So, CompilerSystemRemoveFileResults as Sr, ScriptObjectLocalValue as Ss, ExternalStyleCompiler as St, CompilerBuildStats as T, JsonDocsComponent as Ta, HOST_FLAGS as Tc, OutputTargetDocsCustom as Ti, TypeInfo as Tn, getComponentsFromModules as To, CompilerSystemWriteFileResults as Tr, ScriptRealm as Ts, HydrateAnchorElement as Tt, ComponentCompilerProperty as U, ParsePackageJsonResult as Ua, byteSize as Uc, ResolveModuleOptions as Ui, BuildResultsComponentGraph as Un, isOutputTargetStats as Uo, FsWatchResults as Ur, isFunction as Us, NewSpecPageOptions as Ut, ComponentCompilerMethod as V, FsWriteResults as Va, WWW as Vc, ResolveModuleIdOptions as Vi, BuildOnEvents as Vn, isOutputTargetDocsVscode as Vo, EmulateViewport as Vr, isComplexType as Vs, MsgFromWorker as Vt, ComponentCompilerPropertyComplexType as W, addDocBlock as Wa, RobotsTxtOpts as Wi, BundlingConfig as Wn, isOutputTargetWww as Wo, FsWatcherItem as Wr, isIterable as Ws, NodeMap as Wt, ComponentCompilerStaticProperty as X, isJsFile as Xa, SerializeDocumentOptions as Xi, CompilerBuildResults as Xn, buildJsonFileError as Xo, HydratedFlag as Xr, pluck as Xs, Plugin as Xt, ComponentCompilerStaticMethod as Y, isDtsFile as Ya, RollupOutputOptions as Yi, Compiler as Yn, buildError as Yo, HydrateFactoryOptions as Yr, noop as Ys, PlatformRuntime as Yt, ComponentCompilerTypeReference as Z, isJsxFile as Za, ServiceWorkerConfig as Zi, CompilerBuildStart as Zn, buildWarn as Zo, JestConfig as Zr, sortBy as Zs, PluginCtx as Zt, CollectionCompilerVersion as _, ErrorHandler as _a, DIST_TYPES as _c, OutputTargetCustom as _i, SourceTarget as _n, normalizeFsPathQuery as _o, CompilerSystemCreateDirectoryOptions as _r, ScriptLocalValue as _s, CssToEsmImportData as _t, BuildCtx as a, TestingConfig as aa, CMP_FLAGS as ac, LoggerTimeSpan as ai, RenderNode as an, getSourceMappingUrlForEndOfFile as ao, CompilerEventFileAdd as ar, augmentDiagnosticWithNode as as, ComponentConstructorProperties as at, CollectionDependencyManifest as b, ResolutionHandler as ba, DOCS_JSON as bc, OutputTargetDistCustomElements as bi, StyleCompiler as bn, resolve as bo, CompilerSystemRemoveDirectoryOptions as br, ScriptNullValue as bs, EntryModule as bt, BuildStyleUpdate as c, TransformerConfig as ca, CUSTOM as cc, OptimizeCssInput as ci, RollupResult as cn, deserializeProperty as co, CompilerEventFsChange as cr, createOnWarnFn as cs, ComponentNativeConstructor as ct, BundleModuleOutput as d, TranspileResults as da, DIST_COLLECTION as dc, OptimizeJsOutput as di, RollupSourceMap as dn, RemoteValue as do, CompilerFileWatcherCallback as dr, LocalValueParam as ds, ComponentRuntimeMembers as dt, StencilConfig as ea, toTitleCase as ec, LoadConfigInit as ei, PrerenderManager as en, parsePackageJson as eo, CompilerEventBuildLog as er, hasWarning as es, ComponentConstructor as et, Cache as f, UnvalidatedConfig as fa, DIST_CUSTOM_ELEMENTS as fc, OutputTarget as fi, RootAppliedStyleMap as fn, escapeRegExpSpecialCharacters as fo, CompilerFileWatcherEvent as fr, ScriptArrayLocalValue as fs, ComponentRuntimeMeta as ft, CollectionCompilerMeta as g, WorkerOptions as ga, DIST_LAZY_LOADER as gc, OutputTargetCopy as gi, SourceMap$1 as gn, normalizeFsPath as go, CompilerSystem as gr, ScriptListLocalValue as gs, CssImportData as gt, CollectionCompiler as h, WorkerMainController as ha, DIST_LAZY as hc, OutputTargetBuild as hi, SerializedEvent as hn, normalize as ho, CompilerRequestResponse as hr, ScriptDateLocalValue as hs, ComponentTestingConstructor as ht, BuildConditionals as i, Testing as ia, stringifyRuntimeData as ic, LoggerLineUpdater as ii, PropsType as in, getInlineSourceMappingUrlLinker as io, CompilerEventDirDelete as ir, splitLineBreaks as is, ComponentConstructorListener as it, CompilerWorkerContext as j, JsonDocsMethodReturn as ja, NonPrimitiveTypeValue as jc, OutputTargetStats as ji, ValidateTypesResults as jn, isOutputTargetDistCustomElements as jo, CopyTask as jr, ScriptSymbolValue as js, HydrateStaticData as jt, CompilerModeStyles as k, JsonDocsListener as ka, NODE_TYPES as kc, OutputTargetDocsVscode as ki, UpdatedLazyBuildCtx as kn, isOutputTargetDist as ko, ConfigExtras as kr, ScriptSpecialNumber as ks, HydrateResults as kt, BuildTask as l, TranspileOnlyResults as la, DEFAULT_STYLE_MODE as lc, OptimizeCssOutput as li, RollupResultModule as ln, serializeProperty as lo, CompilerEventName as lr, loadRollupDiagnostics as ls, ComponentRuntimeHostListener as lt, CollectionBundleManifest as m, WatcherCloseResults as ma, DIST_HYDRATE_SCRIPT as mc, OutputTargetBaseNext as mi, SerializeImportData as mn, join as mo, CompilerRequest as mr, ScriptBooleanValue as ms, ComponentRuntimeReflectingAttr as mt, AssetsMeta as n, StencilDocsConfig as na, formatComponentRuntimeMeta as nc, LogLevel as ni, PrerenderUrlResults as nn, readPackageJson as no, CompilerEventBuildStart as nr, escapeHtml as ns, ComponentConstructorEncapsulation as nt, BuildFeatures as o, TestingRunOptions as oa, COLLECTION_MANIFEST_FILE_NAME as oc, MakeDirectoryOptions as oi, RollupAssetResult as on, getSourceMappingUrlLinker as oo, CompilerEventFileDelete as or, loadTypeScriptDiagnostic as os, ComponentConstructorProperty as ot, ChildType as p, ValidatedConfig as pa, DIST_GLOBAL_STYLES as pc, OutputTargetBase as pi, RuntimeRef as pn, queryNonceMetaTagContent as po, CompilerFsStats as pr, ScriptBigIntValue as ps, ComponentRuntimeMetaCompact as pt, ComponentCompilerState as q, getTextDocs as qa, RollupInputOptions as qi, CompileScriptMinifyOptions as qn, shouldExcludeComponent as qo, HotModuleReplacement as qr, isString as qs, ParsedImport as qt, BuildComponent as r, SystemDetails as ra, formatLazyBundleRuntimeMeta as rc, Logger as ri, PrintLine as rn, isRemoteUrl as ro, CompilerEventDirAdd as rr, normalizeDiagnostics as rs, ComponentConstructorEvent as rt, BuildSourceGraph as s, TransformOptions as sa, COPY as sc, NodeResolveConfig as si, RollupChunkResult as sn, rollupToStencilSourceMap as so, CompilerEventFileUpdate as sr, loadTypeScriptDiagnostics as ss, ComponentConstructorPropertyType as st, AnyHTMLElement as t, StencilDevServerConfig as ta, unique as tc, LoadConfigResults as ti, PrerenderUrlRequest as tn, readOnlyArrayHasStringMember as to, CompilerEventBuildNoChange as tr, shouldIgnoreError as ts, ComponentConstructorChangeHandlers as tt, BundleModule as u, TranspileOptions as ua, DIST as uc, OptimizeJsInput as ui, RollupResults as un, result_d_exports as uo, CompilerFileWatcher as ur, LocalValue as us, ComponentRuntimeMember as ut, CollectionComponentEntryPath as v, FunctionalComponent as va, DOCS_CUSTOM as vc, OutputTargetDist as vi, SpecPage as vn, normalizePath as vo, CompilerSystemCreateDirectoryResults as vr, ScriptMapLocalValue as vs, DocData as vt, CompilerBuildStatCollection as w, JsonDocs as wa, GENERATED_DTS as wc, OutputTargetDistTypes as wi, TranspileModuleResults as wn, getComponentsDtsTypesFilePath as wo, CompilerSystemRenamedPath as wr, ScriptPrimitiveProtocolValue as ws, HostRef as wt, CollectionManifest as x, UserBuildConditionals as xa, DOCS_README as xc, OutputTargetDistGlobalStyles as xi, StyleMap as xn, FilterComponentsResult as xo, CompilerSystemRemoveDirectoryResults as xr, ScriptNumberValue as xs, EventInitDict as xt, CollectionDependencyData as y, RafCallback as ya, DOCS_CUSTOM_ELEMENTS_MANIFEST as yc, OutputTargetDistCollection as yi, StencilDocument as yn, relative as yo, CompilerSystemRealpathResults as yr, ScriptMappingLocalValue as ys, Encapsulation as yt, ComponentCompilerListener as z, JsonDocsValue as za, VALUE_CONSTANT as zc, PrerenderResults as zi, BuildNoChangeResults as zn, isOutputTargetDocsJson as zo, EligiblePrimaryPackageOutputTarget as zr, fromEntries as zs, ModuleFormat as zt };
6278
+ export { CompilerFsStats as $, COLLECTION_APP_DATA_FILE_NAME as $i, WorkerMainController as $n, result_d_exports as $r, OutputTargetBuild as $t, BuildOverrides as A, XLINK_NS as Aa, TASK_CANCELED_MSG as Ai, ResolveModuleIdResults as An, ModeValidationError as Ar, HotModuleReplacement as At, CompilerEventBuildLog as B, splitLineBreaks as Bi, SsrFactoryOptions as Bn, isJsFile as Br, Logger as Bt, BuildEmitEvents as C, STATS as Ca, isOutputTargetStandalone as Ci, PluginTransformResults as Cn, JsonDocsStyle as Cr, DevServerEditor as Ct, BuildOnEventRemove as D, VALID_CONFIG_OUTPUT_TARGETS as Da, isValidConfigOutputTarget as Di, PrerenderResults as Dn, JsonDocsValue as Dr, HistoryApiFallback as Dt, BuildNoChangeResults as E, TYPES as Ea, isOutputTargetWww as Ei, PrerenderOptions as En, JsonDocsUsage as Er, FsWatchResults as Et, Compiler as F, hasError as Fi, SerializeDocumentOptions as Fn, createJsVarName as Fr, LazyRequire as Ft, CompilerEventFileAdd as G, isRolldownError as Gi, TransformOptions as Gn, readOnlyArrayHasStringMember as Gr, OptimizeCssInput as Gt, CompilerEventBuildStart as H, loadTypeScriptDiagnostic as Hi, StencilDevServerConfig as Hn, isTsFile as Hr, LoggerTimeSpan as Ht, CompilerBuildResults as I, hasWarning as Ii, ServiceWorkerConfig as In, generatePreamble as Ir, LightDomPatches as It, CompilerEventFsChange as J, formatLazyBundleRuntimeMeta as Ji, TranspileResults as Jn, getRolldownSourceMapOptions as Jr, OptimizeJsOutput as Jt, CompilerEventFileDelete as K, loadRolldownDiagnostics as Ki, TranspileOnlyResults as Kn, readPackageJson as Kr, OptimizeCssOutput as Kt, CompilerBuildStart as L, shouldIgnoreError as Li, SitemapXmpOpts as Ln, getTextDocs as Lr, LoadConfigInit as Lt, CliInitOptions as M, buildJsonFileError as Mi, RobotsTxtOpts as Mn, validateComponentTag as Mr, HydrateFactoryOptions as Mt, CompileScriptMinifyOptions as N, buildWarn as Ni, RobotsTxtResults as Nn, ParsePackageJsonResult as Nr, HydratedFlag as Nt, BuildOnEvents as O, WATCH_FLAGS as Oa, relativeImport as Oi, PrerenderStartOptions as On, StyleDoc as Or, HmrGlobalStyleUpdate as Ot, CompileTarget as P, catchError as Pi, RolldownConfig as Pn, addDocBlock as Pr, LOG_LEVELS as Pt, CompilerFileWatcherEvent as Q, COLLECTION as Qi, WatcherCloseResults as Qn, rolldownToStencilSourceMap as Qr, OutputTargetBaseNext as Qt, CompilerDependency as R, escapeHtml as Ri, SitemapXmpResults as Rn, hasDependency as Rr, LoadConfigResults as Rt, AutoprefixerOptions as S, STANDALONE as Sa, isOutputTargetSsrWasm as Si, PluginCtx as Sn, JsonDocsSlot as Sr, DevServerConfig as St, BuildLog as T, SVG_NS as Ta, isOutputTargetTypes as Ti, PrerenderHydrateOptions as Tn, JsonDocsTypeLibrary as Tr, DocsReadmeCustomColumn as Tt, CompilerEventDirAdd as U, loadTypeScriptDiagnostics as Ui, StencilDocsConfig as Un, isTsxFile as Ur, ModeConfig as Ut, CompilerEventBuildNoChange as V, augmentDiagnosticWithNode as Vi, StencilConfig as Vn, isJsxFile as Vr, LoggerLineUpdater as Vt, CompilerEventDirDelete as W, createOnWarnFn as Wi, SystemDetails as Wn, parsePackageJson as Wr, NodeResolveConfig as Wt, CompilerFileWatcher as X, ASSETS as Xi, ValidatedConfig as Xn, getSourceMappingUrlLinker as Xr, OutputTargetAssets as Xt, CompilerEventName as Y, stringifyRuntimeData as Yi, UnvalidatedConfig as Yn, getSourceMappingUrlForEndOfFile as Yr, OutputTarget as Yt, CompilerFileWatcherCallback as Z, CMP_FLAGS as Zi, ValidatedOutputTargetWww as Zn, relativizeSourceMap as Zr, OutputTargetBase as Zt, PrintLine as _, LOADER_BUNDLE as _a, isOutputTargetDocsVscode as _i, OutputTargetWww as _n, JsonDocsListener as _r, CopyTask as _t, ComponentCompilerEvent as a, DOCS_AGENT_SKILL as aa, getComponentsFromModules as ai, OutputTargetDocsCustom as an, RafCallback as ar, CompilerSystemRealpathResults as at, SsrResults as b, SSR as ba, isOutputTargetServerRenderer as bi, PlatformPath as bn, JsonDocsPart as br, CustomElementsExportBehaviorOptions as bt, ComponentCompilerMethod as c, DOCS_JSON as ca, isOutputTargetCopy as ci, OutputTargetDocsReadme as cn, TagTransformer as cr, CompilerSystemRemoveFileResults as ct, ComponentCompilerTypeReferences as d, EVENT_FLAGS as da, isOutputTargetDocs as di, OutputTargetLoaderBundle as dn, JsonDocMethodParameter as dr, CompilerSystemWriteFileResults as dt, COLLECTION_MANIFEST_FILE_NAME as ea, FilterComponentsResult as ei, OutputTargetCollection as en, WorkerOptions as er, CompilerRequest as et, ComponentGlobalStyle as f, GENERATED_DTS as fa, isOutputTargetDocsAgentSkill as fi, OutputTargetSsr as fn, JsonDocs as fr, CompilerWatcher as ft, PrerenderUrlResults as g, LISTENER_FLAGS as ga, isOutputTargetDocsReadme as gi, OutputTargetTypes as gn, JsonDocsEvent as gr, CopyResults as gt, PackageJsonData as h, HTML_NS as ha, isOutputTargetDocsJson as hi, OutputTargetStats as hn, JsonDocsDependencyGraph as hr, ConfigCompat as ht, CompilerWorkerContext as i, DIST_LAZY as ia, getComponentsDtsTypesFilePath as ii, OutputTargetDocsAgentSkill as in, MixedInCtor as ir, CompilerSystemCreateDirectoryResults as it, BuildResultsComponentGraph as j, buildError as ji, ResolveModuleOptions as jn, validateComponentModes as jr, HydrateDocumentOptions as jt, BuildOutput as k, WWW as ka, shouldExcludeComponent as ki, ResolveModuleIdOptions as kn, FsWriteResults as kr, HmrStyleUpdate as kt, ComponentCompilerProperty as l, DOCS_README as la, isOutputTargetCustom as li, OutputTargetDocsVscode as ln, UserBuildConditionals as lr, CompilerSystemRenameResults as lt, LazyBundlesRuntimeData as m, HOST_FLAGS as ma, isOutputTargetDocsCustomElementsManifest as mi, OutputTargetStandalone as mn, JsonDocsCustomState as mr, ConfigBundle as mt, ChildType as n, CUSTOM as na, filterExcludedComponents as ni, OutputTargetCustom as nn, ErrorHandler as nr, CompilerSystem as nt, ComponentCompilerListener as o, DOCS_CUSTOM as oa, isOutputTargetAssets as oi, OutputTargetDocsCustomElementsManifest as on, ReactiveControllerHostInterface as or, CompilerSystemRemoveDirectoryOptions as ot, HostElement as p, GLOBAL_STYLE as pa, isOutputTargetDocsCustom as pi, OutputTargetSsrWasm as pn, JsonDocsComponent as pr, Config as pt, CompilerEventFileUpdate as q, formatComponentRuntimeMeta as qi, TranspileOptions as qn, getInlineSourceMappingUrlLinker as qr, OptimizeJsInput as qt, CompilerCtx as r, DEFAULT_STYLE_MODE as ra, getComponentsDtsSrcFilePath as ri, OutputTargetDistLazy as rn, FunctionalComponent as rr, CompilerSystemCreateDirectoryOptions as rt, ComponentCompilerMeta as s, DOCS_CUSTOM_ELEMENTS_MANIFEST as sa, isOutputTargetCollection as si, OutputTargetDocsJson as sn, ResolutionHandler as sr, CompilerSystemRemoveDirectoryResults as st, BuildCtx as t, COPY as ta, filterActiveTargets as ti, OutputTargetCopy as tn, ComponentInterface as tr, CompilerRequestResponse as tt, ComponentCompilerState as u, DOCS_VSCODE as ua, isOutputTargetDistLazy as ui, OutputTargetGlobalStyle as un, VNode as ur, CompilerSystemRenamedPath as ut, PropsType as v, MEMBER_FLAGS as va, isOutputTargetGlobalStyle as vi, PageReloadStrategy as vn, JsonDocsMethod as vr, Credentials as vt, BuildEvents as w, STYLE_EXT as wa, isOutputTargetStats as wi, PrerenderConfig as wn, JsonDocsTag as wr, Diagnostic$1 as wt, WorkerMsgHandler as x, SSR_WASM as xa, isOutputTargetSsr as xi, Plugin$1 as xn, JsonDocsProp as xr, DevServer as xt, RuntimeRef as y, NODE_TYPES as ya, isOutputTargetLoaderBundle as yi, ParsedPath as yn, JsonDocsMethodReturn as yr, CustomElementsExportBehavior as yt, CompilerEventBuildFinish as z, normalizeDiagnostics as zi, SsrDocumentOptions as zn, isDtsFile as zr, LogLevel as zt };