@chimerai/cli 0.2.75 → 0.2.76
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/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +18 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA4BH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd;AAWD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BnE"}
|
package/dist/commands/dev.js
CHANGED
|
@@ -16,6 +16,22 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
|
16
16
|
const execa_1 = require("execa");
|
|
17
17
|
const scanner_js_1 = require("../scanner.js");
|
|
18
18
|
const utils_js_1 = require("../utils.js");
|
|
19
|
+
/**
|
|
20
|
+
* Resolves the correct Python executable: tries 'python', falls back to 'python3'.
|
|
21
|
+
* On Ubuntu/Debian, only 'python3' is available by default.
|
|
22
|
+
*/
|
|
23
|
+
async function resolvePython() {
|
|
24
|
+
for (const candidate of ['python', 'python3']) {
|
|
25
|
+
try {
|
|
26
|
+
await (0, execa_1.execa)(candidate, ['--version']);
|
|
27
|
+
return candidate;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
// not found, try next
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
throw new Error('Python not found. Please install Python 3 (https://python.org) and ensure it is in your PATH.');
|
|
34
|
+
}
|
|
19
35
|
/**
|
|
20
36
|
* Validate project structure
|
|
21
37
|
* @param targetDir - Project root directory
|
|
@@ -126,7 +142,8 @@ async function startDevServer(targetDir, project, port) {
|
|
|
126
142
|
// Create venv if not exists
|
|
127
143
|
if (!(await fs_extra_1.default.pathExists(venvDir))) {
|
|
128
144
|
spinner.text = 'Creating Python virtual environment...';
|
|
129
|
-
|
|
145
|
+
const pythonBin = await resolvePython();
|
|
146
|
+
await (0, execa_1.execa)(pythonBin, ['-m', 'venv', venvDir], { cwd: aiServiceDir });
|
|
130
147
|
// Install requirements
|
|
131
148
|
spinner.text = 'Installing Python dependencies...';
|
|
132
149
|
const pipPath = isWindows
|
package/package.json
CHANGED