@stencil/core 5.0.0-alpha.1 → 5.0.0-alpha.11

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 (50) hide show
  1. package/dist/app-data/index.d.ts +2 -0
  2. package/dist/{runtime/app-data → app-data}/index.js +17 -12
  3. package/dist/{client-B1nuvCd2.mjs → client-aTQ7xHxx.mjs} +2432 -2278
  4. package/dist/compiler/index.d.mts +6 -6
  5. package/dist/compiler/index.mjs +2 -2
  6. package/dist/compiler/utils/index.d.mts +2 -2
  7. package/dist/compiler/utils/index.mjs +3 -3
  8. package/dist/{compiler-LX4_RKKd.mjs → compiler-DCN7Np2A.mjs} +14854 -13500
  9. package/dist/declarations/stencil-public-compiler.d.ts +4374 -2
  10. package/dist/declarations/stencil-public-compiler.js +2 -4
  11. package/dist/declarations/stencil-public-docs.d.ts +504 -1
  12. package/dist/declarations/stencil-public-runtime.d.ts +1982 -2
  13. package/dist/{index-fIuYTL9f.d.mts → index-BvkyxSY6.d.mts} +29 -2
  14. package/dist/{index-D-LlB2nw.d.mts → index-vY35H18z.d.mts} +795 -1188
  15. package/dist/{index-BONzXKJt.d.ts → index-xAkMgLX_.d.ts} +88 -39
  16. package/dist/index.d.mts +1 -1
  17. package/dist/index.mjs +2 -2
  18. package/dist/jsx-runtime.d.mts +18 -0
  19. package/dist/jsx-runtime.mjs +2 -0
  20. package/dist/{node-SxQIOCZE.mjs → node--akYC-sG.mjs} +20 -30
  21. package/dist/regular-expression-CFVJOTUh.mjs +508 -0
  22. package/dist/{runtime-CF9DJtSu.js → runtime/client/lazy.js} +2675 -2493
  23. package/dist/runtime/client/{index.d.ts → runtime.d.ts} +106 -78
  24. package/dist/runtime/client/{index.js → runtime.js} +2545 -2487
  25. package/dist/runtime/index.d.ts +58 -29
  26. package/dist/runtime/index.js +4795 -2
  27. package/dist/runtime/server/index.d.mts +103 -70
  28. package/dist/runtime/server/index.mjs +2545 -2350
  29. package/dist/runtime/server/runner.d.mts +44 -48
  30. package/dist/runtime/server/runner.mjs +347 -751
  31. package/dist/signals/index.d.ts +47 -0
  32. package/dist/signals/index.js +199 -0
  33. package/dist/sys/node/index.d.mts +1 -1
  34. package/dist/sys/node/index.mjs +1 -1
  35. package/dist/sys/node/worker.mjs +2 -2
  36. package/dist/testing/index.d.mts +97 -3
  37. package/dist/testing/index.mjs +367 -59
  38. package/dist/{validation-CaCgjw-f.mjs → validation-ByxKj8bC.mjs} +116 -99
  39. package/package.json +47 -38
  40. package/dist/index-CHjZtib0.d.ts +0 -30
  41. package/dist/jsx-runtime-DBzBJLKk.d.ts +0 -28
  42. package/dist/jsx-runtime.d.ts +0 -2
  43. package/dist/jsx-runtime.js +0 -2
  44. package/dist/runtime/app-data/index.d.ts +0 -2
  45. package/dist/serialize-BkYHk7Mi.mjs +0 -766
  46. package/dist/stencil-public-compiler-C_X1iolo.d.ts +0 -4455
  47. package/dist/stencil-public-runtime-DlV8o7-z.d.ts +0 -1845
  48. /package/dist/{runtime/app-globals → app-globals}/index.d.ts +0 -0
  49. /package/dist/{runtime/app-globals → app-globals}/index.js +0 -0
  50. /package/dist/{chunk-CjcI7cDX.mjs → chunk-z9aeyW2b.mjs} +0 -0
@@ -1,4 +1,3 @@
1
- import "./stencil-public-docs.js";
2
1
  //#region src/declarations/stencil-public-compiler.ts
3
2
  /**
4
3
  * This sets the log level hierarchy for our terminal logger, ranging from
@@ -30,7 +29,7 @@ const LOG_LEVELS = [
30
29
  /**
31
30
  * The collection of valid export behaviors.
32
31
  * Used to generate a type for typed configs as well as output target validation
33
- * for the `dist-custom-elements` output target.
32
+ * for the `standalone` output target.
34
33
  *
35
34
  * Adding a value to this const array will automatically add it as a valid option on the
36
35
  * output target configuration for `customElementsExportBehavior`.
@@ -39,8 +38,7 @@ const LOG_LEVELS = [
39
38
  * - `auto-define-custom-elements`: Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
40
39
  * functionality allows consumers to bypass the explicit call to define a component, its children, its children's
41
40
  * children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
42
- * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory. This behavior was added to allow easy migration
43
- * from `dist-custom-elements-bundle` to `dist-custom-elements`.
41
+ * - `bundle`: A `defineCustomElements` function will be exported from the distribution directory.
44
42
  * - `single-export-module`: All components will be re-exported from the specified directory's root `index.js` file.
45
43
  */
46
44
  const CustomElementsExportBehaviorOptions = [
@@ -1,2 +1,505 @@
1
- import { $n as JsonDocsValue, Bn as JsonDocsCustomState, Gn as JsonDocsMethodReturn, Hn as JsonDocsEvent, Jn as JsonDocsSlot, Kn as JsonDocsPart, Ln as JsonDocMethodParameter, Qn as JsonDocsUsage, Rn as JsonDocs, Un as JsonDocsListener, Vn as JsonDocsDependencyGraph, Wn as JsonDocsMethod, Xn as JsonDocsTag, Yn as JsonDocsStyle, Zn as JsonDocsTypeLibrary, er as StyleDoc, qn as JsonDocsProp, zn as JsonDocsComponent } from "../stencil-public-compiler-C_X1iolo.js";
1
+ //#region src/declarations/stencil-private.d.ts
2
+ /**
3
+ * Information about a type used in a Stencil component or exported
4
+ * from a Stencil project.
5
+ */
6
+ interface ComponentCompilerPropertyComplexType {
7
+ /**
8
+ * The string of the original type annotation in the Stencil source code
9
+ */
10
+ original: string;
11
+ /**
12
+ * A 'resolved' type, where e.g. imported types have been resolved and inlined
13
+ *
14
+ * For instance, an annotation like `(foo: Foo) => string;` will be
15
+ * converted to `(foo: { foo: string }) => string;`.
16
+ */
17
+ resolved: string;
18
+ /**
19
+ * A record of the types which were referenced in the assorted type
20
+ * annotation in the original source file.
21
+ */
22
+ references: ComponentCompilerTypeReferences;
23
+ /**
24
+ * @internal TypeScript AST node used for semantic type analysis during compilation.
25
+ * Not serialized, only used internally for improved type renaming logic.
26
+ */
27
+ _astNode?: any;
28
+ }
29
+ /**
30
+ * A record of `ComponentCompilerTypeReference` entities.
31
+ *
32
+ * Each key in this record is intended to be the names of the types used by a component. However, this is not enforced
33
+ * by the type system (I.E. any string can be used as a key).
34
+ *
35
+ * Note any key can be a user defined type or a TypeScript standard type.
36
+ */
37
+ type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
38
+ /**
39
+ * Describes a reference to a type used by a component.
40
+ */
41
+ interface ComponentCompilerTypeReference {
42
+ /**
43
+ * A type may be defined:
44
+ * - locally (in the same file as the component that uses it)
45
+ * - globally
46
+ * - by importing it into a file (and is defined elsewhere)
47
+ */
48
+ location: 'local' | 'global' | 'import';
49
+ /**
50
+ * The path to the type reference, if applicable (global types should not need a path associated with them)
51
+ */
52
+ path?: string;
53
+ /**
54
+ * An ID for this type which is unique within a Stencil project.
55
+ */
56
+ id: string;
57
+ /**
58
+ * Whether this type was imported as a default import (e.g., `import MyEnum from './my-enum'`)
59
+ * vs a named import (e.g., `import { MyType } from './my-type'`)
60
+ */
61
+ isDefault?: boolean;
62
+ /**
63
+ * The name used in the import statement (before any user-defined alias).
64
+ * For `import { XAxisOption as moo }`, this would be "XAxisOption".
65
+ * This is the name exported by the source module.
66
+ */
67
+ referenceLocation?: string;
68
+ }
69
+ /**
70
+ * Information about a type which is referenced by another type on a Stencil
71
+ * component, for instance a {@link ComponentCompilerPropertyComplexType} or a
72
+ * {@link ComponentCompilerEventComplexType}.
73
+ */
74
+ interface ComponentCompilerReferencedType {
75
+ /**
76
+ * The path to the module where the type is declared.
77
+ */
78
+ path: string;
79
+ /**
80
+ * The string of the original type annotation in the Stencil source code
81
+ */
82
+ declaration: string;
83
+ /**
84
+ * An extracted docstring
85
+ */
86
+ docstring: string;
87
+ }
88
+ interface ComponentCompilerEventComplexType {
89
+ original: string;
90
+ resolved: string;
91
+ references: ComponentCompilerTypeReferences;
92
+ }
93
+ interface ComponentCompilerMethodComplexType {
94
+ signature: string;
95
+ parameters: JsonDocMethodParameter[];
96
+ references: ComponentCompilerTypeReferences;
97
+ return: string;
98
+ /**
99
+ * @internal TypeScript AST method node used for semantic type analysis during compilation.
100
+ * Not serialized, only used internally for improved type renaming logic.
101
+ */
102
+ _astNode?: any;
103
+ }
104
+ //#endregion
105
+ //#region src/declarations/stencil-public-docs.d.ts
106
+ /**
107
+ * The Type Library holds information about the types which are used in a
108
+ * Stencil project. During compilation, Stencil gathers information about the
109
+ * types which form part of a component's public API, such as properties
110
+ * decorated with `@Prop`, `@Event`, `@Watch`, etc. This type information is
111
+ * then added to the Type Library, where it can be accessed later on for
112
+ * generating documentation.
113
+ *
114
+ * This information is included in the file written by the `docs-json` output
115
+ * target (see {@link JsonDocs.typeLibrary}).
116
+ */
117
+ type JsonDocsTypeLibrary = Record<string, ComponentCompilerReferencedType>;
118
+ /**
119
+ * A container for JSDoc metadata for a project
120
+ */
121
+ interface JsonDocs {
122
+ /**
123
+ * The metadata for the JSDocs for each component in a Stencil project
124
+ */
125
+ components: JsonDocsComponent[];
126
+ /**
127
+ * The timestamp at which the metadata was generated, in the format YYYY-MM-DDThh:mm:ss
128
+ */
129
+ timestamp: string;
130
+ compiler: {
131
+ /**
132
+ * The name of the compiler that generated the metadata
133
+ */
134
+ name: string;
135
+ /**
136
+ * The version of the Stencil compiler that generated the metadata
137
+ */
138
+ version: string;
139
+ /**
140
+ * The version of TypeScript that was used to generate the metadata
141
+ */
142
+ typescriptVersion: string;
143
+ };
144
+ typeLibrary: JsonDocsTypeLibrary;
145
+ }
146
+ /**
147
+ * Container for JSDoc metadata for a single Stencil component
148
+ */
149
+ interface JsonDocsComponent {
150
+ /**
151
+ * The directory containing the Stencil component, minus the file name.
152
+ *
153
+ * @example /workspaces/stencil-project/src/components/my-component
154
+ */
155
+ dirPath?: string;
156
+ /**
157
+ * The name of the file containing the Stencil component, with no path
158
+ *
159
+ * @example my-component.tsx
160
+ */
161
+ fileName?: string;
162
+ /**
163
+ * The full path of the file containing the Stencil component
164
+ *
165
+ * @example /workspaces/stencil-project/src/components/my-component/my-component.tsx
166
+ */
167
+ filePath?: string;
168
+ /**
169
+ * The path to the component's `readme.md` file, including the filename
170
+ *
171
+ * @example /workspaces/stencil-project/src/components/my-component/readme.md
172
+ */
173
+ readmePath?: string;
174
+ /**
175
+ * The path to the component's `usage` directory
176
+ *
177
+ * @example /workspaces/stencil-project/src/components/my-component/usage/
178
+ */
179
+ usagesDir?: string;
180
+ /**
181
+ * The encapsulation strategy for a component
182
+ */
183
+ encapsulation: 'shadow' | 'scoped' | 'none';
184
+ /**
185
+ * The tag name for the component, for use in HTML
186
+ */
187
+ tag: string;
188
+ /**
189
+ * The contents of a component's `readme.md` that are user generated.
190
+ *
191
+ * Auto-generated contents are not stored in this reference.
192
+ */
193
+ readme: string;
194
+ /**
195
+ * The description of a Stencil component, found in the JSDoc that sits above the component's declaration
196
+ */
197
+ docs: string;
198
+ /**
199
+ * JSDoc tags found in the JSDoc comment written atop a component's declaration
200
+ */
201
+ docsTags: JsonDocsTag[];
202
+ /**
203
+ * The text from the class-level JSDoc for a Stencil component, if present.
204
+ */
205
+ overview?: string;
206
+ /**
207
+ * A mapping of usage example file names to their contents for the component.
208
+ */
209
+ usage: JsonDocsUsage;
210
+ /**
211
+ * Array of metadata for a component's `@Prop`s
212
+ */
213
+ props: JsonDocsProp[];
214
+ /**
215
+ * Array of metadata for a component's `@Method`s
216
+ */
217
+ methods: JsonDocsMethod[];
218
+ /**
219
+ * Array of metadata for a component's `@Event`s
220
+ */
221
+ events: JsonDocsEvent[];
222
+ /**
223
+ * Array of metadata for a component's `@Listen` handlers
224
+ */
225
+ listeners: JsonDocsListener[];
226
+ /**
227
+ * Array of metadata for a component's CSS styling information
228
+ */
229
+ styles: JsonDocsStyle[];
230
+ /**
231
+ * Array of component Slot information, generated from `@slot` tags
232
+ */
233
+ slots: JsonDocsSlot[];
234
+ /**
235
+ * Array of component Parts information, generate from `@part` tags
236
+ */
237
+ parts: JsonDocsPart[];
238
+ /**
239
+ * Array of custom states defined via @AttachInternals({ states: {...} })
240
+ */
241
+ customStates: JsonDocsCustomState[];
242
+ /**
243
+ * Array of metadata describing where the current component is used
244
+ */
245
+ dependents: string[];
246
+ /**
247
+ * Array of metadata listing the components which are used in current component
248
+ */
249
+ dependencies: string[];
250
+ /**
251
+ * Describes a tree of components coupling
252
+ */
253
+ dependencyGraph: JsonDocsDependencyGraph;
254
+ /**
255
+ * A deprecation reason/description found following a `@deprecated` tag
256
+ */
257
+ deprecation?: string;
258
+ }
259
+ interface JsonDocsDependencyGraph {
260
+ [tagName: string]: string[];
261
+ }
262
+ /**
263
+ * A descriptor for a single JSDoc tag found in a block comment
264
+ */
265
+ interface JsonDocsTag {
266
+ /**
267
+ * The tag name (immediately following the '@')
268
+ */
269
+ name: string;
270
+ /**
271
+ * The description that immediately follows the tag name
272
+ */
273
+ text?: string;
274
+ }
275
+ interface JsonDocsValue {
276
+ value?: string;
277
+ type: string;
278
+ }
279
+ /**
280
+ * A mapping of file names to their contents.
281
+ *
282
+ * This type is meant to be used when reading one or more usage markdown files associated with a component. For the
283
+ * given directory structure:
284
+ * ```
285
+ * src/components/my-component
286
+ * ├── my-component.tsx
287
+ * └── usage
288
+ * ├── bar.md
289
+ * └── foo.md
290
+ * ```
291
+ * an instance of this type would include the name of the markdown file, mapped to its contents:
292
+ * ```ts
293
+ * {
294
+ * 'bar': STRING_CONTENTS_OF_BAR.MD
295
+ * 'foo': STRING_CONTENTS_OF_FOO.MD
296
+ * }
297
+ * ```
298
+ */
299
+ interface JsonDocsUsage {
300
+ [key: string]: string;
301
+ }
302
+ /**
303
+ * An intermediate representation of a `@Prop` decorated member's JSDoc
304
+ */
305
+ interface JsonDocsProp {
306
+ /**
307
+ * the name of the prop
308
+ */
309
+ name: string;
310
+ complexType?: ComponentCompilerPropertyComplexType;
311
+ /**
312
+ * the type of the prop, in terms of the TypeScript type system (as opposed to JavaScript's or HTML's)
313
+ */
314
+ type: string;
315
+ /**
316
+ * `true` if the prop was configured as "mutable" where it was declared, `false` otherwise
317
+ */
318
+ mutable: boolean;
319
+ /**
320
+ * The name of the attribute that is exposed to configure a compiled web component
321
+ */
322
+ attr?: string;
323
+ /**
324
+ * `true` if the prop was configured to "reflect" back to HTML where it (the prop) was declared, `false` otherwise
325
+ */
326
+ reflectToAttr: boolean;
327
+ /**
328
+ * the JSDoc description text associated with the prop
329
+ */
330
+ docs: string;
331
+ /**
332
+ * JSDoc tags associated with the prop
333
+ */
334
+ docsTags: JsonDocsTag[];
335
+ /**
336
+ * The default value of the prop
337
+ */
338
+ default?: string;
339
+ /**
340
+ * Deprecation text associated with the prop. This is the text that immediately follows a `@deprecated` tag
341
+ */
342
+ deprecation?: string;
343
+ values: JsonDocsValue[];
344
+ /**
345
+ * `true` if a component is declared with a '?', `false` otherwise
346
+ *
347
+ * @example
348
+ * ```tsx
349
+ * @Prop() componentProps?: any;
350
+ * ```
351
+ */
352
+ optional: boolean;
353
+ /**
354
+ * `true` if a component is declared with a '!', `false` otherwise
355
+ *
356
+ * @example
357
+ * ```tsx
358
+ * @Prop() componentProps!: any;
359
+ * ```
360
+ */
361
+ required: boolean;
362
+ /**
363
+ * `true` if the prop has a `get()`. `false` otherwise
364
+ */
365
+ getter: boolean;
366
+ /**
367
+ * `true` if the prop has a `set()`. `false` otherwise
368
+ */
369
+ setter: boolean;
370
+ }
371
+ interface JsonDocsMethod {
372
+ name: string;
373
+ docs: string;
374
+ docsTags: JsonDocsTag[];
375
+ deprecation?: string;
376
+ signature: string;
377
+ returns: JsonDocsMethodReturn;
378
+ parameters: JsonDocMethodParameter[];
379
+ complexType: ComponentCompilerMethodComplexType;
380
+ }
381
+ interface JsonDocsMethodReturn {
382
+ type: string;
383
+ docs: string;
384
+ }
385
+ interface JsonDocMethodParameter {
386
+ name: string;
387
+ type: string;
388
+ docs: string;
389
+ }
390
+ interface JsonDocsEvent {
391
+ event: string;
392
+ bubbles: boolean;
393
+ cancelable: boolean;
394
+ composed: boolean;
395
+ complexType: ComponentCompilerEventComplexType;
396
+ docs: string;
397
+ docsTags: JsonDocsTag[];
398
+ deprecation?: string;
399
+ detail: string;
400
+ }
401
+ /**
402
+ * Type describing a CSS Style, as described by a JSDoc-style comment
403
+ */
404
+ interface JsonDocsStyle {
405
+ /**
406
+ * The name of the style
407
+ */
408
+ name: string;
409
+ /**
410
+ * The type/description associated with the style
411
+ */
412
+ docs: string;
413
+ /**
414
+ * The annotation used in the JSDoc of the style (e.g. `@prop`)
415
+ */
416
+ annotation: string;
417
+ /**
418
+ * The mode associated with the style
419
+ */
420
+ mode: string | undefined;
421
+ }
422
+ interface JsonDocsListener {
423
+ event: string;
424
+ target?: string;
425
+ capture: boolean;
426
+ passive: boolean;
427
+ }
428
+ /**
429
+ * A descriptor for a slot
430
+ *
431
+ * Objects of this type are translated from the JSDoc tag, `@slot`
432
+ */
433
+ interface JsonDocsSlot {
434
+ /**
435
+ * The name of the slot. Defaults to an empty string for an unnamed slot.
436
+ */
437
+ name: string;
438
+ /**
439
+ * A textual description of the slot.
440
+ */
441
+ docs: string;
442
+ }
443
+ /**
444
+ * A descriptor of a CSS Shadow Part
445
+ *
446
+ * Objects of this type are translated from the JSDoc tag, `@part`, or the 'part'
447
+ * attribute on a component in TSX
448
+ */
449
+ interface JsonDocsPart {
450
+ /**
451
+ * The name of the Shadow part
452
+ */
453
+ name: string;
454
+ /**
455
+ * A textual description of the Shadow part.
456
+ */
457
+ docs: string;
458
+ }
459
+ /**
460
+ * A descriptor for a Custom State defined via @AttachInternals({ states: {...} })
461
+ *
462
+ * Custom states are exposed via the ElementInternals.states CustomStateSet
463
+ * and can be targeted with the CSS `:state()` pseudo-class.
464
+ *
465
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet
466
+ */
467
+ interface JsonDocsCustomState {
468
+ /**
469
+ * The name of the custom state (without dashes)
470
+ */
471
+ name: string;
472
+ /**
473
+ * The initial/default value of the state
474
+ */
475
+ initialValue: boolean;
476
+ /**
477
+ * A textual description of the custom state
478
+ */
479
+ docs: string;
480
+ }
481
+ /**
482
+ * Represents a parsed block comment in a CSS, Sass, etc. file for a custom property.
483
+ */
484
+ interface StyleDoc {
485
+ /**
486
+ * The name of the CSS property
487
+ */
488
+ name: string;
489
+ /**
490
+ * The user-defined description of the CSS property
491
+ */
492
+ docs: string;
493
+ /**
494
+ * The JSDoc-style annotation (e.g. `@prop`) that was used in the block comment to detect the comment.
495
+ * Used to inform Stencil where the start of a new property's description starts (and where the previous description
496
+ * ends).
497
+ */
498
+ annotation: 'prop';
499
+ /**
500
+ * The Stencil style-mode that is associated with this property.
501
+ */
502
+ mode: string | undefined;
503
+ }
504
+ //#endregion
2
505
  export { JsonDocMethodParameter, JsonDocs, JsonDocsComponent, JsonDocsCustomState, JsonDocsDependencyGraph, JsonDocsEvent, JsonDocsListener, JsonDocsMethod, JsonDocsMethodReturn, JsonDocsPart, JsonDocsProp, JsonDocsSlot, JsonDocsStyle, JsonDocsTag, JsonDocsTypeLibrary, JsonDocsUsage, JsonDocsValue, StyleDoc };