Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.
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: dependency-check-team/dependency-check
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 869e7563ddfd17d6e03b290a22d558ef89d2bf71
Choose a base ref
...
head repository: dependency-check-team/dependency-check
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 864e89983dfc506669e02741ffc1019dd4b7497e
Choose a head ref

Commits on Jan 15, 2018

  1. Require at least Node 6

    voxpelli committed Jan 15, 2018
    Copy the full SHA
    b8efac2 View commit details
  2. Copy the full SHA
    36b3d24 View commit details
  3. Copy the full SHA
    28502b5 View commit details
  4. Use arrow functions

    voxpelli committed Jan 15, 2018
    Copy the full SHA
    e5fdc3a View commit details
  5. Copy the full SHA
    ac7a817 View commit details
  6. Enable strict mode

    voxpelli committed Jan 15, 2018
    Copy the full SHA
    b7aef20 View commit details
  7. Use latest version of read-package-json

    As 3.x won't support older versions of Node.js that are unsupported by that module
    voxpelli committed Jan 15, 2018
    Copy the full SHA
    7bb339a View commit details
  8. Copy the full SHA
    bdbbfcf View commit details
  9. 3.0.0

    voxpelli committed Jan 15, 2018
    Copy the full SHA
    d0efa70 View commit details

Commits on Mar 1, 2018

  1. Add a quiet mode to the CLI (#83)

    I'm using this on many packages with lerna and it's hard to spot the "Fail" messages amongst all the "Success" messages.  It would be a lot easier if this module didn't log anything on success.
    ForbesLindesay authored and voxpelli committed Mar 1, 2018
    Copy the full SHA
    54cd46f View commit details
  2. Update standard to ^11.0.0

    voxpelli committed Mar 1, 2018
    Copy the full SHA
    813ca9c View commit details
  3. 3.1.0

    voxpelli committed Mar 1, 2018
    Copy the full SHA
    899dc5c View commit details

Commits on Mar 9, 2018

  1. Copy the full SHA
    8343b34 View commit details

Commits on Jul 14, 2018

  1. Resolve entry paths as globs (#93)

    vweevers authored and blakeembrey committed Jul 14, 2018
    Copy the full SHA
    c49b3ac View commit details

Commits on Jul 15, 2018

  1. 3.2.0

    blakeembrey committed Jul 15, 2018
    Copy the full SHA
    bbd743a View commit details

Commits on Sep 11, 2018

  1. Copy the full SHA
    2ef4fce View commit details
  2. update dev dependencies

    voxpelli committed Sep 11, 2018
    Copy the full SHA
    8feed95 View commit details
  3. update debug package

    fixes deprecation warning on install
    voxpelli committed Sep 11, 2018
    Copy the full SHA
    3393748 View commit details
  4. 3.2.1

    voxpelli committed Sep 11, 2018
    Copy the full SHA
    a6548e5 View commit details

Commits on Dec 25, 2018

  1. Silently pass on unsupported versions of Node.js

    This allows users to have depedency-check v3 as part of their CI build
    pipeline without being required to remove EoL versions of Node.js from
    their build matrix.
    watson authored and voxpelli committed Dec 25, 2018
    Copy the full SHA
    5aff1bc View commit details
  2. Copy the full SHA
    3f302e0 View commit details
  3. Copy the full SHA
    e3ff1df View commit details
  4. 3.3.0

    voxpelli committed Dec 25, 2018
    Copy the full SHA
    32c1b74 View commit details

Commits on Jun 6, 2019

  1. Create SECURITY.md

    voxpelli committed Jun 6, 2019
    Copy the full SHA
    26b624b View commit details
  2. Adding @blakeembrey to collaborators.md

    Long overdue
    voxpelli authored Jun 6, 2019
    Copy the full SHA
    3deca68 View commit details
  3. Copy the full SHA
    d008382 View commit details

Commits on Jul 8, 2019

  1. Update globby to ^9.2.0

    voxpelli committed Jul 8, 2019
    Copy the full SHA
    b5ddfff View commit details
  2. Make all badges use https

    voxpelli committed Jul 8, 2019
    Copy the full SHA
    a451038 View commit details
  3. Copy the full SHA
    940dc98 View commit details
  4. Add test for globs

    voxpelli committed Jul 8, 2019
    Copy the full SHA
    a0e05e1 View commit details
  5. Wording tweak in cli help

    voxpelli committed Jul 8, 2019
    Copy the full SHA
    4f6665c View commit details
  6. 3.3.1

    voxpelli committed Jul 8, 2019
    Copy the full SHA
    c28a1f0 View commit details
  7. Don't publish everything

    voxpelli committed Jul 8, 2019
    Copy the full SHA
    2df48ee View commit details
  8. 3.3.2

    voxpelli committed Jul 8, 2019
    Copy the full SHA
    f9c548e View commit details
  9. Copy the full SHA
    3a4e576 View commit details
  10. 3.4.0

    voxpelli committed Jul 8, 2019
    Copy the full SHA
    8e2ded0 View commit details
  11. Copy the full SHA
    b1d44de View commit details
  12. Copy the full SHA
    0fab216 View commit details
  13. 3.4.1

    voxpelli committed Jul 8, 2019
    Copy the full SHA
    9c74d37 View commit details

Commits on Jul 28, 2019

  1. BREAKING: Require Node >=10

    voxpelli committed Jul 28, 2019
    Copy the full SHA
    fb09c07 View commit details
  2. SEMIBREAKING: Update to latest globby release

    globby 10.x uses a new version of fast-glob which can in edge cases break some previously working glob patterns.
    
    See:
    
    * https://github.com/sindresorhus/globby/releases/tag/v10.0.0
    * https://github.com/mrmlnc/fast-glob/releases/tag/3.0.0
    voxpelli committed Jul 28, 2019
    Copy the full SHA
    2c91ae0 View commit details
  3. Copy the full SHA
    011184c View commit details
  4. Add resolving of package.json directly from files

    Making it enough to specify which files to check the dependencies of
    voxpelli committed Jul 28, 2019
    Copy the full SHA
    da6c139 View commit details
  5. BREAKING: Run all tests by default

    Only run partial when explicitly asked specifically to just run "--missing" or "--unused"
    
    This is breaking as the default check is now changing, which may cause failures
    voxpelli committed Jul 28, 2019
    Copy the full SHA
    5e4f11b View commit details
  6. SEMIBREAKING: Make --quiet the standard, add --verbose

    Align with other tools and only log failures, not successes, by default
    
    This is breaking if you relied on the output of a log on success
    voxpelli committed Jul 28, 2019
    Copy the full SHA
    d886e2b View commit details
  7. Update list of test targets

    voxpelli committed Jul 28, 2019
    Copy the full SHA
    ae7d049 View commit details
  8. Copy the full SHA
    a3b62d2 View commit details
  9. Move to require('module').builtinModules

    Fixes #80
    voxpelli committed Jul 28, 2019
    Copy the full SHA
    55d282e View commit details
  10. Copy the full SHA
    53d2c3d View commit details
  11. Copy the full SHA
    a8a39fc View commit details
Showing with 437 additions and 231 deletions.
  1. +4 −1 .gitignore
  2. +4 −0 .npmignore
  3. +8 −10 .travis.yml
  4. +20 −0 SECURITY.md
  5. +71 −48 cli.js
  6. +5 −3 collaborators.md
  7. +250 −141 index.js
  8. +34 −13 package.json
  9. +41 −15 readme.md
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.DS_Store
node_modules
node_modules
/package-lock.json
/yarn.lock
/*.tgz
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/test
/.travis.yml
/yarn.lock
/*.tgz
18 changes: 8 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
language: node_js
node_js:
- '0.10'
- '0.12'
- 'iojs'
- '4'
- '5'
- '6'
- '7'
- '8'
- '9'
- 'stable'
- '12'
- '11'
- '10'
script: npm run check && npm run test-cli
sudo: false
jobs:
include:
- stage: linting
script: npm run lint
20 changes: 20 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 4.x.x | :white_check_mark: |
| 3.x.x | :white_check_mark: |
| 2.10.x | :white_check_mark: |
| < 2.10 | :x: |

## Reporting a Vulnerability

Send an e-mail to the maintainers, eg. @voxpelli through pelle@kodfabrik.se Start the subject line with `SECURITY:`

The maintainers will get back to you as soon as possible and work with you to evaluate and handle the vulnerability.

As none of the maintainers have maintenance commitance for this module as part of their day jobs, no promises can be made in how fast a fix can be made.

Whenever feasible a patch version fixing the security vulnerability will be released and the reporting user, unless it wishes to stay anonymous, will be credited for their contribution.
119 changes: 71 additions & 48 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
#!/usr/bin/env node

var check = require('./')
'use strict'

var args = require('minimist')(process.argv.slice(2), {
const requiredNodeEngineMinimum = parseInt(require('./package.json').engines.node.match(/^>=(\d+)\./)[1], 10)
const currentNodeEngine = parseInt(process.version.match(/^v(\d+)\./)[1], 10)

if (currentNodeEngine < requiredNodeEngineMinimum) {
console.error('dependency-check: Node ' + requiredNodeEngineMinimum + ' or greater is required. `dependency-check` did not run.')
process.exit(0)
}

const check = require('./')

const args = require('minimist')(process.argv.slice(2), {
default: {
missing: false,
extra: false,
unused: false,
dev: true,
'default-entries': true
'default-entries': true,
verbose: false
},
boolean: ['missing', 'extra', 'dev', 'version', 'ignore', 'default-entries'],
boolean: ['missing', 'unused', 'dev', 'version', 'ignore', 'default-entries', 'verbose'],
alias: {
extra: 'unused',
'ignore-module': 'i',
'extensions': 'e'
extensions: 'e'
}
})

@@ -23,31 +33,31 @@ if (args.version) {
}

if (args.help || args._.length === 0) {
console.log('\nUsage: dependency-check <path to package.json or module folder> <additional entries to add> <options>')

console.log('\nUsage: dependency-check <path to entry file, package.json or module folder> <additional entry paths to add> <options>')
console.log('\nEntry paths supports globbing for easy adding of eg. entire folders.')
console.log('\nOptions:')
console.log('--missing (default) Check to make sure that all modules in your code are listed in your package.json')
console.log('--unused, --extra The inverse of the --missing check and will tell you which modules in your package.json *were not* used in your code')
console.log('--missing Only check to make sure that all modules in your code are listed in your package.json')
console.log('--unused Only check which modules listed in your package.json *are not* used in your code')
console.log("--no-dev Won't tell you about devDependencies that are missing or unused")
console.log("--no-peer Won't tell you about peerDependencies that are missing or unused")
console.log("--ignore-module, -i Won't tell you about these module names when missing or unused")
console.log('--entry By default your main and bin entries from package.json will be parsed, but you can add more the list of entries by passing them in as --entry')
console.log("--no-default-entries Won't parse your main and bin entries from package.json will be parsed")
console.log("--ignore-module, -i Won't tell you about these module names when missing or unused. Supports globbing")
console.log("--no-default-entries Won't parse your main and bin entries from package.json even when a package.json or module folder has been defined")
console.log('--detective Requireable path containing an alternative implementation of the detective module that supports alternate syntaxes')
console.log("--extensions, -e List of file extensions with detective to use when resolving require paths. Eg. 'js,jsx:detective-es6'")
console.log('--version Show current version')
console.log('--ignore To always exit with code 0 pass --ignore')
console.log('--verbose Enable logging of eg. success message')
console.log('')

process.exit(1)
}

function extensions (arg) {
if (!arg) return undefined
var extensions = {}
const extensions = {}

function add (value) {
var parts = value.trim().split(':', 2)
const parts = value.trim().split(':', 2)

parts[0].split(',').forEach(function (ext) {
extensions[ext.charAt(0) === '.' ? ext : '.' + ext] = parts[1]
@@ -65,40 +75,53 @@ function extensions (arg) {

check({
path: args._.shift(),
entries: args._.concat(args.entry || []),
entries: args._,
noDefaultEntries: !args['default-entries'],
extensions: extensions(args.e),
detective: args.detective
}, function (err, data) {
if (err) {
console.error(err.message)
return process.exit(1)
}
var pkg = data.package
var deps = data.used
var failed = 0
var options = {
excludeDev: args.dev === false,
excludePeer: args.peer === false,
ignore: [].concat(args.i || [])
}
if (args.extra) {
var extras = check.extra(pkg, deps, options)
failed += extras.length
if (extras.length) {
console.error('Fail! Modules in package.json not used in code: ' + extras.join(', '))
} else {
console.log('Success! All dependencies in package.json are used in the code')
})
.then(data => {
const pkg = data.package
const deps = data.used
let failed = 0
const options = {
excludeDev: args.dev === false,
excludePeer: args.peer === false,
ignore: [].concat(args.i || [])
}
}
if (args.missing || !args.extra) {
var missing = check.missing(pkg, deps, options)
failed += missing.length
if (missing.length) {
console.error('Fail! Dependencies not listed in package.json: ' + missing.join(', '))
} else {
console.log('Success! All dependencies used in the code are listed in package.json')

const runAllTests = !args.extra && !args.missing

if (runAllTests || args.unused) {
const extras = check.extra(pkg, deps, options)
failed += extras.length
if (extras.length) {
console.error('Fail! Modules in package.json not used in code: ' + extras.join(', '))
} else if (args.verbose) {
console.log('Success! All dependencies in package.json are used in the code')
}
}
}
process.exit(args.ignore || !failed ? 0 : 1)
})
if (runAllTests || args.missing) {
const optionsForMissingCheck = runAllTests
? Object.assign({}, options, {
excludeDev: false,
excludePeer: false
})
: options

const missing = check.missing(pkg, deps, optionsForMissingCheck)

failed += missing.length

if (missing.length) {
console.error('Fail! Dependencies not listed in package.json: ' + missing.join(', '))
} else if (args.verbose) {
console.log('Success! All dependencies used in the code are listed in package.json')
}
}
process.exit(args.ignore || !failed ? 0 : 1)
})
.catch(err => {
console.error(err.message)
process.exit(1)
})
8 changes: 5 additions & 3 deletions collaborators.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

dependency-check is only possible due to the excellent work of the following collaborators:

<table><tbody><tr><th align="left">voxpelli</th><td><a href="https://github.com/voxpelli">GitHub/voxpelli</a></td></tr>
<tr><th align="left">maxogden</th><td><a href="https://github.com/maxogden">GitHub/maxogden</a></td></tr>
</tbody></table>
| Nickname | Profile |
|-------------|------------------------------------------------------|
| blakeembrey | [GitHub/blakeembrey](https://github.com/blakeembrey) |
| voxpelli | [GitHub/voxpelli](https://github.com/voxpelli) |
| maxogden | [GitHub/maxogden](https://github.com/maxogden) |
Loading