npm-check-updates 14.0.0 → 14.1.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/README.md +36 -15
- package/build/package.json +9 -7
- package/build/src/bin/cli.js +4 -2
- package/build/src/bin/cli.js.map +1 -1
- package/build/src/cli-options.d.ts +1 -0
- package/build/src/cli-options.js +167 -32
- package/build/src/cli-options.js.map +1 -1
- package/build/src/index.js +2 -2
- package/build/src/index.js.map +1 -1
- package/build/src/lib/initOptions.js +27 -4
- package/build/src/lib/initOptions.js.map +1 -1
- package/build/src/lib/mergeOptions.d.ts +1 -1
- package/build/src/lib/queryVersions.js +2 -2
- package/build/src/lib/queryVersions.js.map +1 -1
- package/build/src/lib/runLocal.js +3 -1
- package/build/src/lib/runLocal.js.map +1 -1
- package/build/src/lib/upgradePackageData.js +124 -24
- package/build/src/lib/upgradePackageData.js.map +1 -1
- package/build/src/logging.d.ts +29 -0
- package/build/src/logging.js +99 -22
- package/build/src/logging.js.map +1 -1
- package/build/src/package-managers/index.js +2 -0
- package/build/src/package-managers/index.js.map +1 -1
- package/build/src/package-managers/npm.d.ts +1 -1
- package/build/src/package-managers/npm.js +25 -4
- package/build/src/package-managers/npm.js.map +1 -1
- package/build/src/package-managers/staticRegistry.d.ts +10 -0
- package/build/src/package-managers/staticRegistry.js +32 -0
- package/build/src/package-managers/staticRegistry.js.map +1 -0
- package/build/src/scripts/build-options.js +1 -1
- package/build/src/scripts/build-options.js.map +1 -1
- package/build/src/types/RunOptions.d.ts +5 -5
- package/build/src/types/StaticRegistry.d.ts +3 -0
- package/build/src/types/StaticRegistry.js +3 -0
- package/build/src/types/StaticRegistry.js.map +1 -0
- package/build/src/version-util.d.ts +7 -0
- package/build/src/version-util.js +26 -1
- package/build/src/version-util.js.map +1 -1
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -6,8 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
**npm-check-updates upgrades your package.json dependencies to the _latest_ versions, ignoring specified versions.**
|
|
8
8
|
|
|
9
|
-
- maintains existing semantic versioning _policies_, i.e. `"
|
|
9
|
+
- maintains existing semantic versioning _policies_, i.e. `"react": "^16.0.4"` to `"react": "^18.2.0"`.
|
|
10
10
|
- _only_ modifies package.json file. Run `npm install` to update your installed packages and package-lock.json.
|
|
11
|
+
- clean output
|
|
12
|
+
- sensible defaults
|
|
13
|
+
- lots of options for custom behavior
|
|
14
|
+
- CLI and module usage
|
|
15
|
+
- compatible with `npm`, `yarn`, and `pnpm`
|
|
11
16
|
|
|
12
17
|

|
|
13
18
|
|
|
@@ -15,8 +20,6 @@
|
|
|
15
20
|
- Cyan = minor upgrade
|
|
16
21
|
- Green = patch upgrade
|
|
17
22
|
|
|
18
|
-
You may also want to consider [npm-check](https://github.com/dylang/npm-check). Similar purpose, different features.
|
|
19
|
-
|
|
20
23
|
## Installation
|
|
21
24
|
|
|
22
25
|
Install globally:
|
|
@@ -143,8 +146,8 @@ ncu "/^(?!react-).*$/" # windows
|
|
|
143
146
|
"prod,dev,bundle,optional")
|
|
144
147
|
--deprecated Include deprecated packages.
|
|
145
148
|
--doctor Iteratively installs upgrades and runs tests to
|
|
146
|
-
identify breaking upgrades.
|
|
147
|
-
|
|
149
|
+
identify breaking upgrades. Requires "-u" to
|
|
150
|
+
execute. Run "ncu --help --doctor" for details.
|
|
148
151
|
--doctorInstall <command> Specifies the install script to use in doctor
|
|
149
152
|
mode. (default: npm install/yarn)
|
|
150
153
|
--doctorTest <command> Specifies the test script to use in doctor mode.
|
|
@@ -161,11 +164,10 @@ ncu "/^(?!react-).*$/" # windows
|
|
|
161
164
|
--filterVersion <matches> Filter on package version using
|
|
162
165
|
comma-or-space-delimited list, /regex/, or
|
|
163
166
|
predicate function.
|
|
164
|
-
--format <value>
|
|
165
|
-
comma-delimited
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
links to source code repository. (default: [])
|
|
167
|
+
--format <value> Modify the output formatting or show additional
|
|
168
|
+
information. Specify one or more comma-delimited
|
|
169
|
+
values: group, ownerChanged, repo. Run "ncu
|
|
170
|
+
--help --format" for details. (default: [])
|
|
169
171
|
-g, --global Check global packages instead of in the current
|
|
170
172
|
project.
|
|
171
173
|
-i, --interactive Enable interactive prompts for each dependency;
|
|
@@ -188,14 +190,16 @@ ncu "/^(?!react-).*$/" # windows
|
|
|
188
190
|
--packageData <value> Package file data (you can also use stdin).
|
|
189
191
|
--packageFile <path|glob> Package file(s) location. (default:
|
|
190
192
|
./package.json)
|
|
191
|
-
-p, --packageManager <name> npm, yarn (default:
|
|
193
|
+
-p, --packageManager <name> npm, yarn, staticRegistry (default: npm). Run
|
|
194
|
+
"ncu --help --packageManager" for details.
|
|
192
195
|
--peer Check peer dependencies of installed packages
|
|
193
196
|
and filter updates to compatible versions. Run
|
|
194
197
|
"ncu --help --peer" for details.
|
|
195
198
|
--pre <n> Include -alpha, -beta, -rc. (default: 0; default
|
|
196
199
|
with --newest and --greatest: 1)
|
|
197
200
|
--prefix <path> Current working directory of npm.
|
|
198
|
-
-r, --registry <
|
|
201
|
+
-r, --registry <uri> Third-party npm registry. Run "ncu --help
|
|
202
|
+
--registry" for details.
|
|
199
203
|
-x, --reject <matches> Exclude packages matching the given string,
|
|
200
204
|
wildcard, glob, comma-or-space-delimited list,
|
|
201
205
|
/regex/, or predicate function. (default: [])
|
|
@@ -210,8 +214,8 @@ ncu "/^(?!react-).*$/" # windows
|
|
|
210
214
|
--stdin Read package.json from stdin.
|
|
211
215
|
-t, --target <value> Determines the version to upgrade to: latest,
|
|
212
216
|
newest, greatest, minor, patch, @[tag], or
|
|
213
|
-
[function]. Run "ncu --help
|
|
214
|
-
details.
|
|
217
|
+
[function]. (default: latest). Run "ncu --help
|
|
218
|
+
--target" for details.
|
|
215
219
|
--timeout <ms> Global timeout in milliseconds. (default: no
|
|
216
220
|
global timeout and 30 seconds per
|
|
217
221
|
npm-registry-fetch)
|
|
@@ -221,6 +225,23 @@ ncu "/^(?!react-).*$/" # windows
|
|
|
221
225
|
-h, --help display help for command
|
|
222
226
|
```
|
|
223
227
|
|
|
228
|
+
## Interactive Mode
|
|
229
|
+
|
|
230
|
+
Choose exactly which upgrades to make in interactive mode:
|
|
231
|
+
|
|
232
|
+
```sh
|
|
233
|
+
ncu --interactive
|
|
234
|
+
ncu -i
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Select which upgrades you want:
|
|
238
|
+
|
|
239
|
+

|
|
240
|
+
|
|
241
|
+
Combine with `--format group` for a truly _luxe_ experience:
|
|
242
|
+
|
|
243
|
+

|
|
244
|
+
|
|
224
245
|
## Doctor Mode
|
|
225
246
|
|
|
226
247
|
Usage: `ncu --doctor [-u] [options]`
|
|
@@ -262,7 +283,7 @@ npm run test
|
|
|
262
283
|
Saving partially upgraded package.json
|
|
263
284
|
```
|
|
264
285
|
|
|
265
|
-
##
|
|
286
|
+
## Config File
|
|
266
287
|
|
|
267
288
|
Use a `.ncurc.{json,yml,js}` file to specify configuration information.
|
|
268
289
|
You can specify file name and path using `--configFileName` and `--configFilePath`
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-check-updates",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"author": "Tomas Junnonen <tomas1@gmail.com>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"contributors": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"prepublishOnly": "npm run build",
|
|
39
39
|
"prettier": "prettier .",
|
|
40
40
|
"test": "npm run test:src && npm run test:timeout",
|
|
41
|
-
"test:src": "mocha test src/test test/package-managers/npm test/package-managers/yarn",
|
|
41
|
+
"test:src": "mocha test src/test test/package-managers/npm test/package-managers/yarn test/package-managers/staticRegistry",
|
|
42
42
|
"test:timeout": "mocha --exit test/timeout",
|
|
43
43
|
"ncu": "node build/src/bin/cli.js"
|
|
44
44
|
},
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"pacote": "^13.6.0",
|
|
74
74
|
"parse-github-url": "^1.0.2",
|
|
75
75
|
"progress": "^2.0.3",
|
|
76
|
-
"prompts": "
|
|
76
|
+
"prompts": "https://github.com/raineorshine/prompts#ncu",
|
|
77
77
|
"rc-config-loader": "^4.1.0",
|
|
78
78
|
"remote-git-tags": "^3.0.0",
|
|
79
79
|
"rimraf": "^3.0.2",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@types/pacote": "^11.1.4",
|
|
100
100
|
"@types/parse-github-url": "^1.0.0",
|
|
101
101
|
"@types/progress": "^2.0.5",
|
|
102
|
-
"@types/prompts": "^2.
|
|
102
|
+
"@types/prompts": "^2.0.14",
|
|
103
103
|
"@types/remote-git-tags": "^4.0.0",
|
|
104
104
|
"@types/rimraf": "^3.0.2",
|
|
105
105
|
"@types/semver": "^7.3.10",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"eslint-plugin-fp": "^2.3.0",
|
|
120
120
|
"eslint-plugin-import": "^2.26.0",
|
|
121
121
|
"eslint-plugin-jsdoc": "^39.3.2",
|
|
122
|
-
"eslint-plugin-
|
|
122
|
+
"eslint-plugin-n": "^15.2.3",
|
|
123
123
|
"eslint-plugin-promise": "^6.0.0",
|
|
124
124
|
"husky": "^8.0.1",
|
|
125
125
|
"lockfile-lint": "^4.7.5",
|
|
@@ -139,10 +139,12 @@
|
|
|
139
139
|
],
|
|
140
140
|
"lockfile-lint": {
|
|
141
141
|
"allowed-schemes": [
|
|
142
|
-
"https:"
|
|
142
|
+
"https:",
|
|
143
|
+
"git+https:"
|
|
143
144
|
],
|
|
144
145
|
"allowed-hosts": [
|
|
145
|
-
"npm"
|
|
146
|
+
"npm",
|
|
147
|
+
"github.com"
|
|
146
148
|
],
|
|
147
149
|
"empty-hostname": false,
|
|
148
150
|
"type": "npm ",
|
package/build/src/bin/cli.js
CHANGED
|
@@ -75,9 +75,11 @@ commander_1.program
|
|
|
75
75
|
.description('[filter] is a list or regex of package names to check (all others will be ignored).')
|
|
76
76
|
.usage('[options] [filter]');
|
|
77
77
|
// add cli options
|
|
78
|
-
cli_options_1.default.forEach(({ long, short, arg, description, default: defaultValue, parse }) =>
|
|
78
|
+
cli_options_1.default.forEach(({ long, short, arg, description, default: defaultValue, help, parse }) =>
|
|
79
79
|
// handle 3rd/4th argument polymorphism
|
|
80
|
-
commander_1.program.option(`${short ? `-${short}, ` : ''}--${long}${arg ? ` <${arg}>` : ''}`,
|
|
80
|
+
commander_1.program.option(`${short ? `-${short}, ` : ''}--${long}${arg ? ` <${arg}>` : ''}`,
|
|
81
|
+
// point to help in description if extended help text is available
|
|
82
|
+
`${description}${help ? ` Run "ncu --help --${long}" for details.` : ''}`, parse || defaultValue, parse ? defaultValue : undefined));
|
|
81
83
|
// set version option at the end
|
|
82
84
|
commander_1.program.version(package_json_1.default.version);
|
|
83
85
|
commander_1.program.parse(process.argv);
|
package/build/src/bin/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/bin/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAmC;AACnC,oDAAsB;AACtB,sEAA4C;AAC5C,qDAA0B;AAC1B,sEAAoC;AACpC,8DAA0D;AAC1D,+DAAsC;AAEtC,8EAA8E;AAC9E,MAAM,QAAQ,GAAG,IAAA,yBAAc,EAAC,EAAE,GAAG,EAAH,sBAAG,EAAE,CAAC,CAAA;AACxC,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,KAAK,sBAAG,CAAC,OAAO,EAAE;IAC7D,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;CAClD;AAED,uCAAuC;AACvC,+DAA+D;AAC/D,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC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AR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,KAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AAE5G,mBAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;AAChC,WAAW,GAAG,mBAAO,CAAC,IAAI,EAAE,CAAA;AAE5B,wFAAwF;AACxF,MAAM,OAAO,GAAG;IACd,GAAG,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACrG,GAAG,gBAAC,CAAC,MAAM,CAAC,mBAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC;IACzD,IAAI,EAAE,mBAAO,CAAC,IAAI;IAClB,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;CAChE,CAAA;AAED,oEAAoE;AAEpE,IAAA,eAAG,EAAC,OAAO,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAA"}
|
package/build/src/cli-options.js
CHANGED
|
@@ -7,34 +7,72 @@ exports.cliOptionsMap = void 0;
|
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const cli_table_1 = __importDefault(require("cli-table"));
|
|
9
9
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* "newest" means most recently released in terms of release date, even if there are other version numbers that are higher. It includes prereleases.
|
|
13
|
-
* "greatest" means the highest version number, regardless of release date. It includes prereleases.
|
|
14
|
-
* "latest" is whatever the project's "latest" git tag points to. It's usually the non-prerelease version with the highest version number, but is ultimately decided by each project's maintainers.
|
|
15
|
-
* "minor" means the highest minor version without incrementing the current major.
|
|
16
|
-
* "patch" means the highest patch version without incrementing the current major or minor.
|
|
17
|
-
**/
|
|
18
|
-
const getHelpTargetTable = () => {
|
|
10
|
+
/** Wraps a string by inserting newlines every n characters. Wraps on word break. Default: 92 chars. */
|
|
11
|
+
const wrap = (s, maxLineLength = 92) => {
|
|
19
12
|
/* eslint-disable fp/no-mutating-methods */
|
|
13
|
+
const linesIn = s.split('\n');
|
|
14
|
+
const linesOut = [];
|
|
15
|
+
linesIn.forEach(lineIn => {
|
|
16
|
+
var _a;
|
|
17
|
+
let i = 0;
|
|
18
|
+
if (lineIn.length === 0) {
|
|
19
|
+
linesOut.push('');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// eslint-disable-next-line fp/no-loops
|
|
23
|
+
while (i < lineIn.length) {
|
|
24
|
+
const lineFull = lineIn.slice(i, i + maxLineLength + 1);
|
|
25
|
+
// if the line is within the line length, push it as the last line and break
|
|
26
|
+
const lineTrimmed = lineFull.trimEnd();
|
|
27
|
+
if (lineTrimmed.length <= maxLineLength) {
|
|
28
|
+
linesOut.push(lineTrimmed);
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
// otherwise, wrap before the last word that exceeds the wrap length
|
|
32
|
+
// do not wrap in the middle of a word
|
|
33
|
+
// reverse the string and use match to find the first non-word character to wrap on
|
|
34
|
+
const wrapOffset = ((_a = lineFull
|
|
35
|
+
.split('')
|
|
36
|
+
.reverse()
|
|
37
|
+
.join('')
|
|
38
|
+
// add [^\W] to not break in the middle of --registry
|
|
39
|
+
.match(/[ -][^\W]/)) === null || _a === void 0 ? void 0 : _a.index) || 0;
|
|
40
|
+
const line = lineFull.slice(0, lineFull.length - wrapOffset);
|
|
41
|
+
// make sure we do not end up in an infinite loop
|
|
42
|
+
if (line.length === 0)
|
|
43
|
+
break;
|
|
44
|
+
linesOut.push(line.trimEnd());
|
|
45
|
+
i += line.length;
|
|
46
|
+
}
|
|
47
|
+
i = 0;
|
|
48
|
+
});
|
|
49
|
+
return linesOut.join('\n').trim();
|
|
50
|
+
};
|
|
51
|
+
/** Wraps the second column in a list of 2-column cli-table rows. */
|
|
52
|
+
const wrapRows = (rows) => rows.map(([col1, col2]) => [col1, wrap(col2)]);
|
|
53
|
+
/** Extended help for the --target option. */
|
|
54
|
+
const extendedHelpTarget = () => {
|
|
55
|
+
const header = 'Determines the version to upgrade to. (default: "latest")';
|
|
20
56
|
const table = new cli_table_1.default({
|
|
21
57
|
colAligns: ['right', 'left'],
|
|
58
|
+
rows: wrapRows([
|
|
59
|
+
[
|
|
60
|
+
'greatest',
|
|
61
|
+
`Upgrade to the highest version number published, regardless of release date or tag. Includes prereleases.`,
|
|
62
|
+
],
|
|
63
|
+
['latest', `Upgrade to whatever the package's "latest" git tag points to. Excludes pre is specified.`],
|
|
64
|
+
['minor', 'Upgrade to the highest minor version without bumping the major version.'],
|
|
65
|
+
[
|
|
66
|
+
'newest',
|
|
67
|
+
`Upgrade to the version with the most recent publish date, even if there are other version numbers that are higher. Includes prereleases.`,
|
|
68
|
+
],
|
|
69
|
+
['patch', `Upgrade to the highest patch version without bumping the minor or major versions.`],
|
|
70
|
+
['@[tag]', `Upgrade to the version published to a specific tag, e.g. 'next' or 'beta'.`],
|
|
71
|
+
]),
|
|
72
|
+
// coerce type until rows is added @types/cli-table
|
|
73
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/cli-table/index.d.ts
|
|
22
74
|
});
|
|
23
|
-
|
|
24
|
-
'greatest',
|
|
25
|
-
`Upgrade to the highest version number published, regardless of release date or tag.
|
|
26
|
-
Includes prereleases.`,
|
|
27
|
-
]);
|
|
28
|
-
table.push(['latest', `Upgrade to whatever the package's "latest" git tag points to. Excludes pre is specified.`]);
|
|
29
|
-
table.push(['minor', 'Upgrade to the highest minor version without bumping the major version.']);
|
|
30
|
-
table.push([
|
|
31
|
-
'newest',
|
|
32
|
-
`Upgrade to the version with the most recent publish date, even if there are
|
|
33
|
-
other version numbers that are higher. Includes prereleases.`,
|
|
34
|
-
]);
|
|
35
|
-
table.push(['patch', `Upgrade to the highest patch version without bumping the minor or major versions.`]);
|
|
36
|
-
table.push(['@[tag]', `Upgrade to the version published to a specific tag, e.g. 'next' or 'beta'.`]);
|
|
37
|
-
return `Determines the version to upgrade to. (default: "latest")
|
|
75
|
+
return `${header}
|
|
38
76
|
|
|
39
77
|
${table.toString()}
|
|
40
78
|
|
|
@@ -53,6 +91,96 @@ You can also specify a custom function in your .ncurc.js file, or when importing
|
|
|
53
91
|
|
|
54
92
|
`;
|
|
55
93
|
};
|
|
94
|
+
/** Extended help for the --format option. */
|
|
95
|
+
const extendedHelpFormat = () => {
|
|
96
|
+
const header = 'Modify the output formatting or show additional information. Specify one or more comma-delimited values.';
|
|
97
|
+
const table = new cli_table_1.default({
|
|
98
|
+
colAligns: ['right', 'left'],
|
|
99
|
+
rows: wrapRows([
|
|
100
|
+
['group', `Groups packages by major, minor, patch, and non-semver updates.`],
|
|
101
|
+
['ownerChanged', `Shows if the package owner has changed.`],
|
|
102
|
+
['repo', `Infers and displays links to the package's source code repository.`],
|
|
103
|
+
]),
|
|
104
|
+
// coerce type until rows is added @types/cli-table
|
|
105
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/cli-table/index.d.ts
|
|
106
|
+
});
|
|
107
|
+
return `${header}\n\n${table.toString()}
|
|
108
|
+
`;
|
|
109
|
+
};
|
|
110
|
+
/** Extended help for the --format option. */
|
|
111
|
+
const extendedHelpPackageManager = () => {
|
|
112
|
+
const header = 'Specifies the package manager to use when looking up version numbers.';
|
|
113
|
+
const table = new cli_table_1.default({
|
|
114
|
+
colAligns: ['right', 'left'],
|
|
115
|
+
rows: wrapRows([
|
|
116
|
+
['npm', `System-installed npm. Default.`],
|
|
117
|
+
['yarn', `System-installed yarn. Automatically used if yarn.lock is present.`],
|
|
118
|
+
[
|
|
119
|
+
'staticRegistry',
|
|
120
|
+
`Checks versions from a static file. Must include the --registry option with the path to a JSON registry file.
|
|
121
|
+
|
|
122
|
+
Example:
|
|
123
|
+
|
|
124
|
+
${chalk_1.default.cyan('$')} ncu --packageManager staticRegistry --registry ./my-registry.json
|
|
125
|
+
|
|
126
|
+
my-registry.json:
|
|
127
|
+
|
|
128
|
+
{
|
|
129
|
+
"prettier": "2.7.1",
|
|
130
|
+
"typescript": "4.7.4"
|
|
131
|
+
}
|
|
132
|
+
`,
|
|
133
|
+
],
|
|
134
|
+
]),
|
|
135
|
+
// coerce type until rows is added @types/cli-table
|
|
136
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/cli-table/index.d.ts
|
|
137
|
+
});
|
|
138
|
+
return `${header}\n\n${table.toString()}
|
|
139
|
+
`;
|
|
140
|
+
};
|
|
141
|
+
/** Extended help for the --doctor option. */
|
|
142
|
+
const extendedHelpDoctor = () => `Iteratively installs upgrades and runs tests to identify breaking upgrades.
|
|
143
|
+
|
|
144
|
+
${chalk_1.default.bold('Add "-u" to execute')} (modifies your package file, lock file, and node_modules)
|
|
145
|
+
|
|
146
|
+
To be more precise:
|
|
147
|
+
1. Runs "npm install" and "npm test" to ensure tests are currently passing.
|
|
148
|
+
2. Runs "ncu -u" to optimistically upgrade all dependencies.
|
|
149
|
+
3. If tests pass, hurray!
|
|
150
|
+
4. If tests fail, restores package file and lock file.
|
|
151
|
+
5. For each dependency, install upgrade and run tests.
|
|
152
|
+
6. Prints broken upgrades with test error.
|
|
153
|
+
7. Saves working upgrades to package.json.
|
|
154
|
+
|
|
155
|
+
Example:
|
|
156
|
+
|
|
157
|
+
$ ncu --doctor -u
|
|
158
|
+
Running tests before upgrading
|
|
159
|
+
npm install
|
|
160
|
+
npm run test
|
|
161
|
+
Upgrading all dependencies and re-running tests
|
|
162
|
+
ncu -u
|
|
163
|
+
npm install
|
|
164
|
+
npm run test
|
|
165
|
+
Tests failed
|
|
166
|
+
Identifying broken dependencies
|
|
167
|
+
npm install
|
|
168
|
+
npm install --no-save react@16.0.0
|
|
169
|
+
npm run test
|
|
170
|
+
✓ react 15.0.0 → 16.0.0
|
|
171
|
+
npm install --no-save react-redux@7.0.0
|
|
172
|
+
npm run test
|
|
173
|
+
✗ react-redux 6.0.0 → 7.0.0
|
|
174
|
+
|
|
175
|
+
/projects/myproject/test.js:13
|
|
176
|
+
throw new Error('Test failed!')
|
|
177
|
+
^
|
|
178
|
+
|
|
179
|
+
npm install --no-save react-dnd@11.1.3
|
|
180
|
+
npm run test
|
|
181
|
+
✓ react-dnd 10.0.0 → 11.1.3
|
|
182
|
+
Saving partially upgraded package.json
|
|
183
|
+
`;
|
|
56
184
|
// store CLI options separately from bin file so that they can be used to build type definitions
|
|
57
185
|
const cliOptions = [
|
|
58
186
|
{
|
|
@@ -88,7 +216,7 @@ const cliOptions = [
|
|
|
88
216
|
},
|
|
89
217
|
{
|
|
90
218
|
long: 'deep',
|
|
91
|
-
description: `Run recursively in current working directory. Alias of (--packageFile '
|
|
219
|
+
description: `Run recursively in current working directory. Alias of (--packageFile '**/package.json').`,
|
|
92
220
|
type: 'boolean',
|
|
93
221
|
},
|
|
94
222
|
{
|
|
@@ -105,8 +233,9 @@ const cliOptions = [
|
|
|
105
233
|
},
|
|
106
234
|
{
|
|
107
235
|
long: 'doctor',
|
|
108
|
-
description: 'Iteratively installs upgrades and runs tests to identify breaking upgrades.
|
|
236
|
+
description: 'Iteratively installs upgrades and runs tests to identify breaking upgrades. Requires "-u" to execute.',
|
|
109
237
|
type: 'boolean',
|
|
238
|
+
help: extendedHelpDoctor(),
|
|
110
239
|
},
|
|
111
240
|
{
|
|
112
241
|
long: 'doctorInstall',
|
|
@@ -150,10 +279,12 @@ const cliOptions = [
|
|
|
150
279
|
{
|
|
151
280
|
long: 'format',
|
|
152
281
|
arg: 'value',
|
|
153
|
-
description: '
|
|
282
|
+
description: 'Modify the output formatting or show additional information. Specify one or more comma-delimited values: group, ownerChanged, repo.',
|
|
154
283
|
parse: value => (typeof value === 'string' ? value.split(',') : value),
|
|
155
284
|
default: [],
|
|
156
285
|
type: 'string[]',
|
|
286
|
+
choices: ['group', 'ownerChanged', 'repo'],
|
|
287
|
+
help: extendedHelpFormat(),
|
|
157
288
|
},
|
|
158
289
|
{
|
|
159
290
|
long: 'global',
|
|
@@ -220,12 +351,13 @@ const cliOptions = [
|
|
|
220
351
|
short: 'p',
|
|
221
352
|
arg: 'name',
|
|
222
353
|
// manual default to allow overriding auto yarn detection
|
|
223
|
-
description: 'npm, yarn (default:
|
|
354
|
+
description: 'npm, yarn, staticRegistry (default: npm).',
|
|
355
|
+
help: extendedHelpPackageManager(),
|
|
224
356
|
type: 'string',
|
|
225
357
|
},
|
|
226
358
|
{
|
|
227
359
|
long: 'peer',
|
|
228
|
-
description: 'Check peer dependencies of installed packages and filter updates to compatible versions.
|
|
360
|
+
description: 'Check peer dependencies of installed packages and filter updates to compatible versions.',
|
|
229
361
|
type: 'boolean',
|
|
230
362
|
help: `Check peer dependencies of installed packages and filter updates to compatible versions.
|
|
231
363
|
|
|
@@ -280,8 +412,11 @@ As a comparison: without using the --peer option, ncu will suggest the latest ve
|
|
|
280
412
|
{
|
|
281
413
|
long: 'registry',
|
|
282
414
|
short: 'r',
|
|
283
|
-
arg: '
|
|
415
|
+
arg: 'uri',
|
|
284
416
|
description: 'Third-party npm registry.',
|
|
417
|
+
help: wrap(`Specify the registry to use when looking up package version numbers.
|
|
418
|
+
|
|
419
|
+
When --packageManager staticRegistry is set, --registry must specify a path to a JSON registry file.`),
|
|
285
420
|
type: 'string',
|
|
286
421
|
},
|
|
287
422
|
{
|
|
@@ -327,8 +462,8 @@ As a comparison: without using the --peer option, ncu will suggest the latest ve
|
|
|
327
462
|
long: 'target',
|
|
328
463
|
short: 't',
|
|
329
464
|
arg: 'value',
|
|
330
|
-
description: 'Determines the version to upgrade to: latest, newest, greatest, minor, patch, @[tag], or [function].
|
|
331
|
-
help:
|
|
465
|
+
description: 'Determines the version to upgrade to: latest, newest, greatest, minor, patch, @[tag], or [function]. (default: latest).',
|
|
466
|
+
help: extendedHelpTarget(),
|
|
332
467
|
// eslint-disable-next-line no-template-curly-in-string
|
|
333
468
|
type: `'latest' | 'newest' | 'greatest' | 'minor' | 'patch' | ${'`@${string}`'} | TargetFunction`,
|
|
334
469
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-options.js","sourceRoot":"","sources":["../../src/cli-options.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAsB;AACtB,0DAA6B;AAC7B,kDAAyB;
|
|
1
|
+
{"version":3,"file":"cli-options.js","sourceRoot":"","sources":["../../src/cli-options.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAsB;AACtB,0DAA6B;AAC7B,kDAAyB;AAgBzB,uGAAuG;AACvG,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,aAAa,GAAG,EAAE,EAAE,EAAE;IAC7C,2CAA2C;IAC3C,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC7B,MAAM,QAAQ,GAAa,EAAE,CAAA;IAC7B,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;;QACvB,IAAI,CAAC,GAAG,CAAC,CAAA;QACT,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACjB,OAAM;SACP;QAED,uCAAuC;QACvC,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;YACxB,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,aAAa,GAAG,CAAC,CAAC,CAAA;YAEvD,4EAA4E;YAC5E,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAA;YACtC,IAAI,WAAW,CAAC,MAAM,IAAI,aAAa,EAAE;gBACvC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;gBAC1B,MAAK;a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G,EAAE,IAAI;QACT,WAAW,EAAE,oGAAoG;QACjH,IAAI,EAAE,QAAQ;KACf;IACD;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,sFAAsF;QACnG,IAAI,EAAE,SAAS;KAChB;CACF,CAAA;AAED,iDAAiD;AACpC,QAAA,aAAa,GAAG,UAAU,CAAC,MAAM,CAC5C,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IAClB,GAAG,KAAK;IACR,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACrD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;CACpD,CAAC,EACF,EAAsB,CACvB,CAAA;AAED,MAAM,gBAAgB,GAAG,gBAAC,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;AAErD,kBAAe,gBAAgB,CAAA"}
|
package/build/src/index.js
CHANGED
|
@@ -10,8 +10,8 @@ const globby_1 = __importDefault(require("globby"));
|
|
|
10
10
|
const lodash_1 = __importDefault(require("lodash"));
|
|
11
11
|
const chalk_1 = __importDefault(require("chalk"));
|
|
12
12
|
const package_managers_1 = __importDefault(require("./package-managers"));
|
|
13
|
-
const constants_1 = require("./constants");
|
|
14
13
|
const logging_1 = require("./logging");
|
|
14
|
+
const cli_options_1 = require("./cli-options");
|
|
15
15
|
const findPackage_1 = __importDefault(require("./lib/findPackage"));
|
|
16
16
|
const doctor_1 = __importDefault(require("./lib/doctor"));
|
|
17
17
|
const getNcuRc_1 = __importDefault(require("./lib/getNcuRc"));
|
|
@@ -150,7 +150,7 @@ async function run(runOptions = {}, { cli } = {}) {
|
|
|
150
150
|
}
|
|
151
151
|
// print help otherwise
|
|
152
152
|
else {
|
|
153
|
-
(0, logging_1.print)(options,
|
|
153
|
+
(0, logging_1.print)(options, `Usage: ncu --doctor\n\n${cli_options_1.cliOptionsMap.doctor.help}`, 'warn');
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
// normal mode
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAmB;AACnB,gDAAuB;AACvB,oDAA2B;AAC3B,oDAAsB;AACtB,kDAAyB;AACzB,0EAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAmB;AACnB,gDAAuB;AACvB,oDAA2B;AAC3B,oDAAsB;AACtB,kDAAyB;AACzB,0EAAgD;AAChD,uCAA4C;AAC5C,+CAA6C;AAC7C,oEAA2C;AAC3C,0DAAiC;AACjC,8DAAqC;AACrC,kFAAyD;AACzD,sEAA6C;AAC7C,oEAA2C;AAC3C,sEAA6C;AAC7C,gEAAuC;AACvC,8DAAqC;AAOrC,6EAA6E;AAC7E,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,GAAG,CAAC,EAAE;IACrC,MAAM,GAAG,CAAA;AACX,CAAC,CAAC,CAAA;AAEF;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,OAAgB;;IACpC,yEAAyE;IACzE,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,KAAI,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,0CAAE,QAAQ,CAAC,SAAS,CAAC,CAAA,CAAC,EAAE;QACzF,MAAM,OAAO,GACX,+DAA+D;YAC/D,iEAAiE;YACjE,qDAAqD;YACrD,oEAAoE;YACpE,gEAAgE;YAChE,mEAAmE;YACnE,mDAAmD,CAAA;QAErD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AE,QAAQ,CAAC,CAAA;aAC7B;SACF;aAAM;YACL,gEAAgE;YAChE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,sBAAsB,EAAE;gBAC3D,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;aAC9B;YACD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,MAAM,IAAA,qBAAW,EAAC,OAAO,CAAC,CAAA;YACrD,QAAQ,GAAG,MAAM,IAAA,kBAAQ,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;SACrD;QACD,YAAY,CAAC,OAAO,CAAC,CAAA;QACrB,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,cAAc;IACd,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,kBAAkB;QAClB,IAAI,OAAO,CAAC,OAAO,EAAE;YACnB,iGAAiG;YACjG,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,IAAA,gBAAM,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;SAC5D;QACD,uBAAuB;aAClB;YACH,IAAA,eAAK,EAAC,OAAO,EAAE,0BAA0B,2BAAa,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAA;SAC9E;KACF;IACD,cAAc;SACT;QACH,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC,CAAC,CAAA;KACrD;AACH,CAAC;AAlHD,kBAkHC;AAED,kBAAe,GAAG,CAAA"}
|
|
@@ -7,7 +7,6 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
9
|
const cli_options_1 = __importDefault(require("../cli-options"));
|
|
10
|
-
const constants_1 = require("../constants");
|
|
11
10
|
const programError_1 = __importDefault(require("./programError"));
|
|
12
11
|
const getPackageFileName_1 = __importDefault(require("./getPackageFileName"));
|
|
13
12
|
const logging_1 = require("../logging");
|
|
@@ -35,6 +34,7 @@ function initOptions(runOptions, { cli } = {}) {
|
|
|
35
34
|
...(runOptions.packageData && typeof runOptions.packageData !== 'string'
|
|
36
35
|
? { packageData: JSON.stringify(runOptions.packageData, null, 2) }
|
|
37
36
|
: null),
|
|
37
|
+
cli,
|
|
38
38
|
};
|
|
39
39
|
const loglevel = options.silent ? 'silent' : options.loglevel;
|
|
40
40
|
const json = Object.keys(options)
|
|
@@ -52,13 +52,37 @@ function initOptions(runOptions, { cli } = {}) {
|
|
|
52
52
|
});
|
|
53
53
|
(0, logging_1.print)(options, '', 'warn');
|
|
54
54
|
}
|
|
55
|
+
// validate options with predefined choices
|
|
56
|
+
cli_options_1.default.forEach(({ long, choices }) => {
|
|
57
|
+
if (!choices || choices.length === 0)
|
|
58
|
+
return;
|
|
59
|
+
const value = options[long];
|
|
60
|
+
const values = [].concat(value);
|
|
61
|
+
if (values.length === 0)
|
|
62
|
+
return;
|
|
63
|
+
// make sure the option value is valid
|
|
64
|
+
// if an array of values is given, make sure each one is a valid choice
|
|
65
|
+
if (values.every(value => !choices.includes(value))) {
|
|
66
|
+
(0, programError_1.default)(options, chalk.red(`Invalid option value: --${long} ${value}. Valid values are: ${choices.join(', ')}.`));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
55
69
|
// disallow non-matching filter and args
|
|
56
70
|
if (options.filter && (options.args || []).length > 0 && options.filter !== options.args.join(' ')) {
|
|
57
71
|
(0, programError_1.default)(options, chalk.red('Cannot specify a filter using both --filter and args. Did you forget to quote an argument?') +
|
|
58
72
|
'\nSee: https://github.com/raineorshine/npm-check-updates/issues/759#issuecomment-723587297');
|
|
59
73
|
}
|
|
74
|
+
// disallow packageFile and --deep
|
|
60
75
|
else if (options.packageFile && options.deep) {
|
|
61
|
-
(0, programError_1.default)(options, chalk.red(`Cannot specify both --packageFile and --deep. --deep is an alias for --packageFile '
|
|
76
|
+
(0, programError_1.default)(options, chalk.red(`Cannot specify both --packageFile and --deep. --deep is an alias for --packageFile '**/package.json'`));
|
|
77
|
+
}
|
|
78
|
+
// disallow incorrect or missing registry path when selecting staticRegistry as packageManager
|
|
79
|
+
if (options.packageManager === 'staticRegistry') {
|
|
80
|
+
if (options.registry === undefined || options.registry === null) {
|
|
81
|
+
(0, programError_1.default)(options, chalk.red('When --package-manager staticRegistry is specified, you must provide the path for the registry file with --registry. Run "ncu --help --packageManager" for details.'));
|
|
82
|
+
}
|
|
83
|
+
if (!fs_1.default.existsSync(options.registry)) {
|
|
84
|
+
(0, programError_1.default)(options, chalk.red(`The specified static registry file does not exist: ${options.registry}`));
|
|
85
|
+
}
|
|
62
86
|
}
|
|
63
87
|
const target = options.target || 'latest';
|
|
64
88
|
const autoPre = target === 'newest' || target === 'greatest';
|
|
@@ -71,10 +95,9 @@ function initOptions(runOptions, { cli } = {}) {
|
|
|
71
95
|
}
|
|
72
96
|
return {
|
|
73
97
|
...options,
|
|
74
|
-
...(options.deep ? { packageFile:
|
|
98
|
+
...(options.deep ? { packageFile: `**/${(0, getPackageFileName_1.default)(options)}` } : null),
|
|
75
99
|
...((options.args || []).length > 0 ? { filter: options.args.join(' ') } : null),
|
|
76
100
|
...(format.length > 0 ? { format } : null),
|
|
77
|
-
cli,
|
|
78
101
|
// add shortcut for any keys that start with 'json'
|
|
79
102
|
json,
|
|
80
103
|
// convert silent option to loglevel silent
|