2021-11-04 20:42:47 +00:00
|
|
|
const ArboristWorkspaceCmd = require('../arborist-cmd.js')
|
2020-10-02 17:52:19 -04:00
|
|
|
|
2024-04-30 23:53:22 -07:00
|
|
|
// dedupe duplicated packages, or find them in the tree
|
2021-05-20 15:54:50 -04:00
|
|
|
class FindDupes extends ArboristWorkspaceCmd {
|
2021-11-18 20:58:02 +00:00
|
|
|
static description = 'Find duplication in the package tree'
|
|
|
|
static name = 'find-dupes'
|
|
|
|
static params = [
|
2022-12-06 22:18:33 -05:00
|
|
|
'install-strategy',
|
2021-11-18 20:58:02 +00:00
|
|
|
'legacy-bundling',
|
2022-12-06 22:18:33 -05:00
|
|
|
'global-style',
|
2021-11-18 20:58:02 +00:00
|
|
|
'strict-peer-deps',
|
|
|
|
'package-lock',
|
|
|
|
'omit',
|
2023-10-13 06:55:37 -07:00
|
|
|
'include',
|
2021-11-18 20:58:02 +00:00
|
|
|
'ignore-scripts',
|
|
|
|
'audit',
|
|
|
|
'bin-links',
|
|
|
|
'fund',
|
|
|
|
...super.params,
|
|
|
|
]
|
2021-05-20 15:54:50 -04:00
|
|
|
|
2024-04-30 23:53:22 -07:00
|
|
|
async exec () {
|
2021-03-04 17:40:28 -05:00
|
|
|
this.npm.config.set('dry-run', true)
|
2021-11-04 20:42:47 +00:00
|
|
|
return this.npm.exec('dedupe', [])
|
2021-03-04 17:40:28 -05:00
|
|
|
}
|
|
|
|
}
|
2024-04-30 23:53:22 -07:00
|
|
|
|
2021-03-04 17:40:28 -05:00
|
|
|
module.exports = FindDupes
|