@c-d-cc/reap 0.7.7 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +22 -13
  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: [] };
@@ -10762,17 +10776,6 @@ async function updateProject(projectRoot, dryRun = false) {
10762
10776
  async function migrateLegacyFiles(paths, dryRun, result) {
10763
10777
  await removeDirIfExists(paths.legacyCommands, ".reap/commands/", dryRun, result);
10764
10778
  await removeDirIfExists(paths.legacyTemplates, ".reap/templates/", dryRun, result);
10765
- try {
10766
- const claudeCmdDir = paths.legacyClaudeCommands;
10767
- const files = await readdir9(claudeCmdDir);
10768
- for (const file of files) {
10769
- if (file.startsWith("reap.") && file.endsWith(".md")) {
10770
- if (!dryRun)
10771
- await unlink3(join10(claudeCmdDir, file));
10772
- result.removed.push(`.claude/commands/${file}`);
10773
- }
10774
- }
10775
- } catch {}
10776
10779
  try {
10777
10780
  const legacyHooksJson = paths.legacyClaudeHooksJson;
10778
10781
  const fileContent = await readTextFile(legacyHooksJson);
@@ -10906,7 +10909,7 @@ async function fixProject(projectRoot) {
10906
10909
  // src/cli/index.ts
10907
10910
  init_fs();
10908
10911
  import { join as join11 } from "path";
10909
- program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.7.7");
10912
+ program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.7.9");
10910
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) => {
10911
10914
  try {
10912
10915
  const cwd = process.cwd();
@@ -10994,8 +10997,14 @@ program.command("fix").description("Diagnose and repair .reap/ directory structu
10994
10997
  process.exit(1);
10995
10998
  }
10996
10999
  });
10997
- program.command("update").description("Sync slash commands, templates, and hooks to the latest version").option("--dry-run", "Show changes without applying them").action(async (options) => {
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) => {
10998
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
+ }
10999
11008
  const result = await updateProject(process.cwd(), options.dryRun ?? false);
11000
11009
  if (options.dryRun) {
11001
11010
  console.log("[dry-run] Changes that would be applied:");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c-d-cc/reap",
3
- "version": "0.7.7",
3
+ "version": "0.7.9",
4
4
  "description": "Recursive Evolutionary Autonomous Pipeline — AI and humans evolve software across generations",
5
5
  "type": "module",
6
6
  "license": "MIT",