@joystick.js/cli-canary 0.0.0-canary.140 → 0.0.0-canary.142
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/lib/dev/index.js +5 -3
- package/package.json +1 -1
- package/src/lib/dev/index.js +8 -3
package/dist/lib/dev/index.js
CHANGED
|
@@ -262,6 +262,8 @@ const handleRestartApplicationProcess = async (options = {}) => {
|
|
|
262
262
|
port: options?.port,
|
|
263
263
|
sessionsBeforeHMRUpdate: options?.sessionsBeforeHMRUpdate
|
|
264
264
|
});
|
|
265
|
+
handleServerProcessSTDIO();
|
|
266
|
+
handleServerProcessMessages();
|
|
265
267
|
return Promise.resolve();
|
|
266
268
|
}
|
|
267
269
|
process.loader.text("Starting app...");
|
|
@@ -273,14 +275,14 @@ const handleRestartApplicationProcess = async (options = {}) => {
|
|
|
273
275
|
throw new Error(`[dev.handleRestartApplicationProcess] ${exception.message}`);
|
|
274
276
|
}
|
|
275
277
|
};
|
|
276
|
-
const handleNotifyHMRClients = (indexHTMLChanged = false) => {
|
|
278
|
+
const handleNotifyHMRClients = async (indexHTMLChanged = false) => {
|
|
277
279
|
try {
|
|
278
280
|
if (process.hmrProcess) {
|
|
279
|
-
const settings = loadSettings(process.env.NODE_ENV);
|
|
281
|
+
const settings = await loadSettings(process.env.NODE_ENV);
|
|
280
282
|
process.hmrProcess.send(
|
|
281
283
|
JSON.stringify({
|
|
282
284
|
type: "RESTART_SERVER",
|
|
283
|
-
settings,
|
|
285
|
+
settings: settings.parsed,
|
|
284
286
|
indexHTMLChanged
|
|
285
287
|
})
|
|
286
288
|
);
|
package/package.json
CHANGED
package/src/lib/dev/index.js
CHANGED
|
@@ -319,6 +319,11 @@ const handleRestartApplicationProcess = async (options = {}) => {
|
|
|
319
319
|
sessionsBeforeHMRUpdate: options?.sessionsBeforeHMRUpdate,
|
|
320
320
|
});
|
|
321
321
|
|
|
322
|
+
// NOTE: Reattach process event handlers here because the ones down below
|
|
323
|
+
// are stale after a restart.
|
|
324
|
+
handleServerProcessSTDIO();
|
|
325
|
+
handleServerProcessMessages();
|
|
326
|
+
|
|
322
327
|
return Promise.resolve();
|
|
323
328
|
}
|
|
324
329
|
|
|
@@ -334,14 +339,14 @@ const handleRestartApplicationProcess = async (options = {}) => {
|
|
|
334
339
|
}
|
|
335
340
|
};
|
|
336
341
|
|
|
337
|
-
const handleNotifyHMRClients = (indexHTMLChanged = false) => {
|
|
342
|
+
const handleNotifyHMRClients = async (indexHTMLChanged = false) => {
|
|
338
343
|
try {
|
|
339
344
|
if (process.hmrProcess) {
|
|
340
|
-
const settings = loadSettings(process.env.NODE_ENV);
|
|
345
|
+
const settings = await loadSettings(process.env.NODE_ENV);
|
|
341
346
|
process.hmrProcess.send(
|
|
342
347
|
JSON.stringify({
|
|
343
348
|
type: "RESTART_SERVER",
|
|
344
|
-
settings,
|
|
349
|
+
settings: settings.parsed,
|
|
345
350
|
indexHTMLChanged,
|
|
346
351
|
})
|
|
347
352
|
);
|