Skip to content

Commit 3d74691

Browse files
committed
perf: avoid deps on npm-registry-fetch, save install size
1 parent 541c929 commit 3d74691

File tree

9 files changed

+1448
-1409
lines changed

9 files changed

+1448
-1409
lines changed

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
},
1010
"dependencies": {
1111
"@iconify-json/ph": "^1.1.13",
12-
"@iconify-json/simple-icons": "^1.1.107",
12+
"@iconify-json/simple-icons": "^1.1.108",
1313
"@nuxt/content": "^2.13.0",
1414
"@nuxt/devtools": "1.3.1",
1515
"@nuxt/fonts": "^0.7.1",
1616
"@nuxt/image": "1.7.0",
1717
"@nuxt/ui-pro": "^1.3.1",
18-
"@nuxthq/studio": "^2.0.2",
18+
"@nuxthq/studio": "^2.0.3",
1919
"@nuxtjs/plausible": "^1.0.0",
2020
"@vueuse/core": "^10.11.0",
2121
"@vueuse/nuxt": "^10.11.0",

docs/pnpm-lock.yaml

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

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"prepare": "pnpm -r --filter=\"./packages/*\" run dev:prepare"
2424
},
2525
"devDependencies": {
26-
"@antfu/eslint-config": "^2.21.1",
26+
"@antfu/eslint-config": "^2.21.2",
2727
"@antfu/ni": "^0.21.12",
2828
"@nuxt/devtools": "workspace:*",
2929
"@nuxt/devtools-ui-kit": "workspace:*",
@@ -36,22 +36,22 @@
3636
"@unocss/eslint-config": "^0.61.0",
3737
"bumpp": "^9.4.1",
3838
"conventional-changelog-cli": "^5.0.0",
39-
"eslint": "^9.5.0",
39+
"eslint": "^9.6.0",
4040
"eslint-plugin-format": "^0.1.2",
4141
"esno": "^4.7.0",
4242
"execa": "^7.2.0",
4343
"lint-staged": "^15.2.7",
4444
"nuxt": "^3.12.2",
4545
"pathe": "^1.1.2",
4646
"simple-git-hooks": "^2.11.1",
47-
"taze": "^0.13.9",
47+
"taze": "^0.14.0",
4848
"tiged": "^2.12.7",
49-
"typescript": "^5.5.2",
49+
"typescript": "^5.5.3",
5050
"ua-parser-js": "^1.0.38",
5151
"unocss": "^0.61.0",
5252
"vite-hot-client": "^0.2.3",
53-
"vue": "^3.4.30",
54-
"vue-tsc": "^2.0.22"
53+
"vue": "^3.4.31",
54+
"vue-tsc": "^2.0.24"
5555
},
5656
"simple-git-hooks": {
5757
"pre-commit": "npx lint-staged"

packages/devtools-wizard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"global-directory": "^4.0.1",
3232
"magicast": "^0.3.4",
3333
"pathe": "^1.1.2",
34-
"pkg-types": "^1.1.1",
34+
"pkg-types": "^1.1.2",
3535
"prompts": "^2.4.2",
3636
"rc9": "^2.1.2",
3737
"semver": "^7.6.2"

packages/devtools/package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"error-stack-parser-es": "^0.1.4",
5656
"execa": "^7.2.0",
5757
"fast-glob": "^3.3.2",
58+
"fast-npm-meta": "^0.1.1",
5859
"flatted": "^3.3.1",
5960
"get-port-please": "^3.1.2",
6061
"hookable": "^5.5.3",
@@ -63,12 +64,11 @@
6364
"launch-editor": "^2.8.0",
6465
"local-pkg": "^0.5.0",
6566
"magicast": "^0.3.4",
66-
"npm-registry-fetch": "^17.1.0",
67-
"nypm": "^0.3.8",
67+
"nypm": "^0.3.9",
6868
"ohash": "^1.1.3",
6969
"pathe": "^1.1.2",
7070
"perfect-debounce": "^1.0.0",
71-
"pkg-types": "^1.1.1",
71+
"pkg-types": "^1.1.2",
7272
"rc9": "^2.1.2",
7373
"scule": "^1.3.0",
7474
"semver": "^7.6.2",
@@ -85,14 +85,13 @@
8585
"@iconify-json/carbon": "^1.1.36",
8686
"@iconify-json/logos": "^1.1.43",
8787
"@iconify-json/ri": "^1.1.21",
88-
"@iconify-json/simple-icons": "^1.1.107",
88+
"@iconify-json/simple-icons": "^1.1.108",
8989
"@iconify-json/tabler": "^1.1.115",
9090
"@nuxt/content": "^2.13.0",
9191
"@nuxt/devtools": "workspace:*",
9292
"@nuxt/test-utils": "3.9.0",
9393
"@parcel/watcher": "^2.4.1",
9494
"@types/markdown-it-link-attributes": "^3.0.5",
95-
"@types/npm-registry-fetch": "^8.0.7",
9695
"@types/ua-parser-js": "^0.7.39",
9796
"@unocss/nuxt": "^0.61.0",
9897
"@unocss/preset-icons": "^0.61.0",
@@ -108,19 +107,19 @@
108107
"markdown-it": "^14.1.0",
109108
"markdown-it-link-attributes": "^4.0.1",
110109
"nanoid": "^5.0.7",
111-
"nitropack": "^2.9.6",
110+
"nitropack": "^2.9.7",
112111
"nuxt": "^3.12.2",
113112
"ofetch": "^1.3.4",
114113
"quicktype-core": "^23.0.170",
115-
"shiki": "^1.9.1",
114+
"shiki": "^1.10.0",
116115
"theme-vitesse": "^0.8.0",
117116
"ua-parser-js": "^1.0.38",
118117
"unocss": "^0.61.0",
119118
"unplugin-vue-markdown": "^0.26.2",
120119
"vanilla-jsoneditor": "^0.23.7",
121120
"vis-data": "^7.1.9",
122121
"vis-network": "^9.1.9",
123-
"vue-tsc": "^2.0.22",
122+
"vue-tsc": "^2.0.24",
124123
"vue-virtual-scroller": "2.0.0-beta.8",
125124
"xterm": "^5.3.0",
126125
"xterm-addon-fit": "^0.8.0"

packages/devtools/src/npm/index.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { createRequire } from 'node:module'
22
import { logger, useNuxt } from '@nuxt/kit'
33
import { readPackageJSON } from 'pkg-types'
44
import semver from 'semver'
5-
import { joinURL } from 'ufo'
65
import { getPackageInfo } from 'local-pkg'
76
import type { PackageUpdateInfo } from '../types'
87

@@ -45,23 +44,15 @@ export async function checkForUpdateOf(name: string, current?: string, nuxt = us
4544
if (!current)
4645
return
4746

48-
const { pickRegistry, json: fetchMeta } = await import('npm-registry-fetch')
49-
const reg = pickRegistry(name)
50-
const manifest = await fetchMeta(joinURL(reg, name), {
51-
headers: {
52-
'user-agent': `npm node/${process.version}`,
53-
'accept': 'application/json',
54-
},
55-
spec: name,
56-
}) as unknown as Packument
47+
const { getLatestVersion } = await import('fast-npm-meta')
48+
const { version: latest } = await getLatestVersion(name)
5749

58-
const latest = manifest?.['dist-tags']?.latest
5950
const needsUpdate = !!latest && latest !== current && semver.lt(current, latest)
6051

6152
return {
6253
name,
6354
current,
64-
latest,
55+
latest: latest || current,
6556
needsUpdate,
6657
}
6758
}

playgrounds/module-starter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@nuxt/module-builder": "~0.6.0",
3434
"@nuxt/schema": "^3.12.2",
3535
"@nuxt/test-utils": "^3.13.1",
36-
"eslint": "^9.5.0",
36+
"eslint": "^9.6.0",
3737
"nuxt": "^3.12.2",
3838
"vitest": "^1.6.0"
3939
}

playgrounds/tab-pinia/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"devDependencies": {
1616
"@exampledev/new.css": "^1.1.3",
17-
"cypress": "^13.12.0",
17+
"cypress": "^13.13.0",
1818
"nuxt": "^3.12.2"
1919
}
2020
}

0 commit comments

Comments
 (0)