From 22cd4770c1748f1adda46ee2f09e2277d6e1d8fa Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Jun 2024 17:16:26 +0100 Subject: [PATCH 01/31] fix(nuxt): ensure payload script executes before entry (#27506) --- packages/nuxt/src/core/runtime/nitro/renderer.ts | 3 +++ test/bundle.test.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index ebd84414a..4fc1f2839 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -455,6 +455,9 @@ export default defineRenderHandler(async (event): Promise Date: Mon, 10 Jun 2024 18:18:00 +0200 Subject: [PATCH 02/31] fix(kit): avoid fallback to normalized path in module loading (#27507) --- packages/kit/src/module/install.ts | 2 +- packages/kit/src/resolve.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/kit/src/module/install.ts b/packages/kit/src/module/install.ts index d283388a6..153aab0bd 100644 --- a/packages/kit/src/module/install.ts +++ b/packages/kit/src/module/install.ts @@ -84,7 +84,7 @@ export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, n let error: unknown for (const path of paths) { try { - const src = await resolvePath(path) + const src = await resolvePath(path, { fallbackToOriginal: true }) // Prefer ESM resolution if possible nuxtModule = await importModule(src, nuxt.options.modulesDir).catch(() => null) ?? requireModule(src, { paths: nuxt.options.modulesDir }) diff --git a/packages/kit/src/resolve.ts b/packages/kit/src/resolve.ts index 8bdf0693c..392dec86d 100644 --- a/packages/kit/src/resolve.ts +++ b/packages/kit/src/resolve.ts @@ -23,6 +23,13 @@ export interface ResolvePathOptions { * @default false */ virtual?: boolean + + /** + * Whether to fallback to the original path if the resolved path does not exist instead of returning the normalized input path. + * + * @default false + */ + fallbackToOriginal?: boolean } /** @@ -99,7 +106,7 @@ export async function resolvePath (path: string, opts: ResolvePathOptions = {}): } // Return normalized input - return path + return opts.fallbackToOriginal ? _path : path } /** From 0536dbeed9d77e9d4840fc0dcf84df9166c3c615 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Jun 2024 17:24:43 +0100 Subject: [PATCH 03/31] fix(nuxt): also augment page metadata after `pages:extend` hook (#27134) --- .../1.experimental-features.md | 4 +- packages/nuxt/src/pages/module.ts | 16 ++++---- packages/nuxt/src/pages/utils.ts | 40 ++++++++++++++----- packages/nuxt/test/pages.test.ts | 7 ++-- packages/schema/src/config/experimental.ts | 2 +- 5 files changed, 45 insertions(+), 24 deletions(-) diff --git a/docs/2.guide/3.going-further/1.experimental-features.md b/docs/2.guide/3.going-further/1.experimental-features.md index 691a2187c..9105b2ebf 100644 --- a/docs/2.guide/3.going-further/1.experimental-features.md +++ b/docs/2.guide/3.going-further/1.experimental-features.md @@ -386,7 +386,7 @@ This option allows exposing some route metadata defined in `definePageMeta` at b This only works with static or strings/arrays rather than variables or conditional assignment. See [original issue](https://github.com/nuxt/nuxt/issues/24770) for more information and context. - +``` ## cookieStore diff --git a/packages/nuxt/src/pages/module.ts b/packages/nuxt/src/pages/module.ts index ee5b8c1c7..ae80fd4e0 100644 --- a/packages/nuxt/src/pages/module.ts +++ b/packages/nuxt/src/pages/module.ts @@ -61,8 +61,12 @@ export default defineNuxtModule({ } const pages = await resolvePagesRoutes() - await nuxt.callHook('pages:extend', pages) - if (pages.length) { return true } + if (pages.length) { + if (nuxt.apps.default) { + nuxt.apps.default.pages = pages + } + return true + } return false } @@ -75,7 +79,6 @@ export default defineNuxtModule({ nuxt.hook('app:templates', async (app) => { app.pages = await resolvePagesRoutes() - await nuxt.callHook('pages:extend', app.pages) if (!nuxt.options.ssr && app.pages.some(p => p.mode === 'server')) { logger.warn('Using server pages with `ssr: false` is not supported with auto-detected component islands. Set `experimental.componentIslands` to `true`.') @@ -153,10 +156,9 @@ export default defineNuxtModule({ logs: nuxt.options.debug, async beforeWriteFiles (rootPage) { rootPage.children.forEach(child => child.delete()) - let pages = nuxt.apps.default?.pages - if (!pages) { - pages = await resolvePagesRoutes() - await nuxt.callHook('pages:extend', pages) + const pages = nuxt.apps.default?.pages || await resolvePagesRoutes() + if (nuxt.apps.default) { + nuxt.apps.default.pages = pages } function addPage (parent: EditableTreeNode, page: NuxtPage) { // @ts-expect-error TODO: either fix types upstream or figure out another diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index 9bd65069f..79e0321e9 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -58,21 +58,30 @@ export async function resolvePagesRoutes (): Promise { scannedFiles.sort((a, b) => a.relativePath.localeCompare(b.relativePath, 'en-US')) const allRoutes = await generateRoutesFromFiles(uniqueBy(scannedFiles, 'relativePath'), { - shouldExtractBuildMeta: nuxt.options.experimental.scanPageMeta || nuxt.options.experimental.typedPages, shouldUseServerComponents: !!nuxt.options.experimental.componentIslands, - vfs: nuxt.vfs, }) - return uniqueBy(allRoutes, 'path') + const pages = uniqueBy(allRoutes, 'path') + + const shouldAugment = nuxt.options.experimental.scanPageMeta || nuxt.options.experimental.typedPages + + if (shouldAugment) { + const augmentedPages = await augmentPages(pages, nuxt.vfs) + await nuxt.callHook('pages:extend', pages) + await augmentPages(pages, nuxt.vfs, augmentedPages) + augmentedPages.clear() + } else { + await nuxt.callHook('pages:extend', pages) + } + + return pages } type GenerateRoutesFromFilesOptions = { - shouldExtractBuildMeta?: boolean shouldUseServerComponents?: boolean - vfs?: Record } -export async function generateRoutesFromFiles (files: ScannedFile[], options: GenerateRoutesFromFilesOptions = {}): Promise { +export function generateRoutesFromFiles (files: ScannedFile[], options: GenerateRoutesFromFilesOptions = {}): NuxtPage[] { const routes: NuxtPage[] = [] for (const file of files) { @@ -124,17 +133,26 @@ export async function generateRoutesFromFiles (files: ScannedFile[], options: Ge } } - if (options.shouldExtractBuildMeta && options.vfs) { - const fileContent = file.absolutePath in options.vfs ? options.vfs[file.absolutePath] : fs.readFileSync(file.absolutePath, 'utf-8') - Object.assign(route, await getRouteMeta(fileContent, file.absolutePath)) - } - parent.push(route) } return prepareRoutes(routes) } +export async function augmentPages (routes: NuxtPage[], vfs: Record, augmentedPages = new Set()) { + for (const route of routes) { + if (!augmentedPages.has(route) && route.file) { + const fileContent = route.file in vfs ? vfs[route.file] : fs.readFileSync(route.file, 'utf-8') + Object.assign(route, await getRouteMeta(fileContent, route.file)) + } + + if (route.children && route.children.length > 0) { + await augmentPages(route.children, vfs) + } + } + return augmentedPages +} + const SFC_SCRIPT_RE = /]*>([\s\S]*?)<\/script[^>]*>/i export function extractScriptContent (html: string) { const match = html.match(SFC_SCRIPT_RE) diff --git a/packages/nuxt/test/pages.test.ts b/packages/nuxt/test/pages.test.ts index 36d996d63..3babb4cf1 100644 --- a/packages/nuxt/test/pages.test.ts +++ b/packages/nuxt/test/pages.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import type { NuxtPage } from 'nuxt/schema' -import { generateRoutesFromFiles, normalizeRoutes, pathToNitroGlob } from '../src/pages/utils' +import { augmentPages, generateRoutesFromFiles, normalizeRoutes, pathToNitroGlob } from '../src/pages/utils' import { generateRouteKey } from '../src/pages/runtime/utils' describe('pages:generateRoutesFromFiles', () => { @@ -568,11 +568,12 @@ describe('pages:generateRoutesFromFiles', () => { ) as Record try { - result = await generateRoutesFromFiles(test.files.map(file => ({ + result = generateRoutesFromFiles(test.files.map(file => ({ shouldUseServerComponents: true, absolutePath: file.path, relativePath: file.path.replace(/^(pages|layer\/pages)\//, ''), - })), { shouldExtractBuildMeta: true, vfs }) + }))) + await augmentPages(result, vfs) } catch (error: any) { expect(error.message).toEqual(test.error) } diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index bf984023f..b80f0beca 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -378,7 +378,7 @@ export default defineUntypedSchema({ * * https://github.com/nuxt/nuxt/issues/24770 */ - scanPageMeta: false, + scanPageMeta: true, /** * Automatically share payload _data_ between pages that are prerendered. This can result in a significant From 7d48d98f62e3b0639a19a9677703f3f7f8593776 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Jun 2024 18:30:09 +0100 Subject: [PATCH 04/31] chore: upgrade `jiti` (#27479) Co-authored-by: Pooya Parsa --- package.json | 2 +- packages/kit/package.json | 2 +- packages/nuxt/package.json | 2 +- packages/ui-templates/package.json | 2 +- pnpm-lock.yaml | 40 +++++++++++++++--------------- renovate.json | 1 - 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index f2e2fa576..fedac84b5 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "globby": "14.0.1", "h3": "1.11.1", "happy-dom": "14.12.0", - "jiti": "1.21.0", + "jiti": "1.21.6", "markdownlint-cli": "0.41.0", "nitropack": "2.9.6", "nuxi": "3.11.1", diff --git a/packages/kit/package.json b/packages/kit/package.json index d98f585ad..0a3ea10f6 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -34,7 +34,7 @@ "globby": "^14.0.1", "hash-sum": "^2.0.0", "ignore": "^5.3.1", - "jiti": "^1.21.0", + "jiti": "^1.21.6", "klona": "^2.0.6", "knitwork": "^1.1.0", "mlly": "^1.7.1", diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 03655cacd..2c1f965af 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -84,7 +84,7 @@ "h3": "^1.11.1", "hookable": "^5.5.3", "ignore": "^5.3.1", - "jiti": "^1.21.0", + "jiti": "^1.21.6", "klona": "^2.0.6", "knitwork": "^1.1.0", "magic-string": "^0.30.10", diff --git a/packages/ui-templates/package.json b/packages/ui-templates/package.json index 68db032be..131114835 100644 --- a/packages/ui-templates/package.json +++ b/packages/ui-templates/package.json @@ -26,7 +26,7 @@ "execa": "9.2.0", "globby": "14.0.1", "html-minifier": "4.0.0", - "jiti": "1.21.0", + "jiti": "1.21.6", "knitwork": "1.1.0", "lodash-es": "4.17.21", "pathe": "1.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 67f8d4b96..9342495df 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -102,8 +102,8 @@ importers: specifier: 14.12.0 version: 14.12.0 jiti: - specifier: 1.21.0 - version: 1.21.0 + specifier: 1.21.6 + version: 1.21.6 markdownlint-cli: specifier: 0.41.0 version: 0.41.0 @@ -186,8 +186,8 @@ importers: specifier: ^5.3.1 version: 5.3.1 jiti: - specifier: ^1.21.0 - version: 1.21.0 + specifier: ^1.21.6 + version: 1.21.6 klona: specifier: ^2.0.6 version: 2.0.6 @@ -331,8 +331,8 @@ importers: specifier: ^5.3.1 version: 5.3.1 jiti: - specifier: ^1.21.0 - version: 1.21.0 + specifier: ^1.21.6 + version: 1.21.6 klona: specifier: ^2.0.6 version: 2.0.6 @@ -597,8 +597,8 @@ importers: specifier: 4.0.0 version: 4.0.0 jiti: - specifier: 1.21.0 - version: 1.21.0 + specifier: 1.21.6 + version: 1.21.6 knitwork: specifier: 1.1.0 version: 1.1.0 @@ -4974,8 +4974,8 @@ packages: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - jiti@1.21.0: - resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} + jiti@1.21.6: + resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} hasBin: true js-beautify@1.14.9: @@ -8690,7 +8690,7 @@ snapshots: dotenv: 16.4.5 git-url-parse: 14.0.0 is-docker: 3.0.0 - jiti: 1.21.0 + jiti: 1.21.6 mri: 1.2.0 nanoid: 5.0.7 ofetch: 1.3.4 @@ -10296,7 +10296,7 @@ snapshots: defu: 6.1.4 dotenv: 16.4.5 giget: 1.2.1 - jiti: 1.21.0 + jiti: 1.21.6 mlly: 1.7.1 ohash: 1.1.3 pathe: 1.1.2 @@ -12105,7 +12105,7 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jiti@1.21.0: {} + jiti@1.21.6: {} js-beautify@1.14.9: dependencies: @@ -12218,7 +12218,7 @@ snapshots: get-port-please: 3.1.2 h3: 1.11.1 http-shutdown: 1.2.2 - jiti: 1.21.0 + jiti: 1.21.6 mlly: 1.7.1 node-forge: 1.3.1 pathe: 1.1.2 @@ -12806,7 +12806,7 @@ snapshots: esbuild: 0.18.20 fs-extra: 11.2.0 globby: 13.2.2 - jiti: 1.21.0 + jiti: 1.21.6 mlly: 1.7.1 mri: 1.2.0 pathe: 1.1.2 @@ -12885,7 +12885,7 @@ snapshots: httpxy: 0.1.5 ioredis: 5.3.2 is-primitive: 3.0.1 - jiti: 1.21.0 + jiti: 1.21.6 klona: 2.0.6 knitwork: 1.1.0 listhen: 1.7.2 @@ -13394,7 +13394,7 @@ snapshots: postcss-loader@8.1.1(postcss@8.4.38)(typescript@5.4.5)(webpack@5.91.0): dependencies: cosmiconfig: 9.0.0(typescript@5.4.5) - jiti: 1.21.0 + jiti: 1.21.6 postcss: 8.4.38 semver: 7.6.2 optionalDependencies: @@ -14469,7 +14469,7 @@ snapshots: esbuild: 0.19.11 globby: 13.2.2 hookable: 5.5.3 - jiti: 1.21.0 + jiti: 1.21.6 magic-string: 0.30.10 mkdist: 1.3.0(sass@1.69.4)(typescript@5.4.5) mlly: 1.7.1 @@ -14490,7 +14490,7 @@ snapshots: dependencies: '@antfu/utils': 0.7.8 defu: 6.1.4 - jiti: 1.21.0 + jiti: 1.21.6 uncrypto@0.1.3: {} @@ -14679,7 +14679,7 @@ snapshots: '@babel/standalone': 7.23.9 '@babel/types': 7.24.5 defu: 6.1.4 - jiti: 1.21.0 + jiti: 1.21.6 mri: 1.2.0 scule: 1.3.0 transitivePeerDependencies: diff --git a/renovate.json b/renovate.json index 232c4eeb9..974eeccfc 100644 --- a/renovate.json +++ b/renovate.json @@ -31,7 +31,6 @@ "main" ], "ignoreDeps": [ - "jiti", "@vitejs/plugin-vue", "nuxt", "nuxt3", From 1d34594b9e49177c968f41276f81c8a690febe4d Mon Sep 17 00:00:00 2001 From: Hendrik Heil Date: Mon, 10 Jun 2024 20:41:36 +0200 Subject: [PATCH 05/31] feat(nuxt): register plugin hooks before executing plugins (#27449) --- .../2.directory-structure/1.plugins.md | 3 +- packages/nuxt/src/app/nuxt.ts | 13 ++++++-- test/nuxt/plugin.test.ts | 31 +++++++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/docs/2.guide/2.directory-structure/1.plugins.md b/docs/2.guide/2.directory-structure/1.plugins.md index b525b1f4c..a30be3eac 100644 --- a/docs/2.guide/2.directory-structure/1.plugins.md +++ b/docs/2.guide/2.directory-structure/1.plugins.md @@ -81,8 +81,9 @@ Watch a video from Alexander Lichter about the Object Syntax for Nuxt plugins. :: ::note -If you are using the object-syntax, the properties may be statically analyzed in future to produce a more optimized build. So you should not define them at runtime. :br +If you are using the object-syntax, the properties are statically analyzed to produce a more optimized build. So you should not define them at runtime. :br For example, setting `enforce: import.meta.server ? 'pre' : 'post'` would defeat any future optimization Nuxt is able to do for your plugins. +Nuxt does statically pre-load any hook listeners when using object-syntax, allowing you to define hooks without needing to worry about order of plugin registration. :: ## Registration Order diff --git a/packages/nuxt/src/app/nuxt.ts b/packages/nuxt/src/app/nuxt.ts index 3339fff93..db062b6b5 100644 --- a/packages/nuxt/src/app/nuxt.ts +++ b/packages/nuxt/src/app/nuxt.ts @@ -387,11 +387,15 @@ export function createNuxtApp (options: CreateOptions) { return nuxtApp } -/** @since 3.0.0 */ -export async function applyPlugin (nuxtApp: NuxtApp, plugin: Plugin & ObjectPlugin) { +/** @since 3.12.0 */ +export function registerPluginHooks (nuxtApp: NuxtApp, plugin: Plugin & ObjectPlugin) { if (plugin.hooks) { nuxtApp.hooks.addHooks(plugin.hooks) } +} + +/** @since 3.0.0 */ +export async function applyPlugin (nuxtApp: NuxtApp, plugin: Plugin & ObjectPlugin) { if (typeof plugin === 'function') { const { provide } = await nuxtApp.runWithContext(() => plugin(nuxtApp)) || {} if (provide && typeof provide === 'object') { @@ -438,6 +442,11 @@ export async function applyPlugins (nuxtApp: NuxtApp, plugins: Array { ]) }) }) + +describe('plugin hooks', () => { + it('registers hooks before executing plugins', async () => { + const nuxtApp = useNuxtApp() + + const sequence: string[] = [] + const plugins = [ + defineNuxtPlugin({ + name: 'A', + setup (nuxt) { + sequence.push('start A') + nuxt.callHook('a:setup') + }, + }), + defineNuxtPlugin({ + name: 'B', + hooks: { + 'a:setup': () => { + sequence.push('listen B') + }, + }, + }), + ] + + await applyPlugins(nuxtApp, plugins) + expect(sequence).toMatchObject([ + 'start A', + 'listen B', + ]) + }) +}) From d3a6e8cfe25af62c1f304b5b737b5a632339a7b3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:41:49 +0100 Subject: [PATCH 06/31] chore(deps): update all non-major dependencies (main) (#27508) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +-- packages/nuxt/package.json | 2 +- packages/schema/package.json | 2 +- pnpm-lock.yaml | 49 ++++++++++++++++-------------------- 4 files changed, 26 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index fedac84b5..e3b0b4b30 100644 --- a/package.json +++ b/package.json @@ -90,10 +90,10 @@ "vitest": "1.6.0", "vitest-environment-nuxt": "1.0.0", "vue": "3.4.27", - "vue-router": "4.3.2", + "vue-router": "4.3.3", "vue-tsc": "2.0.21" }, - "packageManager": "pnpm@9.2.0", + "packageManager": "pnpm@9.3.0", "engines": { "node": "^16.10.0 || >=18.0.0" }, diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 2c1f965af..7ebf3c3fe 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -115,7 +115,7 @@ "vue": "^3.4.27", "vue-bundle-renderer": "^2.1.0", "vue-devtools-stub": "^0.1.0", - "vue-router": "^4.3.2" + "vue-router": "^4.3.3" }, "devDependencies": { "@nuxt/ui-templates": "1.3.4", diff --git a/packages/schema/package.json b/packages/schema/package.json index 2487b5e11..1489adfed 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -58,7 +58,7 @@ "vue": "3.4.27", "vue-bundle-renderer": "2.1.0", "vue-loader": "17.4.2", - "vue-router": "4.3.2", + "vue-router": "4.3.3", "webpack": "5.91.0", "webpack-dev-middleware": "7.2.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9342495df..5df508ca6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,7 +31,7 @@ importers: version: link:packages/kit '@nuxt/test-utils': specifier: 3.13.1 - version: 3.13.1(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) + version: 3.13.1(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) '@nuxt/webpack-builder': specifier: workspace:* version: link:packages/webpack @@ -148,13 +148,13 @@ importers: version: 1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0) vitest-environment-nuxt: specifier: 1.0.0 - version: 1.0.0(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) + version: 1.0.0(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) vue: specifier: 3.4.27 version: 3.4.27(typescript@5.4.5) vue-router: - specifier: 4.3.2 - version: 4.3.2(vue@3.4.27(typescript@5.4.5)) + specifier: 4.3.3 + version: 4.3.3(vue@3.4.27(typescript@5.4.5)) vue-tsc: specifier: 2.0.21 version: 2.0.21(typescript@5.4.5) @@ -407,7 +407,7 @@ importers: version: 1.10.1 unplugin-vue-router: specifier: ^0.7.0 - version: 0.7.0(rollup@4.18.0)(vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) + version: 0.7.0(rollup@4.18.0)(vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) unstorage: specifier: ^1.10.2 version: 1.10.2(ioredis@5.3.2) @@ -424,8 +424,8 @@ importers: specifier: ^0.1.0 version: 0.1.0 vue-router: - specifier: ^4.3.2 - version: 4.3.2(vue@3.4.27(typescript@5.4.5)) + specifier: ^4.3.3 + version: 4.3.3(vue@3.4.27(typescript@5.4.5)) devDependencies: '@nuxt/ui-templates': specifier: workspace:* @@ -564,8 +564,8 @@ importers: specifier: 17.4.2 version: 17.4.2(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5))(webpack@5.91.0) vue-router: - specifier: 4.3.2 - version: 4.3.2(vue@3.4.27(typescript@5.4.5)) + specifier: 4.3.3 + version: 4.3.3(vue@3.4.27(typescript@5.4.5)) webpack: specifier: 5.91.0 version: 5.91.0 @@ -977,7 +977,7 @@ importers: version: 1.3.4 unplugin-vue-router: specifier: ^0.7.0 - version: 0.7.0(rollup@4.18.0)(vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) + version: 0.7.0(rollup@4.18.0)(vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) vitest: specifier: 1.5.3 version: 1.5.3(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0) @@ -986,7 +986,7 @@ importers: version: 3.4.27(typescript@5.4.5) vue-router: specifier: latest - version: 4.3.2(vue@3.4.27(typescript@5.4.5)) + version: 4.3.3(vue@3.4.27(typescript@5.4.5)) test/fixtures/minimal: dependencies: @@ -2960,9 +2960,6 @@ packages: '@vue/compiler-ssr@3.4.27': resolution: {integrity: sha512-CVRzSJIltzMG5FcidsW0jKNQnNRYC8bT21VegyMMtHmhW3UOI7knmUehzswXLrExDLE6lQCZdrhD4ogI7c+vuw==} - '@vue/devtools-api@6.5.1': - resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==} - '@vue/devtools-api@6.6.3': resolution: {integrity: sha512-0MiMsFma/HqA6g3KLKn+AGpL1kgKhFWszC9U29NfpWK5LE7bjeXxySWJrOJ77hBz+TBrBQ7o4QJqbPbqbs8rJw==} @@ -7399,8 +7396,8 @@ packages: peerDependencies: vue: 3.4.27 - vue-router@4.3.2: - resolution: {integrity: sha512-hKQJ1vDAZ5LVkKEnHhmm1f9pMiWIBNGF5AwU67PdH7TyXCj/a4hTccuUuYCAMgJK6rO/NVYtQIEN3yL8CECa7Q==} + vue-router@4.3.3: + resolution: {integrity: sha512-8Q+u+WP4N2SXY38FDcF2H1dUEbYVHVPtPCPZj/GTZx8RCbiB8AtJP9+YIxn4Vs0svMTNQcLIzka4GH7Utkx9xQ==} peerDependencies: vue: 3.4.27 @@ -8699,7 +8696,7 @@ snapshots: rc9: 2.1.2 std-env: 3.7.0 - '@nuxt/test-utils@3.13.1(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5))': + '@nuxt/test-utils@3.13.1(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5))': dependencies: '@nuxt/kit': link:packages/kit '@nuxt/schema': link:packages/schema @@ -8726,9 +8723,9 @@ snapshots: unenv: 1.9.0 unplugin: 1.10.1 vite: 5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0) - vitest-environment-nuxt: 1.0.0(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) + vitest-environment-nuxt: 1.0.0(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) vue: 3.4.27(typescript@5.4.5) - vue-router: 4.3.2(vue@3.4.27(typescript@5.4.5)) + vue-router: 4.3.3(vue@3.4.27(typescript@5.4.5)) optionalDependencies: '@testing-library/vue': 8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)) '@vue/test-utils': 2.4.6 @@ -9772,8 +9769,6 @@ snapshots: '@vue/compiler-dom': 3.4.27 '@vue/shared': 3.4.27 - '@vue/devtools-api@6.5.1': {} - '@vue/devtools-api@6.6.3': {} '@vue/devtools-applet@7.1.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(unocss@0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5))': @@ -14620,7 +14615,7 @@ snapshots: - rollup - supports-color - unplugin-vue-router@0.7.0(rollup@4.18.0)(vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)): + unplugin-vue-router@0.7.0(rollup@4.18.0)(vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)): dependencies: '@babel/types': 7.24.5 '@rollup/pluginutils': 5.1.0(rollup@4.18.0) @@ -14636,7 +14631,7 @@ snapshots: unplugin: 1.10.1 yaml: 2.3.4 optionalDependencies: - vue-router: 4.3.2(vue@3.4.27(typescript@5.4.5)) + vue-router: 4.3.3(vue@3.4.27(typescript@5.4.5)) transitivePeerDependencies: - rollup - vue @@ -14852,9 +14847,9 @@ snapshots: sass: 1.69.4 terser: 5.27.0 - vitest-environment-nuxt@1.0.0(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)): + vitest-environment-nuxt@1.0.0(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)): dependencies: - '@nuxt/test-utils': 3.13.1(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) + '@nuxt/test-utils': 3.13.1(@testing-library/vue@8.1.0(@vue/compiler-sfc@3.4.27)(vue@3.4.27(typescript@5.4.5)))(@vue/test-utils@2.4.6)(h3@1.11.1)(happy-dom@14.12.0)(nitropack@2.9.6(encoding@0.1.13))(playwright-core@1.44.1)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0))(vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) transitivePeerDependencies: - '@cucumber/cucumber' - '@jest/globals' @@ -15008,9 +15003,9 @@ snapshots: dependencies: vue: 3.4.27(typescript@5.4.5) - vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)): + vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)): dependencies: - '@vue/devtools-api': 6.5.1 + '@vue/devtools-api': 6.6.3 vue: 3.4.27(typescript@5.4.5) vue-template-compiler@2.7.14: From b3f519aa6ebc13d33a73686307cf3c9a278a1181 Mon Sep 17 00:00:00 2001 From: Ryan Clements Date: Mon, 10 Jun 2024 14:45:10 -0400 Subject: [PATCH 07/31] docs: add docs page for prerendering (#27286) --- docs/1.getting-started/10.deployment.md | 57 +------- docs/1.getting-started/9.prerendering.md | 177 +++++++++++++++++++++++ 2 files changed, 178 insertions(+), 56 deletions(-) create mode 100644 docs/1.getting-started/9.prerendering.md diff --git a/docs/1.getting-started/10.deployment.md b/docs/1.getting-started/10.deployment.md index f381d6ca6..91a4a71cc 100644 --- a/docs/1.getting-started/10.deployment.md +++ b/docs/1.getting-started/10.deployment.md @@ -71,62 +71,7 @@ There are two ways to deploy a Nuxt application to any static hosting services: - Static site generation (SSG) with `ssr: true` pre-renders routes of your application at build time. (This is the default behavior when running `nuxi generate`.) It will also generate `/200.html` and `/404.html` single-page app fallback pages, which can render dynamic routes or 404 errors on the client (though you may need to configure this on your static host). - Alternatively, you can prerender your site with `ssr: false` (static single-page app). This will produce HTML pages with an empty `
` where your Vue app would normally be rendered. You will lose many SEO benefits of prerendering your site, so it is suggested instead to use [``](/docs/api/components/client-only) to wrap the portions of your site that cannot be server rendered (if any). -### Crawl-based Pre-rendering - -Use the [`nuxi generate` command](/docs/api/commands/generate) to build and pre-render your application using the [Nitro](/docs/guide/concepts/server-engine) crawler. This command is similar to `nuxt build` with the `nitro.static` option set to `true`, or running `nuxt build --prerender`. - -```bash [Terminal] -npx nuxi generate -``` - -That's it! You can now deploy the `.output/public` directory to any static hosting service or preview it locally with `npx serve .output/public`. - -Working of the Nitro crawler: - -1. Load the HTML of your application's root route (`/`), any non-dynamic pages in your `~/pages` directory, and any other routes in the `nitro.prerender.routes` array. -2. Save the HTML and `payload.json` to the `~/.output/public/` directory to be served statically. -3. Find all anchor tags (``) in the HTML to navigate to other routes. -4. Repeat steps 1-3 for each anchor tag found until there are no more anchor tags to crawl. - -This is important to understand since pages that are not linked to a discoverable page can't be pre-rendered automatically. - -::read-more{to="/docs/api/commands/generate#nuxi-generate"} -Read more about the `nuxi generate` command. -:: - -### Selective Pre-rendering - -You can manually specify routes that [Nitro](/docs/guide/concepts/server-engine) will fetch and pre-render during the build or ignore routes that you don't want to pre-render like `/dynamic` in the `nuxt.config` file: - -```ts twoslash [nuxt.config.ts] -export default defineNuxtConfig({ - nitro: { - prerender: { - routes: ['/user/1', '/user/2'], - ignore: ['/dynamic'] - } - } -}) -``` - -You can combine this with the `crawlLinks` option to pre-render a set of routes that the crawler can't discover like your `/sitemap.xml` or `/robots.txt`: - -```ts twoslash [nuxt.config.ts] -export default defineNuxtConfig({ - nitro: { - prerender: { - crawlLinks: true, - routes: ['/sitemap.xml', '/robots.txt'] - } - } -}) -``` - -Setting `nitro.prerender` to `true` is similar to `nitro.prerender.crawlLinks` to `true`. - -::read-more{to="https://nitro.unjs.io/config#prerender"} -Read more about pre-rendering in the Nitro documentation. -:: +:read-more{title="Nuxt prerendering" to="/docs/getting-started/prerendering"} ### Client-side Only Rendering diff --git a/docs/1.getting-started/9.prerendering.md b/docs/1.getting-started/9.prerendering.md new file mode 100644 index 000000000..ee63d7b28 --- /dev/null +++ b/docs/1.getting-started/9.prerendering.md @@ -0,0 +1,177 @@ +--- +title: "Prerendering" +description: Nuxt allows pages to be statically rendered at build time to improve certain performance or SEO metrics +navigation.icon: i-ph-code-block-duotone +--- + +Nuxt allows for select pages from your application to be rendered at build time. Nuxt will serve the prebuilt pages when requested instead of generating them on the fly. + +:read-more{title="Nuxt rendering modes" to="/docs/guide/concepts/rendering"} + +## Crawl-based Pre-rendering + +Use the [`nuxi generate` command](/docs/api/commands/generate) to build and pre-render your application using the [Nitro](/docs/guide/concepts/server-engine) crawler. This command is similar to `nuxt build` with the `nitro.static` option set to `true`, or running `nuxt build --prerender`. + +This will build your site, stand up a nuxt instance, and, by default, prerender the root page `/` along with any of your site's pages it links to, any of your site's pages they link to, and so on. + +```bash [Terminal] +npx nuxi generate +``` + +You can now deploy the `.output/public` directory to any static hosting service or preview it locally with `npx serve .output/public`. + +Working of the Nitro crawler: + +1. Load the HTML of your application's root route (`/`), any non-dynamic pages in your `~/pages` directory, and any other routes in the `nitro.prerender.routes` array. +2. Save the HTML and `payload.json` to the `~/.output/public/` directory to be served statically. +3. Find all anchor tags (``) in the HTML to navigate to other routes. +4. Repeat steps 1-3 for each anchor tag found until there are no more anchor tags to crawl. + +This is important to understand since pages that are not linked to a discoverable page can't be pre-rendered automatically. + +::read-more{to="/docs/api/commands/generate#nuxi-generate"} +Read more about the `nuxi generate` command. +:: + +### Selective Pre-rendering + +You can manually specify routes that [Nitro](/docs/guide/concepts/server-engine) will fetch and pre-render during the build or ignore routes that you don't want to pre-render like `/dynamic` in the `nuxt.config` file: + +```ts twoslash [nuxt.config.ts] +export default defineNuxtConfig({ + nitro: { + prerender: { + routes: ["/user/1", "/user/2"], + ignore: ["/dynamic"], + }, + }, +}); +``` + +You can combine this with the `crawlLinks` option to pre-render a set of routes that the crawler can't discover like your `/sitemap.xml` or `/robots.txt`: + +```ts twoslash [nuxt.config.ts] +export default defineNuxtConfig({ + nitro: { + prerender: { + crawlLinks: true, + routes: ["/sitemap.xml", "/robots.txt"], + }, + }, +}); +``` + +Setting `nitro.prerender` to `true` is similar to `nitro.prerender.crawlLinks` to `true`. + +::read-more{to="https://nitro.unjs.io/config#prerender"} +Read more about pre-rendering in the Nitro documentation. +:: + +Lastly, you can manually configure this using routeRules. + +```ts twoslash [nuxt.config.ts] +export default defineNuxtConfig({ + routeRules: { + // Set prerender to true to configure it to be prerendered + "/rss.xml": { prerender: true }, + // Set it to false to configure it to be skipped for prerendering + "/this-DOES-NOT-get-prerendered": { prerender: false }, + // Everything under /blog gets prerendered as long as it + // is linked to from another page + "/blog/**": { prerender: true }, + }, +}); +``` + +::read-more{to="https://nitro.unjs.io/config/#routerules"} +Read more about Nitro's `routeRules` configuration. +:: + +As a shorthand, you can also configure this in a page file using [`defineRouteRules`](/docs/api/utils/define-route-rules). + +::read-more{to="/docs/guide/going-further/experimental-features#inlinerouterules" icon="i-ph-star-duotone"} +This feature is experimental and in order to use it you must enable the `experimental.inlineRouteRules` option in your `nuxt.config`. +:: + +```vue [pages/index.vue] + + + +``` + +This will be translated to: + +```ts [nuxt.config.ts] +export default defineNuxtConfig({ + routeRules: { + "/": { prerender: true }, + }, +}); +``` + +## Runtime prerender configuration + +### `prerenderRoutes` + +You can use this at runtime within a [Nuxt context](/docs/guide/going-further/nuxt-app#the-nuxt-context) to add more routes for Nitro to prerender. + +```vue [pages/index.vue] + + + +``` + +:read-more{title="prerenderRoutes" to="/docs/api/utils/prerender-routes"} + +### `prerender:routes` Nuxt hook + +This is called before prerendering for additional routes to be registered. + +```ts [nitro.config.ts] +export default defineNuxtConfig({ + hooks: { + async "prerender:routes"(ctx) { + const { pages } = await fetch("https://api.some-cms.com/pages").then( + (res) => res.json(), + ); + for (const page of pages) { + ctx.routes.add(`/${page.name}`); + } + }, + }, +}); +``` + +### `prerender:generate` Nitro hook + +This is called for each route during prerendering. You can use this for fine grained handling of each route that gets prerendered. + +```ts [nitro.config.ts] +export default defineNuxtConfig({ + nitro: { + hooks: { + "prerender:generate"(route) { + if (route.route?.includes("private")) { + route.skip = true; + } + }, + }, + }, +}); +``` From 91685a5b2bef68d1b160b4dd002d8194c8d402d3 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Jun 2024 20:49:43 +0100 Subject: [PATCH 08/31] fix(nuxt): resolve full path to app manifest stub page --- packages/nuxt/src/pages/module.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/pages/module.ts b/packages/nuxt/src/pages/module.ts index ae80fd4e0..3e5982ea3 100644 --- a/packages/nuxt/src/pages/module.ts +++ b/packages/nuxt/src/pages/module.ts @@ -1,6 +1,6 @@ import { existsSync, readdirSync } from 'node:fs' import { mkdir, readFile } from 'node:fs/promises' -import { addBuildPlugin, addComponent, addPlugin, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, defineNuxtModule, findPath, logger, updateTemplates, useNitro } from '@nuxt/kit' +import { addBuildPlugin, addComponent, addPlugin, addTemplate, addTypeTemplate, addVitePlugin, addWebpackPlugin, defineNuxtModule, findPath, logger, resolvePath, updateTemplates, useNitro } from '@nuxt/kit' import { dirname, join, relative, resolve } from 'pathe' import { genImport, genObjectFromRawEntries, genString } from 'knitwork' import type { Nuxt, NuxtApp, NuxtPage } from 'nuxt/schema' @@ -344,6 +344,7 @@ export default defineNuxtModule({ } if (nuxt.options.experimental.appManifest) { + const componentStubPath = await resolvePath(resolve(runtimeDir, 'component-stub')) // Add all redirect paths as valid routes to router; we will handle these in a client-side middleware // when the app manifest is enabled. nuxt.hook('pages:extend', (routes) => { @@ -358,7 +359,7 @@ export default defineNuxtModule({ routes.push({ _sync: true, path: path.replace(/\/[^/]*\*\*/, '/:pathMatch(.*)'), - file: resolve(runtimeDir, 'component-stub'), + file: componentStubPath, }) } }) From dccf2e5f35d68b1b9d1daf3d1c39a6ffe112332c Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Jun 2024 20:55:04 +0100 Subject: [PATCH 09/31] fix(nuxt): resolve paths without file extensions --- packages/nuxt/src/pages/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index 79e0321e9..85d408727 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -2,7 +2,7 @@ import { runInNewContext } from 'node:vm' import fs from 'node:fs' import { extname, normalize, relative, resolve } from 'pathe' import { encodePath, joinURL, withLeadingSlash } from 'ufo' -import { logger, resolveFiles, useNuxt } from '@nuxt/kit' +import { logger, resolveFiles, resolvePath, useNuxt } from '@nuxt/kit' import { genArrayFromRaw, genDynamicImport, genImport, genSafeVariableName } from 'knitwork' import escapeRE from 'escape-string-regexp' import { filename } from 'pathe/utils' @@ -142,7 +142,7 @@ export function generateRoutesFromFiles (files: ScannedFile[], options: Generate export async function augmentPages (routes: NuxtPage[], vfs: Record, augmentedPages = new Set()) { for (const route of routes) { if (!augmentedPages.has(route) && route.file) { - const fileContent = route.file in vfs ? vfs[route.file] : fs.readFileSync(route.file, 'utf-8') + const fileContent = route.file in vfs ? vfs[route.file] : fs.readFileSync(await resolvePath(route.file), 'utf-8') Object.assign(route, await getRouteMeta(fileContent, route.file)) } From 7bb02735e7883ec14035cf86b6a9055bbcbc6587 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Jun 2024 21:11:31 +0100 Subject: [PATCH 10/31] fix(kit): revert back to `esnext` target --- packages/kit/src/template.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/kit/src/template.ts b/packages/kit/src/template.ts index 829551de6..194434f69 100644 --- a/packages/kit/src/template.ts +++ b/packages/kit/src/template.ts @@ -135,7 +135,7 @@ export async function _generateTypes (nuxt: Nuxt) { /* Base options: */ esModuleInterop: true, skipLibCheck: true, - target: 'es2022', + target: 'ESNext', allowJs: true, resolveJsonModule: true, moduleDetection: 'force', @@ -147,11 +147,11 @@ export async function _generateTypes (nuxt: Nuxt) { forceConsistentCasingInFileNames: true, noImplicitOverride: true, /* If NOT transpiling with TypeScript: */ - module: hasTypescriptVersionWithModulePreserve ? 'preserve' : 'es2022', + module: hasTypescriptVersionWithModulePreserve ? 'preserve' : 'ESNext', noEmit: true, /* If your code runs in the DOM: */ lib: [ - 'es2022', + 'ESNext', 'dom', 'dom.iterable', ], From 018b03588ae41bccc761ddf1a129994aeb287892 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Jun 2024 21:25:42 +0100 Subject: [PATCH 11/31] fix(kit,schema): revert changes to module options types (#26850) This reverts commit c06a683e49a7539ff37096edc1940d90e5421af3. --- packages/kit/src/module/define.ts | 57 ++++++++--------------------- packages/kit/src/module/install.ts | 2 +- packages/schema/src/types/module.ts | 40 ++++++-------------- test/fixtures/basic-types/types.ts | 18 --------- 4 files changed, 28 insertions(+), 89 deletions(-) diff --git a/packages/kit/src/module/define.ts b/packages/kit/src/module/define.ts index 061362370..ff2a56d2d 100644 --- a/packages/kit/src/module/define.ts +++ b/packages/kit/src/module/define.ts @@ -3,7 +3,7 @@ import { performance } from 'node:perf_hooks' import { defu } from 'defu' import { applyDefaults } from 'untyped' import { dirname } from 'pathe' -import type { ModuleDefinition, ModuleOptions, ModuleSetupInstallResult, ModuleSetupReturn, Nuxt, NuxtModule, NuxtOptions, ResolvedModuleOptions, ResolvedNuxtTemplate } from '@nuxt/schema' +import type { ModuleDefinition, ModuleOptions, ModuleSetupReturn, Nuxt, NuxtModule, NuxtOptions, ResolvedNuxtTemplate } from '@nuxt/schema' import { logger } from '../logger' import { nuxtCtx, tryUseNuxt, useNuxt } from '../context' import { checkNuxtCompatibility, isNuxt2 } from '../compatibility' @@ -13,53 +13,28 @@ import { compileTemplate, templateUtils } from '../internal/template' * Define a Nuxt module, automatically merging defaults with user provided options, installing * any hooks that are provided, and calling an optional setup function for full control. */ -export function defineNuxtModule (definition: ModuleDefinition | NuxtModule): NuxtModule - -export function defineNuxtModule (): { - with: > ( - definition: ModuleDefinition | NuxtModule - ) => NuxtModule -} - -export function defineNuxtModule (definition?: ModuleDefinition | NuxtModule) { - if (definition) { - return _defineNuxtModule(definition) - } - - return { - with: >( - definition: ModuleDefinition | NuxtModule, - ) => _defineNuxtModule(definition), - } -} - -function _defineNuxtModule> (definition: ModuleDefinition | NuxtModule): NuxtModule { - if (typeof definition === 'function') { return _defineNuxtModule({ setup: definition }) } +export function defineNuxtModule (definition: ModuleDefinition | NuxtModule): NuxtModule { + if (typeof definition === 'function') { return defineNuxtModule({ setup: definition }) } // Normalize definition and meta - const module: ModuleDefinition & Required, 'meta'>> = defu(definition, { meta: {} }) - - module.meta.configKey ||= module.meta.name + const module: ModuleDefinition & Required, 'meta'>> = defu(definition, { meta: {} }) + if (module.meta.configKey === undefined) { + module.meta.configKey = module.meta.name + } // Resolves module options from inline options, [configKey] in nuxt.config, defaults and schema - async function getOptions (inlineOptions?: Partial, nuxt: Nuxt = useNuxt()): Promise> { - const nuxtConfigOptionsKey = module.meta.configKey || module.meta.name - - const nuxtConfigOptions: Partial = nuxtConfigOptionsKey && nuxtConfigOptionsKey in nuxt.options ? nuxt.options[ nuxtConfigOptionsKey] : {} - - const optionsDefaults: TOptionsDefaults = module.defaults instanceof Function ? module.defaults(nuxt) : module.defaults ?? {} - - let options: ResolvedModuleOptions = defu(inlineOptions, nuxtConfigOptions, optionsDefaults) - + async function getOptions (inlineOptions?: OptionsT, nuxt: Nuxt = useNuxt()) { + const configKey = module.meta.configKey || module.meta.name! + const _defaults = module.defaults instanceof Function ? module.defaults(nuxt) : module.defaults + let _options = defu(inlineOptions, nuxt.options[configKey as keyof NuxtOptions], _defaults) as OptionsT if (module.schema) { - options = await applyDefaults(module.schema, options) as any + _options = await applyDefaults(module.schema, _options) as OptionsT } - - return Promise.resolve(options) + return Promise.resolve(_options) } // Module format is always a simple function - async function normalizedModule (this: any, inlineOptions: Partial, nuxt: Nuxt): Promise { + async function normalizedModule (this: any, inlineOptions: OptionsT, nuxt: Nuxt) { if (!nuxt) { nuxt = tryUseNuxt() || this.nuxt /* invoked by nuxt 2 */ } @@ -112,7 +87,7 @@ function _defineNuxtModule { + return defu(res, { timings: { setup: setupTime, }, @@ -123,7 +98,7 @@ function _defineNuxtModule Promise.resolve(module.meta) normalizedModule.getOptions = getOptions - return > normalizedModule + return normalizedModule as NuxtModule } // -- Nuxt 2 compatibility shims -- diff --git a/packages/kit/src/module/install.ts b/packages/kit/src/module/install.ts index 153aab0bd..beecd62ae 100644 --- a/packages/kit/src/module/install.ts +++ b/packages/kit/src/module/install.ts @@ -31,7 +31,7 @@ export async function installModule< isNuxt2() // @ts-expect-error Nuxt 2 `moduleContainer` is not typed ? await nuxtModule.call(nuxt.moduleContainer, inlineOptions, nuxt) - : await nuxtModule(inlineOptions || {}, nuxt) + : await nuxtModule(inlineOptions, nuxt) ) ?? {} if (res === false /* setup aborted */) { return diff --git a/packages/schema/src/types/module.ts b/packages/schema/src/types/module.ts index 13b42365a..9b92d6a93 100644 --- a/packages/schema/src/types/module.ts +++ b/packages/schema/src/types/module.ts @@ -1,4 +1,3 @@ -import type { Defu } from 'defu' import type { NuxtHooks } from './hooks' import type { Nuxt } from './nuxt' import type { NuxtCompatibility } from './compatibility' @@ -27,7 +26,8 @@ export interface ModuleMeta { /** The options received. */ export type ModuleOptions = Record -export type ModuleSetupInstallResult = { +/** Optional result for nuxt modules */ +export interface ModuleSetupReturn { /** * Timing information for the initial setup */ @@ -39,37 +39,19 @@ export type ModuleSetupInstallResult = { } type Awaitable = T | Promise +type _ModuleSetupReturn = Awaitable -type Prettify = { - [K in keyof T]: T[K]; -} & {} - -export type ModuleSetupReturn = Awaitable - -export type ResolvedModuleOptions> = Prettify< - Defu< - Partial, - [Partial, TOptionsDefaults] - > -> - -/** Module definition passed to 'defineNuxtModule(...)' or 'defineNuxtModule().with(...)'. */ -export interface ModuleDefinition< - TOptions extends ModuleOptions, - TOptionsDefaults extends Partial = Partial, -> { +/** Input module passed to defineNuxtModule. */ +export interface ModuleDefinition { meta?: ModuleMeta - defaults?: TOptionsDefaults | ((nuxt: Nuxt) => TOptionsDefaults) - schema?: TOptions + defaults?: T | ((nuxt: Nuxt) => T) + schema?: T hooks?: Partial - setup?: (this: void, resolvedOptions: ResolvedModuleOptions, nuxt: Nuxt) => ModuleSetupReturn + setup?: (this: void, resolvedOptions: T, nuxt: Nuxt) => _ModuleSetupReturn } -export interface NuxtModule< - TOptions extends ModuleOptions = ModuleOptions, - TOptionsDefaults extends Partial = Partial, -> { - (this: void, resolvedOptions: ResolvedModuleOptions, nuxt: Nuxt): ModuleSetupReturn - getOptions?: (inlineOptions?: Partial, nuxt?: Nuxt) => Promise> +export interface NuxtModule { + (this: void, inlineOptions: T, nuxt: Nuxt): _ModuleSetupReturn + getOptions?: (inlineOptions?: T, nuxt?: Nuxt) => Promise getMeta?: () => Promise } diff --git a/test/fixtures/basic-types/types.ts b/test/fixtures/basic-types/types.ts index 343ecb1a8..dad52b4f6 100644 --- a/test/fixtures/basic-types/types.ts +++ b/test/fixtures/basic-types/types.ts @@ -5,7 +5,6 @@ import type { NavigationFailure, RouteLocationNormalized, RouteLocationRaw, Rout import type { AppConfig, RuntimeValue, UpperSnakeCase } from 'nuxt/schema' import { defineNuxtConfig } from 'nuxt/config' -import { defineNuxtModule } from 'nuxt/kit' import { callWithNuxt, isVue3 } from '#app' import type { NuxtError } from '#app' import type { NavigateToOptions } from '#app/composables/router' @@ -243,23 +242,6 @@ describe('modules', () => { // @ts-expect-error we want to ensure we throw type error on invalid key defineNuxtConfig({ undeclaredKey: { other: false } }) }) - - it('correctly typed resolved options in defineNuxtModule setup using `.with()`', () => { - defineNuxtModule<{ - foo?: string - baz: number - }>().with({ - defaults: { - foo: 'bar', - }, - setup: (resolvedOptions) => { - expectTypeOf(resolvedOptions).toEqualTypeOf<{ - foo: string - baz?: number | undefined - }>() - }, - }) - }) }) describe('nuxtApp', () => { From 11a79359b86f1a3ae677fa058a73d150c6a94962 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Jun 2024 21:51:40 +0100 Subject: [PATCH 12/31] fix(nuxt): remove `boolean` value for `dedupe` in v4 compat (#27511) --- docs/1.getting-started/12.upgrade.md | 40 +++++++++++++++++++ .../nuxt/src/app/composables/asyncData.ts | 5 +-- packages/nuxt/src/app/defaults.ts | 1 + packages/nuxt/src/core/templates.ts | 9 +++-- .../basic/pages/useAsyncData/override.vue | 2 +- 5 files changed, 50 insertions(+), 7 deletions(-) diff --git a/docs/1.getting-started/12.upgrade.md b/docs/1.getting-started/12.upgrade.md index a50f1f372..323abdb1d 100644 --- a/docs/1.getting-started/12.upgrade.md +++ b/docs/1.getting-started/12.upgrade.md @@ -223,6 +223,46 @@ export default defineNuxtConfig({ Please report an issue if you are doing this, as we do not plan to keep this as configurable. +#### Removal of deprecated `boolean` values for `dedupe` option when calling `refresh` in `useAsyncData` and `useFetch` + +🚦 **Impact Level**: Minimal + +##### What Changed + +Previously it was possible to pass `dedupe: boolean` to `refresh`. These were aliases of `cancel` (`true`) and `defer` (`false`). + +```ts twoslash [app.vue] +const { refresh } = await useAsyncData(async () => ({ message: 'Hello, Nuxt 3!' })) + +async function refreshData () { + await refresh({ dedupe: true }) +} +``` + +##### Reasons for Change + +These aliases were removed, for greater clarity. + +The issue came up when adding `dedupe` as an option to `useAsyncData`, and we removed the boolean values as they ended up being _opposites_. + +`refresh({ dedupe: false })` meant 'do not _cancel_ existing requests in favour of this new one'. But passing `dedupe: true` within the options of `useAsyncData` means 'do not make any new requests if there is an existing pending request.' (See [PR](https://github.com/nuxt/nuxt/pull/24564#pullrequestreview-1764584361).) + +##### Migration Steps + +The migration should be straightforward: + +```diff + const { refresh } = await useAsyncData(async () => ({ message: 'Hello, Nuxt 3!' })) + + async function refreshData () { +- await refresh({ dedupe: true }) ++ await refresh({ dedupe: 'cancel' }) + +- await refresh({ dedupe: false }) ++ await refresh({ dedupe: 'defer' }) + } +``` + #### Respect defaults when clearing `data` in `useAsyncData` and `useFetch` 🚦 **Impact Level**: Minimal diff --git a/packages/nuxt/src/app/composables/asyncData.ts b/packages/nuxt/src/app/composables/asyncData.ts index aafb729e1..8ca773a33 100644 --- a/packages/nuxt/src/app/composables/asyncData.ts +++ b/packages/nuxt/src/app/composables/asyncData.ts @@ -11,7 +11,7 @@ import { onNuxtReady } from './ready' import { asyncDataDefaults, resetAsyncDataToUndefined } from '#build/nuxt.config.mjs' // TODO: temporary module for backwards compatibility -import type { DefaultAsyncDataErrorValue, DefaultAsyncDataValue } from '#app/defaults' +import type { DedupeOption, DefaultAsyncDataErrorValue, DefaultAsyncDataValue } from '#app/defaults' export type AsyncDataRequestStatus = 'idle' | 'pending' | 'success' | 'error' @@ -99,7 +99,6 @@ export interface AsyncDataOptions< export interface AsyncDataExecuteOptions { _initial?: boolean - // TODO: remove boolean option in Nuxt 4 /** * Force a refresh, even if there is already a pending request. Previous requests will * not be cancelled, but their result will not affect the data/pending state - and any @@ -108,7 +107,7 @@ export interface AsyncDataExecuteOptions { * Instead of using `boolean` values, use `cancel` for `true` and `defer` for `false`. * Boolean values will be removed in a future release. */ - dedupe?: boolean | 'cancel' | 'defer' + dedupe?: DedupeOption } export interface _AsyncData { diff --git a/packages/nuxt/src/app/defaults.ts b/packages/nuxt/src/app/defaults.ts index c83129cca..f0dd26ea7 100644 --- a/packages/nuxt/src/app/defaults.ts +++ b/packages/nuxt/src/app/defaults.ts @@ -3,5 +3,6 @@ export type DefaultAsyncDataErrorValue = null export type DefaultAsyncDataValue = null export type DefaultErrorValue = null +export type DedupeOption = boolean | 'cancel' | 'defer' export {} diff --git a/packages/nuxt/src/core/templates.ts b/packages/nuxt/src/core/templates.ts index 0395ff2cb..9e120da0f 100644 --- a/packages/nuxt/src/core/templates.ts +++ b/packages/nuxt/src/core/templates.ts @@ -112,6 +112,8 @@ export const pluginsDeclaration: NuxtTemplate = { const pluginsName = (await annotatePlugins(ctx.nuxt, ctx.app.plugins)).filter(p => p.name).map(p => `'${p.name}'`) + const isV4 = ctx.nuxt.options.future.compatibilityVersion === 4 + return `// Generated by Nuxt' import type { Plugin } from '#app' @@ -131,9 +133,10 @@ declare module '#app' { } declare module '#app/defaults' { - type DefaultAsyncDataErrorValue = ${ctx.nuxt.options.future.compatibilityVersion === 4 ? 'undefined' : 'null'} - type DefaultAsyncDataValue = ${ctx.nuxt.options.future.compatibilityVersion === 4 ? 'undefined' : 'null'} - type DefaultErrorValue = ${ctx.nuxt.options.future.compatibilityVersion === 4 ? 'undefined' : 'null'} + type DefaultAsyncDataErrorValue = ${isV4 ? 'undefined' : 'null'} + type DefaultAsyncDataValue = ${isV4 ? 'undefined' : 'null'} + type DefaultErrorValue = ${isV4 ? 'undefined' : 'null'} + type DedupeOption = ${isV4 ? '\'cancel\' | \'defer\'' : 'boolean | \'cancel\' | \'defer\''} } declare module 'vue' { diff --git a/test/fixtures/basic/pages/useAsyncData/override.vue b/test/fixtures/basic/pages/useAsyncData/override.vue index 4741c3005..e0f659a1b 100644 --- a/test/fixtures/basic/pages/useAsyncData/override.vue +++ b/test/fixtures/basic/pages/useAsyncData/override.vue @@ -15,7 +15,7 @@ if (count || data.value !== 1) { } timeout = 100 -const p = refresh({ dedupe: true, _initial: false }) +const p = refresh({ dedupe: 'cancel', _initial: false }) if (import.meta.client && (count !== 0 || data.value !== 1)) { throw new Error('count should start at 0') From cd95d99704c3ccb3f579c06d2d25da6d4119ac10 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Jun 2024 21:52:16 +0100 Subject: [PATCH 13/31] feat(nuxt,schema): add `compatibilityDate` flag for future (#27512) --- packages/nuxt/src/core/nitro.ts | 5 ++++- packages/schema/package.json | 3 ++- packages/schema/src/config/common.ts | 12 ++++++++++++ pnpm-lock.yaml | 8 ++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/core/nitro.ts b/packages/nuxt/src/core/nitro.ts index ce25bdb7d..84d6aec7d 100644 --- a/packages/nuxt/src/core/nitro.ts +++ b/packages/nuxt/src/core/nitro.ts @@ -388,7 +388,10 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) { } // Init nitro - const nitro = await createNitro(nitroConfig) + const nitro = await createNitro(nitroConfig, { + // @ts-expect-error this will be valid in a future version of Nitro + compatibilityDate: nuxt.options.compatibilityDate, + }) // Trigger Nitro reload when SPA loading template changes const spaLoadingTemplateFilePath = await spaLoadingTemplatePath(nuxt) diff --git a/packages/schema/package.json b/packages/schema/package.json index 1489adfed..a556e4911 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -63,6 +63,7 @@ "webpack-dev-middleware": "7.2.1" }, "dependencies": { + "compatx": "^0.1.3", "consola": "^3.2.3", "defu": "^6.1.4", "hookable": "^5.5.3", @@ -71,8 +72,8 @@ "scule": "^1.3.0", "std-env": "^3.7.0", "ufo": "^1.5.3", - "unimport": "^3.7.2", "uncrypto": "^0.1.3", + "unimport": "^3.7.2", "untyped": "^1.4.2" }, "engines": { diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index 944bd5f2c..5f6c866af 100644 --- a/packages/schema/src/config/common.ts +++ b/packages/schema/src/config/common.ts @@ -20,6 +20,18 @@ export default defineUntypedSchema({ */ extends: null, + /** + * Specify a compatibility date for your app. + * + * This is used to control the behavior of presets in Nitro, Nuxt Image + * and other modules that may change behavior without a major version bump. + * + * We plan to improve the tooling around this feature in the future. + * + * @type {typeof import('compatx').DateString | Record} + */ + compatibilityDate: undefined, + /** * Extend project from a local or remote source. * diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5df508ca6..86d9c1660 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -457,6 +457,9 @@ importers: packages/schema: dependencies: + compatx: + specifier: ^0.1.3 + version: 0.1.3 consola: specifier: ^3.2.3 version: 3.2.3 @@ -3578,6 +3581,9 @@ packages: commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + compatx@0.1.3: + resolution: {integrity: sha512-MWspQwvBk5xeLZMetIfjOozTAtmAIICz1mtol6NbBpCSllXOO+HvWMO87B18rcFtqjfrZ0tIFOH9gNG63ep+mw==} + compress-commons@6.0.2: resolution: {integrity: sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==} engines: {node: '>= 14'} @@ -10489,6 +10495,8 @@ snapshots: commondir@1.0.1: {} + compatx@0.1.3: {} + compress-commons@6.0.2: dependencies: crc-32: 1.2.2 From 9655ce6f6227ea1e178cb4fd239c4062cfc6a999 Mon Sep 17 00:00:00 2001 From: Maik Kowol Date: Tue, 11 Jun 2024 00:20:27 +0200 Subject: [PATCH 14/31] fix(nuxt): add parent `scopeId` to server components (#27497) --- .../nuxt/src/app/components/nuxt-island.ts | 10 ++++++++- .../components/runtime/server-component.ts | 4 +++- test/nuxt/nuxt-island.test.ts | 21 +++++++++++++++---- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/packages/nuxt/src/app/components/nuxt-island.ts b/packages/nuxt/src/app/components/nuxt-island.ts index 503d3e34a..784132a75 100644 --- a/packages/nuxt/src/app/components/nuxt-island.ts +++ b/packages/nuxt/src/app/components/nuxt-island.ts @@ -1,4 +1,4 @@ -import type { Component } from 'vue' +import type { Component, PropType } from 'vue' import { Fragment, Teleport, computed, createStaticVNode, createVNode, defineComponent, getCurrentInstance, h, nextTick, onMounted, ref, toRaw, watch, withMemo } from 'vue' import { debounce } from 'perfect-debounce' import { hash } from 'ohash' @@ -59,6 +59,10 @@ export default defineComponent({ type: Object, default: () => ({}), }, + scopeId: { + type: String as PropType, + default: () => undefined, + }, source: { type: String, default: () => undefined, @@ -131,6 +135,10 @@ export default defineComponent({ const currentSlots = Object.keys(slots) let html = ssrHTML.value + if (props.scopeId) { + html = html.replace(/^<[^> ]*/, full => full + ' ' + props.scopeId) + } + if (import.meta.client && !canLoadClientComponent.value) { for (const [key, value] of Object.entries(payloads.components || {})) { html = html.replace(new RegExp(` data-island-uid="${uid.value}" data-island-component="${key}"[^>]*>`), (full) => { diff --git a/packages/nuxt/src/components/runtime/server-component.ts b/packages/nuxt/src/components/runtime/server-component.ts index bea615b2d..c5ecee9b2 100644 --- a/packages/nuxt/src/components/runtime/server-component.ts +++ b/packages/nuxt/src/components/runtime/server-component.ts @@ -1,4 +1,4 @@ -import { defineComponent, h, ref } from 'vue' +import { defineComponent, getCurrentInstance, h, ref } from 'vue' import NuxtIsland from '#app/components/nuxt-island' import { useRoute } from '#app/composables/router' import { isPrerendered } from '#app/composables/payload' @@ -11,6 +11,7 @@ export const createServerComponent = (name: string) => { props: { lazy: Boolean }, emits: ['error'], setup (props, { attrs, slots, expose, emit }) { + const vm = getCurrentInstance() const islandRef = ref(null) expose({ @@ -22,6 +23,7 @@ export const createServerComponent = (name: string) => { name, lazy: props.lazy, props: attrs, + scopeId: vm?.vnode.scopeId, ref: islandRef, onError: (err) => { emit('error', err) diff --git a/test/nuxt/nuxt-island.test.ts b/test/nuxt/nuxt-island.test.ts index e9cb75ae1..a12123884 100644 --- a/test/nuxt/nuxt-island.test.ts +++ b/test/nuxt/nuxt-island.test.ts @@ -1,6 +1,6 @@ import { beforeEach } from 'node:test' import { describe, expect, it, vi } from 'vitest' -import { h, nextTick } from 'vue' +import { defineComponent, h, nextTick, popScopeId, pushScopeId } from 'vue' import { mountSuspended } from '@nuxt/test-utils/runtime' import { createServerComponent } from '../../packages/nuxt/src/components/runtime/server-component' import { createSimpleRemoteIslandProvider } from '../fixtures/remote-provider' @@ -133,6 +133,19 @@ describe('runtime server component', () => { expect(wrapper.emitted('error')).toHaveLength(1) vi.mocked(fetch).mockReset() }) + + it('expect NuxtIsland to have parent scopeId', async () => { + const wrapper = await mountSuspended(defineComponent({ + render () { + pushScopeId('data-v-654e2b21') + const vnode = h(createServerComponent('dummyName')) + popScopeId() + return vnode + }, + })) + + expect(wrapper.find('*').attributes()).toHaveProperty('data-v-654e2b21') + }) }) describe('client components', () => { @@ -186,7 +199,7 @@ describe('client components', () => { expect(fetch).toHaveBeenCalledOnce() expect(wrapper.html()).toMatchInlineSnapshot(` - "
hello
+ "
hello
client component
@@ -212,7 +225,7 @@ describe('client components', () => { await wrapper.vm.$.exposed!.refresh() await nextTick() expect(wrapper.html()).toMatchInlineSnapshot(` - "
hello
+ "
hello
fallback
" @@ -305,7 +318,7 @@ describe('client components', () => { }) expect(fetch).toHaveBeenCalledOnce() expect(wrapper.html()).toMatchInlineSnapshot(` - "
hello
+ "
hello
slot in client component
From 13fec55c1030b8a95106773a6a6463107fbf24f4 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Jun 2024 23:42:55 +0100 Subject: [PATCH 15/31] fix(nuxt): handle symbol keys in wrapped runtime config --- packages/nuxt/src/app/nuxt.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/nuxt.ts b/packages/nuxt/src/app/nuxt.ts index db062b6b5..d8fd5ffb5 100644 --- a/packages/nuxt/src/app/nuxt.ts +++ b/packages/nuxt/src/app/nuxt.ts @@ -563,8 +563,8 @@ function wrappedConfig (runtimeConfig: Record) { const keys = Object.keys(runtimeConfig).map(key => `\`${key}\``) const lastKey = keys.pop() return new Proxy(runtimeConfig, { - get (target, p: string, receiver) { - if (p !== 'public' && !(p in target) && !p.startsWith('__v') /* vue check for reactivity, e.g. `__v_isRef` */) { + get (target, p, receiver) { + if (typeof p === 'string' && p !== 'public' && !(p in target) && !p.startsWith('__v') /* vue check for reactivity, e.g. `__v_isRef` */) { console.warn(`[nuxt] Could not access \`${p}\`. The only available runtime config keys on the client side are ${keys.join(', ')} and ${lastKey}. See \`https://nuxt.com/docs/guide/going-further/runtime-config\` for more information.`) } return Reflect.get(target, p, receiver) From b75bf870bef90c7791e2bfbdb0fab9168871cb16 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 11 Jun 2024 09:23:48 +0100 Subject: [PATCH 16/31] fix(nuxt): register augmented pages to avoid re-augmenting --- packages/nuxt/src/pages/utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index 85d408727..19014fbd2 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -144,6 +144,7 @@ export async function augmentPages (routes: NuxtPage[], vfs: Record 0) { From 09f6a88e1d7f2b2d59e65a146592ac5b78ed7a07 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 11 Jun 2024 09:37:35 +0100 Subject: [PATCH 17/31] fix(nuxt): use file path as key for re-augmenting --- packages/nuxt/src/pages/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index 19014fbd2..78080c97c 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -139,12 +139,12 @@ export function generateRoutesFromFiles (files: ScannedFile[], options: Generate return prepareRoutes(routes) } -export async function augmentPages (routes: NuxtPage[], vfs: Record, augmentedPages = new Set()) { +export async function augmentPages (routes: NuxtPage[], vfs: Record, augmentedPages = new Set()) { for (const route of routes) { - if (!augmentedPages.has(route) && route.file) { + if (route.file && !augmentedPages.has(route.file)) { const fileContent = route.file in vfs ? vfs[route.file] : fs.readFileSync(await resolvePath(route.file), 'utf-8') Object.assign(route, await getRouteMeta(fileContent, route.file)) - augmentedPages.add(route) + augmentedPages.add(route.file) } if (route.children && route.children.length > 0) { From 9f06842fa1b323bd0e0911b0335a091a9052b5c3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 09:44:43 +0100 Subject: [PATCH 18/31] v3.12.0 --- packages/kit/package.json | 2 +- packages/nuxt/package.json | 2 +- packages/schema/package.json | 2 +- packages/vite/package.json | 2 +- packages/webpack/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/kit/package.json b/packages/kit/package.json index 0a3ea10f6..e529e16f4 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -1,6 +1,6 @@ { "name": "@nuxt/kit", - "version": "3.11.2", + "version": "3.12.0", "repository": { "type": "git", "url": "git+https://github.com/nuxt/nuxt.git", diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 7ebf3c3fe..e033b47fd 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -1,6 +1,6 @@ { "name": "nuxt", - "version": "3.11.2", + "version": "3.12.0", "repository": { "type": "git", "url": "git+https://github.com/nuxt/nuxt.git", diff --git a/packages/schema/package.json b/packages/schema/package.json index a556e4911..81cd68ff6 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,6 @@ { "name": "@nuxt/schema", - "version": "3.11.2", + "version": "3.12.0", "repository": { "type": "git", "url": "git+https://github.com/nuxt/nuxt.git", diff --git a/packages/vite/package.json b/packages/vite/package.json index 418b7deb9..4b89955a8 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -1,6 +1,6 @@ { "name": "@nuxt/vite-builder", - "version": "3.11.2", + "version": "3.12.0", "repository": { "type": "git", "url": "git+https://github.com/nuxt/nuxt.git", diff --git a/packages/webpack/package.json b/packages/webpack/package.json index d4c67588e..d77c7d7d7 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -1,6 +1,6 @@ { "name": "@nuxt/webpack-builder", - "version": "3.11.2", + "version": "3.12.0", "repository": { "type": "git", "url": "git+https://github.com/nuxt/nuxt.git", From 7777f056413af7c9bc897db380e1eae7132b49d7 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 11 Jun 2024 09:54:34 +0100 Subject: [PATCH 19/31] chore: fix release script --- scripts/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release.sh b/scripts/release.sh index a247550e9..f8fc5bd81 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -16,7 +16,7 @@ for PKG in packages/* ; do if [[ $PKG == "packages/test-utils" ]] ; then continue fi - if [[ $p == "packages/ui-templates" ]] ; then + if [[ $PKG == "packages/ui-templates" ]] ; then continue fi pushd $PKG From 0252000d7cf604e82ab3e4d8c675b757a5224e6c Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 11 Jun 2024 10:14:11 +0100 Subject: [PATCH 20/31] fix(nuxt): update registry list for `@nuxt/scripts` --- packages/nuxt/package.json | 1 + packages/nuxt/src/imports/presets.ts | 5 +- packages/nuxt/test/auto-imports.test.ts | 21 +- pnpm-lock.yaml | 369 +++++++++++++++++++++++- 4 files changed, 384 insertions(+), 12 deletions(-) diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index e033b47fd..a1debe956 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -118,6 +118,7 @@ "vue-router": "^4.3.3" }, "devDependencies": { + "@nuxt/scripts": "^0.4.7", "@nuxt/ui-templates": "1.3.4", "@parcel/watcher": "2.4.1", "@types/estree": "1.0.5", diff --git a/packages/nuxt/src/imports/presets.ts b/packages/nuxt/src/imports/presets.ts index ba5a513d3..3b2e85534 100644 --- a/packages/nuxt/src/imports/presets.ts +++ b/packages/nuxt/src/imports/presets.ts @@ -123,15 +123,16 @@ export const scriptsStubsPreset = { 'useScriptFathomAnalytics', 'useScriptMatomoAnalytics', 'useScriptGoogleTagManager', + 'useScriptGoogleAdsense', 'useScriptSegment', - 'useScriptFacebookPixel', + 'useScriptMetaPixel', 'useScriptXPixel', 'useScriptIntercom', 'useScriptHotjar', 'useScriptStripe', 'useScriptLemonSqueezy', 'useScriptVimeoPlayer', - 'useScriptYouTubeIframe', + 'useScriptYouTubePlayer', 'useScriptGoogleMaps', 'useScriptNpm', ], diff --git a/packages/nuxt/test/auto-imports.test.ts b/packages/nuxt/test/auto-imports.test.ts index 3f8807dc3..f41736917 100644 --- a/packages/nuxt/test/auto-imports.test.ts +++ b/packages/nuxt/test/auto-imports.test.ts @@ -6,8 +6,9 @@ import * as VueFunctions from 'vue' import type { Import } from 'unimport' import { createUnimport } from 'unimport' import type { Plugin } from 'vite' +import { registry as scriptRegistry } from '@nuxt/scripts/registry' import { TransformPlugin } from '../src/imports/transform' -import { defaultPresets } from '../src/imports/presets' +import { defaultPresets, scriptsStubsPreset } from '../src/imports/presets' describe('imports:transform', () => { const imports: Import[] = [ @@ -193,3 +194,21 @@ describe('imports:vue', () => { }) } }) + +describe('imports:nuxt/scripts', () => { + const scripts = scriptRegistry().map(s => s.import?.name).filter(Boolean) + const globalScripts = new Set([ + 'useScript', + 'useAnalyticsPageEvent', + 'useElementScriptTrigger', + 'useConsentScriptTrigger', + ]) + it.each(scriptsStubsPreset.imports)(`should register %s from @nuxt/scripts`, (name) => { + if (globalScripts.has(name)) { return } + + expect(scripts).toContain(name) + }) + it.each(scripts)(`should register %s from @nuxt/scripts`, (name) => { + expect(scriptsStubsPreset.imports).toContain(name) + }) +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 86d9c1660..ec7ca3f7f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -257,7 +257,7 @@ importers: version: 2.0.2 '@nuxt/devtools': specifier: ^1.3.3 - version: 1.3.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(nuxt@packages+nuxt)(rollup@4.18.0)(unocss@0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)) + version: 1.3.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(nuxt@packages+nuxt)(rollup@4.18.0)(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)) '@nuxt/kit': specifier: workspace:* version: link:../kit @@ -427,6 +427,9 @@ importers: specifier: ^4.3.3 version: 4.3.3(vue@3.4.27(typescript@5.4.5)) devDependencies: + '@nuxt/scripts': + specifier: ^0.4.7 + version: 0.4.7(@nuxt/devtools@1.3.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(nuxt@packages+nuxt)(rollup@4.18.0)(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)))(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(@vue/compiler-core@3.4.27)(ioredis@5.3.2)(nuxt@packages+nuxt)(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5))(webpack@5.91.0(esbuild@0.21.5)) '@nuxt/ui-templates': specifier: workspace:* version: link:../ui-templates @@ -619,7 +622,7 @@ importers: version: 1.3.0 unocss: specifier: 0.60.4 - version: 0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) + version: 0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) vite: specifier: 5.2.13 version: 5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0) @@ -1951,6 +1954,18 @@ packages: resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} engines: {node: '>=18.18'} + '@iconify-json/carbon@1.1.35': + resolution: {integrity: sha512-zKqioWceqFRiLJvxpjcCpVP3j2YcokYshlbwSAHBhOih5XNUymUS3hm1kpV4KljMI1xWH96UcozHaaf6x4YzdA==} + + '@iconify-json/logos@1.1.43': + resolution: {integrity: sha512-UtvL1yDHUr9dl1Tqihh6K9m5dmbYKOYyLf3i9aKhymSW76QjOCGjpgQc0PQ4GJCAdU1cAMu+WO61TgPxdonrlg==} + + '@iconify-json/ri@1.1.20': + resolution: {integrity: sha512-yScIGjLFBCJKWKskQTWRjNI2Awoq+VRDkRxEsCQvSfdz41n+xkRtFG2K6J1OVI90ClRHfjFC8VJ2+WzxxyFjTQ==} + + '@iconify-json/tabler@1.1.113': + resolution: {integrity: sha512-dT34D0gyqxgK2t91+8scQ+U387yZ/zb4r7/3CHqhmvaVMsnOT8DFtX0FhJzdr6ldnVH82pGAp59GGr97IT/UfQ==} + '@iconify/types@2.0.0': resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} @@ -2098,6 +2113,11 @@ packages: nuxt: workspace:* vite: 5.2.13 + '@nuxt/devtools-ui-kit@1.3.3': + resolution: {integrity: sha512-vM9dcb/CLXf1big6SmhVL0mh/JzNtZaJwHMYDd3vqv7jAedGuNfURDSGGVYQRFlSFisA3Cn0TnjDDs+dPrGuAA==} + peerDependencies: + '@nuxt/devtools': 1.3.3 + '@nuxt/devtools-wizard@1.3.3': resolution: {integrity: sha512-9Umo9eDgwhSBDnTzWINXwJBYy2J3ay6OviM7Qdr08B9hDu+CU6MrEpsT4hZ3npD7p1E+9t1YQw/4fZ8NMcPVnw==} hasBin: true @@ -2125,6 +2145,9 @@ packages: peerDependencies: webpack: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 + '@nuxt/scripts@0.4.7': + resolution: {integrity: sha512-zVP7tF3rmO2ZqQW5Hmmy0NQ4WYH+8ye1QBseSJZ0Ab1pDQEpWX+CI7tVak7Fw7IWVnrAcjIMh6TJFt0zQ/ARjg==} + '@nuxt/telemetry@2.5.4': resolution: {integrity: sha512-KH6wxzsNys69daSO0xUv0LEBAfhwwjK1M+0Cdi1/vxmifCslMIY7lN11B4eywSfscbyVPAYJvANyc7XiVPImBQ==} hasBin: true @@ -2170,6 +2193,9 @@ packages: vitest: optional: true + '@nuxtjs/color-mode@3.4.1': + resolution: {integrity: sha512-vZgJqDstxInGw3RGSWbLoCLXtU1mvh1LLeuEA/X3a++DYA4ifwSbNoiSiOyb9qZHFEwz1Xr99H71sXV4IhOaEg==} + '@nuxtjs/mdc@0.5.0': resolution: {integrity: sha512-480Ajc7o/YAl9b21btd0oRtVe/UjUWmVSEWauS+H+izwEGdGvJTVfZRdaiAXcXKl+UmUTpf+POel027sE9HAZQ==} @@ -2445,6 +2471,9 @@ packages: '@shikijs/core@1.3.0': resolution: {integrity: sha512-7fedsBfuILDTBmrYZNFI8B6ATTxhQAasUHllHmjvSZPnoq4bULWoTpHwmuQvZ8Aq03/tAa2IGo6RXqWtHdWaCA==} + '@shikijs/core@1.6.3': + resolution: {integrity: sha512-QnJKHFUW95GnlJLJGP6QLx4M69HM0KlXk+R2Y8lr/x4nAx1Yb/lsuxq4XwybuUjTxbJk+BT0g/kvn0bcsjGGHg==} + '@shikijs/transformers@1.1.2': resolution: {integrity: sha512-tldkUMW7RBkU2F6eXbiRMw3ja+hQer1EjwhD2NGOv6K0pgZdVp3JKjU8uisRtg65tyBqrVHq7zlLHVk7EKmUZA==} @@ -2581,6 +2610,9 @@ packages: '@types/fs-extra@11.0.4': resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} + '@types/google.maps@3.55.9': + resolution: {integrity: sha512-phaOMtezbT3NaXPKiI3m0OosUS7Nly0auw3Be5s/CgMWLVoDAUP1Yb/Ld0TRoRp8ibrlT4VqM5kmzfvUA0UNLQ==} + '@types/hash-sum@1.0.2': resolution: {integrity: sha512-UP28RddqY8xcU0SCEp9YKutQICXpaAq9N8U2klqF5hegGha7KzTOL8EdhIIV3bOSGBzjEpN9bU/d+nNZBdJYVw==} @@ -2653,6 +2685,9 @@ packages: '@types/source-list-map@0.1.4': resolution: {integrity: sha512-Kdfm7Sk5VX8dFW7Vbp18+fmAatBewzBILa1raHYxrGEFXT0jNl9x3LWfuW7bTbjEKFNey9Dfkj/UzT6z/NvRlg==} + '@types/stripe-v3@3.1.33': + resolution: {integrity: sha512-fIE7F7alypCrnIMsk4naprHf8kXEvPM2Q9FGdL/3TDeGM0xlHohdVWkwuaEZ2tKzXB9QQKoS8k+ocLkPjZajwQ==} + '@types/tapable@1.0.10': resolution: {integrity: sha512-q8F20SdXG5fdVJQ5yxsVlH+f+oekP42QeHv4s5KlrxTMT0eopXn7ol1rhxMcksf8ph7XNv811iVDE2hOpUvEPg==} @@ -2665,6 +2700,9 @@ packages: '@types/unist@3.0.2': resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} + '@types/vimeo__player@2.18.3': + resolution: {integrity: sha512-IzSzb6doT4I4uAnBHa+mBCiNtK7iAllEJjtpkX0sKY6/s1Vi+aX1134IAiPgiyFlMvFab/oZQpSeccK4r0/T2A==} + '@types/web-bluetooth@0.0.20': resolution: {integrity: sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==} @@ -2690,6 +2728,9 @@ packages: '@types/yargs@17.0.28': resolution: {integrity: sha512-N3e3fkS86hNhtk6BEnc0rj3zcehaxx8QWhCROJkqpl5Zaoi7nAic3jH8q94jVD3zu5LGk+PUB6KAiDmimYOEQw==} + '@types/youtube@0.0.50': + resolution: {integrity: sha512-d4GpH4uPYp9W07kc487tiq6V/EUHl18vZWFMbQoe4Sk9LXEWzFi/BMf9x7TI4m7/j7gU3KeX8H6M8aPBgykeLw==} + '@typescript-eslint/eslint-plugin@7.9.0': resolution: {integrity: sha512-6e+X0X3sFe/G/54aC3jt0txuMTURqLyekmEHViqyA2VnxhLMpvA6nqmcjIy+Cr9tLDHPssA74BP5Mx9HQIxBEA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -2797,6 +2838,9 @@ packages: '@unocss/inspector@0.60.4': resolution: {integrity: sha512-PcnrEQ2H7osZho4Nh0+84O4IXzlkF7pvTUe/7FTJYF1HQGWHB/PfOSoyKn7/sF5sED8hMK9RlSJ9YGUH9ioY+g==} + '@unocss/nuxt@0.60.4': + resolution: {integrity: sha512-2lv7tsVlAnGMqqImfZPLm05dtDo3Og0VDrHOAwFwL4XiVaTLXEXQfAf/bOBDRy4qpJ2nFDj9eltuoQYWto1jmA==} + '@unocss/postcss@0.60.4': resolution: {integrity: sha512-mHha4BoOpCWRRL5EFJqsj+BiYxOBPXUZDFbSWmA8oAMBwcA/yqtnaRF2tqI9CK+CDfhmtbYF64KdTLh9pf6BvQ==} engines: {node: '>=14'} @@ -2857,6 +2901,11 @@ packages: peerDependencies: vite: 5.2.13 + '@unocss/webpack@0.60.4': + resolution: {integrity: sha512-TcPuiAZZO+a+xiahrCm7eEHlP8o667n+CWv+kpz4bidY5V8Xyxs1MjzJAPVOk8Kwz86HvQZyf2CG+3powNTwKA==} + peerDependencies: + webpack: ^4 || ^5 + '@vercel/nft@0.26.4': resolution: {integrity: sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==} engines: {node: '>=16'} @@ -3029,6 +3078,9 @@ packages: '@vueuse/components@10.9.0': resolution: {integrity: sha512-BHQpA0yIi3y7zKa1gYD0FUzLLkcRTqVhP8smnvsCK6GFpd94Nziq1XVPD7YpFeho0k5BzbBiNZF7V/DpkJ967A==} + '@vueuse/core@10.10.0': + resolution: {integrity: sha512-vexJ/YXYs2S42B783rI95lMt3GzEwkxzC8Hb0Ndpd8rD+p+Lk/Za4bd797Ym7yq4jXqdSyj3JLChunF/vyYjUw==} + '@vueuse/core@10.9.0': resolution: {integrity: sha512-/1vjTol8SXnx6xewDEKfS0Ra//ncg4Hb0DaZiwKf7drgfMsKFExQ+FnnENcN6efPen+1kIzhLQoGSy0eDUVOMg==} @@ -3073,9 +3125,20 @@ packages: universal-cookie: optional: true + '@vueuse/metadata@10.10.0': + resolution: {integrity: sha512-UNAo2sTCAW5ge6OErPEHb5z7NEAg3XcO9Cj7OK45aZXfLLH1QkexDcZD77HBi5zvEiLOm1An+p/4b5K3Worpug==} + '@vueuse/metadata@10.9.0': resolution: {integrity: sha512-iddNbg3yZM0X7qFY2sAotomgdHK7YJ6sKUvQqbvwnf7TmaVPxS4EJydcNsVejNdS8iWCtDk+fYXr7E32nyTnGA==} + '@vueuse/nuxt@10.10.0': + resolution: {integrity: sha512-l8uFNuFASmcjPEaKAbigUrQZDtVQ9wRTfbuIBEpr3oAGnYtXGwBoQqYGnZopUR1Kdh8qiurpKuwvzVQnrzDjyw==} + peerDependencies: + nuxt: workspace:* + + '@vueuse/shared@10.10.0': + resolution: {integrity: sha512-2aW33Ac0Uk0U+9yo3Ypg9s5KcR42cuehRWl7vnUHadQyFvCktseyxxEPBi1Eiq4D2yBGACOnqLZpx1eMc7g5Og==} + '@vueuse/shared@10.9.0': resolution: {integrity: sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==} @@ -6579,6 +6642,9 @@ packages: shiki@1.3.0: resolution: {integrity: sha512-9aNdQy/etMXctnPzsje1h1XIGm9YfRcSksKOGqZWXA/qP9G18/8fpz5Bjpma8bOgz3tqIpjERAd6/lLjFyzoww==} + shiki@1.6.3: + resolution: {integrity: sha512-lE1/YGlzFY0hQSyEfsZj18xGrTWxyhFQkaiILALqTBZPbJeYFWpbUhlmTGPOupYB/qC+H6sV4UznJzcEh3WMHQ==} + side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} @@ -6855,6 +6921,9 @@ packages: peerDependencies: tslib: ^2 + third-party-capital@1.0.30: + resolution: {integrity: sha512-hiXyTwFcgmVBCfhPZz92OxqBvd36EbsI6LVesOCHGVcgQwmSM/mr4GC6AkbPiR6KdOkfsGctoqrHII7n3UZRFg==} + time-fix-plugin@2.0.7: resolution: {integrity: sha512-uVFet1LQToeUX0rTcSiYVYVoGuBpc8gP/2jnlUzuHMHe+gux6XLsNzxLUweabMwiUj5ejhoIMsUI55nVSEa/Vw==} peerDependencies: @@ -7168,6 +7237,14 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + v-lazy-show@0.2.4: + resolution: {integrity: sha512-Lx9Str2i+HTh+zGzs9O3YyhGAZOAAfU+6MUUPcQPPiPxQO1sHBEv9sH3MO9bPc4T09gsjsS2+sbaCWQ1MdhpJQ==} + peerDependencies: + '@vue/compiler-core': ^3.3 + + valibot@0.30.0: + resolution: {integrity: sha512-5POBdbSkM+3nvJ6ZlyQHsggisfRtyT4tVTo1EIIShs6qCdXJnyWU5TJ68vr8iTg5zpOLjXLRiBqNx+9zwZz/rA==} + validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} @@ -8363,6 +8440,22 @@ snapshots: '@humanwhocodes/retry@0.3.0': {} + '@iconify-json/carbon@1.1.35': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify-json/logos@1.1.43': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify-json/ri@1.1.20': + dependencies: + '@iconify/types': 2.0.0 + + '@iconify-json/tabler@1.1.113': + dependencies: + '@iconify/types': 2.0.0 + '@iconify/types@2.0.0': {} '@iconify/utils@2.1.24': @@ -8563,6 +8656,53 @@ snapshots: nuxt: link:packages/nuxt vite: 5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0) + '@nuxt/devtools-ui-kit@1.3.3(@nuxt/devtools@1.3.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(nuxt@packages+nuxt)(rollup@4.18.0)(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)))(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(@vue/compiler-core@3.4.27)(nuxt@packages+nuxt)(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5))(webpack@5.91.0(esbuild@0.21.5))': + dependencies: + '@iconify-json/carbon': 1.1.35 + '@iconify-json/logos': 1.1.43 + '@iconify-json/ri': 1.1.20 + '@iconify-json/tabler': 1.1.113 + '@nuxt/devtools': 1.3.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(nuxt@packages+nuxt)(rollup@4.18.0)(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)) + '@nuxt/devtools-kit': 1.3.3(nuxt@packages+nuxt)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) + '@nuxt/kit': link:packages/kit + '@nuxtjs/color-mode': 3.4.1 + '@unocss/core': 0.60.4 + '@unocss/nuxt': 0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(webpack@5.91.0(esbuild@0.21.5)) + '@unocss/preset-attributify': 0.60.4 + '@unocss/preset-icons': 0.60.4 + '@unocss/preset-mini': 0.60.4 + '@unocss/reset': 0.60.4 + '@vueuse/core': 10.10.0(vue@3.4.27(typescript@5.4.5)) + '@vueuse/integrations': 10.9.0(focus-trap@7.5.4)(vue@3.4.27(typescript@5.4.5)) + '@vueuse/nuxt': 10.10.0(nuxt@packages+nuxt)(vue@3.4.27(typescript@5.4.5)) + defu: 6.1.4 + focus-trap: 7.5.4 + splitpanes: 3.1.5 + unocss: 0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) + v-lazy-show: 0.2.4(@vue/compiler-core@3.4.27) + transitivePeerDependencies: + - '@unocss/webpack' + - '@vue/compiler-core' + - '@vue/composition-api' + - async-validator + - axios + - change-case + - drauu + - fuse.js + - idb-keyval + - jwt-decode + - nprogress + - nuxt + - postcss + - qrcode + - rollup + - sortablejs + - supports-color + - universal-cookie + - vite + - vue + - webpack + '@nuxt/devtools-wizard@1.3.3': dependencies: consola: 3.2.3 @@ -8576,13 +8716,13 @@ snapshots: rc9: 2.1.2 semver: 7.6.2 - '@nuxt/devtools@1.3.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(nuxt@packages+nuxt)(rollup@4.18.0)(unocss@0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5))': + '@nuxt/devtools@1.3.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(nuxt@packages+nuxt)(rollup@4.18.0)(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5))': dependencies: '@antfu/utils': 0.7.8 '@nuxt/devtools-kit': 1.3.3(nuxt@packages+nuxt)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) '@nuxt/devtools-wizard': 1.3.3 '@nuxt/kit': link:packages/kit - '@vue/devtools-applet': 7.1.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(unocss@0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)) + '@vue/devtools-applet': 7.1.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)) '@vue/devtools-core': 7.1.3(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)) '@vue/devtools-kit': 7.1.3(vue@3.4.27(typescript@5.4.5)) birpc: 0.2.17 @@ -8682,6 +8822,74 @@ snapshots: string-width: 4.2.3 webpack: 5.91.0 + '@nuxt/scripts@0.4.7(@nuxt/devtools@1.3.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(nuxt@packages+nuxt)(rollup@4.18.0)(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)))(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(@vue/compiler-core@3.4.27)(ioredis@5.3.2)(nuxt@packages+nuxt)(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5))(webpack@5.91.0(esbuild@0.21.5))': + dependencies: + '@nuxt/devtools-kit': 1.3.3(nuxt@packages+nuxt)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) + '@nuxt/devtools-ui-kit': 1.3.3(@nuxt/devtools@1.3.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(nuxt@packages+nuxt)(rollup@4.18.0)(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)))(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(@vue/compiler-core@3.4.27)(nuxt@packages+nuxt)(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5))(webpack@5.91.0(esbuild@0.21.5)) + '@nuxt/kit': link:packages/kit + '@types/google.maps': 3.55.9 + '@types/stripe-v3': 3.1.33 + '@types/vimeo__player': 2.18.3 + '@types/youtube': 0.0.50 + '@unhead/vue': 1.9.12(vue@3.4.27(typescript@5.4.5)) + '@vueuse/core': 10.10.0(vue@3.4.27(typescript@5.4.5)) + consola: 3.2.3 + defu: 6.1.4 + estree-walker: 3.0.3 + h3: 1.11.1 + magic-string: 0.30.10 + mlly: 1.7.1 + ofetch: 1.3.4 + ohash: 1.1.3 + pathe: 1.1.2 + pkg-types: 1.1.1 + semver: 7.6.2 + shiki: 1.6.3 + sirv: 2.0.4 + std-env: 3.7.0 + third-party-capital: 1.0.30 + ufo: 1.5.3 + unimport: 3.7.2(rollup@4.18.0) + unplugin: 1.10.1 + unstorage: 1.10.2(ioredis@5.3.2) + valibot: 0.30.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@nuxt/devtools' + - '@planetscale/database' + - '@unocss/webpack' + - '@upstash/redis' + - '@vercel/kv' + - '@vue/compiler-core' + - '@vue/composition-api' + - async-validator + - axios + - change-case + - drauu + - fuse.js + - idb-keyval + - ioredis + - jwt-decode + - nprogress + - nuxt + - postcss + - qrcode + - rollup + - sortablejs + - supports-color + - uWebSockets.js + - universal-cookie + - vite + - vue + - webpack + '@nuxt/telemetry@2.5.4': dependencies: '@nuxt/kit': link:packages/kit @@ -8739,6 +8947,13 @@ snapshots: playwright-core: 1.44.1 vitest: 1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0) + '@nuxtjs/color-mode@3.4.1': + dependencies: + '@nuxt/kit': link:packages/kit + pathe: 1.1.2 + pkg-types: 1.1.1 + semver: 7.6.2 + '@nuxtjs/mdc@0.5.0': dependencies: '@nuxt/kit': link:packages/kit @@ -8982,6 +9197,8 @@ snapshots: '@shikijs/core@1.3.0': {} + '@shikijs/core@1.6.3': {} + '@shikijs/transformers@1.1.2': dependencies: shiki: 1.1.2 @@ -9166,6 +9383,8 @@ snapshots: '@types/jsonfile': 6.1.2 '@types/node': 20.12.12 + '@types/google.maps@3.55.9': {} + '@types/hash-sum@1.0.2': {} '@types/hast@3.0.4': @@ -9243,6 +9462,8 @@ snapshots: '@types/source-list-map@0.1.4': {} + '@types/stripe-v3@3.1.33': {} + '@types/tapable@1.0.10': {} '@types/uglify-js@3.17.3': @@ -9253,6 +9474,8 @@ snapshots: '@types/unist@3.0.2': {} + '@types/vimeo__player@2.18.3': {} + '@types/web-bluetooth@0.0.20': {} '@types/webpack-bundle-analyzer@4.7.0': @@ -9302,6 +9525,8 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.1 + '@types/youtube@0.0.50': {} + '@typescript-eslint/eslint-plugin@7.9.0(@typescript-eslint/parser@7.9.0(eslint@9.4.0)(typescript@5.4.5))(eslint@9.4.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.10.0 @@ -9464,6 +9689,29 @@ snapshots: gzip-size: 6.0.0 sirv: 2.0.4 + '@unocss/nuxt@0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(webpack@5.91.0(esbuild@0.21.5))': + dependencies: + '@nuxt/kit': link:packages/kit + '@unocss/config': 0.60.4 + '@unocss/core': 0.60.4 + '@unocss/preset-attributify': 0.60.4 + '@unocss/preset-icons': 0.60.4 + '@unocss/preset-tagify': 0.60.4 + '@unocss/preset-typography': 0.60.4 + '@unocss/preset-uno': 0.60.4 + '@unocss/preset-web-fonts': 0.60.4 + '@unocss/preset-wind': 0.60.4 + '@unocss/reset': 0.60.4 + '@unocss/vite': 0.60.4(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) + '@unocss/webpack': 0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)) + unocss: 0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) + transitivePeerDependencies: + - postcss + - rollup + - supports-color + - vite + - webpack + '@unocss/postcss@0.60.4(postcss@8.4.38)': dependencies: '@unocss/config': 0.60.4 @@ -9571,6 +9819,21 @@ snapshots: transitivePeerDependencies: - rollup + '@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5))': + dependencies: + '@ampproject/remapping': 2.3.0 + '@rollup/pluginutils': 5.1.0(rollup@4.18.0) + '@unocss/config': 0.60.4 + '@unocss/core': 0.60.4 + chokidar: 3.6.0 + fast-glob: 3.3.2 + magic-string: 0.30.10 + unplugin: 1.10.1 + webpack: 5.91.0(esbuild@0.21.5) + webpack-sources: 3.2.3 + transitivePeerDependencies: + - rollup + '@vercel/nft@0.26.4(encoding@0.1.13)': dependencies: '@mapbox/node-pre-gyp': 1.0.11(encoding@0.1.13) @@ -9777,12 +10040,12 @@ snapshots: '@vue/devtools-api@6.6.3': {} - '@vue/devtools-applet@7.1.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(unocss@0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5))': + '@vue/devtools-applet@7.1.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5))': dependencies: '@vue/devtools-core': 7.1.3(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)) '@vue/devtools-kit': 7.1.3(vue@3.4.27(typescript@5.4.5)) '@vue/devtools-shared': 7.1.3 - '@vue/devtools-ui': 7.1.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(unocss@0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vue@3.4.27(typescript@5.4.5)) + '@vue/devtools-ui': 7.1.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vue@3.4.27(typescript@5.4.5)) lodash-es: 4.17.21 perfect-debounce: 1.0.0 shiki: 1.3.0 @@ -9832,7 +10095,7 @@ snapshots: dependencies: rfdc: 1.3.1 - '@vue/devtools-ui@7.1.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(unocss@0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vue@3.4.27(typescript@5.4.5))': + '@vue/devtools-ui@7.1.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vue@3.4.27(typescript@5.4.5))': dependencies: '@unocss/reset': 0.60.4 '@vue/devtools-shared': 7.1.3 @@ -9842,7 +10105,7 @@ snapshots: colord: 2.9.3 floating-vue: 5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)) focus-trap: 7.5.4 - unocss: 0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) + unocss: 0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) vue: 3.4.27(typescript@5.4.5) transitivePeerDependencies: - '@vue/composition-api' @@ -9921,6 +10184,16 @@ snapshots: - '@vue/composition-api' - vue + '@vueuse/core@10.10.0(vue@3.4.27(typescript@5.4.5))': + dependencies: + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 10.10.0 + '@vueuse/shared': 10.10.0(vue@3.4.27(typescript@5.4.5)) + vue-demi: 0.14.7(vue@3.4.27(typescript@5.4.5)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + '@vueuse/core@10.9.0(vue@3.4.27(typescript@5.4.5))': dependencies: '@types/web-bluetooth': 0.0.20 @@ -9942,8 +10215,29 @@ snapshots: - '@vue/composition-api' - vue + '@vueuse/metadata@10.10.0': {} + '@vueuse/metadata@10.9.0': {} + '@vueuse/nuxt@10.10.0(nuxt@packages+nuxt)(vue@3.4.27(typescript@5.4.5))': + dependencies: + '@nuxt/kit': link:packages/kit + '@vueuse/core': 10.10.0(vue@3.4.27(typescript@5.4.5)) + '@vueuse/metadata': 10.10.0 + local-pkg: 0.5.0 + nuxt: link:packages/nuxt + vue-demi: 0.14.7(vue@3.4.27(typescript@5.4.5)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + + '@vueuse/shared@10.10.0(vue@3.4.27(typescript@5.4.5))': + dependencies: + vue-demi: 0.14.7(vue@3.4.27(typescript@5.4.5)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + '@vueuse/shared@10.9.0(vue@3.4.27(typescript@5.4.5))': dependencies: vue-demi: 0.14.7(vue@3.4.27(typescript@5.4.5)) @@ -14099,6 +14393,10 @@ snapshots: dependencies: '@shikijs/core': 1.3.0 + shiki@1.6.3: + dependencies: + '@shikijs/core': 1.6.3 + side-channel@1.0.4: dependencies: call-bind: 1.0.7 @@ -14338,6 +14636,17 @@ snapshots: mkdirp: 1.0.4 yallist: 4.0.0 + terser-webpack-plugin@5.3.10(esbuild@0.21.5)(webpack@5.91.0(esbuild@0.21.5)): + dependencies: + '@jridgewell/trace-mapping': 0.3.25 + jest-worker: 27.5.1 + schema-utils: 3.3.0 + serialize-javascript: 6.0.2 + terser: 5.27.0 + webpack: 5.91.0(esbuild@0.21.5) + optionalDependencies: + esbuild: 0.21.5 + terser-webpack-plugin@5.3.10(webpack@5.91.0): dependencies: '@jridgewell/trace-mapping': 0.3.25 @@ -14366,6 +14675,10 @@ snapshots: dependencies: tslib: 2.6.2 + third-party-capital@1.0.30: + dependencies: + semver: 7.6.2 + time-fix-plugin@2.0.7(webpack@5.91.0): dependencies: webpack: 5.91.0 @@ -14594,7 +14907,7 @@ snapshots: universalify@2.0.0: {} - unocss@0.60.4(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)): + unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)): dependencies: '@unocss/astro': 0.60.4(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) '@unocss/cli': 0.60.4(rollup@4.18.0) @@ -14617,6 +14930,7 @@ snapshots: '@unocss/transformer-variant-group': 0.60.4 '@unocss/vite': 0.60.4(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)) optionalDependencies: + '@unocss/webpack': 0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)) vite: 5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0) transitivePeerDependencies: - postcss @@ -14724,6 +15038,12 @@ snapshots: util-deprecate@1.0.2: {} + v-lazy-show@0.2.4(@vue/compiler-core@3.4.27): + dependencies: + '@vue/compiler-core': 3.4.27 + + valibot@0.30.0: {} + validate-npm-package-license@3.0.4: dependencies: spdx-correct: 3.2.0 @@ -15133,6 +15453,37 @@ snapshots: - esbuild - uglify-js + webpack@5.91.0(esbuild@0.21.5): + dependencies: + '@types/eslint-scope': 3.7.6 + '@types/estree': 1.0.5 + '@webassemblyjs/ast': 1.12.1 + '@webassemblyjs/wasm-edit': 1.12.1 + '@webassemblyjs/wasm-parser': 1.12.1 + acorn: 8.11.3 + acorn-import-assertions: 1.9.0(acorn@8.11.3) + browserslist: 4.23.0 + chrome-trace-event: 1.0.3 + enhanced-resolve: 5.16.0 + es-module-lexer: 1.3.1 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.0 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 3.3.0 + tapable: 2.2.1 + terser-webpack-plugin: 5.3.10(esbuild@0.21.5)(webpack@5.91.0(esbuild@0.21.5)) + watchpack: 2.4.1 + webpack-sources: 3.2.3 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + webpackbar@6.0.1(webpack@5.91.0): dependencies: ansi-escapes: 4.3.2 From 52b85a886ba522bb97c51f6eb6ac3904a2b4de93 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 11 Jun 2024 10:34:22 +0100 Subject: [PATCH 21/31] test: update scrolling test --- test/fixtures/basic/modules/page-extend/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/fixtures/basic/modules/page-extend/index.ts b/test/fixtures/basic/modules/page-extend/index.ts index 15c18599c..b5b18ffbe 100644 --- a/test/fixtures/basic/modules/page-extend/index.ts +++ b/test/fixtures/basic/modules/page-extend/index.ts @@ -16,9 +16,15 @@ export default defineNuxtModule({ }, { path: '/big-page-1', file: resolver.resolve('./pages/big-page.vue'), + meta: { + layout: false + } }, { path: '/big-page-2', file: resolver.resolve('./pages/big-page.vue'), + meta: { + layout: false + } }) }) }, From 4db02e11f47e4bc57010bc53073e1525e1839ccf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 10:35:01 +0100 Subject: [PATCH 22/31] chore(deps): pin devdependency @nuxt/scripts to 0.4.7 (main) (#27523) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/nuxt/package.json | 2 +- pnpm-lock.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index a1debe956..ef0869ca6 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -118,7 +118,7 @@ "vue-router": "^4.3.3" }, "devDependencies": { - "@nuxt/scripts": "^0.4.7", + "@nuxt/scripts": "0.4.7", "@nuxt/ui-templates": "1.3.4", "@parcel/watcher": "2.4.1", "@types/estree": "1.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ec7ca3f7f..9a914d3da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -428,7 +428,7 @@ importers: version: 4.3.3(vue@3.4.27(typescript@5.4.5)) devDependencies: '@nuxt/scripts': - specifier: ^0.4.7 + specifier: 0.4.7 version: 0.4.7(@nuxt/devtools@1.3.3(@unocss/reset@0.60.4)(floating-vue@5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)))(nuxt@packages+nuxt)(rollup@4.18.0)(unocss@0.60.4(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0)))(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5)))(@unocss/webpack@0.60.4(rollup@4.18.0)(webpack@5.91.0(esbuild@0.21.5)))(@vue/compiler-core@3.4.27)(ioredis@5.3.2)(nuxt@packages+nuxt)(postcss@8.4.38)(rollup@4.18.0)(vite@5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0))(vue@3.4.27(typescript@5.4.5))(webpack@5.91.0(esbuild@0.21.5)) '@nuxt/ui-templates': specifier: workspace:* @@ -8985,7 +8985,7 @@ snapshots: remark-parse: 11.0.0 remark-rehype: 11.1.0 scule: 1.3.0 - shiki: 1.3.0 + shiki: 1.6.3 ufo: 1.5.3 unified: 11.0.4 unist-builder: 4.0.0 @@ -10100,7 +10100,7 @@ snapshots: '@unocss/reset': 0.60.4 '@vue/devtools-shared': 7.1.3 '@vueuse/components': 10.9.0(vue@3.4.27(typescript@5.4.5)) - '@vueuse/core': 10.9.0(vue@3.4.27(typescript@5.4.5)) + '@vueuse/core': 10.10.0(vue@3.4.27(typescript@5.4.5)) '@vueuse/integrations': 10.9.0(focus-trap@7.5.4)(vue@3.4.27(typescript@5.4.5)) colord: 2.9.3 floating-vue: 5.2.2(@nuxt/kit@packages+kit)(vue@3.4.27(typescript@5.4.5)) From 1d2eee00d00aad50be3cc36c4c8a695c2547867b Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 11 Jun 2024 10:56:24 +0100 Subject: [PATCH 23/31] docs: update more references to v3.12 --- docs/2.guide/3.going-further/1.features.md | 2 +- docs/3.api/1.components/12.nuxt-route-announcer.md | 2 +- docs/3.api/2.composables/on-prehydrate.md | 2 +- docs/3.api/2.composables/use-route-announcer.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/2.guide/3.going-further/1.features.md b/docs/2.guide/3.going-further/1.features.md index 4ec31794a..02056f1e1 100644 --- a/docs/2.guide/3.going-further/1.features.md +++ b/docs/2.guide/3.going-further/1.features.md @@ -40,7 +40,7 @@ There is also a `future` namespace for early opting-in to new features that will ### compatibilityVersion ::important -This configuration option is available in Nuxt v3.12+ or in [the nightly release channel](/docs/guide/going-further/nightly-release-channel). +This configuration option is available in Nuxt v3.12+. :: This enables early access to Nuxt features or flags. diff --git a/docs/3.api/1.components/12.nuxt-route-announcer.md b/docs/3.api/1.components/12.nuxt-route-announcer.md index 4f6e90862..b53f9fa92 100644 --- a/docs/3.api/1.components/12.nuxt-route-announcer.md +++ b/docs/3.api/1.components/12.nuxt-route-announcer.md @@ -11,7 +11,7 @@ links: --- ::important -This component will be available in Nuxt v3.12 or in [the nightly release channel](/docs/guide/going-further/nightly-release-channel). +This component is available in Nuxt v3.12+. :: ## Usage diff --git a/docs/3.api/2.composables/on-prehydrate.md b/docs/3.api/2.composables/on-prehydrate.md index 79073123a..1f034d6ce 100644 --- a/docs/3.api/2.composables/on-prehydrate.md +++ b/docs/3.api/2.composables/on-prehydrate.md @@ -10,7 +10,7 @@ links: --- ::important -This composable will be available in Nuxt v3.12+ or in [the nightly release channel](/docs/guide/going-further/nightly-release-channel). +This composable is available in Nuxt v3.12+. :: `onPrehydrate` is a composable lifecycle hook that allows you to run a callback on the client immediately before diff --git a/docs/3.api/2.composables/use-route-announcer.md b/docs/3.api/2.composables/use-route-announcer.md index c3272631f..1111eec0a 100644 --- a/docs/3.api/2.composables/use-route-announcer.md +++ b/docs/3.api/2.composables/use-route-announcer.md @@ -11,7 +11,7 @@ links: --- ::important -This composable will be available in Nuxt v3.12 or in [the nightly release channel](/docs/guide/going-further/nightly-release-channel). +This composable is available in Nuxt v3.12+. :: ## Description From b7d4a5767bdf401bba7c628fedc8542009dc2655 Mon Sep 17 00:00:00 2001 From: Alexander Lichter Date: Tue, 11 Jun 2024 11:56:40 +0200 Subject: [PATCH 24/31] docs: mention 3.12 for testing nuxt 4 (#27525) --- docs/1.getting-started/12.upgrade.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/1.getting-started/12.upgrade.md b/docs/1.getting-started/12.upgrade.md index 323abdb1d..3017305c7 100644 --- a/docs/1.getting-started/12.upgrade.md +++ b/docs/1.getting-started/12.upgrade.md @@ -23,7 +23,7 @@ To use the latest Nuxt build and test features before their release, read about Nuxt 4 is planned to be released **on or before June 14** (though obviously this is dependent on having enough time after Nitro's major release to be properly tested in the community, so be aware that this is not an exact date). -Until then, it is possible to test many of Nuxt 4's breaking changes on the nightly release channel. +Until then, it is possible to test many of Nuxt 4's breaking changes from Nuxt version 3.12 or via the nightly release channel. ::tip{icon="i-ph-video-duotone" to="https://www.youtube.com/watch?v=r4wFKlcJK6c" target="_blank"} Watch a video from Alexander Lichter showing how to opt in to Nuxt 4's breaking changes already. From b7a35fd956dfc651d3abe40596254046654d9575 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 10:59:35 +0100 Subject: [PATCH 25/31] chore(deps): update devdependency prettier to v3.3.2 (main) (#27518) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/ui-templates/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/ui-templates/package.json b/packages/ui-templates/package.json index 131114835..4232030b4 100644 --- a/packages/ui-templates/package.json +++ b/packages/ui-templates/package.json @@ -30,7 +30,7 @@ "knitwork": "1.1.0", "lodash-es": "4.17.21", "pathe": "1.1.2", - "prettier": "3.3.1", + "prettier": "3.3.2", "scule": "1.3.0", "unocss": "0.60.4", "vite": "5.2.13" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a914d3da..1f2997d7c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -615,8 +615,8 @@ importers: specifier: 1.1.2 version: 1.1.2 prettier: - specifier: 3.3.1 - version: 3.3.1 + specifier: 3.3.2 + version: 3.3.2 scule: specifier: 1.3.0 version: 1.3.0 @@ -6224,8 +6224,8 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - prettier@3.3.1: - resolution: {integrity: sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==} + prettier@3.3.2: + resolution: {integrity: sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==} engines: {node: '>=14'} hasBin: true @@ -13861,7 +13861,7 @@ snapshots: prelude-ls@1.2.1: {} - prettier@3.3.1: {} + prettier@3.3.2: {} pretty-bytes@6.1.1: {} From 24b8533e7084ea007940df13410c44ad4771182d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 11 Jun 2024 11:01:21 +0100 Subject: [PATCH 26/31] chore: lint --- test/fixtures/basic/modules/page-extend/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/fixtures/basic/modules/page-extend/index.ts b/test/fixtures/basic/modules/page-extend/index.ts index b5b18ffbe..60ef2c224 100644 --- a/test/fixtures/basic/modules/page-extend/index.ts +++ b/test/fixtures/basic/modules/page-extend/index.ts @@ -17,14 +17,14 @@ export default defineNuxtModule({ path: '/big-page-1', file: resolver.resolve('./pages/big-page.vue'), meta: { - layout: false - } + layout: false, + }, }, { path: '/big-page-2', file: resolver.resolve('./pages/big-page.vue'), meta: { - layout: false - } + layout: false, + }, }) }) }, From a8746af43ff6b55fe43fb43bdb586f38be754c9f Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 11 Jun 2024 12:05:26 +0200 Subject: [PATCH 27/31] refactor(schema): use `CompatibilityDateSpec` (#27521) --- packages/schema/src/config/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index 5f6c866af..89cebec5a 100644 --- a/packages/schema/src/config/common.ts +++ b/packages/schema/src/config/common.ts @@ -28,7 +28,7 @@ export default defineUntypedSchema({ * * We plan to improve the tooling around this feature in the future. * - * @type {typeof import('compatx').DateString | Record} + * @type {typeof import('compatx').CompatibilityDateSpec} */ compatibilityDate: undefined, From d5d9071d76a73b1996d804a525b1284786afd320 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 11 Jun 2024 11:44:53 +0100 Subject: [PATCH 28/31] chore: bump `nuxi` dependency (#27526) --- package.json | 2 +- packages/nuxt/package.json | 2 +- pnpm-lock.yaml | 143 ++----------------------- test/fixtures/basic-types/package.json | 2 +- 4 files changed, 12 insertions(+), 137 deletions(-) diff --git a/package.json b/package.json index e3b0b4b30..eec7837f9 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "jiti": "1.21.6", "markdownlint-cli": "0.41.0", "nitropack": "2.9.6", - "nuxi": "3.11.1", + "nuxi": "3.12.0", "nuxt": "workspace:*", "nuxt-content-twoslash": "0.0.10", "ofetch": "1.3.4", diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index ef0869ca6..487ef079a 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -90,7 +90,7 @@ "magic-string": "^0.30.10", "mlly": "^1.7.1", "nitropack": "^2.9.6", - "nuxi": "^3.11.1", + "nuxi": "^3.12.0", "nypm": "^0.3.8", "ofetch": "^1.3.4", "ohash": "^1.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1f2997d7c..eec32fed9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,8 +111,8 @@ importers: specifier: 2.9.6 version: 2.9.6(encoding@0.1.13) nuxi: - specifier: 3.11.1 - version: 3.11.1 + specifier: 3.12.0 + version: 3.12.0 nuxt: specifier: workspace:* version: link:packages/nuxt @@ -349,8 +349,8 @@ importers: specifier: ^2.9.6 version: 2.9.6(encoding@0.1.13) nuxi: - specifier: ^3.11.1 - version: 3.11.1 + specifier: ^3.12.0 + version: 3.12.0 nypm: specifier: ^0.3.8 version: 0.3.8 @@ -985,8 +985,8 @@ importers: specifier: ^0.7.0 version: 0.7.0(rollup@4.18.0)(vue-router@4.3.3(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) vitest: - specifier: 1.5.3 - version: 1.5.3(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0) + specifier: 1.6.0 + version: 1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0) vue: specifier: 3.4.27 version: 3.4.27(typescript@5.4.5) @@ -2930,33 +2930,18 @@ packages: peerDependencies: vitest: 1.6.0 - '@vitest/expect@1.5.3': - resolution: {integrity: sha512-y+waPz31pOFr3rD7vWTbwiLe5+MgsMm40jTZbQE8p8/qXyBX3CQsIXRx9XK12IbY7q/t5a5aM/ckt33b4PxK2g==} - '@vitest/expect@1.6.0': resolution: {integrity: sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==} - '@vitest/runner@1.5.3': - resolution: {integrity: sha512-7PlfuReN8692IKQIdCxwir1AOaP5THfNkp0Uc4BKr2na+9lALNit7ub9l3/R7MP8aV61+mHKRGiqEKRIwu6iiQ==} - '@vitest/runner@1.6.0': resolution: {integrity: sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==} - '@vitest/snapshot@1.5.3': - resolution: {integrity: sha512-K3mvIsjyKYBhNIDujMD2gfQEzddLe51nNOAf45yKRt/QFJcUIeTQd2trRvv6M6oCBHNVnZwFWbQ4yj96ibiDsA==} - '@vitest/snapshot@1.6.0': resolution: {integrity: sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==} - '@vitest/spy@1.5.3': - resolution: {integrity: sha512-Llj7Jgs6lbnL55WoshJUUacdJfjU2honvGcAJBxhra5TPEzTJH8ZuhI3p/JwqqfnTr4PmP7nDmOXP53MS7GJlg==} - '@vitest/spy@1.6.0': resolution: {integrity: sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==} - '@vitest/utils@1.5.3': - resolution: {integrity: sha512-rE9DTN1BRhzkzqNQO+kw8ZgfeEBCLXiHJwetk668shmNBpSagQxneT5eSqEBLP+cqSiAeecvQmbpFfdMyLcIQA==} - '@vitest/utils@1.6.0': resolution: {integrity: sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==} @@ -5746,8 +5731,8 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - nuxi@3.11.1: - resolution: {integrity: sha512-AW71TpxRHNg8MplQVju9tEFvXPvX42e0wPYknutSStDuAjV99vWTWYed4jxr/grk2FtKAuv2KvdJxcn2W59qyg==} + nuxi@3.12.0: + resolution: {integrity: sha512-6vRdiXTw9SajEQOUi6Ze/XaIXzy1q/sD5UqHQSv3yqTu7Pot5S7fEihNXV8LpcgLz+9HzjVt70r7jYe7R99c2w==} engines: {node: ^16.10.0 || >=18.0.0} hasBin: true @@ -7266,11 +7251,6 @@ packages: peerDependencies: vite: 5.2.13 - vite-node@1.5.3: - resolution: {integrity: sha512-axFo00qiCpU/JLd8N1gu9iEYL3xTbMbMrbe5nDp9GL0nb6gurIdZLkkFogZXWnE8Oyy5kfSLwNVIcVsnhE7lgQ==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - vite-node@1.6.0: resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} engines: {node: ^18.0.0 || >=20.0.0} @@ -7353,31 +7333,6 @@ packages: vitest-environment-nuxt@1.0.0: resolution: {integrity: sha512-AWMO9h4HdbaFdPWZw34gALFI8gbBiOpvfbyeZwHIPfh4kWg/TwElYHvYMQ61WPUlCGaS5LebfHkaI0WPyb//Iw==} - vitest@1.5.3: - resolution: {integrity: sha512-2oM7nLXylw3mQlW6GXnRriw+7YvZFk/YNV8AxIC3Z3MfFbuziLGWP9GPxxu/7nRlXhqyxBikpamr+lEEj1sUEw==} - engines: {node: ^18.0.0 || >=20.0.0} - hasBin: true - peerDependencies: - '@edge-runtime/vm': '*' - '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 1.5.3 - '@vitest/ui': 1.5.3 - happy-dom: '*' - jsdom: '*' - peerDependenciesMeta: - '@edge-runtime/vm': - optional: true - '@types/node': - optional: true - '@vitest/browser': - optional: true - '@vitest/ui': - optional: true - happy-dom: - optional: true - jsdom: - optional: true - vitest@1.6.0: resolution: {integrity: sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -9886,57 +9841,28 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/expect@1.5.3': - dependencies: - '@vitest/spy': 1.5.3 - '@vitest/utils': 1.5.3 - chai: 4.3.10 - '@vitest/expect@1.6.0': dependencies: '@vitest/spy': 1.6.0 '@vitest/utils': 1.6.0 chai: 4.3.10 - '@vitest/runner@1.5.3': - dependencies: - '@vitest/utils': 1.5.3 - p-limit: 5.0.0 - pathe: 1.1.2 - '@vitest/runner@1.6.0': dependencies: '@vitest/utils': 1.6.0 p-limit: 5.0.0 pathe: 1.1.2 - '@vitest/snapshot@1.5.3': - dependencies: - magic-string: 0.30.10 - pathe: 1.1.2 - pretty-format: 29.7.0 - '@vitest/snapshot@1.6.0': dependencies: magic-string: 0.30.10 pathe: 1.1.2 pretty-format: 29.7.0 - '@vitest/spy@1.5.3': - dependencies: - tinyspy: 2.2.0 - '@vitest/spy@1.6.0': dependencies: tinyspy: 2.2.0 - '@vitest/utils@1.5.3': - dependencies: - diff-sequences: 29.6.3 - estree-walker: 3.0.3 - loupe: 2.3.7 - pretty-format: 29.7.0 - '@vitest/utils@1.6.0': dependencies: diff-sequences: 29.6.3 @@ -13367,7 +13293,7 @@ snapshots: dependencies: boolbase: 1.0.0 - nuxi@3.11.1: + nuxi@3.12.0: optionalDependencies: fsevents: 2.3.3 @@ -15073,23 +14999,6 @@ snapshots: dependencies: vite: 5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0) - vite-node@1.5.3(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0): - dependencies: - cac: 6.7.14 - debug: 4.3.4 - pathe: 1.1.2 - picocolors: 1.0.0 - vite: 5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0) - transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - vite-node@1.6.0(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0): dependencies: cac: 6.7.14 @@ -15195,40 +15104,6 @@ snapshots: - vue - vue-router - vitest@1.5.3(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0): - dependencies: - '@vitest/expect': 1.5.3 - '@vitest/runner': 1.5.3 - '@vitest/snapshot': 1.5.3 - '@vitest/spy': 1.5.3 - '@vitest/utils': 1.5.3 - acorn-walk: 8.3.2 - chai: 4.3.10 - debug: 4.3.4 - execa: 8.0.1 - local-pkg: 0.5.0 - magic-string: 0.30.10 - pathe: 1.1.2 - picocolors: 1.0.0 - std-env: 3.7.0 - strip-literal: 2.1.0 - tinybench: 2.5.1 - tinypool: 0.8.4 - vite: 5.2.13(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0) - vite-node: 1.5.3(@types/node@20.14.2)(sass@1.69.4)(terser@5.27.0) - why-is-node-running: 2.2.2 - optionalDependencies: - '@types/node': 20.14.2 - happy-dom: 14.12.0 - transitivePeerDependencies: - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - vitest@1.6.0(@types/node@20.14.2)(happy-dom@14.12.0)(sass@1.69.4)(terser@5.27.0): dependencies: '@vitest/expect': 1.6.0 diff --git a/test/fixtures/basic-types/package.json b/test/fixtures/basic-types/package.json index 94a09218c..59851227a 100644 --- a/test/fixtures/basic-types/package.json +++ b/test/fixtures/basic-types/package.json @@ -11,7 +11,7 @@ "devDependencies": { "ofetch": "latest", "unplugin-vue-router": "^0.7.0", - "vitest": "1.5.3", + "vitest": "1.6.0", "vue": "latest", "vue-router": "latest" } From 41fc45da254408921972ab626101c41cea70de32 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 11:50:45 +0100 Subject: [PATCH 29/31] v3.12.1 --- packages/kit/package.json | 2 +- packages/nuxt/package.json | 2 +- packages/schema/package.json | 2 +- packages/vite/package.json | 2 +- packages/webpack/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/kit/package.json b/packages/kit/package.json index e529e16f4..b7f9cddd6 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -1,6 +1,6 @@ { "name": "@nuxt/kit", - "version": "3.12.0", + "version": "3.12.1", "repository": { "type": "git", "url": "git+https://github.com/nuxt/nuxt.git", diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 487ef079a..6b788ebc0 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -1,6 +1,6 @@ { "name": "nuxt", - "version": "3.12.0", + "version": "3.12.1", "repository": { "type": "git", "url": "git+https://github.com/nuxt/nuxt.git", diff --git a/packages/schema/package.json b/packages/schema/package.json index 81cd68ff6..f4c8a3d98 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,6 @@ { "name": "@nuxt/schema", - "version": "3.12.0", + "version": "3.12.1", "repository": { "type": "git", "url": "git+https://github.com/nuxt/nuxt.git", diff --git a/packages/vite/package.json b/packages/vite/package.json index 4b89955a8..39dfbfe91 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -1,6 +1,6 @@ { "name": "@nuxt/vite-builder", - "version": "3.12.0", + "version": "3.12.1", "repository": { "type": "git", "url": "git+https://github.com/nuxt/nuxt.git", diff --git a/packages/webpack/package.json b/packages/webpack/package.json index d77c7d7d7..c0932b511 100644 --- a/packages/webpack/package.json +++ b/packages/webpack/package.json @@ -1,6 +1,6 @@ { "name": "@nuxt/webpack-builder", - "version": "3.12.0", + "version": "3.12.1", "repository": { "type": "git", "url": "git+https://github.com/nuxt/nuxt.git", From 115fc2d18f48c814f16572ce17bb97f0fa7fd0b9 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 11 Jun 2024 12:41:34 +0100 Subject: [PATCH 30/31] test: add type test for nuxt module resolved types --- test/fixtures/basic-types/types.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/fixtures/basic-types/types.ts b/test/fixtures/basic-types/types.ts index dad52b4f6..4e593c1b6 100644 --- a/test/fixtures/basic-types/types.ts +++ b/test/fixtures/basic-types/types.ts @@ -4,6 +4,7 @@ import type { FetchError } from 'ofetch' import type { NavigationFailure, RouteLocationNormalized, RouteLocationRaw, Router, useRouter as vueUseRouter } from '#vue-router' import type { AppConfig, RuntimeValue, UpperSnakeCase } from 'nuxt/schema' +import { defineNuxtModule } from 'nuxt/kit' import { defineNuxtConfig } from 'nuxt/config' import { callWithNuxt, isVue3 } from '#app' import type { NuxtError } from '#app' @@ -242,6 +243,17 @@ describe('modules', () => { // @ts-expect-error we want to ensure we throw type error on invalid key defineNuxtConfig({ undeclaredKey: { other: false } }) }) + + it('preserves options in defineNuxtModule setup without `.with()`', () => { + defineNuxtModule<{ foo?: string, baz: number }>({ + defaults: { + baz: 100, + }, + setup: (resolvedOptions) => { + expectTypeOf(resolvedOptions).toEqualTypeOf<{ foo?: string, baz: number }>() + }, + }) + }) }) describe('nuxtApp', () => { From 14fecc9f73cf6491aef4e715a37b5dfe6d894467 Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Tue, 11 Jun 2024 23:33:22 +1000 Subject: [PATCH 31/31] fix(nuxt): call `onNuxtReady` callback without arguments (#27428) --- packages/nuxt/src/app/composables/ready.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/composables/ready.ts b/packages/nuxt/src/app/composables/ready.ts index 2360bc002..d4a1257a1 100644 --- a/packages/nuxt/src/app/composables/ready.ts +++ b/packages/nuxt/src/app/composables/ready.ts @@ -7,8 +7,8 @@ export const onNuxtReady = (callback: () => any) => { const nuxtApp = useNuxtApp() if (nuxtApp.isHydrating) { - nuxtApp.hooks.hookOnce('app:suspense:resolve', () => { requestIdleCallback(callback) }) + nuxtApp.hooks.hookOnce('app:suspense:resolve', () => { requestIdleCallback(() => callback()) }) } else { - requestIdleCallback(callback) + requestIdleCallback(() => callback()) } }