projax 1.3.13 → 1.3.14

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projax-api",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "REST API server for projax project dashboard (internal use)",
5
5
  "private": true,
6
6
  "main": "dist/index.js",
package/dist/index.js CHANGED
@@ -211,32 +211,54 @@ program
211
211
  .action(async () => {
212
212
  try {
213
213
  await ensureAPIServerRunning(true);
214
- // Find the prxi source file - check both locations
215
- const prxiSourceNew = path.join(__dirname, '..', '..', 'prxi', 'src', 'index.tsx');
214
+ // Find the built prxi file - check multiple locations
215
+ const prxiBuiltNew = path.join(__dirname, '..', '..', 'prxi', 'dist', 'index.mjs');
216
+ const prxiBuiltOld = path.join(__dirname, 'prxi', 'dist', 'index.mjs');
216
217
  const prxiSourceOld = path.join(__dirname, '..', 'src', 'prxi.tsx');
217
- const prxiSource = fs.existsSync(prxiSourceNew) ? prxiSourceNew : prxiSourceOld;
218
- // Find tsx binary
219
- const tsxBinRoot = path.join(__dirname, '..', '..', '..', 'node_modules', '.bin', 'tsx');
220
- const tsxBinCli = path.join(__dirname, '..', 'node_modules', '.bin', 'tsx');
221
- const tsxBin = fs.existsSync(tsxBinRoot) ? tsxBinRoot : tsxBinCli;
222
- if (!fs.existsSync(prxiSource)) {
223
- console.error('Error: prxi UI source not found.');
224
- console.error(`Looked for: ${prxiSourceNew} and ${prxiSourceOld}`);
225
- process.exit(1);
218
+ let prxiPath = null;
219
+ let useSource = false;
220
+ if (fs.existsSync(prxiBuiltNew)) {
221
+ prxiPath = prxiBuiltNew;
222
+ }
223
+ else if (fs.existsSync(prxiBuiltOld)) {
224
+ prxiPath = prxiBuiltOld;
225
+ }
226
+ else if (fs.existsSync(prxiSourceOld)) {
227
+ prxiPath = prxiSourceOld;
228
+ useSource = true;
226
229
  }
227
- if (!fs.existsSync(tsxBin)) {
228
- console.error('Error: tsx not found. Please install dependencies: npm install');
230
+ if (!prxiPath) {
231
+ console.error('Error: prxi UI not found.');
232
+ console.error('Please rebuild the project: npm run build');
229
233
  process.exit(1);
230
234
  }
231
- // Run prxi using tsx
232
235
  const { spawn } = require('child_process');
233
- const child = spawn(tsxBin, [prxiSource], {
234
- stdio: 'inherit',
235
- cwd: path.dirname(prxiSource),
236
- });
237
- child.on('exit', (code) => {
238
- process.exit(code || 0);
239
- });
236
+ if (useSource) {
237
+ // Fallback: Run source using tsx
238
+ const tsxBinRoot = path.join(__dirname, '..', '..', '..', 'node_modules', '.bin', 'tsx');
239
+ const tsxBinCli = path.join(__dirname, '..', 'node_modules', '.bin', 'tsx');
240
+ const tsxBin = fs.existsSync(tsxBinRoot) ? tsxBinRoot : tsxBinCli;
241
+ if (!fs.existsSync(tsxBin)) {
242
+ console.error('Error: tsx not found. Please install dependencies: npm install');
243
+ process.exit(1);
244
+ }
245
+ const child = spawn(tsxBin, [prxiPath], {
246
+ stdio: 'inherit',
247
+ cwd: path.dirname(prxiPath),
248
+ });
249
+ child.on('exit', (code) => {
250
+ process.exit(code || 0);
251
+ });
252
+ }
253
+ else {
254
+ // Run built version with node
255
+ const child = spawn(process.execPath, [prxiPath], {
256
+ stdio: 'inherit',
257
+ });
258
+ child.on('exit', (code) => {
259
+ process.exit(code || 0);
260
+ });
261
+ }
240
262
  }
241
263
  catch (error) {
242
264
  console.error('Error launching prxi:', error instanceof Error ? error.message : error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projax",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "Cross-platform project management dashboard for tracking local development projects. Features CLI, Terminal UI, Desktop app, REST API, and built-in tools for test detection, port management, and script execution.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {