@jannael/glinter 1.2.3 → 1.2.5
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/README.md +12 -3
- package/dist/index.js +129 -119
- package/package.json +77 -77
package/README.md
CHANGED
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
<img alt="Glinter" src="https://github.com/Jannael/glinter/raw/main/apps/web/public/og.png">
|
|
7
7
|
</picture>
|
|
8
8
|
</a>
|
|
9
|
-
<br>
|
|
10
|
-
<br>
|
|
11
|
-
<br>
|
|
12
9
|
</p>
|
|
13
10
|
|
|
14
11
|
Glinter is a high-performance, transparent Git wrapper built with **Bun**.
|
|
@@ -21,6 +18,12 @@ Glinter is a high-performance, transparent Git wrapper built with **Bun**.
|
|
|
21
18
|
|
|
22
19
|
## Preview
|
|
23
20
|
|
|
21
|
+
### Badge
|
|
22
|
+
|
|
23
|
+
| Preview | Copy |
|
|
24
|
+
| -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
25
|
+
| [](https://glinter.jannael.com) | `[](https://glinter.jannael.com)` |
|
|
26
|
+
|
|
24
27
|
<video src="https://github.com/user-attachments/assets/63b401a0-e1e1-453c-9e38-c36cd14e200f" controls="false" autoplay="true" loop="true" muted="true" style="max-width: 100%;">
|
|
25
28
|
Your browser does not support the video tag.
|
|
26
29
|
</video>
|
|
@@ -31,6 +34,12 @@ Your browser does not support the video tag.
|
|
|
31
34
|
| ------------------------------------ | --------------------------------------- |
|
|
32
35
|
|  |  |
|
|
33
36
|
|
|
37
|
+
## Security
|
|
38
|
+
|
|
39
|
+
Security is a top priority for this project.
|
|
40
|
+
|
|
41
|
+
This project uses Bun as its runtime and package manager. You don't need to worry about package vulnerabilities — the `bunfig.toml` configuration includes `minimumReleaseAge = 259200` (3 days), which prevents newly published packages from being installed automatically. This protects against supply chain attacks that have become increasingly common in the npm ecosystem.
|
|
42
|
+
|
|
34
43
|
## Features
|
|
35
44
|
|
|
36
45
|
- **Abbreviation**: You can use `g` instead of `git`.
|
package/dist/index.js
CHANGED
|
@@ -177,7 +177,7 @@ function errorHandler(error) {
|
|
|
177
177
|
import { styleText as v } from "util";
|
|
178
178
|
import { stdout as x, stdin as D } from "process";
|
|
179
179
|
import * as b from "readline";
|
|
180
|
-
import
|
|
180
|
+
import G from "readline";
|
|
181
181
|
|
|
182
182
|
// node_modules/fast-string-truncated-width/dist/utils.js
|
|
183
183
|
var getCodePointsLength = (() => {
|
|
@@ -548,9 +548,9 @@ function I(r, t, s, e) {
|
|
|
548
548
|
u += i[a].length + 1;
|
|
549
549
|
return u + o;
|
|
550
550
|
}
|
|
551
|
-
var
|
|
552
|
-
var
|
|
553
|
-
var h = { actions: new Set(
|
|
551
|
+
var K = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
552
|
+
var j = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
553
|
+
var h = { actions: new Set(K), aliases: new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["\x03", "cancel"], ["escape", "cancel"]]), messages: { cancel: "Canceled", error: "Something went wrong" }, withGuide: true, date: { monthNames: [...j], messages: { required: "Please enter a valid date", invalidMonth: "There are only 12 months in a year", invalidDay: (r, t) => `There are only ${r} days in ${t}`, afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`, beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}` } } };
|
|
554
554
|
function C(r, t) {
|
|
555
555
|
if (typeof r == "string")
|
|
556
556
|
return h.aliases.get(r) === t;
|
|
@@ -559,7 +559,7 @@ function C(r, t) {
|
|
|
559
559
|
return true;
|
|
560
560
|
return false;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function Y(r, t) {
|
|
563
563
|
if (r === t)
|
|
564
564
|
return;
|
|
565
565
|
const s = r.split(`
|
|
@@ -569,16 +569,16 @@ function z(r, t) {
|
|
|
569
569
|
s[o] !== e[o] && n.push(o);
|
|
570
570
|
return { lines: n, numLinesBefore: s.length, numLinesAfter: e.length, numLines: i };
|
|
571
571
|
}
|
|
572
|
-
var
|
|
572
|
+
var q = globalThis.process.platform.startsWith("win");
|
|
573
573
|
var k = Symbol("clack:cancel");
|
|
574
|
-
function
|
|
574
|
+
function R(r) {
|
|
575
575
|
return r === k;
|
|
576
576
|
}
|
|
577
577
|
function w(r, t) {
|
|
578
578
|
const s = r;
|
|
579
579
|
s.isTTY && s.setRawMode(t);
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function W({ input: r = D, output: t = x, overwrite: s = true, hideCursor: e = true } = {}) {
|
|
582
582
|
const i = b.createInterface({ input: r, output: t, prompt: "", tabSize: 1 });
|
|
583
583
|
b.emitKeypressEvents(r, i), r instanceof O && r.isTTY && r.setRawMode(true);
|
|
584
584
|
const n = (o, { name: u, sequence: a }) => {
|
|
@@ -597,12 +597,12 @@ function R({ input: r = D, output: t = x, overwrite: s = true, hideCursor: e = t
|
|
|
597
597
|
});
|
|
598
598
|
};
|
|
599
599
|
return e && t.write(import_sisteransi.cursor.hide), r.once("keypress", n), () => {
|
|
600
|
-
r.off("keypress", n), e && t.write(import_sisteransi.cursor.show), r instanceof O && r.isTTY && !
|
|
600
|
+
r.off("keypress", n), e && t.write(import_sisteransi.cursor.show), r instanceof O && r.isTTY && !q && r.setRawMode(false), i.terminal = false, i.close();
|
|
601
601
|
};
|
|
602
602
|
}
|
|
603
603
|
var A = (r) => ("columns" in r) && typeof r.columns == "number" ? r.columns : 80;
|
|
604
604
|
var L = (r) => ("rows" in r) && typeof r.rows == "number" ? r.rows : 20;
|
|
605
|
-
function
|
|
605
|
+
function B(r, t, s, e = s, i = s, n) {
|
|
606
606
|
const o = A(r ?? x);
|
|
607
607
|
return wrapAnsi(t, o - s.length, { hard: true, trim: false }).split(`
|
|
608
608
|
`).map((u, a, l) => {
|
|
@@ -611,7 +611,17 @@ function W(r, t, s, e = s, i = s, n) {
|
|
|
611
611
|
}).join(`
|
|
612
612
|
`);
|
|
613
613
|
}
|
|
614
|
-
|
|
614
|
+
function P(r, t) {
|
|
615
|
+
if ("~standard" in r) {
|
|
616
|
+
const s = r["~standard"].validate(t);
|
|
617
|
+
if (s instanceof Promise)
|
|
618
|
+
throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
|
|
619
|
+
return s.issues?.at(0)?.message;
|
|
620
|
+
}
|
|
621
|
+
return r(t);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
class m {
|
|
615
625
|
input;
|
|
616
626
|
output;
|
|
617
627
|
_abortSignal;
|
|
@@ -659,7 +669,7 @@ var m = class {
|
|
|
659
669
|
this.state = "cancel", this.close();
|
|
660
670
|
}, { once: true });
|
|
661
671
|
}
|
|
662
|
-
this.rl =
|
|
672
|
+
this.rl = G.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== undefined && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
663
673
|
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(this.value);
|
|
664
674
|
}), this.once("cancel", () => {
|
|
665
675
|
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t(k);
|
|
@@ -682,9 +692,9 @@ var m = class {
|
|
|
682
692
|
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
683
693
|
}
|
|
684
694
|
onKeypress(t, s) {
|
|
685
|
-
if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t
|
|
695
|
+
if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t, s), s?.name === "return" && this._shouldSubmit(t, s)) {
|
|
686
696
|
if (this.opts.validate) {
|
|
687
|
-
const e = this.opts.validate
|
|
697
|
+
const e = P(this.opts.validate, this.value);
|
|
688
698
|
e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
|
|
689
699
|
}
|
|
690
700
|
this.state !== "error" && (this.state = "submit");
|
|
@@ -706,7 +716,7 @@ var m = class {
|
|
|
706
716
|
if (this.state === "initial")
|
|
707
717
|
this.output.write(import_sisteransi.cursor.hide);
|
|
708
718
|
else {
|
|
709
|
-
const s =
|
|
719
|
+
const s = Y(this._prevFrame, t), e = L(this.output);
|
|
710
720
|
if (this.restoreCursor(), s) {
|
|
711
721
|
const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
|
|
712
722
|
let o = s.lines.find((u) => u >= i);
|
|
@@ -740,21 +750,21 @@ var m = class {
|
|
|
740
750
|
this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
|
|
741
751
|
}
|
|
742
752
|
}
|
|
743
|
-
}
|
|
744
|
-
function
|
|
753
|
+
}
|
|
754
|
+
function J(r, t) {
|
|
745
755
|
if (r === undefined || t.length === 0)
|
|
746
756
|
return 0;
|
|
747
757
|
const s = t.findIndex((e) => e.value === r);
|
|
748
758
|
return s !== -1 ? s : 0;
|
|
749
759
|
}
|
|
750
|
-
function
|
|
760
|
+
function H(r, t) {
|
|
751
761
|
return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
|
|
752
762
|
}
|
|
753
|
-
function
|
|
763
|
+
function Q(r, t) {
|
|
754
764
|
if (t)
|
|
755
765
|
return r ? t : t[0];
|
|
756
766
|
}
|
|
757
|
-
var
|
|
767
|
+
var X2 = class extends m {
|
|
758
768
|
filteredOptions;
|
|
759
769
|
multiple;
|
|
760
770
|
isNavigating = false;
|
|
@@ -782,7 +792,7 @@ var Q = class extends m {
|
|
|
782
792
|
constructor(t) {
|
|
783
793
|
super(t), this.#n = t.options, this.#u = t.placeholder;
|
|
784
794
|
const s = this.options;
|
|
785
|
-
this.filteredOptions = [...s], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ??
|
|
795
|
+
this.filteredOptions = [...s], this.multiple = t.multiple === true, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? H;
|
|
786
796
|
let e;
|
|
787
797
|
if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? e = t.initialValue : e = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (e = [this.options[0].value]), e)
|
|
788
798
|
for (const i of e) {
|
|
@@ -800,7 +810,7 @@ var Q = class extends m {
|
|
|
800
810
|
this.userInput === "\t" && this._clearUserInput(), this._setUserInput(u, true), this.isNavigating = false;
|
|
801
811
|
return;
|
|
802
812
|
}
|
|
803
|
-
e || i ? (this.#s = f(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value =
|
|
813
|
+
e || i ? (this.#s = f(this.#s, e ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#s]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n ? this.value = Q(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== undefined && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
|
|
804
814
|
}
|
|
805
815
|
deselectAll() {
|
|
806
816
|
this.selectedValues = [];
|
|
@@ -813,7 +823,7 @@ var Q = class extends m {
|
|
|
813
823
|
this.#r = t;
|
|
814
824
|
const s = this.options;
|
|
815
825
|
t && this.#t ? this.filteredOptions = s.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...s];
|
|
816
|
-
const e =
|
|
826
|
+
const e = J(this.focusedValue, this.filteredOptions);
|
|
817
827
|
this.#s = f(e, 0, this.filteredOptions);
|
|
818
828
|
const i = this.filteredOptions[this.#s];
|
|
819
829
|
i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = undefined, this.multiple || (this.focusedValue !== undefined ? this.toggleSelected(this.focusedValue) : this.deselectAll());
|
|
@@ -821,7 +831,7 @@ var Q = class extends m {
|
|
|
821
831
|
}
|
|
822
832
|
};
|
|
823
833
|
|
|
824
|
-
class
|
|
834
|
+
class Z extends m {
|
|
825
835
|
get cursor() {
|
|
826
836
|
return this.value ? 0 : 1;
|
|
827
837
|
}
|
|
@@ -838,11 +848,11 @@ class X2 extends m {
|
|
|
838
848
|
});
|
|
839
849
|
}
|
|
840
850
|
}
|
|
841
|
-
var
|
|
842
|
-
function
|
|
843
|
-
return [...r].map((t) =>
|
|
851
|
+
var tt = { Y: { type: "year", len: 4 }, M: { type: "month", len: 2 }, D: { type: "day", len: 2 } };
|
|
852
|
+
function F(r) {
|
|
853
|
+
return [...r].map((t) => tt[t]);
|
|
844
854
|
}
|
|
845
|
-
function
|
|
855
|
+
function st(r) {
|
|
846
856
|
const t = new Intl.DateTimeFormat(r, { year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(new Date(2000, 0, 15)), s = [];
|
|
847
857
|
let e = "/";
|
|
848
858
|
for (const i of t)
|
|
@@ -858,7 +868,7 @@ function S(r) {
|
|
|
858
868
|
function U(r, t) {
|
|
859
869
|
return new Date(r || 2001, t || 1, 0).getDate();
|
|
860
870
|
}
|
|
861
|
-
function
|
|
871
|
+
function N(r) {
|
|
862
872
|
const { year: t, month: s, day: e } = S(r);
|
|
863
873
|
if (!t || t < 0 || t > 9999 || !s || s < 1 || s > 12 || !e || e < 1)
|
|
864
874
|
return;
|
|
@@ -866,16 +876,16 @@ function F(r) {
|
|
|
866
876
|
if (!(i.getUTCFullYear() !== t || i.getUTCMonth() !== s - 1 || i.getUTCDate() !== e))
|
|
867
877
|
return { year: t, month: s, day: e };
|
|
868
878
|
}
|
|
869
|
-
function
|
|
870
|
-
const t =
|
|
879
|
+
function E(r) {
|
|
880
|
+
const t = N(r);
|
|
871
881
|
return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : undefined;
|
|
872
882
|
}
|
|
873
|
-
function
|
|
883
|
+
function et(r, t, s, e) {
|
|
874
884
|
const i = s ? { year: s.getUTCFullYear(), month: s.getUTCMonth() + 1, day: s.getUTCDate() } : null, n = e ? { year: e.getUTCFullYear(), month: e.getUTCMonth() + 1, day: e.getUTCDate() } : null;
|
|
875
885
|
return r === "year" ? { min: i?.year ?? 1, max: n?.year ?? 9999 } : r === "month" ? { min: i && t.year === i.year ? i.month : 1, max: n && t.year === n.year ? n.month : 12 } : { min: i && t.year === i.year && t.month === i.month ? i.day : 1, max: n && t.year === n.year && t.month === n.month ? n.day : U(t.year, t.month) };
|
|
876
886
|
}
|
|
877
887
|
|
|
878
|
-
class
|
|
888
|
+
class it extends m {
|
|
879
889
|
#s;
|
|
880
890
|
#r;
|
|
881
891
|
#t;
|
|
@@ -904,10 +914,10 @@ class et extends m {
|
|
|
904
914
|
return this.#s.map((s) => t[s.type]).join(this.#r);
|
|
905
915
|
}
|
|
906
916
|
#a() {
|
|
907
|
-
this._setUserInput(this.#c(this.#t)), this._setValue(
|
|
917
|
+
this._setUserInput(this.#c(this.#t)), this._setValue(E(this.#t) ?? undefined);
|
|
908
918
|
}
|
|
909
919
|
constructor(t) {
|
|
910
|
-
const s = t.format ? { segments:
|
|
920
|
+
const s = t.format ? { segments: F(t.format), separator: t.separator ?? "/" } : st(t.locale), e = t.separator ?? s.separator, i = t.format ? F(t.format) : s.segments, n = t.initialValue ?? t.defaultValue, o = n ? { year: String(n.getUTCFullYear()).padStart(4, "0"), month: String(n.getUTCMonth() + 1).padStart(2, "0"), day: String(n.getUTCDate()).padStart(2, "0") } : { year: "____", month: "__", day: "__" }, u = i.map((a) => o[a.type]).join(e);
|
|
911
921
|
super({ ...t, initialUserInput: u }, false), this.#s = i, this.#r = e, this.#t = o, this.#n = t.minDate, this.#u = t.maxDate, this.#a(), this.on("cursor", (a) => this.#d(a)), this.on("key", (a, l) => this.#f(a, l)), this.on("finalize", () => this.#g(t));
|
|
912
922
|
}
|
|
913
923
|
#h() {
|
|
@@ -924,7 +934,7 @@ class et extends m {
|
|
|
924
934
|
const s = this.#h();
|
|
925
935
|
if (!s)
|
|
926
936
|
return;
|
|
927
|
-
const { segment: e } = s, i = this.#t[e.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, u =
|
|
937
|
+
const { segment: e } = s, i = this.#t[e.type], n = !i || i.replace(/_/g, "") === "", o = Number.parseInt((i || "0").replace(/_/g, "0"), 10) || 0, u = et(e.type, S(this.#t), this.#n, this.#u);
|
|
928
938
|
let a;
|
|
929
939
|
n ? a = t === 1 ? u.min : u.max : a = Math.max(Math.min(u.max, o + t), u.min), this.#t = { ...this.#t, [e.type]: a.toString().padStart(e.len, "0") }, this.#i = true, this.#o = null, this.#a();
|
|
930
940
|
}
|
|
@@ -994,7 +1004,7 @@ class et extends m {
|
|
|
994
1004
|
}
|
|
995
1005
|
}
|
|
996
1006
|
this.inlineError = "", this.#t[i.type] = l;
|
|
997
|
-
const y = l.includes("_") ? undefined :
|
|
1007
|
+
const y = l.includes("_") ? undefined : N(this.#t);
|
|
998
1008
|
if (y) {
|
|
999
1009
|
const { year: d, month: g } = y, _ = U(d, g);
|
|
1000
1010
|
this.#t = { year: String(Math.max(0, Math.min(9999, d))).padStart(4, "0"), month: String(Math.max(1, Math.min(12, g))).padStart(2, "0"), day: String(Math.max(1, Math.min(_, y.day))).padStart(2, "0") };
|
|
@@ -1017,11 +1027,10 @@ class et extends m {
|
|
|
1017
1027
|
const n = U(s, e);
|
|
1018
1028
|
this.#t = { ...this.#t, day: String(Math.min(i, n)).padStart(2, "0") };
|
|
1019
1029
|
}
|
|
1020
|
-
this.value =
|
|
1030
|
+
this.value = E(this.#t) ?? t.defaultValue ?? undefined;
|
|
1021
1031
|
}
|
|
1022
1032
|
}
|
|
1023
|
-
|
|
1024
|
-
class it extends m {
|
|
1033
|
+
var rt = class extends m {
|
|
1025
1034
|
options;
|
|
1026
1035
|
cursor = 0;
|
|
1027
1036
|
#s;
|
|
@@ -1067,9 +1076,10 @@ class it extends m {
|
|
|
1067
1076
|
}
|
|
1068
1077
|
});
|
|
1069
1078
|
}
|
|
1070
|
-
}
|
|
1079
|
+
};
|
|
1080
|
+
var nt = new Set(["up", "down", "left", "right"]);
|
|
1071
1081
|
|
|
1072
|
-
class
|
|
1082
|
+
class ot extends m {
|
|
1073
1083
|
#s = false;
|
|
1074
1084
|
#r;
|
|
1075
1085
|
focused = "editor";
|
|
@@ -1122,7 +1132,7 @@ ${i}` : `${s}${v("inverse", e)}${i}`;
|
|
|
1122
1132
|
}
|
|
1123
1133
|
constructor(t) {
|
|
1124
1134
|
super(t, false), this.#r = t.showSubmit ?? false, this.on("key", (s, e) => {
|
|
1125
|
-
if (e?.name &&
|
|
1135
|
+
if (e?.name && nt.has(e.name)) {
|
|
1126
1136
|
this.#n(e.name);
|
|
1127
1137
|
return;
|
|
1128
1138
|
}
|
|
@@ -1148,7 +1158,7 @@ ${i}` : `${s}${v("inverse", e)}${i}`;
|
|
|
1148
1158
|
});
|
|
1149
1159
|
}
|
|
1150
1160
|
}
|
|
1151
|
-
var
|
|
1161
|
+
var ut = class extends m {
|
|
1152
1162
|
options;
|
|
1153
1163
|
cursor = 0;
|
|
1154
1164
|
get _value() {
|
|
@@ -1176,8 +1186,8 @@ var nt = class extends m {
|
|
|
1176
1186
|
constructor(t) {
|
|
1177
1187
|
super(t, false), this.options = t.options, this.value = [...t.initialValues ?? []];
|
|
1178
1188
|
const s = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), 0);
|
|
1179
|
-
this.cursor = this.options[s].disabled ? f(s, 1, this.options) : s, this.on("key", (e) => {
|
|
1180
|
-
|
|
1189
|
+
this.cursor = this.options[s].disabled ? f(s, 1, this.options) : s, this.on("key", (e, i) => {
|
|
1190
|
+
i.name === "a" && this.toggleAll(), i.name === "i" && this.toggleInvert();
|
|
1181
1191
|
}), this.on("cursor", (e) => {
|
|
1182
1192
|
switch (e) {
|
|
1183
1193
|
case "left":
|
|
@@ -1195,7 +1205,7 @@ var nt = class extends m {
|
|
|
1195
1205
|
});
|
|
1196
1206
|
}
|
|
1197
1207
|
};
|
|
1198
|
-
class
|
|
1208
|
+
class ht extends m {
|
|
1199
1209
|
options;
|
|
1200
1210
|
cursor = 0;
|
|
1201
1211
|
get _selectedValue() {
|
|
@@ -1222,7 +1232,7 @@ class ut extends m {
|
|
|
1222
1232
|
});
|
|
1223
1233
|
}
|
|
1224
1234
|
}
|
|
1225
|
-
class
|
|
1235
|
+
class ct extends m {
|
|
1226
1236
|
get userInputWithCursor() {
|
|
1227
1237
|
if (this.state === "submit")
|
|
1228
1238
|
return this.userInput;
|
|
@@ -1245,54 +1255,54 @@ class ht extends m {
|
|
|
1245
1255
|
}
|
|
1246
1256
|
|
|
1247
1257
|
// node_modules/@clack/prompts/dist/index.mjs
|
|
1248
|
-
import { styleText as e, stripVTControlCharacters as
|
|
1258
|
+
import { styleText as e, stripVTControlCharacters as ot2 } from "util";
|
|
1249
1259
|
import V2 from "process";
|
|
1250
1260
|
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
1251
|
-
function
|
|
1261
|
+
function se() {
|
|
1252
1262
|
return V2.platform !== "win32" ? V2.env.TERM !== "linux" : !!V2.env.CI || !!V2.env.WT_SESSION || !!V2.env.TERMINUS_SUBLIME || V2.env.ConEmuTask === "{cmd::Cmder}" || V2.env.TERM_PROGRAM === "Terminus-Sublime" || V2.env.TERM_PROGRAM === "vscode" || V2.env.TERM === "xterm-256color" || V2.env.TERM === "alacritty" || V2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1253
1263
|
}
|
|
1254
|
-
var tt2 =
|
|
1255
|
-
var
|
|
1264
|
+
var tt2 = se();
|
|
1265
|
+
var at2 = () => process.env.CI === "true";
|
|
1256
1266
|
var w2 = (t, i) => tt2 ? t : i;
|
|
1257
|
-
var
|
|
1258
|
-
var
|
|
1259
|
-
var
|
|
1267
|
+
var _t = w2("\u25C6", "*");
|
|
1268
|
+
var ut2 = w2("\u25A0", "x");
|
|
1269
|
+
var lt2 = w2("\u25B2", "x");
|
|
1260
1270
|
var H2 = w2("\u25C7", "o");
|
|
1261
|
-
var
|
|
1271
|
+
var ct2 = w2("\u250C", "T");
|
|
1262
1272
|
var $2 = w2("\u2502", "|");
|
|
1263
1273
|
var x2 = w2("\u2514", "\u2014");
|
|
1264
|
-
var
|
|
1265
|
-
var
|
|
1274
|
+
var xt = w2("\u2510", "T");
|
|
1275
|
+
var Et = w2("\u2518", "\u2014");
|
|
1266
1276
|
var z2 = w2("\u25CF", ">");
|
|
1267
1277
|
var U2 = w2("\u25CB", " ");
|
|
1268
1278
|
var et2 = w2("\u25FB", "[\u2022]");
|
|
1269
1279
|
var K2 = w2("\u25FC", "[+]");
|
|
1270
1280
|
var Y2 = w2("\u25FB", "[ ]");
|
|
1271
|
-
var
|
|
1281
|
+
var Gt = w2("\u25AA", "\u2022");
|
|
1272
1282
|
var st2 = w2("\u2500", "-");
|
|
1273
|
-
var
|
|
1274
|
-
var
|
|
1275
|
-
var
|
|
1276
|
-
var
|
|
1277
|
-
var
|
|
1278
|
-
var
|
|
1279
|
-
var
|
|
1280
|
-
var
|
|
1281
|
-
var
|
|
1283
|
+
var $t = w2("\u256E", "+");
|
|
1284
|
+
var Mt = w2("\u251C", "+");
|
|
1285
|
+
var dt = w2("\u256F", "+");
|
|
1286
|
+
var ht2 = w2("\u2570", "+");
|
|
1287
|
+
var Ot = w2("\u256D", "+");
|
|
1288
|
+
var pt = w2("\u25CF", "\u2022");
|
|
1289
|
+
var mt = w2("\u25C6", "*");
|
|
1290
|
+
var gt = w2("\u25B2", "!");
|
|
1291
|
+
var yt = w2("\u25A0", "x");
|
|
1282
1292
|
var P2 = (t) => {
|
|
1283
1293
|
switch (t) {
|
|
1284
1294
|
case "initial":
|
|
1285
1295
|
case "active":
|
|
1286
|
-
return e("cyan",
|
|
1296
|
+
return e("cyan", _t);
|
|
1287
1297
|
case "cancel":
|
|
1288
|
-
return e("red",
|
|
1298
|
+
return e("red", ut2);
|
|
1289
1299
|
case "error":
|
|
1290
|
-
return e("yellow",
|
|
1300
|
+
return e("yellow", lt2);
|
|
1291
1301
|
case "submit":
|
|
1292
1302
|
return e("green", H2);
|
|
1293
1303
|
}
|
|
1294
1304
|
};
|
|
1295
|
-
var
|
|
1305
|
+
var ft = (t) => {
|
|
1296
1306
|
switch (t) {
|
|
1297
1307
|
case "initial":
|
|
1298
1308
|
case "active":
|
|
@@ -1305,7 +1315,7 @@ var yt = (t) => {
|
|
|
1305
1315
|
return e("green", $2);
|
|
1306
1316
|
}
|
|
1307
1317
|
};
|
|
1308
|
-
var
|
|
1318
|
+
var Pt = (t, i, s, r, u, n = false) => {
|
|
1309
1319
|
let a = i, c = 0;
|
|
1310
1320
|
if (n)
|
|
1311
1321
|
for (let o = r - 1;o >= s && (a -= t[o].length, c++, !(a <= u)); o--)
|
|
@@ -1333,7 +1343,7 @@ var F2 = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItem
|
|
|
1333
1343
|
let b2 = 0, G2 = 0, M = y;
|
|
1334
1344
|
const N2 = t - v2;
|
|
1335
1345
|
let O2 = d;
|
|
1336
|
-
const j2 = () =>
|
|
1346
|
+
const j2 = () => Pt(m2, M, 0, N2, O2), k2 = () => Pt(m2, M, N2 + 1, m2.length, O2, true);
|
|
1337
1347
|
f2 ? ({ lineCount: M, removals: b2 } = j2(), M > O2 && (h2 || (O2 -= 1), { lineCount: M, removals: G2 } = k2())) : (h2 || (O2 -= 1), { lineCount: M, removals: G2 } = k2(), M > O2 && (O2 -= 1, { lineCount: M, removals: b2 } = j2())), b2 > 0 && (f2 = true, m2.splice(0, b2)), G2 > 0 && (h2 = true, m2.splice(m2.length - G2, G2));
|
|
1338
1348
|
}
|
|
1339
1349
|
const S2 = [];
|
|
@@ -1343,10 +1353,10 @@ var F2 = ({ cursor: t, options: i, style: s, output: r = process.stdout, maxItem
|
|
|
1343
1353
|
S2.push(G2);
|
|
1344
1354
|
return h2 && S2.push(l), S2;
|
|
1345
1355
|
};
|
|
1346
|
-
var
|
|
1356
|
+
var le = (t) => {
|
|
1347
1357
|
const i = t.active ?? "Yes", s = t.inactive ?? "No";
|
|
1348
|
-
return new
|
|
1349
|
-
const r = t.withGuide ?? h.withGuide, u = `${P2(this.state)} `, n = r ? `${e("gray", $2)} ` : "", a =
|
|
1358
|
+
return new Z({ active: i, inactive: s, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue ?? true, render() {
|
|
1359
|
+
const r = t.withGuide ?? h.withGuide, u = `${P2(this.state)} `, n = r ? `${e("gray", $2)} ` : "", a = B(t.output, t.message, n, u), c = `${r ? `${e("gray", $2)}
|
|
1350
1360
|
` : ""}${a}
|
|
1351
1361
|
`, o = this.value ? i : s;
|
|
1352
1362
|
switch (this.state) {
|
|
@@ -1370,18 +1380,18 @@ ${d}
|
|
|
1370
1380
|
}
|
|
1371
1381
|
} }).prompt();
|
|
1372
1382
|
};
|
|
1373
|
-
var
|
|
1383
|
+
var ge = (t = "", i) => {
|
|
1374
1384
|
const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", x2)} ` : "";
|
|
1375
1385
|
s.write(`${r}${e("red", t)}
|
|
1376
1386
|
|
|
1377
1387
|
`);
|
|
1378
1388
|
};
|
|
1379
|
-
var
|
|
1380
|
-
const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray",
|
|
1389
|
+
var ye = (t = "", i) => {
|
|
1390
|
+
const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", ct2)} ` : "";
|
|
1381
1391
|
s.write(`${r}${t}
|
|
1382
1392
|
`);
|
|
1383
1393
|
};
|
|
1384
|
-
var
|
|
1394
|
+
var fe = (t = "", i) => {
|
|
1385
1395
|
const s = i?.output ?? process.stdout, r = i?.withGuide ?? h.withGuide ? `${e("gray", $2)}
|
|
1386
1396
|
${e("gray", x2)} ` : "";
|
|
1387
1397
|
s.write(`${r}${t}
|
|
@@ -1391,17 +1401,17 @@ ${e("gray", x2)} ` : "";
|
|
|
1391
1401
|
var Q2 = (t, i) => t.split(`
|
|
1392
1402
|
`).map((s) => i(s)).join(`
|
|
1393
1403
|
`);
|
|
1394
|
-
var
|
|
1404
|
+
var we = (t) => {
|
|
1395
1405
|
const i = (r, u) => {
|
|
1396
1406
|
const n = r.label ?? String(r.value);
|
|
1397
1407
|
return u === "disabled" ? `${e("gray", Y2)} ${Q2(n, (a) => e(["strikethrough", "gray"], a))}${r.hint ? ` ${e("dim", `(${r.hint ?? "disabled"})`)}` : ""}` : u === "active" ? `${e("cyan", et2)} ${n}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "selected" ? `${e("green", K2)} ${Q2(n, (a) => e("dim", a))}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "cancelled" ? `${Q2(n, (a) => e(["strikethrough", "dim"], a))}` : u === "active-selected" ? `${e("green", K2)} ${n}${r.hint ? ` ${e("dim", `(${r.hint})`)}` : ""}` : u === "submitted" ? `${Q2(n, (a) => e("dim", a))}` : `${e("dim", Y2)} ${Q2(n, (a) => e("dim", a))}`;
|
|
1398
1408
|
}, s = t.required ?? true;
|
|
1399
|
-
return new
|
|
1409
|
+
return new ut({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValues: t.initialValues, required: s, cursorAt: t.cursorAt, validate(r) {
|
|
1400
1410
|
if (s && (r === undefined || r.length === 0))
|
|
1401
1411
|
return `Please select at least one option.
|
|
1402
1412
|
${e("reset", e("dim", `Press ${e(["gray", "bgWhite", "inverse"], " space ")} to select, ${e("gray", e("bgWhite", e("inverse", " enter ")))} to submit`))}`;
|
|
1403
1413
|
}, render() {
|
|
1404
|
-
const r = t.withGuide ?? h.withGuide, u =
|
|
1414
|
+
const r = t.withGuide ?? h.withGuide, u = B(t.output, t.message, r ? `${ft(this.state)} ` : "", `${P2(this.state)} `), n = `${r ? `${e("gray", $2)}
|
|
1405
1415
|
` : ""}${u}
|
|
1406
1416
|
`, a = this.value ?? [], c = (o, l) => {
|
|
1407
1417
|
if (o.disabled)
|
|
@@ -1411,14 +1421,14 @@ ${e("reset", e("dim", `Press ${e(["gray", "bgWhite", "inverse"], " space ")} to
|
|
|
1411
1421
|
};
|
|
1412
1422
|
switch (this.state) {
|
|
1413
1423
|
case "submit": {
|
|
1414
|
-
const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "submitted")).join(e("dim", ", ")) || e("dim", "none"), l =
|
|
1424
|
+
const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "submitted")).join(e("dim", ", ")) || e("dim", "none"), l = B(t.output, o, r ? `${e("gray", $2)} ` : "");
|
|
1415
1425
|
return `${n}${l}`;
|
|
1416
1426
|
}
|
|
1417
1427
|
case "cancel": {
|
|
1418
1428
|
const o = this.options.filter(({ value: d }) => a.includes(d)).map((d) => i(d, "cancelled")).join(e("dim", ", "));
|
|
1419
1429
|
if (o.trim() === "")
|
|
1420
1430
|
return `${n}${e("gray", $2)}`;
|
|
1421
|
-
const l =
|
|
1431
|
+
const l = B(t.output, o, r ? `${e("gray", $2)} ` : "");
|
|
1422
1432
|
return `${n}${l}${r ? `
|
|
1423
1433
|
${e("gray", $2)}` : ""}`;
|
|
1424
1434
|
}
|
|
@@ -1444,11 +1454,11 @@ ${r ? e("cyan", x2) : ""}
|
|
|
1444
1454
|
}
|
|
1445
1455
|
} }).prompt();
|
|
1446
1456
|
};
|
|
1447
|
-
var
|
|
1448
|
-
var
|
|
1449
|
-
const l =
|
|
1457
|
+
var _e = (t) => e("magenta", t);
|
|
1458
|
+
var vt = ({ indicator: t = "dots", onCancel: i, output: s = process.stdout, cancelMessage: r, errorMessage: u, frames: n = tt2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: a = tt2 ? 80 : 120, signal: c, ...o } = {}) => {
|
|
1459
|
+
const l = at2();
|
|
1450
1460
|
let d, g, p2 = false, f2 = false, h2 = "", I2, m2 = performance.now();
|
|
1451
|
-
const y = A(s), v2 = o?.styleFrame ??
|
|
1461
|
+
const y = A(s), v2 = o?.styleFrame ?? _e, C2 = (_) => {
|
|
1452
1462
|
const A2 = _ > 1 ? u ?? h.messages.error : r ?? h.messages.cancel;
|
|
1453
1463
|
f2 = _ === 1, p2 && (W2(A2, _), f2 && typeof i == "function" && i());
|
|
1454
1464
|
}, S2 = () => C2(2), b2 = () => C2(1), G2 = () => {
|
|
@@ -1467,7 +1477,7 @@ var ft = ({ indicator: t = "dots", onCancel: i, output: s = process.stdout, canc
|
|
|
1467
1477
|
const A2 = (performance.now() - _) / 1000, L2 = Math.floor(A2 / 60), D2 = Math.floor(A2 % 60);
|
|
1468
1478
|
return L2 > 0 ? `[${L2}m ${D2}s]` : `[${D2}s]`;
|
|
1469
1479
|
}, k2 = o.withGuide ?? h.withGuide, rt2 = (_ = "") => {
|
|
1470
|
-
p2 = true, d =
|
|
1480
|
+
p2 = true, d = W({ output: s }), h2 = O2(_), m2 = performance.now(), k2 && s.write(`${e("gray", $2)}
|
|
1471
1481
|
`);
|
|
1472
1482
|
let A2 = 0, L2 = 0;
|
|
1473
1483
|
G2(), g = setInterval(() => {
|
|
@@ -1481,17 +1491,17 @@ var ft = ({ indicator: t = "dots", onCancel: i, output: s = process.stdout, canc
|
|
|
1481
1491
|
else if (t === "timer")
|
|
1482
1492
|
Z2 = `${D2} ${h2} ${j2(m2)}`;
|
|
1483
1493
|
else {
|
|
1484
|
-
const
|
|
1485
|
-
Z2 = `${D2} ${h2}${
|
|
1494
|
+
const Lt = ".".repeat(Math.floor(L2)).slice(0, 3);
|
|
1495
|
+
Z2 = `${D2} ${h2}${Lt}`;
|
|
1486
1496
|
}
|
|
1487
|
-
const
|
|
1488
|
-
s.write(
|
|
1497
|
+
const kt = wrapAnsi(Z2, y, { hard: true, trim: false });
|
|
1498
|
+
s.write(kt), A2 = A2 + 1 < n.length ? A2 + 1 : 0, L2 = L2 < 4 ? L2 + 0.125 : 0;
|
|
1489
1499
|
}, a);
|
|
1490
1500
|
}, W2 = (_ = "", A2 = 0, L2 = false) => {
|
|
1491
1501
|
if (!p2)
|
|
1492
1502
|
return;
|
|
1493
1503
|
p2 = false, clearInterval(g), N2();
|
|
1494
|
-
const D2 = A2 === 0 ? e("green", H2) : A2 === 1 ? e("red",
|
|
1504
|
+
const D2 = A2 === 0 ? e("green", H2) : A2 === 1 ? e("red", ut2) : e("red", lt2);
|
|
1495
1505
|
h2 = _ ?? h2, L2 || (t === "timer" ? s.write(`${D2} ${h2} ${j2(m2)}
|
|
1496
1506
|
`) : s.write(`${D2} ${h2}
|
|
1497
1507
|
`)), M(), d();
|
|
@@ -1502,12 +1512,12 @@ var ft = ({ indicator: t = "dots", onCancel: i, output: s = process.stdout, canc
|
|
|
1502
1512
|
return f2;
|
|
1503
1513
|
} };
|
|
1504
1514
|
};
|
|
1505
|
-
var
|
|
1515
|
+
var Nt = { light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") };
|
|
1506
1516
|
var it2 = (t, i) => t.includes(`
|
|
1507
1517
|
`) ? t.split(`
|
|
1508
1518
|
`).map((s) => i(s)).join(`
|
|
1509
1519
|
`) : i(t);
|
|
1510
|
-
var
|
|
1520
|
+
var Ee = (t) => {
|
|
1511
1521
|
const i = (s, r) => {
|
|
1512
1522
|
const u = s.label ?? String(s.value);
|
|
1513
1523
|
switch (r) {
|
|
@@ -1523,17 +1533,17 @@ var xe = (t) => {
|
|
|
1523
1533
|
return `${e("dim", U2)} ${it2(u, (n) => e("dim", n))}`;
|
|
1524
1534
|
}
|
|
1525
1535
|
};
|
|
1526
|
-
return new
|
|
1527
|
-
const s = t.withGuide ?? h.withGuide, r = `${P2(this.state)} `, u = `${
|
|
1536
|
+
return new ht({ options: t.options, signal: t.signal, input: t.input, output: t.output, initialValue: t.initialValue, render() {
|
|
1537
|
+
const s = t.withGuide ?? h.withGuide, r = `${P2(this.state)} `, u = `${ft(this.state)} `, n = B(t.output, t.message, u, r), a = `${s ? `${e("gray", $2)}
|
|
1528
1538
|
` : ""}${n}
|
|
1529
1539
|
`;
|
|
1530
1540
|
switch (this.state) {
|
|
1531
1541
|
case "submit": {
|
|
1532
|
-
const c = s ? `${e("gray", $2)} ` : "", o =
|
|
1542
|
+
const c = s ? `${e("gray", $2)} ` : "", o = B(t.output, i(this.options[this.cursor], "selected"), c);
|
|
1533
1543
|
return `${a}${o}`;
|
|
1534
1544
|
}
|
|
1535
1545
|
case "cancel": {
|
|
1536
|
-
const c = s ? `${e("gray", $2)} ` : "", o =
|
|
1546
|
+
const c = s ? `${e("gray", $2)} ` : "", o = B(t.output, i(this.options[this.cursor], "cancelled"), c);
|
|
1537
1547
|
return `${a}${o}${s ? `
|
|
1538
1548
|
${e("gray", $2)}` : ""}`;
|
|
1539
1549
|
}
|
|
@@ -1548,8 +1558,8 @@ ${o}
|
|
|
1548
1558
|
}
|
|
1549
1559
|
} }).prompt();
|
|
1550
1560
|
};
|
|
1551
|
-
var
|
|
1552
|
-
var
|
|
1561
|
+
var Bt = `${e("gray", $2)} `;
|
|
1562
|
+
var Re = (t) => new ct({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, output: t.output, signal: t.signal, input: t.input, render() {
|
|
1553
1563
|
const i = t?.withGuide ?? h.withGuide, s = `${`${i ? `${e("gray", $2)}
|
|
1554
1564
|
` : ""}${P2(this.state)} `}${t.message}
|
|
1555
1565
|
`, r = t.placeholder ? e("inverse", t.placeholder[0]) + e("dim", t.placeholder.slice(1)) : e(["inverse", "hidden"], "_"), u = this.userInput ? this.userInputWithCursor : r, n = this.value ?? "";
|
|
@@ -1584,13 +1594,13 @@ async function MultiSelect({
|
|
|
1584
1594
|
message,
|
|
1585
1595
|
options
|
|
1586
1596
|
}) {
|
|
1587
|
-
const selected = await
|
|
1597
|
+
const selected = await we({
|
|
1588
1598
|
message,
|
|
1589
1599
|
options,
|
|
1590
1600
|
required: true
|
|
1591
1601
|
});
|
|
1592
|
-
if (
|
|
1593
|
-
|
|
1602
|
+
if (R(selected)) {
|
|
1603
|
+
ge("Operation cancelled.");
|
|
1594
1604
|
process.exit(0);
|
|
1595
1605
|
}
|
|
1596
1606
|
return selected;
|
|
@@ -1891,7 +1901,7 @@ async function Input({
|
|
|
1891
1901
|
message,
|
|
1892
1902
|
placeholder
|
|
1893
1903
|
}) {
|
|
1894
|
-
const value = await
|
|
1904
|
+
const value = await Re({
|
|
1895
1905
|
message,
|
|
1896
1906
|
placeholder,
|
|
1897
1907
|
validate(input) {
|
|
@@ -1900,8 +1910,8 @@ async function Input({
|
|
|
1900
1910
|
}
|
|
1901
1911
|
}
|
|
1902
1912
|
});
|
|
1903
|
-
if (
|
|
1904
|
-
|
|
1913
|
+
if (R(value)) {
|
|
1914
|
+
ge("Operation cancelled.");
|
|
1905
1915
|
process.exit(0);
|
|
1906
1916
|
}
|
|
1907
1917
|
return value.trim();
|
|
@@ -1912,12 +1922,12 @@ async function Select({
|
|
|
1912
1922
|
message,
|
|
1913
1923
|
options
|
|
1914
1924
|
}) {
|
|
1915
|
-
const selected = await
|
|
1925
|
+
const selected = await Ee({
|
|
1916
1926
|
message,
|
|
1917
1927
|
options
|
|
1918
1928
|
});
|
|
1919
|
-
if (
|
|
1920
|
-
|
|
1929
|
+
if (R(selected)) {
|
|
1930
|
+
ge("Operation cancelled.");
|
|
1921
1931
|
process.exit(0);
|
|
1922
1932
|
}
|
|
1923
1933
|
return selected;
|
|
@@ -1994,12 +2004,12 @@ async function Confirm({
|
|
|
1994
2004
|
cancelMessage,
|
|
1995
2005
|
exitOnCancel = true
|
|
1996
2006
|
}) {
|
|
1997
|
-
const confirmed = await
|
|
2007
|
+
const confirmed = await le({
|
|
1998
2008
|
message
|
|
1999
2009
|
});
|
|
2000
|
-
if (
|
|
2010
|
+
if (R(confirmed)) {
|
|
2001
2011
|
if (exitOnCancel) {
|
|
2002
|
-
|
|
2012
|
+
ge(cancelMessage ?? "Operation cancelled.");
|
|
2003
2013
|
process.exit(0);
|
|
2004
2014
|
}
|
|
2005
2015
|
return null;
|
|
@@ -2009,17 +2019,17 @@ async function Confirm({
|
|
|
2009
2019
|
|
|
2010
2020
|
// apps/cli/utils/intro.ts
|
|
2011
2021
|
function Intro(message) {
|
|
2012
|
-
|
|
2022
|
+
ye(message);
|
|
2013
2023
|
}
|
|
2014
2024
|
|
|
2015
2025
|
// apps/cli/utils/outro.ts
|
|
2016
2026
|
function Outro(message) {
|
|
2017
|
-
|
|
2027
|
+
fe(message);
|
|
2018
2028
|
}
|
|
2019
2029
|
|
|
2020
2030
|
// apps/cli/utils/spinner.ts
|
|
2021
2031
|
function Spinner() {
|
|
2022
|
-
return
|
|
2032
|
+
return vt();
|
|
2023
2033
|
}
|
|
2024
2034
|
|
|
2025
2035
|
// apps/cli/modules/setup/app/setup-command.ts
|
package/package.json
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@jannael/glinter",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "A high-performance, transparent Git wrapper with interactive staging",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"private": false,
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/Jannael/Glinter.git"
|
|
11
|
-
},
|
|
12
|
-
"author": {
|
|
13
|
-
"name": "Jannael",
|
|
14
|
-
"url": "https://github.com/jannael"
|
|
15
|
-
},
|
|
16
|
-
"homepage": "https://glinter.jannael.com",
|
|
17
|
-
"bugs": {
|
|
18
|
-
"url": "https://github.com/jannael/glinter/issues"
|
|
19
|
-
},
|
|
20
|
-
"publishConfig": {
|
|
21
|
-
"access": "public"
|
|
22
|
-
},
|
|
23
|
-
"keywords": [
|
|
24
|
-
"git",
|
|
25
|
-
"cli",
|
|
26
|
-
"wrapper",
|
|
27
|
-
"interactive",
|
|
28
|
-
"staging"
|
|
29
|
-
],
|
|
30
|
-
"files": [
|
|
31
|
-
"dist"
|
|
32
|
-
],
|
|
33
|
-
"exports": {
|
|
34
|
-
".": "./dist/index.js"
|
|
35
|
-
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "bun build ./apps/cli/index.ts --outfile=./dist/index.js --target=bun",
|
|
38
|
-
"prepublishOnly": "bun run build",
|
|
39
|
-
"test": "vitest",
|
|
40
|
-
"lint": "oxlint",
|
|
41
|
-
"lint:fix": "oxlint --fix",
|
|
42
|
-
"format": "prettier --write .",
|
|
43
|
-
"format:check": "prettier --check .",
|
|
44
|
-
"type-check": "bunx tsc --noEmit",
|
|
45
|
-
"prepare": "husky"
|
|
46
|
-
},
|
|
47
|
-
"bin": {
|
|
48
|
-
"g": "./dist/index.js"
|
|
49
|
-
},
|
|
50
|
-
"engines": {
|
|
51
|
-
"bun": ">=1.0.0"
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@types/bun": "
|
|
55
|
-
"husky": "9.1.7",
|
|
56
|
-
"oxlint": "1.
|
|
57
|
-
"prettier": "3.8.3",
|
|
58
|
-
"prettier-plugin-astro": "0.14.1",
|
|
59
|
-
"prettier-plugin-tailwindcss": "0.8.0",
|
|
60
|
-
"vitest": "4.1.
|
|
61
|
-
"lint-staged": "17.0.5",
|
|
62
|
-
"wrangler": "4.
|
|
63
|
-
},
|
|
64
|
-
"peerDependencies": {
|
|
65
|
-
"bun": "
|
|
66
|
-
"typescript": "6.0.3"
|
|
67
|
-
},
|
|
68
|
-
"dependencies": {
|
|
69
|
-
"@clack/prompts": "1.
|
|
70
|
-
},
|
|
71
|
-
"lint-staged": {
|
|
72
|
-
"*.{ts,tsx,js,jsx,astro}": [
|
|
73
|
-
"bun run lint:fix",
|
|
74
|
-
"bun run format"
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@jannael/glinter",
|
|
3
|
+
"version": "1.2.5",
|
|
4
|
+
"description": "A high-performance, transparent Git wrapper with interactive staging",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/Jannael/Glinter.git"
|
|
11
|
+
},
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Jannael",
|
|
14
|
+
"url": "https://github.com/jannael"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://glinter.jannael.com",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/jannael/glinter/issues"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"git",
|
|
25
|
+
"cli",
|
|
26
|
+
"wrapper",
|
|
27
|
+
"interactive",
|
|
28
|
+
"staging"
|
|
29
|
+
],
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"exports": {
|
|
34
|
+
".": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "bun build ./apps/cli/index.ts --outfile=./dist/index.js --target=bun",
|
|
38
|
+
"prepublishOnly": "bun run build",
|
|
39
|
+
"test": "vitest",
|
|
40
|
+
"lint": "oxlint",
|
|
41
|
+
"lint:fix": "oxlint --fix",
|
|
42
|
+
"format": "prettier --write .",
|
|
43
|
+
"format:check": "prettier --check .",
|
|
44
|
+
"type-check": "bunx tsc --noEmit",
|
|
45
|
+
"prepare": "husky"
|
|
46
|
+
},
|
|
47
|
+
"bin": {
|
|
48
|
+
"g": "./dist/index.js"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"bun": ">=1.0.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/bun": "1.3.14",
|
|
55
|
+
"husky": "9.1.7",
|
|
56
|
+
"oxlint": "1.67.0",
|
|
57
|
+
"prettier": "3.8.3",
|
|
58
|
+
"prettier-plugin-astro": "0.14.1",
|
|
59
|
+
"prettier-plugin-tailwindcss": "0.8.0",
|
|
60
|
+
"vitest": "4.1.7",
|
|
61
|
+
"lint-staged": "17.0.5",
|
|
62
|
+
"wrangler": "4.95.0"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"bun": "1.3.14",
|
|
66
|
+
"typescript": "6.0.3"
|
|
67
|
+
},
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"@clack/prompts": "1.5.0"
|
|
70
|
+
},
|
|
71
|
+
"lint-staged": {
|
|
72
|
+
"*.{ts,tsx,js,jsx,astro}": [
|
|
73
|
+
"bun run lint:fix",
|
|
74
|
+
"bun run format"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|