inup 1.4.12 → 1.5.0

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 (46) hide show
  1. package/dist/cli.js +2 -1
  2. package/dist/config/project-config.js +6 -0
  3. package/dist/core/package-detector.js +3 -2
  4. package/dist/core/upgrade-runner.js +6 -3
  5. package/dist/features/changelog/clients/github-client.js +134 -0
  6. package/dist/features/changelog/clients/npm-registry-client.js +53 -0
  7. package/dist/features/changelog/index.js +19 -0
  8. package/dist/features/changelog/parsers/changelog-parser.js +68 -0
  9. package/dist/features/changelog/parsers/github-release-html-parser.js +61 -0
  10. package/dist/features/changelog/parsers/package-metadata.js +34 -0
  11. package/dist/features/changelog/parsers/repository-ref.js +26 -0
  12. package/dist/features/changelog/services/changelog-service.js +30 -0
  13. package/dist/features/changelog/services/package-metadata-service.js +108 -0
  14. package/dist/features/changelog/services/release-notes-service.js +180 -0
  15. package/dist/features/changelog/types/changelog.types.js +3 -0
  16. package/dist/interactive-ui.js +242 -114
  17. package/dist/services/background-audit.js +60 -0
  18. package/dist/services/index.js +3 -1
  19. package/dist/services/vulnerability-checker.js +133 -0
  20. package/dist/ui/controllers/index.js +8 -0
  21. package/dist/ui/controllers/package-info-modal-controller.js +237 -0
  22. package/dist/ui/controllers/vulnerability-audit-controller.js +82 -0
  23. package/dist/ui/index.js +3 -0
  24. package/dist/ui/input-handler.js +40 -9
  25. package/dist/ui/modal/index.js +22 -0
  26. package/dist/ui/modal/layout.js +84 -0
  27. package/dist/ui/modal/package-info-sections.js +327 -0
  28. package/dist/ui/modal/package-info.js +147 -0
  29. package/dist/ui/modal/theme-selector.js +46 -0
  30. package/dist/ui/modal/types.js +3 -0
  31. package/dist/ui/presenters/index.js +11 -0
  32. package/dist/ui/presenters/vulnerability.js +76 -0
  33. package/dist/ui/renderer/index.js +9 -11
  34. package/dist/ui/renderer/package-list.js +135 -62
  35. package/dist/ui/state/filter-manager.js +17 -2
  36. package/dist/ui/state/modal-manager.js +48 -6
  37. package/dist/ui/state/state-manager.js +42 -7
  38. package/dist/ui/utils/cursor.js +18 -0
  39. package/dist/ui/utils/index.js +8 -1
  40. package/dist/ui/utils/terminal-input.js +82 -0
  41. package/dist/ui/utils/text.js +75 -0
  42. package/dist/ui/utils/version.js +3 -2
  43. package/package.json +7 -11
  44. package/dist/services/changelog-fetcher.js +0 -215
  45. package/dist/ui/renderer/modal.js +0 -190
  46. package/dist/ui/renderer/theme-selector.js +0 -83
@@ -1,83 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.renderThemeSelectorModal = renderThemeSelectorModal;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const themes_1 = require("../themes");
9
- /**
10
- * Get the visual length of a string (ignoring ANSI color codes)
11
- * Accounts for wide characters like emojis
12
- */
13
- function getVisualLength(str) {
14
- const cleaned = str.replace(/\u001b\[[0-9;]*m/g, '');
15
- let length = 0;
16
- for (const char of cleaned) {
17
- const code = char.charCodeAt(0);
18
- // Emoji ranges: 0x1F000–0x1F9FF (and other ranges)
19
- if (code >= 0x1F000 || code >= 0x2600) {
20
- length += 2;
21
- }
22
- else {
23
- length += 1;
24
- }
25
- }
26
- return length;
27
- }
28
- /**
29
- * Render the theme selector modal
30
- */
31
- function renderThemeSelectorModal(currentTheme, previewTheme, terminalWidth = 80, terminalHeight = 24) {
32
- const maxModalWidth = 76; // Fixed width that fits comfortably in 80-char terminal
33
- const padding = Math.max(0, Math.floor((terminalWidth - maxModalWidth) / 2));
34
- const lines = [];
35
- const contentWidth = maxModalWidth - 4; // Account for '│ ' on left and ' │' on right
36
- // Helper to pad content to exact width
37
- const createLine = (content) => {
38
- const visualLen = getVisualLength(content);
39
- const spacesNeeded = Math.max(0, contentWidth - visualLen);
40
- const line = ' '.repeat(padding) + chalk_1.default.gray('│') + ' ' + content + ' '.repeat(spacesNeeded) + ' ' + chalk_1.default.gray('│');
41
- return line;
42
- };
43
- // Top padding to center vertically
44
- const topPadding = Math.max(1, Math.floor((terminalHeight - themes_1.themeNames.length - 8) / 2));
45
- for (let i = 0; i < topPadding; i++) {
46
- lines.push('');
47
- }
48
- // Top border
49
- lines.push(' '.repeat(padding) + chalk_1.default.gray('╭' + '─'.repeat(maxModalWidth - 2) + '╮'));
50
- // Title
51
- const title = chalk_1.default.cyan('🎨 Select Theme');
52
- lines.push(createLine(title));
53
- // Separator
54
- lines.push(' '.repeat(padding) + chalk_1.default.gray('├' + '─'.repeat(maxModalWidth - 2) + '┤'));
55
- // Theme options
56
- for (const themeName of themes_1.themeNames) {
57
- const isSelected = themeName === previewTheme;
58
- const isCurrent = themeName === currentTheme;
59
- const themeObj = themes_1.themes[themeName];
60
- // Build the theme line
61
- let themeLine = '';
62
- if (isSelected) {
63
- themeLine = chalk_1.default.green('● ');
64
- }
65
- else {
66
- themeLine = chalk_1.default.gray('○ ');
67
- }
68
- themeLine += themeObj.name;
69
- if (isCurrent) {
70
- themeLine += chalk_1.default.gray(' (current)');
71
- }
72
- lines.push(createLine(themeLine));
73
- }
74
- // Separator before instructions
75
- lines.push(' '.repeat(padding) + chalk_1.default.gray('├' + '─'.repeat(maxModalWidth - 2) + '┤'));
76
- // Instructions
77
- const instruction = chalk_1.default.gray('↑/↓ to navigate • Enter to confirm • Esc to cancel');
78
- lines.push(createLine(instruction));
79
- // Bottom border
80
- lines.push(' '.repeat(padding) + chalk_1.default.gray('╰' + '─'.repeat(maxModalWidth - 2) + '╯'));
81
- return lines;
82
- }
83
- //# sourceMappingURL=theme-selector.js.map