node-power-user 1.0.21 → 2.0.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/CHANGELOG.md CHANGED
@@ -14,6 +14,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
14
14
  - `Fixed` for any bug fixes.
15
15
  - `Security` in case of vulnerabilities.
16
16
 
17
+ ---
18
+ ## [2.0.0] - 2026-02-24
19
+ ### BREAKING
20
+ - Upgraded yargs v16 to v18: updated CLI entry point to use `parseSync()` API
21
+ - Upgraded chalk v4 to v5: requires Node 22+ for ESM `require()` support
22
+ - Upgraded @inquirer/prompts v7 to v8
23
+
24
+ ### Changed
25
+ - Updated all `require('chalk')` to `require('chalk').default` for chalk v5 ESM compatibility
26
+ - Improved outdated command menu: Minor/Major options only show when relevant updates exist
27
+ - Made breaking changes legend conditional on actual major updates being present
28
+ - Updated npm-check-updates to v19.5 and itwcw-package-analytics to v1.0.8
29
+
17
30
  ---
18
31
  ## [1.0.0] - 2024-06-19
19
32
  ### Added
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
- const argv = require('yargs').argv;
3
- const cli = new (require('../dist/cli.js'))(argv);
2
+ const { hideBin } = require('yargs/helpers');
3
+ const argv = require('yargs')(hideBin(process.argv)).parseSync();
4
+ const cli = new (require('../dist/cli.js'))();
4
5
  (async function() {
5
6
  'use strict';
6
7
  await cli.process(argv);
@@ -7,7 +7,7 @@ const version = require('wonderful-version');
7
7
  const { table } = require('table');
8
8
  const ProgressBar = require('cli-progress');
9
9
  const Npm = require('npm-api');
10
- const chalk = require('chalk');
10
+ const chalk = require('chalk').default;
11
11
 
12
12
  const npm = new Npm();
13
13
 
@@ -1,6 +1,6 @@
1
1
  // Libraries
2
2
  const logger = new (require('../lib/logger'))('node-power-user');
3
- const chalk = require('chalk');
3
+ const chalk = require('chalk').default;
4
4
  const { table } = require('table');
5
5
  const jetpack = require('fs-jetpack');
6
6
  const path = require('path');
@@ -117,13 +117,20 @@ module.exports = async function (options) {
117
117
  }
118
118
 
119
119
  console.log(table(dataTable));
120
- logger.log(chalk.dim('Legend: ') + chalk.magenta('⚠ = major version (breaking changes)'));
121
120
 
122
- // Get counts for menu
121
+ // Only show legend if there are major updates
122
+ const hasMajorUpdates = [...allPackages.values()].some(pkg => pkg.hasMajorUpdate);
123
+ if (hasMajorUpdates) {
124
+ logger.log(chalk.dim('Legend: ') + chalk.magenta('⚠ = major version (breaking changes)'));
125
+ }
126
+
127
+ // Get counts for menu (only show a tier if it has updates beyond the tier below)
123
128
  const discrepancies = [...allPackages.values()].filter(pkg => pkg.hasDiscrepancy);
124
129
  const patchCount = Object.keys(patchUpgrades).length;
125
130
  const minorCount = Object.keys(minorUpgrades).length;
126
131
  const majorCount = Object.keys(latestUpgrades).length;
132
+ const hasMinorBeyondPatch = minorCount > patchCount;
133
+ const hasMajorBeyondMinor = majorCount > minorCount;
127
134
 
128
135
  // Check for shortcut flags (skip menu)
129
136
  let action = null;
@@ -155,14 +162,14 @@ module.exports = async function (options) {
155
162
  });
156
163
  }
157
164
 
158
- if (minorCount > 0) {
165
+ if (hasMinorBeyondPatch) {
159
166
  choices.push({
160
167
  name: `Minor (${minorCount}) - new features, no breaking changes`,
161
168
  value: 'minor',
162
169
  });
163
170
  }
164
171
 
165
- if (majorCount > 0) {
172
+ if (hasMajorBeyondMinor) {
166
173
  choices.push({
167
174
  name: `Major (${majorCount}) - all updates including breaking changes ⚠`,
168
175
  value: 'latest',
@@ -2,7 +2,7 @@
2
2
  const logger = new (require('../lib/logger'))('node-power-user');
3
3
  const path = require('path');
4
4
  const jetpack = require('fs-jetpack');
5
- const chalk = require('chalk');
5
+ const chalk = require('chalk').default;
6
6
  const { table } = require('table');
7
7
 
8
8
  // Load package.json
@@ -1,5 +1,5 @@
1
1
  // Libraries
2
- const chalk = require('chalk');
2
+ const chalk = require('chalk').default;
3
3
 
4
4
  // Logger class
5
5
  function Logger(name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-power-user",
3
- "version": "1.0.21",
3
+ "version": "2.0.0",
4
4
  "description": "Easy tools for every Node.js developer!",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -36,17 +36,17 @@
36
36
  "replace": {}
37
37
  },
38
38
  "dependencies": {
39
- "@inquirer/prompts": "^7.10.1",
40
- "chalk": "^4.1.2",
39
+ "@inquirer/prompts": "^8.3.0",
40
+ "chalk": "^5.6.2",
41
41
  "cli-progress": "^3.12.0",
42
42
  "fs-jetpack": "^5.1.0",
43
- "itwcw-package-analytics": "^1.0.6",
43
+ "itwcw-package-analytics": "^1.0.8",
44
44
  "node-powertools": "^2.3.2",
45
45
  "npm-api": "^1.0.1",
46
- "npm-check-updates": "^19.3.2",
46
+ "npm-check-updates": "^19.5.0",
47
47
  "table": "^6.9.0",
48
48
  "wonderful-version": "^1.3.2",
49
- "yargs": "^16.2.0"
49
+ "yargs": "^18.0.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "mocha": "^8.4.0",