Session 5 of voyage-rebrand (V6). Operator-authorized cross-plugin scope. - git mv plugins/ultraplan-local plugins/voyage (rename detected, history preserved) - .claude-plugin/marketplace.json: voyage entry replaces ultraplan-local - CLAUDE.md: voyage row in plugin list, voyage in design-system consumer list - README.md: bulk rename ultra*-local commands -> trek* commands; ultraplan-local refs -> voyage; type discriminators (type: trekbrief/trekreview); session-title pattern (voyage:<command>:<slug>); v4.0.0 release-note paragraph - plugins/voyage/.claude-plugin/plugin.json: homepage/repository URLs point to monorepo voyage path - plugins/voyage/verify.sh: drop URL whitelist exception (no longer needed) Closes voyage-rebrand. bash plugins/voyage/verify.sh PASS 7/7. npm test 361/361.
14 lines
531 B
JavaScript
14 lines
531 B
JavaScript
// lib/util/atomic-write.mjs
|
|
// Atomic JSON file write — writes to {path}.tmp then renames to {path}.
|
|
// Crash-safe: a partial write leaves the original file untouched.
|
|
//
|
|
// Extracted from hooks/scripts/pre-compact-flush.mjs in v3.3.0 so that
|
|
// session-state writers and progress.json writers share one implementation.
|
|
|
|
import { writeFileSync, renameSync } from 'node:fs';
|
|
|
|
export function atomicWriteJson(path, obj) {
|
|
const tmp = path + '.tmp';
|
|
writeFileSync(tmp, JSON.stringify(obj, null, 2));
|
|
renameSync(tmp, path);
|
|
}
|