@roots/bud-client 2023.8.17-169 → 2023.8.24-2254
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/lib/hot/client.js +4 -1
- package/package.json +4 -4
- package/src/hot/client.ts +5 -1
- package/src/types/index.d.ts +5 -4
package/lib/hot/client.js
CHANGED
|
@@ -29,6 +29,9 @@ export const client = async (queryString, webpackHot) => {
|
|
|
29
29
|
current: {},
|
|
30
30
|
hmr: {},
|
|
31
31
|
listeners: {},
|
|
32
|
+
reload: () => {
|
|
33
|
+
window.location.reload();
|
|
34
|
+
},
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
if (!window.bud.current[options.name]) {
|
|
@@ -102,7 +105,7 @@ export const client = async (queryString, webpackHot) => {
|
|
|
102
105
|
if (!payload)
|
|
103
106
|
return;
|
|
104
107
|
if (options.reload && payload.action === `reload`)
|
|
105
|
-
return window.
|
|
108
|
+
return window.bud.reload();
|
|
106
109
|
if (payload.name !== options.name)
|
|
107
110
|
return;
|
|
108
111
|
window.bud.controllers.map(controller => controller?.update(payload));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roots/bud-client",
|
|
3
|
-
"version": "2023.8.
|
|
3
|
+
"version": "2023.8.24-2254",
|
|
4
4
|
"description": "Client scripts for @roots/bud",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16"
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
"types": "./lib/index.d.ts",
|
|
70
70
|
"module": "./lib/index.mjs",
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@roots/bud": "2023.8.
|
|
72
|
+
"@roots/bud": "2023.8.24-2254",
|
|
73
73
|
"@skypack/package-check": "0.2.2",
|
|
74
|
-
"@types/node": "18.17.
|
|
74
|
+
"@types/node": "18.17.9",
|
|
75
75
|
"@types/webpack-env": "1.18.1"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"tslib": "2.6.
|
|
78
|
+
"tslib": "2.6.2"
|
|
79
79
|
},
|
|
80
80
|
"volta": {
|
|
81
81
|
"extends": "../../../package.json"
|
package/src/hot/client.ts
CHANGED
|
@@ -21,6 +21,7 @@ export const client = async (
|
|
|
21
21
|
)
|
|
22
22
|
return false
|
|
23
23
|
}
|
|
24
|
+
|
|
24
25
|
/* Guard: webpackHot api availability */
|
|
25
26
|
if (!webpackHot) {
|
|
26
27
|
console.error(
|
|
@@ -40,6 +41,9 @@ export const client = async (
|
|
|
40
41
|
current: {},
|
|
41
42
|
hmr: {},
|
|
42
43
|
listeners: {},
|
|
44
|
+
reload: () => {
|
|
45
|
+
window.location.reload()
|
|
46
|
+
},
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
|
|
@@ -124,7 +128,7 @@ export const client = async (
|
|
|
124
128
|
if (!payload) return
|
|
125
129
|
|
|
126
130
|
if (options.reload && payload.action === `reload`)
|
|
127
|
-
return window.
|
|
131
|
+
return window.bud.reload()
|
|
128
132
|
|
|
129
133
|
if (payload.name !== options.name) return
|
|
130
134
|
window.bud.controllers.map(controller => controller?.update(payload))
|
package/src/types/index.d.ts
CHANGED
|
@@ -41,10 +41,11 @@ declare interface Options {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
declare var bud: {
|
|
44
|
-
current
|
|
45
|
-
controllers
|
|
46
|
-
hmr
|
|
47
|
-
listeners
|
|
44
|
+
current: Record<string, string>
|
|
45
|
+
controllers: Array<Controller>
|
|
46
|
+
hmr: Record<string, Events & EventSource>
|
|
47
|
+
listeners: Record<string, Listener>
|
|
48
|
+
reload: () => void
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
declare module global {
|