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 +13 -0
- package/bin/node-power-user +3 -2
- package/dist/commands/global.js +1 -1
- package/dist/commands/outdated.js +12 -5
- package/dist/commands/packages.js +1 -1
- package/dist/lib/logger.js +1 -1
- package/package.json +6 -6
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
|
package/bin/node-power-user
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
3
|
-
const
|
|
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);
|
package/dist/commands/global.js
CHANGED
|
@@ -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
|
-
//
|
|
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 (
|
|
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 (
|
|
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
|
package/dist/lib/logger.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-power-user",
|
|
3
|
-
"version": "
|
|
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": "^
|
|
40
|
-
"chalk": "^
|
|
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.
|
|
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.
|
|
46
|
+
"npm-check-updates": "^19.5.0",
|
|
47
47
|
"table": "^6.9.0",
|
|
48
48
|
"wonderful-version": "^1.3.2",
|
|
49
|
-
"yargs": "^
|
|
49
|
+
"yargs": "^18.0.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"mocha": "^8.4.0",
|