xab 5.0.0 → 6.0.0

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/index.js +43 -25
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -1182,28 +1182,15 @@ async function validateApply(worktreeGit, beforeHash) {
1182
1182
  const worktreeClean = modified.length === 0 && created.length === 0 && deleted.length === 0 && conflicted.length === 0 && notAdded.length === 0;
1183
1183
  const dirtyFiles = [];
1184
1184
  if (!worktreeClean) {
1185
- const parts = [];
1186
- if (modified.length) {
1187
- parts.push(`${modified.length} modified`);
1188
- for (const f of modified)
1189
- dirtyFiles.push(`M ${f}`);
1190
- }
1191
- if (notAdded.length) {
1192
- parts.push(`${notAdded.length} untracked`);
1193
- for (const f of notAdded)
1194
- dirtyFiles.push(`? ${f}`);
1195
- }
1196
- if (deleted.length) {
1197
- parts.push(`${deleted.length} deleted`);
1198
- for (const f of deleted)
1199
- dirtyFiles.push(`D ${f}`);
1200
- }
1201
- if (conflicted.length) {
1202
- parts.push(`${conflicted.length} conflicted`);
1203
- for (const f of conflicted)
1204
- dirtyFiles.push(`C ${f}`);
1205
- }
1206
- errors.push(`Working tree not clean: ${parts.join(", ")}`);
1185
+ for (const f of modified)
1186
+ dirtyFiles.push(`M ${f}`);
1187
+ for (const f of notAdded)
1188
+ dirtyFiles.push(`? ${f}`);
1189
+ for (const f of deleted)
1190
+ dirtyFiles.push(`D ${f}`);
1191
+ for (const f of conflicted)
1192
+ dirtyFiles.push(`C ${f}`);
1193
+ errors.push(`Working tree not clean (${dirtyFiles.length} files): ${dirtyFiles.join(", ")}`);
1207
1194
  }
1208
1195
  const conflictMarkers = [];
1209
1196
  if (newCommitHash) {
@@ -1791,6 +1778,16 @@ __export(exports_batch, {
1791
1778
  runBatch: () => runBatch
1792
1779
  });
1793
1780
  import chalk from "chalk";
1781
+ import { readFileSync as readFileSync5 } from "fs";
1782
+ import { join as join6 } from "path";
1783
+ function getVersion() {
1784
+ try {
1785
+ const pkg = JSON.parse(readFileSync5(join6(import.meta.dir, "..", "package.json"), "utf-8"));
1786
+ return pkg.version ?? "?";
1787
+ } catch {
1788
+ return "?";
1789
+ }
1790
+ }
1794
1791
  function shortHash2(h) {
1795
1792
  return h.slice(0, 8);
1796
1793
  }
@@ -1846,8 +1843,9 @@ function emitJsonl(obj) {
1846
1843
  async function runBatch(opts) {
1847
1844
  const jsonl = opts.jsonl ?? false;
1848
1845
  const startTime = Date.now();
1846
+ const version = getVersion();
1849
1847
  log("");
1850
- log(` ${chalk.cyan.bold("xab")} ${chalk.dim("\u2014 curated branch reconciliation")}`);
1848
+ log(` ${chalk.cyan.bold("xab")} ${chalk.dim(`v${version}`)} ${chalk.dim("\u2014 curated branch reconciliation")}`);
1851
1849
  log(` ${chalk.magenta(opts.sourceRef)} ${chalk.dim("\u2192")} ${chalk.green(opts.targetRef)}`);
1852
1850
  if (opts.workBranch)
1853
1851
  log(` ${chalk.dim("work branch:")} ${chalk.cyan(opts.workBranch)}`);
@@ -2041,7 +2039,16 @@ import { useState, useEffect, useCallback, useRef } from "react";
2041
2039
  import { Box, Text, useInput, useApp, Static, Newline } from "ink";
2042
2040
  import SelectInput from "ink-select-input";
2043
2041
  import Spinner from "ink-spinner";
2042
+ import { readFileSync as readFileSync4 } from "fs";
2043
+ import { join as join5 } from "path";
2044
2044
  import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
2045
+ var XAB_VERSION = (() => {
2046
+ try {
2047
+ return JSON.parse(readFileSync4(join5(import.meta.dir, "..", "package.json"), "utf-8")).version ?? "?";
2048
+ } catch {
2049
+ return "?";
2050
+ }
2051
+ })();
2045
2052
  function shortHash(h) {
2046
2053
  return h.slice(0, 8);
2047
2054
  }
@@ -2066,8 +2073,15 @@ function Header({
2066
2073
  /* @__PURE__ */ jsxDEV(Text, {
2067
2074
  bold: true,
2068
2075
  color: "cyan",
2069
- children: "\u256D\u2500 backmerge"
2076
+ children: "\u256D\u2500 xab"
2070
2077
  }, undefined, false, undefined, this),
2078
+ /* @__PURE__ */ jsxDEV(Text, {
2079
+ dimColor: true,
2080
+ children: [
2081
+ " v",
2082
+ XAB_VERSION
2083
+ ]
2084
+ }, undefined, true, undefined, this),
2071
2085
  /* @__PURE__ */ jsxDEV(Text, {
2072
2086
  color: "gray",
2073
2087
  children: " \u2014 curated branch reconciliation"
@@ -2839,8 +2853,12 @@ for (let i = 0;i < args.length; i++) {
2839
2853
  repoPath = arg;
2840
2854
  }
2841
2855
  if (showHelp) {
2856
+ let version = "?";
2857
+ try {
2858
+ version = JSON.parse(await Bun.file(new URL("./package.json", import.meta.url).pathname).text()).version;
2859
+ } catch {}
2842
2860
  console.log(`
2843
- xab \u2014 AI-powered curated branch reconciliation
2861
+ xab v${version} \u2014 AI-powered curated branch reconciliation
2844
2862
 
2845
2863
  Usage:
2846
2864
  xab [repo-path] [options]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xab",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "description": "AI-powered curated branch reconciliation engine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -32,6 +32,7 @@
32
32
  "ink-spinner": "^5.0.0",
33
33
  "ink-text-input": "^6.0.0",
34
34
  "react": "18.3.1",
35
- "simple-git": "^3.33.0"
35
+ "simple-git": "^3.33.0",
36
+ "xab": "^5.0.0"
36
37
  }
37
38
  }