@codemoreira/esad 1.4.6-32 → 1.4.6-34

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-32",
3
+ "version": "1.4.6-34",
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",
@@ -139,6 +139,7 @@ module.exports = async (subcommand) => {
139
139
  } else {
140
140
  // Other subcommands (android, ios directly)
141
141
  try {
142
+ if (subcommand === 'android') {
142
143
  await runProcess('react-native', ['run-android', '--no-packager'], cwd);
143
144
  } else if (subcommand === 'ios') {
144
145
  await runProcess('react-native', ['run-ios', '--no-packager'], cwd);
@@ -18,7 +18,6 @@ const runProcess = (cmd, args, cwd = process.cwd()) => {
18
18
  fn(arg);
19
19
  };
20
20
 
21
- // Try to find a local binary in node_modules/.bin first
22
21
  const isWin = process.platform === 'win32';
23
22
  const localBinPath = path.join(cwd, 'node_modules', '.bin', isWin ? `${cmd}.cmd` : cmd);
24
23
 
@@ -26,22 +25,29 @@ const runProcess = (cmd, args, cwd = process.cwd()) => {
26
25
  let finalArgs = args;
27
26
 
28
27
  if (fs.existsSync(localBinPath)) {
29
- command = localBinPath;
28
+ // Use RELATIVE path for Windows stability
29
+ command = isWin ? `node_modules\\.bin\\${cmd}.cmd` : `./node_modules/.bin/${cmd}`;
30
30
  } else {
31
- // Fallback to npx
32
- command = isWin ? 'npx.cmd' : 'npx';
33
- finalArgs = [cmd, ...args];
31
+ command = isWin ? `${cmd}.cmd` : cmd;
34
32
  }
33
+
34
+ console.log(`[ESAD] Resolved Command: ${command} (CWD: ${cwd})`);
35
35
 
36
- const child = spawn(command, finalArgs, { stdio: 'inherit', cwd, shell: true });
36
+ const child = spawn(command, finalArgs, {
37
+ stdio: 'inherit',
38
+ cwd,
39
+ shell: true
40
+ });
37
41
 
38
42
  child.on('error', err => {
39
- finalize(reject, new Error(`Failed to spawn command ${command}: ${err.message}`));
43
+ // Log more details to understand when this happens
44
+ console.error(`[ESAD] Process Error: ${err.code} - ${err.message}`);
45
+ finalize(reject, new Error(`Failed to start ${cmd}: ${err.message}`));
40
46
  });
41
47
 
42
48
  child.on('close', code => {
43
49
  if (code !== 0) {
44
- finalize(reject, new Error(`Command ${command} ${finalArgs.join(' ')} failed with exit code ${code}`));
50
+ finalize(reject, new Error(`Process ${cmd} exited with code ${code}`));
45
51
  } else {
46
52
  finalize(resolve);
47
53
  }