Skip to content

Commit

Permalink
feat: add bunx as execute in bun (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeko369 committed Jan 20, 2023
1 parent 6d544f9 commit be87d1c
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/agents.ts
Expand Up @@ -39,7 +39,7 @@ const bun = {
'add': 'bun add {0}',
'upgrade': null,
'upgrade-interactive': null,
'execute': null,
'execute': 'bunx {0}',
'uninstall': 'bun remove {0}',
'global_uninstall': 'bun remove -g {0}',
}
Expand Down
14 changes: 14 additions & 0 deletions test/nx/bun.spec.ts
@@ -0,0 +1,14 @@
import { expect, test } from 'vitest'
import { parseNx } from '../../src/commands'

const agent = 'bun'
const _ = (arg: string, expected: string) => () => {
expect(
parseNx(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}

test('single uninstall', _('esbuild', 'bunx esbuild'))
test('multiple', _('esbuild --version', 'bunx esbuild --version'))
14 changes: 14 additions & 0 deletions test/nx/npm.spec.ts
@@ -0,0 +1,14 @@
import { expect, test } from 'vitest'
import { parseNx } from '../../src/commands'

const agent = 'npm'
const _ = (arg: string, expected: string) => () => {
expect(
parseNx(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}

test('single uninstall', _('esbuild', 'npx esbuild'))
test('multiple', _('esbuild --version', 'npx esbuild --version'))
14 changes: 14 additions & 0 deletions test/nx/pnpm.spec.ts
@@ -0,0 +1,14 @@
import { expect, test } from 'vitest'
import { parseNx } from '../../src/commands'

const agent = 'pnpm'
const _ = (arg: string, expected: string) => () => {
expect(
parseNx(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}

test('single uninstall', _('esbuild', 'pnpm dlx esbuild'))
test('multiple', _('esbuild --version', 'pnpm dlx esbuild --version'))
14 changes: 14 additions & 0 deletions test/nx/yarn.spec.ts
@@ -0,0 +1,14 @@
import { expect, test } from 'vitest'
import { parseNx } from '../../src/commands'

const agent = 'yarn'
const _ = (arg: string, expected: string) => () => {
expect(
parseNx(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}

test('single uninstall', _('esbuild', 'npx esbuild'))
test('multiple', _('esbuild --version', 'npx esbuild --version'))
14 changes: 14 additions & 0 deletions test/nx/yarn@berry.spec.ts
@@ -0,0 +1,14 @@
import { expect, test } from 'vitest'
import { parseNx } from '../../src/commands'

const agent = 'yarn@berry'
const _ = (arg: string, expected: string) => () => {
expect(
parseNx(agent, arg.split(' ').filter(Boolean)),
).toBe(
expected,
)
}

test('single uninstall', _('esbuild', 'yarn dlx esbuild'))
test('multiple', _('esbuild --version', 'yarn dlx esbuild --version'))

0 comments on commit be87d1c

Please sign in to comment.