openmagic 0.29.0 → 0.29.1
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/cli.js +22 -7
- package/dist/cli.js.map +1 -1
- package/dist/toolbar/index.global.js +1 -1
- package/dist/toolbar/index.global.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
import { Command } from "commander";
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
import open from "open";
|
|
7
|
-
import { resolve as resolve2 } from "path";
|
|
7
|
+
import { resolve as resolve2, join as join5 } from "path";
|
|
8
|
+
import { existsSync as existsSync5, readFileSync as readFileSync5 } from "fs";
|
|
8
9
|
import { spawn } from "child_process";
|
|
9
10
|
import { createInterface } from "readline";
|
|
10
11
|
|
|
@@ -1448,7 +1449,7 @@ async function handleLlmChat(params, onChunk, onDone, onError) {
|
|
|
1448
1449
|
}
|
|
1449
1450
|
|
|
1450
1451
|
// src/server.ts
|
|
1451
|
-
var VERSION = "0.29.
|
|
1452
|
+
var VERSION = "0.29.1";
|
|
1452
1453
|
var __dirname = dirname2(fileURLToPath(import.meta.url));
|
|
1453
1454
|
function attachOpenMagic(httpServer, roots) {
|
|
1454
1455
|
function handleRequest(req, res) {
|
|
@@ -1990,7 +1991,7 @@ process.on("uncaughtException", (err) => {
|
|
|
1990
1991
|
});
|
|
1991
1992
|
var childProcesses = [];
|
|
1992
1993
|
var lastDetectedPort = null;
|
|
1993
|
-
var VERSION2 = "0.29.
|
|
1994
|
+
var VERSION2 = "0.29.1";
|
|
1994
1995
|
function ask(question) {
|
|
1995
1996
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
1996
1997
|
return new Promise((resolve3) => {
|
|
@@ -2417,12 +2418,26 @@ async function offerToStartDevServer(expectedPort) {
|
|
|
2417
2418
|
}
|
|
2418
2419
|
if (childExited && !isUp) {
|
|
2419
2420
|
console.log(
|
|
2420
|
-
chalk.red(` \u2717 Dev server
|
|
2421
|
-
);
|
|
2422
|
-
console.log(
|
|
2423
|
-
chalk.dim(` Check the error output above and fix the issue.`)
|
|
2421
|
+
chalk.red(` \u2717 Dev server failed to start.`)
|
|
2424
2422
|
);
|
|
2425
2423
|
console.log("");
|
|
2424
|
+
try {
|
|
2425
|
+
const pkgPath = join5(process.cwd(), "package.json");
|
|
2426
|
+
if (existsSync5(pkgPath)) {
|
|
2427
|
+
const pkg = JSON.parse(readFileSync5(pkgPath, "utf-8"));
|
|
2428
|
+
if (pkg.engines?.node) {
|
|
2429
|
+
console.log(chalk.yellow(` This project requires Node.js ${pkg.engines.node}`));
|
|
2430
|
+
console.log(chalk.dim(` You are running Node.js ${process.version}`));
|
|
2431
|
+
console.log("");
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
} catch {
|
|
2435
|
+
}
|
|
2436
|
+
console.log(chalk.white(" Options:"));
|
|
2437
|
+
console.log(chalk.dim(" 1. Fix the error above and try again"));
|
|
2438
|
+
console.log(chalk.dim(" 2. Start the server manually, then run:"));
|
|
2439
|
+
console.log(chalk.cyan(" npx openmagic --port <your-port>"));
|
|
2440
|
+
console.log("");
|
|
2426
2441
|
return false;
|
|
2427
2442
|
}
|
|
2428
2443
|
if (!isUp) {
|