@chimerai/cli 0.2.74 → 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/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +10 -0
- 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/dist/utils.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export declare function resolveTargetDir(dirOption: string): string;
|
|
|
64
64
|
/**
|
|
65
65
|
* Registers a project in the global registry.
|
|
66
66
|
* Called by create and init commands.
|
|
67
|
+
* Skips temp directories and test environments to avoid registry pollution.
|
|
67
68
|
*/
|
|
68
69
|
export declare function registerProject(name: string, absolutePath: string): void;
|
|
69
70
|
/**
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmCH;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAS,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CA8B7F;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAS,GAAG,IAAI,CAKlE;AAMD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAY5D;AAMD;;GAEG;AACH,wBA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OAAO,GAAE,MAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAcf;AAMD,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAgDD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CActD;AAoBD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAiCzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAa1D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAgCxE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAYvD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,CASxD"}
|
package/dist/utils.js
CHANGED
|
@@ -277,8 +277,18 @@ function resolveTargetDir(dirOption) {
|
|
|
277
277
|
/**
|
|
278
278
|
* Registers a project in the global registry.
|
|
279
279
|
* Called by create and init commands.
|
|
280
|
+
* Skips temp directories and test environments to avoid registry pollution.
|
|
280
281
|
*/
|
|
281
282
|
function registerProject(name, absolutePath) {
|
|
283
|
+
// Never register temp/test paths
|
|
284
|
+
const normalised = absolutePath.replace(/\\/g, '/').toLowerCase();
|
|
285
|
+
if (normalised.includes('/appdata/local/temp/') ||
|
|
286
|
+
normalised.includes('/tmp/') ||
|
|
287
|
+
name.startsWith('chimerai-test-') ||
|
|
288
|
+
process.env.NODE_ENV === 'test' ||
|
|
289
|
+
process.env.CHIMERAI_NO_REGISTRY === '1') {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
282
292
|
fs_extra_1.default.ensureDirSync(REGISTRY_DIR);
|
|
283
293
|
let registry = { projects: {}, default: null };
|
|
284
294
|
if (fs_extra_1.default.existsSync(REGISTRY_PATH)) {
|
package/package.json
CHANGED