git-interactive-vlaqa 1.0.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/README.md +81 -0
- package/bin/gia +2 -0
- package/bin/gicm +2 -0
- package/dist/add.js +18 -0
- package/dist/commit.d.ts +11 -0
- package/dist/commit.d.ts.map +1 -0
- package/dist/commit.js +53 -0
- package/dist/commit.js.map +1 -0
- package/dist/errors/gitError.d.ts +4 -0
- package/dist/errors/gitError.d.ts.map +1 -0
- package/dist/errors/gitError.js +10 -0
- package/dist/errors/gitError.js.map +1 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +7 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/git.d.ts +14 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +24 -0
- package/dist/git.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# git-interactive
|
|
2
|
+
|
|
3
|
+
A collection of interactive CLI commands for common Git workflows, built on [Conventional Commits](https://www.conventionalcommits.org/).
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g git-interactive
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
|
|
19
|
+
### `gicm` — Interactive Commit
|
|
20
|
+
|
|
21
|
+
Creates a Conventional Commit via guided prompts. Requires staged changes.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
gicm
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### Interactive Prompts
|
|
28
|
+
|
|
29
|
+
**1. Commit type**
|
|
30
|
+
|
|
31
|
+
| Type | Description |
|
|
32
|
+
|------|-------------|
|
|
33
|
+
| `feat` | New feature |
|
|
34
|
+
| `test` | Test additions or changes |
|
|
35
|
+
| `fix` | Bug fix |
|
|
36
|
+
| `chore` | Maintenance tasks |
|
|
37
|
+
| `refactor` | Code restructuring without behavior change |
|
|
38
|
+
| `docs` | Documentation changes |
|
|
39
|
+
| `style` | Formatting, whitespace, etc. |
|
|
40
|
+
|
|
41
|
+
**2. Scope** *(optional)*
|
|
42
|
+
|
|
43
|
+
| Option | Description |
|
|
44
|
+
|--------|-------------|
|
|
45
|
+
| `branch` | Uses the current branch name as scope |
|
|
46
|
+
| `e2e` | Literal scope `e2e` |
|
|
47
|
+
| `api` | Literal scope `api` |
|
|
48
|
+
| `omit` | No scope |
|
|
49
|
+
| `custom` | Prompts for a custom scope string |
|
|
50
|
+
|
|
51
|
+
**3. Description**
|
|
52
|
+
|
|
53
|
+
A short description of the change. Must be at least 5 characters. A live character counter (`[n/75]`) is shown while typing.
|
|
54
|
+
|
|
55
|
+
#### Output format
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
<type>(<scope>): <description>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Examples:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
feat(my-branch): add user authentication
|
|
65
|
+
fix: resolve null pointer on login
|
|
66
|
+
chore(api): update dependencies
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
After a successful commit, the short hash and subject are printed:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
✔ Committed: a1b2c3d feat(my-branch): add user authentication
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### Error handling
|
|
76
|
+
|
|
77
|
+
| Condition | Message |
|
|
78
|
+
|-----------|---------|
|
|
79
|
+
| Not inside a Git repository | `Make sure you are calling commands from GIT project!` |
|
|
80
|
+
| No staged files | `No staged files. Stage your changes with \`git add\` first.` |
|
|
81
|
+
| Prompt cancelled (`Ctrl+C`) | `👋 until next time!` |
|
package/bin/gia
ADDED
package/bin/gicm
ADDED
package/dist/add.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.add = void 0;
|
|
4
|
+
const git_1 = require("./git");
|
|
5
|
+
const gitError_1 = require("./errors/gitError");
|
|
6
|
+
class Add {
|
|
7
|
+
gitBase;
|
|
8
|
+
constructor(gitBase = git_1.git) {
|
|
9
|
+
this.gitBase = gitBase;
|
|
10
|
+
}
|
|
11
|
+
async run(workdir) {
|
|
12
|
+
if (!this.gitBase.isInsideGitProject(workdir).ok)
|
|
13
|
+
throw new gitError_1.GitError('Make sure you are calling commands from GIT project!');
|
|
14
|
+
// TODO: implement interactive git add
|
|
15
|
+
throw new Error('Not implemented');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.add = new Add();
|
package/dist/commit.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { git } from './git';
|
|
2
|
+
declare class Commit {
|
|
3
|
+
private gitBase;
|
|
4
|
+
constructor(gitBase?: typeof git);
|
|
5
|
+
private gitArgs;
|
|
6
|
+
ask(workdir: string): Promise<string>;
|
|
7
|
+
call(workdir: string): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare const commit: Commit;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=commit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../src/commit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,cAAM,MAAM;IACI,OAAO,CAAC,OAAO;gBAAP,OAAO,GAAE,OAAO,GAAS;IAC7C,OAAO,CAAC,OAAO,CAGb;IAEW,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA+BrC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAWpD;AAED,eAAO,MAAM,MAAM,QAAe,CAAC"}
|
package/dist/commit.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commit = void 0;
|
|
4
|
+
const prompts_1 = require("@inquirer/prompts");
|
|
5
|
+
const git_1 = require("./git");
|
|
6
|
+
const errors_1 = require("./errors");
|
|
7
|
+
class Commit {
|
|
8
|
+
gitBase;
|
|
9
|
+
constructor(gitBase = git_1.git) {
|
|
10
|
+
this.gitBase = gitBase;
|
|
11
|
+
}
|
|
12
|
+
async promptMessage(workdir) {
|
|
13
|
+
const wrap = (s) => s ? `(${s})` : '';
|
|
14
|
+
const type = await (0, prompts_1.rawlist)({
|
|
15
|
+
message: 'Select commit type:',
|
|
16
|
+
choices: ['feat', 'test', 'fix', 'chore', 'refactor', 'docs', 'style'],
|
|
17
|
+
});
|
|
18
|
+
const scopeAnswer = await (0, prompts_1.rawlist)({
|
|
19
|
+
message: 'Select commit scope:',
|
|
20
|
+
choices: ['branch', 'e2e', 'api', 'omit', 'custom'],
|
|
21
|
+
});
|
|
22
|
+
let scope = '';
|
|
23
|
+
if (scopeAnswer === 'branch') {
|
|
24
|
+
const branch = this.gitBase.ok(workdir, ['branch', '--show-current']);
|
|
25
|
+
if (!branch.ok)
|
|
26
|
+
throw new errors_1.GitError(`Could not get branch name: ${branch.out}`);
|
|
27
|
+
scope = wrap(branch.out);
|
|
28
|
+
}
|
|
29
|
+
else if (scopeAnswer === 'custom') {
|
|
30
|
+
scope = wrap(await (0, prompts_1.input)({ message: 'Provide custom scope:' }));
|
|
31
|
+
}
|
|
32
|
+
const description = await (0, prompts_1.input)({
|
|
33
|
+
message: 'Provide commit description:',
|
|
34
|
+
transformer: (v) => `\x1b[32m[${v.length}/75]\x1b[0m ${v}`,
|
|
35
|
+
validate: (v) => v.trim().length > 5 || 'Description should be 5 characters long!',
|
|
36
|
+
});
|
|
37
|
+
return `${type}${scope}: ${description.trim()}`;
|
|
38
|
+
}
|
|
39
|
+
async run(workdir) {
|
|
40
|
+
if (!this.gitBase.isInsideGitProject(workdir).ok)
|
|
41
|
+
throw new errors_1.GitError('Make sure you are calling commands from GIT project!');
|
|
42
|
+
const staged = this.gitBase.ok(workdir, ['diff', '--cached', '--name-only']);
|
|
43
|
+
if (!staged.ok || staged.out.trim() === '')
|
|
44
|
+
throw new errors_1.GitError('No staged files. Stage your changes with `git add` first.');
|
|
45
|
+
const message = await this.promptMessage(workdir);
|
|
46
|
+
const result = this.gitBase.ok(workdir, ['commit', '-m', message]);
|
|
47
|
+
if (!result.ok)
|
|
48
|
+
throw new errors_1.GitError(`Failed to commit: ${result.out}`);
|
|
49
|
+
const log = this.gitBase.ok(workdir, ['log', '-1', '--pretty=format:%h %s']);
|
|
50
|
+
console.log(`\n\x1b[32m✔ Committed:\x1b[0m ${log.out}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.commit = new Commit();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit.js","sourceRoot":"","sources":["../src/commit.ts"],"names":[],"mappings":";;;AAAA,+CAAmD;AACnD,+BAA4B;AAC5B,gDAA6C;AAE7C,MAAM,MAAM;IACY;IAApB,YAAoB,UAAsB,SAAG;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IACzC,OAAO,GAAG;QACd,MAAM,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC;QACpC,MAAM,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC;KACzD,CAAC;IAEK,KAAK,CAAC,GAAG,CAAC,OAAe;QAC5B,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,sCAAsC;QAEtC,MAAM,IAAI,GAAG,MAAM,IAAA,iBAAO,EAAC;YACvB,OAAO,EAAE,qBAAqB;YAC9B,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC;SACzE,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,MAAM,IAAA,iBAAO,EAAC;YAC9B,OAAO,EAAE,sBAAsB;YAC/B,OAAO,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;SACvD,CAAC,CAAC;QAEH,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;YAC3B,KAAK,GAAG,QAAQ,CAAC,MAAM,IAAA,eAAK,EAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC;QACxE,CAAC;aAAM,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;YAClC,MAAM,UAAU,GAAI,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAClE,IAAI,CAAC,UAAU,CAAC,EAAE;gBAAE,MAAM,IAAI,mBAAQ,CAAC,4BAA4B,CAAC,CAAC;YAErE,KAAK,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACtC,CAAC;aAAM,IAAI,WAAW,KAAK,OAAO,EAAE,CAAC;YACjC,KAAK,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,IAAA,eAAK,EAAC;YACxB,OAAO,EAAE,6BAA6B;SACzC,CAAC,CAAC;QAEH,OAAO,GAAG,IAAI,GAAG,KAAK,KAAK,OAAO,EAAE,CAAC;IACzC,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,OAAe;QAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,EAAE;YAC5C,MAAM,IAAI,mBAAQ,CAAC,sDAAsD,CAAC,CAAC;QAE/E,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAExC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7E,IAAI,CAAC,aAAa,CAAC,EAAE;YAAE,MAAM,IAAI,mBAAQ,CAAC,mBAAmB,CAAC,CAAC;IACnE,CAAC;CAEJ;AAEY,QAAA,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitError.d.ts","sourceRoot":"","sources":["../../src/errors/gitError.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;gBACnB,OAAO,EAAE,MAAM;CAI9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitError.js","sourceRoot":"","sources":["../../src/errors/gitError.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAS,SAAQ,KAAK;IAC/B,YAAY,OAAe;QACvB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IAC3B,CAAC;CACJ;AALD,4BAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExitPromptError = exports.GitError = void 0;
|
|
4
|
+
var gitError_1 = require("./gitError");
|
|
5
|
+
Object.defineProperty(exports, "GitError", { enumerable: true, get: function () { return gitError_1.GitError; } });
|
|
6
|
+
var core_1 = require("@inquirer/core");
|
|
7
|
+
Object.defineProperty(exports, "ExitPromptError", { enumerable: true, get: function () { return core_1.ExitPromptError; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
|
package/dist/git.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare class Git {
|
|
2
|
+
private call;
|
|
3
|
+
ok(workdir: string, args: string[]): {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
out: string;
|
|
6
|
+
};
|
|
7
|
+
isInsideGitProject(workdir: string): {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
out: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare const git: Git;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAEA,cAAM,GAAG;IACL,OAAO,CAAC,IAAI;IAIL,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAgBjE,kBAAkB,CAAC,OAAO,EAAE,MAAM;YAhBS,OAAO;aAAO,MAAM;;CAmBzE;AAED,eAAO,MAAM,GAAG,KAAY,CAAC"}
|
package/dist/git.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.git = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
class Git {
|
|
6
|
+
call(workdir, args) {
|
|
7
|
+
return (0, child_process_1.execFileSync)('git', args, { cwd: workdir, encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
8
|
+
}
|
|
9
|
+
ok(workdir, args) {
|
|
10
|
+
try {
|
|
11
|
+
return { ok: true, out: this.call(workdir, args) };
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
const err = e;
|
|
15
|
+
const stderr = typeof err.stderr === 'string' ? err.stderr : (err.stderr?.toString() ?? '');
|
|
16
|
+
const stdout = typeof err.stdout === 'string' ? err.stdout : (err.stdout?.toString() ?? '');
|
|
17
|
+
return { ok: false, out: (stderr || stdout || err.message).trim() };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
isInsideGitProject(workdir) {
|
|
21
|
+
return this.ok(workdir, ['rev-parse', '--is-inside-work-tree']);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.git = new Git();
|
package/dist/git.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAE7C,MAAM,GAAG;IACG,IAAI,CAAC,OAAe,EAAE,IAAc;QACxC,OAAO,IAAA,4BAAY,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/F,CAAC;IAEM,EAAE,CAAC,OAAe,EAAE,IAAc;QACrC,IAAI,CAAC;YACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;QACvD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,MAAM,GAAG,GAAG,CAIX,CAAC;YACF,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5F,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAE5F,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,KAAK,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;QAC7E,CAAC;IACL,CAAC;IAEM,kBAAkB,CAAC,OAAe;QACrC,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC,CAAC;IACpE,CAAC;CACJ;AAEY,QAAA,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const commit_1 = require("./commit");
|
|
8
|
+
const errors_1 = require("./errors");
|
|
9
|
+
const add_1 = require("./add");
|
|
10
|
+
const command = path_1.default.basename(process.argv[1] ?? '');
|
|
11
|
+
(async () => {
|
|
12
|
+
const workdir = process.cwd();
|
|
13
|
+
switch (command) {
|
|
14
|
+
case 'gicm':
|
|
15
|
+
await commit_1.commit.run(workdir);
|
|
16
|
+
break;
|
|
17
|
+
case 'gia':
|
|
18
|
+
await add_1.add.run(workdir);
|
|
19
|
+
break;
|
|
20
|
+
default: console.log(`Unknown command: ${command}`);
|
|
21
|
+
}
|
|
22
|
+
})().catch((error) => {
|
|
23
|
+
if (error instanceof errors_1.ExitPromptError) {
|
|
24
|
+
console.log('👋 until next time!');
|
|
25
|
+
}
|
|
26
|
+
else if (error instanceof Error) {
|
|
27
|
+
console.error(`❌ ${error.message}`);
|
|
28
|
+
process.exitCode = 1;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
console.error('Unexpected error:', error);
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,qCAAkC;AAElC,CAAC,KAAK,IAAI,EAAE;IACR,IAAI,CAAC;QACD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAE9B,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAClE,CAAC;AAEL,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAE1C,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;IACtC,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC7D,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACvC,CAAC;SAAM,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC7D,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "git-interactive-vlaqa",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Interactive Git CLI",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"prepublishOnly": "npm run build",
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"bin"
|
|
14
|
+
],
|
|
15
|
+
"bin": {
|
|
16
|
+
"gicm": "./bin/gicm",
|
|
17
|
+
"gia": "./bin/gia"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/VladimirLQA/git_utils.git"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [],
|
|
24
|
+
"author": "Volodymyr Lazurenko",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/VladimirLQA/git_utils/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/VladimirLQA/git_utils#readme",
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@eslint/js": "^10.0.1",
|
|
32
|
+
"@eslint/json": "^2.0.0",
|
|
33
|
+
"@eslint/markdown": "^8.0.2",
|
|
34
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
35
|
+
"@types/node": "^25.9.3",
|
|
36
|
+
"eslint": "^10.5.0",
|
|
37
|
+
"globals": "^17.6.0",
|
|
38
|
+
"jiti": "^2.7.0",
|
|
39
|
+
"typescript": "^6.0.3",
|
|
40
|
+
"typescript-eslint": "^8.61.0"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@inquirer/prompts": "^8.5.2"
|
|
44
|
+
}
|
|
45
|
+
}
|