projax 1.3.14 → 1.3.16
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/dist/api/package.json +1 -1
- package/dist/index.js +27 -43
- package/dist/prxi/src/index.tsx +1370 -0
- package/package.json +6 -3
package/dist/api/package.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -211,54 +211,38 @@ program
|
|
|
211
211
|
.action(async () => {
|
|
212
212
|
try {
|
|
213
213
|
await ensureAPIServerRunning(true);
|
|
214
|
-
// Find the
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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;
|
|
229
|
-
}
|
|
214
|
+
// Find the prxi source file - check multiple locations
|
|
215
|
+
const prxiPaths = [
|
|
216
|
+
path.join(__dirname, 'prxi', 'src', 'index.tsx'), // When running from built/published CLI
|
|
217
|
+
path.join(__dirname, '..', '..', 'prxi', 'src', 'index.tsx'), // When running from workspace
|
|
218
|
+
path.join(__dirname, '..', 'src', 'prxi.tsx'), // Legacy location
|
|
219
|
+
];
|
|
220
|
+
const prxiPath = prxiPaths.find(p => fs.existsSync(p));
|
|
230
221
|
if (!prxiPath) {
|
|
231
222
|
console.error('Error: prxi UI not found.');
|
|
232
|
-
console.error('
|
|
223
|
+
console.error('Looked in:', prxiPaths);
|
|
233
224
|
process.exit(1);
|
|
234
225
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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
|
-
});
|
|
226
|
+
// Find tsx binary - it should be in CLI's node_modules since tsx is a dependency
|
|
227
|
+
const tsxPaths = [
|
|
228
|
+
path.join(__dirname, '..', 'node_modules', '.bin', 'tsx'), // When running from built CLI
|
|
229
|
+
path.join(__dirname, '..', '..', '..', 'node_modules', '.bin', 'tsx'), // When running from workspace root
|
|
230
|
+
'tsx', // Fallback to PATH
|
|
231
|
+
];
|
|
232
|
+
let tsxBin = tsxPaths.find(p => p === 'tsx' || fs.existsSync(p));
|
|
233
|
+
if (!tsxBin) {
|
|
234
|
+
console.error('Error: tsx not found. Please install dependencies: npm install');
|
|
235
|
+
process.exit(1);
|
|
261
236
|
}
|
|
237
|
+
// Run prxi source using tsx
|
|
238
|
+
const { spawn } = require('child_process');
|
|
239
|
+
const child = spawn(tsxBin, [prxiPath], {
|
|
240
|
+
stdio: 'inherit',
|
|
241
|
+
cwd: path.dirname(prxiPath),
|
|
242
|
+
});
|
|
243
|
+
child.on('exit', (code) => {
|
|
244
|
+
process.exit(code || 0);
|
|
245
|
+
});
|
|
262
246
|
}
|
|
263
247
|
catch (error) {
|
|
264
248
|
console.error('Error launching prxi:', error instanceof Error ? error.message : error);
|