inup 1.4.8 → 1.4.9

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.
@@ -58,7 +58,7 @@ class UpgradeRunner {
58
58
  // Group by package name and version specifier
59
59
  const choiceMap = new Map();
60
60
  selectedChoices.forEach((choice) => {
61
- const key = `${choice.name}@${choice.currentVersionSpecifier}`;
61
+ const key = `${choice.name}@${choice.currentVersionSpecifier}@${choice.dependencyType}`;
62
62
  choiceMap.set(key, choice.upgradeType);
63
63
  });
64
64
  // Convert to the format expected by selectPackagesToUpgrade
@@ -98,7 +98,9 @@ class UpgradeRunner {
98
98
  validateSelectedChoices(selectedChoices, allPackages) {
99
99
  // Validate that all selected packages have valid target versions
100
100
  const invalidChoices = selectedChoices.filter((choice) => {
101
- const packageInfo = allPackages.find((pkg) => pkg.name === choice.name && pkg.packageJsonPath === choice.packageJsonPath);
101
+ const packageInfo = allPackages.find((pkg) => pkg.name === choice.name &&
102
+ pkg.packageJsonPath === choice.packageJsonPath &&
103
+ pkg.type === choice.dependencyType);
102
104
  return !packageInfo || !choice.targetVersion;
103
105
  });
104
106
  if (invalidChoices.length > 0) {
@@ -56,26 +56,29 @@ class PackageUpgrader {
56
56
  return; // Skip install, let user do it manually
57
57
  }
58
58
  console.log(chalk_1.default.cyan(`\nšŸ“¦ Running ${this.packageManager.installCommand}...\n`));
59
- const [cmd, ...args] = this.packageManager.installCommand.split(' ');
60
- const result = (0, child_process_1.spawnSync)(cmd, args, {
59
+ const result = (0, child_process_1.spawnSync)(this.packageManager.installCommand, {
61
60
  cwd: installDir,
62
61
  stdio: 'inherit',
62
+ shell: true,
63
63
  });
64
+ if (result.error) {
65
+ throw result.error;
66
+ }
64
67
  if (result.status !== 0) {
68
+ if (result.signal) {
69
+ throw new Error(`${this.packageManager.installCommand} terminated by signal ${result.signal}`);
70
+ }
65
71
  throw new Error(`${this.packageManager.installCommand} exited with code ${result.status}`);
66
72
  }
67
73
  }
68
- groupChoicesByFileAndType(choices, packageInfos) {
74
+ groupChoicesByFileAndType(choices, _packageInfos) {
69
75
  const groups = {};
70
76
  choices.forEach((choice) => {
71
- const info = packageInfos.find((p) => p.name === choice.name && p.packageJsonPath === choice.packageJsonPath);
72
- if (info) {
73
- const key = `${choice.packageJsonPath}|${info.type}`;
74
- if (!groups[key]) {
75
- groups[key] = [];
76
- }
77
- groups[key].push(choice);
77
+ const key = `${choice.packageJsonPath}|${choice.dependencyType}`;
78
+ if (!groups[key]) {
79
+ groups[key] = [];
78
80
  }
81
+ groups[key].push(choice);
79
82
  });
80
83
  return groups;
81
84
  }
@@ -61,7 +61,7 @@ class InteractiveUI {
61
61
  // Deduplicate packages by name and version specifier, but track all package.json paths
62
62
  const uniquePackages = new Map();
63
63
  for (const pkg of outdatedPackages) {
64
- const key = `${pkg.name}@${pkg.currentVersion}`;
64
+ const key = `${pkg.name}@${pkg.currentVersion}@${pkg.type}`;
65
65
  if (!uniquePackages.has(key)) {
66
66
  uniquePackages.set(key, {
67
67
  pkg,
@@ -96,7 +96,7 @@ class InteractiveUI {
96
96
  const rangeClean = semver.coerce(pkg.rangeVersion)?.version || pkg.rangeVersion;
97
97
  const latestClean = semver.coerce(pkg.latestVersion)?.version || pkg.latestVersion;
98
98
  // Use previous selection if available, otherwise default to 'none'
99
- const key = `${pkg.name}@${pkg.currentVersion}`;
99
+ const key = `${pkg.name}@${pkg.currentVersion}@${pkg.type}`;
100
100
  const previousSelection = previousSelections?.get(key) || 'none';
101
101
  return {
102
102
  name: pkg.name,
@@ -127,6 +127,7 @@ class InteractiveUI {
127
127
  choices.push({
128
128
  name: state.name,
129
129
  packageJsonPath,
130
+ dependencyType: state.type,
130
131
  upgradeType: state.selectedOption,
131
132
  targetVersion: targetVersionWithPrefix,
132
133
  currentVersionSpecifier: state.currentVersionSpecifier,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inup",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
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.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -40,20 +40,20 @@
40
40
  "@types/keypress.js": "^2.1.3",
41
41
  "@types/node": "^24.10.1",
42
42
  "@types/semver": "^7.7.1",
43
- "@vitest/coverage-v8": "^3.0.0",
44
- "prettier": "^3.8.0",
43
+ "@vitest/coverage-v8": "^3.2.4",
44
+ "prettier": "^3.8.1",
45
45
  "typescript": "^5.9.3",
46
- "vitest": "^3.0.0"
46
+ "vitest": "^3.2.4"
47
47
  },
48
48
  "dependencies": {
49
49
  "chalk": "^5.6.2",
50
- "commander": "^14.0.2",
50
+ "commander": "^14.0.3",
51
51
  "env-paths": "^4.0.0",
52
- "inquirer": "^13.2.1",
52
+ "inquirer": "^13.3.2",
53
53
  "keypress": "^0.2.1",
54
54
  "nanospinner": "^1.2.2",
55
- "semver": "^7.7.3",
56
- "undici": "^7.19.1"
55
+ "semver": "^7.7.4",
56
+ "undici": "^7.24.4"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=20.0.0"