@stencil/core 5.0.0-beta.11 → 5.0.0-beta.13

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.
@@ -394,6 +394,11 @@ interface JsonDocsComponent {
394
394
  * A deprecation reason/description found following a `@deprecated` tag
395
395
  */
396
396
  deprecation?: string;
397
+ /**
398
+ * `true` if this is a "CSS-only component"
399
+ * discovered in .css file via `@component`-marked JSDoc block
400
+ */
401
+ cssOnly?: boolean;
397
402
  }
398
403
  interface JsonDocsDependencyGraph {
399
404
  [tagName: string]: string[];
@@ -553,6 +558,16 @@ interface JsonDocsStyle {
553
558
  * The annotation used in the JSDoc of the style (e.g. `@prop`)
554
559
  */
555
560
  annotation: string;
561
+ /**
562
+ * The CSS `syntax` descriptor for a custom property, if it was registered via a native
563
+ * `@property` at-rule (e.g. `"<length>"`).
564
+ */
565
+ syntax?: string;
566
+ /**
567
+ * The `initial-value` descriptor for a custom property, if it was registered via a native
568
+ * `@property` at-rule.
569
+ */
570
+ default?: string;
556
571
  /**
557
572
  * The mode associated with the style
558
573
  */
@@ -639,6 +654,14 @@ interface StyleDoc {
639
654
  * The Stencil style-mode that is associated with this property.
640
655
  */
641
656
  mode: string | undefined;
657
+ /**
658
+ * The CSS `syntax` descriptor, if this property was registered via a native `@property` at-rule.
659
+ */
660
+ syntax?: string;
661
+ /**
662
+ * The `initial-value` descriptor, if this property was registered via a native `@property` at-rule.
663
+ */
664
+ default?: string;
642
665
  }
643
666
  //#endregion
644
667
  //#region src/declarations/stencil-public-runtime.d.ts
@@ -923,6 +946,15 @@ interface StencilConfig {
923
946
  * whenever a config file is present - set this explicitly to opt an existing project in or out.
924
947
  */
925
948
  generateExportMaps?: boolean;
949
+ /**
950
+ * Set to `false` to disable discovery of "CSS-only components" - pure-CSS custom-element
951
+ * definitions marked with a `@component` JSDoc tag in `.css` files under `srcDir`. No JS
952
+ * class, never registered via `customElements.define()` - just a documented,
953
+ * type-checked tag name and its CSS custom properties/attribute variants.
954
+ *
955
+ * Defaults to `true`.
956
+ */
957
+ enableCssOnlyComponents?: boolean;
926
958
  /**
927
959
  * The namespace config is a string representing a namespace for the app.
928
960
  * For apps that are not meant to be a library of reusable components,
@@ -1874,6 +1906,7 @@ interface CompilerBuildResults {
1874
1906
  buildId: number;
1875
1907
  componentGraph?: BuildResultsComponentGraph;
1876
1908
  components: ComponentCompilerMeta[];
1909
+ cssOnlyComponents: ComponentCompilerMeta[];
1877
1910
  diagnostics: Diagnostic[];
1878
1911
  dirsAdded: string[];
1879
1912
  dirsDeleted: string[];
@@ -1890,6 +1923,15 @@ interface CompilerBuildResults {
1890
1923
  namespace: string;
1891
1924
  fsNamespace: string;
1892
1925
  outputs: BuildOutput[];
1926
+ /**
1927
+ * Absolute paths to every global stylesheet, in cascade order: each `global-style` output
1928
+ * target's compiled CSS in the order those targets are declared in `config.outputTargets` - or,
1929
+ * with none configured, the generated `{fsNamespace}.css` holding Stencil's auto-placed CSS (when
1930
+ * emitted). Unlike `outputs`, which groups files by type and sorts them alphabetically, this
1931
+ * preserves author-intended order for consumers like the dev-server's auto-generated component
1932
+ * preview.
1933
+ */
1934
+ globalStyleFiles: string[];
1893
1935
  rootDir: string;
1894
1936
  srcDir: string;
1895
1937
  timestamp: string;
@@ -1905,6 +1947,7 @@ interface HotModuleReplacement {
1905
1947
  componentsUpdated?: string[];
1906
1948
  excludeHmr?: string[];
1907
1949
  externalStylesUpdated?: string[];
1950
+ globalStylesUpdated?: HmrGlobalStyleUpdate[];
1908
1951
  imagesUpdated?: string[];
1909
1952
  indexHtmlUpdated?: boolean;
1910
1953
  inlineStylesUpdated?: HmrStyleUpdate[];
@@ -1919,6 +1962,15 @@ interface HmrStyleUpdate {
1919
1962
  styleTag: string;
1920
1963
  styleText: string;
1921
1964
  }
1965
+ /**
1966
+ * A live-reload update for a `global-style` output target's CSS. Applied on
1967
+ * the client by matching `fileName` against the `<link>` that loads it and
1968
+ * inserting/updating an adjacent `<style>` override
1969
+ */
1970
+ interface HmrGlobalStyleUpdate {
1971
+ fileName: string;
1972
+ styleText: string;
1973
+ }
1922
1974
  type BuildOnEventRemove = () => boolean;
1923
1975
  interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
1924
1976
  unsubscribeAll(): void;
@@ -2679,10 +2731,8 @@ interface OutputTargetStandalone extends OutputTargetBaseNext {
2679
2731
  type: 'standalone';
2680
2732
  empty?: boolean;
2681
2733
  /**
2682
- * Triggers the following behaviors when enabled:
2683
- * 1. All `@stencil/core/*` module references are treated as external during bundling.
2684
- * 2. File names are not hashed.
2685
- * 3. File minification will follow the behavior defined at the root of the Stencil config.
2734
+ * When `true`, all `@stencil/core/*` module references are treated as external
2735
+ * during bundling rather than being included in the generated output.
2686
2736
  *
2687
2737
  * @default false
2688
2738
  */
@@ -2970,6 +3020,8 @@ interface LazyRequire {
2970
3020
  }
2971
3021
  //#endregion
2972
3022
  //#region src/declarations/stencil-private.d.ts
3023
+ /** Build-time virtual `@import`s a `global-style` input can use to place Stencil-generated CSS. */
3024
+ type StencilVirtualImport = 'stencil-hydrate' | 'stencil-component-globals' | 'stencil-css-components';
2973
3025
  interface SourceMap$1 {
2974
3026
  file: string;
2975
3027
  mappings: string;
@@ -3108,6 +3160,7 @@ interface BuildCtx {
3108
3160
  esmComponentBundle: ReadonlyArray<BundleModule>;
3109
3161
  commonJsComponentBundle: ReadonlyArray<BundleModule>;
3110
3162
  components: ComponentCompilerMeta[];
3163
+ cssOnlyComponents: ComponentCompilerMeta[];
3111
3164
  componentGraph: Map<string, string[]>;
3112
3165
  config: ValidatedConfig;
3113
3166
  createTimeSpan(msg: string, debug?: boolean): LoggerTimeSpan;
@@ -3156,6 +3209,9 @@ interface BuildCtx {
3156
3209
  */
3157
3210
  stylesPromise: Promise<string>;
3158
3211
  stylesUpdated: BuildStyleUpdate[];
3212
+ globalStylesUpdated: BuildGlobalStyleLinkUpdate[];
3213
+ /** Absolute path of the generated `{fsNamespace}.css`, when this build emitted one */
3214
+ stencilCssFile?: string;
3159
3215
  timeSpan: LoggerTimeSpan;
3160
3216
  timestamp: string;
3161
3217
  transpileBuildCount: number;
@@ -3168,6 +3224,14 @@ interface BuildStyleUpdate {
3168
3224
  styleText: string;
3169
3225
  styleMode: string;
3170
3226
  }
3227
+ /**
3228
+ * A live-reload update for a `global-style` output target's CSS, matched on
3229
+ * the client by `fileName` against the `<link>`
3230
+ */
3231
+ interface BuildGlobalStyleLinkUpdate {
3232
+ fileName: string;
3233
+ styleText: string;
3234
+ }
3171
3235
  type BuildTask = any;
3172
3236
  interface CompilerBuildStats {
3173
3237
  timestamp: string;
@@ -3309,6 +3373,12 @@ interface CompilerCtx {
3309
3373
  cssModuleImports: Map<string, string[]>;
3310
3374
  /** Cache of built global styles, keyed by input file path */
3311
3375
  globalStyleCache: Map<string, string>;
3376
+ /** Cache of discovered CSS-only components from the last scan, keyed by absolute .css file path */
3377
+ cssOnlyComponentsCache: Map<string, ComponentCompilerMeta[]>;
3378
+ /** Contents of the last auto-placed `stencil-*` CSS, used to detect changes for HMR */
3379
+ stencilCss?: string;
3380
+ /** Virtual imports found in each built global style (post-preprocessing), keyed by input path */
3381
+ globalStyleVirtualImports: Map<string, Set<StencilVirtualImport>>;
3312
3382
  collections: CollectionCompilerMeta[];
3313
3383
  compilerOptions: any;
3314
3384
  events: BuildEvents;
@@ -3454,7 +3524,7 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
3454
3524
  * Custom states to initialize on the ElementInternals.states CustomStateSet.
3455
3525
  * These are defined via @AttachInternals({ states: {...} }).
3456
3526
  */
3457
- attachInternalsCustomStates: ComponentCompilerCustomState[];
3527
+ attachInternalsCustomStates: JsonDocsCustomState[];
3458
3528
  componentClassName: string;
3459
3529
  /**
3460
3530
  * A list of web component tag names that are either:
@@ -3524,7 +3594,7 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
3524
3594
  sourceFilePath: string;
3525
3595
  sourceMapPath: string;
3526
3596
  states: ComponentCompilerState[];
3527
- styleDocs: CompilerStyleDoc[];
3597
+ styleDocs: StyleDoc[];
3528
3598
  styles: StyleCompiler[];
3529
3599
  globalStyles: ComponentGlobalStyle[];
3530
3600
  tagName: string;
@@ -3727,20 +3797,6 @@ interface ComponentCompilerState {
3727
3797
  * Custom states are exposed via the ElementInternals.states CustomStateSet
3728
3798
  * and can be targeted with the CSS :state() pseudo-class.
3729
3799
  */
3730
- interface ComponentCompilerCustomState {
3731
- /**
3732
- * The name of the custom state (without dashes)
3733
- */
3734
- name: string;
3735
- /**
3736
- * The initial value of the state
3737
- */
3738
- initialValue: boolean;
3739
- /**
3740
- * Optional JSDoc description for the state
3741
- */
3742
- docs: string;
3743
- }
3744
3800
  /**
3745
3801
  * Representation of JSDoc that is pulled off a node in the AST
3746
3802
  */
@@ -3752,44 +3808,7 @@ interface CompilerJsDoc {
3752
3808
  /**
3753
3809
  * Tags included in the JSDoc
3754
3810
  */
3755
- tags: CompilerJsDocTagInfo[];
3756
- }
3757
- /**
3758
- * Representation of a tag that exists in a JSDoc
3759
- */
3760
- interface CompilerJsDocTagInfo {
3761
- /**
3762
- * The name of the tag - e.g. `@deprecated`
3763
- */
3764
- name: string;
3765
- /**
3766
- * Additional text that is associated with the tag - e.g. `@deprecated use v2 of this API`
3767
- */
3768
- text?: string;
3769
- }
3770
- /**
3771
- * The (internal) representation of a CSS block comment in a CSS, Sass, etc. file. This data structure is used during
3772
- * the initial compilation phases of Stencil, as a piece of {@link ComponentCompilerMeta}.
3773
- */
3774
- interface CompilerStyleDoc {
3775
- /**
3776
- * The name of the CSS property
3777
- */
3778
- name: string;
3779
- /**
3780
- * The user-defined description of the CSS property
3781
- */
3782
- docs: string;
3783
- /**
3784
- * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
3785
- * Used to inform Stencil where the start of a new property's description starts (and where the previous description
3786
- * ends).
3787
- */
3788
- annotation: 'prop';
3789
- /**
3790
- * The Stencil style-mode that is associated with this property.
3791
- */
3792
- mode: string;
3811
+ tags: JsonDocsTag[];
3793
3812
  }
3794
3813
  interface CompilerAssetDir {
3795
3814
  absolutePath?: string;