Skip to content

Commit 8ae842c

Browse files
authored
feat(commands): support dedupe (#61)
1 parent abf95b7 commit 8ae842c

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ This package includes package manager agents and their corresponding commands fo
7070
- `'global_uninstall'` - remove global packages
7171
- `'upgrade'` - upgrade dependencies
7272
- `'upgrade-interactive'` - upgrade dependencies interactively: not available for `npm`
73+
- `'dedupe'` - deduplicate dependencies with overlapping ranges: not available for `deno` and `bun`
7374
- `'execute'` - download & execute binary scripts
7475
- `'execute-local'` - execute binary scripts (from package locally installed)
7576
- `'run'` - run `package.json` scripts

src/commands.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const npm: AgentCommands = {
2626
'add': ['npm', 'i', 0],
2727
'upgrade': ['npm', 'update', 0],
2828
'upgrade-interactive': null,
29+
'dedupe': ['npm', 'dedupe', 0],
2930
'execute': ['npx', 0],
3031
'execute-local': ['npx', 0],
3132
'uninstall': ['npm', 'uninstall', 0],
@@ -42,6 +43,7 @@ const yarn: AgentCommands = {
4243
'add': ['yarn', 'add', 0],
4344
'upgrade': ['yarn', 'upgrade', 0],
4445
'upgrade-interactive': ['yarn', 'upgrade-interactive', 0],
46+
'dedupe': null,
4547
'execute': ['npx', 0],
4648
'execute-local': dashDashArg('yarn', 'exec'),
4749
'uninstall': ['yarn', 'remove', 0],
@@ -54,6 +56,7 @@ const yarnBerry: AgentCommands = {
5456
'frozen': ['yarn', 'install', '--immutable', 0],
5557
'upgrade': ['yarn', 'up', 0],
5658
'upgrade-interactive': ['yarn', 'up', '-i', 0],
59+
'dedupe': ['yarn', 'dedupe', 0],
5760
'execute': ['yarn', 'dlx', 0],
5861
'execute-local': ['yarn', 'exec', 0],
5962
// Yarn 2+ removed 'global', see https://github.com/yarnpkg/berry/issues/821
@@ -70,6 +73,7 @@ const pnpm: AgentCommands = {
7073
'add': ['pnpm', 'add', 0],
7174
'upgrade': ['pnpm', 'update', 0],
7275
'upgrade-interactive': ['pnpm', 'update', '-i', 0],
76+
'dedupe': ['pnpm', 'dedupe', 0],
7377
'execute': ['pnpm', 'dlx', 0],
7478
'execute-local': ['pnpm', 'exec', 0],
7579
'uninstall': ['pnpm', 'remove', 0],
@@ -85,6 +89,7 @@ const bun: AgentCommands = {
8589
'add': ['bun', 'add', 0],
8690
'upgrade': ['bun', 'update', 0],
8791
'upgrade-interactive': ['bun', 'update', '-i', 0],
92+
'dedupe': null,
8893
'execute': ['bun', 'x', 0],
8994
'execute-local': ['bun', 'x', 0],
9095
'uninstall': ['bun', 'remove', 0],
@@ -100,6 +105,7 @@ const deno: AgentCommands = {
100105
'add': ['deno', 'add', 0],
101106
'upgrade': ['deno', 'outdated', '--update', 0],
102107
'upgrade-interactive': ['deno', 'outdated', '--update', 0],
108+
'dedupe': null,
103109
'execute': denoExecute(),
104110
'execute-local': ['deno', 'task', '--eval', 0],
105111
'uninstall': ['deno', 'remove', 0],

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface AgentCommands {
1212
'add': AgentCommandValue
1313
'upgrade': AgentCommandValue
1414
'upgrade-interactive': AgentCommandValue
15+
'dedupe': AgentCommandValue
1516
'execute': AgentCommandValue
1617
'execute-local': AgentCommandValue
1718
'uninstall': AgentCommandValue

0 commit comments

Comments
 (0)