@stencil/core 4.39.0 → 4.40.1-dev.1766552834.64f6089

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 (39) hide show
  1. package/cli/index.cjs +1616 -41
  2. package/cli/index.js +1616 -41
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +2791 -2515
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +1665 -90
  12. package/internal/app-data/index.cjs +1 -0
  13. package/internal/app-data/index.js +1 -0
  14. package/internal/app-data/package.json +1 -1
  15. package/internal/app-globals/package.json +1 -1
  16. package/internal/client/index.js +1746 -105
  17. package/internal/client/package.json +1 -1
  18. package/internal/client/patch-browser.js +1 -1
  19. package/internal/hydrate/index.js +1770 -133
  20. package/internal/hydrate/package.json +1 -1
  21. package/internal/hydrate/runner.js +1794 -104
  22. package/internal/package.json +1 -1
  23. package/internal/stencil-private.d.ts +25 -2
  24. package/internal/stencil-public-compiler.d.ts +33 -3
  25. package/internal/stencil-public-runtime.d.ts +14 -3
  26. package/internal/testing/index.js +1758 -133
  27. package/internal/testing/package.json +1 -1
  28. package/mock-doc/index.cjs +8 -1
  29. package/mock-doc/index.js +8 -1
  30. package/mock-doc/package.json +1 -1
  31. package/package.json +1 -1
  32. package/screenshot/index.js +1608 -30
  33. package/screenshot/package.json +1 -1
  34. package/screenshot/pixel-match.js +1 -1
  35. package/sys/node/index.js +28 -28
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +1696 -109
  39. package/testing/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal",
3
- "version": "4.39.0",
3
+ "version": "4.40.1-dev.1766552834.64f6089",
4
4
  "description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -18,7 +18,7 @@ export interface SourceMap {
18
18
  names: string[];
19
19
  sourceRoot?: string;
20
20
  sources: string[];
21
- sourcesContent?: string[];
21
+ sourcesContent?: (string | null)[];
22
22
  version: number;
23
23
  }
24
24
  export interface PrintLine {
@@ -47,6 +47,11 @@ export interface ImportData {
47
47
  export interface SerializeImportData extends ImportData {
48
48
  importeePath: string;
49
49
  importerPath?: string;
50
+ /**
51
+ * True if this is a node module import (e.g. using ~ prefix like ~foo/style.css)
52
+ * These should be treated as bare module specifiers and not have ./ prepended
53
+ */
54
+ isNodeModule?: boolean;
50
55
  }
51
56
  export interface BuildFeatures {
52
57
  style: boolean;
@@ -54,6 +59,7 @@ export interface BuildFeatures {
54
59
  formAssociated: boolean;
55
60
  shadowDom: boolean;
56
61
  shadowDelegatesFocus: boolean;
62
+ shadowSlotAssignmentManual: boolean;
57
63
  scoped: boolean;
58
64
  /**
59
65
  * Every component has a render function
@@ -470,6 +476,7 @@ export interface ComponentCompilerFeatures {
470
476
  hasReflect: boolean;
471
477
  hasRenderFn: boolean;
472
478
  hasSerializer: boolean;
479
+ hasSlot: boolean;
473
480
  hasState: boolean;
474
481
  hasStyle: boolean;
475
482
  hasVdomAttribute: boolean;
@@ -554,6 +561,11 @@ export interface ComponentCompilerMeta extends ComponentCompilerFeatures {
554
561
  properties: ComponentCompilerProperty[];
555
562
  serializers: ComponentCompilerChangeHandler[];
556
563
  shadowDelegatesFocus: boolean;
564
+ /**
565
+ * Slot assignment mode for shadow DOM. 'manual', enables imperative slotting
566
+ * using HTMLSlotElement.assign(). Only applicable when encapsulation is 'shadow'.
567
+ */
568
+ slotAssignment: 'manual' | null;
557
569
  sourceFilePath: string;
558
570
  sourceMapPath: string;
559
571
  states: ComponentCompilerState[];
@@ -707,6 +719,9 @@ export interface ComponentCompilerMethodComplexType {
707
719
  export interface ComponentCompilerChangeHandler {
708
720
  propName: string;
709
721
  methodName: string;
722
+ handlerOptions?: {
723
+ immediate?: boolean;
724
+ };
710
725
  }
711
726
  export interface ComponentCompilerMethod extends ComponentCompilerStaticMethod {
712
727
  name: string;
@@ -798,7 +813,9 @@ export interface ComponentConstructor {
798
813
  * them.
799
814
  */
800
815
  export interface ComponentConstructorChangeHandlers {
801
- [propName: string]: string[];
816
+ [propName: string]: {
817
+ [methodName: string]: number;
818
+ }[];
802
819
  }
803
820
  export interface ComponentTestingConstructor extends ComponentConstructor {
804
821
  COMPILER_META: ComponentCompilerMeta;
@@ -1829,12 +1846,18 @@ export interface CssImportData {
1829
1846
  filePath: string;
1830
1847
  altFilePath?: string;
1831
1848
  styleText?: string | null;
1849
+ modifiers?: string;
1832
1850
  }
1833
1851
  export interface CssToEsmImportData {
1834
1852
  srcImportText: string;
1835
1853
  varName: string;
1836
1854
  url: string;
1837
1855
  filePath: string;
1856
+ /**
1857
+ * True if this is a node module import (e.g. using ~ prefix like ~foo/style.css)
1858
+ * These should be treated as bare module specifiers and not have ./ prepended
1859
+ */
1860
+ isNodeModule?: boolean;
1838
1861
  }
1839
1862
  /**
1840
1863
  * Input CSS to be transformed into ESM
@@ -123,9 +123,12 @@ export interface StencilConfig {
123
123
  */
124
124
  plugins?: any[];
125
125
  /**
126
- * Generate js source map files for all bundles
126
+ * Generate js source map files for all bundles.
127
+ * Set to `true` to always generate source maps, `false` to never generate source maps.
128
+ * Set to `'dev'` to only generate source maps when the `--dev` flag is passed.
129
+ * Defaults to `'dev'`.
127
130
  */
128
- sourceMap?: boolean;
131
+ sourceMap?: boolean | 'dev';
129
132
  /**
130
133
  * The srcDir config specifies the directory which should contain the source typescript files
131
134
  * for each component. The standard for Stencil apps is to use src, which is the default.
@@ -294,6 +297,30 @@ export interface StencilConfig {
294
297
  * is updated, it will not trigger a re-run of tests.
295
298
  */
296
299
  watchIgnoredRegex?: RegExp | RegExp[];
300
+ /**
301
+ * An array of component tag names to exclude from production builds.
302
+ * Useful to remove test, demo or experimental components from final output.
303
+ *
304
+ * **Note:** Exclusion only applies to production builds (default, or when `--prod` is used).
305
+ * Development builds (with `--dev` flag) will include all components to support local testing.
306
+ *
307
+ * Supports glob patterns for matching multiple components:
308
+ * - `['demo-*']` - Excludes all components starting with "demo-"
309
+ * - `['*-test', '*-demo']` - Excludes components ending with "-test" or "-demo"
310
+ * - `['my-component']` - Excludes a specific component
311
+ *
312
+ * Components matching these patterns will be completely excluded from all output targets.
313
+ *
314
+ * @example
315
+ * ```ts
316
+ * export const config: Config = {
317
+ * excludeComponents: ['demo-*', 'test-component', '*-internal'],
318
+ * };
319
+ * ```
320
+ *
321
+ * @default []
322
+ */
323
+ excludeComponents?: string[];
297
324
  /**
298
325
  * Set whether unused dependencies should be excluded from the built output.
299
326
  */
@@ -472,7 +499,9 @@ type StrictConfigFields = keyof Pick<Config, 'buildEs5' | 'cacheDir' | 'devMode'
472
499
  * about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
473
500
  * validations have occurred at runtime.
474
501
  */
475
- export type ValidatedConfig = RequireFields<Config, StrictConfigFields>;
502
+ export type ValidatedConfig = RequireFields<Config, StrictConfigFields> & {
503
+ sourceMap: boolean;
504
+ };
476
505
  export interface HydratedFlag {
477
506
  /**
478
507
  * Defaults to `hydrated`.
@@ -2143,6 +2172,7 @@ export interface OutputTargetHydrate extends OutputTargetBase {
2143
2172
  */
2144
2173
  external?: string[];
2145
2174
  empty?: boolean;
2175
+ minify?: boolean;
2146
2176
  }
2147
2177
  export interface OutputTargetCustom extends OutputTargetBase {
2148
2178
  type: 'custom';
@@ -63,6 +63,12 @@ export interface ShadowRootOptions {
63
63
  * focusable part is given focus, and the shadow host is given any available `:focus` styling.
64
64
  */
65
65
  delegatesFocus?: boolean;
66
+ /**
67
+ * Sets the slot assignment mode for the shadow root. When set to `'manual'`, enables imperative
68
+ * slotting using the `HTMLSlotElement.assign()` method. Defaults to `'named'` for standard
69
+ * declarative slotting behavior.
70
+ */
71
+ slotAssignment?: 'manual' | 'named';
66
72
  }
67
73
  export interface ModeStyles {
68
74
  [modeName: string]: string | string[];
@@ -156,7 +162,9 @@ export interface StateDecorator {
156
162
  (): PropertyDecorator;
157
163
  }
158
164
  export interface WatchDecorator {
159
- (propName: any): CustomMethodDecorator<(newValue?: any, oldValue?: any, propName?: any, ...args: any[]) => any | void>;
165
+ (propName: any, watchOptions?: {
166
+ immediate?: boolean;
167
+ }): CustomMethodDecorator<(newValue?: any, oldValue?: any, propName?: any, ...args: any[]) => any | void>;
160
168
  }
161
169
  export interface PropSerializeDecorator {
162
170
  (propName: any): CustomMethodDecorator<(newValue?: any, propName?: string, ...args: any[]) => string | null>;
@@ -695,7 +703,7 @@ declare namespace LocalJSX {
695
703
  export { LocalJSX as JSX };
696
704
  export declare namespace JSXBase {
697
705
  interface IntrinsicElements {
698
- slot: JSXBase.SlotAttributes;
706
+ slot: JSXBase.SlotAttributes<HTMLSlotElement>;
699
707
  a: JSXBase.AnchorHTMLAttributes<HTMLAnchorElement>;
700
708
  abbr: JSXBase.HTMLAttributes;
701
709
  address: JSXBase.HTMLAttributes;
@@ -865,7 +873,7 @@ export declare namespace JSXBase {
865
873
  use: JSXBase.SVGAttributes;
866
874
  view: JSXBase.SVGAttributes;
867
875
  }
868
- interface SlotAttributes extends JSXAttributes {
876
+ interface SlotAttributes<T = HTMLSlotElement> extends JSXAttributes<T> {
869
877
  name?: string;
870
878
  slot?: string;
871
879
  onSlotchange?: (event: Event) => void;
@@ -921,6 +929,9 @@ export declare namespace JSXBase {
921
929
  popoverTargetAction?: string;
922
930
  popoverTargetElement?: Element | null;
923
931
  popoverTarget?: string;
932
+ command?: string;
933
+ commandFor?: string;
934
+ commandfor?: string;
924
935
  }
925
936
  interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
926
937
  height?: number | string;