@novastorm-ai/cli 0.0.8 → 0.1.0
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
|
@@ -916,6 +916,15 @@ async function startCommand() {
|
|
|
916
916
|
const devServer = new DevServerRunner();
|
|
917
917
|
const proxyServer = new ProxyServer();
|
|
918
918
|
const wsServer = new WebSocketServer();
|
|
919
|
+
let earlyExit = true;
|
|
920
|
+
process.on("SIGINT", () => {
|
|
921
|
+
if (earlyExit) {
|
|
922
|
+
console.log(chalk6.dim("\nShutting down..."));
|
|
923
|
+
devServer.kill().catch(() => {
|
|
924
|
+
});
|
|
925
|
+
process.exit(0);
|
|
926
|
+
}
|
|
927
|
+
});
|
|
919
928
|
const licenseChecker = new LicenseChecker();
|
|
920
929
|
const indexer = new ProjectIndexer();
|
|
921
930
|
const logger = new NovaLogger();
|
|
@@ -939,13 +948,13 @@ async function startCommand() {
|
|
|
939
948
|
if (config.telemetry.enabled && process.env["NOVA_TELEMETRY"] !== "false") {
|
|
940
949
|
const { createHash: createHash2 } = await import("crypto");
|
|
941
950
|
const os = await import("os");
|
|
942
|
-
const { execFile:
|
|
951
|
+
const { execFile: execFile4 } = await import("child_process");
|
|
943
952
|
const mac = Object.values(os.networkInterfaces()).flat().find((i) => !i?.internal && i?.mac !== "00:00:00:00:00:00")?.mac ?? "";
|
|
944
953
|
const machineId = createHash2("sha256").update(os.hostname() + os.userInfo().username + mac).digest("hex");
|
|
945
954
|
let projectHash;
|
|
946
955
|
try {
|
|
947
956
|
const remoteUrl = await new Promise((resolve4, reject) => {
|
|
948
|
-
|
|
957
|
+
execFile4("git", ["remote", "get-url", "origin"], { cwd }, (err, stdout3) => {
|
|
949
958
|
if (err) reject(err);
|
|
950
959
|
else resolve4(stdout3.trim());
|
|
951
960
|
});
|
|
@@ -955,7 +964,7 @@ async function startCommand() {
|
|
|
955
964
|
projectHash = createHash2("sha256").update(cwd).digest("hex");
|
|
956
965
|
}
|
|
957
966
|
const telemetry = new Telemetry();
|
|
958
|
-
const cliPkg = await import("./package-
|
|
967
|
+
const cliPkg = await import("./package-GXN6NQIN.js").catch(
|
|
959
968
|
() => ({ default: { version: "0.0.1" } })
|
|
960
969
|
);
|
|
961
970
|
telemetry.send({
|
|
@@ -1537,6 +1546,7 @@ Dev server error: ${error}`));
|
|
|
1537
1546
|
}
|
|
1538
1547
|
});
|
|
1539
1548
|
chat.start();
|
|
1549
|
+
earlyExit = false;
|
|
1540
1550
|
process.on("SIGINT", () => {
|
|
1541
1551
|
shutdown().catch(() => process.exit(1));
|
|
1542
1552
|
});
|
|
@@ -2148,6 +2158,40 @@ async function checkForUpdates(currentVersion) {
|
|
|
2148
2158
|
}
|
|
2149
2159
|
}
|
|
2150
2160
|
|
|
2161
|
+
// src/commands/uninstall.ts
|
|
2162
|
+
import { execFile as execFile3 } from "child_process";
|
|
2163
|
+
import chalk11 from "chalk";
|
|
2164
|
+
import ora4 from "ora";
|
|
2165
|
+
var PKG_NAME2 = "@novastorm-ai/cli";
|
|
2166
|
+
function runCommand(cmd, args) {
|
|
2167
|
+
return new Promise((resolve4) => {
|
|
2168
|
+
execFile3(cmd, args, { timeout: 3e4 }, (error, stdout3, stderr) => {
|
|
2169
|
+
if (error) {
|
|
2170
|
+
resolve4({ ok: false, output: stderr || error.message });
|
|
2171
|
+
} else {
|
|
2172
|
+
resolve4({ ok: true, output: stdout3 });
|
|
2173
|
+
}
|
|
2174
|
+
});
|
|
2175
|
+
});
|
|
2176
|
+
}
|
|
2177
|
+
async function uninstallCommand() {
|
|
2178
|
+
const spinner = ora4("Uninstalling Novastorm CLI...").start();
|
|
2179
|
+
let result = await runCommand("npm", ["uninstall", "-g", PKG_NAME2]);
|
|
2180
|
+
if (!result.ok) {
|
|
2181
|
+
result = await runCommand("pnpm", ["uninstall", "-g", PKG_NAME2]);
|
|
2182
|
+
}
|
|
2183
|
+
if (result.ok) {
|
|
2184
|
+
spinner.succeed("Novastorm CLI uninstalled.");
|
|
2185
|
+
console.log(chalk11.gray("\n Thanks for trying Novastorm."));
|
|
2186
|
+
console.log(chalk11.gray(` Feedback? ${chalk11.cyan("https://github.com/novastorm-cli/nova/issues")}`));
|
|
2187
|
+
console.log(chalk11.gray(` Come back anytime: ${chalk11.cyan(`npm install -g ${PKG_NAME2}`)}
|
|
2188
|
+
`));
|
|
2189
|
+
} else {
|
|
2190
|
+
spinner.fail("Uninstall failed. Try manually:");
|
|
2191
|
+
console.log(chalk11.cyan(` npm uninstall -g ${PKG_NAME2}`));
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2151
2195
|
// src/index.ts
|
|
2152
2196
|
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
2153
2197
|
var pkg = JSON.parse(
|
|
@@ -2211,6 +2255,9 @@ function createCli() {
|
|
|
2211
2255
|
program.command("update").description("Update Novastorm CLI to the latest version").action(async () => {
|
|
2212
2256
|
await updateCommand();
|
|
2213
2257
|
});
|
|
2258
|
+
program.command("uninstall").description("Uninstall Novastorm CLI from your system").action(async () => {
|
|
2259
|
+
await uninstallCommand();
|
|
2260
|
+
});
|
|
2214
2261
|
return program;
|
|
2215
2262
|
}
|
|
2216
2263
|
var BANNER = `\x1B[96m
|
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.1.0",
|
|
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/licensing": "0.0.1",
|
|
40
|
+
"@novastorm-ai/proxy": "0.0.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsup",
|