vibe-cokit 1.10.0 → 1.11.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/bin/vk.cjs +0 -0
- package/dist/cli.js +10 -4
- package/package.json +1 -1
package/bin/vk.cjs
CHANGED
|
File without changes
|
package/dist/cli.js
CHANGED
|
@@ -2548,8 +2548,11 @@ async function getCommitSha(tmpDir) {
|
|
|
2548
2548
|
}
|
|
2549
2549
|
async function readSettings() {
|
|
2550
2550
|
const file = Bun.file(SETTINGS_PATH);
|
|
2551
|
-
if (await file.exists())
|
|
2552
|
-
|
|
2551
|
+
if (await file.exists()) {
|
|
2552
|
+
const text = await file.text();
|
|
2553
|
+
const stripped = text.replace(/^\s*\/\/.*$/gm, "").replace(/,(\s*[}\]])/g, "$1");
|
|
2554
|
+
return JSON.parse(stripped);
|
|
2555
|
+
}
|
|
2553
2556
|
return {};
|
|
2554
2557
|
}
|
|
2555
2558
|
async function writeSettings(settings) {
|
|
@@ -2611,8 +2614,11 @@ async function upgradeCli() {
|
|
|
2611
2614
|
const { stdout: installedRaw } = await exec2("bun", ["pm", "ls", "-g"]);
|
|
2612
2615
|
const match = installedRaw.match(/vibe-cokit@(\S+)/);
|
|
2613
2616
|
const currentVersion = match?.[1] ?? "0.0.0";
|
|
2614
|
-
const
|
|
2615
|
-
|
|
2617
|
+
const res = await fetch("https://registry.npmjs.org/vibe-cokit/latest");
|
|
2618
|
+
if (!res.ok)
|
|
2619
|
+
throw new Error(`npm registry returned ${res.status}`);
|
|
2620
|
+
const data = await res.json();
|
|
2621
|
+
const latestVersion = data.version;
|
|
2616
2622
|
if (currentVersion === latestVersion) {
|
|
2617
2623
|
return { upgraded: false, from: currentVersion, to: latestVersion };
|
|
2618
2624
|
}
|