@wix/zero-config-implementation 1.63.0 → 1.64.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/index-BFldpPCN.js +96 -0
- package/dist/index-BGHyk7CU.js +708 -0
- package/dist/index-CVwvuJQW.js +98629 -0
- package/dist/index.js +30 -77871
- package/package.json +3 -2
- package/src/index.ts +14 -2
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.64.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",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"@wix/builder-services-wrapper": "^1.42.0",
|
|
42
43
|
"@wix/react-component-schema": "1.6.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
@@ -80,5 +81,5 @@
|
|
|
80
81
|
]
|
|
81
82
|
}
|
|
82
83
|
},
|
|
83
|
-
"falconPackageHash": "
|
|
84
|
+
"falconPackageHash": "7a686c953d35285ef8246e7de2f6deefabd15fa341615b1e38ff1f27"
|
|
84
85
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { WixServicesWrapper } from '@wix/builder-services-wrapper'
|
|
1
2
|
import type { EditorReactComponent } from '@wix/react-component-schema'
|
|
2
3
|
import { Result, type ResultAsync, errAsync, okAsync } from 'neverthrow'
|
|
3
|
-
import
|
|
4
|
+
import React, { type ComponentType } from 'react'
|
|
4
5
|
|
|
5
6
|
import { toEditorReactComponent } from './converters'
|
|
6
7
|
import { IoError, type NotFoundError, ParseError } from './errors'
|
|
@@ -12,6 +13,12 @@ import { findComponent, findDefaultComponent, loadModule } from './module-loader
|
|
|
12
13
|
import type { LoadModuleFailure } from './module-loader'
|
|
13
14
|
import { compileTsFile } from './ts-compiler'
|
|
14
15
|
|
|
16
|
+
const defaultWrapper = (Component: ComponentType<unknown>): ComponentType<unknown> => {
|
|
17
|
+
const WrappedComponent: ComponentType<unknown> = (props) =>
|
|
18
|
+
React.createElement(WixServicesWrapper, null, React.createElement(Component, props as Record<string, unknown>))
|
|
19
|
+
return WrappedComponent
|
|
20
|
+
}
|
|
21
|
+
|
|
15
22
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
16
23
|
// Types
|
|
17
24
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -54,6 +61,11 @@ export function extractComponentManifestResult(
|
|
|
54
61
|
options?.onError?.(error)
|
|
55
62
|
}
|
|
56
63
|
|
|
64
|
+
const optionsWithDefaults: ExtractComponentManifestOptions = {
|
|
65
|
+
...options,
|
|
66
|
+
wrapper: options?.wrapper ?? defaultWrapper,
|
|
67
|
+
}
|
|
68
|
+
|
|
57
69
|
// Step 1: Compile TypeScript (fatal)
|
|
58
70
|
return compileTsFile(componentPath)
|
|
59
71
|
.andThen((program) => {
|
|
@@ -125,7 +137,7 @@ export function extractComponentManifestResult(
|
|
|
125
137
|
cssImportPaths,
|
|
126
138
|
!!failure,
|
|
127
139
|
report,
|
|
128
|
-
|
|
140
|
+
optionsWithDefaults,
|
|
129
141
|
compiledEntryPath,
|
|
130
142
|
)
|
|
131
143
|
if (!processResult.ok) {
|