@wix/cli-app 1.0.67 → 1.0.69
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 +139 -155
- package/build/index.js.map +1 -1
- package/client.d.ts +1 -0
- package/internal/hot-page.ts +41 -0
- package/package.json +13 -9
- package/tsconfig.app.json +2 -1
package/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* eslint-disable no-param-reassign */
|
|
2
|
+
/// <reference types="vite/client" />
|
|
3
|
+
import type { ComponentType } from 'react';
|
|
4
|
+
import { useState, useRef, useEffect } from 'react';
|
|
5
|
+
|
|
6
|
+
export function createHotPageWrapper(
|
|
7
|
+
OriginalPage: ComponentType<unknown>,
|
|
8
|
+
hotData: {
|
|
9
|
+
page?: ComponentType<unknown>;
|
|
10
|
+
setPage?: (NewPage: ComponentType<unknown>) => void;
|
|
11
|
+
}
|
|
12
|
+
) {
|
|
13
|
+
const Wrapper = import.meta.hot
|
|
14
|
+
? () => {
|
|
15
|
+
const [WrappedPage, setPage] = useState<ComponentType<unknown>>(
|
|
16
|
+
hotData.page ?? OriginalPage
|
|
17
|
+
);
|
|
18
|
+
const isMountedRef = useRef(false);
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
hotData.setPage = (NewPage) => {
|
|
22
|
+
hotData.page = NewPage;
|
|
23
|
+
if (isMountedRef.current) {
|
|
24
|
+
setPage(NewPage);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}, [setPage]);
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
isMountedRef.current = true;
|
|
31
|
+
|
|
32
|
+
return () => {
|
|
33
|
+
isMountedRef.current = false;
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
return WrappedPage;
|
|
37
|
+
}
|
|
38
|
+
: OriginalPage;
|
|
39
|
+
|
|
40
|
+
return Wrapper;
|
|
41
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/cli-app",
|
|
3
3
|
"description": "CLI tool for Wix apps",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.69",
|
|
5
5
|
"author": "Amit Dahan",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@vitejs/plugin-react-swc": "3.
|
|
8
|
-
"vite": "4.
|
|
7
|
+
"@vitejs/plugin-react-swc": "3.3.0",
|
|
8
|
+
"vite": "4.3.4"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@rollup/plugin-virtual": "^3.0.1",
|
|
12
12
|
"@types/verror": "^1.10.6",
|
|
13
13
|
"@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.
|
|
17
|
-
"@wix/
|
|
14
|
+
"@wix/ambassador-ctp-app-cloud-deployer-service-v1-app-cloud-deployer": "^1.0.10",
|
|
15
|
+
"@wix/ambassador-ctp-gradual-rollout-v1-app-config": "^1.0.29",
|
|
16
|
+
"@wix/ambassador-devcenter-components-v1-component": "^1.0.227",
|
|
17
|
+
"@wix/arm-client": "0.0.0",
|
|
18
|
+
"@wix/bi-logger-wix-cli": "^1.12.0",
|
|
18
19
|
"@wix/cli-app-definitions": "0.0.0",
|
|
19
20
|
"@wix/cli-app-manifest": "1.0.0",
|
|
20
21
|
"@wix/cli-auth": "0.0.0",
|
|
@@ -55,13 +56,16 @@
|
|
|
55
56
|
"./client": {
|
|
56
57
|
"types": "./client.d.ts"
|
|
57
58
|
},
|
|
59
|
+
"./internal/hot-page": "./internal/hot-page.ts",
|
|
58
60
|
"./tsconfig.app.json": "./tsconfig.app.json",
|
|
59
61
|
"./package.json": "./package.json"
|
|
60
62
|
},
|
|
61
63
|
"files": [
|
|
62
64
|
"build",
|
|
63
65
|
"!build/**/*.d.ts",
|
|
64
|
-
"tsconfig.app.json"
|
|
66
|
+
"tsconfig.app.json",
|
|
67
|
+
"client.d.ts",
|
|
68
|
+
"internal"
|
|
65
69
|
],
|
|
66
70
|
"peerDependencies": {
|
|
67
71
|
"react": "^16.14 || ^17 || ^18",
|
|
@@ -104,5 +108,5 @@
|
|
|
104
108
|
]
|
|
105
109
|
}
|
|
106
110
|
},
|
|
107
|
-
"falconPackageHash": "
|
|
111
|
+
"falconPackageHash": "e7446e68106dbaa351d2cfac33daf9d22a0a0d661ef6b690e17fdba6"
|
|
108
112
|
}
|