@wix/zero-config-implementation 1.32.0 → 1.34.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/README.md +1 -1
- package/dist/index.d.ts +2742 -45
- package/dist/index.js +22598 -14991
- package/dist/jsx-runtime-interceptor.d.ts +58 -42
- package/dist/jsx-runtime-loader.d.ts +27 -23
- package/package.json +4 -3
- package/src/index.ts +4 -0
- package/src/information-extractors/css/parse.ts +113 -437
- package/vite.config.ts +14 -2
- package/dist/component-renderer.d.ts +0 -31
- package/dist/converters/data-item-builder.d.ts +0 -18
- package/dist/converters/index.d.ts +0 -1
- package/dist/converters/to-editor-component.d.ts +0 -3
- package/dist/converters/utils.d.ts +0 -20
- package/dist/errors.d.ts +0 -230
- package/dist/extraction-types.d.ts +0 -7
- package/dist/information-extractors/css/index.d.ts +0 -3
- package/dist/information-extractors/css/parse.d.ts +0 -7
- package/dist/information-extractors/css/sass-adapter.d.ts +0 -2
- package/dist/information-extractors/css/selector-matcher.d.ts +0 -6
- package/dist/information-extractors/css/types.d.ts +0 -61
- package/dist/information-extractors/react/extractors/core/index.d.ts +0 -6
- package/dist/information-extractors/react/extractors/core/runner.d.ts +0 -23
- package/dist/information-extractors/react/extractors/core/store.d.ts +0 -17
- package/dist/information-extractors/react/extractors/core/tree-builder.d.ts +0 -15
- package/dist/information-extractors/react/extractors/core/types.d.ts +0 -40
- package/dist/information-extractors/react/extractors/css-properties.d.ts +0 -20
- package/dist/information-extractors/react/extractors/index.d.ts +0 -11
- package/dist/information-extractors/react/extractors/prop-tracker.d.ts +0 -21
- package/dist/information-extractors/react/index.d.ts +0 -8
- package/dist/information-extractors/react/types.d.ts +0 -38
- package/dist/information-extractors/react/utils/mock-generator.d.ts +0 -21
- package/dist/information-extractors/ts/components.d.ts +0 -14
- package/dist/information-extractors/ts/css-imports.d.ts +0 -2
- package/dist/information-extractors/ts/index.d.ts +0 -3
- package/dist/information-extractors/ts/types.d.ts +0 -54
- package/dist/information-extractors/ts/utils/semantic-type-resolver.d.ts +0 -12
- package/dist/manifest-pipeline.d.ts +0 -29
- package/dist/module-loader.d.ts +0 -27
- package/dist/ts-compiler.d.ts +0 -13
- package/dist/utils/css-class.d.ts +0 -9
- package/dist/wix-type-to-data-type.d.ts +0 -6
|
@@ -1,42 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
declare
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
type JsxDevFn = typeof originalDevRuntime.jsxDEV;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
import { ExoticComponent } from 'react';
|
|
2
|
+
import { JSXElementConstructor } from 'react';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
import { reactJsxDevRuntime } from 'react/jsx-dev-runtime';
|
|
5
|
+
import { reactJsxRuntime } from 'react/jsx-runtime';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
|
|
8
|
+
export declare const Fragment: ExoticComponent< {
|
|
9
|
+
children?: ReactNode | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Gets the original jsx/jsxs/jsxDEV functions.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getOriginals(): {
|
|
16
|
+
jsx: jsx;
|
|
17
|
+
jsxs: jsxs;
|
|
18
|
+
jsxDEV: jsxDEV;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export declare function jsx(type: Parameters<typeof originalRuntime.jsx>[0], props: Parameters<typeof originalRuntime.jsx>[1], key?: Parameters<typeof originalRuntime.jsx>[2]): ReactElement<any, string | JSXElementConstructor<any>>;
|
|
22
|
+
|
|
23
|
+
export declare function jsxDEV(type: Parameters<JsxDevFn>[0], props: Parameters<JsxDevFn>[1], key: Parameters<JsxDevFn>[2], isStaticChildren: Parameters<JsxDevFn>[3], source: Parameters<JsxDevFn>[4], self: Parameters<JsxDevFn>[5]): ReactElement<any, string | JSXElementConstructor<any>>;
|
|
24
|
+
|
|
25
|
+
declare type JsxDevFn = typeof originalDevRuntime.jsxDEV;
|
|
26
|
+
|
|
27
|
+
export declare function jsxs(type: Parameters<typeof originalRuntime.jsxs>[0], props: Parameters<typeof originalRuntime.jsxs>[1], key?: Parameters<typeof originalRuntime.jsxs>[2]): ReactElement<any, string | JSXElementConstructor<any>>;
|
|
28
|
+
|
|
29
|
+
declare const originalDevRuntime: reactJsxDevRuntime;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Interceptable JSX Runtime
|
|
33
|
+
*
|
|
34
|
+
* This module wraps React's jsx-runtime and allows dynamic interception
|
|
35
|
+
* of jsx/jsxs/jsxDEV calls. This is necessary because ESM imports are immutable,
|
|
36
|
+
* so we can't monkey-patch react/jsx-runtime directly.
|
|
37
|
+
*
|
|
38
|
+
* ## Usage contexts
|
|
39
|
+
*
|
|
40
|
+
* This module runs in two contexts that must share mutable state:
|
|
41
|
+
*
|
|
42
|
+
* 1. **Vite alias (tests)** — aliased to `react/jsx-runtime` in vite.config.ts
|
|
43
|
+
* 2. **Node.js ESM loader hook (CLI)** — redirected via `module.register()` in cli.ts
|
|
44
|
+
*
|
|
45
|
+
* In both cases the interceptor may be loaded as a separate module instance from
|
|
46
|
+
* the copy bundled into the main dist files. To ensure `setJsxInterceptors()`
|
|
47
|
+
* (called from component-renderer.ts) affects the `jsx`/`jsxs` that user
|
|
48
|
+
* components call, mutable state lives on `globalThis` via `Symbol.for()`.
|
|
49
|
+
*/
|
|
50
|
+
declare const originalRuntime: reactJsxRuntime;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Sets custom jsx/jsxs/jsxDEV implementations for interception.
|
|
54
|
+
* Call with no arguments to restore originals.
|
|
55
|
+
*/
|
|
56
|
+
export declare function setJsxInterceptors(jsx?: typeof originalRuntime.jsx, jsxs?: typeof originalRuntime.jsxs, jsxDEV?: JsxDevFn): void;
|
|
57
|
+
|
|
58
|
+
export { }
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
declare type NextResolve = (specifier: string, context: ResolveContext) => Promise<ResolveResult>;
|
|
2
|
+
|
|
3
|
+
export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
|
|
4
|
+
|
|
5
|
+
declare interface ResolveContext {
|
|
6
|
+
parentURL?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Node.js ESM Customization Hook
|
|
11
|
+
*
|
|
12
|
+
* Redirects ESM `import 'react/jsx-runtime'` and `import 'react/jsx-dev-runtime'`
|
|
13
|
+
* to the interceptable jsx-runtime-interceptor module.
|
|
14
|
+
*
|
|
15
|
+
* Registered via `module.register()` in the CLI before loading user components.
|
|
16
|
+
* This ensures that dynamically imported user components use the interceptable
|
|
17
|
+
* jsx-runtime, enabling prop tracking and element tracing.
|
|
18
|
+
*
|
|
19
|
+
* CJS `require()` calls are not affected by this hook — the interceptor uses
|
|
20
|
+
* `createRequire` internally, so it always loads the real React runtime.
|
|
21
|
+
*/
|
|
22
|
+
declare interface ResolveResult {
|
|
23
|
+
url: string;
|
|
24
|
+
shortCircuit?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { }
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"registry": "https://registry.npmjs.org/",
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.34.0",
|
|
8
8
|
"description": "Core library for extracting component manifests from JS and CSS files",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "dist/index.js",
|
|
@@ -45,10 +45,11 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@wix/zero-config-schema": "1.1.0",
|
|
48
|
-
"
|
|
48
|
+
"css-tree": "^3.2.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@faker-js/faker": "^10.2.0",
|
|
52
|
+
"@types/css-tree": "^2.3.11",
|
|
52
53
|
"@types/node": "^20.0.0",
|
|
53
54
|
"@types/react": "^18.3.1",
|
|
54
55
|
"@types/react-dom": "^18.3.1",
|
|
@@ -83,5 +84,5 @@
|
|
|
83
84
|
]
|
|
84
85
|
}
|
|
85
86
|
},
|
|
86
|
-
"falconPackageHash": "
|
|
87
|
+
"falconPackageHash": "69e79e3ace0456830f1097c17e57559c472de0256f58846b1ef3e031"
|
|
87
88
|
}
|
package/src/index.ts
CHANGED
|
@@ -214,6 +214,10 @@ export {
|
|
|
214
214
|
export { loadModule, findComponent } from './module-loader'
|
|
215
215
|
export type { LoadModuleFailure } from './module-loader'
|
|
216
216
|
|
|
217
|
+
/** neverthrow re-exports — consumers must use these instead of importing neverthrow directly */
|
|
218
|
+
export { Result, ResultAsync, ok, err, okAsync, errAsync } from 'neverthrow'
|
|
219
|
+
export type { Ok, Err } from 'neverthrow'
|
|
220
|
+
|
|
217
221
|
// ── Tier 3: Low-Level Renderer ──────────────────────────────────────────────
|
|
218
222
|
|
|
219
223
|
export { renderWithExtractors } from './component-renderer'
|