@c-d-cc/reap 0.7.8 → 0.7.9
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/cli.js +22 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9861,6 +9861,7 @@ async function initProject(projectRoot, projectName, entryMode, preset, onProgre
|
|
|
9861
9861
|
// src/cli/commands/update.ts
|
|
9862
9862
|
import { readdir as readdir9, unlink as unlink3, rm as rm2, mkdir as mkdir6 } from "fs/promises";
|
|
9863
9863
|
import { join as join10 } from "path";
|
|
9864
|
+
import { execSync } from "child_process";
|
|
9864
9865
|
|
|
9865
9866
|
// src/core/hooks.ts
|
|
9866
9867
|
async function migrateHooks(dryRun = false) {
|
|
@@ -10647,6 +10648,19 @@ async function migrateLineage(paths) {
|
|
|
10647
10648
|
}
|
|
10648
10649
|
|
|
10649
10650
|
// src/cli/commands/update.ts
|
|
10651
|
+
function selfUpgrade() {
|
|
10652
|
+
try {
|
|
10653
|
+
const installed = execSync("reap --version", { encoding: "utf-8", timeout: 5000 }).trim();
|
|
10654
|
+
const latest = execSync("npm view @c-d-cc/reap version", { encoding: "utf-8", timeout: 1e4 }).trim();
|
|
10655
|
+
if (installed === latest) {
|
|
10656
|
+
return { upgraded: false };
|
|
10657
|
+
}
|
|
10658
|
+
execSync("npm update -g @c-d-cc/reap", { encoding: "utf-8", timeout: 60000, stdio: "pipe" });
|
|
10659
|
+
return { upgraded: true, from: installed, to: latest };
|
|
10660
|
+
} catch {
|
|
10661
|
+
return { upgraded: false };
|
|
10662
|
+
}
|
|
10663
|
+
}
|
|
10650
10664
|
async function updateProject(projectRoot, dryRun = false) {
|
|
10651
10665
|
const paths = new ReapPaths(projectRoot);
|
|
10652
10666
|
const result = { updated: [], skipped: [], removed: [] };
|
|
@@ -10895,7 +10909,7 @@ async function fixProject(projectRoot) {
|
|
|
10895
10909
|
// src/cli/index.ts
|
|
10896
10910
|
init_fs();
|
|
10897
10911
|
import { join as join11 } from "path";
|
|
10898
|
-
program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.7.
|
|
10912
|
+
program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.7.9");
|
|
10899
10913
|
program.command("init").description("Initialize a new REAP project (Genesis)").argument("[project-name]", "Project name (defaults to current directory name)").option("-m, --mode <mode>", "Entry mode: greenfield, migration, adoption", "greenfield").option("-p, --preset <preset>", "Bootstrap with a genome preset (e.g., bun-hono-react)").action(async (projectName, options) => {
|
|
10900
10914
|
try {
|
|
10901
10915
|
const cwd = process.cwd();
|
|
@@ -10983,8 +10997,14 @@ program.command("fix").description("Diagnose and repair .reap/ directory structu
|
|
|
10983
10997
|
process.exit(1);
|
|
10984
10998
|
}
|
|
10985
10999
|
});
|
|
10986
|
-
program.command("update").description("
|
|
11000
|
+
program.command("update").description("Upgrade REAP package and sync slash commands, templates, and hooks").option("--dry-run", "Show changes without applying them").action(async (options) => {
|
|
10987
11001
|
try {
|
|
11002
|
+
if (!options.dryRun) {
|
|
11003
|
+
const upgrade = selfUpgrade();
|
|
11004
|
+
if (upgrade.upgraded) {
|
|
11005
|
+
console.log(`Upgraded: v${upgrade.from} → v${upgrade.to}`);
|
|
11006
|
+
}
|
|
11007
|
+
}
|
|
10988
11008
|
const result = await updateProject(process.cwd(), options.dryRun ?? false);
|
|
10989
11009
|
if (options.dryRun) {
|
|
10990
11010
|
console.log("[dry-run] Changes that would be applied:");
|