infinicode 2.8.6 → 2.8.8
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/robopark/serve.js +22 -5
- package/dist/robopark-cli.js +1 -1
- package/package.json +1 -1
package/dist/robopark/serve.js
CHANGED
|
@@ -14,8 +14,8 @@ import { dirname, join } from 'node:path';
|
|
|
14
14
|
import { fileURLToPath } from 'node:url';
|
|
15
15
|
function pkgDir() {
|
|
16
16
|
try {
|
|
17
|
-
// dist/robopark/serve.js -> project root
|
|
18
|
-
return dirname(dirname(fileURLToPath(import.meta.url)));
|
|
17
|
+
// dist/robopark/serve.js -> dist/robopark -> dist -> project root
|
|
18
|
+
return dirname(dirname(dirname(fileURLToPath(import.meta.url))));
|
|
19
19
|
}
|
|
20
20
|
catch {
|
|
21
21
|
return process.cwd();
|
|
@@ -36,10 +36,26 @@ function findScheduler() {
|
|
|
36
36
|
if (existsSync(p))
|
|
37
37
|
return p;
|
|
38
38
|
}
|
|
39
|
+
// Last resort: resolve the installed infinicode package and look next to it.
|
|
40
|
+
try {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
42
|
+
const req = require('module').createRequire(fileURLToPath(import.meta.url));
|
|
43
|
+
const pkgMain = req.resolve('infinicode/package.json');
|
|
44
|
+
const p = join(dirname(pkgMain), 'packages', 'robopark', 'scheduler', 'main.py');
|
|
45
|
+
if (existsSync(p))
|
|
46
|
+
return p;
|
|
47
|
+
}
|
|
48
|
+
catch { /* ignore */ }
|
|
39
49
|
return null;
|
|
40
50
|
}
|
|
41
51
|
function findPython() {
|
|
42
|
-
|
|
52
|
+
// On Windows the canonical interpreter is usually `python` (from the Microsoft
|
|
53
|
+
// Store / python.org installer); `python3` is common on Linux/macOS. Prefer the
|
|
54
|
+
// platform-specific name first, then fall back to the other conventions.
|
|
55
|
+
const names = process.platform === 'win32'
|
|
56
|
+
? ['python', 'python3', 'python3.12', 'python3.11', 'python3.10', 'py']
|
|
57
|
+
: ['python3.12', 'python3.11', 'python3.10', 'python3', 'python'];
|
|
58
|
+
for (const name of names) {
|
|
43
59
|
try {
|
|
44
60
|
execSync(`${name} --version`, { stdio: 'ignore' });
|
|
45
61
|
return name;
|
|
@@ -48,7 +64,9 @@ function findPython() {
|
|
|
48
64
|
continue;
|
|
49
65
|
}
|
|
50
66
|
}
|
|
51
|
-
return
|
|
67
|
+
// Nothing verified; return the most likely name so the user sees the actual
|
|
68
|
+
// ENOENT/"not found" error from the OS rather than a silent fallback.
|
|
69
|
+
return process.platform === 'win32' ? 'python' : 'python3';
|
|
52
70
|
}
|
|
53
71
|
/** Resolve the actual infinicode CLI entry point so `robopark setup --start`
|
|
54
72
|
* works even when global bins are not on PATH.
|
|
@@ -115,7 +133,6 @@ export async function roboparkServe(opts) {
|
|
|
115
133
|
env,
|
|
116
134
|
stdio: 'pipe',
|
|
117
135
|
detached: !opts.foreground,
|
|
118
|
-
shell: process.platform === 'win32',
|
|
119
136
|
});
|
|
120
137
|
let ready = false;
|
|
121
138
|
proc.stdout?.on('data', (d) => {
|
package/dist/robopark-cli.js
CHANGED
|
@@ -17,7 +17,7 @@ const config = new Conf({
|
|
|
17
17
|
});
|
|
18
18
|
const program = new Command('robopark')
|
|
19
19
|
.description('RoboPark fleet control CLI — set up, watch, and drive talking robots')
|
|
20
|
-
.version('2.8.
|
|
20
|
+
.version('2.8.8');
|
|
21
21
|
program
|
|
22
22
|
.command('scan')
|
|
23
23
|
.description('Auto-discover the fleet and print ready-to-run setup commands')
|
package/package.json
CHANGED