inup 1.5.0 → 1.5.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Donfear
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,49 +1,45 @@
1
- # 🚀 inup
1
+ # inup — Interactive Dependency Upgrader
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/inup?logo=npm&logoColor=%23CB3837&style=for-the-badge&color=crimson)](https://www.npmjs.com/package/inup)
4
4
  [![Downloads](https://img.shields.io/npm/dm/inup?style=for-the-badge&color=646CFF&logoColor=white)](https://www.npmjs.com/package/inup)
5
5
  [![Total downloads](https://img.shields.io/npm/dt/inup?style=for-the-badge&color=informational)](https://www.npmjs.com/package/inup)
6
+ [![CI](https://img.shields.io/github/actions/workflow/status/donfear/inup/ci.yml?branch=main&style=for-the-badge&label=CI)](https://github.com/donfear/inup/actions/workflows/ci.yml)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://github.com/donfear/inup/blob/main/LICENSE)
6
8
 
7
- Upgrade your dependencies interactively. Works with npm, yarn, pnpm, and bun.
9
+ Interactively upgrade outdated dependencies across npm, yarn, pnpm, and bun. Auto-detects your package manager, works in monorepos and workspaces, and requires zero configuration.
8
10
 
9
11
  ![Interactive Upgrade Demo](docs/demo/interactive-upgrade.gif)
10
12
 
11
- ## 🚀 Usage
13
+ ## Quick Start
12
14
 
13
15
  ```bash
14
16
  npx inup
15
17
  ```
16
18
 
17
- Or install globally:
19
+ Or install globally with your preferred package manager:
18
20
 
19
21
  ```bash
20
22
  npm install -g inup
23
+ pnpm add -g inup
24
+ yarn global add inup
25
+ bun add -g inup
21
26
  ```
22
27
 
23
- That's it. The tool scans your project, finds outdated packages, and lets you pick what to upgrade.
28
+ Run `inup` in any project it scans for outdated packages and lets you pick what to upgrade.
24
29
 
25
- ## 💡 Why inup?
30
+ ## Why inup?
26
31
 
27
- - **Inclusive by Default**: We load Dev, Peer, and Optional dependencies automatically. No more restarting the tool because you forgot a `--peer` flag.
28
- - **Live Toggles**: Toggle dependency types (`d`, `p`, `o`) on the fly without exiting.
29
- - **Zero Config**: Auto-detects your package manager.
30
- - **Monorepo Ready**: Seamlessly handles workspaces.
31
- - **Modern UX**: Search with `/`, view package details with `i`, and swap themes with `t`.
32
+ - **All Dependencies at Once** Dev, peer, and optional dependencies load automatically. No more re-running with `--peer` or `--dev` flags.
33
+ - **Live Toggles** Filter dependency types (`d`, `p`, `o`) on the fly without restarting.
34
+ - **Zero Config** Auto-detects npm, yarn, pnpm, or bun from your lockfile.
35
+ - **Monorepo Ready** Discovers and upgrades across workspaces seamlessly.
36
+ - **Vulnerability Audit** Flags known security vulnerabilities right in the package list so you know what's risky before upgrading.
37
+ - **Changelog Viewer** — Read release notes and changelogs inline without leaving the terminal.
38
+ - **Built-in Search** — Press `/` to filter packages instantly.
39
+ - **Package Details** — Press `i` to view package info, download stats, and more.
40
+ - **Themes** — Press `t` to switch between color themes.
32
41
 
33
- ## ⌨️ Keyboard Shortcuts
34
-
35
- - `↑/↓` - Navigate packages
36
- - `←/→` - Select version (current, patch, minor, major)
37
- - `Space` - Toggle selection
38
- - `m` - Select all minor updates
39
- - `l` - Select all latest updates
40
- - `u` - Unselect all
41
- - `/` - Search packages
42
- - `t` - Change theme
43
- - `i` - View package info
44
- - `Enter` - Confirm and upgrade
45
-
46
- ## ⚙️ Options
42
+ ## Options
47
43
 
48
44
  ```bash
49
45
  inup [options]
@@ -56,12 +52,25 @@ inup [options]
56
52
  --debug Write verbose debug logs
57
53
  ```
58
54
 
59
- ## 🔒 Privacy
55
+ ## Keyboard Shortcuts
56
+
57
+ | Key | Action |
58
+ |-----|--------|
59
+ | `↑` `↓` | Navigate packages |
60
+ | `←` `→` | Select version (current, patch, minor, major) |
61
+ | `Space` | Toggle selection |
62
+ | `m` | Select all minor updates |
63
+ | `l` | Select all latest updates |
64
+ | `u` | Unselect all |
65
+ | `/` | Search packages |
66
+ | `i` | View package info |
67
+ | `t` | Change theme |
68
+ | `Enter` | Confirm and upgrade |
60
69
 
61
- We don't track anything. Ever.
70
+ ## Privacy
62
71
 
63
- Version checks and package metadata are fetched from the npm registry. When needed for immutable exact-version manifests, inup may also fetch a pinned `package.json` from jsDelivr. Weekly download counts come from the npm downloads API.
72
+ No tracking, no telemetry, no data collection. Package metadata is fetched directly from the npm registry. Download counts come from the npm downloads API. When needed for exact-version manifests, inup may fetch a pinned `package.json` from jsDelivr.
64
73
 
65
- ## 📄 License
74
+ ## License
66
75
 
67
- MIT
76
+ [MIT](LICENSE)
package/dist/cli.js CHANGED
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.runCli = runCli;
7
8
  const commander_1 = require("commander");
8
9
  const chalk_1 = __importDefault(require("chalk"));
9
10
  const fs_1 = require("fs");
@@ -12,23 +13,23 @@ const index_1 = require("./index");
12
13
  const services_1 = require("./services");
13
14
  const config_1 = require("./config");
14
15
  const utils_1 = require("./utils");
16
+ const git_1 = require("./utils/git");
17
+ const terminal_input_1 = require("./ui/utils/terminal-input");
15
18
  const packageJson = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../package.json'), 'utf-8'));
16
19
  const program = new commander_1.Command();
17
- program
18
- .name('inup')
19
- .description('Interactive upgrade tool for package managers. Auto-detects and works with npm, yarn, pnpm, and bun.')
20
- .version(packageJson.version)
21
- .option('-d, --dir <directory>', 'specify directory to run in', process.cwd())
22
- .option('-e, --exclude <patterns>', 'exclude paths matching regex patterns (comma-separated)', '')
23
- .option('-i, --ignore <packages>', 'ignore packages (comma-separated, supports glob patterns like @babel/*)')
24
- .option('--max-depth <number>', 'maximum directory depth for package.json discovery', '10')
25
- .option('--package-manager <name>', 'manually specify package manager (npm, yarn, pnpm, bun)')
26
- .option('--debug', 'write verbose debug log to /tmp/inup-debug-YYYY-MM-DD.log')
27
- .action(async (options) => {
20
+ async function runCli(options) {
28
21
  const cwd = (0, path_1.resolve)(options.dir);
29
22
  if (options.debug || process.env.INUP_DEBUG === '1') {
30
23
  (0, utils_1.enableDebugLogging)();
31
24
  }
25
+ const gitState = (0, git_1.getGitWorkingTreeState)(cwd);
26
+ if (gitState.isRepo && gitState.isDirty) {
27
+ const shouldProceed = await terminal_input_1.TerminalInput.promptForImmediateConfirmation(`${chalk_1.default.yellow('Warning:')} dirty working tree. Proceed anyway? ${chalk_1.default.dim('[y/N]')} `, false);
28
+ if (!shouldProceed) {
29
+ console.log(chalk_1.default.yellow('Upgrade cancelled.'));
30
+ return;
31
+ }
32
+ }
32
33
  // Load project config from .inuprc
33
34
  const projectConfig = (0, config_1.loadProjectConfig)(cwd);
34
35
  // Merge CLI exclude patterns with config
@@ -99,7 +100,18 @@ program
99
100
  console.log(chalk_1.default.yellow('└' + '─'.repeat(78) + '┘'));
100
101
  console.log('');
101
102
  }
102
- });
103
+ }
104
+ program
105
+ .name('inup')
106
+ .description('Interactive upgrade tool for package managers. Auto-detects and works with npm, yarn, pnpm, and bun.')
107
+ .version(packageJson.version)
108
+ .option('-d, --dir <directory>', 'specify directory to run in', process.cwd())
109
+ .option('-e, --exclude <patterns>', 'exclude paths matching regex patterns (comma-separated)', '')
110
+ .option('-i, --ignore <packages>', 'ignore packages (comma-separated, supports glob patterns like @babel/*)')
111
+ .option('--max-depth <number>', 'maximum directory depth for package.json discovery', '10')
112
+ .option('--package-manager <name>', 'manually specify package manager (npm, yarn, pnpm, bun)')
113
+ .option('--debug', 'write verbose debug log to /tmp/inup-debug-YYYY-MM-DD.log')
114
+ .action(runCli);
103
115
  // Handle uncaught errors gracefully
104
116
  process.on('uncaughtException', (error) => {
105
117
  console.error(chalk_1.default.red('Uncaught Exception:'), error.message);
@@ -128,5 +140,7 @@ process.on('SIGTERM', () => {
128
140
  console.log(chalk_1.default.yellow('\n\nOperation cancelled.'));
129
141
  process.exit(0);
130
142
  });
131
- program.parse();
143
+ if (require.main === module) {
144
+ program.parse();
145
+ }
132
146
  //# sourceMappingURL=cli.js.map
@@ -60,7 +60,7 @@ exports.TerminalInput = {
60
60
  },
61
61
  };
62
62
  },
63
- promptForConfirmation(prompt) {
63
+ promptForConfirmation(prompt, defaultValue = true) {
64
64
  return new Promise((resolve) => {
65
65
  const rl = readline.createInterface({
66
66
  input: process.stdin,
@@ -73,10 +73,53 @@ exports.TerminalInput = {
73
73
  };
74
74
  rl.question(prompt, (answer) => {
75
75
  const normalizedAnswer = answer.trim().toLowerCase();
76
- finish(normalizedAnswer === '' || normalizedAnswer === 'y' || normalizedAnswer === 'yes');
76
+ if (normalizedAnswer === '') {
77
+ finish(defaultValue);
78
+ return;
79
+ }
80
+ finish(normalizedAnswer === 'y' || normalizedAnswer === 'yes');
77
81
  });
78
82
  rl.on('SIGINT', () => finish(false));
79
83
  });
80
84
  },
85
+ promptForImmediateConfirmation(prompt, defaultValue = true) {
86
+ return new Promise((resolve) => {
87
+ process.stdout.write(prompt);
88
+ let cleanup = () => { };
89
+ const finish = (value) => {
90
+ cleanup();
91
+ process.stdout.write('\n');
92
+ resolve(value);
93
+ };
94
+ try {
95
+ const session = exports.TerminalInput.startKeypressSession((str, key) => {
96
+ const normalized = str.trim().toLowerCase();
97
+ if (key.name === 'return' || key.name === 'enter') {
98
+ finish(defaultValue);
99
+ return;
100
+ }
101
+ if (normalized === 'y') {
102
+ finish(true);
103
+ return;
104
+ }
105
+ if (normalized === 'n') {
106
+ finish(false);
107
+ return;
108
+ }
109
+ if (key.ctrl && key.name === 'c') {
110
+ finish(false);
111
+ }
112
+ });
113
+ cleanup = () => {
114
+ session.close();
115
+ };
116
+ }
117
+ catch {
118
+ exports.TerminalInput.promptForConfirmation(prompt, defaultValue)
119
+ .then(resolve)
120
+ .catch(() => resolve(false));
121
+ }
122
+ });
123
+ },
81
124
  };
82
125
  //# sourceMappingURL=terminal-input.js.map
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getGitWorkingTreeState = getGitWorkingTreeState;
4
+ const child_process_1 = require("child_process");
5
+ /**
6
+ * Detect whether cwd is a git work tree and whether it has local changes.
7
+ * Fail soft if git is unavailable or cwd is not a repository.
8
+ */
9
+ function getGitWorkingTreeState(cwd) {
10
+ try {
11
+ const isInsideWorkTree = (0, child_process_1.execSync)('git rev-parse --is-inside-work-tree', {
12
+ cwd,
13
+ encoding: 'utf-8',
14
+ stdio: ['ignore', 'pipe', 'ignore'],
15
+ }).trim();
16
+ if (isInsideWorkTree !== 'true') {
17
+ return { isRepo: false, isDirty: false };
18
+ }
19
+ const status = (0, child_process_1.execSync)('git status --porcelain', {
20
+ cwd,
21
+ encoding: 'utf-8',
22
+ stdio: ['ignore', 'pipe', 'ignore'],
23
+ });
24
+ return {
25
+ isRepo: true,
26
+ isDirty: status.trim().length > 0,
27
+ };
28
+ }
29
+ catch {
30
+ return { isRepo: false, isDirty: false };
31
+ }
32
+ }
33
+ //# sourceMappingURL=git.js.map
@@ -20,6 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.collectAllDependenciesAsync = exports.readPackageJsonAsync = void 0;
21
21
  __exportStar(require("./filesystem"), exports);
22
22
  __exportStar(require("./exec"), exports);
23
+ __exportStar(require("./git"), exports);
23
24
  __exportStar(require("./version"), exports);
24
25
  __exportStar(require("./debug-logger"), exports);
25
26
  // Re-export async functions for convenience
package/package.json CHANGED
@@ -1,26 +1,33 @@
1
1
  {
2
2
  "name": "inup",
3
- "version": "1.5.0",
4
- "description": "Interactive CLI tool for upgrading dependencies with ease. Auto-detects and works with npm, yarn, pnpm, and bun. Inspired by yarn upgrade-interactive. Supports monorepos, workspaces, and batch upgrades.",
3
+ "version": "1.5.1",
4
+ "description": "Interactive dependency upgrader for npm, yarn, pnpm & bun. Zero-config, monorepo-ready. Upgrade-interactive for every package manager.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "inup": "./dist/cli.js"
8
8
  },
9
9
  "author": "Donfear",
10
10
  "keywords": [
11
+ "upgrade-interactive",
12
+ "interactive",
13
+ "dependency-management",
14
+ "outdated",
15
+ "upgrade",
16
+ "update",
11
17
  "npm",
12
18
  "yarn",
13
19
  "pnpm",
14
20
  "bun",
15
- "upgrade",
16
- "interactive",
17
- "cli",
18
- "package-manager",
19
- "dependency-management",
20
- "yarn-upgrade-interactive",
21
21
  "monorepo",
22
22
  "workspace",
23
- "batch-upgrade"
23
+ "cli",
24
+ "vulnerability",
25
+ "audit",
26
+ "changelog",
27
+ "package-manager",
28
+ "dependencies",
29
+ "semver",
30
+ "ncu"
24
31
  ],
25
32
  "license": "MIT",
26
33
  "homepage": "https://github.com/donfear/inup#readme",