@jannael/glinter 1.0.4 → 1.0.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/dist/index.js +26 -23
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -90,17 +90,17 @@ var require_src = __commonJS((exports, module) => {
|
|
|
90
90
|
module.exports = { cursor, scroll, erase, beep };
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
// src/
|
|
93
|
+
// src/utils/colors.ts
|
|
94
94
|
var GREEN = "\x1B[32m";
|
|
95
95
|
var YELLOW = "\x1B[33m";
|
|
96
96
|
var RED = "\x1B[31m";
|
|
97
97
|
var MAGENTA = "\x1B[35m";
|
|
98
|
-
var
|
|
98
|
+
var BLUE = "\x1B[34m";
|
|
99
99
|
var BLACK = "\x1B[30m";
|
|
100
100
|
var BG_YELLOW = "\x1B[43m";
|
|
101
101
|
var RESET = "\x1B[0m";
|
|
102
102
|
|
|
103
|
-
// src/
|
|
103
|
+
// src/utils/check.ts
|
|
104
104
|
var CHECK = `${GREEN}\u2714${RESET}`;
|
|
105
105
|
|
|
106
106
|
// node_modules/@clack/core/dist/index.mjs
|
|
@@ -1254,7 +1254,7 @@ ${a}
|
|
|
1254
1254
|
};
|
|
1255
1255
|
var je = `${t("gray", d2)} `;
|
|
1256
1256
|
|
|
1257
|
-
// src/
|
|
1257
|
+
// src/utils/multiselect.ts
|
|
1258
1258
|
async function MultiSelect({
|
|
1259
1259
|
message,
|
|
1260
1260
|
options
|
|
@@ -1271,7 +1271,7 @@ async function MultiSelect({
|
|
|
1271
1271
|
return selected;
|
|
1272
1272
|
}
|
|
1273
1273
|
|
|
1274
|
-
// src/add/app/add-command.ts
|
|
1274
|
+
// src/modules/add/app/add-command.ts
|
|
1275
1275
|
class AddCommand {
|
|
1276
1276
|
getChangesUseCase;
|
|
1277
1277
|
stageChangesUseCase;
|
|
@@ -1286,11 +1286,10 @@ class AddCommand {
|
|
|
1286
1286
|
return;
|
|
1287
1287
|
}
|
|
1288
1288
|
const options = [
|
|
1289
|
-
{ value: "all", label: `${BOLD}all changes${RESET}` },
|
|
1290
1289
|
...changes.map((c2) => ({ value: c2.value, label: c2.label }))
|
|
1291
1290
|
];
|
|
1292
1291
|
const selectedChanges = await MultiSelect({
|
|
1293
|
-
message:
|
|
1292
|
+
message: `Select the changes you want to commit. ${BLUE}[space] to select and${RESET} ${GREEN}[enter] to confirm${RESET} ${MAGENTA}[a] to select all${RESET} ${RED}[esc] to cancel${RESET}`,
|
|
1294
1293
|
options
|
|
1295
1294
|
});
|
|
1296
1295
|
let selected = selectedChanges.map((file) => file.trim());
|
|
@@ -1311,7 +1310,7 @@ ${BG_YELLOW}${BLACK} WARNING ${RESET}`);
|
|
|
1311
1310
|
}
|
|
1312
1311
|
}
|
|
1313
1312
|
|
|
1314
|
-
// src/add/domain/change.ts
|
|
1313
|
+
// src/modules/add/domain/change.ts
|
|
1315
1314
|
class Change {
|
|
1316
1315
|
props;
|
|
1317
1316
|
constructor(props) {
|
|
@@ -1378,7 +1377,7 @@ class Change {
|
|
|
1378
1377
|
}
|
|
1379
1378
|
}
|
|
1380
1379
|
|
|
1381
|
-
// src/add/app/get-changes.use-case.ts
|
|
1380
|
+
// src/modules/add/app/get-changes.use-case.ts
|
|
1382
1381
|
class GetChangesUseCase {
|
|
1383
1382
|
gitRepository;
|
|
1384
1383
|
constructor(gitRepository) {
|
|
@@ -1405,7 +1404,7 @@ class GetChangesUseCase {
|
|
|
1405
1404
|
}
|
|
1406
1405
|
}
|
|
1407
1406
|
|
|
1408
|
-
// src/add/app/stage-changes.use-case.ts
|
|
1407
|
+
// src/modules/add/app/stage-changes.use-case.ts
|
|
1409
1408
|
class StageChangesUseCase {
|
|
1410
1409
|
gitRepository;
|
|
1411
1410
|
constructor(gitRepository) {
|
|
@@ -1418,7 +1417,7 @@ class StageChangesUseCase {
|
|
|
1418
1417
|
}
|
|
1419
1418
|
}
|
|
1420
1419
|
|
|
1421
|
-
// src/add/infra/bun-git.repository.ts
|
|
1420
|
+
// src/modules/add/infra/bun-git.repository.ts
|
|
1422
1421
|
var {$: $2 } = globalThis.Bun;
|
|
1423
1422
|
|
|
1424
1423
|
class BunGitRepository {
|
|
@@ -1442,7 +1441,7 @@ class BunGitRepository {
|
|
|
1442
1441
|
}
|
|
1443
1442
|
}
|
|
1444
1443
|
|
|
1445
|
-
// src/add/main.ts
|
|
1444
|
+
// src/modules/add/main.ts
|
|
1446
1445
|
async function addCommand() {
|
|
1447
1446
|
const gitRepository = new BunGitRepository;
|
|
1448
1447
|
const getChangesUseCase = new GetChangesUseCase(gitRepository);
|
|
@@ -1451,7 +1450,7 @@ async function addCommand() {
|
|
|
1451
1450
|
await addCommand2.execute();
|
|
1452
1451
|
}
|
|
1453
1452
|
|
|
1454
|
-
// src/switch/domain/branch.ts
|
|
1453
|
+
// src/modules/switch/domain/branch.ts
|
|
1455
1454
|
class Branch {
|
|
1456
1455
|
props;
|
|
1457
1456
|
constructor(props) {
|
|
@@ -1469,21 +1468,25 @@ class Branch {
|
|
|
1469
1468
|
get isHeadBranch() {
|
|
1470
1469
|
return this.props.name.includes("HEAD");
|
|
1471
1470
|
}
|
|
1472
|
-
static
|
|
1471
|
+
static fromGitBranch(entries) {
|
|
1473
1472
|
const branches = [];
|
|
1474
|
-
for (let i = 0;i < entries
|
|
1473
|
+
for (let i = 0;i < entries?.length; i++) {
|
|
1475
1474
|
const entry = entries[i];
|
|
1476
1475
|
if (!entry)
|
|
1477
1476
|
continue;
|
|
1478
1477
|
const current = entry.includes("*");
|
|
1479
1478
|
const remote = entry.includes("remotes/");
|
|
1480
|
-
branches.push(new Branch({
|
|
1479
|
+
branches.push(new Branch({
|
|
1480
|
+
name: current ? entry.replace("*", "").trim() : entry,
|
|
1481
|
+
current,
|
|
1482
|
+
remote
|
|
1483
|
+
}));
|
|
1481
1484
|
}
|
|
1482
1485
|
return branches;
|
|
1483
1486
|
}
|
|
1484
1487
|
}
|
|
1485
1488
|
|
|
1486
|
-
// src/switch/app/get-branches.use-case.ts
|
|
1489
|
+
// src/modules/switch/app/get-branches.use-case.ts
|
|
1487
1490
|
class GetBranchesUseCase {
|
|
1488
1491
|
branchRepository;
|
|
1489
1492
|
constructor(branchRepository) {
|
|
@@ -1491,12 +1494,12 @@ class GetBranchesUseCase {
|
|
|
1491
1494
|
}
|
|
1492
1495
|
async execute() {
|
|
1493
1496
|
const branches = await this.branchRepository.getBranches();
|
|
1494
|
-
const allBranches = Branch.
|
|
1497
|
+
const allBranches = Branch.fromGitBranch(branches);
|
|
1495
1498
|
return allBranches;
|
|
1496
1499
|
}
|
|
1497
1500
|
}
|
|
1498
1501
|
|
|
1499
|
-
// src/switch/app/switch-branch.use-case.ts
|
|
1502
|
+
// src/modules/switch/app/switch-branch.use-case.ts
|
|
1500
1503
|
class SwitchBranch {
|
|
1501
1504
|
branchRepository;
|
|
1502
1505
|
constructor(branchRepository) {
|
|
@@ -1507,7 +1510,7 @@ class SwitchBranch {
|
|
|
1507
1510
|
}
|
|
1508
1511
|
}
|
|
1509
1512
|
|
|
1510
|
-
// src/
|
|
1513
|
+
// src/utils/select.ts
|
|
1511
1514
|
async function Select({
|
|
1512
1515
|
message,
|
|
1513
1516
|
options
|
|
@@ -1523,7 +1526,7 @@ async function Select({
|
|
|
1523
1526
|
return selected;
|
|
1524
1527
|
}
|
|
1525
1528
|
|
|
1526
|
-
// src/switch/app/switch-command.ts
|
|
1529
|
+
// src/modules/switch/app/switch-command.ts
|
|
1527
1530
|
class SwitchCommand {
|
|
1528
1531
|
getBranchesUseCase;
|
|
1529
1532
|
switchBranch;
|
|
@@ -1564,7 +1567,7 @@ class SwitchCommand {
|
|
|
1564
1567
|
}
|
|
1565
1568
|
}
|
|
1566
1569
|
|
|
1567
|
-
// src/switch/infra/bun-switch-repository.ts
|
|
1570
|
+
// src/modules/switch/infra/bun-switch-repository.ts
|
|
1568
1571
|
var {$: $3 } = globalThis.Bun;
|
|
1569
1572
|
|
|
1570
1573
|
class BunSwitchRepository {
|
|
@@ -1587,7 +1590,7 @@ class BunSwitchRepository {
|
|
|
1587
1590
|
}
|
|
1588
1591
|
}
|
|
1589
1592
|
|
|
1590
|
-
// src/switch/main.ts
|
|
1593
|
+
// src/modules/switch/main.ts
|
|
1591
1594
|
async function switchCommand() {
|
|
1592
1595
|
const switchRepo = new BunSwitchRepository;
|
|
1593
1596
|
const switchBranchUseCase = new SwitchBranch(switchRepo);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jannael/glinter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "A high-performance, transparent Git wrapper with interactive staging",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"exports": {
|
|
34
|
-
".": "./
|
|
34
|
+
".": "./dist/index.js"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"dev": "bun run src/index.ts",
|