git-it-done 1.0.1 → 1.1.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/LICENSE +21 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +26 -29
- package/dist/index.js.map +1 -1
- package/dist/utils/checkGitStatus.d.ts +1 -1
- package/dist/utils/checkGitStatus.js +40 -26
- package/dist/utils/checkGitStatus.js.map +1 -1
- package/dist/utils/commitMessage.d.ts +1 -1
- package/dist/utils/commitMessage.js +17 -23
- package/dist/utils/commitMessage.js.map +1 -1
- package/dist/utils/diffSignals.d.ts +22 -0
- package/dist/utils/diffSignals.js +75 -0
- package/dist/utils/diffSignals.js.map +1 -0
- package/dist/utils/displayStatus.d.ts +1 -1
- package/dist/utils/displayStatus.js +10 -16
- package/dist/utils/displayStatus.js.map +1 -1
- package/dist/utils/fileStaging.d.ts +1 -1
- package/dist/utils/fileStaging.js +84 -44
- package/dist/utils/fileStaging.js.map +1 -1
- package/dist/utils/formatFileStatus.js +14 -14
- package/dist/utils/formatFileStatus.js.map +1 -1
- package/dist/utils/generateCommitMessage.d.ts +13 -1
- package/dist/utils/generateCommitMessage.js +179 -90
- package/dist/utils/generateCommitMessage.js.map +1 -1
- package/dist/utils/getFileChanges.d.ts +15 -1
- package/dist/utils/getFileChanges.js +60 -22
- package/dist/utils/getFileChanges.js.map +1 -1
- package/dist/utils/gitCommand.d.ts +27 -1
- package/dist/utils/gitCommand.js +53 -13
- package/dist/utils/gitCommand.js.map +1 -1
- package/dist/utils/performCommit.js +39 -50
- package/dist/utils/performCommit.js.map +1 -1
- package/dist/utils/process_interruption.js +23 -17
- package/dist/utils/process_interruption.js.map +1 -1
- package/dist/utils/push_to_remote.js +56 -46
- package/dist/utils/push_to_remote.js.map +1 -1
- package/dist/utils/repoRoot.d.ts +6 -0
- package/dist/utils/repoRoot.js +10 -0
- package/dist/utils/repoRoot.js.map +1 -0
- package/dist/utils/types/types.d.ts +11 -1
- package/dist/utils/types/types.js +1 -2
- package/package.json +39 -8
- package/readme.md +298 -9
- package/dist/utils/isGitrepo.d.ts +0 -1
- package/dist/utils/isGitrepo.js +0 -9
- package/dist/utils/isGitrepo.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sid.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
"use strict";
|
|
1
|
+
#!/usr/bin/env node
|
|
3
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -9,57 +8,55 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
9
|
});
|
|
11
10
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const commitMessage_1 = require("./utils/commitMessage");
|
|
23
|
-
const performCommit_1 = require("./utils/performCommit");
|
|
24
|
-
const push_to_remote_1 = require("./utils/push_to_remote");
|
|
25
|
-
const process_interruption_1 = __importDefault(require("./utils/process_interruption"));
|
|
11
|
+
import { intro, outro, cancel } from '@clack/prompts';
|
|
12
|
+
import chalk from 'chalk';
|
|
13
|
+
import { checkGitStatus } from './utils/checkGitStatus.js';
|
|
14
|
+
import { getChanges } from './utils/getFileChanges.js';
|
|
15
|
+
import { displayRepositoryStatus } from './utils/displayStatus.js';
|
|
16
|
+
import { handleFileStaging } from './utils/fileStaging.js';
|
|
17
|
+
import { handleCommitMessage } from './utils/commitMessage.js';
|
|
18
|
+
import { performCommit } from './utils/performCommit.js';
|
|
19
|
+
import { handlePushToRemote } from './utils/push_to_remote.js';
|
|
20
|
+
import start from './utils/process_interruption.js';
|
|
26
21
|
function main() {
|
|
27
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
var _a;
|
|
28
24
|
console.clear();
|
|
29
|
-
|
|
25
|
+
intro(chalk.bgBlue(' Auto Commit Tool '));
|
|
30
26
|
// 1. Validate git repository and configuration
|
|
31
|
-
const gitStatus =
|
|
27
|
+
const gitStatus = checkGitStatus();
|
|
32
28
|
if (!gitStatus.valid) {
|
|
33
|
-
|
|
29
|
+
cancel(gitStatus.reason);
|
|
34
30
|
process.exit(1);
|
|
35
31
|
}
|
|
32
|
+
(_a = gitStatus.warnings) === null || _a === void 0 ? void 0 : _a.forEach(warning => console.log(chalk.yellow.bold(`\n⚠️ ${warning}`)));
|
|
36
33
|
// 2. Get current repository changes
|
|
37
|
-
const changes =
|
|
34
|
+
const changes = getChanges();
|
|
38
35
|
const allFiles = [...changes.staged, ...changes.unstaged, ...changes.untracked];
|
|
39
36
|
// 3. Handle no changes case
|
|
40
37
|
if (allFiles.length === 0) {
|
|
41
|
-
|
|
38
|
+
outro(chalk.green('✨ Working directory is clean. Nothing to commit! 🎉'));
|
|
42
39
|
process.exit(0);
|
|
43
40
|
}
|
|
44
41
|
// 4. Display current repository status
|
|
45
|
-
|
|
42
|
+
displayRepositoryStatus(changes);
|
|
46
43
|
// 5. Handle file staging if needed
|
|
47
|
-
const filesToCommit = yield
|
|
44
|
+
const filesToCommit = yield handleFileStaging(changes);
|
|
48
45
|
if (filesToCommit.length === 0) {
|
|
49
|
-
|
|
46
|
+
outro(chalk.yellow('ℹ️ No files to commit after staging process.'));
|
|
50
47
|
process.exit(0);
|
|
51
48
|
}
|
|
52
49
|
// 6. Handle commit message creation
|
|
53
|
-
const commitMessage = yield
|
|
50
|
+
const commitMessage = yield handleCommitMessage(filesToCommit);
|
|
54
51
|
// 7. Perform the commit
|
|
55
|
-
const commitSuccess = yield
|
|
52
|
+
const commitSuccess = yield performCommit(commitMessage);
|
|
56
53
|
if (!commitSuccess) {
|
|
57
54
|
process.exit(1);
|
|
58
55
|
}
|
|
59
56
|
// 8. Handle push to remote
|
|
60
|
-
yield
|
|
61
|
-
|
|
57
|
+
yield handlePushToRemote();
|
|
58
|
+
outro(chalk.green('🎉 All done!'));
|
|
62
59
|
});
|
|
63
60
|
}
|
|
64
|
-
(
|
|
61
|
+
start(main);
|
|
65
62
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,MAAM,iCAAiC,CAAC;AAEpD,SAAe,IAAI;;;QACjB,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAE1C,+CAA+C;QAC/C,MAAM,SAAS,GAAG,cAAc,EAAE,CAAC;QACnC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;YACrB,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAAA,SAAS,CAAC,QAAQ,0CAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC,CAA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|
export declare function checkGitStatus(): GitStatus;
|
|
@@ -1,37 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { existsSync } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { gitCommand, gitOutput } from './gitCommand.js';
|
|
4
|
+
/** In-progress operations we refuse to commit into. */
|
|
5
|
+
const IN_PROGRESS = [
|
|
6
|
+
{ entry: 'MERGE_HEAD', reason: 'A merge is in progress' },
|
|
7
|
+
{ entry: 'REBASE_HEAD', reason: 'A rebase is in progress' },
|
|
8
|
+
{ entry: 'rebase-merge', reason: 'A rebase is in progress' },
|
|
9
|
+
{ entry: 'rebase-apply', reason: 'A rebase or `git am` is in progress' },
|
|
10
|
+
{ entry: 'CHERRY_PICK_HEAD', reason: 'A cherry-pick is in progress' },
|
|
11
|
+
{ entry: 'REVERT_HEAD', reason: 'A revert is in progress' },
|
|
12
|
+
{ entry: 'BISECT_LOG', reason: 'A bisect session is in progress' }
|
|
13
|
+
];
|
|
14
|
+
export function checkGitStatus() {
|
|
15
|
+
var _a;
|
|
16
|
+
const warnings = [];
|
|
8
17
|
// Step 1: Check if Git is installed
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
catch (_a) {
|
|
13
|
-
return {
|
|
14
|
-
valid: false,
|
|
15
|
-
reason: 'Git is not installed or not in PATH',
|
|
16
|
-
};
|
|
18
|
+
if (!gitCommand(['--version']).ok) {
|
|
19
|
+
return { valid: false, reason: 'Git is not installed or not in PATH' };
|
|
17
20
|
}
|
|
18
21
|
// Step 2: Check if inside a Git repository
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const gitDir = gitOutput(['rev-parse', '--absolute-git-dir']);
|
|
23
|
+
if (!gitDir) {
|
|
24
|
+
return { valid: false, reason: 'Not in a Git repository' };
|
|
25
|
+
}
|
|
26
|
+
// Step 3: Refuse to commit into a half-finished merge/rebase/cherry-pick
|
|
27
|
+
for (const { entry, reason } of IN_PROGRESS) {
|
|
28
|
+
if (existsSync(path.join(gitDir, entry))) {
|
|
29
|
+
return {
|
|
30
|
+
valid: false,
|
|
31
|
+
reason: `${reason}. Finish or abort it first (e.g. \`git merge --abort\`, \`git rebase --abort\`).`
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// Step 4: Warn loudly about a detached HEAD (commits there are easy to lose)
|
|
36
|
+
if (!gitCommand(['symbolic-ref', '--quiet', 'HEAD']).ok) {
|
|
37
|
+
const head = (_a = gitOutput(['rev-parse', '--short', 'HEAD'])) !== null && _a !== void 0 ? _a : 'unknown';
|
|
38
|
+
warnings.push(`HEAD is detached at ${head} — commits made here are not on any branch and can be lost. Run \`git switch -c <branch>\` first.`);
|
|
24
39
|
}
|
|
25
|
-
// Step
|
|
26
|
-
const userName = (
|
|
27
|
-
const userEmail = (
|
|
40
|
+
// Step 5: Check if Git user config is set
|
|
41
|
+
const userName = gitOutput(['config', 'user.name']);
|
|
42
|
+
const userEmail = gitOutput(['config', 'user.email']);
|
|
28
43
|
if (!userName || !userEmail) {
|
|
29
44
|
return {
|
|
30
45
|
valid: false,
|
|
31
|
-
reason: `Git user not configured. Run:\n git config --global user.name "Your Name"\n git config --global user.email "you@example.com"
|
|
46
|
+
reason: `Git user not configured. Run:\n git config --global user.name "Your Name"\n git config --global user.email "you@example.com"`
|
|
32
47
|
};
|
|
33
48
|
}
|
|
34
|
-
|
|
35
|
-
return { valid: true };
|
|
49
|
+
return warnings.length > 0 ? { valid: true, warnings } : { valid: true };
|
|
36
50
|
}
|
|
37
51
|
//# sourceMappingURL=checkGitStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkGitStatus.js","sourceRoot":"","sources":["../../src/utils/checkGitStatus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkGitStat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,WAAW,EAAE,CAAC;QAC5C,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;YACzC,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,GAAG,MAAM,kFAAkF;aACpG,CAAC;QACJ,CAAC;IACH,CAAC;IAED,6EAA6E;IAC7E,IAAI,CAAC,UAAU,CAAC,CAAC,cAAc,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACxD,MAAM,IAAI,GAAG,MAAA,SAAS,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,mCAAI,SAAS,CAAC;QACtE,QAAQ,CAAC,IAAI,CACX,uBAAuB,IAAI,mGAAmG,CAC/H,CAAC;IACJ,CAAC;IAED,0CAA0C;IAC1C,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAEtD,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5B,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,gIAAgI;SACzI,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC3E,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FileChange } from './types/types';
|
|
1
|
+
import { FileChange } from './types/types.js';
|
|
2
2
|
export declare function handleCommitMessage(filesToCommit: FileChange[]): Promise<string>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,25 +7,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const prompts_1 = require("@clack/prompts");
|
|
17
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
18
|
-
const generateCommitMessage_1 = require("./generateCommitMessage");
|
|
19
|
-
const formatFileStatus_1 = require("./formatFileStatus");
|
|
20
|
-
function handleCommitMessage(filesToCommit) {
|
|
10
|
+
import { select, text, cancel, isCancel } from '@clack/prompts';
|
|
11
|
+
import chalk from 'chalk';
|
|
12
|
+
import { generateCommitMessage } from './generateCommitMessage.js';
|
|
13
|
+
import { formatFileStatus } from './formatFileStatus.js';
|
|
14
|
+
export function handleCommitMessage(filesToCommit) {
|
|
21
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
16
|
// Display files to commit
|
|
23
17
|
displayFilesToCommit(filesToCommit);
|
|
24
18
|
// Generate automatic commit message
|
|
25
|
-
const generatedMessage =
|
|
19
|
+
const generatedMessage = generateCommitMessage(filesToCommit);
|
|
26
20
|
// Get user preference for commit message
|
|
27
21
|
const messageOption = yield getMessageOption(generatedMessage);
|
|
28
|
-
if (
|
|
29
|
-
|
|
22
|
+
if (isCancel(messageOption)) {
|
|
23
|
+
cancel('Operation cancelled');
|
|
30
24
|
process.exit(0);
|
|
31
25
|
}
|
|
32
26
|
// Handle different message options
|
|
@@ -41,12 +35,12 @@ function handleCommitMessage(filesToCommit) {
|
|
|
41
35
|
});
|
|
42
36
|
}
|
|
43
37
|
function displayFilesToCommit(filesToCommit) {
|
|
44
|
-
console.log(
|
|
45
|
-
filesToCommit.forEach(({ status, file }) => console.log(` ${
|
|
38
|
+
console.log(chalk.bold('\n📝 Files to commit:'));
|
|
39
|
+
filesToCommit.forEach(({ status, file }) => console.log(` ${formatFileStatus(status)} ${file}`));
|
|
46
40
|
}
|
|
47
41
|
function getMessageOption(generatedMessage) {
|
|
48
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
return yield
|
|
43
|
+
return yield select({
|
|
50
44
|
message: 'How would you like to create the commit message?',
|
|
51
45
|
options: [
|
|
52
46
|
{ value: 'generated', label: `Use generated: "${generatedMessage}"` },
|
|
@@ -58,13 +52,13 @@ function getMessageOption(generatedMessage) {
|
|
|
58
52
|
}
|
|
59
53
|
function getCustomMessage() {
|
|
60
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
const commitMessage = yield
|
|
55
|
+
const commitMessage = yield text({
|
|
62
56
|
message: 'Enter commit message:',
|
|
63
57
|
placeholder: 'feat: add new feature',
|
|
64
58
|
validate: value => !value.trim() ? 'Commit message is required' : undefined
|
|
65
59
|
});
|
|
66
|
-
if (
|
|
67
|
-
|
|
60
|
+
if (isCancel(commitMessage)) {
|
|
61
|
+
cancel('Operation cancelled');
|
|
68
62
|
process.exit(0);
|
|
69
63
|
}
|
|
70
64
|
return commitMessage;
|
|
@@ -72,13 +66,13 @@ function getCustomMessage() {
|
|
|
72
66
|
}
|
|
73
67
|
function getEditedMessage(generatedMessage) {
|
|
74
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
const commitMessage = yield
|
|
69
|
+
const commitMessage = yield text({
|
|
76
70
|
message: 'Edit commit message:',
|
|
77
71
|
initialValue: generatedMessage,
|
|
78
72
|
validate: value => !value.trim() ? 'Commit message is required' : undefined
|
|
79
73
|
});
|
|
80
|
-
if (
|
|
81
|
-
|
|
74
|
+
if (isCancel(commitMessage)) {
|
|
75
|
+
cancel('Operation cancelled');
|
|
82
76
|
process.exit(0);
|
|
83
77
|
}
|
|
84
78
|
return commitMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commitMessage.js","sourceRoot":"","sources":["../../src/utils/commitMessage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commitMessage.js","sourceRoot":"","sources":["../../src/utils/commitMessage.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,UAAgB,mBAAmB,CAAC,aAA2B;;QACnE,0BAA0B;QAC1B,oBAAoB,CAAC,aAAa,CAAC,CAAC;QAEpC,oCAAoC;QACpC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,aAAa,CAAC,CAAC;QAE9D,yCAAyC;QACzC,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;QAE/D,IAAI,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YAC5B,MAAM,CAAC,qBAAqB,CAAC,CAAC;YAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,mCAAmC;QACnC,IAAI,aAAa,GAAG,gBAAgB,CAAC;QAErC,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;YAC/B,aAAa,GAAG,MAAM,gBAAgB,EAAE,CAAC;QAC3C,CAAC;aAAM,IAAI,aAAa,KAAK,MAAM,EAAE,CAAC;YACpC,aAAa,GAAG,MAAM,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;CAAA;AAED,SAAS,oBAAoB,CAAC,aAA2B;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,C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AC,IAAI,EAAE,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,SAAS;SAC5E,CAAW,CAAC;QAEb,IAAI,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YAC5B,MAAM,CAAC,qBAAqB,CAAC,CAAC;YAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface DiffSignals {
|
|
2
|
+
/** An added comment explicitly states the change fixes something. */
|
|
3
|
+
fixIntent: boolean;
|
|
4
|
+
/** An added comment explicitly states the change restructures code. */
|
|
5
|
+
refactorIntent: boolean;
|
|
6
|
+
/** More declarations were added than removed — likely new API surface. */
|
|
7
|
+
newApi: boolean;
|
|
8
|
+
/** Conditional logic was both removed and added — weak "behaviour fix" hint. */
|
|
9
|
+
conditionalChurn: boolean;
|
|
10
|
+
/** The diff was too large to read; callers should say so rather than guess. */
|
|
11
|
+
oversized: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const EMPTY_SIGNALS: DiffSignals;
|
|
14
|
+
/**
|
|
15
|
+
* Derive intent hints from a unified diff, looking only at ADDED lines (`+`,
|
|
16
|
+
* excluding the `+++` file header) and REMOVED lines (`-`, excluding `---`).
|
|
17
|
+
* Scanning the raw diff text — headers, context lines and all — is what made
|
|
18
|
+
* every commit come out as "fix: resolve issues and bugs".
|
|
19
|
+
*/
|
|
20
|
+
export declare function analyzeDiff(diff: string): DiffSignals;
|
|
21
|
+
/** Read and analyse the staged diff. Returns null when git itself failed. */
|
|
22
|
+
export declare function readStagedDiffSignals(): DiffSignals | null;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { gitCommand } from './gitCommand.js';
|
|
2
|
+
export const EMPTY_SIGNALS = {
|
|
3
|
+
fixIntent: false,
|
|
4
|
+
refactorIntent: false,
|
|
5
|
+
newApi: false,
|
|
6
|
+
conditionalChurn: false,
|
|
7
|
+
oversized: false
|
|
8
|
+
};
|
|
9
|
+
const COMMENT = /^\s*(\/\/+|\/\*+|\*|#+|--|<!--|"""|''')/;
|
|
10
|
+
/**
|
|
11
|
+
* Deliberately narrow: it matches someone *stating* they fixed something, not
|
|
12
|
+
* the mere presence of the substring "error" (which `catch (error)` supplies in
|
|
13
|
+
* almost every real diff).
|
|
14
|
+
*/
|
|
15
|
+
const FIX_INTENT = /\b(bug\s?fix|hot\s?fix|work\s?around|regression|fix(e[sd])?\s+(a|an|the|this|issue|bug|crash|error|regression|typo|#\d+)|(fix|fixes|fixed|resolve|resolves|resolved|close|closes|closed)\s+#\d+)\b/i;
|
|
16
|
+
const REFACTOR_INTENT = /\b(refactor(ed|ing)?|restructur(e|ed|ing)|clean\s?up|simplif(y|ied|ies)|dedupe|deduplicat(e|ed)|extract(ed)?\s+(in)?to)\b/i;
|
|
17
|
+
const DECLARATION = /^\s*(export\s+(default\s+)?)?(public\s+|private\s+|protected\s+|static\s+|abstract\s+)*(async\s+)?(function|class|interface|enum|type\s+\w+\s*=|struct|trait|impl|def|func|fn)\b/;
|
|
18
|
+
const CONDITIONAL = /(^|[^\w.])(if|elif|else\s+if|switch|while|unless)\s*[({:]|\?\?|\?\./;
|
|
19
|
+
function isComment(line) {
|
|
20
|
+
return COMMENT.test(line);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Derive intent hints from a unified diff, looking only at ADDED lines (`+`,
|
|
24
|
+
* excluding the `+++` file header) and REMOVED lines (`-`, excluding `---`).
|
|
25
|
+
* Scanning the raw diff text — headers, context lines and all — is what made
|
|
26
|
+
* every commit come out as "fix: resolve issues and bugs".
|
|
27
|
+
*/
|
|
28
|
+
export function analyzeDiff(diff) {
|
|
29
|
+
const signals = Object.assign({}, EMPTY_SIGNALS);
|
|
30
|
+
let addedDeclarations = 0;
|
|
31
|
+
let removedDeclarations = 0;
|
|
32
|
+
let addedConditionals = 0;
|
|
33
|
+
let removedConditionals = 0;
|
|
34
|
+
for (const line of diff.split('\n')) {
|
|
35
|
+
const added = line.startsWith('+') && !line.startsWith('+++');
|
|
36
|
+
const removed = line.startsWith('-') && !line.startsWith('---');
|
|
37
|
+
if (!added && !removed)
|
|
38
|
+
continue;
|
|
39
|
+
const content = line.slice(1);
|
|
40
|
+
if (isComment(content)) {
|
|
41
|
+
if (added && FIX_INTENT.test(content))
|
|
42
|
+
signals.fixIntent = true;
|
|
43
|
+
if (added && REFACTOR_INTENT.test(content))
|
|
44
|
+
signals.refactorIntent = true;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (DECLARATION.test(content)) {
|
|
48
|
+
if (added)
|
|
49
|
+
addedDeclarations++;
|
|
50
|
+
else
|
|
51
|
+
removedDeclarations++;
|
|
52
|
+
}
|
|
53
|
+
if (CONDITIONAL.test(content)) {
|
|
54
|
+
if (added)
|
|
55
|
+
addedConditionals++;
|
|
56
|
+
else
|
|
57
|
+
removedConditionals++;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
signals.newApi = addedDeclarations > removedDeclarations;
|
|
61
|
+
signals.conditionalChurn = removedConditionals > 0 && addedConditionals > 0;
|
|
62
|
+
return signals;
|
|
63
|
+
}
|
|
64
|
+
/** Read and analyse the staged diff. Returns null when git itself failed. */
|
|
65
|
+
export function readStagedDiffSignals() {
|
|
66
|
+
const result = gitCommand(['diff', '--cached', '--no-color', '--no-ext-diff']);
|
|
67
|
+
if (result.oversized) {
|
|
68
|
+
return Object.assign(Object.assign({}, EMPTY_SIGNALS), { oversized: true });
|
|
69
|
+
}
|
|
70
|
+
if (!result.ok) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return analyzeDiff(result.stdout);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=diffSignals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diffSignals.js","sourceRoot":"","sources":["../../src/utils/diffSignals.ts"],"names":[],"mappings":"AAA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
|
|
2
2
|
export declare function displayRepositoryStatus(changes: GitChanges): void;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.displayRepositoryStatus = displayRepositoryStatus;
|
|
7
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
-
const formatFileStatus_1 = require("./formatFileStatus");
|
|
9
|
-
function displayRepositoryStatus(changes) {
|
|
10
|
-
console.log(chalk_1.default.bold('\n📁 Repository Status:'));
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { formatFileStatus } from './formatFileStatus.js';
|
|
3
|
+
export function displayRepositoryStatus(changes) {
|
|
4
|
+
console.log(chalk.bold('\n📁 Repository Status:'));
|
|
11
5
|
if (changes.staged.length > 0) {
|
|
12
|
-
console.log(
|
|
13
|
-
changes.staged.forEach(({ status, file }) => console.log(` ${
|
|
6
|
+
console.log(chalk.green('\nStaged files:'));
|
|
7
|
+
changes.staged.forEach(({ status, file }) => console.log(` ${formatFileStatus(status)} ${file}`));
|
|
14
8
|
}
|
|
15
9
|
if (changes.unstaged.length > 0) {
|
|
16
|
-
console.log(
|
|
17
|
-
changes.unstaged.forEach(({ status, file }) => console.log(` ${
|
|
10
|
+
console.log(chalk.yellow('\nUnstaged files:'));
|
|
11
|
+
changes.unstaged.forEach(({ status, file }) => console.log(` ${formatFileStatus(status)} ${file}`));
|
|
18
12
|
}
|
|
19
13
|
if (changes.untracked.length > 0) {
|
|
20
|
-
console.log(
|
|
21
|
-
changes.untracked.forEach(({ status, file }) => console.log(` ${
|
|
14
|
+
console.log(chalk.cyan('\nUntracked files:'));
|
|
15
|
+
changes.untracked.forEach(({ status, file }) => console.log(` ${formatFileStatus(status)} ${file}`));
|
|
22
16
|
}
|
|
23
17
|
}
|
|
24
18
|
//# sourceMappingURL=displayStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"displayStatus.js","sourceRoot":"","sources":["../../src/utils/displayStatus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"displayStatus.js","sourceRoot":"","sources":["../../src/utils/displayStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,UAAU,uBAAuB,CAAC,OAAmB;IACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC;IAEnD,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAC5C,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,gBAAgB,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CACrD,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAC/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,gBAAgB,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CACrD,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,gBAAgB,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CACrD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GitChanges, FileChange } from './types/types';
|
|
1
|
+
import { GitChanges, FileChange } from './types/types.js';
|
|
2
2
|
export declare function handleFileStaging(changes: GitChanges): Promise<FileChange[]>;
|