@joystick.js/cli-canary 0.0.0-canary.94 → 0.0.0-canary.96
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.
|
@@ -1,26 +1,4 @@
|
|
|
1
1
|
import dev from "../../lib/dev/index.js";
|
|
2
|
-
process.hmrProcess.on("message", (message) => {
|
|
3
|
-
const processMessages = [
|
|
4
|
-
"SERVER_CLOSED",
|
|
5
|
-
"HAS_HMR_CONNECTIONS",
|
|
6
|
-
"HAS_NO_HMR_CONNECTIONS",
|
|
7
|
-
"HMR_UPDATE_COMPLETED"
|
|
8
|
-
];
|
|
9
|
-
if (!processMessages.includes(message?.type)) {
|
|
10
|
-
process.loader.stable(message);
|
|
11
|
-
}
|
|
12
|
-
if (message?.type === "HAS_HMR_CONNECTIONS") {
|
|
13
|
-
process.hmrProcess.hasConnections = true;
|
|
14
|
-
}
|
|
15
|
-
if (message?.type === "HAS_NO_HMR_CONNECTIONS") {
|
|
16
|
-
process.hmrProcess.hasConnections = false;
|
|
17
|
-
}
|
|
18
|
-
if (message?.type === "HMR_UPDATE_COMPLETED") {
|
|
19
|
-
setTimeout(() => {
|
|
20
|
-
restartApplicationProcess(message?.sessions);
|
|
21
|
-
}, 500);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
2
|
const startHMRProcess = () => {
|
|
25
3
|
const execArgv = ["--no-warnings"];
|
|
26
4
|
if (majorVersion < 19) {
|
package/dist/lib/dev/index.js
CHANGED
|
@@ -110,6 +110,7 @@ const handleHMRProcessMessages = (options = {}) => {
|
|
|
110
110
|
const handleHMRProcessSTDIO = () => {
|
|
111
111
|
try {
|
|
112
112
|
if (process.hmrProcess) {
|
|
113
|
+
console.log(process.hmrProcess);
|
|
113
114
|
process.hmrProcess.on("error", (error) => {
|
|
114
115
|
CLILog(error.toString(), {
|
|
115
116
|
level: "danger",
|
|
@@ -501,6 +502,7 @@ const dev = async (options, { resolve, reject }) => {
|
|
|
501
502
|
nodeMajorVersion,
|
|
502
503
|
__dirname
|
|
503
504
|
});
|
|
505
|
+
console.log(hmrProcess);
|
|
504
506
|
processIds.push(hmrProcess.pid);
|
|
505
507
|
process.hmrProcess = hmrProcess;
|
|
506
508
|
handleHMRProcessSTDIO();
|
package/package.json
CHANGED
|
@@ -200,35 +200,35 @@ import dev from "../../lib/dev/index.js";
|
|
|
200
200
|
//};
|
|
201
201
|
//
|
|
202
202
|
//const handleHMRProcessMessages = () => {
|
|
203
|
-
process.hmrProcess.on("message", (message) => {
|
|
204
|
-
const processMessages = [
|
|
205
|
-
"SERVER_CLOSED",
|
|
206
|
-
"HAS_HMR_CONNECTIONS",
|
|
207
|
-
"HAS_NO_HMR_CONNECTIONS",
|
|
208
|
-
"HMR_UPDATE_COMPLETED",
|
|
209
|
-
];
|
|
210
|
-
|
|
211
|
-
if (!processMessages.includes(message?.type)) {
|
|
212
|
-
process.loader.stable(message);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (message?.type === "HAS_HMR_CONNECTIONS") {
|
|
216
|
-
process.hmrProcess.hasConnections = true;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (message?.type === "HAS_NO_HMR_CONNECTIONS") {
|
|
220
|
-
process.hmrProcess.hasConnections = false;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (message?.type === "HMR_UPDATE_COMPLETED") {
|
|
224
|
-
// NOTE: Do a setTimeout to ensure that server is still available while the HMR update completes.
|
|
225
|
-
// Necessary because some updates are instance, but others might mount a UI that needs a server
|
|
226
|
-
// available (e.g., runs API requests).
|
|
227
|
-
setTimeout(() => {
|
|
228
|
-
restartApplicationProcess(message?.sessions);
|
|
229
|
-
}, 500);
|
|
230
|
-
}
|
|
231
|
-
});
|
|
203
|
+
// process.hmrProcess.on("message", (message) => {
|
|
204
|
+
// const processMessages = [
|
|
205
|
+
// "SERVER_CLOSED",
|
|
206
|
+
// "HAS_HMR_CONNECTIONS",
|
|
207
|
+
// "HAS_NO_HMR_CONNECTIONS",
|
|
208
|
+
// "HMR_UPDATE_COMPLETED",
|
|
209
|
+
// ];
|
|
210
|
+
//
|
|
211
|
+
// if (!processMessages.includes(message?.type)) {
|
|
212
|
+
// process.loader.stable(message);
|
|
213
|
+
// }
|
|
214
|
+
//
|
|
215
|
+
// if (message?.type === "HAS_HMR_CONNECTIONS") {
|
|
216
|
+
// process.hmrProcess.hasConnections = true;
|
|
217
|
+
// }
|
|
218
|
+
//
|
|
219
|
+
// if (message?.type === "HAS_NO_HMR_CONNECTIONS") {
|
|
220
|
+
// process.hmrProcess.hasConnections = false;
|
|
221
|
+
// }
|
|
222
|
+
//
|
|
223
|
+
// if (message?.type === "HMR_UPDATE_COMPLETED") {
|
|
224
|
+
// // NOTE: Do a setTimeout to ensure that server is still available while the HMR update completes.
|
|
225
|
+
// // Necessary because some updates are instance, but others might mount a UI that needs a server
|
|
226
|
+
// // available (e.g., runs API requests).
|
|
227
|
+
// setTimeout(() => {
|
|
228
|
+
// restartApplicationProcess(message?.sessions);
|
|
229
|
+
// }, 500);
|
|
230
|
+
// }
|
|
231
|
+
// });
|
|
232
232
|
//};
|
|
233
233
|
//
|
|
234
234
|
//const handleHMRProcessSTDIO = () => {
|
package/src/lib/dev/index.js
CHANGED
|
@@ -133,6 +133,7 @@ const handleHMRProcessMessages = (options = {}) => {
|
|
|
133
133
|
const handleHMRProcessSTDIO = () => {
|
|
134
134
|
try {
|
|
135
135
|
if (process.hmrProcess) {
|
|
136
|
+
console.log(process.hmrProcess);
|
|
136
137
|
process.hmrProcess.on("error", (error) => {
|
|
137
138
|
CLILog(error.toString(), {
|
|
138
139
|
level: "danger",
|
|
@@ -600,6 +601,8 @@ const dev = async (options, { resolve, reject }) => {
|
|
|
600
601
|
__dirname,
|
|
601
602
|
});
|
|
602
603
|
|
|
604
|
+
console.log(hmrProcess);
|
|
605
|
+
|
|
603
606
|
processIds.push(hmrProcess.pid);
|
|
604
607
|
process.hmrProcess = hmrProcess;
|
|
605
608
|
|