2020-10-02 17:52:19 -04:00
|
|
|
// dedupe duplicated packages, or find them in the tree
|
2021-05-20 15:54:50 -04:00
|
|
|
const ArboristWorkspaceCmd = require('./workspaces/arborist-cmd.js')
|
2020-10-02 17:52:19 -04:00
|
|
|
|
2021-05-20 15:54:50 -04:00
|
|
|
class FindDupes extends ArboristWorkspaceCmd {
|
2021-03-23 14:58:11 -04:00
|
|
|
/* istanbul ignore next - see test/lib/load-all-commands.js */
|
|
|
|
static get description () {
|
|
|
|
return 'Find duplication in the package tree'
|
|
|
|
}
|
|
|
|
|
2021-03-04 17:40:28 -05:00
|
|
|
/* istanbul ignore next - see test/lib/load-all-commands.js */
|
2021-03-11 17:54:23 -05:00
|
|
|
static get name () {
|
|
|
|
return 'find-dupes'
|
2021-03-04 17:40:28 -05:00
|
|
|
}
|
|
|
|
|
2021-05-20 15:54:50 -04:00
|
|
|
/* istanbul ignore next - see test/lib/load-all-commands.js */
|
|
|
|
static get params () {
|
|
|
|
return [
|
|
|
|
'global-style',
|
|
|
|
'legacy-bundling',
|
|
|
|
'strict-peer-deps',
|
|
|
|
'package-lock',
|
|
|
|
'omit',
|
|
|
|
'ignore-scripts',
|
|
|
|
'audit',
|
|
|
|
'bin-links',
|
|
|
|
'fund',
|
|
|
|
...super.params,
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2021-03-04 17:40:28 -05:00
|
|
|
exec (args, cb) {
|
|
|
|
this.npm.config.set('dry-run', true)
|
|
|
|
this.npm.commands.dedupe([], cb)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = FindDupes
|