@codemoreira/esad 1.4.6-30 → 1.4.6-31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemoreira/esad",
3
- "version": "1.4.6-30",
3
+ "version": "1.4.6-31",
4
4
  "description": "Easy Super App Development - Zero-Config CLI and DevTools for React Native Module Federation",
5
5
  "main": "src/plugin/index.js",
6
6
  "types": "./src/plugin/index.d.ts",
@@ -86,7 +86,8 @@ module.exports = async (subcommand) => {
86
86
  if (shouldStartBundler && choice !== 'c') {
87
87
  console.log(`\nšŸ› ļø Starting Rspack Bundler in a new window...`);
88
88
  if (process.platform === 'win32') {
89
- spawn('cmd', ['/c', 'start', '/D', cwd, 'npx', 'react-native', 'webpack-start'], {
89
+ const npxCmd = 'npx.cmd';
90
+ spawn('cmd', ['/c', 'start', '/D', cwd, npxCmd, 'react-native', 'webpack-start'], {
90
91
  detached: true,
91
92
  stdio: 'ignore',
92
93
  shell: true
@@ -9,9 +9,17 @@ const { spawn } = require('cross-spawn');
9
9
  */
10
10
  const runProcess = (cmd, args, cwd = process.cwd()) => {
11
11
  return new Promise((resolve, reject) => {
12
- const child = spawn(cmd, args, { stdio: 'inherit', cwd, shell: true });
12
+ // On Windows, npx must be executed as npx.cmd
13
+ const command = process.platform === 'win32' && cmd === 'npx' ? 'npx.cmd' : cmd;
14
+
15
+ const child = spawn(command, args, { stdio: 'inherit', cwd, shell: true });
16
+
17
+ child.on('error', err => {
18
+ reject(new Error(`Failed to spawn command ${command}: ${err.message}`));
19
+ });
20
+
13
21
  child.on('close', code => {
14
- if (code !== 0) reject(new Error(`Command ${cmd} ${args.join(' ')} failed`));
22
+ if (code !== 0) reject(new Error(`Command ${command} ${args.join(' ')} failed with exit code ${code}`));
15
23
  else resolve();
16
24
  });
17
25
  });