From b5beffc11909f2c387ce38755e80db43d222819c Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 10 Jan 2025 17:09:51 +0000 Subject: [PATCH] perf(nuxt): use lighter `@nuxt/cli` dependency (#30526) --- packages/nuxt/bin/nuxt.mjs | 2 +- packages/nuxt/build.config.ts | 2 +- packages/nuxt/package.json | 2 +- packages/nuxt/src/core/features.ts | 2 +- pnpm-lock.yaml | 59 +++++++++++++++++++++++++----- 5 files changed, 54 insertions(+), 13 deletions(-) diff --git a/packages/nuxt/bin/nuxt.mjs b/packages/nuxt/bin/nuxt.mjs index 7faab34846..8c0237f4ee 100755 --- a/packages/nuxt/bin/nuxt.mjs +++ b/packages/nuxt/bin/nuxt.mjs @@ -1,2 +1,2 @@ #!/usr/bin/env node -import 'nuxi/cli' +import '@nuxt/cli/cli' diff --git a/packages/nuxt/build.config.ts b/packages/nuxt/build.config.ts index 1f8a82cf20..4301b165fb 100644 --- a/packages/nuxt/build.config.ts +++ b/packages/nuxt/build.config.ts @@ -22,7 +22,7 @@ export default defineBuildConfig({ }, }, dependencies: [ - 'nuxi', + '@nuxt/cli', 'vue-router', 'ofetch', ], diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 682af64405..5d8d666f56 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -64,6 +64,7 @@ "test:attw": "attw --pack" }, "dependencies": { + "@nuxt/cli": "^3.20.0", "@nuxt/devalue": "^2.0.2", "@nuxt/devtools": "^1.7.0", "@nuxt/kit": "workspace:*", @@ -100,7 +101,6 @@ "mlly": "^1.7.3", "nanotar": "^0.1.1", "nitro": "npm:nitro-nightly@3.0.0-beta-28796231.359af68d", - "nuxi": "^3.18.2", "nypm": "^0.4.1", "ofetch": "^1.4.1", "ohash": "^1.1.4", diff --git a/packages/nuxt/src/core/features.ts b/packages/nuxt/src/core/features.ts index 6e22d04bff..d19b4021c0 100644 --- a/packages/nuxt/src/core/features.ts +++ b/packages/nuxt/src/core/features.ts @@ -53,7 +53,7 @@ export function installNuxtModule (name: string, options?: EnsurePackageInstalle installPrompts.add(name) const nuxt = useNuxt() return promptToInstall(name, async () => { - const { runCommand } = await import('nuxi') + const { runCommand } = await import('@nuxt/cli') await runCommand('module', ['add', name, '--cwd', nuxt.options.rootDir]) }, { rootDir: nuxt.options.rootDir, searchPaths: nuxt.options.modulesDir, ...options }) } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 10dc6ea671..d0ded9f22a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -279,6 +279,9 @@ importers: packages/nuxt: dependencies: + '@nuxt/cli': + specifier: ^3.20.0 + version: 3.20.0(magicast@0.3.5) '@nuxt/devalue': specifier: ^2.0.2 version: 2.0.2 @@ -390,9 +393,6 @@ importers: nitro: specifier: npm:nitro-nightly@3.0.0-beta-28796231.359af68d version: nitro-nightly@3.0.0-beta-28796231.359af68d(typescript@5.7.3) - nuxi: - specifier: ^3.18.2 - version: 3.18.2 nypm: specifier: ^0.4.1 version: 0.4.1 @@ -477,7 +477,7 @@ importers: devDependencies: '@nuxt/scripts': specifier: 0.9.5 - version: 0.9.5(@nuxt/devtools@1.7.0(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3)))(@unocss/webpack@0.62.4(rollup@4.30.1)(webpack@5.97.1(esbuild@0.24.2)))(@vue/compiler-core@3.5.13)(change-case@5.4.4)(nuxt@packages+nuxt)(postcss@8.4.49)(rollup@4.30.1)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))(webpack@5.97.1(esbuild@0.24.2)) + version: 0.9.5(@nuxt/devtools@1.7.0(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3)))(@unocss/webpack@0.62.4(rollup@4.30.1)(webpack@5.97.1(esbuild@0.24.2)))(@vue/compiler-core@3.5.13)(change-case@5.4.4)(fuse.js@7.0.0)(nuxt@packages+nuxt)(postcss@8.4.49)(rollup@4.30.1)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))(webpack@5.97.1(esbuild@0.24.2)) '@parcel/watcher': specifier: 2.5.0 version: 2.5.0 @@ -1996,6 +1996,11 @@ packages: resolution: {integrity: sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + '@nuxt/cli@3.20.0': + resolution: {integrity: sha512-TmQPjIHXJFPTssPMMFuLF48nr9cm6ctaNwrnhDFl4xLunfLR4rrMJNJAQhepWyukg970ZgokZVbUYMqf6eCnTQ==} + engines: {node: ^16.10.0 || >=18.0.0} + hasBin: true + '@nuxt/devalue@2.0.2': resolution: {integrity: sha512-GBzP8zOc7CGWyFQS6dv1lQz8VVpz5C2yRszbXufwG/9zhStTIH50EtD87NmWbTMwXDvZLNg8GIpb1UFdH93JCA==} @@ -4518,6 +4523,10 @@ packages: functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + fuse.js@7.0.0: + resolution: {integrity: sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q==} + engines: {node: '>=10'} + gauge@3.0.2: resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} engines: {node: '>=10'} @@ -8656,6 +8665,35 @@ snapshots: '@npmcli/name-from-folder@2.0.0': {} + '@nuxt/cli@3.20.0(magicast@0.3.5)': + dependencies: + c12: 2.0.1(magicast@0.3.5) + chokidar: 4.0.3 + citty: 0.1.6 + clipboardy: 4.0.0 + consola: 3.3.3 + defu: 6.1.4 + fuse.js: 7.0.0 + giget: 1.2.3 + h3: h3-nightly@2.0.0-1718872656.6765a6e + httpxy: 0.1.5 + jiti: 2.4.2 + listhen: 1.9.0 + nypm: 0.4.1 + ofetch: 1.4.1 + ohash: 1.1.4 + pathe: 2.0.1 + perfect-debounce: 1.0.0 + pkg-types: 1.3.0 + scule: 1.3.0 + semver: 7.6.3 + std-env: 3.8.0 + tinyexec: 0.3.2 + ufo: 1.5.4 + transitivePeerDependencies: + - magicast + - uWebSockets.js + '@nuxt/devalue@2.0.2': {} '@nuxt/devtools-kit@1.5.1(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))': @@ -8672,7 +8710,7 @@ snapshots: execa: 7.2.0 vite: 6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1) - '@nuxt/devtools-ui-kit@1.5.1(@nuxt/devtools@1.7.0(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3)))(@unocss/webpack@0.62.4(rollup@4.30.1)(webpack@5.97.1(esbuild@0.24.2)))(@vue/compiler-core@3.5.13)(change-case@5.4.4)(nuxt@packages+nuxt)(postcss@8.4.49)(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))(webpack@5.97.1(esbuild@0.24.2))': + '@nuxt/devtools-ui-kit@1.5.1(@nuxt/devtools@1.7.0(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3)))(@unocss/webpack@0.62.4(rollup@4.30.1)(webpack@5.97.1(esbuild@0.24.2)))(@vue/compiler-core@3.5.13)(change-case@5.4.4)(fuse.js@7.0.0)(nuxt@packages+nuxt)(postcss@8.4.49)(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))(webpack@5.97.1(esbuild@0.24.2))': dependencies: '@iconify-json/carbon': 1.2.1 '@iconify-json/logos': 1.2.0 @@ -8688,7 +8726,7 @@ snapshots: '@unocss/preset-mini': 0.62.4 '@unocss/reset': 0.62.4 '@vueuse/core': 11.1.0(vue@3.5.13(typescript@5.7.3)) - '@vueuse/integrations': 11.1.0(change-case@5.4.4)(focus-trap@7.6.0)(vue@3.5.13(typescript@5.7.3)) + '@vueuse/integrations': 11.1.0(change-case@5.4.4)(focus-trap@7.6.0)(fuse.js@7.0.0)(vue@3.5.13(typescript@5.7.3)) '@vueuse/nuxt': 11.1.0(nuxt@packages+nuxt)(vue@3.5.13(typescript@5.7.3)) defu: 6.1.4 focus-trap: 7.6.0 @@ -8823,10 +8861,10 @@ snapshots: string-width: 4.2.3 webpack: 5.97.1 - '@nuxt/scripts@0.9.5(@nuxt/devtools@1.7.0(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3)))(@unocss/webpack@0.62.4(rollup@4.30.1)(webpack@5.97.1(esbuild@0.24.2)))(@vue/compiler-core@3.5.13)(change-case@5.4.4)(nuxt@packages+nuxt)(postcss@8.4.49)(rollup@4.30.1)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))(webpack@5.97.1(esbuild@0.24.2))': + '@nuxt/scripts@0.9.5(@nuxt/devtools@1.7.0(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3)))(@unocss/webpack@0.62.4(rollup@4.30.1)(webpack@5.97.1(esbuild@0.24.2)))(@vue/compiler-core@3.5.13)(change-case@5.4.4)(fuse.js@7.0.0)(nuxt@packages+nuxt)(postcss@8.4.49)(rollup@4.30.1)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))(webpack@5.97.1(esbuild@0.24.2))': dependencies: '@nuxt/devtools-kit': 1.7.0(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1)) - '@nuxt/devtools-ui-kit': 1.5.1(@nuxt/devtools@1.7.0(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3)))(@unocss/webpack@0.62.4(rollup@4.30.1)(webpack@5.97.1(esbuild@0.24.2)))(@vue/compiler-core@3.5.13)(change-case@5.4.4)(nuxt@packages+nuxt)(postcss@8.4.49)(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))(webpack@5.97.1(esbuild@0.24.2)) + '@nuxt/devtools-ui-kit': 1.5.1(@nuxt/devtools@1.7.0(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3)))(@unocss/webpack@0.62.4(rollup@4.30.1)(webpack@5.97.1(esbuild@0.24.2)))(@vue/compiler-core@3.5.13)(change-case@5.4.4)(fuse.js@7.0.0)(nuxt@packages+nuxt)(postcss@8.4.49)(rollup@4.30.1)(vite@6.0.7(@types/node@22.10.5)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))(webpack@5.97.1(esbuild@0.24.2)) '@nuxt/kit': link:packages/kit '@stripe/stripe-js': 4.8.0 '@types/google.maps': 3.58.1 @@ -10385,7 +10423,7 @@ snapshots: - '@vue/composition-api' - vue - '@vueuse/integrations@11.1.0(change-case@5.4.4)(focus-trap@7.6.0)(vue@3.5.13(typescript@5.7.3))': + '@vueuse/integrations@11.1.0(change-case@5.4.4)(focus-trap@7.6.0)(fuse.js@7.0.0)(vue@3.5.13(typescript@5.7.3))': dependencies: '@vueuse/core': 11.1.0(vue@3.5.13(typescript@5.7.3)) '@vueuse/shared': 11.1.0(vue@3.5.13(typescript@5.7.3)) @@ -10393,6 +10431,7 @@ snapshots: optionalDependencies: change-case: 5.4.4 focus-trap: 7.6.0 + fuse.js: 7.0.0 transitivePeerDependencies: - '@vue/composition-api' - vue @@ -11929,6 +11968,8 @@ snapshots: functions-have-names@1.2.3: {} + fuse.js@7.0.0: {} + gauge@3.0.2: dependencies: aproba: 2.0.0