threadlines 0.1.36 → 0.1.38
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/commands/check.js +10 -5
- package/dist/git/vercel.js +20 -10
- package/package.json +1 -1
package/dist/commands/check.js
CHANGED
|
@@ -422,18 +422,23 @@ function displayResults(response, showFull) {
|
|
|
422
422
|
// Show attention items
|
|
423
423
|
if (attentionItems.length > 0) {
|
|
424
424
|
for (const item of attentionItems) {
|
|
425
|
-
console.log(chalk_1.default.yellow(
|
|
425
|
+
console.log(chalk_1.default.yellow(`[attention] ${item.expertId}`));
|
|
426
426
|
if (item.fileReferences && item.fileReferences.length > 0) {
|
|
427
|
+
// List all files as bullet points
|
|
427
428
|
for (const fileRef of item.fileReferences) {
|
|
428
429
|
const lineRef = item.lineReferences?.[item.fileReferences.indexOf(fileRef)];
|
|
429
430
|
const lineStr = lineRef ? `:${lineRef}` : '';
|
|
430
|
-
console.log(chalk_1.default.gray(
|
|
431
|
+
console.log(chalk_1.default.gray(`* ${fileRef}${lineStr}`));
|
|
431
432
|
}
|
|
432
433
|
}
|
|
433
|
-
|
|
434
|
-
|
|
434
|
+
// Show reasoning once at the end (if available)
|
|
435
|
+
if (item.reasoning) {
|
|
436
|
+
console.log(chalk_1.default.gray(item.reasoning));
|
|
435
437
|
}
|
|
438
|
+
else if (!item.fileReferences || item.fileReferences.length === 0) {
|
|
439
|
+
console.log(chalk_1.default.gray('Needs attention'));
|
|
440
|
+
}
|
|
441
|
+
console.log(''); // Empty line between threadlines
|
|
436
442
|
}
|
|
437
|
-
console.log('');
|
|
438
443
|
}
|
|
439
444
|
}
|
package/dist/git/vercel.js
CHANGED
|
@@ -17,6 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.getVercelContext = getVercelContext;
|
|
19
19
|
const simple_git_1 = __importDefault(require("simple-git"));
|
|
20
|
+
const child_process_1 = require("child_process");
|
|
20
21
|
const diff_1 = require("./diff");
|
|
21
22
|
/**
|
|
22
23
|
* Gets all Vercel context in one call - completely isolated from other environments.
|
|
@@ -75,7 +76,7 @@ async function getDiff(repoRoot) {
|
|
|
75
76
|
.filter(line => line.trim().length > 0)
|
|
76
77
|
.map(line => line.trim());
|
|
77
78
|
return {
|
|
78
|
-
diff: diff || '',
|
|
79
|
+
diff: diff || '', // Empty diff is legitimate (e.g., metadata-only commits, merge commits)
|
|
79
80
|
changedFiles
|
|
80
81
|
};
|
|
81
82
|
}
|
|
@@ -115,7 +116,10 @@ function getCommitSha() {
|
|
|
115
116
|
}
|
|
116
117
|
/**
|
|
117
118
|
* Gets commit author for Vercel
|
|
118
|
-
* Uses VERCEL_GIT_COMMIT_AUTHOR_NAME for name, git log for email
|
|
119
|
+
* Uses VERCEL_GIT_COMMIT_AUTHOR_NAME for name, raw git log command for email
|
|
120
|
+
*
|
|
121
|
+
* Uses raw `git log` command (same as test script) instead of simple-git library
|
|
122
|
+
* because simple-git's log method may not work correctly in Vercel's shallow clone.
|
|
119
123
|
*/
|
|
120
124
|
async function getCommitAuthorForVercel(repoRoot, commitSha) {
|
|
121
125
|
const authorName = process.env.VERCEL_GIT_COMMIT_AUTHOR_NAME;
|
|
@@ -123,14 +127,20 @@ async function getCommitAuthorForVercel(repoRoot, commitSha) {
|
|
|
123
127
|
throw new Error('Vercel: VERCEL_GIT_COMMIT_AUTHOR_NAME environment variable is not set. ' +
|
|
124
128
|
'This should be automatically provided by Vercel.');
|
|
125
129
|
}
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
// Use raw git log command (same approach as test script) - more reliable than simple-git
|
|
131
|
+
try {
|
|
132
|
+
const email = (0, child_process_1.execSync)(`git log ${commitSha} -1 --format=%ae`, { encoding: 'utf-8', cwd: repoRoot }).trim();
|
|
133
|
+
if (!email) {
|
|
134
|
+
throw new Error('Email is empty');
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
name: authorName.trim(),
|
|
138
|
+
email: email.trim()
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
129
142
|
throw new Error(`Vercel: Failed to get commit author email from git log for commit ${commitSha}. ` +
|
|
130
|
-
`This should be available in Vercel's build environment
|
|
143
|
+
`This should be available in Vercel's build environment. ` +
|
|
144
|
+
`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
131
145
|
}
|
|
132
|
-
return {
|
|
133
|
-
name: authorName.trim(),
|
|
134
|
-
email: gitAuthor.email.trim()
|
|
135
|
-
};
|
|
136
146
|
}
|