@jannael/glinter 1.2.0 → 1.2.2

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 (3) hide show
  1. package/README.md +12 -75
  2. package/dist/index.js +42 -11
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -13,94 +13,31 @@
13
13
 
14
14
  Glinter is a high-performance, transparent Git wrapper built with **Bun**.
15
15
 
16
+ [Commands](https://glinter.jannael.com/#commands)
17
+
18
+ [Aliases](https://glinter.jannael.com/alias)
19
+
20
+ [Quick start](https://glinter.jannael.com/#quick-start)
21
+
16
22
  ## Preview
17
23
 
18
24
  <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%;">
19
25
  Your browser does not support the video tag.
20
26
  </video>
21
27
 
22
- ## Features
23
-
24
- - **Abbreviation**: You can use `g` instead of `git`.
25
-
26
- - **Safe by Default**: Automatically filters and prevents accidental staging of sensitive files: `.env` and `node_modules`.
27
-
28
- - **Transparent Wrapper**: For every other command (like `commit`, `push`, `log`, or `status`), Glinter acts as a direct tunnel to Git. It preserves all original colors, formatting, and interactive features of the native Git CLI.
29
-
30
-
31
- ### Commands
32
-
33
- | Command | Description |
34
- |---|---|
35
- | `g add` | Opens an interactive file selector to stage changes, filtering out sensitive files like `.env` and `node_modules` |
36
- | `g commit` | Opens an interactive prompt to select a commit type and write a commit message |
37
- | `g switch` | Opens an interactive prompt to switch branches |
38
- | `g setup` | sets up alias for git and glinter |
39
- | `g alias` | shows all the aliases |
40
-
41
- ### Aliases
42
-
43
- | Alias | Command | Description |
44
- |---|---|---|
45
- | gs | git status -sb | Status with short format and branch info |
46
- | gl | git log --oneline --decorate --graph --all -n 20 | Recent commits graph |
47
- | gll | git log --stat | Log with file change statistics |
48
- | gd | git diff --word-diff=color | Word-level diff with colors |
49
- | gds | git diff --staged --word-diff=color | Staged diff with colors |
50
- | ga | glinter add | Interactive staging |
51
- | gaa | git add -A | Add all changes |
52
- | gc | glinter commit | Interactive commit |
53
- | gcm | git commit -m | Direct commit message |
54
- | gca | git commit --amend | Amend last commit |
55
- | gcan | git commit --amend --no-edit | Amend without editing |
56
- | gb | git branch | List branches |
57
- | gba | git branch -a | List all branches |
58
- | gco | glinter switch | Interactive branch switch |
59
- | gcb | git checkout -b | Create and switch branch |
60
- | gpl | git pull | Pull from remote |
61
- | gplr | git pull --rebase | Pull with rebase |
62
- | gp | git push | Push to remote |
63
- | ggpush | git push origin HEAD | Push current branch |
64
- | gpf | git push --force-with-lease | Force push with lease |
65
- | gst | git stash | Stash changes |
66
- | gstp | git stash pop | Pop stash |
67
- | gstl | git stash list | List stashes |
68
- | gcl | git clean -fd | Clean untracked files |
69
- | grh | git reset --hard | Hard reset |
70
-
71
- ## Quick Start
72
-
73
- 1. **Install Glinter**:
74
-
75
- ```bash
76
- npm install -g @jannael/glinter
77
- ```
78
-
79
- 2. **Set up aliases** (optional, recommended):
80
-
81
- ```bash
82
- g setup
83
- ```
84
-
85
- 3. **Start using Glinter**:
86
-
87
- ```bash
88
- g add # Interactive file staging
89
- g commit # Interactive commit
90
- g status # Standard git status
91
- g push # Standard git push
92
- ```
93
-
94
-
95
-
96
-
97
28
  ### Screenshots
98
29
 
99
30
  | `g add` | `g commit` |
100
31
  |---|---|
101
32
  | ![glinter add](./screenshots/ga.png) | ![glinter commit](./screenshots/gc.png) |
102
33
 
34
+ ## Features
103
35
 
36
+ - **Abbreviation**: You can use `g` instead of `git`.
37
+
38
+ - **Safe by Default**: Automatically filters and prevents accidental staging of sensitive files: `.env` and `node_modules`.
39
+
40
+ - **Transparent Wrapper**: For every other command (like `commit`, `push`, `log`, or `status`), Glinter acts as a direct tunnel to Git. It preserves all original colors, formatting, and interactive features of the native Git CLI.
104
41
 
105
42
  ## How it works
106
43
 
package/dist/index.js CHANGED
@@ -90,6 +90,35 @@ var require_src = __commonJS((exports, module) => {
90
90
  module.exports = { cursor, scroll, erase, beep };
91
91
  });
92
92
 
93
+ // apps/cli/commands.ts
94
+ var AVAILABLE_COMMANDS = [
95
+ {
96
+ name: "add",
97
+ command: "g add",
98
+ description: "Interactive add"
99
+ },
100
+ {
101
+ name: "commit",
102
+ command: "g commit",
103
+ description: "Interactive commit"
104
+ },
105
+ {
106
+ name: "switch",
107
+ command: "g switch",
108
+ description: "Interactive switch"
109
+ },
110
+ {
111
+ name: "alias",
112
+ command: "g alias",
113
+ description: "Show all the aliases"
114
+ },
115
+ {
116
+ name: "setup",
117
+ command: "g setup",
118
+ description: "Setup alias for git and glinter"
119
+ }
120
+ ];
121
+
93
122
  // apps/cli/error/error-constructor.ts
94
123
  function CreateError(name) {
95
124
  const capitalize = (text) => text.charAt(0).toUpperCase() + text.slice(1);
@@ -2231,19 +2260,21 @@ async function switchCommand() {
2231
2260
  await switchCommand2.execute();
2232
2261
  }
2233
2262
 
2263
+ // apps/cli/commands-fn.ts
2264
+ var COMMANDS_FN = {
2265
+ add: addCommand,
2266
+ commit: commitCommand,
2267
+ switch: switchCommand,
2268
+ alias: aliasCommand,
2269
+ setup: setupCommand
2270
+ };
2271
+
2234
2272
  // apps/cli/index.ts
2235
2273
  var args = Bun.argv.slice(2);
2236
- if (args[0] === "add" && !args[1])
2237
- await addCommand();
2238
- else if (args[0] === "commit" && !args[1])
2239
- await commitCommand();
2240
- else if (args[0] === "switch" && !args[1])
2241
- await switchCommand();
2242
- else if (args[0] === "alias" && !args[1])
2243
- await aliasCommand();
2244
- else if (args[0] === "setup")
2245
- await setupCommand();
2246
- else {
2274
+ var command = AVAILABLE_COMMANDS.find((command2) => command2.name === args[0]);
2275
+ if (command && args.length === 1) {
2276
+ await COMMANDS_FN[command.name]?.(args.slice(1));
2277
+ } else {
2247
2278
  const proc = Bun.spawn(["git", ...args], {
2248
2279
  stdio: ["inherit", "inherit", "inherit"]
2249
2280
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jannael/glinter",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "A high-performance, transparent Git wrapper with interactive staging",
5
5
  "type": "module",
6
6
  "private": false,
@@ -51,7 +51,8 @@
51
51
  "devDependencies": {
52
52
  "@biomejs/biome": "2.4.10",
53
53
  "@types/bun": "latest",
54
- "vitest": "4.1.4"
54
+ "vitest": "4.1.4",
55
+ "wrangler": "4.84.1"
55
56
  },
56
57
  "peerDependencies": {
57
58
  "bun": ">=1.0.0",