@novastorm-ai/cli 0.0.5 → 0.0.7

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
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  run
4
- } from "../chunk-EI4OXMJV.js";
4
+ } from "../chunk-I25R3NQ4.js";
5
5
  import "../chunk-4AQQAQBM.js";
6
6
  import "../chunk-QKD6A4EK.js";
7
7
  import "../chunk-KKTDQOQX.js";
@@ -943,7 +943,7 @@ async function startCommand() {
943
943
  projectHash = createHash2("sha256").update(cwd).digest("hex");
944
944
  }
945
945
  const telemetry = new Telemetry();
946
- const cliPkg = await import("./package-VCA7BUW3.js").catch(
946
+ const cliPkg = await import("./package-MIQKXQDV.js").catch(
947
947
  () => ({ default: { version: "0.0.1" } })
948
948
  );
949
949
  telemetry.send({
@@ -2018,6 +2018,15 @@ import { execFile as execFile2 } from "child_process";
2018
2018
  import chalk10 from "chalk";
2019
2019
  import ora3 from "ora";
2020
2020
  var PKG_NAME = "@novastorm-ai/cli";
2021
+ function isNewer(remote, local) {
2022
+ const r = remote.split(".").map(Number);
2023
+ const l = local.split(".").map(Number);
2024
+ for (let i = 0; i < 3; i++) {
2025
+ if ((r[i] ?? 0) > (l[i] ?? 0)) return true;
2026
+ if ((r[i] ?? 0) < (l[i] ?? 0)) return false;
2027
+ }
2028
+ return false;
2029
+ }
2021
2030
  async function getLatestVersion() {
2022
2031
  try {
2023
2032
  const controller = new AbortController();
@@ -2066,8 +2075,8 @@ async function updateCommand() {
2066
2075
  currentVersion = pkg2.version;
2067
2076
  } catch {
2068
2077
  }
2069
- if (currentVersion === latest) {
2070
- spinner.succeed(`Already on the latest version ${chalk10.green(latest)}`);
2078
+ if (!isNewer(latest, currentVersion)) {
2079
+ spinner.succeed(`Already on the latest version ${chalk10.green(currentVersion)}`);
2071
2080
  return;
2072
2081
  }
2073
2082
  spinner.text = `Updating ${chalk10.gray(currentVersion)} \u2192 ${chalk10.green(latest)}...`;
@@ -2082,15 +2091,28 @@ async function updateCommand() {
2082
2091
  }
2083
2092
  }
2084
2093
  }
2094
+ var updateBannerInterval = null;
2085
2095
  async function checkForUpdates(currentVersion) {
2086
2096
  try {
2087
- const latest = await getLatestVersion();
2088
- if (latest && latest !== currentVersion) {
2089
- console.log(
2090
- chalk10.yellow(` Update available: ${chalk10.gray(currentVersion)} \u2192 ${chalk10.green(latest)}`) + chalk10.gray(` Run ${chalk10.cyan("nova update")} to install
2091
- `)
2097
+ let renderBanner2 = function() {
2098
+ if (!process.stdout.isTTY) return;
2099
+ process.stdout.write(
2100
+ `\x1B7\x1B[${rows};${x}H${msg}\x1B8`
2092
2101
  );
2093
- }
2102
+ };
2103
+ var renderBanner = renderBanner2;
2104
+ const latest = await getLatestVersion();
2105
+ if (!latest || !isNewer(latest, currentVersion)) return;
2106
+ const msg = chalk10.bgYellow.black(` UPDATE `) + chalk10.yellow(` ${currentVersion} \u2192 ${latest} `) + chalk10.gray(`run ${chalk10.cyan("nova update")}`);
2107
+ const columns = process.stdout.columns || 80;
2108
+ const rows = process.stdout.rows || 24;
2109
+ const plain = msg.replace(/\x1b\[[0-9;]*m/g, "");
2110
+ const x = Math.max(columns - plain.length - 1, 0);
2111
+ renderBanner2();
2112
+ updateBannerInterval = setInterval(renderBanner2, 5e3);
2113
+ process.on("exit", () => {
2114
+ if (updateBannerInterval) clearInterval(updateBannerInterval);
2115
+ });
2094
2116
  } catch {
2095
2117
  }
2096
2118
  }
@@ -2170,7 +2192,8 @@ var BANNER = `\x1B[96m
2170
2192
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
2171
2193
  \u2551 A M B I E N T D E V E L O P M E N T T O O L \u2551
2172
2194
  \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
2173
- \x1B[0m`;
2195
+ \x1B[0m\x1B[90m https://cli.novastorm.ai\x1B[0m
2196
+ `;
2174
2197
  async function run(argv = process.argv) {
2175
2198
  const args = argv.slice(2);
2176
2199
  const suppressBanner = args.includes("--version") || args.includes("-V") || args.includes("--help") || args.includes("-h");
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  createCli,
5
5
  promptAndScaffold,
6
6
  run
7
- } from "./chunk-EI4OXMJV.js";
7
+ } from "./chunk-I25R3NQ4.js";
8
8
  import "./chunk-4AQQAQBM.js";
9
9
  import {
10
10
  ConfigReader,
@@ -4,7 +4,7 @@ import "./chunk-3RG5ZIWI.js";
4
4
  var package_default = {
5
5
  name: "@novastorm-ai/cli",
6
6
  publishConfig: { access: "public" },
7
- version: "0.0.5",
7
+ version: "0.0.7",
8
8
  license: "SEE LICENSE IN LICENSE.md",
9
9
  type: "module",
10
10
  main: "dist/index.js",
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.0.5",
6
+ "version": "0.0.7",
7
7
  "license": "SEE LICENSE IN LICENSE.md",
8
8
  "type": "module",
9
9
  "main": "dist/index.js",