projax 1.3.4 → 1.3.6

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.
@@ -747,11 +747,29 @@ function runScriptInBackground(projectPath, projectName, scriptName, args = [],
747
747
  // Create write stream for log file (keep reference to prevent GC)
748
748
  const logStream = fs.createWriteStream(logFile, { flags: 'a' });
749
749
  // Spawn process in detached mode with output redirected to log file
750
- const child = (0, child_process_1.spawn)(command, commandArgs, {
751
- cwd: projectPath,
752
- stdio: ['ignore', logStream, logStream], // Redirect stdout and stderr to log file
753
- detached: true,
754
- shell: process.platform === 'win32',
750
+ let child;
751
+ try {
752
+ child = (0, child_process_1.spawn)(command, commandArgs, {
753
+ cwd: projectPath,
754
+ stdio: ['ignore', logStream, logStream], // Redirect stdout and stderr to log file
755
+ detached: true,
756
+ shell: process.platform === 'win32',
757
+ });
758
+ }
759
+ catch (spawnError) {
760
+ logStream.end();
761
+ reject(new Error(`Failed to spawn process: ${spawnError instanceof Error ? spawnError.message : String(spawnError)}`));
762
+ return;
763
+ }
764
+ if (!child.pid) {
765
+ logStream.end();
766
+ reject(new Error('Failed to start process: no PID assigned'));
767
+ return;
768
+ }
769
+ // Handle spawn errors
770
+ child.on('error', (error) => {
771
+ logStream.end();
772
+ reject(new Error(`Process spawn error: ${error.message}`));
755
773
  });
756
774
  // Don't close the stream - let it stay open for the child process
757
775
  // The stream will be closed when the child process exits
@@ -820,7 +838,7 @@ function runScriptInBackground(projectPath, projectName, scriptName, args = [],
820
838
  // Ignore errors
821
839
  }
822
840
  }, 5000);
823
- // Resolve immediately since process is running in background
824
- resolve(0);
841
+ // Resolve with PID since process is running in background
842
+ resolve(child.pid);
825
843
  });
826
844
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projax",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "CLI tool for managing local development projects",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -18,16 +18,19 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "commander": "^11.1.0",
21
+ "cors": "^2.8.5",
21
22
  "electron": "^28.0.0",
22
- "inquirer": "^9.2.12",
23
23
  "express": "^4.18.2",
24
- "cors": "^2.8.5",
25
- "better-sqlite3": "^11.10.0",
26
- "@electron/rebuild": "^3.6.0"
24
+ "ink": "^4.4.1",
25
+ "inquirer": "^9.2.12",
26
+ "react": "^18.2.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/inquirer": "^9.0.7",
30
30
  "@types/node": "^20.10.0",
31
+ "@types/react": "^18.2.42",
32
+ "esbuild": "^0.27.0",
33
+ "tsx": "^4.20.6",
31
34
  "typescript": "^5.3.3"
32
35
  },
33
36
  "keywords": [