@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.
Files changed (42) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +2742 -45
  3. package/dist/index.js +22598 -14991
  4. package/dist/jsx-runtime-interceptor.d.ts +58 -42
  5. package/dist/jsx-runtime-loader.d.ts +27 -23
  6. package/package.json +4 -3
  7. package/src/index.ts +4 -0
  8. package/src/information-extractors/css/parse.ts +113 -437
  9. package/vite.config.ts +14 -2
  10. package/dist/component-renderer.d.ts +0 -31
  11. package/dist/converters/data-item-builder.d.ts +0 -18
  12. package/dist/converters/index.d.ts +0 -1
  13. package/dist/converters/to-editor-component.d.ts +0 -3
  14. package/dist/converters/utils.d.ts +0 -20
  15. package/dist/errors.d.ts +0 -230
  16. package/dist/extraction-types.d.ts +0 -7
  17. package/dist/information-extractors/css/index.d.ts +0 -3
  18. package/dist/information-extractors/css/parse.d.ts +0 -7
  19. package/dist/information-extractors/css/sass-adapter.d.ts +0 -2
  20. package/dist/information-extractors/css/selector-matcher.d.ts +0 -6
  21. package/dist/information-extractors/css/types.d.ts +0 -61
  22. package/dist/information-extractors/react/extractors/core/index.d.ts +0 -6
  23. package/dist/information-extractors/react/extractors/core/runner.d.ts +0 -23
  24. package/dist/information-extractors/react/extractors/core/store.d.ts +0 -17
  25. package/dist/information-extractors/react/extractors/core/tree-builder.d.ts +0 -15
  26. package/dist/information-extractors/react/extractors/core/types.d.ts +0 -40
  27. package/dist/information-extractors/react/extractors/css-properties.d.ts +0 -20
  28. package/dist/information-extractors/react/extractors/index.d.ts +0 -11
  29. package/dist/information-extractors/react/extractors/prop-tracker.d.ts +0 -21
  30. package/dist/information-extractors/react/index.d.ts +0 -8
  31. package/dist/information-extractors/react/types.d.ts +0 -38
  32. package/dist/information-extractors/react/utils/mock-generator.d.ts +0 -21
  33. package/dist/information-extractors/ts/components.d.ts +0 -14
  34. package/dist/information-extractors/ts/css-imports.d.ts +0 -2
  35. package/dist/information-extractors/ts/index.d.ts +0 -3
  36. package/dist/information-extractors/ts/types.d.ts +0 -54
  37. package/dist/information-extractors/ts/utils/semantic-type-resolver.d.ts +0 -12
  38. package/dist/manifest-pipeline.d.ts +0 -29
  39. package/dist/module-loader.d.ts +0 -27
  40. package/dist/ts-compiler.d.ts +0 -13
  41. package/dist/utils/css-class.d.ts +0 -9
  42. package/dist/wix-type-to-data-type.d.ts +0 -6
@@ -1,42 +1,58 @@
1
- /**
2
- * Interceptable JSX Runtime
3
- *
4
- * This module wraps React's jsx-runtime and allows dynamic interception
5
- * of jsx/jsxs/jsxDEV calls. This is necessary because ESM imports are immutable,
6
- * so we can't monkey-patch react/jsx-runtime directly.
7
- *
8
- * ## Usage contexts
9
- *
10
- * This module runs in two contexts that must share mutable state:
11
- *
12
- * 1. **Vite alias (tests)** — aliased to `react/jsx-runtime` in vite.config.ts
13
- * 2. **Node.js ESM loader hook (CLI)** — redirected via `module.register()` in cli.ts
14
- *
15
- * In both cases the interceptor may be loaded as a separate module instance from
16
- * the copy bundled into the main dist files. To ensure `setJsxInterceptors()`
17
- * (called from component-renderer.ts) affects the `jsx`/`jsxs` that user
18
- * components call, mutable state lives on `globalThis` via `Symbol.for()`.
19
- */
20
- declare const originalRuntime: typeof import("react/jsx-runtime");
21
- declare const originalDevRuntime: typeof import("react/jsx-dev-runtime");
22
- export declare const Fragment: import('react').ExoticComponent<{
23
- children?: import('react').ReactNode | undefined;
24
- }>;
25
- type JsxDevFn = typeof originalDevRuntime.jsxDEV;
26
- /**
27
- * Sets custom jsx/jsxs/jsxDEV implementations for interception.
28
- * Call with no arguments to restore originals.
29
- */
30
- export declare function setJsxInterceptors(jsx?: typeof originalRuntime.jsx, jsxs?: typeof originalRuntime.jsxs, jsxDEV?: JsxDevFn): void;
31
- /**
32
- * Gets the original jsx/jsxs/jsxDEV functions.
33
- */
34
- export declare function getOriginals(): {
35
- jsx: typeof import('./jsx-runtime-interceptor.ts').jsx;
36
- jsxs: typeof import('./jsx-runtime-interceptor.ts').jsxs;
37
- jsxDEV: typeof import('./jsx-runtime-interceptor.ts').jsxDEV;
38
- };
39
- export declare function jsx(type: Parameters<typeof originalRuntime.jsx>[0], props: Parameters<typeof originalRuntime.jsx>[1], key?: Parameters<typeof originalRuntime.jsx>[2]): import('react').ReactElement<any, string | import('react').JSXElementConstructor<any>>;
40
- export declare function jsxs(type: Parameters<typeof originalRuntime.jsxs>[0], props: Parameters<typeof originalRuntime.jsxs>[1], key?: Parameters<typeof originalRuntime.jsxs>[2]): import('react').ReactElement<any, string | import('react').JSXElementConstructor<any>>;
41
- 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]): import('react').ReactElement<any, string | import('react').JSXElementConstructor<any>>;
42
- export {};
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
- * Node.js ESM Customization Hook
3
- *
4
- * Redirects ESM `import 'react/jsx-runtime'` and `import 'react/jsx-dev-runtime'`
5
- * to the interceptable jsx-runtime-interceptor module.
6
- *
7
- * Registered via `module.register()` in the CLI before loading user components.
8
- * This ensures that dynamically imported user components use the interceptable
9
- * jsx-runtime, enabling prop tracking and element tracing.
10
- *
11
- * CJS `require()` calls are not affected by this hook — the interceptor uses
12
- * `createRequire` internally, so it always loads the real React runtime.
13
- */
14
- interface ResolveResult {
15
- url: string;
16
- shortCircuit?: boolean;
17
- }
18
- interface ResolveContext {
19
- parentURL?: string;
20
- }
21
- type NextResolve = (specifier: string, context: ResolveContext) => Promise<ResolveResult>;
22
- export declare function resolve(specifier: string, context: ResolveContext, nextResolve: NextResolve): Promise<ResolveResult>;
23
- export {};
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.32.0",
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
- "lightningcss": "^1.31.1"
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": "459bf8c730865e0703e2a8248d887164542b0044ede2b6bcdae37271"
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'