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: v12.5.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: v12.5.4
Choose a head ref
  • 3 commits
  • 5 files changed
  • 2 contributors

Commits on Mar 17, 2022

  1. Copy the full SHA
    35c9a86 View commit details
  2. fix: allow updating to eslint 8 (#1071)

    Co-authored-by: Raine Revere <raine@cybersemics.org>
    midgleyc and raineorshine authored Mar 17, 2022
    Copy the full SHA
    7b47ef3 View commit details
  3. 12.5.4

    raineorshine committed Mar 17, 2022
    Copy the full SHA
    2b18797 View commit details
Showing with 150 additions and 519 deletions.
  1. +1 −6 .ncurc.js
  2. +132 −505 package-lock.json
  3. +2 −2 package.json
  4. +2 −2 src/lib/doctor.ts
  5. +13 −4 src/logging.ts
7 changes: 1 addition & 6 deletions .ncurc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
module.exports = {
reject: [
// "If you use TypeScript, you will want to stay on Chalk 4 until TypeScript 4.6 is out."
// ESM only modules
// https://github.com/microsoft/TypeScript/issues/46452
'chalk',
'cint',
// eslint-plugin-promise does not support eslint v8 yet
// https://github.com/xjamundx/eslint-plugin-promise/pull/219
'eslint',
// "Must use import to load ES Module"
// These can be removed once the tests are converted to Typescript
'find-up',
'get-stdin',
'globby',
637 changes: 132 additions & 505 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npm-check-updates",
"version": "12.5.3",
"version": "12.5.4",
"author": "Tomas Junnonen <tomas1@gmail.com>",
"license": "Apache-2.0",
"contributors": [
@@ -111,7 +111,7 @@
"chai-as-promised": "^7.1.1",
"chai-string": "^1.5.0",
"cross-env": "^7.0.3",
"eslint": "^7.32.0",
"eslint": "^8.11.0",
"eslint-config-raine": "^0.3.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-fp": "^2.3.0",
4 changes: 2 additions & 2 deletions src/lib/doctor.ts
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ const doctor = async (run: Run, options: Options) => {
/** Install dependencies using "npm run install" or a custom script given by --doctorInstall. */
const runInstall = async () => {
if (options.doctorInstall) {
const [installCommand, ...testArgs] = options.doctorInstall?.split(' ')
const [installCommand, ...testArgs] = options.doctorInstall.split(' ')
await spawn(installCommand, testArgs)
}
else {
@@ -84,7 +84,7 @@ const doctor = async (run: Run, options: Options) => {
/** Run the tests using "npm run test" or a custom script given by --doctorTest. */
const runTests = async (spawnOptions?: SpawnOptions) => {
if (options.doctorTest) {
const [testCommand, ...testArgs] = options.doctorTest?.split(' ')
const [testCommand, ...testArgs] = options.doctorTest.split(' ')
await spawn(testCommand, testArgs, spawnOptions)
}
else {
17 changes: 13 additions & 4 deletions src/logging.ts
Original file line number Diff line number Diff line change
@@ -67,6 +67,17 @@ function createDependencyTable() {
})
}

/**
* Extract just the version number from a package.json dep
*
* @param dep Raw dependency, could be version / npm: string / Git url
*/
function getVersion(dep: string): string {
return isGithubUrl(dep) ? getGithubUrlTag(dep)!
: isNpmAlias(dep) ? parseNpmAlias(dep)![1]
: dep
}

/**
* @param args
* @param args.from
@@ -84,15 +95,13 @@ function toDependencyTable({ from: fromDeps, to: toDeps, ownersChangedDeps, form
const rows = Object.keys(toDeps).map(dep => {
const from = fromDeps[dep] || ''
const toRaw = toDeps[dep] || ''
const to = isGithubUrl(toRaw) ? getGithubUrlTag(toRaw)!
: isNpmAlias(toRaw) ? parseNpmAlias(toRaw)![1]
: toRaw
const to = getVersion(toRaw)
const ownerChanged = ownersChangedDeps
? dep in ownersChangedDeps
? ownersChangedDeps[dep] ? '*owner changed*' : ''
: '*unknown*'
: ''
const toColorized = colorizeDiff(from, to)
const toColorized = colorizeDiff(getVersion(from), to)
const repoUrl = format?.includes('repo')
? getRepoUrl(dep) || ''
: ''