@novastorm-ai/cli 0.0.7 → 0.0.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/bin/nova.js
CHANGED
|
@@ -38,6 +38,7 @@ import { Command } from "commander";
|
|
|
38
38
|
|
|
39
39
|
// src/commands/start.ts
|
|
40
40
|
import { exec } from "child_process";
|
|
41
|
+
import * as net from "net";
|
|
41
42
|
import * as path from "path";
|
|
42
43
|
import chalk6 from "chalk";
|
|
43
44
|
import ora2 from "ora";
|
|
@@ -878,6 +879,17 @@ Available: ${SETTABLE_FIELDS.map((f) => f.path).join(", ")}`);
|
|
|
878
879
|
|
|
879
880
|
// src/commands/start.ts
|
|
880
881
|
var PROXY_PORT_OFFSET = 1;
|
|
882
|
+
function isPortInUse(port) {
|
|
883
|
+
return new Promise((resolve4) => {
|
|
884
|
+
const server = net.createServer();
|
|
885
|
+
server.once("error", () => resolve4(true));
|
|
886
|
+
server.once("listening", () => {
|
|
887
|
+
server.close();
|
|
888
|
+
resolve4(false);
|
|
889
|
+
});
|
|
890
|
+
server.listen(port, "127.0.0.1");
|
|
891
|
+
});
|
|
892
|
+
}
|
|
881
893
|
function findOverlayScript() {
|
|
882
894
|
const candidates = [
|
|
883
895
|
// From cli/dist/ (when imported as module)
|
|
@@ -943,7 +955,7 @@ async function startCommand() {
|
|
|
943
955
|
projectHash = createHash2("sha256").update(cwd).digest("hex");
|
|
944
956
|
}
|
|
945
957
|
const telemetry = new Telemetry();
|
|
946
|
-
const cliPkg = await import("./package-
|
|
958
|
+
const cliPkg = await import("./package-4SPN5HTE.js").catch(
|
|
947
959
|
() => ({ default: { version: "0.0.1" } })
|
|
948
960
|
);
|
|
949
961
|
telemetry.send({
|
|
@@ -1064,6 +1076,25 @@ ${nudgeMessage}
|
|
|
1064
1076
|
}
|
|
1065
1077
|
const projectMapApi = new ProjectMapApi();
|
|
1066
1078
|
const proxyPort = devPort + PROXY_PORT_OFFSET;
|
|
1079
|
+
spinner.start("Checking ports...");
|
|
1080
|
+
const devPortBusy = await isPortInUse(devPort);
|
|
1081
|
+
const proxyPortBusy = await isPortInUse(proxyPort);
|
|
1082
|
+
if (devPortBusy || proxyPortBusy) {
|
|
1083
|
+
spinner.fail("Port conflict detected:");
|
|
1084
|
+
if (devPortBusy) {
|
|
1085
|
+
console.log(chalk6.red(` \u2717 Port ${devPort} is already in use (dev server)`));
|
|
1086
|
+
console.log(chalk6.gray(` Kill the process: ${chalk6.cyan(`lsof -ti :${devPort} | xargs kill`)}`));
|
|
1087
|
+
}
|
|
1088
|
+
if (proxyPortBusy) {
|
|
1089
|
+
console.log(chalk6.red(` \u2717 Port ${proxyPort} is already in use (proxy)`));
|
|
1090
|
+
console.log(chalk6.gray(` Kill the process: ${chalk6.cyan(`lsof -ti :${proxyPort} | xargs kill`)}`));
|
|
1091
|
+
}
|
|
1092
|
+
console.log(chalk6.gray(`
|
|
1093
|
+
Or change the port in nova.toml: ${chalk6.cyan("port = <number>")}
|
|
1094
|
+
`));
|
|
1095
|
+
process.exit(1);
|
|
1096
|
+
}
|
|
1097
|
+
spinner.succeed("Ports available");
|
|
1067
1098
|
spinner.start(`Starting dev server (${chalk6.dim(devCommand)})...`);
|
|
1068
1099
|
try {
|
|
1069
1100
|
await devServer.spawn(devCommand, cwd, devPort);
|
|
@@ -2199,8 +2230,16 @@ async function run(argv = process.argv) {
|
|
|
2199
2230
|
const suppressBanner = args.includes("--version") || args.includes("-V") || args.includes("--help") || args.includes("-h");
|
|
2200
2231
|
if (!suppressBanner) {
|
|
2201
2232
|
console.log(BANNER);
|
|
2202
|
-
|
|
2203
|
-
|
|
2233
|
+
const isLocal = !import.meta.url.includes("node_modules");
|
|
2234
|
+
if (isLocal) {
|
|
2235
|
+
console.log("\x1B[43m\x1B[30m LOCAL BUILD \x1B[0m");
|
|
2236
|
+
}
|
|
2237
|
+
console.log(`\x1B[90m v${pkg.version}\x1B[0m
|
|
2238
|
+
`);
|
|
2239
|
+
if (!isLocal) {
|
|
2240
|
+
checkForUpdates(pkg.version).catch(() => {
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2204
2243
|
}
|
|
2205
2244
|
const program = createCli();
|
|
2206
2245
|
await program.parseAsync(argv);
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.8",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"tsup": "^8.4.0",
|
|
37
37
|
"typescript": "^5.7.0",
|
|
38
38
|
"@novastorm-ai/core": "0.0.1",
|
|
39
|
-
"@novastorm-ai/
|
|
40
|
-
"@novastorm-ai/
|
|
39
|
+
"@novastorm-ai/proxy": "0.0.1",
|
|
40
|
+
"@novastorm-ai/licensing": "0.0.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsup",
|