fix: v2.3.1 — correct version, say why a plugin update failed, gitignored files in Files

- v2.3.0's tree reported 2.2.1, so every install saw an update forever;
  package.json, the lockfile, openapi.yaml, the CLAUDE.md marker and the
  snapshot now read 2.3.1
- A failed plugin-update step records the tail of the command's stdout and
  stderr plus its exit code or signal (failureText); plugin-bootstrap.js
  prints its refusal on stdout, which the verdict used to drop. Update all
  uses the same text
- updates.test.js never applies an update: it skips when the checkout is
  behind a release (apply ran npm run setup and pruned dev dependencies)
- Files tree lists gitignored files and folders, named in orange
  (addIgnored in git-diff.js); change-tree rows indent in whole steps
This commit is contained in:
2026-10-06 16:22:53 +07:00
parent 7ca1134c3d
commit 837da6e5de
14 changed files with 191 additions and 49 deletions
+33
View File
@@ -169,3 +169,36 @@ describe("plugin-update-helper name guard", () => {
assert.ok(!Number.isNaN(Date.parse(v.finished_at)));
});
});
describe("plugin-update-helper failureText", () => {
// Required, not spawned: the helper only runs main() as a script.
const { failureText } = require("../../scripts/plugin-update-helper");
it("names why the bootstrap refused, which it prints on stdout", () => {
const err = Object.assign(new Error("Command failed: node plugin-bootstrap.js --force"), {
status: 1,
stdout: "installing…\nbootstrap: locked\n",
stderr: "",
});
assert.equal(failureText(err), "installing…\nbootstrap: locked\n(exit 1)");
});
it("keeps only the last lines, stdout then stderr", () => {
const err = Object.assign(new Error("x"), {
status: 2,
stdout: ["1", "2", "3", "4", "5", "6", "7"].join("\n"),
stderr: "boom",
});
assert.equal(failureText(err), "3\n4\n5\n6\n7\nboom\n(exit 2)");
});
it("says a killed command was killed, and falls back to the message when nothing was printed", () => {
const err = Object.assign(new Error("Command failed: node b.js --force\n"), {
status: null,
signal: "SIGTERM",
stdout: "",
stderr: "",
});
assert.equal(failureText(err), "Command failed: node b.js --force (killed by SIGTERM)");
});
});