inup 1.5.4 → 1.5.6

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.
Files changed (65) hide show
  1. package/README.md +24 -10
  2. package/dist/cli.js +20 -22
  3. package/dist/config/constants.js +4 -2
  4. package/dist/config/package-meta.js +10 -0
  5. package/dist/config/project-config.js +6 -1
  6. package/dist/core/package-detector.js +8 -4
  7. package/dist/core/upgrade-runner.js +7 -10
  8. package/dist/core/upgrader.js +6 -8
  9. package/dist/features/changelog/clients/github-client.js +5 -6
  10. package/dist/features/changelog/services/changelog-service.js +2 -4
  11. package/dist/features/changelog/services/package-metadata-service.js +6 -11
  12. package/dist/features/changelog/services/release-notes-service.js +4 -2
  13. package/dist/features/debug/services/performance-tracker.js +6 -8
  14. package/dist/index.js +1 -2
  15. package/dist/interactive-ui.js +30 -587
  16. package/dist/services/background-audit.js +3 -5
  17. package/dist/services/cache-manager.js +5 -7
  18. package/dist/services/http/inflight.js +22 -0
  19. package/dist/services/http/retry.js +30 -0
  20. package/dist/services/jsdelivr/client.js +191 -0
  21. package/dist/services/jsdelivr/manifest.js +136 -0
  22. package/dist/services/jsdelivr-registry.js +6 -392
  23. package/dist/services/npm-registry.js +12 -81
  24. package/dist/services/persistent-cache.js +8 -13
  25. package/dist/types/domain.js +3 -0
  26. package/dist/types/streaming.js +3 -0
  27. package/dist/types/ui.js +3 -0
  28. package/dist/types.js +17 -0
  29. package/dist/ui/controllers/package-info-modal-controller.js +22 -31
  30. package/dist/ui/controllers/vulnerability-audit-controller.js +17 -8
  31. package/dist/ui/index.js +3 -0
  32. package/dist/ui/input-handler.js +62 -77
  33. package/dist/ui/keymap.js +208 -0
  34. package/dist/ui/modal/package-info-sections/release-notes.js +161 -0
  35. package/dist/ui/modal/package-info-sections/sections.js +150 -0
  36. package/dist/ui/modal/package-info-sections/text.js +75 -0
  37. package/dist/ui/modal/package-info-sections.js +15 -368
  38. package/dist/ui/modal/package-info.js +1 -1
  39. package/dist/ui/renderer/help-modal.js +75 -0
  40. package/dist/ui/renderer/index.js +2 -5
  41. package/dist/ui/renderer/package-list/interface.js +184 -0
  42. package/dist/ui/renderer/package-list/rows.js +172 -0
  43. package/dist/ui/renderer/package-list.js +15 -462
  44. package/dist/ui/session/action-dispatcher.js +233 -0
  45. package/dist/ui/session/index.js +13 -0
  46. package/dist/ui/session/interactive-session.js +280 -0
  47. package/dist/ui/session/selection-state-builder.js +144 -0
  48. package/dist/ui/state/filter-manager.js +17 -6
  49. package/dist/ui/state/modal-manager.js +35 -0
  50. package/dist/ui/state/navigation-manager.js +33 -4
  51. package/dist/ui/state/state-manager.js +68 -3
  52. package/dist/ui/state/theme-manager.js +1 -0
  53. package/dist/ui/themes-colors.js +8 -0
  54. package/dist/ui/themes.js +11 -19
  55. package/dist/ui/utils/cursor.js +3 -4
  56. package/dist/ui/utils/index.js +6 -1
  57. package/dist/ui/utils/text.js +3 -2
  58. package/dist/ui/utils/version.js +60 -86
  59. package/dist/utils/config.js +13 -1
  60. package/dist/utils/filesystem/io.js +87 -0
  61. package/dist/utils/filesystem/paths.js +19 -0
  62. package/dist/utils/filesystem/scan.js +205 -0
  63. package/dist/utils/filesystem.js +17 -335
  64. package/dist/utils/version.js +31 -1
  65. package/package.json +10 -9
@@ -1,466 +1,19 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
4
15
  };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.renderPackageLine = renderPackageLine;
7
- exports.renderSectionHeader = renderSectionHeader;
8
- exports.renderSpacer = renderSpacer;
9
- exports.renderInterface = renderInterface;
10
- exports.renderPackagesTable = renderPackagesTable;
11
- const chalk_1 = __importDefault(require("chalk"));
12
- const utils_1 = require("../utils");
13
- const themes_colors_1 = require("../themes-colors");
14
- const vulnerability_1 = require("../presenters/vulnerability");
15
- function padLineToWidth(line, terminalWidth) {
16
- const padding = Math.max(0, terminalWidth - utils_1.VersionUtils.getVisualLength(line));
17
- return line + ' '.repeat(padding);
18
- }
19
- /**
20
- * Get type badge for dependency type (theme-aware)
21
- */
22
- function getTypeBadge(type) {
23
- switch (type) {
24
- case 'devDependencies':
25
- return (0, themes_colors_1.getThemeColor)('textSecondary')('[D]');
26
- case 'peerDependencies':
27
- return (0, themes_colors_1.getThemeColor)('textSecondary')('[P]');
28
- case 'optionalDependencies':
29
- return (0, themes_colors_1.getThemeColor)('textSecondary')('[O]');
30
- case 'dependencies':
31
- default:
32
- return ''; // No badge for regular dependencies
33
- }
34
- }
35
- /**
36
- * Render a single package line
37
- * @param state Package selection state
38
- * @param index Index in the list
39
- * @param isCurrentRow Whether this is the current/highlighted row
40
- * @param terminalWidth Terminal width for dynamic truncation (default 80)
41
- */
42
- function renderPackageLine(state, index, isCurrentRow, terminalWidth = 80, options = {}) {
43
- const prefix = isCurrentRow ? (0, themes_colors_1.getThemeColor)('success')('❯ ') : ' ';
44
- // Package name with special formatting for scoped packages (@author/package)
45
- let packageName;
46
- if (state.name.startsWith('@')) {
47
- const parts = state.name.split('/');
48
- if (parts.length >= 2) {
49
- const author = parts[0]; // @author
50
- const packagePart = parts.slice(1).join('/'); // package name
51
- if (isCurrentRow) {
52
- packageName =
53
- chalk_1.default.bold((0, themes_colors_1.getThemeColor)('packageAuthor')(author)) +
54
- (0, themes_colors_1.getThemeColor)('packageName')('/' + packagePart);
55
- }
56
- else {
57
- packageName = chalk_1.default.bold.white(author) + chalk_1.default.white('/' + packagePart);
58
- }
59
- }
60
- else {
61
- packageName = isCurrentRow
62
- ? (0, themes_colors_1.getThemeColor)('packageName')(state.name)
63
- : chalk_1.default.white(state.name);
64
- }
65
- }
66
- else {
67
- packageName = isCurrentRow ? (0, themes_colors_1.getThemeColor)('packageName')(state.name) : chalk_1.default.white(state.name);
68
- }
69
- // Determine which dot should be filled (only one per package)
70
- const isCurrentSelected = state.selectedOption === 'none';
71
- const isRangeSelected = state.selectedOption === 'range';
72
- const isLatestSelected = state.selectedOption === 'latest';
73
- const isPending = state.loadState === 'pending';
74
- const isFailed = state.loadState === 'failed';
75
- // Current version dot and version (show original specifier with prefix)
76
- const currentDot = isCurrentSelected ? (0, themes_colors_1.getThemeColor)('dot')('●') : (0, themes_colors_1.getThemeColor)('dotEmpty')('○');
77
- const currentVersion = chalk_1.default.white(state.currentVersionSpecifier);
78
- // Range version dot and version
79
- let rangeDot = '';
80
- let rangeVersionText = '';
81
- if (isPending) {
82
- rangeDot = (0, themes_colors_1.getThemeColor)('dotEmpty')('◌');
83
- rangeVersionText = chalk_1.default.gray('loading');
84
- }
85
- else if (isFailed) {
86
- rangeDot = (0, themes_colors_1.getThemeColor)('dotEmpty')('◌');
87
- rangeVersionText = chalk_1.default.gray('unavailable');
88
- }
89
- else if (state.hasRangeUpdate) {
90
- rangeDot = isRangeSelected ? (0, themes_colors_1.getThemeColor)('dot')('●') : (0, themes_colors_1.getThemeColor)('dotEmpty')('○');
91
- const rangeVersionWithPrefix = utils_1.VersionUtils.applyVersionPrefix(state.currentVersionSpecifier, state.rangeVersion);
92
- rangeVersionText = (0, themes_colors_1.getThemeColor)('versionRange')(rangeVersionWithPrefix);
93
- }
94
- else {
95
- rangeDot = (0, themes_colors_1.getThemeColor)('dotEmpty')('○');
96
- rangeVersionText = '';
97
- }
98
- // Latest version dot and version
99
- let latestDot = '';
100
- let latestVersionText = '';
101
- if (isPending) {
102
- latestDot = (0, themes_colors_1.getThemeColor)('dotEmpty')('◌');
103
- latestVersionText = chalk_1.default.gray('loading');
104
- }
105
- else if (isFailed) {
106
- latestDot = (0, themes_colors_1.getThemeColor)('dotEmpty')('◌');
107
- latestVersionText = chalk_1.default.gray('unavailable');
108
- }
109
- else if (state.hasMajorUpdate) {
110
- latestDot = isLatestSelected ? (0, themes_colors_1.getThemeColor)('dot')('●') : (0, themes_colors_1.getThemeColor)('dotEmpty')('○');
111
- const latestVersionWithPrefix = utils_1.VersionUtils.applyVersionPrefix(state.currentVersionSpecifier, state.latestVersion);
112
- latestVersionText = (0, themes_colors_1.getThemeColor)('versionLatest')(latestVersionWithPrefix);
113
- }
114
- else {
115
- latestDot = (0, themes_colors_1.getThemeColor)('dotEmpty')('○');
116
- latestVersionText = '';
117
- }
118
- // Column widths with capped package name width
119
- // Layout: prefix(2) + name + dashes + spacing(3) + current(16) + spacing(3) + range(16) + spacing(3) + latest(16)
120
- const currentColumnWidth = 16; // Increased to accommodate ^ and ~ prefixes
121
- const rangeColumnWidth = 16; // Increased to accommodate ^ and ~ prefixes
122
- const latestColumnWidth = 16; // Increased to accommodate ^ and ~ prefixes
123
- const spacingWidth = 3;
124
- // Package name width: max 50 chars (after which ellipsis kicks in), but scales down on small terminals
125
- const maxPackageNameWidth = 50;
126
- const minPackageNameWidth = 24;
127
- const otherColumnsWidth = currentColumnWidth + rangeColumnWidth + latestColumnWidth + spacingWidth * 3;
128
- const prefixWidth = 2;
129
- const availableForPackageName = terminalWidth - prefixWidth - otherColumnsWidth - 1;
130
- const packageNameWidth = Math.min(maxPackageNameWidth, Math.max(minPackageNameWidth, availableForPackageName));
131
- // Apply ellipsis truncation if package name exceeds available width
132
- const badgeWidth = state.type === 'dependencies' ? 0 : 3; // [X] without leading space
133
- const truncatedName = utils_1.VersionUtils.truncateMiddle(state.name, packageNameWidth - 1 - badgeWidth); // -1 for space after name, -badgeWidth for badge
134
- // Helper function to determine if dashes should be shown based on available padding
135
- // Only show dashes if there's significant padding (> 2 chars) to fill
136
- const shouldShowDashes = (paddingAmount) => paddingAmount > 2;
137
- const dashColor = isCurrentRow ? chalk_1.default.white : chalk_1.default.gray;
138
- // Use truncated name if it differs from original, otherwise use colored packageName
139
- const displayName = truncatedName !== state.name ? truncatedName : packageName;
140
- // Package name with dashes and badge at the end
141
- const typeBadge = getTypeBadge(state.type);
142
- const shouldShowVulnerability = (0, vulnerability_1.shouldDisplayVulnerabilityForDependency)(state.type, options);
143
- const vulnBadge = shouldShowVulnerability ? (0, vulnerability_1.getVulnerabilityBadge)(state.vulnerability) : '';
144
- const vulnBadgeWidth = vulnBadge ? utils_1.VersionUtils.getVisualLength(vulnBadge) + 1 : 0; // +1 for space
145
- const nameLength = utils_1.VersionUtils.getVisualLength(truncatedName);
146
- const namePadding = Math.max(0, packageNameWidth - nameLength - 1 - badgeWidth - vulnBadgeWidth); // -1 for space after package name
147
- const nameDashes = shouldShowDashes(namePadding)
148
- ? dashColor('-').repeat(namePadding)
149
- : ' '.repeat(namePadding);
150
- // Place badges at the end of dashes: name ------⚠[D]
151
- const vulnSuffix = vulnBadge ? ` ${vulnBadge}` : '';
152
- const packageNameSection = typeBadge
153
- ? `${displayName} ${nameDashes}${vulnSuffix}${typeBadge}`
154
- : `${displayName} ${nameDashes}${vulnSuffix}`;
155
- // Current version section with dashes only if needed
156
- const currentSection = `${currentDot} ${currentVersion}`;
157
- const currentSectionLength = utils_1.VersionUtils.getVisualLength(currentSection) + 1; // +1 for space before padding
158
- const currentPadding = Math.max(0, currentColumnWidth - currentSectionLength);
159
- const currentPaddingText = shouldShowDashes(currentPadding)
160
- ? dashColor('-').repeat(currentPadding)
161
- : ' '.repeat(currentPadding);
162
- const currentWithPadding = currentSection + ' ' + currentPaddingText;
163
- // Range version section with dashes only if needed
164
- let rangeSection = '';
165
- if (isPending || isFailed || state.hasRangeUpdate) {
166
- rangeSection = `${rangeDot} ${rangeVersionText}`;
167
- const rangeSectionLength = utils_1.VersionUtils.getVisualLength(rangeSection) + 1; // +1 for space before padding
168
- const rangePadding = Math.max(0, rangeColumnWidth - rangeSectionLength);
169
- const rangePaddingText = shouldShowDashes(rangePadding)
170
- ? dashColor('-').repeat(rangePadding)
171
- : ' '.repeat(rangePadding);
172
- rangeSection += ' ' + rangePaddingText;
173
- }
174
- else {
175
- // Empty slot - maintain column width
176
- rangeSection = ' '.repeat(rangeColumnWidth);
177
- }
178
- // Latest version section with dashes only if needed
179
- let latestSection = '';
180
- if (isPending || isFailed || state.hasMajorUpdate) {
181
- latestSection = `${latestDot} ${latestVersionText}`;
182
- const latestSectionLength = utils_1.VersionUtils.getVisualLength(latestSection) + 1; // +1 for space before padding
183
- const latestPadding = Math.max(0, latestColumnWidth - latestSectionLength);
184
- const latestPaddingText = shouldShowDashes(latestPadding)
185
- ? dashColor('-').repeat(latestPadding)
186
- : ' '.repeat(latestPadding);
187
- latestSection += ' ' + latestPaddingText;
188
- }
189
- else {
190
- // Empty slot - maintain column width
191
- latestSection = ' '.repeat(latestColumnWidth);
192
- }
193
- // Build line with fixed column widths
194
- const line = `${prefix}${packageNameSection} ${currentWithPadding} ${rangeSection} ${latestSection}`;
195
- return line;
196
- }
197
- /**
198
- * Render section header
199
- */
200
- function renderSectionHeader(title, sectionType) {
201
- const colorFn = sectionType === 'main' ? chalk_1.default.cyan : sectionType === 'peer' ? chalk_1.default.magenta : chalk_1.default.yellow;
202
- return ' ' + colorFn.bold(title);
203
- }
204
- /**
205
- * Render spacer
206
- */
207
- function renderSpacer() {
208
- return '';
209
- }
210
- /**
211
- * Render the main interface
212
- */
213
- function renderInterface(states, currentRow, scrollOffset, maxVisibleItems, forceFullRender, renderableItems, activeFilterLabel, packageManager, filterMode, filterQuery, totalPackagesBeforeFilter, terminalWidth = 80, loadingProgress, auditProgress, options = {}) {
214
- const output = [];
215
- // Header section (same for initial and incremental render)
216
- if (packageManager) {
217
- // Color map for each package manager - use their primary color for main text
218
- const colorMap = {
219
- npm: chalk_1.default.red,
220
- yarn: chalk_1.default.blue,
221
- pnpm: chalk_1.default.yellow,
222
- bun: chalk_1.default.magenta,
223
- };
224
- const pmColor = colorMap[packageManager.name] || packageManager.color;
225
- // Each character in "inup" gets a different color
226
- const inupColors = [chalk_1.default.red, chalk_1.default.yellow, chalk_1.default.blue, chalk_1.default.magenta];
227
- const coloredInup = inupColors.map((color, i) => color.bold('inup'[i])).join('');
228
- const headerLine = ' ' +
229
- chalk_1.default.bold(pmColor('🚀')) +
230
- ' ' +
231
- coloredInup +
232
- (0, themes_colors_1.getThemeColor)('textSecondary')(` (${packageManager.displayName})`);
233
- // Show filter state (always show, including "All")
234
- const fullHeaderLine = activeFilterLabel
235
- ? headerLine +
236
- (0, themes_colors_1.getThemeColor)('textSecondary')(' - ') +
237
- (0, themes_colors_1.getThemeColor)('primary')(activeFilterLabel)
238
- : headerLine;
239
- // Pad to terminal width to clear any leftover characters
240
- const headerPadding = Math.max(0, terminalWidth - utils_1.VersionUtils.getVisualLength(fullHeaderLine));
241
- output.push(fullHeaderLine + ' '.repeat(headerPadding));
242
- }
243
- else {
244
- const headerLine = ' ' +
245
- chalk_1.default.bold.blue('🚀 ') +
246
- chalk_1.default.bold.red('i') +
247
- chalk_1.default.bold.yellow('n') +
248
- chalk_1.default.bold.blue('u') +
249
- chalk_1.default.bold.magenta('p');
250
- // Show filter state (always show, including "All")
251
- const fullHeaderLine = activeFilterLabel
252
- ? headerLine +
253
- (0, themes_colors_1.getThemeColor)('textSecondary')(' - ') +
254
- (0, themes_colors_1.getThemeColor)('primary')(activeFilterLabel)
255
- : headerLine;
256
- // Pad to terminal width to clear any leftover characters
257
- const headerPadding = Math.max(0, terminalWidth - utils_1.VersionUtils.getVisualLength(fullHeaderLine));
258
- output.push(fullHeaderLine + ' '.repeat(headerPadding));
259
- }
260
- output.push('');
261
- if (filterMode) {
262
- // Show filter input with cursor when actively filtering
263
- const filterDisplay = ' ' +
264
- chalk_1.default.bold.white('Search: ') +
265
- (0, themes_colors_1.getThemeColor)('primary')(filterQuery || '') +
266
- (0, themes_colors_1.getThemeColor)('border')('█');
267
- // Pad to terminal width to clear any leftover characters from backspace
268
- const padding = Math.max(0, terminalWidth - utils_1.VersionUtils.getVisualLength(filterDisplay));
269
- output.push(filterDisplay + ' '.repeat(padding));
270
- }
271
- else if (filterQuery) {
272
- // Show applied filter when not in filter mode but filter is active
273
- const filterDisplay = ' ' +
274
- chalk_1.default.bold.white('Search: ') +
275
- (0, themes_colors_1.getThemeColor)('primary')(filterQuery) +
276
- (0, themes_colors_1.getThemeColor)('textSecondary')(' (press / to edit)');
277
- const padding = Math.max(0, terminalWidth - utils_1.VersionUtils.getVisualLength(filterDisplay));
278
- output.push(filterDisplay + ' '.repeat(padding));
279
- }
280
- else {
281
- // Show instructions when not filtering
282
- output.push(' ' +
283
- chalk_1.default.bold.white('/ ') +
284
- (0, themes_colors_1.getThemeColor)('textSecondary')('Search') +
285
- ' ' +
286
- chalk_1.default.bold.white('↑/↓ ') +
287
- (0, themes_colors_1.getThemeColor)('textSecondary')('Move') +
288
- ' ' +
289
- chalk_1.default.bold.white('←/→ ') +
290
- (0, themes_colors_1.getThemeColor)('textSecondary')('Select') +
291
- ' ' +
292
- chalk_1.default.bold.white('D/P/O ') +
293
- (0, themes_colors_1.getThemeColor)('textSecondary')('Filter') +
294
- ' ' +
295
- chalk_1.default.bold.white('I ') +
296
- (0, themes_colors_1.getThemeColor)('textSecondary')('Info') +
297
- ' ' +
298
- chalk_1.default.bold.white('S ') +
299
- (0, themes_colors_1.getThemeColor)('textSecondary')('Vulnerable') +
300
- ' ' +
301
- chalk_1.default.bold.white('M ') +
302
- (0, themes_colors_1.getThemeColor)('textSecondary')('Minor') +
303
- ' ' +
304
- chalk_1.default.bold.white('L ') +
305
- (0, themes_colors_1.getThemeColor)('textSecondary')('All') +
306
- ' ' +
307
- chalk_1.default.bold.white('U ') +
308
- (0, themes_colors_1.getThemeColor)('textSecondary')('None'));
309
- }
310
- // Show status line with item range
311
- const totalPackages = states.length;
312
- const totalBeforeFilter = totalPackagesBeforeFilter || totalPackages;
313
- // Use renderableItems length only if we have renderable items (grouped mode), otherwise use totalPackages (flat mode)
314
- const totalVisualItems = renderableItems && renderableItems.length > 0 ? renderableItems.length : totalPackages;
315
- const startItem = scrollOffset + 1;
316
- const endItem = Math.min(scrollOffset + maxVisibleItems, totalVisualItems);
317
- let statusLine = '';
318
- if (filterMode) {
319
- // In filter mode, show Enter to apply and ESC to clear
320
- if (totalPackages === 0) {
321
- statusLine =
322
- (0, themes_colors_1.getThemeColor)('warning')(`No matches found`) +
323
- ' ' +
324
- chalk_1.default.bold.white('Esc ') +
325
- chalk_1.default.gray('Clear');
326
- }
327
- else if (totalVisualItems > maxVisibleItems) {
328
- statusLine =
329
- (0, themes_colors_1.getThemeColor)('textSecondary')(`Showing ${chalk_1.default.white(startItem)}-${chalk_1.default.white(endItem)} of ${chalk_1.default.white(totalPackages)} matches`) +
330
- ' ' +
331
- chalk_1.default.bold.white('Enter ') +
332
- chalk_1.default.gray('Apply') +
333
- ' ' +
334
- chalk_1.default.bold.white('Esc ') +
335
- chalk_1.default.gray('Clear');
336
- }
337
- else {
338
- statusLine =
339
- (0, themes_colors_1.getThemeColor)('textSecondary')(`Showing all ${chalk_1.default.white(totalPackages)} matches`) +
340
- ' ' +
341
- chalk_1.default.bold.white('Enter ') +
342
- chalk_1.default.gray('Apply') +
343
- ' ' +
344
- chalk_1.default.bold.white('Esc ') +
345
- chalk_1.default.gray('Clear');
346
- }
347
- }
348
- else if (totalPackages < totalBeforeFilter) {
349
- // Filter is applied but not in filter mode
350
- if (totalVisualItems > maxVisibleItems) {
351
- statusLine =
352
- (0, themes_colors_1.getThemeColor)('textSecondary')(`Showing ${chalk_1.default.white(startItem)}-${chalk_1.default.white(endItem)} of ${chalk_1.default.white(totalPackages)} matches`) +
353
- ' ' +
354
- chalk_1.default.bold.white('D/P/O ') +
355
- chalk_1.default.gray('Filter') +
356
- ' ' +
357
- chalk_1.default.bold.white('M ') +
358
- chalk_1.default.gray('Minor') +
359
- ' ' +
360
- chalk_1.default.bold.white('L ') +
361
- chalk_1.default.gray('All') +
362
- ' ' +
363
- chalk_1.default.bold.white('U ') +
364
- chalk_1.default.gray('None') +
365
- ' ' +
366
- chalk_1.default.bold.white('Esc ') +
367
- chalk_1.default.gray('Clear');
368
- }
369
- else {
370
- statusLine =
371
- (0, themes_colors_1.getThemeColor)('textSecondary')(`Showing all ${chalk_1.default.white(totalPackages)} matches`) +
372
- ' ' +
373
- chalk_1.default.bold.white('D/P/O ') +
374
- chalk_1.default.gray('Filter') +
375
- ' ' +
376
- chalk_1.default.bold.white('M ') +
377
- chalk_1.default.gray('Minor') +
378
- ' ' +
379
- chalk_1.default.bold.white('L ') +
380
- chalk_1.default.gray('All') +
381
- ' ' +
382
- chalk_1.default.bold.white('U ') +
383
- chalk_1.default.gray('None') +
384
- ' ' +
385
- chalk_1.default.bold.white('Esc ') +
386
- chalk_1.default.gray('Clear');
387
- }
388
- }
389
- else {
390
- // No filter applied
391
- if (totalVisualItems > maxVisibleItems) {
392
- statusLine =
393
- chalk_1.default.gray(`Showing ${chalk_1.default.white(startItem)}-${chalk_1.default.white(endItem)} of ${chalk_1.default.white(totalPackages)} packages`) +
394
- ' ' +
395
- chalk_1.default.bold.white('Enter ') +
396
- chalk_1.default.gray('Confirm');
397
- }
398
- else {
399
- statusLine =
400
- chalk_1.default.gray(`Showing all ${chalk_1.default.white(totalPackages)} packages`) +
401
- ' ' +
402
- chalk_1.default.bold.white('Enter ') +
403
- chalk_1.default.gray('Confirm');
404
- }
405
- }
406
- if (auditProgress && auditProgress.total > 0) {
407
- const auditLabel = auditProgress.isRunning
408
- ? `Audit ${auditProgress.completed}/${auditProgress.total}`
409
- : `Audit ${auditProgress.total}/${auditProgress.total}`;
410
- statusLine += ' ' + (0, themes_colors_1.getThemeColor)('textSecondary')(auditLabel);
411
- }
412
- // Pad status line to terminal width to clear any leftover characters
413
- const statusLineFull = ' ' + statusLine;
414
- const statusPadding = Math.max(0, terminalWidth - utils_1.VersionUtils.getVisualLength(statusLineFull));
415
- output.push(statusLineFull + ' '.repeat(statusPadding));
416
- output.push('');
417
- // Render visible items
418
- if (renderableItems && renderableItems.length > 0) {
419
- // Use renderable items for grouped display
420
- for (let i = scrollOffset; i < Math.min(scrollOffset + maxVisibleItems, renderableItems.length); i++) {
421
- const item = renderableItems[i];
422
- if (item.type === 'header') {
423
- output.push(renderSectionHeader(item.title, item.sectionType));
424
- }
425
- else if (item.type === 'spacer') {
426
- output.push(renderSpacer());
427
- }
428
- else if (item.type === 'package') {
429
- const line = renderPackageLine(item.state, item.originalIndex, item.originalIndex === currentRow, terminalWidth, options);
430
- output.push(line);
431
- }
432
- }
433
- }
434
- else {
435
- // Fallback to flat rendering (legacy mode)
436
- for (let i = scrollOffset; i < Math.min(scrollOffset + maxVisibleItems, states.length); i++) {
437
- const line = renderPackageLine(states[i], i, i === currentRow, terminalWidth, options);
438
- output.push(line);
439
- }
440
- }
441
- if (loadingProgress?.isLoading) {
442
- const loadingLabel = `Loading packages... (${loadingProgress.resolved}/${loadingProgress.total} checked)`;
443
- const failedLabel = loadingProgress.failed > 0 ? ` ${loadingProgress.failed} unavailable` : '';
444
- const loadingLine = ' ' +
445
- (0, themes_colors_1.getThemeColor)('textSecondary')(loadingLabel) +
446
- (failedLabel ? chalk_1.default.yellow(failedLabel) : '');
447
- const loadingPadding = Math.max(0, terminalWidth - utils_1.VersionUtils.getVisualLength(loadingLine));
448
- output.push(loadingLine + ' '.repeat(loadingPadding));
449
- }
450
- return output.map((line) => padLineToWidth(line, terminalWidth));
451
- }
452
- /**
453
- * Render packages table
454
- */
455
- function renderPackagesTable(packages) {
456
- if (packages.length === 0) {
457
- return chalk_1.default.green('✅ All packages are up to date!');
458
- }
459
- const outdatedPackages = packages.filter((p) => p.isOutdated);
460
- if (outdatedPackages.length === 0) {
461
- return chalk_1.default.green('✅ All packages are up to date!');
462
- }
463
- // Just show a simple message, the interactive interface will handle the display
464
- return chalk_1.default.bold.blue('🚀 inup\n');
465
- }
17
+ __exportStar(require("./package-list/rows"), exports);
18
+ __exportStar(require("./package-list/interface"), exports);
466
19
  //# sourceMappingURL=package-list.js.map