inup 1.4.10 → 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.
- package/README.md +1 -7
- package/dist/cli.js +2 -1
- package/dist/config/constants.js +1 -2
- package/dist/config/project-config.js +6 -0
- package/dist/core/package-detector.js +163 -89
- package/dist/core/upgrade-runner.js +68 -16
- package/dist/features/changelog/clients/github-client.js +134 -0
- package/dist/features/changelog/clients/npm-registry-client.js +53 -0
- package/dist/features/changelog/index.js +19 -0
- package/dist/features/changelog/parsers/changelog-parser.js +68 -0
- package/dist/features/changelog/parsers/github-release-html-parser.js +61 -0
- package/dist/features/changelog/parsers/package-metadata.js +34 -0
- package/dist/features/changelog/parsers/repository-ref.js +26 -0
- package/dist/features/changelog/services/changelog-service.js +30 -0
- package/dist/features/changelog/services/package-metadata-service.js +108 -0
- package/dist/features/changelog/services/release-notes-service.js +180 -0
- package/dist/features/changelog/types/changelog.types.js +3 -0
- package/dist/interactive-ui.js +343 -161
- package/dist/services/background-audit.js +60 -0
- package/dist/services/index.js +3 -3
- package/dist/services/jsdelivr-registry.js +92 -176
- package/dist/services/npm-registry.js +97 -27
- package/dist/services/vulnerability-checker.js +133 -0
- package/dist/ui/controllers/index.js +8 -0
- package/dist/ui/controllers/package-info-modal-controller.js +237 -0
- package/dist/ui/controllers/vulnerability-audit-controller.js +82 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/input-handler.js +41 -10
- package/dist/ui/modal/index.js +22 -0
- package/dist/ui/modal/layout.js +84 -0
- package/dist/ui/modal/package-info-sections.js +327 -0
- package/dist/ui/modal/package-info.js +147 -0
- package/dist/ui/modal/theme-selector.js +46 -0
- package/dist/ui/modal/types.js +3 -0
- package/dist/ui/presenters/index.js +11 -0
- package/dist/ui/presenters/vulnerability.js +76 -0
- package/dist/ui/renderer/index.js +9 -11
- package/dist/ui/renderer/package-list.js +166 -66
- package/dist/ui/state/filter-manager.js +17 -2
- package/dist/ui/state/modal-manager.js +48 -6
- package/dist/ui/state/state-manager.js +49 -12
- package/dist/ui/utils/cursor.js +18 -0
- package/dist/ui/utils/index.js +8 -1
- package/dist/ui/utils/terminal-input.js +82 -0
- package/dist/ui/utils/text.js +75 -0
- package/dist/ui/utils/version.js +3 -2
- package/package.json +7 -11
- package/dist/services/changelog-fetcher.js +0 -190
- package/dist/ui/renderer/modal.js +0 -190
- 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
|