@rness/cli 0.9.0 → 0.9.2
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/README.md +44 -12
- package/dist/bin/rness.js +1 -1
- package/dist/{chunk-DL72BCPT.js → chunk-JKDF7ROY.js} +173 -70
- package/dist/chunk-JKDF7ROY.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DL72BCPT.js.map +0 -1
package/README.md
CHANGED
|
@@ -93,13 +93,14 @@ decided:
|
|
|
93
93
|
written.
|
|
94
94
|
- With `claude` in `agents`, `sync` registers it in each clone:
|
|
95
95
|
`.mcp.json` gets `mcpServers.rness`, which runs the pinned copy
|
|
96
|
-
(`node ../../.rness/node_modules/@rness/cli/dist/bin/rness.js mcp`)
|
|
97
|
-
`.claude/settings.json` lists `rness` in `enabledMcpjsonServers`. A
|
|
96
|
+
(`node ../../.rness/node_modules/@rness/cli/dist/bin/rness.js mcp`). A
|
|
98
97
|
team's own `rness` entry is left as it is.
|
|
98
|
+
- Each developer approves the server once, in Claude Code's own dialog.
|
|
99
|
+
rness does not pre-approve it: `enabledMcpjsonServers` in a committed
|
|
100
|
+
settings file would let any change to the `rness` entry of `.mcp.json` run
|
|
101
|
+
unasked. Review such a change like code.
|
|
99
102
|
- Verified with Claude Code 2.1.284 on 2026-09-29: the server starts from the
|
|
100
|
-
repository and its tools answer.
|
|
101
|
-
`enabledMcpjsonServers` spares the approval prompt in an interactive
|
|
102
|
-
session.
|
|
103
|
+
repository and its tools answer.
|
|
103
104
|
- Another agent can run the same command from a clone; rness writes no
|
|
104
105
|
configuration for it.
|
|
105
106
|
|
|
@@ -177,8 +178,9 @@ dependency does this: `util.styleText`, and a banner kept as a constant.
|
|
|
177
178
|
|
|
178
179
|
The version is written in one place, `.rness/package.json`. `upgrade` pins it
|
|
179
180
|
there (exact, the rest of the file untouched), installs with the workspace's
|
|
180
|
-
package manager,
|
|
181
|
-
|
|
181
|
+
package manager, syncs through the new copy, then commits `.rness`
|
|
182
|
+
(`chore: rness <version>`); a failed install restores the file. Push
|
|
183
|
+
`.rness`. Teammates pull, and the next `rness` command in that
|
|
182
184
|
workspace installs the new pin itself — frozen, so the working tree stays
|
|
183
185
|
clean — and carries on: nothing to remember, nothing to run.
|
|
184
186
|
`RNESS_NO_INSTALL=1` turns that off and restores the warning, for CI, a
|
|
@@ -216,8 +218,10 @@ now names; `rness validate` warns while it is behind.
|
|
|
216
218
|
scaffold did not change; overlapping lines conflict, and `upgrade` stops
|
|
217
219
|
before installing — resolve with git (`git checkout --ours <file>` keeps
|
|
218
220
|
yours, `--theirs` takes the scaffold's), commit, run `upgrade` again.
|
|
219
|
-
- `.rness` must be a clean git repository
|
|
220
|
-
|
|
221
|
+
- `.rness` must be a clean git repository with no merge in progress.
|
|
222
|
+
`upgrade` commits the merge itself, through the repository's hooks. When a
|
|
223
|
+
hook refuses, everything stays staged, what it said is shown, and
|
|
224
|
+
`upgrade` exits 1 with the commit to make.
|
|
221
225
|
- A workspace with no scaffold commit (made by hand, or older than
|
|
222
226
|
`create`) is adopted: identical files merge silently, a differing one
|
|
223
227
|
conflicts once.
|
|
@@ -231,13 +235,41 @@ pin merges the scaffold of the copy installed in `.rness`. A global below
|
|
|
231
235
|
`npx` form, or the pinned copy from inside `.rness`. A workspace pinned below 0.5.0, whose copy has no such
|
|
232
236
|
command, starts with the `npx` form.
|
|
233
237
|
|
|
234
|
-
An upgrade
|
|
235
|
-
|
|
236
|
-
|
|
238
|
+
An upgrade commits `.rness` only. Its sync rewrites a block only when the
|
|
239
|
+
block's content changed — a block is current when its hash is, whatever
|
|
240
|
+
wrote it — and writes the agent files a release adds. The next steps list,
|
|
241
|
+
per repository, the files to commit there.
|
|
237
242
|
|
|
238
243
|
Exit codes: 0 success, 1 failure, 2 usage — or a refusal without a TTY.
|
|
239
244
|
`RNESS_DEBUG=1` adds stack traces; `RNESS_NO_DELEGATE=1` skips the delegation.
|
|
240
245
|
|
|
246
|
+
## 0.9.2 — the sync summary reads as a sentence
|
|
247
|
+
|
|
248
|
+
- `rness sync` counts agent files apart from blocks: "4 blocks: 4
|
|
249
|
+
unchanged; 6 agent files: 6 unchanged". 0.9.1 counted them as blocks
|
|
250
|
+
("10 blocks: 10 unchanged").
|
|
251
|
+
- In a terminal the line reads as a sentence, verb first: "Synced 4 blocks:
|
|
252
|
+
…" instead of "10 blocks: 10 unchanged synced".
|
|
253
|
+
- Blocks are unchanged: no `rness sync` is needed after upgrading.
|
|
254
|
+
|
|
255
|
+
## 0.9.1 — upgrade ends in its commit; the MCP server approved per developer
|
|
256
|
+
|
|
257
|
+
- `rness upgrade` commits `.rness` itself (`chore: rness <version>`), with
|
|
258
|
+
the repository's hooks; a refusal leaves everything staged and exits 1.
|
|
259
|
+
The next steps say what is left: push, and per repository the files the
|
|
260
|
+
sync changed.
|
|
261
|
+
- `upgrade` syncs every time, the Dependabot case included (pin and install
|
|
262
|
+
already at the target). In 0.9.0 it skipped the sync there, so the values
|
|
263
|
+
0.9.0 added to the agent files were missing and the scaffold's
|
|
264
|
+
pre-commit hook refused the commit.
|
|
265
|
+
- `upgrade` refuses a `.rness` with a merge in progress.
|
|
266
|
+
- `validate` counts a merge in progress: the commit recording a scaffold
|
|
267
|
+
merge no longer warns that the scaffold is not merged.
|
|
268
|
+
- The Claude target no longer writes `enabledMcpjsonServers`: each developer
|
|
269
|
+
approves the MCP server once. After syncing with 0.9.0, remove `rness`
|
|
270
|
+
from `enabledMcpjsonServers` in each `.claude/settings.json` by hand —
|
|
271
|
+
rness never removes a value.
|
|
272
|
+
|
|
241
273
|
## 0.9.0 — the context on demand: `rness mcp`
|
|
242
274
|
|
|
243
275
|
- `rness mcp`: a local, read-only MCP server with four tools —
|
package/dist/bin/rness.js
CHANGED
|
@@ -743,6 +743,21 @@ async function isClean(dir, ignore = []) {
|
|
|
743
743
|
dir
|
|
744
744
|
)).trim() === "";
|
|
745
745
|
}
|
|
746
|
+
async function changedPaths(dir, paths) {
|
|
747
|
+
if (paths.length === 0) return [];
|
|
748
|
+
const entries = (await git(
|
|
749
|
+
["status", "--porcelain", "-z", "--untracked-files=all", "--", ...paths],
|
|
750
|
+
dir
|
|
751
|
+
)).split("\0");
|
|
752
|
+
const changed = [];
|
|
753
|
+
for (let i = 0; i < entries.length; i++) {
|
|
754
|
+
const entry = entries[i] ?? "";
|
|
755
|
+
if (entry.length < 4) continue;
|
|
756
|
+
changed.push(entry.slice(3));
|
|
757
|
+
if (entry[0] === "R" || entry[0] === "C") i++;
|
|
758
|
+
}
|
|
759
|
+
return changed;
|
|
760
|
+
}
|
|
746
761
|
async function pullFastForward(dir, credentials) {
|
|
747
762
|
await git(["pull", "--ff-only", "--quiet"], dir, credentials);
|
|
748
763
|
}
|
|
@@ -1390,7 +1405,7 @@ function reportError(e) {
|
|
|
1390
1405
|
}
|
|
1391
1406
|
|
|
1392
1407
|
// src/version.ts
|
|
1393
|
-
var VERSION = "0.9.
|
|
1408
|
+
var VERSION = "0.9.2";
|
|
1394
1409
|
|
|
1395
1410
|
// src/core/block.ts
|
|
1396
1411
|
import { createHash } from "crypto";
|
|
@@ -1705,16 +1720,17 @@ var TARGETS = {
|
|
|
1705
1720
|
{
|
|
1706
1721
|
path: ["permissions", "additionalDirectories"],
|
|
1707
1722
|
contains: "../../.rness"
|
|
1708
|
-
}
|
|
1709
|
-
// Start the rness MCP server of .mcp.json without asking.
|
|
1710
|
-
{ path: ["enabledMcpjsonServers"], contains: "rness" }
|
|
1723
|
+
}
|
|
1711
1724
|
]
|
|
1712
1725
|
},
|
|
1713
1726
|
{
|
|
1714
1727
|
file: ".mcp.json",
|
|
1715
1728
|
guarantees: [
|
|
1716
1729
|
// The pinned copy, by a path relative to the repository — the
|
|
1717
|
-
// directory Claude Code starts the server in (spec 0014 §6).
|
|
1730
|
+
// directory Claude Code starts the server in (spec 0014 §6). Not
|
|
1731
|
+
// pre-approved in settings: each developer approves it once, since
|
|
1732
|
+
// a repository approving its own command would run any change to
|
|
1733
|
+
// it unasked (spec 0014 §3, 0.9.1).
|
|
1718
1734
|
{
|
|
1719
1735
|
path: ["mcpServers", "rness"],
|
|
1720
1736
|
value: {
|
|
@@ -1856,6 +1872,13 @@ function declared(manifest) {
|
|
|
1856
1872
|
(name) => Object.hasOwn(TARGETS, name) ? [TARGETS[name]] : []
|
|
1857
1873
|
);
|
|
1858
1874
|
}
|
|
1875
|
+
var BLOCK_FILES = ["AGENTS.md", "CLAUDE.md"];
|
|
1876
|
+
function writtenFiles(manifest) {
|
|
1877
|
+
return [
|
|
1878
|
+
...BLOCK_FILES,
|
|
1879
|
+
...declared(manifest).flatMap((t) => t.files.map((f) => f.file))
|
|
1880
|
+
];
|
|
1881
|
+
}
|
|
1859
1882
|
async function agentTargets(root, manifest, opts) {
|
|
1860
1883
|
const outcomes = [];
|
|
1861
1884
|
for (const { guarantees, file, label } of await filesOf(
|
|
@@ -2065,7 +2088,7 @@ function sessionUi(p) {
|
|
|
2065
2088
|
async step(options, work, done) {
|
|
2066
2089
|
const label = options.sentence ?? tidy(options.doing);
|
|
2067
2090
|
const finish2 = (result) => done?.(result) ?? null;
|
|
2068
|
-
const label_ = (line2) => `${line2[1]} ${line2[0]}`;
|
|
2091
|
+
const label_ = (line2) => line2[2] ?? `${line2[1]} ${line2[0]}`;
|
|
2069
2092
|
if (options.git === true && !this.gitIsSilent) {
|
|
2070
2093
|
p.log.message(paint("idle", `${label}\u2026`));
|
|
2071
2094
|
const result = await work();
|
|
@@ -2104,7 +2127,6 @@ async function makeUi(terminal) {
|
|
|
2104
2127
|
}
|
|
2105
2128
|
|
|
2106
2129
|
// src/commands/sync.ts
|
|
2107
|
-
var MANAGED_FILES = ["AGENTS.md", "CLAUDE.md"];
|
|
2108
2130
|
function targetsOf(manifest, root, only) {
|
|
2109
2131
|
const targets = [];
|
|
2110
2132
|
if (only === void 0)
|
|
@@ -2294,13 +2316,7 @@ async function syncCommand(opts, deps = {}) {
|
|
|
2294
2316
|
}
|
|
2295
2317
|
} else if (opts.pull === true && !check) {
|
|
2296
2318
|
try {
|
|
2297
|
-
|
|
2298
|
-
...MANAGED_FILES,
|
|
2299
|
-
...(manifest.agents ?? []).flatMap(
|
|
2300
|
-
(a) => Object.hasOwn(TARGETS, a) ? TARGETS[a].files.map((f) => f.file) : []
|
|
2301
|
-
)
|
|
2302
|
-
];
|
|
2303
|
-
if (!await isClean(dir, written)) {
|
|
2319
|
+
if (!await isClean(dir, writtenFiles(manifest))) {
|
|
2304
2320
|
lines.push(["skipped", `${label} (working tree not clean)`]);
|
|
2305
2321
|
continue;
|
|
2306
2322
|
}
|
|
@@ -2343,7 +2359,7 @@ async function syncCommand(opts, deps = {}) {
|
|
|
2343
2359
|
continue;
|
|
2344
2360
|
}
|
|
2345
2361
|
const [agentsLinked, claudeLinked] = await Promise.all(
|
|
2346
|
-
|
|
2362
|
+
BLOCK_FILES.map((f) => isSymlink(join10(t.dir, f)))
|
|
2347
2363
|
);
|
|
2348
2364
|
const atRoot = t.scope === null;
|
|
2349
2365
|
if (!atRoot && (agentsLinked === true || claudeLinked === true)) {
|
|
@@ -3093,19 +3109,32 @@ async function runPinnedSync(root) {
|
|
|
3093
3109
|
};
|
|
3094
3110
|
}
|
|
3095
3111
|
}
|
|
3112
|
+
var SYNC_VERBS = ["updated", "unchanged", "stale"];
|
|
3113
|
+
function counted(noun, counts) {
|
|
3114
|
+
const total = [...counts.values()].reduce((a, b) => a + b, 0);
|
|
3115
|
+
const detail = SYNC_VERBS.filter((verb) => counts.has(verb)).map((verb) => `${counts.get(verb) ?? 0} ${verb}`).join(", ");
|
|
3116
|
+
return `${total} ${noun}${total === 1 ? "" : "s"}${detail === "" ? "" : `: ${detail}`}`;
|
|
3117
|
+
}
|
|
3096
3118
|
function summariseSync(stdout) {
|
|
3097
|
-
const
|
|
3119
|
+
const blocks = /* @__PURE__ */ new Map();
|
|
3120
|
+
const agentFiles = /* @__PURE__ */ new Map();
|
|
3098
3121
|
const others = [];
|
|
3099
3122
|
for (const line2 of stdout.split("\n")) {
|
|
3100
3123
|
if (line2.trim() === "") continue;
|
|
3101
|
-
const
|
|
3102
|
-
if (
|
|
3103
|
-
|
|
3124
|
+
const m = /^(updated|unchanged|stale)\s+(\S+)/.exec(line2);
|
|
3125
|
+
if (m === null) {
|
|
3126
|
+
others.push(line2);
|
|
3127
|
+
continue;
|
|
3128
|
+
}
|
|
3129
|
+
const [, verb = "", path = ""] = m;
|
|
3130
|
+
const counts = /(^|\/)(AGENTS|CLAUDE)\.md$/.test(path) ? blocks : agentFiles;
|
|
3131
|
+
counts.set(verb, (counts.get(verb) ?? 0) + 1);
|
|
3104
3132
|
}
|
|
3105
|
-
const total = [...counts.values()].reduce((a, b) => a + b, 0);
|
|
3106
|
-
const detail = [...counts].map(([verb, n]) => `${n} ${verb}`).join(", ");
|
|
3107
3133
|
return {
|
|
3108
|
-
summary:
|
|
3134
|
+
summary: [
|
|
3135
|
+
counted("block", blocks),
|
|
3136
|
+
...agentFiles.size > 0 ? [counted("agent file", agentFiles)] : []
|
|
3137
|
+
].join("; "),
|
|
3109
3138
|
others
|
|
3110
3139
|
};
|
|
3111
3140
|
}
|
|
@@ -3211,12 +3240,33 @@ function scaffoldMessage(subject, version) {
|
|
|
3211
3240
|
|
|
3212
3241
|
${SCAFFOLD_TRAILER}: ${version}`;
|
|
3213
3242
|
}
|
|
3243
|
+
async function commitUpgrade(rnessDir, message) {
|
|
3244
|
+
const add = await run(rnessDir, ["add", "-A"]);
|
|
3245
|
+
if (add.code !== 0) return { kind: "refused", output: add.stderr.trim() };
|
|
3246
|
+
const staged = await run(rnessDir, ["diff", "--cached", "--quiet"]);
|
|
3247
|
+
if (staged.code === 0 && !await mergeInProgress(rnessDir))
|
|
3248
|
+
return { kind: "nothing" };
|
|
3249
|
+
const commit = await run(rnessDir, ["commit", "-q", "-m", message]);
|
|
3250
|
+
if (commit.code !== 0)
|
|
3251
|
+
return {
|
|
3252
|
+
kind: "refused",
|
|
3253
|
+
output: `${commit.stdout}
|
|
3254
|
+
${commit.stderr}`.trim()
|
|
3255
|
+
};
|
|
3256
|
+
return { kind: "committed" };
|
|
3257
|
+
}
|
|
3258
|
+
async function mergeInProgress(dir) {
|
|
3259
|
+
const r = await run(dir, ["rev-parse", "-q", "--verify", "MERGE_HEAD"]);
|
|
3260
|
+
return r.code === 0;
|
|
3261
|
+
}
|
|
3214
3262
|
async function findScaffoldBase(rnessDir) {
|
|
3263
|
+
const merging = await mergeInProgress(rnessDir);
|
|
3215
3264
|
const log = await run(rnessDir, [
|
|
3216
3265
|
"log",
|
|
3217
3266
|
"--topo-order",
|
|
3218
3267
|
`--format=%H%x1f%P%x1f%s%x1f%(trailers:key=${SCAFFOLD_TRAILER},valueonly,separator=%x2C)%x1e`,
|
|
3219
|
-
"HEAD"
|
|
3268
|
+
"HEAD",
|
|
3269
|
+
...merging ? ["MERGE_HEAD"] : []
|
|
3220
3270
|
]);
|
|
3221
3271
|
if (log.code !== 0) return null;
|
|
3222
3272
|
const commits = log.stdout.split("").map((r) => r.trim()).filter((r) => r !== "").map((r) => {
|
|
@@ -3437,7 +3487,10 @@ async function syncBlocks(ui, root, shown, inPlace, sshWorks) {
|
|
|
3437
3487
|
sentence: "Writing the rness block into every AGENTS.md"
|
|
3438
3488
|
},
|
|
3439
3489
|
() => runPinnedSync(root),
|
|
3440
|
-
(r) => r === null || r.code !== 0 ? null :
|
|
3490
|
+
(r) => r === null || r.code !== 0 ? null : (() => {
|
|
3491
|
+
const { summary } = summariseSync(r.stdout);
|
|
3492
|
+
return ["synced", summary, `Synced ${summary}`];
|
|
3493
|
+
})()
|
|
3441
3494
|
);
|
|
3442
3495
|
if (result === null) {
|
|
3443
3496
|
if (inPlace !== void 0) return inPlace();
|
|
@@ -4355,14 +4408,36 @@ async function declaredManager(rnessDir, pm) {
|
|
|
4355
4408
|
}
|
|
4356
4409
|
return `${pm}@${await packageManagerVersion(pm)}`;
|
|
4357
4410
|
}
|
|
4358
|
-
function
|
|
4411
|
+
async function clonesToCommit(root, cwd, manifest) {
|
|
4412
|
+
const files = writtenFiles(manifest);
|
|
4413
|
+
const clones = [];
|
|
4414
|
+
for (const repo of Object.keys(manifest.repos)) {
|
|
4415
|
+
const dir = join21(root, "org", repo);
|
|
4416
|
+
if (!await exists(dir)) continue;
|
|
4417
|
+
try {
|
|
4418
|
+
const paths = await changedPaths(dir, files);
|
|
4419
|
+
if (paths.length > 0)
|
|
4420
|
+
clones.push({ dir: relative5(cwd, dir) || ".", paths });
|
|
4421
|
+
} catch {
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
return clones;
|
|
4425
|
+
}
|
|
4426
|
+
function finish(ui, cwd, rnessDir, label, target, ending) {
|
|
4359
4427
|
const rel = relative5(cwd, rnessDir) || ".";
|
|
4360
|
-
const
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4428
|
+
const message = `chore: rness ${target}`;
|
|
4429
|
+
const next = [];
|
|
4430
|
+
if (ending.commit === "committed") next.push(`git -C ${rel} push`);
|
|
4431
|
+
if (ending.commit === "refused")
|
|
4432
|
+
next.push(`git -C ${rel} commit -m "${message}"`);
|
|
4433
|
+
for (const c of ending.clones)
|
|
4434
|
+
next.push(
|
|
4435
|
+
`git -C ${c.dir} add ${c.paths.join(" ")} && git -C ${c.dir} commit -m "${message}"`
|
|
4436
|
+
);
|
|
4437
|
+
if (ending.commit !== "nothing")
|
|
4438
|
+
next.push("# teammates: git pull \u2014 the next rness command installs it");
|
|
4364
4439
|
if (ui.session) {
|
|
4365
|
-
ui.note("Next steps", next);
|
|
4440
|
+
if (next.length > 0) ui.note("Next steps", next);
|
|
4366
4441
|
ui.outro(`${label} runs @rness/cli ${target}`);
|
|
4367
4442
|
} else
|
|
4368
4443
|
process.stdout.write(
|
|
@@ -4370,12 +4445,10 @@ function finish(ui, cwd, rnessDir, label, target) {
|
|
|
4370
4445
|
"",
|
|
4371
4446
|
status("upgraded", `${label} to @rness/cli ${target}`),
|
|
4372
4447
|
"",
|
|
4373
|
-
"Next:",
|
|
4374
|
-
...next.map((line2) => ` ${line2}`),
|
|
4375
|
-
""
|
|
4448
|
+
...next.length > 0 ? ["Next:", ...next.map((line2) => ` ${line2}`), ""] : []
|
|
4376
4449
|
].join("\n")
|
|
4377
4450
|
);
|
|
4378
|
-
return 0;
|
|
4451
|
+
return ending.commit === "refused" ? 1 : 0;
|
|
4379
4452
|
}
|
|
4380
4453
|
async function upgradeCommand(version, opts, terminal = defaultTerminal, deps = {}) {
|
|
4381
4454
|
const cwd = opts.cwd ?? process.cwd();
|
|
@@ -4424,6 +4497,13 @@ async function upgradeCommand(version, opts, terminal = defaultTerminal, deps =
|
|
|
4424
4497
|
`);
|
|
4425
4498
|
return 1;
|
|
4426
4499
|
}
|
|
4500
|
+
if (await mergeInProgress(ws.rnessDir)) {
|
|
4501
|
+
process.stderr.write(
|
|
4502
|
+
`${label} has a merge in progress; commit it, or abort it with git -C ${relative5(cwd, ws.rnessDir) || "."} merge --abort, then ${rnessCommand()} upgrade
|
|
4503
|
+
`
|
|
4504
|
+
);
|
|
4505
|
+
return 1;
|
|
4506
|
+
}
|
|
4427
4507
|
if (!await isClean(ws.rnessDir)) {
|
|
4428
4508
|
process.stderr.write(
|
|
4429
4509
|
`${label} has uncommitted changes; commit or stash them, then ${rnessCommand()} upgrade
|
|
@@ -4532,48 +4612,71 @@ async function upgradeCommand(version, opts, terminal = defaultTerminal, deps =
|
|
|
4532
4612
|
const moved = await readPin(ws.rnessDir);
|
|
4533
4613
|
if (moved !== null && moved.spec !== target)
|
|
4534
4614
|
await writePin(ws.rnessDir, moved.spec, target);
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
);
|
|
4543
|
-
} catch (e) {
|
|
4544
|
-
const message = e instanceof Error ? e.message : String(e);
|
|
4545
|
-
ui.error(message);
|
|
4546
|
-
if (!merged) {
|
|
4547
|
-
for (const [file, text] of restore) await writeFileAtomic(file, text);
|
|
4548
|
-
ui.hint(
|
|
4549
|
-
`restored ${relative5(cwd, packageFile) || packageFile}`,
|
|
4550
|
-
"stderr"
|
|
4615
|
+
const mustInstall = !(pin.spec === target && installed === target);
|
|
4616
|
+
if (mustInstall) {
|
|
4617
|
+
try {
|
|
4618
|
+
await ui.step(
|
|
4619
|
+
{ doing: `installing dependencies with ${pm}` },
|
|
4620
|
+
() => installDependencies(pm, ws.rnessDir),
|
|
4621
|
+
() => ["installed", `dependencies with ${pm}`]
|
|
4551
4622
|
);
|
|
4623
|
+
} catch (e) {
|
|
4624
|
+
const message2 = e instanceof Error ? e.message : String(e);
|
|
4625
|
+
ui.error(message2);
|
|
4626
|
+
if (!merged) {
|
|
4627
|
+
for (const [file, text] of restore) await writeFileAtomic(file, text);
|
|
4628
|
+
ui.hint(
|
|
4629
|
+
`restored ${relative5(cwd, packageFile) || packageFile}`,
|
|
4630
|
+
"stderr"
|
|
4631
|
+
);
|
|
4632
|
+
}
|
|
4633
|
+
if (merged)
|
|
4634
|
+
ui.hint(
|
|
4635
|
+
`the scaffold merge is still staged; undo it with: git -C ${relative5(cwd, ws.rnessDir) || "."} merge --abort`,
|
|
4636
|
+
"stderr"
|
|
4637
|
+
);
|
|
4638
|
+
if (/minimum.?release.?age|NO_MATURE/i.test(message2))
|
|
4639
|
+
ui.hint(
|
|
4640
|
+
"pnpm refuses versions published less than 24 h ago: add '@rness/cli' under minimumReleaseAgeExclude in .rness/pnpm-workspace.yaml",
|
|
4641
|
+
"stderr"
|
|
4642
|
+
);
|
|
4643
|
+
return 1;
|
|
4552
4644
|
}
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
"
|
|
4557
|
-
);
|
|
4558
|
-
if (/minimum.?release.?age|NO_MATURE/i.test(message))
|
|
4559
|
-
ui.hint(
|
|
4560
|
-
"pnpm refuses versions published less than 24 h ago: add '@rness/cli' under minimumReleaseAgeExclude in .rness/pnpm-workspace.yaml",
|
|
4561
|
-
"stderr"
|
|
4562
|
-
);
|
|
4563
|
-
return 1;
|
|
4564
|
-
}
|
|
4565
|
-
const now = (await readPinnedCli(ws.rnessDir))?.version ?? null;
|
|
4566
|
-
if (now !== target) {
|
|
4567
|
-
process.stderr.write(
|
|
4568
|
-
`${pm} install left @rness/cli ${now ?? "not installed"} in ${label}, not ${target}
|
|
4645
|
+
const now = (await readPinnedCli(ws.rnessDir))?.version ?? null;
|
|
4646
|
+
if (now !== target) {
|
|
4647
|
+
process.stderr.write(
|
|
4648
|
+
`${pm} install left @rness/cli ${now ?? "not installed"} in ${label}, not ${target}
|
|
4569
4649
|
`
|
|
4570
|
-
|
|
4571
|
-
|
|
4650
|
+
);
|
|
4651
|
+
return 1;
|
|
4652
|
+
}
|
|
4572
4653
|
}
|
|
4573
4654
|
ui.gitIsSilent = true;
|
|
4574
4655
|
const code = await syncBlocks(ui, ws.root, basename5(ws.root));
|
|
4575
4656
|
if (code !== 0) return code;
|
|
4576
|
-
|
|
4657
|
+
const message = `chore: rness ${target}`;
|
|
4658
|
+
const committed = await commitUpgrade(ws.rnessDir, message);
|
|
4659
|
+
if (committed.kind === "committed")
|
|
4660
|
+
ui.line(
|
|
4661
|
+
"committed",
|
|
4662
|
+
`${label} \u2014 ${message}`,
|
|
4663
|
+
`Committed ${label}: ${message}`
|
|
4664
|
+
);
|
|
4665
|
+
if (committed.kind === "refused") {
|
|
4666
|
+
ui.error(
|
|
4667
|
+
`the commit of ${label} was refused; everything is staged \u2014 deal with what git said, then commit`
|
|
4668
|
+
);
|
|
4669
|
+
for (const line2 of committed.output.split("\n"))
|
|
4670
|
+
if (line2.trim() !== "") ui.hint(line2, "stderr");
|
|
4671
|
+
}
|
|
4672
|
+
return finish(ui, cwd, ws.rnessDir, label, target, {
|
|
4673
|
+
commit: committed.kind,
|
|
4674
|
+
clones: await clonesToCommit(
|
|
4675
|
+
ws.root,
|
|
4676
|
+
cwd,
|
|
4677
|
+
await loadManifest(ws.rnessDir)
|
|
4678
|
+
)
|
|
4679
|
+
});
|
|
4577
4680
|
} catch (e) {
|
|
4578
4681
|
return reportError(e);
|
|
4579
4682
|
}
|
|
@@ -5416,4 +5519,4 @@ export {
|
|
|
5416
5519
|
OWN_COMMANDS,
|
|
5417
5520
|
catchUp
|
|
5418
5521
|
};
|
|
5419
|
-
//# sourceMappingURL=chunk-
|
|
5522
|
+
//# sourceMappingURL=chunk-JKDF7ROY.js.map
|