@wix/zero-config-implementation 1.7.0 → 1.9.0
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/converters/data-item-builder.d.ts +4 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +22432 -19408
- package/dist/information-extractors/react/extractors/core/index.d.ts +1 -1
- package/dist/information-extractors/react/extractors/core/runner.d.ts +5 -1
- package/dist/information-extractors/react/extractors/index.d.ts +1 -1
- package/dist/information-extractors/react/extractors/prop-tracker.d.ts +3 -6
- package/dist/information-extractors/react/index.d.ts +2 -3
- package/dist/information-extractors/react/types.d.ts +4 -17
- package/dist/information-extractors/react/utils/mock-generator.d.ts +13 -2
- package/dist/manifest-pipeline.d.ts +2 -2
- package/package.json +2 -2
- package/src/converters/data-item-builder.ts +120 -35
- package/src/converters/to-editor-component.ts +11 -6
- package/src/index.ts +5 -3
- package/src/information-extractors/react/extractors/core/index.ts +1 -1
- package/src/information-extractors/react/extractors/core/runner.ts +12 -7
- package/src/information-extractors/react/extractors/core/tree-builder.ts +3 -1
- package/src/information-extractors/react/extractors/index.ts +1 -0
- package/src/information-extractors/react/extractors/prop-tracker.ts +49 -28
- package/src/information-extractors/react/index.ts +1 -7
- package/src/information-extractors/react/types.ts +4 -20
- package/src/information-extractors/react/utils/mock-generator.ts +99 -31
- package/src/manifest-pipeline.ts +18 -12
- package/dist/information-extractors/react/utils/prop-spy.d.ts +0 -10
- package/src/information-extractors/react/utils/prop-spy.ts +0 -168
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Result } from 'neverthrow';
|
|
2
2
|
import { ParseError } from '../errors';
|
|
3
|
+
import { TrackingStores } from '../information-extractors/react';
|
|
3
4
|
import { PropInfo } from '../information-extractors/ts/types';
|
|
4
5
|
import { DataItem } from '../schema';
|
|
5
6
|
type ParseErrorInstance = InstanceType<typeof ParseError>;
|
|
@@ -8,8 +9,10 @@ type ParseErrorInstance = InstanceType<typeof ParseError>;
|
|
|
8
9
|
*
|
|
9
10
|
* @param propInfo - The resolved TypeScript prop information to convert.
|
|
10
11
|
* @param defaultValue - Optional default value for the data item.
|
|
12
|
+
* @param propUsages - The full stores.propUsages map for on-demand binding lookups.
|
|
13
|
+
* @param propPath - The full stores.propUsages key for this prop, e.g. "props.linkUrl".
|
|
11
14
|
* @returns `Ok<DataItem>` on success, `Err<ParseError>` if an invariant is violated
|
|
12
15
|
* (e.g. an array type missing its element type).
|
|
13
16
|
*/
|
|
14
|
-
export declare function buildDataItem(propInfo: PropInfo, defaultValue?: unknown): Result<DataItem, ParseErrorInstance>;
|
|
17
|
+
export declare function buildDataItem(propInfo: PropInfo, defaultValue?: unknown, propUsages?: TrackingStores['propUsages'], propPath?: string): Result<DataItem, ParseErrorInstance>;
|
|
15
18
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ResultAsync } from 'neverthrow';
|
|
2
2
|
import { EditorReactComponent } from './schema';
|
|
3
3
|
import { NotFoundError, ParseError } from './errors';
|
|
4
|
+
import { RunExtractorsOptions } from './information-extractors/react';
|
|
4
5
|
export type { ComponentInfoWithCss, ExtractedCssInfo, ExtractionWarning, ProcessComponentResult, } from './manifest-pipeline';
|
|
5
6
|
export type { EditorReactComponent } from './schema';
|
|
6
7
|
export interface ManifestResult {
|
|
7
8
|
component: EditorReactComponent;
|
|
8
9
|
errors: ExtractionError[];
|
|
9
10
|
}
|
|
11
|
+
export type { RunExtractorsOptions } from './information-extractors/react';
|
|
10
12
|
export interface ExtractionError {
|
|
11
13
|
componentName: string;
|
|
12
14
|
phase: 'render' | 'coupling' | 'css' | 'loader' | 'conversion';
|
|
@@ -22,7 +24,7 @@ export interface ExtractionError {
|
|
|
22
24
|
* - {@link NotFoundError} — Source file does not exist (phase: `compile`)
|
|
23
25
|
* - {@link ParseError} — TypeScript config or component types could not be parsed (phase: `compile` | `extract`)
|
|
24
26
|
*/
|
|
25
|
-
export declare function extractComponentManifest(componentPath: string, compiledEntryPath: string): ResultAsync<ManifestResult, InstanceType<typeof NotFoundError> | InstanceType<typeof ParseError>>;
|
|
27
|
+
export declare function extractComponentManifest(componentPath: string, compiledEntryPath: string, options?: RunExtractorsOptions): ResultAsync<ManifestResult, InstanceType<typeof NotFoundError> | InstanceType<typeof ParseError>>;
|
|
26
28
|
/** TypeScript compilation & static analysis */
|
|
27
29
|
export { compileTsFile } from './ts-compiler';
|
|
28
30
|
export { extractAllComponentInfo, extractDefaultComponentInfo } from './information-extractors/ts/components';
|
|
@@ -30,8 +32,8 @@ export { extractCssImports } from './information-extractors/ts/css-imports';
|
|
|
30
32
|
export type { ComponentInfo, PropInfo, ResolvedType, ResolvedKind, DefaultValue, } from './information-extractors/ts/types';
|
|
31
33
|
/** React render-time extraction */
|
|
32
34
|
export { runExtractors, ExtractorStore, buildElementTree, createPropTrackerExtractor, createCssPropertiesExtractor, } from './information-extractors/react';
|
|
33
|
-
export type { ExtractionResult, ReactExtractor, RenderContext, CreateElementEvent, RenderCompleteEvent, ExtractedElement, PropTrackerData, PropTrackerExtractorState, CssPropertiesData,
|
|
34
|
-
export type { CoupledComponentInfo, CoupledProp, DOMBinding, TrackingStores,
|
|
35
|
+
export type { ExtractionResult, ReactExtractor, RenderContext, CreateElementEvent, RenderCompleteEvent, ExtractedElement, PropTrackerData, PropTrackerExtractorState, CssPropertiesData, } from './information-extractors/react';
|
|
36
|
+
export type { CoupledComponentInfo, CoupledProp, DOMBinding, TrackingStores, PropWriteInfo, PropSpyMeta, } from './information-extractors/react';
|
|
35
37
|
/** CSS parsing & selector matching */
|
|
36
38
|
export { parseCss } from './information-extractors/css';
|
|
37
39
|
export type { CSSParserAPI } from './information-extractors/css';
|