@wix/cli-app 1.0.73 → 1.0.75
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/build/index.js +141 -134
- package/build/index.js.map +1 -1
- package/internal/{hot-page.ts → hot-page.tsx} +13 -15
- package/package.json +14 -11
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
2
|
/// <reference types="vite/client" />
|
|
3
3
|
import type { ComponentType } from 'react';
|
|
4
|
-
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
5
5
|
|
|
6
|
-
export function createHotPageWrapper(
|
|
7
|
-
OriginalPage: ComponentType<
|
|
6
|
+
export function createHotPageWrapper<P extends Record<string, unknown>>(
|
|
7
|
+
OriginalPage: ComponentType<P>,
|
|
8
8
|
hotData: {
|
|
9
|
-
|
|
10
|
-
setPage?: (NewPage: ComponentType<
|
|
9
|
+
Page?: ComponentType<P>;
|
|
10
|
+
setPage?: (NewPage: ComponentType<P>) => void;
|
|
11
11
|
}
|
|
12
|
-
) {
|
|
13
|
-
|
|
14
|
-
? () => {
|
|
15
|
-
const [WrappedPage, setPage] = useState
|
|
16
|
-
hotData.
|
|
12
|
+
): ComponentType<P> {
|
|
13
|
+
return import.meta.hot
|
|
14
|
+
? (props) => {
|
|
15
|
+
const [WrappedPage, setPage] = useState(
|
|
16
|
+
() => hotData.Page ?? OriginalPage
|
|
17
17
|
);
|
|
18
18
|
const isMountedRef = useRef(false);
|
|
19
19
|
|
|
20
20
|
useEffect(() => {
|
|
21
21
|
hotData.setPage = (NewPage) => {
|
|
22
|
-
hotData.
|
|
22
|
+
hotData.Page = NewPage;
|
|
23
23
|
if (isMountedRef.current) {
|
|
24
|
-
setPage(NewPage);
|
|
24
|
+
setPage(() => NewPage);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
}, [setPage]);
|
|
@@ -33,9 +33,7 @@ export function createHotPageWrapper(
|
|
|
33
33
|
isMountedRef.current = false;
|
|
34
34
|
};
|
|
35
35
|
}, []);
|
|
36
|
-
return WrappedPage
|
|
36
|
+
return <WrappedPage {...props} />;
|
|
37
37
|
}
|
|
38
38
|
: OriginalPage;
|
|
39
|
-
|
|
40
|
-
return Wrapper;
|
|
41
39
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/cli-app",
|
|
3
3
|
"description": "CLI tool for Wix apps",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.75",
|
|
5
5
|
"author": "Amit Dahan",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@vitejs/plugin-react-swc": "3.3.1",
|
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@types/lodash": "^4.14.194",
|
|
12
|
-
"@types/verror": "^1.10.6",
|
|
13
12
|
"@vitejs/plugin-basic-ssl": "^1.0.1",
|
|
14
|
-
"@wix/ambassador-ctp-app-cloud-deployer-service-v1-app-cloud-deployer": "^1.0.
|
|
15
|
-
"@wix/ambassador-ctp-gradual-rollout-v1-app-config": "^1.0.
|
|
16
|
-
"@wix/ambassador-devcenter-components-v1-component": "^1.0.
|
|
13
|
+
"@wix/ambassador-ctp-app-cloud-deployer-service-v1-app-cloud-deployer": "^1.0.11",
|
|
14
|
+
"@wix/ambassador-ctp-gradual-rollout-v1-app-config": "^1.0.32",
|
|
15
|
+
"@wix/ambassador-devcenter-components-v1-component": "^1.0.244",
|
|
17
16
|
"@wix/arm-client": "0.0.0",
|
|
18
|
-
"@wix/bi-logger-wix-cli": "^1.
|
|
17
|
+
"@wix/bi-logger-wix-cli": "^1.16.0",
|
|
19
18
|
"@wix/cli-app-definitions": "0.0.0",
|
|
20
19
|
"@wix/cli-app-manifest": "1.0.0",
|
|
21
20
|
"@wix/cli-auth": "0.0.0",
|
|
22
21
|
"@wix/cli-core-definitions": "0.0.0",
|
|
22
|
+
"@wix/cli-debug-log": "0.0.0",
|
|
23
23
|
"@wix/cli-error-reporter": "0.0.0",
|
|
24
24
|
"@wix/cli-errors": "0.0.0",
|
|
25
25
|
"@wix/cli-fs": "0.0.0",
|
|
@@ -28,11 +28,13 @@
|
|
|
28
28
|
"@wix/cli-logger": "0.0.0",
|
|
29
29
|
"@wix/cli-site-selector": "0.0.0",
|
|
30
30
|
"@wix/cli-telemetry": "0.0.0",
|
|
31
|
+
"@wix/cli-telemetry-react": "0.0.0",
|
|
31
32
|
"@wix/cli-test-overrides": "0.0.0",
|
|
32
33
|
"@wix/cli-ui-kit": "0.0.0",
|
|
33
34
|
"@wix/dev-center-client": "0.0.0",
|
|
34
35
|
"@wix/site-list-client": "0.0.0",
|
|
35
36
|
"@wix/tsup-configs": "0.0.0",
|
|
37
|
+
"@wix/user-browser": "0.0.0",
|
|
36
38
|
"chalk": "^5.2.0",
|
|
37
39
|
"chokidar": "^3.5.3",
|
|
38
40
|
"fast-equals": "^5.0.1",
|
|
@@ -48,7 +50,6 @@
|
|
|
48
50
|
"terminal-link": "^3.0.0",
|
|
49
51
|
"typed-emitter": "^2.1.0",
|
|
50
52
|
"variant": "^3.0.0-dev.25",
|
|
51
|
-
"verror": "^1.10.1",
|
|
52
53
|
"vite-plugin-externals": "^0.6.2",
|
|
53
54
|
"zod": "^3.21.4"
|
|
54
55
|
},
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"./client": {
|
|
61
62
|
"types": "./client.d.ts"
|
|
62
63
|
},
|
|
63
|
-
"./internal/hot-page": "./internal/hot-page.
|
|
64
|
+
"./internal/hot-page": "./internal/hot-page.tsx",
|
|
64
65
|
"./tsconfig.app.json": "./tsconfig.app.json",
|
|
65
66
|
"./package.json": "./package.json"
|
|
66
67
|
},
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
"files": [
|
|
86
87
|
{
|
|
87
88
|
"glob": "./build/index.js",
|
|
88
|
-
"maxSize": "
|
|
89
|
+
"maxSize": "380kb"
|
|
89
90
|
}
|
|
90
91
|
]
|
|
91
92
|
}
|
|
@@ -97,6 +98,7 @@
|
|
|
97
98
|
"scripts": {
|
|
98
99
|
"build": "run -T tsup",
|
|
99
100
|
"build:watch": "run build --watch",
|
|
101
|
+
"lint": "run -T lint-package",
|
|
100
102
|
"test": "yarn workspace @wix/cli-app-spec run test",
|
|
101
103
|
"test:build": "yarn workspace @wix/cli-app-spec run test:build",
|
|
102
104
|
"typecheck": "run -T tsc --noEmit"
|
|
@@ -109,9 +111,10 @@
|
|
|
109
111
|
},
|
|
110
112
|
"validations": {
|
|
111
113
|
"postBuild": [
|
|
112
|
-
"typecheck"
|
|
114
|
+
"typecheck",
|
|
115
|
+
"lint"
|
|
113
116
|
]
|
|
114
117
|
}
|
|
115
118
|
},
|
|
116
|
-
"falconPackageHash": "
|
|
119
|
+
"falconPackageHash": "e93d3a047d2d378e87ce64fbd7dbb635e2737e5026cd0ff2594f1d69"
|
|
117
120
|
}
|