@kianax/wt 0.1.0 → 0.1.4

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 +82 -86
  2. package/package.json +1 -2
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bun
1
+ #!/usr/bin/env node
2
2
  // @bun
3
3
  import { createRequire } from "node:module";
4
4
  var __create = Object.create;
@@ -14851,7 +14851,7 @@ var package_default;
14851
14851
  var init_package = __esm(() => {
14852
14852
  package_default = {
14853
14853
  name: "@kianax/wt",
14854
- version: "0.1.0",
14854
+ version: "0.1.4",
14855
14855
  description: "Git worktree manager - make worktrees as effortless as branches",
14856
14856
  type: "module",
14857
14857
  main: "dist/cli.js",
@@ -14888,7 +14888,6 @@ var init_package = __esm(() => {
14888
14888
  chalk: "^5.6.2",
14889
14889
  ink: "^6.6.0",
14890
14890
  react: "^19.2.3",
14891
- "react-devtools-core": "^7.0.1",
14892
14891
  zod: "^4.3.5"
14893
14892
  },
14894
14893
  devDependencies: {
@@ -29234,7 +29233,7 @@ var init_measure_text = __esm(() => {
29234
29233
  measure_text_default = measureText;
29235
29234
  });
29236
29235
 
29237
- // node_modules/slice-ansi/node_modules/is-fullwidth-code-point/index.js
29236
+ // node_modules/is-fullwidth-code-point/index.js
29238
29237
  function isFullwidthCodePoint(codePoint) {
29239
29238
  if (!Number.isInteger(codePoint)) {
29240
29239
  return false;
@@ -50439,17 +50438,6 @@ var init_styledChars = __esm(() => {
50439
50438
  init_reduce();
50440
50439
  });
50441
50440
 
50442
- // node_modules/is-fullwidth-code-point/index.js
50443
- function isFullwidthCodePoint2(codePoint) {
50444
- if (!Number.isInteger(codePoint)) {
50445
- return false;
50446
- }
50447
- return isFullWidth(codePoint) || isWide(codePoint);
50448
- }
50449
- var init_is_fullwidth_code_point2 = __esm(() => {
50450
- init_get_east_asian_width();
50451
- });
50452
-
50453
50441
  // node_modules/@alcalzone/ansi-tokenize/build/tokenize.js
50454
50442
  function parseLinkCode(string4, offset) {
50455
50443
  string4 = string4.slice(offset);
@@ -50542,7 +50530,7 @@ function tokenize2(str, endChar = Number.POSITIVE_INFINITY) {
50542
50530
  continue;
50543
50531
  }
50544
50532
  }
50545
- const fullWidth = isFullwidthCodePoint2(codePoint);
50533
+ const fullWidth = isFullwidthCodePoint(codePoint);
50546
50534
  const character = String.fromCodePoint(codePoint);
50547
50535
  ret.push({
50548
50536
  type: "char",
@@ -50559,7 +50547,7 @@ function tokenize2(str, endChar = Number.POSITIVE_INFINITY) {
50559
50547
  }
50560
50548
  var CC_0 = 48, CC_9 = 57, CC_SEMI = 59, CC_M = 109;
50561
50549
  var init_tokenize = __esm(() => {
50562
- init_is_fullwidth_code_point2();
50550
+ init_is_fullwidth_code_point();
50563
50551
  init_ansiCodes();
50564
50552
  });
50565
50553
 
@@ -53464,6 +53452,41 @@ var init_version = __esm(() => {
53464
53452
  VERSION2 = package_default.version;
53465
53453
  });
53466
53454
 
53455
+ // src/tui/components/columns.ts
53456
+ function formatRow(parts) {
53457
+ const { cursor, icon, name, path, age, status, suffix = "" } = parts;
53458
+ return [
53459
+ cursor.padEnd(COLUMNS.cursor),
53460
+ icon.padEnd(COLUMNS.icon),
53461
+ name.padEnd(COLUMNS.name),
53462
+ path.padEnd(COLUMNS.path),
53463
+ age.padEnd(COLUMNS.age),
53464
+ status.padEnd(COLUMNS.status),
53465
+ suffix
53466
+ ].join("");
53467
+ }
53468
+ function formatHeader() {
53469
+ return formatRow({
53470
+ cursor: "",
53471
+ icon: "",
53472
+ name: "name",
53473
+ path: "path",
53474
+ age: "age",
53475
+ status: "status"
53476
+ });
53477
+ }
53478
+ var COLUMNS;
53479
+ var init_columns = __esm(() => {
53480
+ COLUMNS = {
53481
+ cursor: 2,
53482
+ icon: 2,
53483
+ name: 20,
53484
+ path: 32,
53485
+ age: 4,
53486
+ status: 8
53487
+ };
53488
+ });
53489
+
53467
53490
  // src/tui/components/WorktreeItem.tsx
53468
53491
  function WorktreeItem({
53469
53492
  worktree,
@@ -53478,8 +53501,6 @@ function WorktreeItem({
53478
53501
  }
53479
53502
  }).catch(() => {});
53480
53503
  }, [worktree.path]);
53481
- const cursor = isSelected ? ">" : " ";
53482
- const icon = isCurrent ? "●" : "○";
53483
53504
  const path = contractHome(worktree.path);
53484
53505
  let statusBadge = "";
53485
53506
  let statusColor;
@@ -53505,79 +53526,61 @@ function WorktreeItem({
53505
53526
  statusBadge = "synced";
53506
53527
  statusColor = theme.status.synced;
53507
53528
  }
53508
- const maxPathLen = 32;
53509
- const displayPath = path.length > maxPathLen ? `...${path.slice(-(maxPathLen - 3))}` : path;
53510
- const { ahead, behind } = worktree;
53511
- const nameWidth = 20;
53529
+ const displayPath = path.length > COLUMNS.path ? `...${path.slice(-(COLUMNS.path - 3))}` : path;
53512
53530
  const primarySuffix = worktree.isPrimary ? " *" : "";
53513
- const maxNameLen = nameWidth - primarySuffix.length;
53514
- const truncatedName = worktree.name.slice(0, maxNameLen);
53515
- const namePadding = " ".repeat(nameWidth - truncatedName.length - primarySuffix.length);
53516
- const pathStr = displayPath.padEnd(32);
53517
- const ageStr = (age || "").padEnd(4);
53518
- const statusStr = statusBadge.padEnd(8);
53531
+ const maxNameLen = COLUMNS.name - primarySuffix.length;
53532
+ const displayName = worktree.name.slice(0, maxNameLen) + primarySuffix;
53533
+ const { ahead, behind } = worktree;
53534
+ let syncSuffix = "";
53535
+ if (ahead !== undefined && ahead > 0)
53536
+ syncSuffix += `+${ahead}`;
53537
+ if (behind !== undefined && behind > 0)
53538
+ syncSuffix += `-${behind}`;
53539
+ const rowText = formatRow({
53540
+ cursor: isSelected ? ">" : "",
53541
+ icon: isCurrent ? "*" : "",
53542
+ name: displayName,
53543
+ path: displayPath,
53544
+ age: age || "",
53545
+ status: statusBadge,
53546
+ suffix: syncSuffix
53547
+ });
53548
+ const cursorEnd = COLUMNS.cursor;
53549
+ const iconEnd = cursorEnd + COLUMNS.icon;
53550
+ const nameEnd = iconEnd + COLUMNS.name;
53551
+ const pathEnd = nameEnd + COLUMNS.path;
53552
+ const ageEnd = pathEnd + COLUMNS.age;
53553
+ const statusEnd = ageEnd + COLUMNS.status;
53519
53554
  return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
53520
53555
  children: [
53521
53556
  /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53522
53557
  color: isSelected ? theme.accent : undefined,
53523
- children: [
53524
- cursor,
53525
- " "
53526
- ]
53527
- }, undefined, true, undefined, this),
53558
+ children: rowText.slice(0, cursorEnd)
53559
+ }, undefined, false, undefined, this),
53528
53560
  /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53529
53561
  color: isCurrent ? theme.accent : "dim",
53530
- children: icon
53562
+ children: rowText.slice(cursorEnd, iconEnd)
53531
53563
  }, undefined, false, undefined, this),
53532
53564
  /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53533
53565
  color: isSelected ? theme.accent : undefined,
53534
- children: [
53535
- " ",
53536
- truncatedName
53537
- ]
53538
- }, undefined, true, undefined, this),
53539
- worktree.isPrimary && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53540
- color: theme.status.primary,
53541
- children: primarySuffix
53542
- }, undefined, false, undefined, this),
53543
- /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53544
- children: namePadding
53566
+ children: rowText.slice(iconEnd, nameEnd)
53545
53567
  }, undefined, false, undefined, this),
53546
53568
  /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53547
53569
  dimColor: true,
53548
- children: [
53549
- " ",
53550
- pathStr
53551
- ]
53552
- }, undefined, true, undefined, this),
53570
+ children: rowText.slice(nameEnd, pathEnd)
53571
+ }, undefined, false, undefined, this),
53553
53572
  /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53554
53573
  dimColor: true,
53555
- children: [
53556
- " ",
53557
- ageStr
53558
- ]
53559
- }, undefined, true, undefined, this),
53574
+ children: rowText.slice(pathEnd, ageEnd)
53575
+ }, undefined, false, undefined, this),
53560
53576
  /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53561
53577
  color: statusColor,
53562
- children: [
53563
- " ",
53564
- statusStr
53565
- ]
53566
- }, undefined, true, undefined, this),
53567
- ahead !== undefined && ahead > 0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53568
- color: theme.ui.success,
53569
- children: [
53570
- "↑",
53571
- ahead
53572
- ]
53573
- }, undefined, true, undefined, this),
53574
- behind !== undefined && behind > 0 && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53575
- color: theme.status.behind,
53576
- children: [
53577
- "↓",
53578
- behind
53579
- ]
53580
- }, undefined, true, undefined, this)
53578
+ children: rowText.slice(ageEnd, statusEnd)
53579
+ }, undefined, false, undefined, this),
53580
+ /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Text, {
53581
+ color: ahead && ahead > 0 ? theme.ui.success : theme.status.behind,
53582
+ children: rowText.slice(statusEnd)
53583
+ }, undefined, false, undefined, this)
53581
53584
  ]
53582
53585
  }, undefined, true, undefined, this);
53583
53586
  }
@@ -53586,6 +53589,7 @@ var init_WorktreeItem = __esm(async () => {
53586
53589
  init_log();
53587
53590
  init_paths();
53588
53591
  init_theme();
53592
+ init_columns();
53589
53593
  await init_build2();
53590
53594
  import_react30 = __toESM(require_react(), 1);
53591
53595
  jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
@@ -53652,17 +53656,8 @@ function WorktreeList({
53652
53656
  width: boxWidth - 2,
53653
53657
  children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
53654
53658
  dimColor: true,
53655
- children: [
53656
- " ",
53657
- "name".padEnd(20),
53658
- " ",
53659
- "path".padEnd(32),
53660
- " ",
53661
- "age".padEnd(4),
53662
- " ",
53663
- "status".padEnd(8)
53664
- ]
53665
- }, undefined, true, undefined, this)
53659
+ children: formatHeader()
53660
+ }, undefined, false, undefined, this)
53666
53661
  }, undefined, false, undefined, this),
53667
53662
  /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text, {
53668
53663
  dimColor: true,
@@ -53704,6 +53699,7 @@ function WorktreeList({
53704
53699
  var jsx_dev_runtime7;
53705
53700
  var init_WorktreeList = __esm(async () => {
53706
53701
  init_version();
53702
+ init_columns();
53707
53703
  await __promiseAll([
53708
53704
  init_build2(),
53709
53705
  init_WorktreeItem()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kianax/wt",
3
- "version": "0.1.0",
3
+ "version": "0.1.4",
4
4
  "description": "Git worktree manager - make worktrees as effortless as branches",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
@@ -37,7 +37,6 @@
37
37
  "chalk": "^5.6.2",
38
38
  "ink": "^6.6.0",
39
39
  "react": "^19.2.3",
40
- "react-devtools-core": "^7.0.1",
41
40
  "zod": "^4.3.5"
42
41
  },
43
42
  "devDependencies": {