@wix/zero-config-implementation 1.25.0 → 1.27.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/extraction-types.d.ts +7 -0
- package/dist/index.d.ts +12 -13
- package/dist/index.js +8159 -8139
- package/dist/information-extractors/css/types.d.ts +2 -0
- package/dist/manifest-pipeline.d.ts +3 -9
- package/dist/module-loader.d.ts +12 -5
- package/package.json +2 -2
- package/src/extraction-types.ts +8 -0
- package/src/index.ts +83 -101
- package/src/information-extractors/css/parse.ts +3 -2
- package/src/information-extractors/css/selector-matcher.ts +46 -21
- package/src/information-extractors/css/types.ts +2 -0
- package/src/manifest-pipeline.ts +53 -46
- package/src/module-loader.ts +24 -19
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseError } from './errors';
|
|
2
|
+
/** A non-fatal issue encountered during component extraction. */
|
|
3
|
+
export interface ExtractionError {
|
|
4
|
+
componentName: string;
|
|
5
|
+
phase: 'render' | 'coupling' | 'css' | 'loader' | 'conversion';
|
|
6
|
+
error: InstanceType<typeof BaseError>;
|
|
7
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
import { EditorReactComponent } from '@wix/zero-config-schema';
|
|
2
2
|
import { ResultAsync } from 'neverthrow';
|
|
3
3
|
import { NotFoundError, ParseError } from './errors';
|
|
4
|
+
import { ExtractionError } from './extraction-types';
|
|
4
5
|
import { RunExtractorsOptions } from './information-extractors/react';
|
|
5
|
-
export type { ComponentInfoWithCss, ExtractedCssInfo, ExtractionWarning, ProcessComponentResult, } from './manifest-pipeline';
|
|
6
|
-
export type { EditorReactComponent } from '@wix/zero-config-schema';
|
|
7
6
|
export interface ManifestResult {
|
|
8
7
|
component: EditorReactComponent;
|
|
9
8
|
errors: ExtractionError[];
|
|
10
9
|
}
|
|
11
|
-
export type { RunExtractorsOptions } from './information-extractors/react';
|
|
12
|
-
export interface ExtractionError {
|
|
13
|
-
componentName: string;
|
|
14
|
-
phase: 'render' | 'coupling' | 'css' | 'loader' | 'conversion';
|
|
15
|
-
error: string;
|
|
16
|
-
stack?: string;
|
|
17
|
-
}
|
|
18
10
|
/**
|
|
19
11
|
* Extract component manifest from a TypeScript source file.
|
|
20
12
|
*
|
|
21
13
|
* @param componentPath - Path to the TypeScript source file
|
|
22
14
|
* @param compiledEntryPath - Path to the built JS entry file of the component's package (e.g. dist/index.js)
|
|
23
|
-
* @
|
|
15
|
+
* @param options.onError - Called for each non-fatal extraction error as it occurs
|
|
24
16
|
* @errors
|
|
25
17
|
* - {@link NotFoundError} — Source file does not exist (phase: `compile`)
|
|
26
18
|
* - {@link ParseError} — TypeScript config or component types could not be parsed (phase: `compile` | `extract`)
|
|
27
19
|
*/
|
|
28
|
-
export
|
|
20
|
+
export interface ExtractComponentManifestOptions extends RunExtractorsOptions {
|
|
21
|
+
onError?: (error: ExtractionError) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function extractComponentManifest(componentPath: string, compiledEntryPath: string, options?: ExtractComponentManifestOptions): ResultAsync<ManifestResult, InstanceType<typeof NotFoundError> | InstanceType<typeof ParseError>>;
|
|
24
|
+
export type { ExtractionError } from './extraction-types';
|
|
25
|
+
export type { EditorReactComponent } from '@wix/zero-config-schema';
|
|
26
|
+
export type { ComponentInfoWithCss, ExtractedCssInfo, ProcessComponentResult } from './manifest-pipeline';
|
|
29
27
|
/** TypeScript compilation & static analysis */
|
|
30
28
|
export { compileTsFile } from './ts-compiler';
|
|
31
29
|
export { extractAllComponentInfo, extractDefaultComponentInfo } from './information-extractors/ts/components';
|
|
32
30
|
export { extractCssImports } from './information-extractors/ts/css-imports';
|
|
33
31
|
export type { ComponentInfo, PropInfo, ResolvedType, ResolvedKind, DefaultValue, } from './information-extractors/ts/types';
|
|
34
32
|
/** React render-time extraction */
|
|
33
|
+
export type { RunExtractorsOptions } from './information-extractors/react';
|
|
35
34
|
export { runExtractors, ExtractorStore, buildElementTree, createPropTrackerExtractor, createCssPropertiesExtractor, } from './information-extractors/react';
|
|
36
|
-
export type { ExtractionResult, ReactExtractor, RenderContext, CreateElementEvent, RenderCompleteEvent, ExtractedElement, PropTrackerData, PropTrackerExtractorState, CssPropertiesData, } from './information-extractors/react';
|
|
37
|
-
export type { CoupledComponentInfo, CoupledProp, DOMBinding, TrackingStores, PropWriteInfo, PropSpyMeta, } from './information-extractors/react';
|
|
35
|
+
export type { ExtractionResult, ReactExtractor, RenderContext, CreateElementEvent, RenderCompleteEvent, ExtractedElement, PropTrackerData, PropTrackerExtractorState, CssPropertiesData, CoupledComponentInfo, CoupledProp, DOMBinding, TrackingStores, PropWriteInfo, PropSpyMeta, } from './information-extractors/react';
|
|
38
36
|
/** CSS parsing & selector matching */
|
|
39
37
|
export { parseCss } from './information-extractors/css';
|
|
40
38
|
export type { CSSParserAPI } from './information-extractors/css';
|
|
@@ -42,5 +40,6 @@ export type { CSSParserAPI } from './information-extractors/css';
|
|
|
42
40
|
export { BaseError, NotFoundError, ParseError, ValidationError, IoError, DefectError, withDefectBoundary, } from './errors';
|
|
43
41
|
/** Module loader primitives */
|
|
44
42
|
export { loadModule, findComponent } from './module-loader';
|
|
43
|
+
export type { LoadModuleFailure } from './module-loader';
|
|
45
44
|
export { renderWithExtractors } from './component-renderer';
|
|
46
45
|
export type { CreateElementListener } from './component-renderer';
|