diff options
author | Gar <gar+gh@danger.computer> | 2021-10-08 04:40:03 +0300 |
---|---|---|
committer | Gar <gar+gh@danger.computer> | 2021-11-04 00:04:22 +0300 |
commit | 8ffeb71dfb248b4a76744bd06cd4d6100f17c8ae (patch) | |
tree | b44d12a79dff3afe0c92df6f6c0219f6d91ad471 /lib/find-dupes.js | |
parent | 85d59191cf681eabd8827ca58f925c1063776f61 (diff) |
chore: refactor commands
This is the first phase of refactoring the internal structure of the npm
commands to set us up for future changes. This iteration changes the
function signature of `exec` for all the commands to be a async (no more
callbacks), and also groups all the commands into their own
subdirectory.
It also removes the Proxy `npm.commands` object, in favor of an
`npm.cmd` and `npm.exec` function that breaks up the two things that
proxy was doing. Namely, getting to the attributes of a given command
(`npm.cmd` now does this), and actually running the command `npm.exec`
does this.
PR-URL: https://github.com/npm/cli/pull/3959
Credit: @wraithgar
Close: #3959
Reviewed-by: @lukekarrys
Diffstat (limited to 'lib/find-dupes.js')
-rw-r--r-- | lib/find-dupes.js | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/find-dupes.js b/lib/find-dupes.js deleted file mode 100644 index 69b30e8aa..000000000 --- a/lib/find-dupes.js +++ /dev/null @@ -1,36 +0,0 @@ -// dedupe duplicated packages, or find them in the tree -const ArboristWorkspaceCmd = require('./workspaces/arborist-cmd.js') - -class FindDupes extends ArboristWorkspaceCmd { - /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get description () { - return 'Find duplication in the package tree' - } - - /* istanbul ignore next - see test/lib/load-all-commands.js */ - static get name () { - return 'find-dupes' - } - - /* 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, - ] - } - - exec (args, cb) { - this.npm.config.set('dry-run', true) - this.npm.commands.dedupe([], cb) - } -} -module.exports = FindDupes |