@stencil/core 5.0.0-beta.2 → 5.0.0-beta.21
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.
- package/dist/app-data/index.d.ts +1 -1
- package/dist/{client-BRu0GtRn.mjs → client-CVXS3JZ-.mjs} +105 -60
- package/dist/compiler/browser.d.ts +110 -79
- package/dist/compiler/browser.js +571 -269
- package/dist/compiler/index.d.mts +110 -2
- package/dist/compiler/index.mjs +3 -3
- package/dist/compiler/utils/index.d.mts +1 -1
- package/dist/{compiler-C8yf59oh.mjs → compiler-ApS_Tn_4.mjs} +4460 -2742
- package/dist/declarations/stencil-public-compiler.d.ts +144 -120
- package/dist/declarations/stencil-public-docs.d.ts +23 -0
- package/dist/declarations/stencil-public-runtime.d.ts +60 -58
- package/dist/{index-BopBfjPu.d.mts → index-B9-Byy8z.d.mts} +142 -118
- package/dist/{index-BXAcVN2j.d.ts → index-BHciXst1.d.ts} +57 -55
- package/dist/{index-DmHmu3y0.d.mts → index-Dz1G9pWZ.d.mts} +2 -2
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +1 -1
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/{node-75gQKkFz.mjs → node-Bz2SOK7_.mjs} +6 -35
- package/dist/runtime/client/lazy.js +228 -180
- package/dist/runtime/client/runtime.d.ts +67 -66
- package/dist/runtime/client/runtime.js +228 -180
- package/dist/runtime/index.d.ts +4 -5
- package/dist/runtime/index.js +226 -178
- package/dist/runtime/server/index.d.mts +11 -11
- package/dist/runtime/server/index.mjs +287 -220
- package/dist/runtime/server/runner.d.mts +4 -4
- package/dist/runtime/server/runner.mjs +82 -54
- package/dist/signals/index.d.ts +11 -2
- package/dist/signals/index.js +11 -1
- package/dist/sys/node/index.d.mts +1 -1
- package/dist/sys/node/index.mjs +1 -1
- package/dist/sys/node/worker.mjs +2 -2
- package/dist/testing/index.d.mts +129 -112
- package/dist/testing/index.mjs +244 -193
- package/package.json +8 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ListenTargetOptions, ResolutionHandler } from "./stencil-public-runtime.js";
|
|
2
|
-
import { InputOptions, Plugin, SourceMap } from "rolldown";
|
|
2
|
+
import { InputOptions, Plugin as Plugin$1, SourceMap } from "rolldown";
|
|
3
3
|
import "typescript";
|
|
4
4
|
//#region src/utils/result.d.ts
|
|
5
5
|
/**
|
|
@@ -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,9 +654,19 @@ 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-private.d.ts
|
|
668
|
+
/** Build-time virtual `@import`s a `global-style` input can use to place Stencil-generated CSS. */
|
|
669
|
+
type StencilVirtualImport = 'stencil-hydrate' | 'stencil-component-globals' | 'stencil-css-components';
|
|
645
670
|
interface SourceMap$1 {
|
|
646
671
|
file: string;
|
|
647
672
|
mappings: string;
|
|
@@ -780,6 +805,7 @@ interface BuildCtx {
|
|
|
780
805
|
esmComponentBundle: ReadonlyArray<BundleModule>;
|
|
781
806
|
commonJsComponentBundle: ReadonlyArray<BundleModule>;
|
|
782
807
|
components: ComponentCompilerMeta[];
|
|
808
|
+
cssOnlyComponents: ComponentCompilerMeta[];
|
|
783
809
|
componentGraph: Map<string, string[]>;
|
|
784
810
|
config: ValidatedConfig;
|
|
785
811
|
createTimeSpan(msg: string, debug?: boolean): LoggerTimeSpan;
|
|
@@ -828,6 +854,9 @@ interface BuildCtx {
|
|
|
828
854
|
*/
|
|
829
855
|
stylesPromise: Promise<string>;
|
|
830
856
|
stylesUpdated: BuildStyleUpdate[];
|
|
857
|
+
globalStylesUpdated: BuildGlobalStyleLinkUpdate[];
|
|
858
|
+
/** Absolute path of the generated `{fsNamespace}.css`, when this build emitted one */
|
|
859
|
+
stencilCssFile?: string;
|
|
831
860
|
timeSpan: LoggerTimeSpan;
|
|
832
861
|
timestamp: string;
|
|
833
862
|
transpileBuildCount: number;
|
|
@@ -840,6 +869,14 @@ interface BuildStyleUpdate {
|
|
|
840
869
|
styleText: string;
|
|
841
870
|
styleMode: string;
|
|
842
871
|
}
|
|
872
|
+
/**
|
|
873
|
+
* A live-reload update for a `global-style` output target's CSS, matched on
|
|
874
|
+
* the client by `fileName` against the `<link>`
|
|
875
|
+
*/
|
|
876
|
+
interface BuildGlobalStyleLinkUpdate {
|
|
877
|
+
fileName: string;
|
|
878
|
+
styleText: string;
|
|
879
|
+
}
|
|
843
880
|
type BuildTask = any;
|
|
844
881
|
interface CompilerBuildStats {
|
|
845
882
|
timestamp: string;
|
|
@@ -981,6 +1018,12 @@ interface CompilerCtx {
|
|
|
981
1018
|
cssModuleImports: Map<string, string[]>;
|
|
982
1019
|
/** Cache of built global styles, keyed by input file path */
|
|
983
1020
|
globalStyleCache: Map<string, string>;
|
|
1021
|
+
/** Cache of discovered CSS-only components from the last scan, keyed by absolute .css file path */
|
|
1022
|
+
cssOnlyComponentsCache: Map<string, ComponentCompilerMeta[]>;
|
|
1023
|
+
/** Contents of the last auto-placed `stencil-*` CSS, used to detect changes for HMR */
|
|
1024
|
+
stencilCss?: string;
|
|
1025
|
+
/** Virtual imports found in each built global style (post-preprocessing), keyed by input path */
|
|
1026
|
+
globalStyleVirtualImports: Map<string, Set<StencilVirtualImport>>;
|
|
984
1027
|
collections: CollectionCompilerMeta[];
|
|
985
1028
|
compilerOptions: any;
|
|
986
1029
|
events: BuildEvents;
|
|
@@ -1126,7 +1169,7 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
|
|
|
1126
1169
|
* Custom states to initialize on the ElementInternals.states CustomStateSet.
|
|
1127
1170
|
* These are defined via @AttachInternals({ states: {...} }).
|
|
1128
1171
|
*/
|
|
1129
|
-
attachInternalsCustomStates:
|
|
1172
|
+
attachInternalsCustomStates: JsonDocsCustomState[];
|
|
1130
1173
|
componentClassName: string;
|
|
1131
1174
|
/**
|
|
1132
1175
|
* A list of web component tag names that are either:
|
|
@@ -1196,7 +1239,7 @@ interface ComponentCompilerMeta extends ComponentCompilerFeatures {
|
|
|
1196
1239
|
sourceFilePath: string;
|
|
1197
1240
|
sourceMapPath: string;
|
|
1198
1241
|
states: ComponentCompilerState[];
|
|
1199
|
-
styleDocs:
|
|
1242
|
+
styleDocs: StyleDoc[];
|
|
1200
1243
|
styles: StyleCompiler[];
|
|
1201
1244
|
globalStyles: ComponentGlobalStyle[];
|
|
1202
1245
|
tagName: string;
|
|
@@ -1399,20 +1442,6 @@ interface ComponentCompilerState {
|
|
|
1399
1442
|
* Custom states are exposed via the ElementInternals.states CustomStateSet
|
|
1400
1443
|
* and can be targeted with the CSS :state() pseudo-class.
|
|
1401
1444
|
*/
|
|
1402
|
-
interface ComponentCompilerCustomState {
|
|
1403
|
-
/**
|
|
1404
|
-
* The name of the custom state (without dashes)
|
|
1405
|
-
*/
|
|
1406
|
-
name: string;
|
|
1407
|
-
/**
|
|
1408
|
-
* The initial value of the state
|
|
1409
|
-
*/
|
|
1410
|
-
initialValue: boolean;
|
|
1411
|
-
/**
|
|
1412
|
-
* Optional JSDoc description for the state
|
|
1413
|
-
*/
|
|
1414
|
-
docs: string;
|
|
1415
|
-
}
|
|
1416
1445
|
/**
|
|
1417
1446
|
* Representation of JSDoc that is pulled off a node in the AST
|
|
1418
1447
|
*/
|
|
@@ -1424,44 +1453,7 @@ interface CompilerJsDoc {
|
|
|
1424
1453
|
/**
|
|
1425
1454
|
* Tags included in the JSDoc
|
|
1426
1455
|
*/
|
|
1427
|
-
tags:
|
|
1428
|
-
}
|
|
1429
|
-
/**
|
|
1430
|
-
* Representation of a tag that exists in a JSDoc
|
|
1431
|
-
*/
|
|
1432
|
-
interface CompilerJsDocTagInfo {
|
|
1433
|
-
/**
|
|
1434
|
-
* The name of the tag - e.g. `@deprecated`
|
|
1435
|
-
*/
|
|
1436
|
-
name: string;
|
|
1437
|
-
/**
|
|
1438
|
-
* Additional text that is associated with the tag - e.g. `@deprecated use v2 of this API`
|
|
1439
|
-
*/
|
|
1440
|
-
text?: string;
|
|
1441
|
-
}
|
|
1442
|
-
/**
|
|
1443
|
-
* The (internal) representation of a CSS block comment in a CSS, Sass, etc. file. This data structure is used during
|
|
1444
|
-
* the initial compilation phases of Stencil, as a piece of {@link ComponentCompilerMeta}.
|
|
1445
|
-
*/
|
|
1446
|
-
interface CompilerStyleDoc {
|
|
1447
|
-
/**
|
|
1448
|
-
* The name of the CSS property
|
|
1449
|
-
*/
|
|
1450
|
-
name: string;
|
|
1451
|
-
/**
|
|
1452
|
-
* The user-defined description of the CSS property
|
|
1453
|
-
*/
|
|
1454
|
-
docs: string;
|
|
1455
|
-
/**
|
|
1456
|
-
* The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
|
|
1457
|
-
* Used to inform Stencil where the start of a new property's description starts (and where the previous description
|
|
1458
|
-
* ends).
|
|
1459
|
-
*/
|
|
1460
|
-
annotation: 'prop';
|
|
1461
|
-
/**
|
|
1462
|
-
* The Stencil style-mode that is associated with this property.
|
|
1463
|
-
*/
|
|
1464
|
-
mode: string;
|
|
1456
|
+
tags: JsonDocsTag[];
|
|
1465
1457
|
}
|
|
1466
1458
|
interface CompilerAssetDir {
|
|
1467
1459
|
absolutePath?: string;
|
|
@@ -1546,28 +1538,6 @@ interface Module {
|
|
|
1546
1538
|
hasVdomXlink: boolean;
|
|
1547
1539
|
hasSignalsImport: boolean;
|
|
1548
1540
|
}
|
|
1549
|
-
interface Plugin$1 {
|
|
1550
|
-
name?: string;
|
|
1551
|
-
pluginType?: string;
|
|
1552
|
-
load?: (id: string, context: PluginCtx) => Promise<string> | string;
|
|
1553
|
-
resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
|
|
1554
|
-
transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults;
|
|
1555
|
-
}
|
|
1556
|
-
type PluginTransformResults = PluginTransformationDescriptor | string | null;
|
|
1557
|
-
interface PluginTransformationDescriptor {
|
|
1558
|
-
code?: string;
|
|
1559
|
-
map?: string;
|
|
1560
|
-
id?: string;
|
|
1561
|
-
diagnostics?: Diagnostic[];
|
|
1562
|
-
dependencies?: string[];
|
|
1563
|
-
}
|
|
1564
|
-
interface PluginCtx {
|
|
1565
|
-
config: Config;
|
|
1566
|
-
sys: CompilerSystem;
|
|
1567
|
-
fs: InMemoryFileSystem;
|
|
1568
|
-
cache: Cache;
|
|
1569
|
-
diagnostics: Diagnostic[];
|
|
1570
|
-
}
|
|
1571
1541
|
interface PrerenderUrlResults {
|
|
1572
1542
|
anchorUrls: string[];
|
|
1573
1543
|
diagnostics: Diagnostic[];
|
|
@@ -1800,6 +1770,15 @@ interface StencilConfig {
|
|
|
1800
1770
|
* @default false
|
|
1801
1771
|
*/
|
|
1802
1772
|
generateExportMaps?: boolean;
|
|
1773
|
+
/**
|
|
1774
|
+
* Set to `false` to disable discovery of "CSS-only components" - pure-CSS custom-element
|
|
1775
|
+
* definitions marked with a `@component` JSDoc tag in `.css` files under `srcDir`. No JS
|
|
1776
|
+
* class, never registered via `customElements.define()` - just a documented,
|
|
1777
|
+
* type-checked tag name and its CSS custom properties/attribute variants.
|
|
1778
|
+
*
|
|
1779
|
+
* Defaults to `true`.
|
|
1780
|
+
*/
|
|
1781
|
+
enableCssOnlyComponents?: boolean;
|
|
1803
1782
|
/**
|
|
1804
1783
|
* The namespace config is a string representing a namespace for the app.
|
|
1805
1784
|
* For apps that are not meant to be a library of reusable components,
|
|
@@ -1821,7 +1800,7 @@ interface StencilConfig {
|
|
|
1821
1800
|
* property). By default, Stencil does not come with Sass or PostCSS support.
|
|
1822
1801
|
* However, either can be added using the plugin array.
|
|
1823
1802
|
*/
|
|
1824
|
-
plugins?: (Plugin
|
|
1803
|
+
plugins?: (Plugin | Plugin$1)[];
|
|
1825
1804
|
/**
|
|
1826
1805
|
* Generate js source map files for all bundles.
|
|
1827
1806
|
* Set to `true` to always generate source maps, `false` to never generate source maps.
|
|
@@ -1842,7 +1821,7 @@ interface StencilConfig {
|
|
|
1842
1821
|
*/
|
|
1843
1822
|
transformAliasedImportPaths?: boolean;
|
|
1844
1823
|
/**
|
|
1845
|
-
* Passes custom configuration
|
|
1824
|
+
* Passes custom configuration to Rolldown's module resolution (its `resolve` option), e.g. `alias`.
|
|
1846
1825
|
* For further information: https://stenciljs.com/docs/module-bundling
|
|
1847
1826
|
*/
|
|
1848
1827
|
nodeResolve?: NodeResolveConfig;
|
|
@@ -1947,8 +1926,8 @@ interface StencilConfig {
|
|
|
1947
1926
|
maxConcurrentWorkers?: number;
|
|
1948
1927
|
preamble?: string;
|
|
1949
1928
|
rolldownPlugins?: {
|
|
1950
|
-
before?: Plugin[];
|
|
1951
|
-
after?: Plugin[];
|
|
1929
|
+
before?: Plugin$1[];
|
|
1930
|
+
after?: Plugin$1[];
|
|
1952
1931
|
};
|
|
1953
1932
|
entryComponentsHint?: string[];
|
|
1954
1933
|
buildLogFilePath?: string;
|
|
@@ -2646,7 +2625,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
|
|
|
2646
2625
|
* Note that this is "approximate", in that HTML may often not be able
|
|
2647
2626
|
* to be split at an exact line width. Additionally, new lines created
|
|
2648
2627
|
* is where HTML naturally already has whitespace, such as before an
|
|
2649
|
-
* attribute or spaces between words. Defaults to `100
|
|
2628
|
+
* attribute or spaces between words. Defaults to no wrapping (`100` when prerendering).
|
|
2650
2629
|
*/
|
|
2651
2630
|
approximateLineWidth?: number;
|
|
2652
2631
|
/**
|
|
@@ -2664,12 +2643,12 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
|
|
|
2664
2643
|
prettyHtml?: boolean;
|
|
2665
2644
|
/**
|
|
2666
2645
|
* Remove quotes from attribute values when possible.
|
|
2667
|
-
* Defaults to `true
|
|
2646
|
+
* Defaults to `false` (`true` when prerendering).
|
|
2668
2647
|
*/
|
|
2669
2648
|
removeAttributeQuotes?: boolean;
|
|
2670
2649
|
/**
|
|
2671
2650
|
* Remove the `=""` from standardized `boolean` attributes,
|
|
2672
|
-
* such as `hidden` or `checked`. Defaults to `true
|
|
2651
|
+
* such as `hidden` or `checked`. Defaults to `false` (`true` when prerendering).
|
|
2673
2652
|
*/
|
|
2674
2653
|
removeBooleanAttributeQuotes?: boolean;
|
|
2675
2654
|
/**
|
|
@@ -2678,7 +2657,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
|
|
|
2678
2657
|
*/
|
|
2679
2658
|
removeEmptyAttributes?: boolean;
|
|
2680
2659
|
/**
|
|
2681
|
-
* Remove HTML comments. Defaults to `true
|
|
2660
|
+
* Remove HTML comments. Defaults to `false` (`true` when prerendering).
|
|
2682
2661
|
*/
|
|
2683
2662
|
removeHtmlComments?: boolean;
|
|
2684
2663
|
/**
|
|
@@ -2777,7 +2756,7 @@ interface CompilerSystem {
|
|
|
2777
2756
|
name: 'node' | 'in-memory';
|
|
2778
2757
|
version: string;
|
|
2779
2758
|
events?: BuildEvents;
|
|
2780
|
-
details
|
|
2759
|
+
details: SystemDetails;
|
|
2781
2760
|
/**
|
|
2782
2761
|
* Add a callback which will be ran when destroy() is called.
|
|
2783
2762
|
*/
|
|
@@ -2790,14 +2769,15 @@ interface CompilerSystem {
|
|
|
2790
2769
|
* SYNC! Always returns a boolean, does not throw.
|
|
2791
2770
|
*/
|
|
2792
2771
|
accessSync(p: string): boolean;
|
|
2793
|
-
applyGlobalPatch?(fromDir: string): Promise<void>;
|
|
2794
2772
|
applyPrerenderGlobalPatch?(opts: {
|
|
2795
2773
|
devServerHostUrl: string;
|
|
2796
2774
|
window: any;
|
|
2797
2775
|
}): void;
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2776
|
+
/**
|
|
2777
|
+
* Check npm for a newer Stencil version. Resolves a function that logs the result.
|
|
2778
|
+
*/
|
|
2779
|
+
checkVersion(logger: Logger, currentVersion: string): Promise<() => void>;
|
|
2780
|
+
copy(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
|
|
2801
2781
|
/**
|
|
2802
2782
|
* Always returns a boolean if the files were copied or not. Does not throw.
|
|
2803
2783
|
*/
|
|
@@ -2822,7 +2802,7 @@ interface CompilerSystem {
|
|
|
2822
2802
|
/**
|
|
2823
2803
|
* Each platform has a different way to dynamically import modules.
|
|
2824
2804
|
*/
|
|
2825
|
-
dynamicImport
|
|
2805
|
+
dynamicImport(p: string): Promise<any>;
|
|
2826
2806
|
/**
|
|
2827
2807
|
* Creates the worker controller for the current system.
|
|
2828
2808
|
*
|
|
@@ -2836,20 +2816,14 @@ interface CompilerSystem {
|
|
|
2836
2816
|
* process.exit()
|
|
2837
2817
|
*/
|
|
2838
2818
|
exit(exitCode: number): Promise<void>;
|
|
2839
|
-
/**
|
|
2840
|
-
* Optionally provide a fetch() function rather than using the built-in fetch().
|
|
2841
|
-
* First arg is a url string or Request object (RequestInfo).
|
|
2842
|
-
* Second arg is the RequestInit. Returns the Response object
|
|
2843
|
-
*/
|
|
2844
|
-
fetch?(input: string | any, init?: any): Promise<any>;
|
|
2845
2819
|
/**
|
|
2846
2820
|
* Generates a sha1 digest encoded as HEX
|
|
2847
2821
|
*/
|
|
2848
|
-
generateContentHash
|
|
2822
|
+
generateContentHash(content: string | any, length?: number): Promise<string>;
|
|
2849
2823
|
/**
|
|
2850
2824
|
* Generates a sha1 digest encoded as HEX from a file path
|
|
2851
2825
|
*/
|
|
2852
|
-
generateFileHash
|
|
2826
|
+
generateFileHash(filePath: string | any, length?: number): Promise<string>;
|
|
2853
2827
|
/**
|
|
2854
2828
|
* Get the current directory.
|
|
2855
2829
|
*/
|
|
@@ -2858,7 +2832,6 @@ interface CompilerSystem {
|
|
|
2858
2832
|
* The compiler's executing path.
|
|
2859
2833
|
*/
|
|
2860
2834
|
getCompilerExecutingPath(): string;
|
|
2861
|
-
getEnvironmentVar?(key: string): string;
|
|
2862
2835
|
/**
|
|
2863
2836
|
* Gets the absolute file path when for a dependency module.
|
|
2864
2837
|
*/
|
|
@@ -2897,11 +2870,7 @@ interface CompilerSystem {
|
|
|
2897
2870
|
* Normalize file system path.
|
|
2898
2871
|
*/
|
|
2899
2872
|
normalizePath(p: string): string;
|
|
2900
|
-
onProcessInterrupt
|
|
2901
|
-
parseYarnLockFile?: (content: string) => {
|
|
2902
|
-
type: 'success' | 'merge' | 'conflict';
|
|
2903
|
-
object: any;
|
|
2904
|
-
};
|
|
2873
|
+
onProcessInterrupt(cb: () => void): void;
|
|
2905
2874
|
platformPath: PlatformPath;
|
|
2906
2875
|
/**
|
|
2907
2876
|
* All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
|
|
@@ -2937,6 +2906,9 @@ interface CompilerSystem {
|
|
|
2937
2906
|
* Rename old path to new path. Does not throw.
|
|
2938
2907
|
*/
|
|
2939
2908
|
rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;
|
|
2909
|
+
/**
|
|
2910
|
+
* Assigned by the compiler. Used by plugins (e.g. `@stencil/sass`) to resolve `~` imports.
|
|
2911
|
+
*/
|
|
2940
2912
|
resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;
|
|
2941
2913
|
resolvePath(p: string): string;
|
|
2942
2914
|
/**
|
|
@@ -3130,6 +3102,7 @@ interface CompilerBuildResults {
|
|
|
3130
3102
|
buildId: number;
|
|
3131
3103
|
componentGraph?: BuildResultsComponentGraph;
|
|
3132
3104
|
components: ComponentCompilerMeta[];
|
|
3105
|
+
cssOnlyComponents: ComponentCompilerMeta[];
|
|
3133
3106
|
diagnostics: Diagnostic[];
|
|
3134
3107
|
dirsAdded: string[];
|
|
3135
3108
|
dirsDeleted: string[];
|
|
@@ -3146,6 +3119,15 @@ interface CompilerBuildResults {
|
|
|
3146
3119
|
namespace: string;
|
|
3147
3120
|
fsNamespace: string;
|
|
3148
3121
|
outputs: BuildOutput[];
|
|
3122
|
+
/**
|
|
3123
|
+
* Absolute paths to every global stylesheet, in cascade order: each `global-style` output
|
|
3124
|
+
* target's compiled CSS in the order those targets are declared in `config.outputTargets` - or,
|
|
3125
|
+
* with none configured, the generated `{fsNamespace}.css` holding Stencil's auto-placed CSS (when
|
|
3126
|
+
* emitted). Unlike `outputs`, which groups files by type and sorts them alphabetically, this
|
|
3127
|
+
* preserves author-intended order for consumers like the dev-server's auto-generated component
|
|
3128
|
+
* preview.
|
|
3129
|
+
*/
|
|
3130
|
+
globalStyleFiles: string[];
|
|
3149
3131
|
rootDir: string;
|
|
3150
3132
|
srcDir: string;
|
|
3151
3133
|
timestamp: string;
|
|
@@ -3161,6 +3143,7 @@ interface HotModuleReplacement {
|
|
|
3161
3143
|
componentsUpdated?: string[];
|
|
3162
3144
|
excludeHmr?: string[];
|
|
3163
3145
|
externalStylesUpdated?: string[];
|
|
3146
|
+
globalStylesUpdated?: HmrGlobalStyleUpdate[];
|
|
3164
3147
|
imagesUpdated?: string[];
|
|
3165
3148
|
indexHtmlUpdated?: boolean;
|
|
3166
3149
|
inlineStylesUpdated?: HmrStyleUpdate[];
|
|
@@ -3175,6 +3158,15 @@ interface HmrStyleUpdate {
|
|
|
3175
3158
|
styleTag: string;
|
|
3176
3159
|
styleText: string;
|
|
3177
3160
|
}
|
|
3161
|
+
/**
|
|
3162
|
+
* A live-reload update for a `global-style` output target's CSS. Applied on
|
|
3163
|
+
* the client by matching `fileName` against the `<link>` that loads it and
|
|
3164
|
+
* inserting/updating an adjacent `<style>` override
|
|
3165
|
+
*/
|
|
3166
|
+
interface HmrGlobalStyleUpdate {
|
|
3167
|
+
fileName: string;
|
|
3168
|
+
styleText: string;
|
|
3169
|
+
}
|
|
3178
3170
|
type BuildOnEventRemove = () => boolean;
|
|
3179
3171
|
interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
|
|
3180
3172
|
unsubscribeAll(): void;
|
|
@@ -3567,7 +3559,7 @@ interface OutputTargetCollection extends OutputTargetBaseNext {
|
|
|
3567
3559
|
* When `true` this flag will transform aliased import paths defined in
|
|
3568
3560
|
* a project's `tsconfig.json` to relative import paths in the compiled output.
|
|
3569
3561
|
*
|
|
3570
|
-
* Paths will be left in aliased format if `false
|
|
3562
|
+
* Paths will be left in aliased format if `false`. Defaults to `true`.
|
|
3571
3563
|
*
|
|
3572
3564
|
* @example
|
|
3573
3565
|
* // tsconfig.json
|
|
@@ -3669,11 +3661,11 @@ interface OutputTargetGlobalStyle extends OutputTargetBaseNext {
|
|
|
3669
3661
|
* Controls whether this global stylesheet is injected into component shadow DOMs
|
|
3670
3662
|
* as a constructable stylesheet at runtime.
|
|
3671
3663
|
*
|
|
3672
|
-
* - `'none'
|
|
3664
|
+
* - `'none'`: Don't inject - stylesheet must be loaded externally (e.g., via `<link>`)
|
|
3673
3665
|
* - `'client'`: Inject only in client builds, not SSR (reduces SSR output size)
|
|
3674
3666
|
* - `'all'`: Inject in both client and SSR builds
|
|
3675
3667
|
*
|
|
3676
|
-
* @default 'none'
|
|
3668
|
+
* @default 'client' when the stylesheet comes from `globalStyle` (or an auto-detected `src/global.*`), 'none' when `input` is set
|
|
3677
3669
|
*/
|
|
3678
3670
|
inject?: 'none' | 'client' | 'all';
|
|
3679
3671
|
}
|
|
@@ -3731,6 +3723,10 @@ interface OutputTargetSsr extends OutputTargetBase {
|
|
|
3731
3723
|
*/
|
|
3732
3724
|
cjs?: boolean;
|
|
3733
3725
|
}
|
|
3726
|
+
/**
|
|
3727
|
+
* Compiles the SSR hydrate app to a WASM plugin (via `extism-js`/QuickJS-ng) that can run
|
|
3728
|
+
* outside of Node
|
|
3729
|
+
*/
|
|
3734
3730
|
interface OutputTargetSsrWasm extends OutputTargetBase {
|
|
3735
3731
|
type: 'ssr-wasm';
|
|
3736
3732
|
/** Output directory. @default 'dist/ssr-wasm' */
|
|
@@ -3868,7 +3864,7 @@ interface OutputTargetDocsAgentSkill extends OutputTargetBase {
|
|
|
3868
3864
|
/**
|
|
3869
3865
|
* The skill's name, used in the `SKILL.md` frontmatter.
|
|
3870
3866
|
*
|
|
3871
|
-
* Defaults to
|
|
3867
|
+
* Defaults to {@link Config.namespace}, lowercased, with anything other than letters and numbers replaced by `-`.
|
|
3872
3868
|
*/
|
|
3873
3869
|
name?: string;
|
|
3874
3870
|
/**
|
|
@@ -3931,10 +3927,8 @@ interface OutputTargetStandalone extends OutputTargetBaseNext {
|
|
|
3931
3927
|
type: 'standalone';
|
|
3932
3928
|
empty?: boolean;
|
|
3933
3929
|
/**
|
|
3934
|
-
*
|
|
3935
|
-
*
|
|
3936
|
-
* 2. File names are not hashed.
|
|
3937
|
-
* 3. File minification will follow the behavior defined at the root of the Stencil config.
|
|
3930
|
+
* When `true`, all `@stencil/core/*` module references are treated as external
|
|
3931
|
+
* during bundling rather than being included in the generated output.
|
|
3938
3932
|
*
|
|
3939
3933
|
* @default false
|
|
3940
3934
|
*/
|
|
@@ -3998,8 +3992,10 @@ interface OutputTargetBase {
|
|
|
3998
3992
|
* This improves dev build times by not generating production-only artifacts.
|
|
3999
3993
|
*
|
|
4000
3994
|
* Defaults vary by output target type:
|
|
4001
|
-
* - `loader-bundle`: `
|
|
4002
|
-
* - `standalone`: `true`
|
|
3995
|
+
* - `loader-bundle`: `true` (skips the npm distribution files; the browser bundle always builds)
|
|
3996
|
+
* - `standalone`: `true` if `loader-bundle` is also configured, otherwise `false`
|
|
3997
|
+
* - `types`, `collection`, `ssr-wasm`: `true` (skips in dev)
|
|
3998
|
+
* - `assets`, `global-style`: `false` (always runs)
|
|
4003
3999
|
* - `ssr`: `true` (skips in dev, unless `devServer.ssr` is enabled)
|
|
4004
4000
|
* - `docs-*`: `true` (skips in dev)
|
|
4005
4001
|
* - `custom`: `true` (skips in dev)
|
|
@@ -4194,10 +4190,6 @@ interface Diagnostic {
|
|
|
4194
4190
|
relFilePath?: string | undefined;
|
|
4195
4191
|
type: string;
|
|
4196
4192
|
}
|
|
4197
|
-
interface CacheStorage {
|
|
4198
|
-
get(key: string): Promise<any>;
|
|
4199
|
-
set(key: string, value: any): Promise<void>;
|
|
4200
|
-
}
|
|
4201
4193
|
interface WorkerOptions {
|
|
4202
4194
|
maxConcurrentWorkers?: number;
|
|
4203
4195
|
maxConcurrentTasksPerWorker?: number;
|
|
@@ -4459,6 +4451,12 @@ interface TranspileOptions {
|
|
|
4459
4451
|
* that the specified flags take effect for this component at runtime.
|
|
4460
4452
|
*/
|
|
4461
4453
|
buildOverrides?: BuildOverrides;
|
|
4454
|
+
/**
|
|
4455
|
+
* When `true`, a `.css`/`.scss` transpile also collects CSS custom-property docs
|
|
4456
|
+
* onto {@link TranspileResults.styleDocs}. Off by default, since it costs an extra parse
|
|
4457
|
+
* of the style text.
|
|
4458
|
+
*/
|
|
4459
|
+
docs?: boolean;
|
|
4462
4460
|
}
|
|
4463
4461
|
/**
|
|
4464
4462
|
* Keys of {@link BuildConditionals} that can be meaningfully overridden at
|
|
@@ -4484,6 +4482,7 @@ interface TranspileResults {
|
|
|
4484
4482
|
inputFilePath: string;
|
|
4485
4483
|
map: any;
|
|
4486
4484
|
outputFilePath: string;
|
|
4485
|
+
styleDocs?: StyleDoc[];
|
|
4487
4486
|
}
|
|
4488
4487
|
interface TransformOptions {
|
|
4489
4488
|
coreImportPath: string;
|
|
@@ -4527,5 +4526,30 @@ interface CliInitOptions {
|
|
|
4527
4526
|
logger: Logger;
|
|
4528
4527
|
sys: CompilerSystem;
|
|
4529
4528
|
}
|
|
4529
|
+
/**
|
|
4530
|
+
* A Stencil `resolveId`/`load`/`transform` plugin, as accepted by {@link StencilConfig.plugins}.
|
|
4531
|
+
*/
|
|
4532
|
+
interface Plugin {
|
|
4533
|
+
name?: string;
|
|
4534
|
+
pluginType?: string;
|
|
4535
|
+
load?: (id: string, context: PluginCtx) => Promise<string> | string;
|
|
4536
|
+
resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
|
|
4537
|
+
transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults;
|
|
4538
|
+
}
|
|
4539
|
+
type PluginTransformResults = PluginTransformationDescriptor | string | null;
|
|
4540
|
+
interface PluginTransformationDescriptor {
|
|
4541
|
+
code?: string;
|
|
4542
|
+
map?: string;
|
|
4543
|
+
id?: string;
|
|
4544
|
+
diagnostics?: Diagnostic[];
|
|
4545
|
+
dependencies?: string[];
|
|
4546
|
+
}
|
|
4547
|
+
interface PluginCtx {
|
|
4548
|
+
config: Config;
|
|
4549
|
+
sys: CompilerSystem;
|
|
4550
|
+
fs: InMemoryFileSystem;
|
|
4551
|
+
cache: Cache;
|
|
4552
|
+
diagnostics: Diagnostic[];
|
|
4553
|
+
}
|
|
4530
4554
|
//#endregion
|
|
4531
|
-
export { AutoprefixerOptions, BuildEmitEvents, BuildEvents, BuildLog, BuildNoChangeResults, BuildOnEventRemove, BuildOnEvents, BuildOutput, BuildOverrides, BuildResultsComponentGraph,
|
|
4555
|
+
export { AutoprefixerOptions, BuildEmitEvents, BuildEvents, BuildLog, BuildNoChangeResults, BuildOnEventRemove, BuildOnEvents, BuildOutput, BuildOverrides, BuildResultsComponentGraph, CliInitOptions, CompileScriptMinifyOptions, CompileTarget, Compiler, CompilerBuildResults, CompilerBuildStart, CompilerDependency, CompilerEventBuildFinish, CompilerEventBuildLog, CompilerEventBuildNoChange, CompilerEventBuildStart, CompilerEventDirAdd, CompilerEventDirDelete, CompilerEventFileAdd, CompilerEventFileDelete, CompilerEventFileUpdate, CompilerEventFsChange, CompilerEventName, CompilerFileWatcher, CompilerFileWatcherCallback, CompilerFileWatcherEvent, CompilerFsStats, CompilerRequest, CompilerRequestResponse, CompilerSystem, CompilerSystemCreateDirectoryOptions, CompilerSystemCreateDirectoryResults, CompilerSystemRealpathResults, CompilerSystemRemoveDirectoryOptions, CompilerSystemRemoveDirectoryResults, CompilerSystemRemoveFileResults, CompilerSystemRenameResults, CompilerSystemRenamedPath, CompilerSystemWriteFileResults, CompilerWatcher, Config, ConfigBundle, ConfigCompat, CopyResults, CopyTask, Credentials, CustomElementsExportBehavior, CustomElementsExportBehaviorOptions, DevServer, DevServerConfig, DevServerEditor, Diagnostic, DocsReadmeCustomColumn, FsWatchResults, HistoryApiFallback, HmrGlobalStyleUpdate, HmrStyleUpdate, HotModuleReplacement, HydrateDocumentOptions, HydrateFactoryOptions, HydratedFlag, JsonDocMethodParameter, JsonDocs, JsonDocsComponent, JsonDocsCustomState, JsonDocsDependencyGraph, JsonDocsEvent, JsonDocsListener, JsonDocsMethod, JsonDocsMethodReturn, JsonDocsPart, JsonDocsProp, JsonDocsSlot, JsonDocsStyle, JsonDocsTag, JsonDocsTypeLibrary, JsonDocsUsage, JsonDocsValue, LOG_LEVELS, LazyRequire, LightDomPatches, LoadConfigInit, LoadConfigResults, LogLevel, Logger, LoggerLineUpdater, LoggerTimeSpan, ModeConfig, NodeResolveConfig, OptimizeCssInput, OptimizeCssOutput, OptimizeJsInput, OptimizeJsOutput, OutputTarget, OutputTargetAssets, OutputTargetBase, OutputTargetBaseNext, OutputTargetBuild, OutputTargetCollection, OutputTargetCopy, OutputTargetCustom, OutputTargetDistLazy, OutputTargetDocsAgentSkill, OutputTargetDocsCustom, OutputTargetDocsCustomElementsManifest, OutputTargetDocsJson, OutputTargetDocsReadme, OutputTargetDocsVscode, OutputTargetGlobalStyle, OutputTargetLoaderBundle, OutputTargetSsr, OutputTargetSsrWasm, OutputTargetStandalone, OutputTargetStats, OutputTargetTypes, OutputTargetWww, PageReloadStrategy, ParsedPath, PlatformPath, Plugin, PluginCtx, PluginTransformResults, PrerenderConfig, PrerenderHydrateOptions, PrerenderOptions, PrerenderResults, PrerenderStartOptions, ResolveModuleIdOptions, ResolveModuleIdResults, ResolveModuleOptions, RobotsTxtOpts, RobotsTxtResults, RolldownConfig, SerializeDocumentOptions, ServiceWorkerConfig, SitemapXmpOpts, SitemapXmpResults, SsrDocumentOptions, SsrFactoryOptions, StencilConfig, StencilDevServerConfig, StencilDocsConfig, StyleDoc, SystemDetails, TransformOptions, TranspileOnlyResults, TranspileOptions, TranspileResults, UnvalidatedConfig, ValidatedConfig, ValidatedOutputTargetWww, WatcherCloseResults, WorkerMainController, WorkerOptions };
|
|
@@ -264,6 +264,11 @@ interface JsonDocsComponent {
|
|
|
264
264
|
* A deprecation reason/description found following a `@deprecated` tag
|
|
265
265
|
*/
|
|
266
266
|
deprecation?: string;
|
|
267
|
+
/**
|
|
268
|
+
* `true` if this is a "CSS-only component"
|
|
269
|
+
* discovered in .css file via `@component`-marked JSDoc block
|
|
270
|
+
*/
|
|
271
|
+
cssOnly?: boolean;
|
|
267
272
|
}
|
|
268
273
|
interface JsonDocsDependencyGraph {
|
|
269
274
|
[tagName: string]: string[];
|
|
@@ -423,6 +428,16 @@ interface JsonDocsStyle {
|
|
|
423
428
|
* The annotation used in the JSDoc of the style (e.g. `@prop`)
|
|
424
429
|
*/
|
|
425
430
|
annotation: string;
|
|
431
|
+
/**
|
|
432
|
+
* The CSS `syntax` descriptor for a custom property, if it was registered via a native
|
|
433
|
+
* `@property` at-rule (e.g. `"<length>"`).
|
|
434
|
+
*/
|
|
435
|
+
syntax?: string;
|
|
436
|
+
/**
|
|
437
|
+
* The `initial-value` descriptor for a custom property, if it was registered via a native
|
|
438
|
+
* `@property` at-rule.
|
|
439
|
+
*/
|
|
440
|
+
default?: string;
|
|
426
441
|
/**
|
|
427
442
|
* The mode associated with the style
|
|
428
443
|
*/
|
|
@@ -509,6 +524,14 @@ interface StyleDoc {
|
|
|
509
524
|
* The Stencil style-mode that is associated with this property.
|
|
510
525
|
*/
|
|
511
526
|
mode: string | undefined;
|
|
527
|
+
/**
|
|
528
|
+
* The CSS `syntax` descriptor, if this property was registered via a native `@property` at-rule.
|
|
529
|
+
*/
|
|
530
|
+
syntax?: string;
|
|
531
|
+
/**
|
|
532
|
+
* The `initial-value` descriptor, if this property was registered via a native `@property` at-rule.
|
|
533
|
+
*/
|
|
534
|
+
default?: string;
|
|
512
535
|
}
|
|
513
536
|
//#endregion
|
|
514
537
|
export { JsonDocMethodParameter, JsonDocs, JsonDocsComponent, JsonDocsCustomState, JsonDocsDependencyGraph, JsonDocsEvent, JsonDocsListener, JsonDocsMethod, JsonDocsMethodReturn, JsonDocsPart, JsonDocsProp, JsonDocsSlot, JsonDocsStyle, JsonDocsTag, JsonDocsTypeLibrary, JsonDocsUsage, JsonDocsValue, StyleDoc };
|