Skip to content

Commit bf3b0c3

Browse files
authored
fix(package-manager): fix command pnpx to pnpm dlx (#215)
fix(package-manager): fix pnpx to pnpm dlx Co-authored-by: nurazon59 <nurazon59@users.noreply.github.com>
1 parent 77dd7f5 commit bf3b0c3

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

packages/cta-engine/src/package-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function getPackageManagerExecuteCommand(
5151
case 'yarn':
5252
return { command: 'yarn', args: ['dlx', pkg, ...args] }
5353
case 'pnpm':
54-
return { command: 'pnpx', args: [pkg, ...args] }
54+
return { command: 'pnpm', args: ['dlx', pkg, ...args] }
5555
case 'bun':
5656
return { command: 'bunx', args: ['--bun', pkg, ...args] }
5757
case 'deno':

packages/cta-engine/tests/integrations/shadcn.test.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,16 @@ describe('shadcn', () => {
5252

5353
expect(output.commands).toEqual([
5454
{
55-
command: 'pnpx',
56-
args: ['shadcn@latest', 'add', '--silent', '--yes', 'button', 'card'],
55+
command: 'pnpm',
56+
args: [
57+
'dlx',
58+
'shadcn@latest',
59+
'add',
60+
'--silent',
61+
'--yes',
62+
'button',
63+
'card',
64+
],
5765
},
5866
])
5967
})
@@ -83,8 +91,16 @@ describe('shadcn', () => {
8391

8492
expect(output.commands).toEqual([
8593
{
86-
command: 'pnpx',
87-
args: ['shadcn@latest', 'add', '--silent', '--yes', 'button', 'card'],
94+
command: 'pnpm',
95+
args: [
96+
'dlx',
97+
'shadcn@latest',
98+
'add',
99+
'--silent',
100+
'--yes',
101+
'button',
102+
'card',
103+
],
88104
},
89105
])
90106
})

packages/cta-engine/tests/package-manager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('getPackageManagerExecuteCommand', () => {
4848
formatCommand(
4949
getPackageManagerExecuteCommand('pnpm', 'shadcn', ['add', 'button']),
5050
),
51-
).toBe('pnpx shadcn add button')
51+
).toBe('pnpm dlx shadcn add button')
5252
})
5353
it('bun', () => {
5454
expect(

0 commit comments

Comments
 (0)