Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: raineorshine/npm-check-updates
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v16.1.3
Choose a base ref
...
head repository: raineorshine/npm-check-updates
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v16.2.0
Choose a head ref
  • 13 commits
  • 17 files changed
  • 1 contributor

Commits on Sep 16, 2022

  1. Copy the full SHA
    631954e View commit details
  2. Copy the full SHA
    b1adf7e View commit details
  3. Copy the full SHA
    6931b4c View commit details
  4. Copy the full SHA
    253b3d2 View commit details
  5. Copy the full SHA
    37ebc81 View commit details
  6. 16.2.0-0

    raineorshine committed Sep 16, 2022
    Copy the full SHA
    a8c6666 View commit details
  7. Copy the full SHA
    294fd7f View commit details
  8. Copy the full SHA
    fc5fee3 View commit details
  9. Remove autoinstall tests from interactive mode.

    npm install command is no longer shown after the prompts since it was redundant.
    raineorshine committed Sep 16, 2022
    Copy the full SHA
    491fbb8 View commit details
  10. Fix broken untildify on cwd.

    Regression: 631954e
    raineorshine committed Sep 16, 2022
    Copy the full SHA
    768b5d3 View commit details

Commits on Sep 19, 2022

  1. Copy the full SHA
    36599e5 View commit details
  2. Copy the full SHA
    8cb9f9c View commit details
  3. 16.2.0

    raineorshine committed Sep 19, 2022
    Copy the full SHA
    d21772b View commit details
Showing with 607 additions and 210 deletions.
  1. +1 −1 CHANGELOG.md
  2. +109 −104 README.md
  3. +2 −2 package-lock.json
  4. +1 −1 package.json
  5. +7 −7 src/bin/cli.ts
  6. +45 −8 src/cli-options.ts
  7. +79 −13 src/index.ts
  8. +6 −6 src/lib/findPackage.ts
  9. +19 −0 src/lib/initOptions.ts
  10. +1 −1 src/lib/queryVersions.ts
  11. +1 −0 src/types/PackageFile.ts
  12. +13 −1 src/types/RunOptions.ts
  13. +1 −1 test/group.test.ts
  14. +1 −1 test/index.test.ts
  15. +0 −64 test/interactive.test.ts
  16. +11 −0 test/version-util.test.ts
  17. +310 −0 test/workspaces.test.ts
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ Prerelease versions are now "upgraded" to versions with a different [preid](http

For example, if you have a dependency at `1.3.3-next.1` and the version fetched by ncu is `1.2.3-dev.2`, ncu **will** suggest an "upgrade" to `1.2.3-dev.2`. This is because prerelease versions with different preids are incomparable. Since they are incomparable, ncu now assumes the fetched version is desired.

Since this change affects only prereleases, there is no impact on default `ncu` usage that fetches the `latest` version. With `--pre` or `--target newest` or `--target greatest`, this change could affect which version is suggested if versions with different preids are published. The change was made to support the new `--target @[tag]` feature.
Since this change affects only prereleases, there is no impact on default `ncu` usage that fetches the `latest` version. With `--pre 1` or `--target newest` or `--target greatest`, this change could affect which version is suggested if versions with different preids are published. The change was made to support the new `--target @[tag]` feature.

If you have a use case where this change is not what is desired, please [report an issue](https://github.com/raineorshine/npm-check-updates/issues/new). The intention is for zero disruption to current usage.

213 changes: 109 additions & 104 deletions README.md
Original file line number Diff line number Diff line change
@@ -130,110 +130,115 @@ ncu "/^(?!react-).*$/" # windows
## Options

```text
--cache Cache versions to the cache file (default:
false)
--cacheExpiration <time> Cache expiration in minutes (default: 10)
--cacheFile <path> Filepath for the cache file (default:
"~/.ncu-cache.json")
--color Force color in terminal
--concurrency <n> Max number of concurrent HTTP requests to
registry. (default: 8)
--configFileName <filename> Config file name. (default:
.ncurc.{json,yml,js})
--configFilePath <path> Directory of .ncurc config file. (default:
directory of `packageFile`)
--cwd <path> Working directory in which npm will be executed.
--deep Run recursively in current working directory.
Alias of (--packageFile '**/package.json').
--dep <value> Check one or more sections of dependencies only:
dev, optional, peer, prod, bundle
(comma-delimited). (default:
"prod,dev,bundle,optional")
--deprecated Include deprecated packages.
--doctor Iteratively installs upgrades and runs tests to
identify breaking upgrades. Requires "-u" to
execute. Run "ncu --help --doctor" for details.
--doctorInstall <command> Specifies the install script to use in doctor
mode. (default: npm install/yarn)
--doctorTest <command> Specifies the test script to use in doctor mode.
(default: npm test)
--enginesNode Include only packages that satisfy engines.node
as specified in the package file.
-e, --errorLevel <n> Set the error level. 1: exits with error code 0
if no errors occur. 2: exits with error code 0
if no packages need updating (useful for
continuous integration). (default: 1)
-f, --filter <matches> Include only package names matching the given
string, wildcard, glob, comma-or-space-delimited
list, /regex/, or predicate function.
--filterVersion <matches> Filter on package version using
comma-or-space-delimited list, /regex/, or
predicate function.
--format <value> Modify the output formatting or show additional
information. Specify one or more comma-delimited
values: group, ownerChanged, repo. Run "ncu
--help --format" for details. (default: [])
-g, --global Check global packages instead of in the current
project.
--groupFunction <fn> Customize how packages are divided into groups
when using '--format group'. Run "ncu --help
--groupFunction" for details.
-i, --interactive Enable interactive prompts for each dependency;
implies -u unless one of the json options are
set.
-j, --jsonAll Output new package file instead of
human-readable message.
--jsonDeps Like `jsonAll` but only lists `dependencies`,
`devDependencies`, `optionalDependencies`, etc
of the new package data.
--jsonUpgraded Output upgraded dependencies in json.
-l, --loglevel <n> Amount to log: silent, error, minimal, warn,
info, verbose, silly. (default: "warn")
--mergeConfig Merges nested configs with the root config file
for --deep or --packageFile options. (default:
false)
-m, --minimal Do not upgrade newer versions that are already
satisfied by the version range according to
semver.
--packageData <value> Package file data (you can also use stdin).
--packageFile <path|glob> Package file(s) location. (default:
./package.json)
-p, --packageManager <name> npm, yarn, staticRegistry (default: npm). Run
"ncu --help --packageManager" for details.
--peer Check peer dependencies of installed packages
and filter updates to compatible versions. Run
"ncu --help --peer" for details.
--pre <n> Include -alpha, -beta, -rc. (default: 0; default
with --newest and --greatest: 1)
--prefix <path> Current working directory of npm.
-r, --registry <uri> Third-party npm registry. Run "ncu --help
--registry" for details.
-x, --reject <matches> Exclude packages matching the given string,
wildcard, glob, comma-or-space-delimited list,
/regex/, or predicate function. (default: [])
--rejectVersion <matches> Exclude package.json versions using
comma-or-space-delimited list, /regex/, or
predicate function.
--removeRange Remove version ranges from the final package
version.
--retry <n> Number of times to retry failed requests for
package info. (default: 3)
-s, --silent Don't output anything. Alias for --loglevel
silent.
--stdin Read package.json from stdin.
-t, --target <value> Determines the version to upgrade to: latest,
newest, greatest, minor, patch, @[tag], or
[function]. (default: latest). Run "ncu --help
--target" for details.
--timeout <ms> Global timeout in milliseconds. (default: no
global timeout and 30 seconds per
npm-registry-fetch)
-u, --upgrade Overwrite package file with upgraded versions
instead of just outputting to console.
--verbose Log additional information for debugging. Alias
for --loglevel verbose.
-V, --version output the version number
-h, --help display help for command
--cache Cache versions to the cache file (default: false)
--cacheExpiration <min> Cache expiration in minutes (default: 10)
--cacheFile <path> Filepath for the cache file (default:
"~/.ncu-cache.json")
--color Force color in terminal
--concurrency <n> Max number of concurrent HTTP requests to
registry. (default: 8)
--configFileName <s> Config file name. (default: .ncurc.{json,yml,js})
--configFilePath <path> Directory of .ncurc config file. (default:
directory of `packageFile`)
--cwd <path> Working directory in which npm will be executed.
--deep Run recursively in current working directory.
Alias of (--packageFile '**/package.json').
--dep <value> Check one or more sections of dependencies only:
dev, optional, peer, prod, bundle
(comma-delimited). (default:
"prod,dev,bundle,optional")
--deprecated Include deprecated packages.
--doctor Iteratively installs upgrades and runs tests to
identify breaking upgrades. Requires "-u" to
execute. Run "ncu --help --doctor" for details.
--doctorInstall <command> Specifies the install script to use in doctor
mode. (default: npm install/yarn)
--doctorTest <command> Specifies the test script to use in doctor mode.
(default: npm test)
--enginesNode Include only packages that satisfy engines.node as
specified in the package file.
-e, --errorLevel <n> Set the error level. 1: exits with error code 0 if
no errors occur. 2: exits with error code 0 if no
packages need updating (useful for continuous
integration). (default: 1)
-f, --filter <p> Include only package names matching the given
string, wildcard, glob, comma-or-space-delimited
list, /regex/, or predicate function.
--filterVersion <p> Filter on package version using
comma-or-space-delimited list, /regex/, or
predicate function.
--format <value> Modify the output formatting or show additional
information. Specify one or more comma-delimited
values: group, ownerChanged, repo. Run "ncu --help
--format" for details. (default: [])
-g, --global Check global packages instead of in the current
project.
--groupFunction <fn> Customize how packages are divided into groups
when using '--format group'. Run "ncu --help
--groupFunction" for details.
-i, --interactive Enable interactive prompts for each dependency;
implies -u unless one of the json options are set.
-j, --jsonAll Output new package file instead of human-readable
message.
--jsonDeps Like `jsonAll` but only lists `dependencies`,
`devDependencies`, `optionalDependencies`, etc of
the new package data.
--jsonUpgraded Output upgraded dependencies in json.
-l, --loglevel <n> Amount to log: silent, error, minimal, warn, info,
verbose, silly. (default: "warn")
--mergeConfig Merges nested configs with the root config file
for --deep or --packageFile options. (default:
false)
-m, --minimal Do not upgrade newer versions that are already
satisfied by the version range according to
semver.
--packageData <value> Package file data (you can also use stdin).
--packageFile <path|glob> Package file(s) location. (default:
./package.json)
-p, --packageManager <s> npm, yarn, staticRegistry (default: npm). Run "ncu
--help --packageManager" for details.
--peer Check peer dependencies of installed packages and
filter updates to compatible versions. Run "ncu
--help --peer" for details.
--pre <n> Include prerelease versions, e.g. -alpha.0,
-beta.5, -rc.2. Automatically set to 1 when
--loglevel is newest or greatest, or when the
current version is a prerelease. (default: 0)
--prefix <path> Current working directory of npm.
-r, --registry <uri> Third-party npm registry. Run "ncu --help
--registry" for details.
-x, --reject <p> Exclude packages matching the given string,
wildcard, glob, comma-or-space-delimited list,
/regex/, or predicate function. (default: [])
--rejectVersion <p> Exclude package.json versions using
comma-or-space-delimited list, /regex/, or
predicate function.
--removeRange Remove version ranges from the final package
version.
--retry <n> Number of times to retry failed requests for
package info. (default: 3)
-s, --silent Don't output anything. Alias for --loglevel
silent.
--stdin Read package.json from stdin.
-t, --target <value> Determines the version to upgrade to: latest,
newest, greatest, minor, patch, @[tag], or
[function]. (default: latest). Run "ncu --help
--target" for details.
--timeout <ms> Global timeout in milliseconds. (default: no
global timeout and 30 seconds per
npm-registry-fetch)
-u, --upgrade Overwrite package file with upgraded versions
instead of just outputting to console.
--verbose Log additional information for debugging. Alias
for --loglevel verbose.
-ww, --withWorkspace <s> Run on one or more specified workspaces and the
root project. (default: [])
-wws, --withWorkspaces Run on all workspaces and the root project.
-w, --workspace <s> Run on one or more specified workspaces. (default:
[])
-ws, --workspaces Run on all workspaces.
-V, --version output the version number
-h, --help display help for command
```

## Interactive Mode
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npm-check-updates",
"version": "16.1.3",
"version": "16.2.0",
"author": "Tomas Junnonen <tomas1@gmail.com>",
"license": "Apache-2.0",
"contributors": [
14 changes: 7 additions & 7 deletions src/bin/cli.ts
Original file line number Diff line number Diff line change
@@ -30,25 +30,25 @@ import getNcuRc from '../lib/getNcuRc' // async global contexts are only availab
const query = arg.replace(/^-*/, '')
const option = cliOptions.find(option => option.long === query || option.short === query)
if (option) {
console.log(`Usage: ncu --${option.long}`)
console.info(`Usage: ncu --${option.long}${option.arg ? ` [${option.arg}]` : ''}`)
if (option.short) {
console.log(` ncu -${option.short}`)
console.info(` ncu -${option.short}${option.arg ? ` [${option.arg}]` : ''}`)
}
if (option.default !== undefined && !(Array.isArray(option.default) && option.default.length === 0)) {
console.log(`Default: ${option.default}`)
console.info(`Default: ${option.default}`)
}
if (option.help) {
const helpText = typeof option.help === 'function' ? option.help() : option.help
console.log(`\n${helpText}`)
console.info(`\n${helpText}`)
} else if (option.description) {
console.log(`\n${option.description}`)
console.info(`\n${option.description}`)
}
} else {
console.log(`Unknown option: ${arg}`)
console.info(`Unknown option: ${arg}`)
}
})
if (rawArgs.length - nonHelpArgs.length > 1) {
console.log('Would you like some help with your help?')
console.info('Would you like some help with your help?')
}
process.exit(0)
}
Loading