ticketlens 0.38.18 → 0.38.19
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/package.json
CHANGED
|
@@ -46,7 +46,7 @@ export async function testConnections({
|
|
|
46
46
|
session.failed();
|
|
47
47
|
const classified = classifyError(err, { baseUrl: conn.baseUrl, profileName: name });
|
|
48
48
|
session.footer(classified.message, 'error', classified.hint);
|
|
49
|
-
results.push({ name, ok: false, error: classified.message });
|
|
49
|
+
results.push({ name, ok: false, error: classified.message, hint: classified.hint });
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -153,7 +153,9 @@ export async function checkConnectivity({
|
|
|
153
153
|
message: 'No profiles configured — nothing to test.', hint: null, fixable: false,
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
const summary = results
|
|
156
|
+
const summary = results
|
|
157
|
+
.map(r => r.ok ? `${r.name}: ok` : `${r.name}: ${r.error}${r.hint ? ` → ${r.hint}` : ''}`)
|
|
158
|
+
.join('; ');
|
|
157
159
|
return {
|
|
158
160
|
id: 'connectivity', label: 'Tracker connectivity',
|
|
159
161
|
ok: failedCount === 0,
|
|
@@ -18,6 +18,8 @@ import { readCliToken } from './cli-auth.mjs';
|
|
|
18
18
|
|
|
19
19
|
const KNOWN_FLAGS = ['--format=', '--fix', '--profile=', '--help', '-h'];
|
|
20
20
|
|
|
21
|
+
const lowerFirst = (str) => str.charAt(0).toLowerCase() + str.slice(1);
|
|
22
|
+
|
|
21
23
|
function renderPlain(checks, { fixed, skipped, stream }) {
|
|
22
24
|
const s = createStyler({ isTTY: stream.isTTY });
|
|
23
25
|
stream.write('\n');
|
|
@@ -109,14 +111,26 @@ export async function runDoctor(args, {
|
|
|
109
111
|
const profileName = profileArg ? profileArg.split('=')[1] : null;
|
|
110
112
|
const shouldFix = validated.includes('--fix');
|
|
111
113
|
|
|
112
|
-
const
|
|
113
|
-
checkProfileConfigFn({ configDir, profileName, cwd }),
|
|
114
|
-
checkLicenseFreshnessFn({ configDir }),
|
|
115
|
-
|
|
116
|
-
checkCacheHealthFn({ configDir, profileName }),
|
|
117
|
-
checkRecallQueueFn({ configDir }),
|
|
114
|
+
const checkList = [
|
|
115
|
+
{ label: 'Profile configuration', run: () => checkProfileConfigFn({ configDir, profileName, cwd }) },
|
|
116
|
+
{ label: 'License freshness', run: () => checkLicenseFreshnessFn({ configDir }) },
|
|
117
|
+
{ label: 'Tracker connectivity', run: () => checkConnectivityFn({ configDir, profileName, cwd }) },
|
|
118
|
+
{ label: 'Attachment cache', run: () => checkCacheHealthFn({ configDir, profileName }) },
|
|
119
|
+
{ label: 'Recall sync queue', run: () => checkRecallQueueFn({ configDir }) },
|
|
118
120
|
];
|
|
119
121
|
|
|
122
|
+
const showProgress = format === 'plain' && stream.isTTY;
|
|
123
|
+
const s = createStyler({ isTTY: stream.isTTY });
|
|
124
|
+
const rawResults = [];
|
|
125
|
+
for (const { label, run } of checkList) {
|
|
126
|
+
if (showProgress) stream.write(` ${s.dim(`○ Checking ${lowerFirst(label)}…`)}\n`);
|
|
127
|
+
try {
|
|
128
|
+
rawResults.push(await run());
|
|
129
|
+
} finally {
|
|
130
|
+
if (showProgress) stream.write('\x1b[A\r\x1b[2K');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
120
134
|
let fixed = [];
|
|
121
135
|
let skipped = [];
|
|
122
136
|
let finalResults = rawResults;
|