Skip to content

Commit 202131c

Browse files
palmithorshadcn
andauthored
chore(deps): Upgrade @antfu/ni to v23.2.0 (#6414)
* chore(deps): Upgrade @antfu/ni to v23.2.0 * chore: changeset * test(shadcn): add bun.lock --------- Co-authored-by: shadcn <m@shadcn.com>
1 parent 7977975 commit 202131c

9 files changed

Lines changed: 33 additions & 14 deletions

File tree

.changeset/cool-mails-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"shadcn": patch
3+
---
4+
5+
upgrade @antfu/ni

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"test:dev": "REGISTRY_URL=http://localhost:3333 vitest run"
4646
},
4747
"dependencies": {
48-
"@antfu/ni": "^0.21.4",
48+
"@antfu/ni": "^23.2.0",
4949
"@babel/core": "^7.22.1",
5050
"@babel/parser": "^7.22.6",
5151
"@babel/plugin-transform-typescript": "^7.22.5",

packages/cli/src/utils/get-package-manager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import { detect } from "@antfu/ni"
22

33
export async function getPackageManager(
44
targetDir: string
5-
): Promise<"yarn" | "pnpm" | "bun" | "npm"> {
5+
): Promise<"yarn" | "pnpm" | "bun" | "npm" | "deno"> {
66
const packageManager = await detect({ programmatic: true, cwd: targetDir })
77

88
if (packageManager === "yarn@berry") return "yarn"
99
if (packageManager === "pnpm@6") return "pnpm"
1010
if (packageManager === "bun") return "bun"
11+
if (packageManager === "deno") return "deno"
1112

1213
return packageManager ?? "npm"
1314
}

packages/shadcn/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"test:dev": "REGISTRY_URL=http://localhost:3333/r vitest run"
5656
},
5757
"dependencies": {
58-
"@antfu/ni": "^0.21.4",
58+
"@antfu/ni": "^23.2.0",
5959
"@babel/core": "^7.22.1",
6060
"@babel/parser": "^7.22.6",
6161
"@babel/plugin-transform-typescript": "^7.22.5",

packages/shadcn/src/utils/get-package-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ export async function getPackageManager(
55
{ withFallback }: { withFallback?: boolean } = {
66
withFallback: false,
77
}
8-
): Promise<"yarn" | "pnpm" | "bun" | "npm"> {
8+
): Promise<"yarn" | "pnpm" | "bun" | "npm" | "deno"> {
99
const packageManager = await detect({ programmatic: true, cwd: targetDir })
1010

1111
if (packageManager === "yarn@berry") return "yarn"
1212
if (packageManager === "pnpm@6") return "pnpm"
1313
if (packageManager === "bun") return "bun"
14-
14+
if (packageManager === "deno") return "deno"
1515
if (!withFallback) {
1616
return packageManager ?? "npm"
1717
}
1.25 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "test-cli-project-bun",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"author": "shadcn",
6+
"license": "MIT"
7+
}

packages/shadcn/test/utils/get-package-manager.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ test("get package manager", async () => {
2020
await getPackageManager(path.resolve(__dirname, "../fixtures/project-bun"))
2121
).toBe("bun")
2222

23+
expect(
24+
await getPackageManager(
25+
path.resolve(__dirname, "../fixtures/project-bun-lock")
26+
)
27+
).toBe("bun")
28+
2329
expect(
2430
await getPackageManager(path.resolve(__dirname, "../fixtures/next"))
2531
).toBe("pnpm")

pnpm-lock.yaml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)