@stencil/core 5.0.0-beta.3 → 5.0.0-beta.30
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-BYvfR_Hx.mjs} +127 -68
- package/dist/compiler/browser.d.ts +114 -81
- package/dist/compiler/browser.js +733 -336
- 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-BPgV6bA4.mjs → compiler-6RhuOkQ0.mjs} +4829 -2895
- package/dist/declarations/stencil-public-compiler.d.ts +152 -129
- package/dist/declarations/stencil-public-docs.d.ts +23 -0
- package/dist/declarations/stencil-public-runtime.d.ts +60 -58
- package/dist/{index-DmHmu3y0.d.mts → index-BGUOG9Wc.d.mts} +6 -2
- package/dist/{index-BXAcVN2j.d.ts → index-BHciXst1.d.ts} +57 -55
- package/dist/{index-BopBfjPu.d.mts → index-BogZpjP2.d.mts} +150 -127
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +1 -1
- package/dist/jsx-runtime.d.mts +6 -0
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/{node-75gQKkFz.mjs → node-CvPPhnWO.mjs} +41 -47
- package/dist/runtime/client/lazy.js +252 -189
- package/dist/runtime/client/runtime.d.ts +71 -66
- package/dist/runtime/client/runtime.js +252 -189
- package/dist/runtime/index.d.ts +4 -5
- package/dist/runtime/index.js +250 -187
- package/dist/runtime/server/index.d.mts +11 -11
- package/dist/runtime/server/index.mjs +302 -228
- 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 +14 -35
- 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 +136 -120
- package/dist/testing/index.mjs +259 -201
- 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;
|
|
@@ -2122,11 +2101,6 @@ interface Config extends StencilConfig {
|
|
|
2122
2101
|
tsWatchOptions?: any;
|
|
2123
2102
|
_isValidated?: boolean;
|
|
2124
2103
|
_isTesting?: boolean;
|
|
2125
|
-
/**
|
|
2126
|
-
* Internal flag set when --docs CLI flag is used.
|
|
2127
|
-
* Forces docs output targets to build even in dev mode.
|
|
2128
|
-
*/
|
|
2129
|
-
_docsFlag?: boolean;
|
|
2130
2104
|
/**
|
|
2131
2105
|
* Whether running in a CI environment (disables interactive features, adjusts worker count)
|
|
2132
2106
|
*/
|
|
@@ -2646,7 +2620,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
|
|
|
2646
2620
|
* Note that this is "approximate", in that HTML may often not be able
|
|
2647
2621
|
* to be split at an exact line width. Additionally, new lines created
|
|
2648
2622
|
* is where HTML naturally already has whitespace, such as before an
|
|
2649
|
-
* attribute or spaces between words. Defaults to `100
|
|
2623
|
+
* attribute or spaces between words. Defaults to no wrapping (`100` when prerendering).
|
|
2650
2624
|
*/
|
|
2651
2625
|
approximateLineWidth?: number;
|
|
2652
2626
|
/**
|
|
@@ -2664,12 +2638,12 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
|
|
|
2664
2638
|
prettyHtml?: boolean;
|
|
2665
2639
|
/**
|
|
2666
2640
|
* Remove quotes from attribute values when possible.
|
|
2667
|
-
* Defaults to `true
|
|
2641
|
+
* Defaults to `false` (`true` when prerendering).
|
|
2668
2642
|
*/
|
|
2669
2643
|
removeAttributeQuotes?: boolean;
|
|
2670
2644
|
/**
|
|
2671
2645
|
* Remove the `=""` from standardized `boolean` attributes,
|
|
2672
|
-
* such as `hidden` or `checked`. Defaults to `true
|
|
2646
|
+
* such as `hidden` or `checked`. Defaults to `false` (`true` when prerendering).
|
|
2673
2647
|
*/
|
|
2674
2648
|
removeBooleanAttributeQuotes?: boolean;
|
|
2675
2649
|
/**
|
|
@@ -2678,7 +2652,7 @@ interface SerializeDocumentOptions extends SsrDocumentOptions {
|
|
|
2678
2652
|
*/
|
|
2679
2653
|
removeEmptyAttributes?: boolean;
|
|
2680
2654
|
/**
|
|
2681
|
-
* Remove HTML comments. Defaults to `true
|
|
2655
|
+
* Remove HTML comments. Defaults to `false` (`true` when prerendering).
|
|
2682
2656
|
*/
|
|
2683
2657
|
removeHtmlComments?: boolean;
|
|
2684
2658
|
/**
|
|
@@ -2777,7 +2751,7 @@ interface CompilerSystem {
|
|
|
2777
2751
|
name: 'node' | 'in-memory';
|
|
2778
2752
|
version: string;
|
|
2779
2753
|
events?: BuildEvents;
|
|
2780
|
-
details
|
|
2754
|
+
details: SystemDetails;
|
|
2781
2755
|
/**
|
|
2782
2756
|
* Add a callback which will be ran when destroy() is called.
|
|
2783
2757
|
*/
|
|
@@ -2790,14 +2764,15 @@ interface CompilerSystem {
|
|
|
2790
2764
|
* SYNC! Always returns a boolean, does not throw.
|
|
2791
2765
|
*/
|
|
2792
2766
|
accessSync(p: string): boolean;
|
|
2793
|
-
applyGlobalPatch?(fromDir: string): Promise<void>;
|
|
2794
2767
|
applyPrerenderGlobalPatch?(opts: {
|
|
2795
2768
|
devServerHostUrl: string;
|
|
2796
2769
|
window: any;
|
|
2797
2770
|
}): void;
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2771
|
+
/**
|
|
2772
|
+
* Check npm for a newer Stencil version. Resolves a function that logs the result.
|
|
2773
|
+
*/
|
|
2774
|
+
checkVersion(logger: Logger, currentVersion: string): Promise<() => void>;
|
|
2775
|
+
copy(copyTasks: Required<CopyTask>[], srcDir: string): Promise<CopyResults>;
|
|
2801
2776
|
/**
|
|
2802
2777
|
* Always returns a boolean if the files were copied or not. Does not throw.
|
|
2803
2778
|
*/
|
|
@@ -2822,7 +2797,7 @@ interface CompilerSystem {
|
|
|
2822
2797
|
/**
|
|
2823
2798
|
* Each platform has a different way to dynamically import modules.
|
|
2824
2799
|
*/
|
|
2825
|
-
dynamicImport
|
|
2800
|
+
dynamicImport(p: string): Promise<any>;
|
|
2826
2801
|
/**
|
|
2827
2802
|
* Creates the worker controller for the current system.
|
|
2828
2803
|
*
|
|
@@ -2836,20 +2811,14 @@ interface CompilerSystem {
|
|
|
2836
2811
|
* process.exit()
|
|
2837
2812
|
*/
|
|
2838
2813
|
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
2814
|
/**
|
|
2846
2815
|
* Generates a sha1 digest encoded as HEX
|
|
2847
2816
|
*/
|
|
2848
|
-
generateContentHash
|
|
2817
|
+
generateContentHash(content: string | any, length?: number): Promise<string>;
|
|
2849
2818
|
/**
|
|
2850
2819
|
* Generates a sha1 digest encoded as HEX from a file path
|
|
2851
2820
|
*/
|
|
2852
|
-
generateFileHash
|
|
2821
|
+
generateFileHash(filePath: string | any, length?: number): Promise<string>;
|
|
2853
2822
|
/**
|
|
2854
2823
|
* Get the current directory.
|
|
2855
2824
|
*/
|
|
@@ -2858,7 +2827,6 @@ interface CompilerSystem {
|
|
|
2858
2827
|
* The compiler's executing path.
|
|
2859
2828
|
*/
|
|
2860
2829
|
getCompilerExecutingPath(): string;
|
|
2861
|
-
getEnvironmentVar?(key: string): string;
|
|
2862
2830
|
/**
|
|
2863
2831
|
* Gets the absolute file path when for a dependency module.
|
|
2864
2832
|
*/
|
|
@@ -2897,11 +2865,7 @@ interface CompilerSystem {
|
|
|
2897
2865
|
* Normalize file system path.
|
|
2898
2866
|
*/
|
|
2899
2867
|
normalizePath(p: string): string;
|
|
2900
|
-
onProcessInterrupt
|
|
2901
|
-
parseYarnLockFile?: (content: string) => {
|
|
2902
|
-
type: 'success' | 'merge' | 'conflict';
|
|
2903
|
-
object: any;
|
|
2904
|
-
};
|
|
2868
|
+
onProcessInterrupt(cb: () => void): void;
|
|
2905
2869
|
platformPath: PlatformPath;
|
|
2906
2870
|
/**
|
|
2907
2871
|
* All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
|
|
@@ -2937,6 +2901,9 @@ interface CompilerSystem {
|
|
|
2937
2901
|
* Rename old path to new path. Does not throw.
|
|
2938
2902
|
*/
|
|
2939
2903
|
rename(oldPath: string, newPath: string): Promise<CompilerSystemRenameResults>;
|
|
2904
|
+
/**
|
|
2905
|
+
* Assigned by the compiler. Used by plugins (e.g. `@stencil/sass`) to resolve `~` imports.
|
|
2906
|
+
*/
|
|
2940
2907
|
resolveModuleId?(opts: ResolveModuleIdOptions): Promise<ResolveModuleIdResults>;
|
|
2941
2908
|
resolvePath(p: string): string;
|
|
2942
2909
|
/**
|
|
@@ -3130,6 +3097,7 @@ interface CompilerBuildResults {
|
|
|
3130
3097
|
buildId: number;
|
|
3131
3098
|
componentGraph?: BuildResultsComponentGraph;
|
|
3132
3099
|
components: ComponentCompilerMeta[];
|
|
3100
|
+
cssOnlyComponents: ComponentCompilerMeta[];
|
|
3133
3101
|
diagnostics: Diagnostic[];
|
|
3134
3102
|
dirsAdded: string[];
|
|
3135
3103
|
dirsDeleted: string[];
|
|
@@ -3146,6 +3114,15 @@ interface CompilerBuildResults {
|
|
|
3146
3114
|
namespace: string;
|
|
3147
3115
|
fsNamespace: string;
|
|
3148
3116
|
outputs: BuildOutput[];
|
|
3117
|
+
/**
|
|
3118
|
+
* Absolute paths to every global stylesheet, in cascade order: each `global-style` output
|
|
3119
|
+
* target's compiled CSS in the order those targets are declared in `config.outputTargets` - or,
|
|
3120
|
+
* with none configured, the generated `{fsNamespace}.css` holding Stencil's auto-placed CSS (when
|
|
3121
|
+
* emitted). Unlike `outputs`, which groups files by type and sorts them alphabetically, this
|
|
3122
|
+
* preserves author-intended order for consumers like the dev-server's auto-generated component
|
|
3123
|
+
* preview.
|
|
3124
|
+
*/
|
|
3125
|
+
globalStyleFiles: string[];
|
|
3149
3126
|
rootDir: string;
|
|
3150
3127
|
srcDir: string;
|
|
3151
3128
|
timestamp: string;
|
|
@@ -3161,6 +3138,7 @@ interface HotModuleReplacement {
|
|
|
3161
3138
|
componentsUpdated?: string[];
|
|
3162
3139
|
excludeHmr?: string[];
|
|
3163
3140
|
externalStylesUpdated?: string[];
|
|
3141
|
+
globalStylesUpdated?: HmrGlobalStyleUpdate[];
|
|
3164
3142
|
imagesUpdated?: string[];
|
|
3165
3143
|
indexHtmlUpdated?: boolean;
|
|
3166
3144
|
inlineStylesUpdated?: HmrStyleUpdate[];
|
|
@@ -3175,6 +3153,15 @@ interface HmrStyleUpdate {
|
|
|
3175
3153
|
styleTag: string;
|
|
3176
3154
|
styleText: string;
|
|
3177
3155
|
}
|
|
3156
|
+
/**
|
|
3157
|
+
* A live-reload update for a `global-style` output target's CSS. Applied on
|
|
3158
|
+
* the client by matching `fileName` against the `<link>` that loads it and
|
|
3159
|
+
* inserting/updating an adjacent `<style>` override
|
|
3160
|
+
*/
|
|
3161
|
+
interface HmrGlobalStyleUpdate {
|
|
3162
|
+
fileName: string;
|
|
3163
|
+
styleText: string;
|
|
3164
|
+
}
|
|
3178
3165
|
type BuildOnEventRemove = () => boolean;
|
|
3179
3166
|
interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
|
|
3180
3167
|
unsubscribeAll(): void;
|
|
@@ -3329,7 +3316,9 @@ interface CopyTask {
|
|
|
3329
3316
|
/**
|
|
3330
3317
|
* Additional glob patterns to exclude from the copy operation, merged with
|
|
3331
3318
|
* the built-in defaults: `__mocks__`, `__fixtures__`, `dist`, hidden dirs,
|
|
3332
|
-
* `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`.
|
|
3319
|
+
* `.ds_store`, `.gitignore`, `desktop.ini`, `thumbs.db`. For a directory
|
|
3320
|
+
* `src`, patterns match paths relative to that directory; an explicitly
|
|
3321
|
+
* named `src` file is never ignored.
|
|
3333
3322
|
*/
|
|
3334
3323
|
ignore?: string[];
|
|
3335
3324
|
/**
|
|
@@ -3567,7 +3556,7 @@ interface OutputTargetCollection extends OutputTargetBaseNext {
|
|
|
3567
3556
|
* When `true` this flag will transform aliased import paths defined in
|
|
3568
3557
|
* a project's `tsconfig.json` to relative import paths in the compiled output.
|
|
3569
3558
|
*
|
|
3570
|
-
* Paths will be left in aliased format if `false
|
|
3559
|
+
* Paths will be left in aliased format if `false`. Defaults to `true`.
|
|
3571
3560
|
*
|
|
3572
3561
|
* @example
|
|
3573
3562
|
* // tsconfig.json
|
|
@@ -3669,11 +3658,11 @@ interface OutputTargetGlobalStyle extends OutputTargetBaseNext {
|
|
|
3669
3658
|
* Controls whether this global stylesheet is injected into component shadow DOMs
|
|
3670
3659
|
* as a constructable stylesheet at runtime.
|
|
3671
3660
|
*
|
|
3672
|
-
* - `'none'
|
|
3661
|
+
* - `'none'`: Don't inject - stylesheet must be loaded externally (e.g., via `<link>`)
|
|
3673
3662
|
* - `'client'`: Inject only in client builds, not SSR (reduces SSR output size)
|
|
3674
3663
|
* - `'all'`: Inject in both client and SSR builds
|
|
3675
3664
|
*
|
|
3676
|
-
* @default 'none'
|
|
3665
|
+
* @default 'client' when the stylesheet comes from `globalStyle` (or an auto-detected `src/global.*`), 'none' when `input` is set
|
|
3677
3666
|
*/
|
|
3678
3667
|
inject?: 'none' | 'client' | 'all';
|
|
3679
3668
|
}
|
|
@@ -3731,6 +3720,10 @@ interface OutputTargetSsr extends OutputTargetBase {
|
|
|
3731
3720
|
*/
|
|
3732
3721
|
cjs?: boolean;
|
|
3733
3722
|
}
|
|
3723
|
+
/**
|
|
3724
|
+
* Compiles the SSR hydrate app to a WASM plugin (via `extism-js`/QuickJS-ng) that can run
|
|
3725
|
+
* outside of Node
|
|
3726
|
+
*/
|
|
3734
3727
|
interface OutputTargetSsrWasm extends OutputTargetBase {
|
|
3735
3728
|
type: 'ssr-wasm';
|
|
3736
3729
|
/** Output directory. @default 'dist/ssr-wasm' */
|
|
@@ -3841,9 +3834,11 @@ interface OutputTargetDocsCustomElementsManifest extends OutputTargetBase {
|
|
|
3841
3834
|
type: 'docs-custom-elements-manifest';
|
|
3842
3835
|
/**
|
|
3843
3836
|
* The file path where the custom-elements.json manifest will be written.
|
|
3844
|
-
* Defaults to 'custom-elements.json'
|
|
3837
|
+
* Defaults to 'dist/custom-elements.json'.
|
|
3838
|
+
*
|
|
3839
|
+
* The `customElements` field of the project's `package.json` is set to this path.
|
|
3845
3840
|
*/
|
|
3846
|
-
file
|
|
3841
|
+
file?: string;
|
|
3847
3842
|
strict?: boolean;
|
|
3848
3843
|
}
|
|
3849
3844
|
interface OutputTargetDocsCustom extends OutputTargetBase {
|
|
@@ -3868,7 +3863,7 @@ interface OutputTargetDocsAgentSkill extends OutputTargetBase {
|
|
|
3868
3863
|
/**
|
|
3869
3864
|
* The skill's name, used in the `SKILL.md` frontmatter.
|
|
3870
3865
|
*
|
|
3871
|
-
* Defaults to
|
|
3866
|
+
* Defaults to {@link Config.namespace}, lowercased, with anything other than letters and numbers replaced by `-`.
|
|
3872
3867
|
*/
|
|
3873
3868
|
name?: string;
|
|
3874
3869
|
/**
|
|
@@ -3931,10 +3926,8 @@ interface OutputTargetStandalone extends OutputTargetBaseNext {
|
|
|
3931
3926
|
type: 'standalone';
|
|
3932
3927
|
empty?: boolean;
|
|
3933
3928
|
/**
|
|
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.
|
|
3929
|
+
* When `true`, all `@stencil/core/*` module references are treated as external
|
|
3930
|
+
* during bundling rather than being included in the generated output.
|
|
3938
3931
|
*
|
|
3939
3932
|
* @default false
|
|
3940
3933
|
*/
|
|
@@ -3998,8 +3991,10 @@ interface OutputTargetBase {
|
|
|
3998
3991
|
* This improves dev build times by not generating production-only artifacts.
|
|
3999
3992
|
*
|
|
4000
3993
|
* Defaults vary by output target type:
|
|
4001
|
-
* - `loader-bundle`: `
|
|
4002
|
-
* - `standalone`: `true`
|
|
3994
|
+
* - `loader-bundle`: `true` (skips the npm distribution files; the browser bundle always builds)
|
|
3995
|
+
* - `standalone`: `true` if `loader-bundle` is also configured, otherwise `false`
|
|
3996
|
+
* - `types`, `collection`, `ssr-wasm`: `true` (skips in dev)
|
|
3997
|
+
* - `assets`, `global-style`: `false` (always runs)
|
|
4003
3998
|
* - `ssr`: `true` (skips in dev, unless `devServer.ssr` is enabled)
|
|
4004
3999
|
* - `docs-*`: `true` (skips in dev)
|
|
4005
4000
|
* - `custom`: `true` (skips in dev)
|
|
@@ -4194,10 +4189,6 @@ interface Diagnostic {
|
|
|
4194
4189
|
relFilePath?: string | undefined;
|
|
4195
4190
|
type: string;
|
|
4196
4191
|
}
|
|
4197
|
-
interface CacheStorage {
|
|
4198
|
-
get(key: string): Promise<any>;
|
|
4199
|
-
set(key: string, value: any): Promise<void>;
|
|
4200
|
-
}
|
|
4201
4192
|
interface WorkerOptions {
|
|
4202
4193
|
maxConcurrentWorkers?: number;
|
|
4203
4194
|
maxConcurrentTasksPerWorker?: number;
|
|
@@ -4459,13 +4450,19 @@ interface TranspileOptions {
|
|
|
4459
4450
|
* that the specified flags take effect for this component at runtime.
|
|
4460
4451
|
*/
|
|
4461
4452
|
buildOverrides?: BuildOverrides;
|
|
4453
|
+
/**
|
|
4454
|
+
* When `true`, a `.css`/`.scss` transpile also collects CSS custom-property docs
|
|
4455
|
+
* onto {@link TranspileResults.styleDocs}. Off by default, since it costs an extra parse
|
|
4456
|
+
* of the style text.
|
|
4457
|
+
*/
|
|
4458
|
+
docs?: boolean;
|
|
4462
4459
|
}
|
|
4463
4460
|
/**
|
|
4464
4461
|
* Keys of {@link BuildConditionals} that can be meaningfully overridden at
|
|
4465
4462
|
* transpile time — config-driven flags that are not derived from component
|
|
4466
4463
|
* scanning or runtime environment detection.
|
|
4467
4464
|
*/
|
|
4468
|
-
type BuildOverrideKeys = 'hotModuleReplacement' | 'signalBacking' | 'vdomSignals' | 'lightDomPatches' | 'slotChildNodes' | 'slotCloneNode' | 'slotDomMutations' | 'slotTextContent' | 'lifecycleDOMEvents' | 'initializeNextTick';
|
|
4465
|
+
type BuildOverrideKeys = 'isDev' | 'isTesting' | 'hotModuleReplacement' | 'signalBacking' | 'vdomSignals' | 'lightDomPatches' | 'slotChildNodes' | 'slotCloneNode' | 'slotDomMutations' | 'slotTextContent' | 'lifecycleDOMEvents' | 'initializeNextTick';
|
|
4469
4466
|
/**
|
|
4470
4467
|
* Subset of Stencil's BUILD feature flags that can be overridden at transpile
|
|
4471
4468
|
* time. Derived from {@link BuildConditionals} via `Pick` so the field list
|
|
@@ -4484,6 +4481,7 @@ interface TranspileResults {
|
|
|
4484
4481
|
inputFilePath: string;
|
|
4485
4482
|
map: any;
|
|
4486
4483
|
outputFilePath: string;
|
|
4484
|
+
styleDocs?: StyleDoc[];
|
|
4487
4485
|
}
|
|
4488
4486
|
interface TransformOptions {
|
|
4489
4487
|
coreImportPath: string;
|
|
@@ -4527,5 +4525,30 @@ interface CliInitOptions {
|
|
|
4527
4525
|
logger: Logger;
|
|
4528
4526
|
sys: CompilerSystem;
|
|
4529
4527
|
}
|
|
4528
|
+
/**
|
|
4529
|
+
* A Stencil `resolveId`/`load`/`transform` plugin, as accepted by {@link StencilConfig.plugins}.
|
|
4530
|
+
*/
|
|
4531
|
+
interface Plugin {
|
|
4532
|
+
name?: string;
|
|
4533
|
+
pluginType?: string;
|
|
4534
|
+
load?: (id: string, context: PluginCtx) => Promise<string> | string;
|
|
4535
|
+
resolveId?: (importee: string, importer: string, context: PluginCtx) => Promise<string> | string;
|
|
4536
|
+
transform?: (sourceText: string, id: string, context: PluginCtx) => Promise<PluginTransformResults> | PluginTransformResults;
|
|
4537
|
+
}
|
|
4538
|
+
type PluginTransformResults = PluginTransformationDescriptor | string | null;
|
|
4539
|
+
interface PluginTransformationDescriptor {
|
|
4540
|
+
code?: string;
|
|
4541
|
+
map?: string;
|
|
4542
|
+
id?: string;
|
|
4543
|
+
diagnostics?: Diagnostic[];
|
|
4544
|
+
dependencies?: string[];
|
|
4545
|
+
}
|
|
4546
|
+
interface PluginCtx {
|
|
4547
|
+
config: Config;
|
|
4548
|
+
sys: CompilerSystem;
|
|
4549
|
+
fs: InMemoryFileSystem;
|
|
4550
|
+
cache: Cache;
|
|
4551
|
+
diagnostics: Diagnostic[];
|
|
4552
|
+
}
|
|
4530
4553
|
//#endregion
|
|
4531
|
-
export { AutoprefixerOptions, BuildEmitEvents, BuildEvents, BuildLog, BuildNoChangeResults, BuildOnEventRemove, BuildOnEvents, BuildOutput, BuildOverrides, BuildResultsComponentGraph,
|
|
4554
|
+
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 };
|