threadlines 0.1.24 → 0.1.25
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 +29 -20
- package/package.json +1 -1
package/dist/commands/check.js
CHANGED
|
@@ -52,30 +52,39 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
52
52
|
async function checkCommand(options) {
|
|
53
53
|
const repoRoot = process.cwd();
|
|
54
54
|
console.log(chalk_1.default.blue('🔍 Threadline: Checking code against your threadlines...\n'));
|
|
55
|
-
//
|
|
55
|
+
// Pre-flight check: Validate ALL required environment variables at once
|
|
56
56
|
const apiKey = (0, config_1.getThreadlineApiKey)();
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const account = (0, config_1.getThreadlineAccount)();
|
|
58
|
+
const missingVars = [];
|
|
59
|
+
if (!apiKey)
|
|
60
|
+
missingVars.push('THREADLINE_API_KEY');
|
|
61
|
+
if (!account)
|
|
62
|
+
missingVars.push('THREADLINE_ACCOUNT');
|
|
63
|
+
if (missingVars.length > 0) {
|
|
64
|
+
console.error(chalk_1.default.red('❌ Error: Missing required environment variables:'));
|
|
65
|
+
for (const varName of missingVars) {
|
|
66
|
+
console.error(chalk_1.default.red(` • ${varName}`));
|
|
67
|
+
}
|
|
59
68
|
console.log('');
|
|
60
69
|
console.log(chalk_1.default.yellow('To fix this:'));
|
|
61
|
-
console.log(chalk_1.default.white(' 1. Create a .env.local file in your project root'));
|
|
62
|
-
console.log(chalk_1.default.gray(' 2. Add: THREADLINE_API_KEY=your-api-key-here'));
|
|
63
|
-
console.log(chalk_1.default.gray(' 3. Make sure .env.local is in your .gitignore'));
|
|
64
70
|
console.log('');
|
|
65
|
-
console.log(chalk_1.default.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
console.log(chalk_1.default.white(' Local development:'));
|
|
72
|
+
console.log(chalk_1.default.gray(' 1. Create a .env.local file in your project root'));
|
|
73
|
+
console.log(chalk_1.default.gray(' 2. Add the missing variable(s):'));
|
|
74
|
+
if (missingVars.includes('THREADLINE_API_KEY')) {
|
|
75
|
+
console.log(chalk_1.default.gray(' THREADLINE_API_KEY=your-api-key-here'));
|
|
76
|
+
}
|
|
77
|
+
if (missingVars.includes('THREADLINE_ACCOUNT')) {
|
|
78
|
+
console.log(chalk_1.default.gray(' THREADLINE_ACCOUNT=your-email@example.com'));
|
|
79
|
+
}
|
|
80
|
+
console.log(chalk_1.default.gray(' 3. Make sure .env.local is in your .gitignore'));
|
|
72
81
|
console.log('');
|
|
73
|
-
console.log(chalk_1.default.
|
|
74
|
-
console.log(chalk_1.default.
|
|
75
|
-
console.log(chalk_1.default.gray('
|
|
76
|
-
console.log(chalk_1.default.gray('
|
|
82
|
+
console.log(chalk_1.default.white(' CI/CD:'));
|
|
83
|
+
console.log(chalk_1.default.gray(' GitHub Actions: Settings → Secrets → Add variables'));
|
|
84
|
+
console.log(chalk_1.default.gray(' GitLab CI: Settings → CI/CD → Variables'));
|
|
85
|
+
console.log(chalk_1.default.gray(' Vercel: Settings → Environment Variables'));
|
|
77
86
|
console.log('');
|
|
78
|
-
console.log(chalk_1.default.gray('
|
|
87
|
+
console.log(chalk_1.default.gray('Get your credentials at: https://devthreadline.com/settings'));
|
|
79
88
|
process.exit(1);
|
|
80
89
|
}
|
|
81
90
|
try {
|
|
@@ -216,8 +225,8 @@ async function checkCommand(options) {
|
|
|
216
225
|
threadlines: threadlinesWithContext,
|
|
217
226
|
diff: gitDiff.diff,
|
|
218
227
|
files: gitDiff.changedFiles,
|
|
219
|
-
apiKey,
|
|
220
|
-
account,
|
|
228
|
+
apiKey: apiKey,
|
|
229
|
+
account: account,
|
|
221
230
|
repoName: repoName,
|
|
222
231
|
branchName: branchName,
|
|
223
232
|
commitSha: metadata.commitSha,
|