Skip to content

Commit

Permalink
feat: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jul 2, 2024
1 parent d352d02 commit 9d680a9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 32 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@
"eslint": "^9.6.0",
"esno": "^4.7.0",
"fast-glob": "^3.3.2",
"fast-npm-meta": "^0.1.0",
"fast-npm-meta": "^0.1.1",
"npm-package-arg": "^11.0.2",
"picocolors": "^1.0.1",
"prompts": "^2.4.2",
"rimraf": "^5.0.7",
"semver": "^7.6.2",
"ufo": "^1.5.3",
"taze": "workspace:*",
"typescript": "^5.5.3",
"ufo": "^1.5.3",
"unbuild": "^2.0.0",
"vitest": "^1.6.0"
}
Expand Down
50 changes: 24 additions & 26 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/utils/packument.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import process from 'node:process'
import { joinURL } from 'ufo'
import { $fetch } from 'ofetch'
import { $fetch, fetch } from 'ofetch'
import { getVersions, pickRegistry } from 'fast-npm-meta'
import type { PackageData } from '../types'

Expand Down Expand Up @@ -37,10 +37,10 @@ export async function fetchPackage(spec: string, npmConfigs: Record<string, unkn
if (!name)
throw new Error(`Invalid package name: ${name}`)

const registry = pickRegistry(scope || '', npmConfigs as any)
const registry = pickRegistry(scope, npmConfigs)

if (registry === NPM_REGISTRY) {
const data = await getVersions(spec)
const data = await getVersions(spec, { fetch })
return {
tags: data.distTags,
versions: data.versions,
Expand All @@ -53,7 +53,7 @@ export async function fetchPackage(spec: string, npmConfigs: Record<string, unkn
headers: {
'user-agent': `taze@npm node/${process.version}`,
'accept': 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
...npmConfigs.headers,
...npmConfigs.headers as any,
},
}) as unknown as Packument

Expand Down

0 comments on commit 9d680a9

Please sign in to comment.