@joystick.js/cli-canary 0.0.0-canary.62 → 0.0.0-canary.64

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.
@@ -429,7 +429,8 @@ const dev = async (options, { resolve, reject }) => {
429
429
  let hmrProcess;
430
430
  if (options?.environment !== "test") {
431
431
  hmrProcess = await startHMR({
432
- nodeMajorVersion
432
+ nodeMajorVersion,
433
+ __dirname
433
434
  });
434
435
  }
435
436
  handleSignalEvents(
@@ -17,7 +17,7 @@ const handleStartServerProcess = (execArgv = {}, sessionsBeforeHMRUpdate = {}) =
17
17
  ROOT_URL: process.env.ROOT_URL,
18
18
  PORT: process.env.PORT,
19
19
  JOYSTICK_SETTINGS: process.env.JOYSTICK_SETTINGS,
20
- HMR_SESSIONS: sessionsBeforeHMRUpdate
20
+ HMR_SESSIONS: JSON.stringify(sessionsBeforeHMRUpdate)
21
21
  }
22
22
  }
23
23
  );
@@ -1,6 +1,6 @@
1
1
  import child_process from "child_process";
2
2
  import path from "path";
3
- const handleStartHMRProcess = (execArgv = {}) => {
3
+ const handleStartHMRProcess = (execArgv = {}, __dirname = "") => {
4
4
  try {
5
5
  return child_process.fork(
6
6
  path.resolve(`${__dirname}/hmrServer.js`),
@@ -41,7 +41,7 @@ const startHMR = (options, { resolve, reject }) => {
41
41
  try {
42
42
  validateOptions(options);
43
43
  const execArgv = getExecArgs(options?.nodeMajorVersion);
44
- const hmrProcess = handleStartHMRProcess(execArgv);
44
+ const hmrProcess = handleStartHMRProcess(execArgv, options?.__dirname);
45
45
  return resolve(hmrProcess);
46
46
  } catch (exception) {
47
47
  reject(`[startHMR] ${exception.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joystick.js/cli-canary",
3
- "version": "0.0.0-canary.62",
3
+ "version": "0.0.0-canary.64",
4
4
  "type": "module",
5
5
  "description": "CLI for the Joystick JavaScript framework.",
6
6
  "main": "development.js",
@@ -516,6 +516,7 @@ const dev = async (options, { resolve, reject }) => {
516
516
  if (options?.environment !== 'test') {
517
517
  hmrProcess = await startHMR({
518
518
  nodeMajorVersion,
519
+ __dirname,
519
520
  });
520
521
  }
521
522
 
@@ -18,7 +18,7 @@ const handleStartServerProcess = (execArgv = {}, sessionsBeforeHMRUpdate = {}) =
18
18
  ROOT_URL: process.env.ROOT_URL,
19
19
  PORT: process.env.PORT,
20
20
  JOYSTICK_SETTINGS: process.env.JOYSTICK_SETTINGS,
21
- HMR_SESSIONS: sessionsBeforeHMRUpdate,
21
+ HMR_SESSIONS: JSON.stringify(sessionsBeforeHMRUpdate),
22
22
  },
23
23
  }
24
24
  );
@@ -1,7 +1,7 @@
1
1
  import child_process from "child_process";
2
2
  import path from "path";
3
3
 
4
- const handleStartHMRProcess = (execArgv = {}) => {
4
+ const handleStartHMRProcess = (execArgv = {}, __dirname = '') => {
5
5
  try {
6
6
  // NOTE: Port is automatically pulled via process.env.PORT
7
7
  // in the hmrServer.js script.
@@ -48,7 +48,7 @@ const startHMR = (options, { resolve, reject }) => {
48
48
  validateOptions(options);
49
49
 
50
50
  const execArgv = getExecArgs(options?.nodeMajorVersion);
51
- const hmrProcess = handleStartHMRProcess(execArgv);
51
+ const hmrProcess = handleStartHMRProcess(execArgv, options?.__dirname);
52
52
 
53
53
  return resolve(hmrProcess);
54
54
  } catch (exception) {