@kaynooo/cli-git 0.11.0 → 0.12.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.
package/dist/gb.js CHANGED
@@ -518,21 +518,6 @@ var STATUS_WORDS = {
518
518
  skipped: ["skipped", "cancelled", "canceled", "manual"]
519
519
  };
520
520
  var STATUS_OF = new Map(Object.entries(STATUS_WORDS).flatMap(([status, words]) => words.map((word) => [word, status])));
521
- function header(bin, context, stream, env = process6.env) {
522
- if (!takesControlCodes(stream, env))
523
- return "";
524
- const colors = paint(stream, env);
525
- const hash = [...bin].reduce((sum, char) => sum + char.charCodeAt(0), 0);
526
- const { theme } = activeTheme();
527
- const spec = theme.bins[bin] ?? theme.accents[hash % theme.accents.length];
528
- const accent = tinted(typeof spec === "string" && spec.split(" ").includes("bold") ? colors : colors.bold, spec, env);
529
- return `${accent(bin)}${context === undefined ? "" : colors.dim(` \u203A ${context}`)}`;
530
- }
531
- function printHeader(bin, context, stream = process6.stdout, env = process6.env) {
532
- const line = header(bin, context, stream, env);
533
- if (line !== "")
534
- console.log(line);
535
- }
536
521
 
537
522
  // ../kit/src/format.ts
538
523
  function upTo(text, separator) {
@@ -2091,7 +2076,7 @@ function load() {
2091
2076
  function isCurrent(named, current, found) {
2092
2077
  return current !== "" && (named === current || found.some((branch) => branch.remote && branch.name === named && localName(branch.name) === current));
2093
2078
  }
2094
- function header2(found, current, failure = "") {
2079
+ function header(found, current, failure = "") {
2095
2080
  const changed = read(["status", "--porcelain", "--untracked-files=no"]).split(`
2096
2081
  `).filter(Boolean).length;
2097
2082
  const here = found.find((branch) => !branch.remote && branch.name === current) ?? (current ? { name: current, upstream: "", track: "" } : undefined);
@@ -2102,7 +2087,7 @@ ${KEYS2}`;
2102
2087
  async function fetched() {
2103
2088
  const proc = Bun.spawn(["git", "fetch", "--all", "--prune", "--quiet"], { stdout: "ignore", stderr: "ignore" });
2104
2089
  const success = await proc.exited === 0;
2105
- return header2(branches(base()), read(["branch", "--show-current"]), success ? "" : "fetch failed");
2090
+ return header(branches(base()), read(["branch", "--show-current"]), success ? "" : "fetch failed");
2106
2091
  }
2107
2092
  function listed2(all) {
2108
2093
  list([
@@ -2184,7 +2169,7 @@ async function gb(args) {
2184
2169
  }
2185
2170
  const picked = await pick(all.map(row), {
2186
2171
  prompt: "gb> ",
2187
- header: header2(found, current),
2172
+ header: header(found, current),
2188
2173
  expect: ["ctrl-d", "ctrl-n"],
2189
2174
  searched: 1,
2190
2175
  preview: (fields) => preview(fields[0]),
package/dist/gc.js CHANGED
@@ -518,21 +518,6 @@ var STATUS_WORDS = {
518
518
  skipped: ["skipped", "cancelled", "canceled", "manual"]
519
519
  };
520
520
  var STATUS_OF = new Map(Object.entries(STATUS_WORDS).flatMap(([status, words]) => words.map((word) => [word, status])));
521
- function header(bin, context, stream, env = process6.env) {
522
- if (!takesControlCodes(stream, env))
523
- return "";
524
- const colors = paint(stream, env);
525
- const hash = [...bin].reduce((sum, char) => sum + char.charCodeAt(0), 0);
526
- const { theme } = activeTheme();
527
- const spec = theme.bins[bin] ?? theme.accents[hash % theme.accents.length];
528
- const accent = tinted(typeof spec === "string" && spec.split(" ").includes("bold") ? colors : colors.bold, spec, env);
529
- return `${accent(bin)}${context === undefined ? "" : colors.dim(` \u203A ${context}`)}`;
530
- }
531
- function printHeader(bin, context, stream = process6.stdout, env = process6.env) {
532
- const line = header(bin, context, stream, env);
533
- if (line !== "")
534
- console.log(line);
535
- }
536
521
 
537
522
  // ../kit/src/format.ts
538
523
  function upTo(text, separator) {
package/dist/gst.js CHANGED
@@ -518,21 +518,6 @@ var STATUS_WORDS = {
518
518
  skipped: ["skipped", "cancelled", "canceled", "manual"]
519
519
  };
520
520
  var STATUS_OF = new Map(Object.entries(STATUS_WORDS).flatMap(([status, words]) => words.map((word) => [word, status])));
521
- function header(bin, context, stream, env = process6.env) {
522
- if (!takesControlCodes(stream, env))
523
- return "";
524
- const colors = paint(stream, env);
525
- const hash = [...bin].reduce((sum, char) => sum + char.charCodeAt(0), 0);
526
- const { theme } = activeTheme();
527
- const spec = theme.bins[bin] ?? theme.accents[hash % theme.accents.length];
528
- const accent = tinted(typeof spec === "string" && spec.split(" ").includes("bold") ? colors : colors.bold, spec, env);
529
- return `${accent(bin)}${context === undefined ? "" : colors.dim(` \u203A ${context}`)}`;
530
- }
531
- function printHeader(bin, context, stream = process6.stdout, env = process6.env) {
532
- const line = header(bin, context, stream, env);
533
- if (line !== "")
534
- console.log(line);
535
- }
536
521
 
537
522
  // ../kit/src/format.ts
538
523
  function upTo(text, separator) {
@@ -1374,7 +1359,6 @@ ${USAGE}`);
1374
1359
  ...group("conflicted", status.conflicted.map((file) => paint(process16.stdout).red(file))),
1375
1360
  ...group("commits", commits.map(([commitSha = "", commitTitle = ""]) => `${role("id", process16.stdout)(commitSha)} ${commitTitle}`))
1376
1361
  ];
1377
- printHeader("gst");
1378
1362
  console.log(lines.join(`
1379
1363
  `));
1380
1364
  return 0;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kaynooo/cli-git",
3
3
  "type": "module",
4
- "version": "0.11.0",
4
+ "version": "0.12.0",
5
5
  "description": "gst, gc and gb: a repository's state in one call, a commit of exactly the paths given, its message checked before anything is staged, and a branch picked.",
6
6
  "author": "Kaynooo <contact@kaynooo.fr>",
7
7
  "license": "MIT",
@@ -44,6 +44,6 @@
44
44
  "gb": "$npm_execpath src/gb.ts"
45
45
  },
46
46
  "devDependencies": {
47
- "@kaynooo/cli-kit": "0.27.1"
47
+ "@kaynooo/cli-kit": "0.29.0"
48
48
  }
49
49
  }