@misaelabanto/commita 0.1.2 → 0.3.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.
|
@@ -4,7 +4,16 @@
|
|
|
4
4
|
"Bash(bun build:*)",
|
|
5
5
|
"Bash(./commita:*)",
|
|
6
6
|
"Bash(/Users/misaelabanto/Code/personal/commita/commita set:*)",
|
|
7
|
-
"Skill(commita)"
|
|
7
|
+
"Skill(commita)",
|
|
8
|
+
"Bash(bun run:*)",
|
|
9
|
+
"WebFetch(domain:nvchad.com)",
|
|
10
|
+
"WebFetch(domain:github.com)",
|
|
11
|
+
"WebFetch(domain:raw.githubusercontent.com)",
|
|
12
|
+
"WebFetch(domain:www.reddit.com)",
|
|
13
|
+
"WebFetch(domain:www.lazyvim.org)",
|
|
14
|
+
"WebFetch(domain:mason-registry.dev)",
|
|
15
|
+
"WebFetch(domain:neovim.io)",
|
|
16
|
+
"Bash(curl -sL \"https://api.github.com/repos/NvChad/ui/git/trees/main?recursive=1\" 2>/dev/null | python3 -c \"import sys,json; [print\\(t['path']\\) for t in json.load\\(sys.stdin\\).get\\('tree',[]\\) if 'lsp' in t['path'].lower\\(\\)]\" 2>/dev/null)"
|
|
8
17
|
]
|
|
9
18
|
}
|
|
10
19
|
}
|
|
@@ -6,23 +6,31 @@ on:
|
|
|
6
6
|
pull_request:
|
|
7
7
|
branches: [main]
|
|
8
8
|
|
|
9
|
+
env:
|
|
10
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
11
|
+
|
|
9
12
|
jobs:
|
|
10
13
|
build:
|
|
11
14
|
name: Build ${{ matrix.output }}
|
|
12
|
-
runs-on:
|
|
15
|
+
runs-on: ${{ matrix.runner }}
|
|
13
16
|
strategy:
|
|
14
17
|
matrix:
|
|
15
18
|
include:
|
|
16
19
|
- target: bun-darwin-x64
|
|
17
20
|
output: commita-darwin-amd64
|
|
21
|
+
runner: ubuntu-latest
|
|
18
22
|
- target: bun-darwin-arm64
|
|
19
23
|
output: commita-darwin-arm64
|
|
24
|
+
runner: ubuntu-latest
|
|
20
25
|
- target: bun-linux-x64
|
|
21
26
|
output: commita-linux-amd64
|
|
27
|
+
runner: ubuntu-latest
|
|
22
28
|
- target: bun-linux-arm64
|
|
23
29
|
output: commita-linux-arm64
|
|
30
|
+
runner: ubuntu-24.04-arm
|
|
24
31
|
- target: bun-windows-x64
|
|
25
32
|
output: commita-windows-amd64.exe
|
|
33
|
+
runner: ubuntu-latest
|
|
26
34
|
|
|
27
35
|
steps:
|
|
28
36
|
- uses: actions/checkout@v4
|
package/README.md
CHANGED
|
@@ -209,12 +209,21 @@ bun run index.ts --all
|
|
|
209
209
|
|
|
210
210
|
### Ignore Patterns
|
|
211
211
|
|
|
212
|
-
Exclude files matching patterns:
|
|
212
|
+
Exclude files matching glob patterns. You can use folder names, glob wildcards, or both:
|
|
213
213
|
|
|
214
214
|
```bash
|
|
215
|
-
|
|
215
|
+
# Ignore entire directories by name
|
|
216
|
+
bun run index.ts --all --ignore "dumps,node_modules"
|
|
217
|
+
|
|
218
|
+
# Ignore files by extension
|
|
219
|
+
bun run index.ts --all --ignore "*.log,*.csv"
|
|
220
|
+
|
|
221
|
+
# Mix folder names and glob patterns
|
|
222
|
+
bun run index.ts --all --ignore "dumps,*.log,dist/*"
|
|
216
223
|
```
|
|
217
224
|
|
|
225
|
+
> **Note**: Bare folder names like `dumps` automatically match all files inside that folder (equivalent to `dumps/**`).
|
|
226
|
+
|
|
218
227
|
### Skip Pushing
|
|
219
228
|
|
|
220
229
|
Don't push commits to remote:
|
|
@@ -295,7 +304,7 @@ This will group files by their directories and create separate commits for each
|
|
|
295
304
|
Ignore build artifacts and logs:
|
|
296
305
|
|
|
297
306
|
```bash
|
|
298
|
-
bun run index.ts --all --ignore "dist
|
|
307
|
+
bun run index.ts --all --ignore "dist,*.log,coverage"
|
|
299
308
|
```
|
|
300
309
|
|
|
301
310
|
### Scenario 3: Local Commits Only
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ export interface CommitOptions {
|
|
|
11
11
|
all: boolean;
|
|
12
12
|
ignore: string;
|
|
13
13
|
push: boolean;
|
|
14
|
+
verify: boolean;
|
|
14
15
|
config?: string;
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -19,6 +20,7 @@ export class CommitHandler {
|
|
|
19
20
|
private fileGrouper: FileGrouper;
|
|
20
21
|
private aiService: AIService;
|
|
21
22
|
private config: CommitaConfig;
|
|
23
|
+
private noVerify: boolean = false;
|
|
22
24
|
|
|
23
25
|
constructor(config: CommitaConfig) {
|
|
24
26
|
this.config = config;
|
|
@@ -30,6 +32,8 @@ export class CommitHandler {
|
|
|
30
32
|
async execute(options: CommitOptions): Promise<void> {
|
|
31
33
|
console.log(chalk.blue('🤖 Commita - AI-powered auto-commit\n'));
|
|
32
34
|
|
|
35
|
+
this.noVerify = !options.verify;
|
|
36
|
+
|
|
33
37
|
await this.gitService.init();
|
|
34
38
|
|
|
35
39
|
const boundaries = ProjectDetector.detect(this.gitService.getRootDir());
|
|
@@ -113,7 +117,7 @@ export class CommitHandler {
|
|
|
113
117
|
console.log();
|
|
114
118
|
|
|
115
119
|
await this.gitService.stageFiles(files);
|
|
116
|
-
await this.gitService.commit(message);
|
|
120
|
+
await this.gitService.commit(message, { noVerify: this.noVerify });
|
|
117
121
|
console.log(chalk.green(` \u2713 Committed ${files.length} ${isStaged ? 'staged' : 'unstaged'} file(s)`));
|
|
118
122
|
}
|
|
119
123
|
}
|
package/src/cli/index.ts
CHANGED
|
@@ -15,8 +15,9 @@ export async function runCLI() {
|
|
|
15
15
|
.description('AI-powered git auto-commit tool')
|
|
16
16
|
.version(packageJson.version, '-v, --version', 'Show version number')
|
|
17
17
|
.option('-a, --all', 'Process all changes grouped by folders', false)
|
|
18
|
-
.option('-i, --ignore <patterns>', 'Comma-separated patterns to exclude', '')
|
|
18
|
+
.option('-i, --ignore <patterns>', 'Comma-separated glob patterns to exclude (e.g. "dumps,*.log,dist/*")', '')
|
|
19
19
|
.option('--no-push', 'Skip pushing after commit')
|
|
20
|
+
.option('--no-verify', 'Bypass git pre-commit and commit-msg hooks')
|
|
20
21
|
.option('-c, --config <path>', 'Path to custom config file')
|
|
21
22
|
.action(async (options: CommitOptions) => {
|
|
22
23
|
try {
|
package/src/git/git.service.ts
CHANGED
|
@@ -121,8 +121,12 @@ index 0000000..0000000
|
|
|
121
121
|
await this.git.reset(['HEAD', '--', ...files]);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
async commit(message: string): Promise<void> {
|
|
125
|
-
|
|
124
|
+
async commit(message: string, options?: { noVerify?: boolean }): Promise<void> {
|
|
125
|
+
if (options?.noVerify) {
|
|
126
|
+
await this.git.commit(message, undefined, { '--no-verify': null });
|
|
127
|
+
} else {
|
|
128
|
+
await this.git.commit(message);
|
|
129
|
+
}
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
async getCurrentBranch(): Promise<string> {
|