node-power-user 2.0.0 → 2.0.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/dist/cli.js CHANGED
@@ -62,7 +62,7 @@ Main.prototype.process = async function (options) {
62
62
 
63
63
  // Execute the command
64
64
  const Command = require(commandFile);
65
- await Command(options);
65
+ return await Command(options);
66
66
  } catch (e) {
67
67
  console.error(`Error executing command "${command}": ${e.message}`);
68
68
 
@@ -124,13 +124,26 @@ module.exports = async function (options) {
124
124
  logger.log(chalk.dim('Legend: ') + chalk.magenta('⚠ = major version (breaking changes)'));
125
125
  }
126
126
 
127
- // Get counts for menu (only show a tier if it has updates beyond the tier below)
127
+ // Get counts for menu (only show a tier if it offers upgrades beyond the tier below)
128
128
  const discrepancies = [...allPackages.values()].filter(pkg => pkg.hasDiscrepancy);
129
129
  const patchCount = Object.keys(patchUpgrades).length;
130
130
  const minorCount = Object.keys(minorUpgrades).length;
131
131
  const majorCount = Object.keys(latestUpgrades).length;
132
- const hasMinorBeyondPatch = minorCount > patchCount;
133
- const hasMajorBeyondMinor = majorCount > minorCount;
132
+
133
+ // Check if minor offers any versions beyond what patch gives
134
+ const hasMinorBeyondPatch = Object.keys(minorUpgrades).some(dep =>
135
+ minorUpgrades[dep] !== (patchUpgrades[dep] || allDependencies[dep])
136
+ );
137
+
138
+ // Check if major/latest offers any versions beyond what minor gives
139
+ const hasMajorBeyondMinor = Object.keys(latestUpgrades).some(dep =>
140
+ latestUpgrades[dep] !== (minorUpgrades[dep] || allDependencies[dep])
141
+ );
142
+
143
+ // If noPrompt, return data without showing menu (used by tests)
144
+ if (options.noPrompt) {
145
+ return { allPackages };
146
+ }
134
147
 
135
148
  // Check for shortcut flags (skip menu)
136
149
  let action = null;
@@ -10,4 +10,6 @@ const project = jetpack.read(path.join(process.cwd(), 'package.json'), 'json');
10
10
  module.exports = async function (options) {
11
11
  // Log version
12
12
  console.log(package.version);
13
+
14
+ return package.version;
13
15
  };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./cli.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-power-user",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Easy tools for every Node.js developer!",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {