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>
This commit is contained in:
Pálmi Þór Valgeirsson
2025-02-11 08:46:53 +00:00
committed by GitHub
parent 7977975c9d
commit 202131cd7b
9 changed files with 33 additions and 14 deletions

View File

@@ -0,0 +1,5 @@
---
"shadcn": patch
---
upgrade @antfu/ni

View File

@@ -45,7 +45,7 @@
"test:dev": "REGISTRY_URL=http://localhost:3333 vitest run"
},
"dependencies": {
"@antfu/ni": "^0.21.4",
"@antfu/ni": "^23.2.0",
"@babel/core": "^7.22.1",
"@babel/parser": "^7.22.6",
"@babel/plugin-transform-typescript": "^7.22.5",

View File

@@ -2,12 +2,13 @@ import { detect } from "@antfu/ni"
export async function getPackageManager(
targetDir: string
): Promise<"yarn" | "pnpm" | "bun" | "npm"> {
): Promise<"yarn" | "pnpm" | "bun" | "npm" | "deno"> {
const packageManager = await detect({ programmatic: true, cwd: targetDir })
if (packageManager === "yarn@berry") return "yarn"
if (packageManager === "pnpm@6") return "pnpm"
if (packageManager === "bun") return "bun"
if (packageManager === "deno") return "deno"
return packageManager ?? "npm"
}

View File

@@ -55,7 +55,7 @@
"test:dev": "REGISTRY_URL=http://localhost:3333/r vitest run"
},
"dependencies": {
"@antfu/ni": "^0.21.4",
"@antfu/ni": "^23.2.0",
"@babel/core": "^7.22.1",
"@babel/parser": "^7.22.6",
"@babel/plugin-transform-typescript": "^7.22.5",

View File

@@ -5,13 +5,13 @@ export async function getPackageManager(
{ withFallback }: { withFallback?: boolean } = {
withFallback: false,
}
): Promise<"yarn" | "pnpm" | "bun" | "npm"> {
): Promise<"yarn" | "pnpm" | "bun" | "npm" | "deno"> {
const packageManager = await detect({ programmatic: true, cwd: targetDir })
if (packageManager === "yarn@berry") return "yarn"
if (packageManager === "pnpm@6") return "pnpm"
if (packageManager === "bun") return "bun"
if (packageManager === "deno") return "deno"
if (!withFallback) {
return packageManager ?? "npm"
}

Binary file not shown.

View File

@@ -0,0 +1,7 @@
{
"name": "test-cli-project-bun",
"version": "1.0.0",
"main": "index.js",
"author": "shadcn",
"license": "MIT"
}

View File

@@ -20,6 +20,12 @@ test("get package manager", async () => {
await getPackageManager(path.resolve(__dirname, "../fixtures/project-bun"))
).toBe("bun")
expect(
await getPackageManager(
path.resolve(__dirname, "../fixtures/project-bun-lock")
)
).toBe("bun")
expect(
await getPackageManager(path.resolve(__dirname, "../fixtures/next"))
).toBe("pnpm")

18
pnpm-lock.yaml generated
View File

@@ -606,8 +606,8 @@ importers:
packages/cli:
dependencies:
'@antfu/ni':
specifier: ^0.21.4
version: 0.21.12
specifier: ^23.2.0
version: 23.3.1
'@babel/core':
specifier: ^7.22.1
version: 7.26.7
@@ -697,8 +697,8 @@ importers:
packages/shadcn:
dependencies:
'@antfu/ni':
specifier: ^0.21.4
version: 0.21.12
specifier: ^23.2.0
version: 23.3.1
'@babel/core':
specifier: ^7.22.1
version: 7.26.7
@@ -801,8 +801,8 @@ packages:
resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==}
engines: {node: '>=6.0.0'}
'@antfu/ni@0.21.12':
resolution: {integrity: sha512-2aDL3WUv8hMJb2L3r/PIQWsTLyq7RQr3v9xD16fiz6O8ys1xEyLhhTOv8gxtZvJiTzjTF5pHoArvRdesGL1DMQ==}
'@antfu/ni@23.3.1':
resolution: {integrity: sha512-C90iyzm/jLV7Lomv2UzwWUzRv9WZr1oRsFRKsX5HjQL4EXrbi9H/RtBkjCP+NF+ABZXUKpAa4F1dkoTaea4zHg==}
hasBin: true
'@babel/code-frame@7.26.2':
@@ -8108,7 +8108,7 @@ snapshots:
'@jridgewell/gen-mapping': 0.3.5
'@jridgewell/trace-mapping': 0.3.25
'@antfu/ni@0.21.12': {}
'@antfu/ni@23.3.1': {}
'@babel/code-frame@7.26.2':
dependencies:
@@ -8509,7 +8509,7 @@ snapshots:
'@types/node': 20.5.1
chalk: 4.1.2
cosmiconfig: 8.3.6(typescript@5.7.3)
cosmiconfig-typescript-loader: 4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.7.3))(ts-node@10.9.2(@types/node@20.17.16)(typescript@5.7.3))(typescript@5.7.3)
cosmiconfig-typescript-loader: 4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.7.3))(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.7.3))(typescript@5.7.3)
lodash.isplainobject: 4.0.6
lodash.merge: 4.6.2
lodash.uniq: 4.5.0
@@ -12055,7 +12055,7 @@ snapshots:
core-util-is@1.0.3: {}
cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.7.3))(ts-node@10.9.2(@types/node@20.17.16)(typescript@5.7.3))(typescript@5.7.3):
cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.7.3))(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.7.3))(typescript@5.7.3):
dependencies:
'@types/node': 20.5.1
cosmiconfig: 8.3.6(typescript@5.7.3)