backstep 0.1.27 → 0.1.28
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/setup.js +4 -0
- package/dist/update.js +11 -2
- package/mod/.claude-plugin/plugin.json +1 -1
- package/package.json +1 -1
package/dist/setup.js
CHANGED
|
@@ -86,6 +86,10 @@ export async function setup() {
|
|
|
86
86
|
}
|
|
87
87
|
if (!r.ok)
|
|
88
88
|
throw new Error(`claude plugin install failed:\n${r.out}`);
|
|
89
|
+
// Already installed, install keeps Claude Code's cached copy of the mod as it
|
|
90
|
+
// was; re-reading the folder and updating brings the mod up to this version.
|
|
91
|
+
run("claude", ["plugin", "marketplace", "update", "backstep"]);
|
|
92
|
+
run("claude", ["plugin", "update", "backstep@backstep"]);
|
|
89
93
|
// Only a problem is worth a line here; the summary below says the rest.
|
|
90
94
|
const bound = ensureUndoKey();
|
|
91
95
|
if (bound)
|
package/dist/update.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { spawnSync } from "./spawn.js";
|
|
6
6
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
8
|
+
import { tmpdir } from "node:os";
|
|
8
9
|
import { homeDir } from "./store.js";
|
|
9
10
|
import { version } from "./telemetry.js";
|
|
10
11
|
const REGISTRY = process.env.BACKSTEP_REGISTRY ?? "https://registry.npmjs.org";
|
|
@@ -68,6 +69,9 @@ const pause = (ms) => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0,
|
|
|
68
69
|
// at it and re-wraps servers, exactly as a fresh install would. npm is asked
|
|
69
70
|
// online, never from its cache, which can be older than a version just
|
|
70
71
|
// published; and asked again for a while if it still hasn't heard of it.
|
|
72
|
+
// It runs from a neutral folder: inside a project that is itself named
|
|
73
|
+
// backstep (or depends on it), npx runs that copy instead of fetching the one
|
|
74
|
+
// asked for, and the "update" reinstalls the old version.
|
|
71
75
|
export function runUpdate(v, tries = 4) {
|
|
72
76
|
let out = "";
|
|
73
77
|
for (let i = 0; i < tries; i++) {
|
|
@@ -78,10 +82,15 @@ export function runUpdate(v, tries = 4) {
|
|
|
78
82
|
timeout: 5 * 60 * 1000,
|
|
79
83
|
env: { ...process.env, NO_COLOR: "1", BACKSTEP_TELEMETRY: "0" },
|
|
80
84
|
stdio: ["ignore", "pipe", "pipe"],
|
|
85
|
+
cwd: tmpdir(),
|
|
81
86
|
});
|
|
82
|
-
if (r.status === 0)
|
|
83
|
-
return { ok: true, detail: `updated to ${v}` };
|
|
84
87
|
out = `${r.stderr ?? ""}\n${r.stdout ?? ""}`;
|
|
88
|
+
// Setup says which version it put in place; anything else means npx ran some other copy.
|
|
89
|
+
if (r.status === 0) {
|
|
90
|
+
if (out.includes(`backstep@${v}`))
|
|
91
|
+
return { ok: true, detail: `updated to ${v}` };
|
|
92
|
+
return { ok: false, detail: `npx ran a different copy of Backstep instead of ${v}. Run this from your home folder: npx backstep@${v} setup` };
|
|
93
|
+
}
|
|
85
94
|
if (!/ETARGET|notarget|No matching version/i.test(out))
|
|
86
95
|
break;
|
|
87
96
|
}
|