ticketlens 0.38.18 → 0.38.20

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ticketlens",
3
- "version": "0.38.18",
3
+ "version": "0.38.20",
4
4
  "description": "Jira CLI for developers — fetch ticket context, triage your queue, and stop tab-switching. Zero dependencies, all local.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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.map(r => r.ok ? `${r.name}: ok` : `${r.name}: ${r.error}`).join('; ');
156
+ const summary = results
157
+ .map(r => r.ok ? `${r.name}: ok` : `${r.name}: ${r.error}${r.hint ? ` → ${r.hint}` : ''}`)
158
+ .join('\n');
157
159
  return {
158
160
  id: 'connectivity', label: 'Tracker connectivity',
159
161
  ok: failedCount === 0,
@@ -18,13 +18,17 @@ 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');
24
26
  for (const check of checks) {
25
27
  const icon = check.ok ? s.green('✔') : s.red('✖');
26
28
  stream.write(` ${icon} ${check.label}: ${check.message}\n`);
27
- if (!check.ok && check.hint) stream.write(` ${s.dim(check.hint)}\n`);
29
+ if (!check.ok && check.hint) {
30
+ for (const line of check.hint.split('\n')) stream.write(` ${s.dim(line)}\n`);
31
+ }
28
32
  }
29
33
  if (fixed.length > 0) {
30
34
  stream.write(`\n ${s.green('Fixed:')} ${fixed.join(', ')}\n`);
@@ -109,14 +113,26 @@ export async function runDoctor(args, {
109
113
  const profileName = profileArg ? profileArg.split('=')[1] : null;
110
114
  const shouldFix = validated.includes('--fix');
111
115
 
112
- const rawResults = [
113
- checkProfileConfigFn({ configDir, profileName, cwd }),
114
- checkLicenseFreshnessFn({ configDir }),
115
- await checkConnectivityFn({ configDir, profileName, cwd }),
116
- checkCacheHealthFn({ configDir, profileName }),
117
- checkRecallQueueFn({ configDir }),
116
+ const checkList = [
117
+ { label: 'Profile configuration', run: () => checkProfileConfigFn({ configDir, profileName, cwd }) },
118
+ { label: 'License freshness', run: () => checkLicenseFreshnessFn({ configDir }) },
119
+ { label: 'Tracker connectivity', run: () => checkConnectivityFn({ configDir, profileName, cwd }) },
120
+ { label: 'Attachment cache', run: () => checkCacheHealthFn({ configDir, profileName }) },
121
+ { label: 'Recall sync queue', run: () => checkRecallQueueFn({ configDir }) },
118
122
  ];
119
123
 
124
+ const showProgress = format === 'plain' && stream.isTTY;
125
+ const s = createStyler({ isTTY: stream.isTTY });
126
+ const rawResults = [];
127
+ for (const { label, run } of checkList) {
128
+ if (showProgress) stream.write(` ${s.dim(`○ Checking ${lowerFirst(label)}…`)}\n`);
129
+ try {
130
+ rawResults.push(await run());
131
+ } finally {
132
+ if (showProgress) stream.write('\x1b[A\r\x1b[2K');
133
+ }
134
+ }
135
+
120
136
  let fixed = [];
121
137
  let skipped = [];
122
138
  let finalResults = rawResults;