From f499b7281211da4652eed8df4ae0c92983e8c8d4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 15 Jul 2023 10:28:29 +0000 Subject: [PATCH] chore(deps): update nuxt core to v3.6.3 (#1238) * chore(deps): update nuxt core to v3.6.3 * chore: remove obsolete patches * fix: remove view transitions workaround * feat: enable bundler module resolution * chore: apply automated fixes * fix: add 'matched' array for upstream compatibility --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Roe Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- budget.json | 2 +- nuxt.config.ts | 4 +- package.json | 10 +- patches/@nuxt__test-utils@3.6.2.patch | 60 ----------- patches/nuxt@3.6.2.patch | 34 ------- pnpm-lock.yaml | 134 ++++++++++--------------- src/modules/runtime/path.global.ts | 15 ++- src/plugins/view-transitions.client.ts | 60 ----------- test/unit/bundle.spec.ts | 2 +- 9 files changed, 74 insertions(+), 247 deletions(-) delete mode 100644 patches/@nuxt__test-utils@3.6.2.patch delete mode 100644 patches/nuxt@3.6.2.patch delete mode 100644 src/plugins/view-transitions.client.ts diff --git a/budget.json b/budget.json index e2f426b3..81b5ebf5 100644 --- a/budget.json +++ b/budget.json @@ -8,7 +8,7 @@ }, { "resourceType": "script", - "budget": 54.8 + "budget": 55 }, { "resourceType": "stylesheet", diff --git a/nuxt.config.ts b/nuxt.config.ts index 5aa3adf2..03e7fd0f 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -74,7 +74,8 @@ export default defineNuxtConfig({ }, experimental: { - // viewTransition: true, + typescriptBundlerResolution: true, + viewTransition: true, componentIslands: true, payloadExtraction: true, typedPages: true, @@ -86,7 +87,6 @@ export default defineNuxtConfig({ strict: true, tsConfig: { compilerOptions: { - // moduleResolution: 'bundler', // resolveJsonModule: false, }, }, diff --git a/package.json b/package.json index 6afdfbee..8f05c15b 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@iconify-json/svg-spinners": "^1.1.1", "@nuxt/content": "2.7.0", "@nuxt/image": "1.0.0-rc.1", - "@nuxt/kit": "3.6.2", + "@nuxt/kit": "3.6.3", "@nuxtjs/color-mode": "3.3.0", "@nuxtjs/fontaine": "0.4.0", "@nuxtjs/html-validator": "1.5.1", @@ -44,7 +44,7 @@ "magic-regexp": "0.7.0", "magic-string": "^0.30.0", "mlly": "^1.4.0", - "nuxt": "3.6.2", + "nuxt": "3.6.3", "nuxt-time": "^0.1.0", "pathe": "^1.1.1", "postcss-nesting": "^12.0.0", @@ -60,7 +60,7 @@ "@commitlint/cli": "17.6.6", "@commitlint/config-conventional": "17.6.6", "@nuxt/devtools": "0.6.7", - "@nuxt/test-utils": "3.6.2", + "@nuxt/test-utils": "3.6.3", "@nuxtjs/eslint-config": "12.0.0", "@nuxtjs/eslint-config-typescript": "12.0.0", "@nuxtjs/eslint-module": "4.1.0", @@ -99,9 +99,7 @@ "packageManager": "pnpm@8.6.7", "pnpm": { "patchedDependencies": { - "@nuxtjs/color-mode@3.3.0": "patches/@nuxtjs__color-mode@3.3.0.patch", - "nuxt@3.6.2": "patches/nuxt@3.6.2.patch", - "@nuxt/test-utils@3.6.2": "patches/@nuxt__test-utils@3.6.2.patch" + "@nuxtjs/color-mode@3.3.0": "patches/@nuxtjs__color-mode@3.3.0.patch" } } } diff --git a/patches/@nuxt__test-utils@3.6.2.patch b/patches/@nuxt__test-utils@3.6.2.patch deleted file mode 100644 index e7dc764f..00000000 --- a/patches/@nuxt__test-utils@3.6.2.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/dist/index.d.ts b/dist/index.d.ts -index 664d9ccc7b6df08583bbcf32774bc24c6f9e5b02..eaef9636178e037d5dfc8dad931703ef21ecd905 100644 ---- a/dist/index.d.ts -+++ b/dist/index.d.ts -@@ -1,5 +1,5 @@ --import * as playwright from 'playwright'; --import { Browser, BrowserContextOptions, LaunchOptions } from 'playwright'; -+import * as playwright from 'playwright-core'; -+import { Browser, BrowserContextOptions, LaunchOptions } from 'playwright-core'; - import { NuxtConfig, Nuxt } from '@nuxt/schema'; - import { ExecaChildProcess } from 'execa'; - import { FetchOptions } from 'ofetch'; -diff --git a/dist/index.mjs b/dist/index.mjs -index 094cc692581c8e8faf46ee178c6dab33a98aaef0..215b31bbdde2f19572f233e1439c30a05d1108b7 100644 ---- a/dist/index.mjs -+++ b/dist/index.mjs -@@ -15,11 +15,11 @@ async function createBrowser() { - const ctx = useTestContext(); - let playwright; - try { -- playwright = await import(String("playwright")); -+ playwright = await import(String("playwright-core")); - } catch { - throw new Error(` -- The dependency 'playwright' not found. -- Please run 'yarn add --dev playwright' or 'npm install --save-dev playwright' -+ The dependency 'playwright-core' not found. -+ Please run 'yarn add --dev playwright-core' or 'npm install --save-dev playwright-core' - `); - } - const { type, launch } = ctx.options.browserOptions; -diff --git a/package.json b/package.json -index b8102a407c65306f7d1909e1231d3ee035d5c652..28ec668e8e3207bd19b67f7c65e87090defdcaef 100644 ---- a/package.json -+++ b/package.json -@@ -31,13 +31,13 @@ - }, - "devDependencies": { - "@jest/globals": "29.6.0", -- "playwright": "1.35.1", -+ "playwright-core": "1.35.1", - "unbuild": "latest", - "vitest": "0.32.4" - }, - "peerDependencies": { - "@jest/globals": "^29.5.0", -- "playwright": "^1.34.3", -+ "playwright-core": "^1.34.3", - "vitest": "^0.30.0 || ^0.31.0 || ^0.32.0", - "vue": "^3.3.4" - }, -@@ -45,7 +45,7 @@ - "@jest/globals": { - "optional": true - }, -- "playwright": { -+ "playwright-core": { - "optional": true - }, - "vitest": { \ No newline at end of file diff --git a/patches/nuxt@3.6.2.patch b/patches/nuxt@3.6.2.patch deleted file mode 100644 index 7b49310c..00000000 --- a/patches/nuxt@3.6.2.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/dist/app/components/nuxt-island.js b/dist/app/components/nuxt-island.js -index e19bb7a1d66a95864526862c6a70690273fb596f..40a8aab0dd011e1fc11b2d6ac8b7b1f85362674f 100644 ---- a/dist/app/components/nuxt-island.js -+++ b/dist/app/components/nuxt-island.js -@@ -41,7 +41,28 @@ export default defineComponent({ - onMounted(() => { - mounted.value = true; - }); -- const ssrHTML = ref(process.client ? getFragmentHTML(instance.vnode?.el ?? null).join("") ?? "
" : "
"); -+ -+ const ssrHTML = ref("
"); -+ if (process.client) { -+ const renderedHTML = getFragmentHTML(instance.vnode?.el ?? null).join("") -+ if (renderedHTML) { -+ ssrHTML.value = renderedHTML; -+ const key2 = `${props.name}_${hashId.value}`; -+ const url = `/__nuxt_island/${key2}`; -+ nuxtApp.payload.data[key2] = { -+ __nuxt_island: { -+ key: key2, -+ params: { -+ ...props.context, -+ props: props.props ? JSON.stringify(props.props) : void 0 -+ } -+ }, -+ html: renderedHTML, -+ head: {}, -+ } -+ } -+ ssrHTML.value = renderedHTML -+ } - const slotProps = computed(() => getSlotProps(ssrHTML.value)); - const uid = ref(ssrHTML.value.match(SSR_UID_RE)?.[1] ?? randomUUID()); - const availableSlots = computed(() => [...ssrHTML.value.matchAll(SLOTNAME_RE)].map((m) => m[1])); \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c2dc474e..2bac5f22 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,15 +9,9 @@ overrides: semver: < 6.0.0, >= 6.3.1 patchedDependencies: - '@nuxt/test-utils@3.6.2': - hash: dvwjcmo5jxtrz6uiuh4jvhw5cq - path: patches/@nuxt__test-utils@3.6.2.patch '@nuxtjs/color-mode@3.3.0': hash: yhatw3bbda574qeiohv37vxgf4 path: patches/@nuxtjs__color-mode@3.3.0.patch - nuxt@3.6.2: - hash: mh2dslgs5hdxnzdojyzdens4vm - path: patches/nuxt@3.6.2.patch dependencies: '@iconify-json/ri': @@ -33,8 +27,8 @@ dependencies: specifier: 1.0.0-rc.1 version: 1.0.0-rc.1 '@nuxt/kit': - specifier: 3.6.2 - version: 3.6.2 + specifier: 3.6.3 + version: 3.6.3 '@nuxtjs/color-mode': specifier: 3.3.0 version: 3.3.0(patch_hash=yhatw3bbda574qeiohv37vxgf4) @@ -84,8 +78,8 @@ dependencies: specifier: ^1.4.0 version: 1.4.0 nuxt: - specifier: 3.6.2 - version: 3.6.2(patch_hash=mh2dslgs5hdxnzdojyzdens4vm)(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5) + specifier: 3.6.3 + version: 3.6.3(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5) nuxt-time: specifier: ^0.1.0 version: 0.1.0 @@ -126,10 +120,10 @@ devDependencies: version: 17.6.6 '@nuxt/devtools': specifier: 0.6.7 - version: 0.6.7(nuxt@3.6.2)(vite@4.4.2) + version: 0.6.7(nuxt@3.6.3)(vite@4.4.2) '@nuxt/test-utils': - specifier: 3.6.2 - version: 3.6.2(patch_hash=dvwjcmo5jxtrz6uiuh4jvhw5cq)(vitest@0.33.0)(vue@3.3.4) + specifier: 3.6.3 + version: 3.6.3(vitest@0.33.0)(vue@3.3.4) '@nuxtjs/eslint-config': specifier: 12.0.0 version: 12.0.0(@typescript-eslint/parser@5.60.1)(eslint-import-resolver-typescript@3.5.5)(eslint@8.44.0) @@ -1397,7 +1391,7 @@ packages: /@nuxt/content@2.7.0: resolution: {integrity: sha512-3vv3Rbpf6NH7RRuy7PLVmpQCt8C9DgV4aTWLmTCdnWpmlNsX+0wQT8bA/ypqmh8zrJ6BXWztFM35WVESkNvDvQ==} dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 consola: 3.2.3 defu: 6.1.2 destr: 1.2.2 @@ -1452,16 +1446,16 @@ packages: /@nuxt/devalue@2.0.2: resolution: {integrity: sha512-GBzP8zOc7CGWyFQS6dv1lQz8VVpz5C2yRszbXufwG/9zhStTIH50EtD87NmWbTMwXDvZLNg8GIpb1UFdH93JCA==} - /@nuxt/devtools-kit@0.6.7(nuxt@3.6.2)(vite@4.4.2): + /@nuxt/devtools-kit@0.6.7(nuxt@3.6.3)(vite@4.4.2): resolution: {integrity: sha512-DEJBLspLRr3zFu/DAHs8Q1o9tgzELt24qDqsuqTEKqcw/2j1iu1TefvUdmXkJo6s8Qk3GI6e3QxrvtEE3mwKqA==} peerDependencies: nuxt: ^3.6.1 vite: '*' dependencies: - '@nuxt/kit': 3.6.2 - '@nuxt/schema': 3.6.2 + '@nuxt/kit': 3.6.3 + '@nuxt/schema': 3.6.3 execa: 7.1.1 - nuxt: 3.6.2(patch_hash=mh2dslgs5hdxnzdojyzdens4vm)(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5) + nuxt: 3.6.3(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5) vite: 4.4.2(@types/node@20.4.2) transitivePeerDependencies: - rollup @@ -1485,16 +1479,16 @@ packages: semver: 7.5.3 dev: true - /@nuxt/devtools@0.6.7(nuxt@3.6.2)(vite@4.4.2): + /@nuxt/devtools@0.6.7(nuxt@3.6.3)(vite@4.4.2): resolution: {integrity: sha512-ATjkNfceG+8DQ8kR6O3UC9MjFfUd39aeFgKA+Z6pjG8Z7e3vwK92oZCSeQ8DQRi4/2kwa/UPjN8pNclyc6FlbQ==} hasBin: true peerDependencies: nuxt: ^3.6.1 vite: '*' dependencies: - '@nuxt/devtools-kit': 0.6.7(nuxt@3.6.2)(vite@4.4.2) + '@nuxt/devtools-kit': 0.6.7(nuxt@3.6.3)(vite@4.4.2) '@nuxt/devtools-wizard': 0.6.7 - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 birpc: 0.2.12 boxen: 7.1.0 consola: 3.2.3 @@ -1510,7 +1504,7 @@ packages: launch-editor: 2.6.0 local-pkg: 0.4.3 magicast: 0.2.9 - nuxt: 3.6.2(patch_hash=mh2dslgs5hdxnzdojyzdens4vm)(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5) + nuxt: 3.6.3(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5) nypm: 0.2.2 pacote: 15.2.0 pathe: 1.1.1 @@ -1540,7 +1534,7 @@ packages: resolution: {integrity: sha512-gCYglIwEuYOdIbcH21RbMfqgQ2jqyd9SJH+GmyvH9M/vBsL7eZ4XEatfZRWa2q1A4DcIMs09/LbQiR3HHy2wZw==} engines: {node: ^14.16.0 || >=16.11.0} dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 consola: 3.2.3 defu: 6.1.2 h3: 1.7.1 @@ -1557,11 +1551,11 @@ packages: - supports-color dev: false - /@nuxt/kit@3.6.2: - resolution: {integrity: sha512-X1WN76izsILva6TvQVTfJCHG7TXCwsB6jsxZKcU3qSog26jer5dildDb5ZmKL3e+IFD6BwK4ShO/py8VZcT6OA==} + /@nuxt/kit@3.6.3: + resolution: {integrity: sha512-Eq+2whSIsZ+2IdB9J3okYOc+nZHassjt13vJZowxO3dw0rsXTnWGFHx40IX+wrBYE6eiOHjU/cXQ1XHdiU2GyQ==} engines: {node: ^14.18.0 || >=16.10.0} dependencies: - '@nuxt/schema': 3.6.2 + '@nuxt/schema': 3.6.3 c12: 1.4.2 consola: 3.2.3 defu: 6.1.2 @@ -1582,8 +1576,8 @@ packages: - rollup - supports-color - /@nuxt/schema@3.6.2: - resolution: {integrity: sha512-wxb1/C5ozly5IwX0IRjVGml1n2KjZrTKsf6lTk3fdjUpW105kAvYX4j66PDOdBRE4vCwCsgaHJfWpUSeNBxbuA==} + /@nuxt/schema@3.6.3: + resolution: {integrity: sha512-ZkcDt1DbgKX4Zv6Y+uLdn4Zt2WUDsZy+cuVx9XTRPoGVaG9PXZEgQr1XYoVH1vBMH/8VgDApvjok/Vzo+x+Nrg==} engines: {node: ^14.18.0 || >=16.10.0} dependencies: defu: 6.1.2 @@ -1603,7 +1597,7 @@ packages: resolution: {integrity: sha512-7kr2VDirYIXqyTHqaiWCrfQLgUjAa4qAHzykJOspMCFJWalHU9SVfnv+cTOKGqoXQ4TWOCd09tEd7sLlMFTEqw==} hasBin: true dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 chalk: 5.3.0 ci-info: 3.8.0 consola: 3.2.3 @@ -1626,24 +1620,24 @@ packages: - rollup - supports-color - /@nuxt/test-utils@3.6.2(patch_hash=dvwjcmo5jxtrz6uiuh4jvhw5cq)(vitest@0.33.0)(vue@3.3.4): - resolution: {integrity: sha512-OvWmgEqh4SiADTj6cnYhIq2fvdBYzIDtrCOJYuCGc6Of80oGZG18cZfKmlcACRk/Vk3zQP3FGDfC26tz7d5N+Q==} + /@nuxt/test-utils@3.6.3(vitest@0.33.0)(vue@3.3.4): + resolution: {integrity: sha512-LpEIjPAF3iVtSlPuZS6r1sRi4Xbfx49k18CTUhit0ukYVfufNrwCsBL60OG+lAhwzAMqUCh4qSwRGaBH1DI3Cg==} engines: {node: ^14.18.0 || >=16.10.0} peerDependencies: '@jest/globals': ^29.5.0 - playwright: ^1.34.3 - vitest: ^0.30.0 || ^0.31.0 || ^0.32.0 + playwright-core: ^1.34.3 + vitest: ^0.30.0 || ^0.31.0 || ^0.32.0 || ^0.33.0 vue: ^3.3.4 peerDependenciesMeta: '@jest/globals': optional: true - playwright: + playwright-core: optional: true vitest: optional: true dependencies: - '@nuxt/kit': 3.6.2 - '@nuxt/schema': 3.6.2 + '@nuxt/kit': 3.6.3 + '@nuxt/schema': 3.6.3 consola: 3.2.3 defu: 6.1.2 execa: 7.1.1 @@ -1657,18 +1651,17 @@ packages: - rollup - supports-color dev: true - patched: true /@nuxt/ui-templates@1.2.0: resolution: {integrity: sha512-MSZza7dxccNb/p7nuzGF8/m4POaFpHzVhNdR7f4xahOpH7Ja02lFeYR+rHtoHIJC0yym4qriqv0mQ+Qf/R61bQ==} - /@nuxt/vite-builder@3.6.2(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5)(vue@3.3.4): - resolution: {integrity: sha512-+JOWj8f5W5CKTHCPUhcuHrIIfOJHMdOaRfWA6DiIK8xPUQ5b3i737GQ9CRoSBHr9EaySJVuYjs6ptT6r0t7Spg==} + /@nuxt/vite-builder@3.6.3(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5)(vue@3.3.4): + resolution: {integrity: sha512-VWxuZ/GKp3IYMSW34yl+K8rEiDjb6gFt2avU1y9oNjkW/ONBLtBP5P7SFVtlzqs3Oxlk9zWAQc8D1dubBC3fEQ==} engines: {node: ^14.18.0 || >=16.10.0} peerDependencies: vue: ^3.3.4 dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 '@rollup/plugin-replace': 5.0.2(rollup@3.26.2) '@vitejs/plugin-vue': 4.2.3(vite@4.3.9)(vue@3.3.4) '@vitejs/plugin-vue-jsx': 3.0.1(vite@4.3.9)(vue@3.3.4) @@ -1700,7 +1693,7 @@ packages: ufo: 1.1.2 unplugin: 1.3.2 vite: 4.3.9(@types/node@20.4.2) - vite-node: 0.32.4(@types/node@20.4.2) + vite-node: 0.33.0(@types/node@20.4.2) vite-plugin-checker: 0.6.1(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vite@4.3.9)(vue-tsc@1.8.5) vue: 3.3.4 vue-bundle-renderer: 1.0.3 @@ -1726,7 +1719,7 @@ packages: /@nuxtjs/color-mode@3.3.0(patch_hash=yhatw3bbda574qeiohv37vxgf4): resolution: {integrity: sha512-YVFNmTISke1eL7uk5p9I1suOsM222FxrqKoF13HS4x94OKCWwPLLeTCEzHZ8orzKnaFUbCXpuL4pRv8gvW+0Kw==} dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 lodash.template: 4.5.0 pathe: 1.1.1 transitivePeerDependencies: @@ -1780,7 +1773,7 @@ packages: peerDependencies: eslint: '>=7' dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 chokidar: 3.5.3 eslint: 8.44.0 eslint-webpack-plugin: 4.0.1(eslint@8.44.0)(webpack@5.88.1) @@ -1796,7 +1789,7 @@ packages: /@nuxtjs/fontaine@0.4.0: resolution: {integrity: sha512-ZGFnp73RCg8weB65Qp0A3d+cWfUyea8OXXgoc61DkDP8+mQ+/mp73wwoy8RMsU5+F60vvx6FkPwiWTJLRMdbAw==} dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 fontaine: 0.4.0 magic-string: 0.30.1 pathe: 1.1.1 @@ -1810,7 +1803,7 @@ packages: /@nuxtjs/html-validator@1.5.1: resolution: {integrity: sha512-4CmDk9DCIRrDTqAkpGmmJJxJZ6Ns+rZAFsEAOQfUB4vWKlzCOx1m1XQH+hyhGBylZvPYwZ7W1H0UN2biUbEV3w==} dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 chalk: 5.3.0 html-validate: 8.0.5 pathe: 1.1.1 @@ -1827,7 +1820,7 @@ packages: /@nuxtjs/plausible@0.2.1: resolution: {integrity: sha512-1AyV9woFeZKBhwYy05S7NBk4jeAXzWcF/SIK/S/GZ8C86G8x7f2hR2eJi9FRRQYGwHutBx2guU4tZAW4J71Azg==} dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 defu: 6.1.2 pathe: 1.1.1 plausible-tracker: 0.3.8 @@ -1839,7 +1832,7 @@ packages: /@nuxtjs/web-vitals@0.2.6: resolution: {integrity: sha512-hoLo/Lcl63rDEm1gR/VN3sSG7mO4UKzJF69lyKjm+cSWtnSinSQo4n/8V0qmDqVgC3GPfvC1X/IqZx5FaRSS/g==} dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 defu: 6.1.2 pathe: 1.1.1 ufo: 1.1.2 @@ -2438,7 +2431,7 @@ packages: /@unocss/nuxt@0.53.5(postcss@8.4.25)(vite@4.4.2)(webpack@5.88.1): resolution: {integrity: sha512-tCyXL58S6a18ggBbqGyxJdBMqFmRCE/61KyP/fEhXGypdC7rAvdgHGH8ci+1i3xY1Zfk4Ki837BLJXluRJKq2g==} dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 '@unocss/config': 0.53.5 '@unocss/core': 0.53.5 '@unocss/preset-attributify': 0.53.5 @@ -7982,8 +7975,8 @@ packages: dependencies: boolbase: 1.0.0 - /nuxi@3.6.2: - resolution: {integrity: sha512-1aRoq8QPXP+VIZZy4S/ZpJ0xx9j1DmOM3hWDfX40clAQCY4YX+NNAOKY4WzXFwU4t38xl+9wY5PE124VHWli2w==} + /nuxi@3.6.3: + resolution: {integrity: sha512-UVokD+9Pq0EoPp2nmkS5K96g/P1BWYEpYCmtX4XW5oZqvkPlEBBdellOWPEb9wgSCBjWYVNpxA2uIRb4yhg1Nw==} engines: {node: ^14.18.0 || >=16.10.0} hasBin: true optionalDependencies: @@ -7992,7 +7985,7 @@ packages: /nuxt-time@0.1.0: resolution: {integrity: sha512-kWk17FWL6fnIQO2kTvpkABFRn8MDzoabIOAjMpL3SVwbeKVQbdTRt20BJs2o4nCldZxUVXoGj4ClK0RDASuSLg==} dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 defu: 6.1.2 pathe: 1.1.1 transitivePeerDependencies: @@ -8008,7 +8001,7 @@ packages: vite: '*' vitest: ^0.30.0 dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 '@vitejs/plugin-vue': 4.2.3(vite@4.4.2)(vue@3.3.4) '@vitejs/plugin-vue-jsx': 3.0.1(vite@4.4.2)(vue@3.3.4) '@vitest/ui': 0.30.1 @@ -8030,8 +8023,8 @@ packages: - vue-router dev: true - /nuxt@3.6.2(patch_hash=mh2dslgs5hdxnzdojyzdens4vm)(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5): - resolution: {integrity: sha512-nzxXEKyjBUjRIfP/vojFdZ9RbpaiVftatT+p5tzJGea8beocRB2XsZ0hcDtmMuOcF6glQjG3EIsVu2p9Ckz/Kg==} + /nuxt@3.6.3(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5): + resolution: {integrity: sha512-FiD2Ok81wPvQjNBO61h1fA7aqL0EloNspDC05eoQZl13kCthn7103esJNS+KAZNlPcXOYruEe3rGt066Sb/TwA==} engines: {node: ^14.18.0 || >=16.10.0} hasBin: true peerDependencies: @@ -8042,11 +8035,11 @@ packages: optional: true dependencies: '@nuxt/devalue': 2.0.2 - '@nuxt/kit': 3.6.2 - '@nuxt/schema': 3.6.2 + '@nuxt/kit': 3.6.3 + '@nuxt/schema': 3.6.3 '@nuxt/telemetry': 2.3.1 '@nuxt/ui-templates': 1.2.0 - '@nuxt/vite-builder': 3.6.2(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5)(vue@3.3.4) + '@nuxt/vite-builder': 3.6.3(@types/node@20.4.2)(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vue-tsc@1.8.5)(vue@3.3.4) '@types/node': 20.4.2 '@unhead/ssr': 1.1.30 '@unhead/vue': 1.1.30(vue@3.3.4) @@ -8072,7 +8065,7 @@ packages: magic-string: 0.30.1 mlly: 1.4.0 nitropack: 2.5.2 - nuxi: 3.6.2 + nuxi: 3.6.3 nypm: 0.2.2 ofetch: 1.1.1 ohash: 1.1.2 @@ -8122,7 +8115,6 @@ packages: - vls - vti - vue-tsc - patched: true /nypm@0.2.2: resolution: {integrity: sha512-O7bumfWgUXlJefT1Y41SF4vsCvzeUYmnKABuOKStheCObzrkWPDmqJc+RJVU+57oFu9bITcrUq8sKFIHgjCnTg==} @@ -10827,27 +10819,6 @@ packages: vfile-message: 3.1.4 dev: false - /vite-node@0.32.4(@types/node@20.4.2): - resolution: {integrity: sha512-L2gIw+dCxO0LK14QnUMoqSYpa9XRGnTTTDjW2h19Mr+GR0EFj4vx52W41gFXfMLqpA00eK4ZjOVYo1Xk//LFEw==} - engines: {node: '>=v14.18.0'} - hasBin: true - dependencies: - cac: 6.7.14 - debug: 4.3.4 - mlly: 1.4.0 - pathe: 1.1.1 - picocolors: 1.0.0 - vite: 4.4.2(@types/node@20.4.2) - transitivePeerDependencies: - - '@types/node' - - less - - lightningcss - - sass - - stylus - - sugarss - - supports-color - - terser - /vite-node@0.33.0(@types/node@20.4.2): resolution: {integrity: sha512-19FpHYbwWWxDr73ruNahC+vtEdza52kA90Qb3La98yZ0xULqV8A5JLNPUff0f5zID4984tW7l3DH2przTJUZSw==} engines: {node: '>=v14.18.0'} @@ -10868,7 +10839,6 @@ packages: - sugarss - supports-color - terser - dev: true /vite-plugin-checker@0.6.1(eslint@8.44.0)(stylelint@15.10.1)(typescript@5.1.6)(vite@4.3.9)(vue-tsc@1.8.5): resolution: {integrity: sha512-4fAiu3W/IwRJuJkkUZlWbLunSzsvijDf0eDN6g/MGh6BUK4SMclOTGbLJCPvdAcMOQvVmm8JyJeYLYd4//8CkA==} @@ -11056,7 +11026,7 @@ packages: jsdom: optional: true dependencies: - '@nuxt/kit': 3.6.2 + '@nuxt/kit': 3.6.3 '@vue/test-utils': 2.4.0(vue@3.3.4) defu: 6.1.2 estree-walker: 3.0.3 diff --git a/src/modules/runtime/path.global.ts b/src/modules/runtime/path.global.ts index 69fdee0d..6ad6545c 100644 --- a/src/modules/runtime/path.global.ts +++ b/src/modules/runtime/path.global.ts @@ -1,11 +1,24 @@ +import type { RouteLocationNormalized, RouteRecordNormalized } from 'vue-router' import { match } from './routes' -export default defineNuxtRouteMiddleware(to => { +export default defineNuxtRouteMiddleware((to, from) => { const path = to.path const matched = match(path) Object.assign(to.meta, matched?.meta) + augmentMatched(from) + augmentMatched(to) if (matched?.path instanceof RegExp) { to.params = (path.match(matched.path)?.groups as Record) || {} } }) + +function augmentMatched(route: RouteLocationNormalized) { + route.matched = [ + { + components: { + default: match(route.path)?.component.__asyncResolved.__name, + }, + } as any as RouteRecordNormalized, + ] +} diff --git a/src/plugins/view-transitions.client.ts b/src/plugins/view-transitions.client.ts deleted file mode 100644 index 8b808346..00000000 --- a/src/plugins/view-transitions.client.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { useRouter } from '#app/composables/router' -import { defineNuxtPlugin } from '#app/nuxt' - -export default defineNuxtPlugin(nuxtApp => { - if (!document.startViewTransition) { - return - } - - let finishTransition: undefined | (() => void) - let abortTransition: undefined | (() => void) - - const router = useRouter() - - router.beforeResolve((to, from) => { - // TODO: remove in next Nuxt patch - if (to.meta.pageTransition === false || to.fullPath === from.fullPath) { - return - } - - const promise = new Promise((resolve, reject) => { - finishTransition = resolve - abortTransition = reject - }) - - let changeRoute: () => void - const ready = new Promise(resolve => (changeRoute = resolve)) - - const transition = document.startViewTransition!(() => { - changeRoute() - return promise - }) - - transition.finished.then(() => { - abortTransition = undefined - finishTransition = undefined - }) - - return ready - }) - - nuxtApp.hook('vue:error', () => { - abortTransition?.() - abortTransition = undefined - }) - - nuxtApp.hook('page:finish', () => { - finishTransition?.() - finishTransition = undefined - }) -}) - -declare global { - interface Document { - startViewTransition?: (callback: () => Promise | void) => { - finished: Promise - updateCallbackDone: Promise - ready: Promise - } - } -} diff --git a/test/unit/bundle.spec.ts b/test/unit/bundle.spec.ts index 825ca440..1df1fcb0 100644 --- a/test/unit/bundle.spec.ts +++ b/test/unit/bundle.spec.ts @@ -36,7 +36,7 @@ describe('project sizes', () => { stats.client = await analyzeSizes('**/*.js', publicDir) expect .soft(roundToKilobytes(stats.client.totalBytes)) - .toMatchInlineSnapshot('"184k"') + .toMatchInlineSnapshot('"185k"') expect.soft(stats.client.files.map(f => f.replace(/\..*\.js/, '.js'))) .toMatchInlineSnapshot(` [ -- 2.51.2