From af13a309c9f05458d1ec7c826a375372519ea2d6 Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 3 Sep 2024 14:59:47 +1000 Subject: [PATCH 001/549] chore: unhead 1.10.3 --- package.json | 10 +++--- pnpm-lock.yaml | 86 +++++++++++++++++++++++++------------------------- src/module.ts | 4 +-- 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index 44cbd33d..9fc228e5 100644 --- a/package.json +++ b/package.json @@ -120,14 +120,14 @@ "@nuxt/schema": "3.13.0", "@nuxt/scripts": "workspace:*", "@unhead/dom": "1.10.2", - "@unhead/schema": "1.10.2", - "@unhead/shared": "1.10.2", - "@unhead/ssr": "1.10.2", - "@unhead/vue": "1.10.2", + "@unhead/schema": "1.10.3", + "@unhead/shared": "1.10.3", + "@unhead/ssr": "1.10.3", + "@unhead/vue": "1.10.3", "nuxt": "^3.13.0", "nuxt-scripts-devtools": "workspace:*", "shiki": "1.10.3", - "unhead": "1.10.2", + "unhead": "1.10.3", "vue": "^3.4.38", "vue-router": "^4.4.3" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 698a4c6e..bbd40763 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,14 +8,14 @@ overrides: '@nuxt/schema': 3.13.0 '@nuxt/scripts': workspace:* '@unhead/dom': 1.10.2 - '@unhead/schema': 1.10.2 - '@unhead/shared': 1.10.2 - '@unhead/ssr': 1.10.2 - '@unhead/vue': 1.10.2 + '@unhead/schema': 1.10.3 + '@unhead/shared': 1.10.3 + '@unhead/ssr': 1.10.3 + '@unhead/vue': 1.10.3 nuxt: ^3.13.0 nuxt-scripts-devtools: workspace:* shiki: 1.10.3 - unhead: 1.10.2 + unhead: 1.10.3 vue: ^3.4.38 vue-router: ^4.4.3 @@ -45,8 +45,8 @@ importers: specifier: ^0.1.0 version: 0.1.0 '@unhead/vue': - specifier: 1.10.2 - version: 1.10.2(vue@3.4.38(typescript@5.5.4)) + specifier: 1.10.3 + version: 1.10.3(vue@3.4.38(typescript@5.5.4)) '@vueuse/core': specifier: ^11.0.3 version: 11.0.3(vue@3.4.38(typescript@5.5.4)) @@ -124,8 +124,8 @@ importers: specifier: ^8.3.0 version: 8.3.0(typescript@5.5.4) '@unhead/schema': - specifier: 1.10.2 - version: 1.10.2 + specifier: 1.10.3 + version: 1.10.3 acorn-loose: specifier: ^8.4.0 version: 8.4.0 @@ -1846,17 +1846,17 @@ packages: '@unhead/schema-org@1.10.1': resolution: {integrity: sha512-GSKYVrjLUAjq9dCQGb4bfj9ZYEvgopNGAgt5cZBs7h50A3Vkrh7+ZRBT22YlBM94SKScxSFXsdeZzLt1jl22Sw==} - '@unhead/schema@1.10.2': - resolution: {integrity: sha512-/GneC9eUwIysdBCho0lDyKg+8qvV4WF2qIkPkyMbuX/tu24G40MAa21/OeY6xQYTwbTHW+p0WBX6immvWGx9iw==} + '@unhead/schema@1.10.3': + resolution: {integrity: sha512-a/dOrCuh0AefPDAUBGUWDW6IBp9xdyw9onWkLW71VS48USvUZt51OVdWYsoQkFGOpqOZDfdiL82DBLhvYDj0rg==} - '@unhead/shared@1.10.2': - resolution: {integrity: sha512-XrEZgdnWcWzxVWhtO1ui+cQXjIktTV7domDA99yCyW5EBsrISB0d03NUP3vp+zD4UUOKq0/0A8UCQnNrlOWkaA==} + '@unhead/shared@1.10.3': + resolution: {integrity: sha512-MCnEvSB/ayYNf+8ZALUIzRD/hkEMGyDcVZYP/Npt/m/x3q/ad4nVyM6xkHjnV2CGfW62/+WDvddk7o2Iz+1QKA==} - '@unhead/ssr@1.10.2': - resolution: {integrity: sha512-DizYq9WIQ1ln2uRk2gvbDkNKhpzKhIXpRePRb8RUTQJMpq7YXFrADWvRO70HNjOa7pddIv4rjtQqtSReqJZW1A==} + '@unhead/ssr@1.10.3': + resolution: {integrity: sha512-Bubkzz0Hz4y8IHJVujocy+tUMhHgKLpXUVpaQm786IdlPp6SRPauHLS9E/+gy2S9+0gbhou71Naqbz39z8+x4A==} - '@unhead/vue@1.10.2': - resolution: {integrity: sha512-q8hQXLkZEqojLX3aFW8nvcQzB5RcdSQWf3RdBGT8WBmoQrqERhN0H4tF0PnMjE8p0N3LLsaMbfJvIDI46pDSFg==} + '@unhead/vue@1.10.3': + resolution: {integrity: sha512-qAkKmiwIn6fd5tgCg3aORMMP8VE70AYl7PJSd6skLD+gzEh1unUmRXQ+uF8Dx3TxUmeXvZVq9F5deZwlmeXEdw==} peerDependencies: vue: ^3.4.38 @@ -5750,8 +5750,8 @@ packages: unenv@1.10.0: resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==} - unhead@1.10.2: - resolution: {integrity: sha512-YfzkRi7RHBHhHFe9lBuNKNaImVh4eJdSdfnlvGJuO28wt6y8jpWR98Wdqh8Tq9M4r0VlIHSV1AJqB5qJd14QLQ==} + unhead@1.10.3: + resolution: {integrity: sha512-0zKLTiu3N8++UFQuzk9a6rN2ct73788Hwb63fhk2mshJscRWEj/y7VZnS3IpsGUUw+WLtH2HZrG1PXZIMzweyA==} unicode-emoji-modifier-base@1.0.0: resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} @@ -8587,8 +8587,8 @@ snapshots: '@unhead/addons@1.10.1(rollup@4.21.2)': dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.21.2) - '@unhead/schema': 1.10.2 - '@unhead/shared': 1.10.2 + '@unhead/schema': 1.10.3 + '@unhead/shared': 1.10.3 magic-string: 0.30.11 mlly: 1.7.1 ufo: 1.5.4 @@ -8599,33 +8599,33 @@ snapshots: '@unhead/dom@1.10.2': dependencies: - '@unhead/schema': 1.10.2 - '@unhead/shared': 1.10.2 + '@unhead/schema': 1.10.3 + '@unhead/shared': 1.10.3 '@unhead/schema-org@1.10.1': dependencies: ufo: 1.5.4 - '@unhead/schema@1.10.2': + '@unhead/schema@1.10.3': dependencies: hookable: 5.5.3 zhead: 2.2.4 - '@unhead/shared@1.10.2': + '@unhead/shared@1.10.3': dependencies: - '@unhead/schema': 1.10.2 + '@unhead/schema': 1.10.3 - '@unhead/ssr@1.10.2': + '@unhead/ssr@1.10.3': dependencies: - '@unhead/schema': 1.10.2 - '@unhead/shared': 1.10.2 + '@unhead/schema': 1.10.3 + '@unhead/shared': 1.10.3 - '@unhead/vue@1.10.2(vue@3.4.38(typescript@5.5.4))': + '@unhead/vue@1.10.3(vue@3.4.38(typescript@5.5.4))': dependencies: - '@unhead/schema': 1.10.2 - '@unhead/shared': 1.10.2 + '@unhead/schema': 1.10.3 + '@unhead/shared': 1.10.3 hookable: 5.5.3 - unhead: 1.10.2 + unhead: 1.10.3 vue: 3.4.38(typescript@5.5.4) '@unocss/astro@0.62.3(rollup@3.29.4)': @@ -9187,9 +9187,9 @@ snapshots: '@vueuse/head@2.0.0(vue@3.4.38(typescript@5.5.4))': dependencies: '@unhead/dom': 1.10.2 - '@unhead/schema': 1.10.2 - '@unhead/ssr': 1.10.2 - '@unhead/vue': 1.10.2(vue@3.4.38(typescript@5.5.4)) + '@unhead/schema': 1.10.3 + '@unhead/ssr': 1.10.3 + '@unhead/vue': 1.10.3(vue@3.4.38(typescript@5.5.4)) vue: 3.4.38(typescript@5.5.4) '@vueuse/integrations@10.11.1(focus-trap@7.5.4)(fuse.js@6.6.2)(vue@3.4.38(typescript@5.5.4))': @@ -12237,8 +12237,8 @@ snapshots: '@nuxt/telemetry': 2.5.4(magicast@0.3.5)(rollup@3.29.4) '@nuxt/vite-builder': 3.13.0(@types/node@22.5.2)(eslint@9.9.1(jiti@1.21.6))(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.4)(terser@5.31.6)(typescript@5.5.4)(vue@3.4.38(typescript@5.5.4)) '@unhead/dom': 1.10.2 - '@unhead/ssr': 1.10.2 - '@unhead/vue': 1.10.2(vue@3.4.38(typescript@5.5.4)) + '@unhead/ssr': 1.10.3 + '@unhead/vue': 1.10.3(vue@3.4.38(typescript@5.5.4)) '@vue/shared': 3.4.38 acorn: 8.12.1 c12: 1.11.1(magicast@0.3.5) @@ -12344,8 +12344,8 @@ snapshots: '@nuxt/telemetry': 2.5.4(magicast@0.3.5)(rollup@4.21.2) '@nuxt/vite-builder': 3.13.0(@types/node@22.5.2)(eslint@9.9.1(jiti@1.21.6))(magicast@0.3.5)(optionator@0.9.4)(rollup@4.21.2)(terser@5.31.6)(typescript@5.5.4)(vue@3.4.38(typescript@5.5.4)) '@unhead/dom': 1.10.2 - '@unhead/ssr': 1.10.2 - '@unhead/vue': 1.10.2(vue@3.4.38(typescript@5.5.4)) + '@unhead/ssr': 1.10.3 + '@unhead/vue': 1.10.3(vue@3.4.38(typescript@5.5.4)) '@vue/shared': 3.4.38 acorn: 8.12.1 c12: 1.11.1(magicast@0.3.5) @@ -13848,11 +13848,11 @@ snapshots: node-fetch-native: 1.6.4 pathe: 1.1.2 - unhead@1.10.2: + unhead@1.10.3: dependencies: '@unhead/dom': 1.10.2 - '@unhead/schema': 1.10.2 - '@unhead/shared': 1.10.2 + '@unhead/schema': 1.10.3 + '@unhead/shared': 1.10.3 hookable: 5.5.3 unicode-emoji-modifier-base@1.0.0: {} diff --git a/src/module.ts b/src/module.ts index 43d6e491..8b42974d 100644 --- a/src/module.ts +++ b/src/module.ts @@ -107,8 +107,8 @@ export default defineNuxtModule({ if (!unheadVersion || lt(unheadVersion, '1.10.0')) { logger.error(`Nuxt Scripts requires Unhead >= 1.10.0, you are using v${unheadVersion}. Please run \`nuxi upgrade --clean\` to upgrade...`) } - else if (lt(unheadVersion, '1.10.2')) { - logger.warn(`Nuxt Scripts recommends Unhead >= 1.10.2, you are using v${unheadVersion}. Please run \`nuxi upgrade --clean\` to upgrade...`) + else if (lt(unheadVersion, '1.10.3')) { + logger.warn(`Nuxt Scripts recommends Unhead >= 1.10.3, you are using v${unheadVersion}. Please run \`nuxi upgrade --clean\` to upgrade...`) } } // allow augmenting the options From 72977832153b0804d15a5ddf7d3cebdb5e69dcd6 Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 3 Sep 2024 15:24:45 +1000 Subject: [PATCH 002/549] fix(useScriptTriggerElement): reject promises on scope dispose --- .../composables/useScriptTriggerElement.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/runtime/composables/useScriptTriggerElement.ts b/src/runtime/composables/useScriptTriggerElement.ts index 1be08e5e..8507bf61 100644 --- a/src/runtime/composables/useScriptTriggerElement.ts +++ b/src/runtime/composables/useScriptTriggerElement.ts @@ -7,6 +7,7 @@ import { useEventListener, useIntersectionObserver, } from '@vueuse/core' +import { tryOnScopeDispose } from '@vueuse/shared' import type { ElementScriptTrigger } from '../types' export interface ElementScriptTriggerOptions { @@ -23,7 +24,7 @@ export interface ElementScriptTriggerOptions { function useElementVisibilityPromise(element: MaybeComputedElementRef) { let observer: UseIntersectionObserverReturn - return new Promise((resolve) => { + return new Promise((resolve, reject) => { observer = useIntersectionObserver( element, (intersectionObserverEntries) => { @@ -38,9 +39,14 @@ function useElementVisibilityPromise(element: MaybeComputedElementRef) { threshold: 0, }, ) - }).finally(() => { - observer.stop() + tryOnScopeDispose(reject) }) + .catch(() => { + // it's okay + }) + .finally(() => { + observer.stop() + }) } /** @@ -57,16 +63,19 @@ export function useScriptTriggerElement(options: ElementScriptTriggerOptions): P return Promise.resolve() if (!triggers.includes('immediate')) { // TODO optimize this, only have 1 instance of intersection observer, stop on find - return new Promise((resolve) => { + return new Promise((resolve, reject) => { const _ = useEventListener( typeof el !== 'undefined' ? (el as EventTarget) : document.body, triggers, () => { - resolve() _() + resolve() }, { once: true, passive: true }, ) + tryOnScopeDispose(reject) + }).catch(() => { + // it's okay }) } return Promise.resolve() From 50126bfb45269c45463609d4163b49480a47a109 Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 3 Sep 2024 15:28:57 +1000 Subject: [PATCH 003/549] chore: bump deps --- docs/package.json | 2 +- package.json | 6 +- pnpm-lock.yaml | 231 +++++++++++++++++++--------------------------- 3 files changed, 100 insertions(+), 139 deletions(-) diff --git a/docs/package.json b/docs/package.json index ce7a8643..d7adcb4f 100644 --- a/docs/package.json +++ b/docs/package.json @@ -18,7 +18,7 @@ "@nuxt/scripts": "workspace:*", "@nuxt/ui-pro": "^1.4.1", "@nuxthq/studio": "^2.0.3", - "@nuxtjs/seo": "^2.0.0-rc.19", + "@nuxtjs/seo": "^2.0.0-rc.20", "@vueuse/core": "^11.0.3", "@vueuse/nuxt": "^11.0.3", "nuxt-scripts-devtools": "workspace:*", diff --git a/package.json b/package.json index 9fc228e5..9802d1b9 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@types/stripe-v3": "^3.1.33", "@types/vimeo__player": "^2.18.3", "@types/youtube": "^0.1.0", - "@unhead/vue": "^1.10.1", + "@unhead/vue": "^1.10.3", "@vueuse/core": "^11.0.3", "consola": "^3.2.3", "defu": "^6.1.4", @@ -100,8 +100,8 @@ "@nuxt/module-builder": "^0.8.3", "@nuxt/test-utils": "3.14.1", "@types/semver": "^7.5.8", - "@typescript-eslint/typescript-estree": "^8.3.0", - "@unhead/schema": "^1.10.1", + "@typescript-eslint/typescript-estree": "^8.4.0", + "@unhead/schema": "^1.10.3", "acorn-loose": "^8.4.0", "bumpp": "^9.5.2", "changelogen": "^0.5.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbd40763..9e247645 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -121,8 +121,8 @@ importers: specifier: ^7.5.8 version: 7.5.8 '@typescript-eslint/typescript-estree': - specifier: ^8.3.0 - version: 8.3.0(typescript@5.5.4) + specifier: ^8.4.0 + version: 8.4.0(typescript@5.5.4) '@unhead/schema': specifier: 1.10.3 version: 1.10.3 @@ -220,8 +220,8 @@ importers: specifier: ^2.0.3 version: 2.0.3(magicast@0.3.5)(rollup@4.21.2) '@nuxtjs/seo': - specifier: ^2.0.0-rc.19 - version: 2.0.0-rc.19(h3@1.12.0)(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) + specifier: ^2.0.0-rc.20 + version: 2.0.0-rc.20(h3@1.12.0)(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) '@vueuse/core': specifier: ^11.0.3 version: 11.0.3(vue@3.4.38(typescript@5.5.4)) @@ -1308,11 +1308,11 @@ packages: '@nuxtjs/robots@4.1.6': resolution: {integrity: sha512-0U5+aEyVoW0j8JcbVaRj0upSi9qZm772epZWKw9sFH7Y8OGAHCM+4EfRXT5GhHSYjTpFc6zFKob+paVGyn3MHA==} - '@nuxtjs/seo@2.0.0-rc.19': - resolution: {integrity: sha512-ypQgmQj1dszjEFiyQrSRjH3C1A0TchwdfWI0Zq90T/L00ic3Z1tgsnjEhtcC5zTaeEqlLLNCenIlP9pKPbPEaA==} + '@nuxtjs/seo@2.0.0-rc.20': + resolution: {integrity: sha512-ABpLB2vHPMgmcXLXF3XUMsdu7p7YzdV9byd4I4wqiO0pc3taXe5L8PVYGHSrhR7JYQmOKOihagbapxDBpQmV2g==} - '@nuxtjs/sitemap@6.0.0-beta.2': - resolution: {integrity: sha512-eWC/0oun524ZRb7f+cULHk+N4CchE7e2GXdBEWaHY6VaNPlVGHcTvWk2/PdRgmofAqehtjY8pn6tQz4AU/oV1w==} + '@nuxtjs/sitemap@6.0.0': + resolution: {integrity: sha512-onn/rkhizs/7zHi8C0r1w6L0B4HYxoL3zqcICadx7b4HdUT5m3w7/MGfBFZkGDspKJ6B4ywhpCODWvLiF2V+rw==} engines: {node: '>=18.0.0'} '@nuxtjs/tailwindcss@6.12.1': @@ -1685,8 +1685,8 @@ packages: peerDependencies: eslint: '>=8.40.0' - '@swc/helpers@0.5.12': - resolution: {integrity: sha512-KMZNXiGibsW9kvZAO1Pam2JPTDBm+KSHMMHWdsyI/1DbIZjT2A6Gy3hblVXUMEDvUAKq+e0vL0X0o54owWji7g==} + '@swc/helpers@0.5.13': + resolution: {integrity: sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w==} '@tailwindcss/aspect-ratio@0.4.2': resolution: {integrity: sha512-8QPrypskfBa7QIMuKHg2TA7BqES6vhBrDLOv8Unb6FcFyd3TjKbc6lcmb9UPQHxfl24sXoJ41ux/H7qQQvfaSQ==} @@ -1777,8 +1777,8 @@ packages: '@types/youtube@0.1.0': resolution: {integrity: sha512-Pg33m3X2mFgdmhtvzOlAfUfgOa3341N3/2JCrVY/mXVxb4hagcqqEG6w4vGCfB64StQNWHSj/T8Eotb1Rko/FQ==} - '@typescript-eslint/eslint-plugin@8.3.0': - resolution: {integrity: sha512-FLAIn63G5KH+adZosDYiutqkOkYEx0nvcwNNfJAf+c7Ae/H35qWwTYvPZUKFj5AS+WfHG/WJJfWnDnyNUlp8UA==} + '@typescript-eslint/eslint-plugin@8.4.0': + resolution: {integrity: sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 @@ -1788,8 +1788,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@8.3.0': - resolution: {integrity: sha512-h53RhVyLu6AtpUzVCYLPhZGL5jzTD9fZL+SYf/+hYOx2bDkyQXztXSc4tbvKYHzfMXExMLiL9CWqJmVz6+78IQ==} + '@typescript-eslint/parser@8.4.0': + resolution: {integrity: sha512-NHgWmKSgJk5K9N16GIhQ4jSobBoJwrmURaLErad0qlLjrpP5bECYg+wxVTGlGZmJbU03jj/dfnb6V9bw+5icsA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -1798,12 +1798,12 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@8.3.0': - resolution: {integrity: sha512-mz2X8WcN2nVu5Hodku+IR8GgCOl4C0G/Z1ruaWN4dgec64kDBabuXyPAr+/RgJtumv8EEkqIzf3X2U5DUKB2eg==} + '@typescript-eslint/scope-manager@8.4.0': + resolution: {integrity: sha512-n2jFxLeY0JmKfUqy3P70rs6vdoPjHK8P/w+zJcV3fk0b0BwRXC/zxRTEnAsgYT7MwdQDt/ZEbtdzdVC+hcpF0A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.3.0': - resolution: {integrity: sha512-wrV6qh//nLbfXZQoj32EXKmwHf4b7L+xXLrP3FZ0GOUU72gSvLjeWUl5J5Ue5IwRxIV1TfF73j/eaBapxx99Lg==} + '@typescript-eslint/type-utils@8.4.0': + resolution: {integrity: sha512-pu2PAmNrl9KX6TtirVOrbLPLwDmASpZhK/XU7WvoKoCUkdtq9zF7qQ7gna0GBZFN0hci0vHaSusiL2WpsQk37A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -1811,12 +1811,12 @@ packages: typescript: optional: true - '@typescript-eslint/types@8.3.0': - resolution: {integrity: sha512-y6sSEeK+facMaAyixM36dQ5NVXTnKWunfD1Ft4xraYqxP0lC0POJmIaL/mw72CUMqjY9qfyVfXafMeaUj0noWw==} + '@typescript-eslint/types@8.4.0': + resolution: {integrity: sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.3.0': - resolution: {integrity: sha512-Mq7FTHl0R36EmWlCJWojIC1qn/ZWo2YiWYc1XVtasJ7FIgjo0MVv9rZWXEE7IK2CGrtwe1dVOxWwqXUdNgfRCA==} + '@typescript-eslint/typescript-estree@8.4.0': + resolution: {integrity: sha512-kJ2OIP4dQw5gdI4uXsaxUZHRwWAGpREJ9Zq6D5L0BweyOrWsL6Sz0YcAZGWhvKnH7fm1J5YFE1JrQL0c9dd53A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -1824,27 +1824,27 @@ packages: typescript: optional: true - '@typescript-eslint/utils@8.3.0': - resolution: {integrity: sha512-F77WwqxIi/qGkIGOGXNBLV7nykwfjLsdauRB/DOFPdv6LTF3BHHkBpq81/b5iMPSF055oO2BiivDJV4ChvNtXA==} + '@typescript-eslint/utils@8.4.0': + resolution: {integrity: sha512-swULW8n1IKLjRAgciCkTCafyTHHfwVQFt8DovmaF69sKbOxTSFMmIZaSHjqO9i/RV0wIblaawhzvtva8Nmm7lQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - '@typescript-eslint/visitor-keys@8.3.0': - resolution: {integrity: sha512-RmZwrTbQ9QveF15m/Cl28n0LXD6ea2CjkhH5rQ55ewz3H24w+AMCJHPVYaZ8/0HoG8Z3cLLFFycRXxeO2tz9FA==} + '@typescript-eslint/visitor-keys@8.4.0': + resolution: {integrity: sha512-zTQD6WLNTre1hj5wp09nBIDiOc2U5r/qmzo7wxPn4ZgAjHql09EofqhF9WF+fZHzL5aCyaIpPcT2hyxl73kr9A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - '@unhead/addons@1.10.1': - resolution: {integrity: sha512-r2l8QTh/1L6e1ehSVe2r8bj177vudHP4L+mBhoDwU9GK7Uku5qhlCdU7jy2osXXEcOAA2w3QWYHQN+JAYyL8Dg==} + '@unhead/addons@1.10.3': + resolution: {integrity: sha512-2Qx/7VbSKeyhmPeb+QWctNejCZx3estsIiz51Cik+xkJgvhVFoXZYziHz7IduwST94lI+dmSfv2FrJLfMvxeKQ==} '@unhead/dom@1.10.2': resolution: {integrity: sha512-4m4xlhaHolHN05PHbST1Ri3Owf1gmmkf4WDzeffQWqCAeDWtKKlqQmWFN6OueeJXw12cwx+85+sqIom4gYFg8w==} - '@unhead/schema-org@1.10.1': - resolution: {integrity: sha512-GSKYVrjLUAjq9dCQGb4bfj9ZYEvgopNGAgt5cZBs7h50A3Vkrh7+ZRBT22YlBM94SKScxSFXsdeZzLt1jl22Sw==} + '@unhead/schema-org@1.10.3': + resolution: {integrity: sha512-XjbTeyMACceP5kGRXelK7PUmMvARq+NOeDKyLjIcNcEvZ3BTeXkykO0KMoDZZneE6EohjLSvCKGDIXXohkWfmw==} '@unhead/schema@1.10.3': resolution: {integrity: sha512-a/dOrCuh0AefPDAUBGUWDW6IBp9xdyw9onWkLW71VS48USvUZt51OVdWYsoQkFGOpqOZDfdiL82DBLhvYDj0rg==} @@ -1877,15 +1877,9 @@ packages: resolution: {integrity: sha512-zYOvFE0HfGIbnP/AvsbAlJpPRx9CQyXzL11m/8zgsHW5SGlJIYxuTll83l/xu026G5mPiksy7quoEOEgCLslqw==} engines: {node: '>=14'} - '@unocss/core@0.61.9': - resolution: {integrity: sha512-2W1YZQIWXcueGdbXU/ZCqn/8yQhWk8e8kAHFkVlbc9rictkd2UmPB9nIZ8Ii1tMwt6F0TT6vfHbLJEGCV08o2g==} - '@unocss/core@0.62.3': resolution: {integrity: sha512-Pfyrj8S7jq9K1QXD6Z5BCeiQavaHpbMN5q958/kmdbNGp57hOg1e346fMJAvgPjLBR+lE/hgZEsDrijtRiZXnw==} - '@unocss/extractor-arbitrary-variants@0.61.9': - resolution: {integrity: sha512-ii42/hKbhgeBBOy86729t6/HeGmxUcHM8FprPeb/v/DfYsCkjDvMYVynX3FN/K5pR2WV+HHp6TQS7GbTmRIN0g==} - '@unocss/extractor-arbitrary-variants@0.62.3': resolution: {integrity: sha512-9ZscWyXEwDZif+b56xZyJFHwJOjdMXmj+6x96jOsnRNBzwT9eW7YcGCErP1ih/q1S6KmuRrHM/JOXMBQ6H4qlw==} @@ -1907,9 +1901,6 @@ packages: '@unocss/preset-icons@0.62.3': resolution: {integrity: sha512-Ie+5RTyac1Q5CNB/s/4aB4VTHAQgQqsI5hshMNLkJ0Jj1lWxodUdEbCRKjXDalRjAXOS9vsLjfJ35ozJ1RSTIQ==} - '@unocss/preset-mini@0.61.9': - resolution: {integrity: sha512-qhagWfdM7ytRWf4wFfrAcdeCUCVD9wDVrM+9evAmuOnMXWEiVZCjfwhjjFu+8lM7g+38n+gi7VcrNuTiZ8fHBA==} - '@unocss/preset-mini@0.62.3': resolution: {integrity: sha512-dn/8ubeW2ry/ZF3iKxdQHnS0l3EBibt0rIOE/XVwx24ub6pRzclU4r7xHnXeqvAFOO9PoiKDGgFR92m6R2MxyQ==} @@ -1925,19 +1916,12 @@ packages: '@unocss/preset-web-fonts@0.62.3': resolution: {integrity: sha512-rGEouncGFwcUY1cjkQ/ZoSmEzOeSi3Yk4YAfHGyS0ff5zKuTDWZgivB8hh/mTtvRzZunIL+FW1+1z5G9rUwjgQ==} - '@unocss/preset-wind@0.61.9': - resolution: {integrity: sha512-AzbjJrNL9Rb2BzTiREyssd8v7KFVVLERQ/PNILGzo6yYelYMl4AhKXZ3jgxWEsIABArVa3UkGBigG4h/L+2JHA==} - '@unocss/preset-wind@0.62.3': resolution: {integrity: sha512-6+VNce1he1U5EXKlXRwTIPn8KeK6bZ2jAEgcCxk8mFy8SzOlLeYzXCI9lcdiWRTjIeIiK5iSaUqmsQFtKdTyQg==} '@unocss/reset@0.62.3': resolution: {integrity: sha512-XVKPkbm8y9SGzRaG3x+HygGZURm50MvKLVHXsbxi67RbIir9Ouyt9hQTV6Xs3RicRZFWOpJx3wMRb8iKUOe5Zw==} - '@unocss/rule-utils@0.61.9': - resolution: {integrity: sha512-54Hw0nF+3ga70ETo3kes4He62wdsB4dHMgEiD/DEmJzyVY3ZuG/sIVAgkxjMQDo5w4SSYU/Ys1QaY+IQmeJHFQ==} - engines: {node: '>=14'} - '@unocss/rule-utils@0.62.3': resolution: {integrity: sha512-qI37jHH//XzyR5Y2aN3Kpo4lQrQO+CaiXpqPSwMLYh2bIypc2RQVpqGVtU736x0eA6IIx41XEkKzUW+VtvJvmg==} engines: {node: '>=14'} @@ -3203,8 +3187,8 @@ packages: peerDependencies: eslint: '>=8.56.0' - eslint-plugin-vue@9.27.0: - resolution: {integrity: sha512-5Dw3yxEyuBSXTzT5/Ge1X5kIkRTQ3nvBn/VwPwInNiZBSJOO/timWMUaflONnFBzU6NhB68lxnCda7ULV5N7LA==} + eslint-plugin-vue@9.28.0: + resolution: {integrity: sha512-ShrihdjIhOTxs+MfWun6oJWuk+g/LAhN+CiuOl/jjkG3l0F2AuK5NMTaWqyvBgkFtpYmyks6P4603mLmhNJW8g==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 @@ -4490,8 +4474,8 @@ packages: nuxt-link-checker@3.1.1: resolution: {integrity: sha512-rtIgU/u2P6NeQuX64iKiKuhgtQ6Kiia8tJpMJKY0B+DRrsmkHySGDslbI6YUr9evJXKUAoQWOlXMY2eCfI6Jsg==} - nuxt-og-image@3.0.0-rc.65: - resolution: {integrity: sha512-rhfjZBONskXJAnsmv5Wy7f6jbSMRw4JuJ3As4Vg+LttMVzw0YwH/X/gDFRVhJ1z2/2ahvBiBiJAnkmlncR+9Ow==} + nuxt-og-image@3.0.0-rc.66: + resolution: {integrity: sha512-NCogUcfIHGRlXKZ4LTVF4LI25oT0pk1Xl7LF1FmF1iT7dVF8WJUVrUHoHBCzJjSGNFrZFoiRHCOpjFTloNj6sg==} engines: {node: '>=18.0.0'} nuxt-schema-org@3.3.9: @@ -4701,8 +4685,8 @@ packages: perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} + picocolors@1.1.0: + resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -6301,7 +6285,7 @@ snapshots: '@babel/code-frame@7.24.7': dependencies: '@babel/highlight': 7.24.7 - picocolors: 1.0.1 + picocolors: 1.1.0 '@babel/compat-data@7.25.4': {} @@ -6430,7 +6414,7 @@ snapshots: '@babel/helper-validator-identifier': 7.24.7 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.1 + picocolors: 1.1.0 '@babel/parser@7.25.6': dependencies: @@ -7318,8 +7302,8 @@ snapshots: '@eslint/js': 9.9.1 '@nuxt/eslint-plugin': 0.5.5(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) '@stylistic/eslint-plugin': 2.7.2(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/eslint-plugin': 8.3.0(@typescript-eslint/parser@8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/parser': 8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.4.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/parser': 8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) eslint: 9.9.1(jiti@1.21.6) eslint-config-flat-gitignore: 0.2.0 eslint-flat-config-utils: 0.3.1 @@ -7327,7 +7311,7 @@ snapshots: eslint-plugin-jsdoc: 50.2.2(eslint@9.9.1(jiti@1.21.6)) eslint-plugin-regexp: 2.6.0(eslint@9.9.1(jiti@1.21.6)) eslint-plugin-unicorn: 55.0.0(eslint@9.9.1(jiti@1.21.6)) - eslint-plugin-vue: 9.27.0(eslint@9.9.1(jiti@1.21.6)) + eslint-plugin-vue: 9.28.0(eslint@9.9.1(jiti@1.21.6)) globals: 15.9.0 local-pkg: 0.5.0 pathe: 1.1.2 @@ -7338,8 +7322,8 @@ snapshots: '@nuxt/eslint-plugin@0.5.5(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: - '@typescript-eslint/types': 8.3.0 - '@typescript-eslint/utils': 8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) eslint: 9.9.1(jiti@1.21.6) transitivePeerDependencies: - supports-color @@ -8000,14 +7984,14 @@ snapshots: - vite - vue - '@nuxtjs/seo@2.0.0-rc.19(h3@1.12.0)(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4))': + '@nuxtjs/seo@2.0.0-rc.20(h3@1.12.0)(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4))': dependencies: '@nuxt/kit': 3.13.0(magicast@0.3.5)(rollup@4.21.2) '@nuxtjs/robots': 4.1.6(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) - '@nuxtjs/sitemap': 6.0.0-beta.2(h3@1.12.0)(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) + '@nuxtjs/sitemap': 6.0.0(h3@1.12.0)(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) defu: 6.1.4 nuxt-link-checker: 3.1.1(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) - nuxt-og-image: 3.0.0-rc.65(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) + nuxt-og-image: 3.0.0-rc.66(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) nuxt-schema-org: 3.3.9(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) nuxt-seo-experiments: 4.0.1(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) nuxt-site-config: 2.2.16(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) @@ -8023,7 +8007,7 @@ snapshots: - vite - vue - '@nuxtjs/sitemap@6.0.0-beta.2(h3@1.12.0)(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4))': + '@nuxtjs/sitemap@6.0.0(h3@1.12.0)(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4))': dependencies: '@nuxt/devtools-kit': 1.4.1(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6)) '@nuxt/kit': 3.13.0(magicast@0.3.5)(rollup@4.21.2) @@ -8406,7 +8390,7 @@ snapshots: '@stylistic/eslint-plugin@2.7.2(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: '@types/eslint': 9.6.1 - '@typescript-eslint/utils': 8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) eslint: 9.9.1(jiti@1.21.6) eslint-visitor-keys: 4.0.0 espree: 10.1.0 @@ -8416,7 +8400,7 @@ snapshots: - supports-color - typescript - '@swc/helpers@0.5.12': + '@swc/helpers@0.5.13': dependencies: tslib: 2.7.0 @@ -8501,14 +8485,14 @@ snapshots: '@types/youtube@0.1.0': {} - '@typescript-eslint/eslint-plugin@8.3.0(@typescript-eslint/parser@8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@8.4.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/scope-manager': 8.3.0 - '@typescript-eslint/type-utils': 8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/utils': 8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 8.3.0 + '@typescript-eslint/parser': 8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/type-utils': 8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.4.0 eslint: 9.9.1(jiti@1.21.6) graphemer: 1.4.0 ignore: 5.3.2 @@ -8519,12 +8503,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)': + '@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: - '@typescript-eslint/scope-manager': 8.3.0 - '@typescript-eslint/types': 8.3.0 - '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 8.3.0 + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/typescript-estree': 8.4.0(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.4.0 debug: 4.3.6 eslint: 9.9.1(jiti@1.21.6) optionalDependencies: @@ -8532,15 +8516,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.3.0': + '@typescript-eslint/scope-manager@8.4.0': dependencies: - '@typescript-eslint/types': 8.3.0 - '@typescript-eslint/visitor-keys': 8.3.0 + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/visitor-keys': 8.4.0 - '@typescript-eslint/type-utils@8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)': + '@typescript-eslint/type-utils@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: - '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4) - '@typescript-eslint/utils': 8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.4.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) debug: 4.3.6 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: @@ -8549,12 +8533,12 @@ snapshots: - eslint - supports-color - '@typescript-eslint/types@8.3.0': {} + '@typescript-eslint/types@8.4.0': {} - '@typescript-eslint/typescript-estree@8.3.0(typescript@5.5.4)': + '@typescript-eslint/typescript-estree@8.4.0(typescript@5.5.4)': dependencies: - '@typescript-eslint/types': 8.3.0 - '@typescript-eslint/visitor-keys': 8.3.0 + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/visitor-keys': 8.4.0 debug: 4.3.6 fast-glob: 3.3.2 is-glob: 4.0.3 @@ -8566,25 +8550,25 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)': + '@typescript-eslint/utils@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1(jiti@1.21.6)) - '@typescript-eslint/scope-manager': 8.3.0 - '@typescript-eslint/types': 8.3.0 - '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/typescript-estree': 8.4.0(typescript@5.5.4) eslint: 9.9.1(jiti@1.21.6) transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@8.3.0': + '@typescript-eslint/visitor-keys@8.4.0': dependencies: - '@typescript-eslint/types': 8.3.0 + '@typescript-eslint/types': 8.4.0 eslint-visitor-keys: 3.4.3 '@ungap/structured-clone@1.2.0': {} - '@unhead/addons@1.10.1(rollup@4.21.2)': + '@unhead/addons@1.10.3(rollup@4.21.2)': dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.21.2) '@unhead/schema': 1.10.3 @@ -8602,7 +8586,7 @@ snapshots: '@unhead/schema': 1.10.3 '@unhead/shared': 1.10.3 - '@unhead/schema-org@1.10.1': + '@unhead/schema-org@1.10.3': dependencies: ufo: 1.5.4 @@ -8693,14 +8677,8 @@ snapshots: transitivePeerDependencies: - supports-color - '@unocss/core@0.61.9': {} - '@unocss/core@0.62.3': {} - '@unocss/extractor-arbitrary-variants@0.61.9': - dependencies: - '@unocss/core': 0.61.9 - '@unocss/extractor-arbitrary-variants@0.62.3': dependencies: '@unocss/core': 0.62.3 @@ -8784,12 +8762,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@unocss/preset-mini@0.61.9': - dependencies: - '@unocss/core': 0.61.9 - '@unocss/extractor-arbitrary-variants': 0.61.9 - '@unocss/rule-utils': 0.61.9 - '@unocss/preset-mini@0.62.3': dependencies: '@unocss/core': 0.62.3 @@ -8817,12 +8789,6 @@ snapshots: '@unocss/core': 0.62.3 ofetch: 1.3.4 - '@unocss/preset-wind@0.61.9': - dependencies: - '@unocss/core': 0.61.9 - '@unocss/preset-mini': 0.61.9 - '@unocss/rule-utils': 0.61.9 - '@unocss/preset-wind@0.62.3': dependencies: '@unocss/core': 0.62.3 @@ -8831,11 +8797,6 @@ snapshots: '@unocss/reset@0.62.3': {} - '@unocss/rule-utils@0.61.9': - dependencies: - '@unocss/core': 0.61.9 - magic-string: 0.30.11 - '@unocss/rule-utils@0.62.3': dependencies: '@unocss/core': 0.62.3 @@ -9502,7 +9463,7 @@ snapshots: caniuse-lite: 1.0.30001655 fraction.js: 4.3.7 normalize-range: 0.1.2 - picocolors: 1.0.1 + picocolors: 1.1.0 postcss: 8.4.44 postcss-value-parser: 4.2.0 @@ -10357,8 +10318,8 @@ snapshots: eslint-plugin-import-x@4.1.1(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4): dependencies: - '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.5.4) - '@typescript-eslint/utils': 8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.4.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) debug: 4.3.6 doctrine: 3.0.0 eslint: 9.9.1(jiti@1.21.6) @@ -10433,7 +10394,7 @@ snapshots: semver: 7.6.3 strip-indent: 3.0.0 - eslint-plugin-vue@9.27.0(eslint@9.9.1(jiti@1.21.6)): + eslint-plugin-vue@9.28.0(eslint@9.9.1(jiti@1.21.6)): dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.1(jiti@1.21.6)) eslint: 9.9.1(jiti@1.21.6) @@ -10691,7 +10652,7 @@ snapshots: fontkit@2.0.4: dependencies: - '@swc/helpers': 0.5.12 + '@swc/helpers': 0.5.13 brotli: 1.3.3 clone: 2.1.2 dfa: 1.2.0 @@ -11360,7 +11321,7 @@ snapshots: launch-editor@2.8.1: dependencies: - picocolors: 1.0.1 + picocolors: 1.1.0 shell-quote: 1.8.1 lazystream@1.0.1: @@ -12126,14 +12087,14 @@ snapshots: - vite - vue - nuxt-og-image@3.0.0-rc.65(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)): + nuxt-og-image@3.0.0-rc.66(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)): dependencies: '@nuxt/devtools-kit': 1.4.1(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6)) '@nuxt/kit': 3.13.0(magicast@0.3.5)(rollup@4.21.2) '@resvg/resvg-js': 2.6.2 '@resvg/resvg-wasm': 2.6.2 - '@unocss/core': 0.61.9 - '@unocss/preset-wind': 0.61.9 + '@unocss/core': 0.62.3 + '@unocss/preset-wind': 0.62.3 chrome-launcher: 1.1.2 defu: 6.1.4 execa: 9.3.1 @@ -12165,7 +12126,7 @@ snapshots: dependencies: '@nuxt/devtools-kit': 1.4.1(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6)) '@nuxt/kit': 3.13.0(magicast@0.3.5)(rollup@4.21.2) - '@unhead/schema-org': 1.10.1 + '@unhead/schema-org': 1.10.3 nuxt-site-config: 2.2.16(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)) nuxt-site-config-kit: 2.2.16(magicast@0.3.5)(rollup@4.21.2)(vue@3.4.38(typescript@5.5.4)) pathe: 1.1.2 @@ -12180,7 +12141,7 @@ snapshots: nuxt-seo-experiments@4.0.1(magicast@0.3.5)(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4)): dependencies: '@nuxt/kit': 3.13.0(magicast@0.3.5)(rollup@4.21.2) - '@unhead/addons': 1.10.1(rollup@4.21.2) + '@unhead/addons': 1.10.3(rollup@4.21.2) defu: 6.1.4 escape-string-regexp: 5.0.0 fast-glob: 3.3.2 @@ -12639,7 +12600,7 @@ snapshots: perfect-debounce@1.0.0: {} - picocolors@1.0.1: {} + picocolors@1.1.0: {} picomatch@2.3.1: {} @@ -12862,7 +12823,7 @@ snapshots: postcss@8.4.44: dependencies: nanoid: 3.3.7 - picocolors: 1.0.1 + picocolors: 1.1.0 source-map-js: 1.2.0 prebuild-install@7.1.2: @@ -13548,7 +13509,7 @@ snapshots: css-tree: 2.3.1 css-what: 6.1.0 csso: 5.0.5 - picocolors: 1.0.1 + picocolors: 1.1.0 synckit@0.9.1: dependencies: @@ -13590,7 +13551,7 @@ snapshots: micromatch: 4.0.8 normalize-path: 3.0.0 object-hash: 3.0.0 - picocolors: 1.0.1 + picocolors: 1.1.0 postcss: 8.4.44 postcss-import: 15.1.0(postcss@8.4.44) postcss-js: 4.0.1(postcss@8.4.44) @@ -14115,7 +14076,7 @@ snapshots: dependencies: browserslist: 4.23.3 escalade: 3.2.0 - picocolors: 1.0.1 + picocolors: 1.1.0 uqr@0.1.2: {} @@ -14210,7 +14171,7 @@ snapshots: fs-extra: 11.2.0 open: 10.1.0 perfect-debounce: 1.0.0 - picocolors: 1.0.1 + picocolors: 1.1.0 sirv: 2.0.4 optionalDependencies: '@nuxt/kit': 3.13.0(magicast@0.3.5)(rollup@3.29.4) @@ -14227,7 +14188,7 @@ snapshots: fs-extra: 11.2.0 open: 10.1.0 perfect-debounce: 1.0.0 - picocolors: 1.0.1 + picocolors: 1.1.0 sirv: 2.0.4 vite: 5.4.2(@types/node@22.5.2)(terser@5.31.6) optionalDependencies: From f198a80a20288aef3d14b7da22656aa3343b93b0 Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 3 Sep 2024 15:50:21 +1000 Subject: [PATCH 004/549] fix(googleAdsense): broken validation input path Fixes #223 --- docs/content/scripts/ads/google-adsense.md | 16 +++++++++++++ src/runtime/registry/google-adsense.ts | 27 +++++++++------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/docs/content/scripts/ads/google-adsense.md b/docs/content/scripts/ads/google-adsense.md index f083e567..004902d7 100644 --- a/docs/content/scripts/ads/google-adsense.md +++ b/docs/content/scripts/ads/google-adsense.md @@ -72,6 +72,22 @@ export function useScriptGoogleAdsense(_options?: Go Please follow the [Registry Scripts](/docs/guides/registry-scripts) guide to learn more about advanced usage. +### Site Ownership Verification + +When a `client` is provided, a meta tag will be inserted on the page so that Google can verify your site ownership. + +```ts +const adsense = useScriptGoogleAdsense({ + client: 'ca-pub-', +}) +``` + +The generated meta tag will look like this: + +```html + +``` + ### GoogleAdsenseApi ```ts diff --git a/src/runtime/registry/google-adsense.ts b/src/runtime/registry/google-adsense.ts index 47f42146..c6991d99 100644 --- a/src/runtime/registry/google-adsense.ts +++ b/src/runtime/registry/google-adsense.ts @@ -1,6 +1,5 @@ -import { optional } from 'valibot' import { useRegistryScript } from '../utils' -import { object, string } from '#nuxt-scripts-validator' +import { object, string, optional } from '#nuxt-scripts-validator' import type { RegistryScriptInput } from '#nuxt-scripts' import { useHead } from '#imports' @@ -40,21 +39,17 @@ export function useScriptGoogleAdsense(_options?: Go use() { return { adsbygoogle: window.adsbygoogle } }, - // allow dataLayer to be accessed on the server - stub: import.meta.client - ? undefined - : ({ fn }) => { - return fn === 'adsbygoogle' ? [] : undefined - }, beforeInit() { - useHead({ - meta: [ - { - name: 'google-adsense-account', - content: options?.client, - }, - ], - }) + if (options?.client) { + useHead({ + meta: [ + { + name: 'google-adsense-account', + content: options?.client, + }, + ], + }) + } }, }, }), _options) From 2033f16f3f4aa69f2398ca87f7f290f944efaac7 Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 3 Sep 2024 15:50:31 +1000 Subject: [PATCH 005/549] chore: avoid runtime valibot dependency --- src/runtime/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/types.ts b/src/runtime/types.ts index 41c680ad..b679e2b7 100644 --- a/src/runtime/types.ts +++ b/src/runtime/types.ts @@ -3,7 +3,6 @@ import type { UseScriptInput, VueScriptInstance } from '@unhead/vue' import type { ComputedRef, Ref } from 'vue' import type { InferInput, ObjectSchema } from 'valibot' import type { Import } from 'unimport' -import { object } from 'valibot' import type { SegmentInput } from './registry/segment' import type { CloudflareWebAnalyticsInput } from './registry/cloudflare-web-analytics' import type { MetaPixelInput } from './registry/meta-pixel' @@ -24,6 +23,7 @@ import type { ClarityInput } from './registry/clarity' import type { CrispInput } from './registry/crisp' import type { GoogleAnalyticsInput } from './registry/google-analytics' import type { GoogleTagManagerInput } from './registry/google-tag-manager' +import { object } from '#nuxt-scripts-validator' export type NuxtUseScriptOptions = {}, U = {}> = Omit, 'trigger'> & { /** From 5b61da05d995fa221af10eada8c592ecc8571dc8 Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 3 Sep 2024 16:23:39 +1000 Subject: [PATCH 006/549] chore: soft dependency unhead 1.10.4 Fixes #219 --- package.json | 10 +-- .../pages/third-parties/youtube/multiple.vue | 42 +++++++++ pnpm-lock.yaml | 86 +++++++++---------- src/module.ts | 4 +- 4 files changed, 92 insertions(+), 50 deletions(-) create mode 100644 playground/pages/third-parties/youtube/multiple.vue diff --git a/package.json b/package.json index 9802d1b9..e8283d5a 100644 --- a/package.json +++ b/package.json @@ -120,14 +120,14 @@ "@nuxt/schema": "3.13.0", "@nuxt/scripts": "workspace:*", "@unhead/dom": "1.10.2", - "@unhead/schema": "1.10.3", - "@unhead/shared": "1.10.3", - "@unhead/ssr": "1.10.3", - "@unhead/vue": "1.10.3", + "@unhead/schema": "1.10.4", + "@unhead/shared": "1.10.4", + "@unhead/ssr": "1.10.4", + "@unhead/vue": "1.10.4", "nuxt": "^3.13.0", "nuxt-scripts-devtools": "workspace:*", "shiki": "1.10.3", - "unhead": "1.10.3", + "unhead": "1.10.4", "vue": "^3.4.38", "vue-router": "^4.4.3" } diff --git a/playground/pages/third-parties/youtube/multiple.vue b/playground/pages/third-parties/youtube/multiple.vue new file mode 100644 index 00000000..9a5dc75f --- /dev/null +++ b/playground/pages/third-parties/youtube/multiple.vue @@ -0,0 +1,42 @@ + + + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e247645..ef9ce287 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,14 +8,14 @@ overrides: '@nuxt/schema': 3.13.0 '@nuxt/scripts': workspace:* '@unhead/dom': 1.10.2 - '@unhead/schema': 1.10.3 - '@unhead/shared': 1.10.3 - '@unhead/ssr': 1.10.3 - '@unhead/vue': 1.10.3 + '@unhead/schema': 1.10.4 + '@unhead/shared': 1.10.4 + '@unhead/ssr': 1.10.4 + '@unhead/vue': 1.10.4 nuxt: ^3.13.0 nuxt-scripts-devtools: workspace:* shiki: 1.10.3 - unhead: 1.10.3 + unhead: 1.10.4 vue: ^3.4.38 vue-router: ^4.4.3 @@ -45,8 +45,8 @@ importers: specifier: ^0.1.0 version: 0.1.0 '@unhead/vue': - specifier: 1.10.3 - version: 1.10.3(vue@3.4.38(typescript@5.5.4)) + specifier: 1.10.4 + version: 1.10.4(vue@3.4.38(typescript@5.5.4)) '@vueuse/core': specifier: ^11.0.3 version: 11.0.3(vue@3.4.38(typescript@5.5.4)) @@ -124,8 +124,8 @@ importers: specifier: ^8.4.0 version: 8.4.0(typescript@5.5.4) '@unhead/schema': - specifier: 1.10.3 - version: 1.10.3 + specifier: 1.10.4 + version: 1.10.4 acorn-loose: specifier: ^8.4.0 version: 8.4.0 @@ -1846,17 +1846,17 @@ packages: '@unhead/schema-org@1.10.3': resolution: {integrity: sha512-XjbTeyMACceP5kGRXelK7PUmMvARq+NOeDKyLjIcNcEvZ3BTeXkykO0KMoDZZneE6EohjLSvCKGDIXXohkWfmw==} - '@unhead/schema@1.10.3': - resolution: {integrity: sha512-a/dOrCuh0AefPDAUBGUWDW6IBp9xdyw9onWkLW71VS48USvUZt51OVdWYsoQkFGOpqOZDfdiL82DBLhvYDj0rg==} + '@unhead/schema@1.10.4': + resolution: {integrity: sha512-nX9sJgKPy2t4GHB9ky/vkMLbYqXl9Num5NZToTr0rKrIGkshzHhUrbn/EiHreIjcGI1eIpu+edniCDIwGTJgmw==} - '@unhead/shared@1.10.3': - resolution: {integrity: sha512-MCnEvSB/ayYNf+8ZALUIzRD/hkEMGyDcVZYP/Npt/m/x3q/ad4nVyM6xkHjnV2CGfW62/+WDvddk7o2Iz+1QKA==} + '@unhead/shared@1.10.4': + resolution: {integrity: sha512-C5wsps9i/XCBObMVQUrbXPvZG17a/e5yL0IsxpICaT4QSiZAj9v7JrNQ5WpM5JOZVMKRI5MYRdafNDw3iSmqZg==} - '@unhead/ssr@1.10.3': - resolution: {integrity: sha512-Bubkzz0Hz4y8IHJVujocy+tUMhHgKLpXUVpaQm786IdlPp6SRPauHLS9E/+gy2S9+0gbhou71Naqbz39z8+x4A==} + '@unhead/ssr@1.10.4': + resolution: {integrity: sha512-2nDG08q9bTvMB24YGNJCXimAs1vuG9yVa01i/Et1B2y4P8qhweXOxnialGmt5j8xeXwPFUBCe36tC5kLCSuJoQ==} - '@unhead/vue@1.10.3': - resolution: {integrity: sha512-qAkKmiwIn6fd5tgCg3aORMMP8VE70AYl7PJSd6skLD+gzEh1unUmRXQ+uF8Dx3TxUmeXvZVq9F5deZwlmeXEdw==} + '@unhead/vue@1.10.4': + resolution: {integrity: sha512-Q45F/KOvDeitc8GkfkPY45V8Dmw1m1b9A/aHM5A2BwRV8GyoRV+HRWVw5h02e0AO1TsICvcW8tI90qeCM2oGSA==} peerDependencies: vue: ^3.4.38 @@ -5734,8 +5734,8 @@ packages: unenv@1.10.0: resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==} - unhead@1.10.3: - resolution: {integrity: sha512-0zKLTiu3N8++UFQuzk9a6rN2ct73788Hwb63fhk2mshJscRWEj/y7VZnS3IpsGUUw+WLtH2HZrG1PXZIMzweyA==} + unhead@1.10.4: + resolution: {integrity: sha512-qKiYhgZ4IuDbylP409cdwK/8WEIi5cOSIBei/OXzxFs4uxiTZHSSa8NC1qPu2kooxHqxyoXGBw8ARms9zOsbxw==} unicode-emoji-modifier-base@1.0.0: resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} @@ -8571,8 +8571,8 @@ snapshots: '@unhead/addons@1.10.3(rollup@4.21.2)': dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.21.2) - '@unhead/schema': 1.10.3 - '@unhead/shared': 1.10.3 + '@unhead/schema': 1.10.4 + '@unhead/shared': 1.10.4 magic-string: 0.30.11 mlly: 1.7.1 ufo: 1.5.4 @@ -8583,33 +8583,33 @@ snapshots: '@unhead/dom@1.10.2': dependencies: - '@unhead/schema': 1.10.3 - '@unhead/shared': 1.10.3 + '@unhead/schema': 1.10.4 + '@unhead/shared': 1.10.4 '@unhead/schema-org@1.10.3': dependencies: ufo: 1.5.4 - '@unhead/schema@1.10.3': + '@unhead/schema@1.10.4': dependencies: hookable: 5.5.3 zhead: 2.2.4 - '@unhead/shared@1.10.3': + '@unhead/shared@1.10.4': dependencies: - '@unhead/schema': 1.10.3 + '@unhead/schema': 1.10.4 - '@unhead/ssr@1.10.3': + '@unhead/ssr@1.10.4': dependencies: - '@unhead/schema': 1.10.3 - '@unhead/shared': 1.10.3 + '@unhead/schema': 1.10.4 + '@unhead/shared': 1.10.4 - '@unhead/vue@1.10.3(vue@3.4.38(typescript@5.5.4))': + '@unhead/vue@1.10.4(vue@3.4.38(typescript@5.5.4))': dependencies: - '@unhead/schema': 1.10.3 - '@unhead/shared': 1.10.3 + '@unhead/schema': 1.10.4 + '@unhead/shared': 1.10.4 hookable: 5.5.3 - unhead: 1.10.3 + unhead: 1.10.4 vue: 3.4.38(typescript@5.5.4) '@unocss/astro@0.62.3(rollup@3.29.4)': @@ -9148,9 +9148,9 @@ snapshots: '@vueuse/head@2.0.0(vue@3.4.38(typescript@5.5.4))': dependencies: '@unhead/dom': 1.10.2 - '@unhead/schema': 1.10.3 - '@unhead/ssr': 1.10.3 - '@unhead/vue': 1.10.3(vue@3.4.38(typescript@5.5.4)) + '@unhead/schema': 1.10.4 + '@unhead/ssr': 1.10.4 + '@unhead/vue': 1.10.4(vue@3.4.38(typescript@5.5.4)) vue: 3.4.38(typescript@5.5.4) '@vueuse/integrations@10.11.1(focus-trap@7.5.4)(fuse.js@6.6.2)(vue@3.4.38(typescript@5.5.4))': @@ -12198,8 +12198,8 @@ snapshots: '@nuxt/telemetry': 2.5.4(magicast@0.3.5)(rollup@3.29.4) '@nuxt/vite-builder': 3.13.0(@types/node@22.5.2)(eslint@9.9.1(jiti@1.21.6))(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.4)(terser@5.31.6)(typescript@5.5.4)(vue@3.4.38(typescript@5.5.4)) '@unhead/dom': 1.10.2 - '@unhead/ssr': 1.10.3 - '@unhead/vue': 1.10.3(vue@3.4.38(typescript@5.5.4)) + '@unhead/ssr': 1.10.4 + '@unhead/vue': 1.10.4(vue@3.4.38(typescript@5.5.4)) '@vue/shared': 3.4.38 acorn: 8.12.1 c12: 1.11.1(magicast@0.3.5) @@ -12305,8 +12305,8 @@ snapshots: '@nuxt/telemetry': 2.5.4(magicast@0.3.5)(rollup@4.21.2) '@nuxt/vite-builder': 3.13.0(@types/node@22.5.2)(eslint@9.9.1(jiti@1.21.6))(magicast@0.3.5)(optionator@0.9.4)(rollup@4.21.2)(terser@5.31.6)(typescript@5.5.4)(vue@3.4.38(typescript@5.5.4)) '@unhead/dom': 1.10.2 - '@unhead/ssr': 1.10.3 - '@unhead/vue': 1.10.3(vue@3.4.38(typescript@5.5.4)) + '@unhead/ssr': 1.10.4 + '@unhead/vue': 1.10.4(vue@3.4.38(typescript@5.5.4)) '@vue/shared': 3.4.38 acorn: 8.12.1 c12: 1.11.1(magicast@0.3.5) @@ -13809,11 +13809,11 @@ snapshots: node-fetch-native: 1.6.4 pathe: 1.1.2 - unhead@1.10.3: + unhead@1.10.4: dependencies: '@unhead/dom': 1.10.2 - '@unhead/schema': 1.10.3 - '@unhead/shared': 1.10.3 + '@unhead/schema': 1.10.4 + '@unhead/shared': 1.10.4 hookable: 5.5.3 unicode-emoji-modifier-base@1.0.0: {} diff --git a/src/module.ts b/src/module.ts index 8b42974d..c7cceef9 100644 --- a/src/module.ts +++ b/src/module.ts @@ -107,8 +107,8 @@ export default defineNuxtModule({ if (!unheadVersion || lt(unheadVersion, '1.10.0')) { logger.error(`Nuxt Scripts requires Unhead >= 1.10.0, you are using v${unheadVersion}. Please run \`nuxi upgrade --clean\` to upgrade...`) } - else if (lt(unheadVersion, '1.10.3')) { - logger.warn(`Nuxt Scripts recommends Unhead >= 1.10.3, you are using v${unheadVersion}. Please run \`nuxi upgrade --clean\` to upgrade...`) + else if (lt(unheadVersion, '1.10.4')) { + logger.warn(`Nuxt Scripts recommends Unhead >= 1.10.4, you are using v${unheadVersion}. Please run \`nuxi upgrade --clean\` to upgrade...`) } } // allow augmenting the options From a65a5e08286800a0c1bde1af2e1e87463bb0f0f2 Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 3 Sep 2024 17:05:18 +1000 Subject: [PATCH 007/549] feat: automatically `preload` and `preconnect` relevant scripts Closes #218 --- .../components/ScriptYouTubePlayer.vue | 4 +- src/runtime/composables/useScript.ts | 25 +++++++++-- .../composables/useScriptTriggerElement.ts | 42 +++++++++---------- 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/src/runtime/components/ScriptYouTubePlayer.vue b/src/runtime/components/ScriptYouTubePlayer.vue index 75a7e064..bcbb9f24 100644 --- a/src/runtime/components/ScriptYouTubePlayer.vue +++ b/src/runtime/components/ScriptYouTubePlayer.vue @@ -52,7 +52,7 @@ const { onLoaded, status } = useScriptYouTubePlayer({ const player: Ref = ref() let clickTriggered = false -if (props.trigger === 'mousedown') { +if (props.trigger === 'mousedown' && trigger instanceof Promise) { trigger.then(() => { clickTriggered = true }) @@ -126,12 +126,14 @@ if (import.meta.server) { useHead({ link: [ { + key: `nuxt-script-youtube-img`, rel: props.aboveTheFold ? 'preconnect' : 'dns-prefetch', href: 'https://i.ytimg.com', }, props.aboveTheFold // we can preload the placeholder image ? { + key: `nuxt-script-youtube-img`, rel: 'preload', as: 'image', href: placeholder.value, diff --git a/src/runtime/composables/useScript.ts b/src/runtime/composables/useScript.ts index d51b4b40..a4ec1a5e 100644 --- a/src/runtime/composables/useScript.ts +++ b/src/runtime/composables/useScript.ts @@ -3,7 +3,7 @@ import type { UseScriptOptions, UseFunctionType, AsAsyncFunctionValues } from '@ import { resolveScriptKey } from 'unhead' import { defu } from 'defu' import { useScript as _useScript } from '@unhead/vue' -import { injectHead, onNuxtReady, useNuxtApp, useRuntimeConfig, reactive } from '#imports' +import { injectHead, onNuxtReady, useHead, useNuxtApp, useRuntimeConfig, reactive } from '#imports' import type { NuxtDevToolsScriptInstance, NuxtUseScriptOptions } from '#nuxt-scripts' function useNuxtScriptRuntimeConfig() { @@ -25,11 +25,28 @@ export type UseScriptContext> = export function useScript = Record, U = Record>(input: UseScriptInput, options?: NuxtUseScriptOptions): UseScriptContext, T>> { input = typeof input === 'string' ? { src: input } : input options = defu(options, useNuxtScriptRuntimeConfig()?.defaultScriptOptions) as NuxtUseScriptOptions - - if (options.trigger === 'onNuxtReady') + // browser hint optimizations + const rel = options.trigger === 'onNuxtReady' ? 'preload' : 'preconnect' + const id = resolveScriptKey(input) as keyof typeof nuxtApp._scripts + if (options.trigger !== 'server' && (rel === 'preload' || !input.src.startsWith('/'))) { + useHead({ + link: [ + { + rel, + as: rel === 'preload' ? 'script' : undefined, + href: input.src, + crossorigin: typeof input.crossorigin !== 'undefined' ? input.crossorigin : 'anonymous', + key: `nuxt-script-${id}`, + tagPriority: rel === 'preload' ? 'high' : 0, + fetchpriority: 'low', + }, + ], + }) + } + if (options.trigger === 'onNuxtReady') { options.trigger = onNuxtReady + } const nuxtApp = useNuxtApp() - const id = resolveScriptKey(input) as keyof typeof nuxtApp._scripts nuxtApp.$scripts = nuxtApp.$scripts! || reactive({}) const exists = !!(nuxtApp.$scripts as Record)?.[id] if (import.meta.client) { diff --git a/src/runtime/composables/useScriptTriggerElement.ts b/src/runtime/composables/useScriptTriggerElement.ts index 8507bf61..1ee6da17 100644 --- a/src/runtime/composables/useScriptTriggerElement.ts +++ b/src/runtime/composables/useScriptTriggerElement.ts @@ -52,31 +52,29 @@ function useElementVisibilityPromise(element: MaybeComputedElementRef) { /** * Create a trigger for an element to load a script based on specific element events. */ -export function useScriptTriggerElement(options: ElementScriptTriggerOptions): Promise { +export function useScriptTriggerElement(options: ElementScriptTriggerOptions): Promise | 'onNuxtReady' { const { el, trigger } = options + const triggers = (Array.isArray(options.trigger) ? options.trigger : [options.trigger]).filter(Boolean) as string[] + if (!trigger || triggers.includes('immediate') || triggers.includes('onNuxtReady')) { + return 'onNuxtReady' + } if (import.meta.server || !el) return new Promise(() => {}) - const triggers = (Array.isArray(options.trigger) ? options.trigger : [options.trigger]).filter(Boolean) as string[] - if (el && triggers.some(t => ['visibility', 'visible'].includes(t))) + if (triggers.some(t => ['visibility', 'visible'].includes(t))) return useElementVisibilityPromise(el) - if (!trigger) - return Promise.resolve() - if (!triggers.includes('immediate')) { // TODO optimize this, only have 1 instance of intersection observer, stop on find - return new Promise((resolve, reject) => { - const _ = useEventListener( - typeof el !== 'undefined' ? (el as EventTarget) : document.body, - triggers, - () => { - _() - resolve() - }, - { once: true, passive: true }, - ) - tryOnScopeDispose(reject) - }).catch(() => { - // it's okay - }) - } - return Promise.resolve() + return new Promise((resolve, reject) => { + const _ = useEventListener( + typeof el !== 'undefined' ? (el as EventTarget) : document.body, + triggers, + () => { + _() + resolve() + }, + { once: true, passive: true }, + ) + tryOnScopeDispose(reject) + }).catch(() => { + // it's okay + }) } From dd75a3157c952b01b8a4bd84a97c3feb85f71e90 Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 3 Sep 2024 18:46:25 +1000 Subject: [PATCH 008/549] chore: avoid adding `crossorigin` for same domain scripts --- src/runtime/composables/useScript.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/composables/useScript.ts b/src/runtime/composables/useScript.ts index a4ec1a5e..e2c1bf10 100644 --- a/src/runtime/composables/useScript.ts +++ b/src/runtime/composables/useScript.ts @@ -35,7 +35,7 @@ export function useScript = Record Date: Tue, 3 Sep 2024 19:40:13 +1000 Subject: [PATCH 009/549] chore: fix test --- test/fixtures/basic/pages/bundle-use-script.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixtures/basic/pages/bundle-use-script.vue b/test/fixtures/basic/pages/bundle-use-script.vue index e3a15e44..bcb87a30 100644 --- a/test/fixtures/basic/pages/bundle-use-script.vue +++ b/test/fixtures/basic/pages/bundle-use-script.vue @@ -19,7 +19,7 @@ const scriptSrc = ref('https://code.jquery.com/jquery-3.6.0.min.js') $script.then(async () => { const head = injectHead() const tags = await head.resolveTags() - scriptSrc.value = tags[0].props.src + scriptSrc.value = tags.filter(s => s.tag === 'script')[0].props.src }) myScript('test') From 260eb528244ae88a704ad4fbe4732d3b7badcf5b Mon Sep 17 00:00:00 2001 From: harlan Date: Tue, 3 Sep 2024 19:51:06 +1000 Subject: [PATCH 010/549] chore: tests --- docs/nuxt.config.ts | 12 ++++++------ src/runtime/components/ScriptVimeoPlayer.vue | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/nuxt.config.ts b/docs/nuxt.config.ts index 5e4421c5..7269fd58 100644 --- a/docs/nuxt.config.ts +++ b/docs/nuxt.config.ts @@ -44,13 +44,13 @@ export default defineNuxtConfig({ }, app: { - seoMeta: { - themeColor: [ - { content: '#18181b', media: '(prefers-color-scheme: dark)' }, - { content: 'white', media: '(prefers-color-scheme: light)' }, - ], - }, head: { + seoMeta: { + themeColor: [ + { content: '#18181b', media: '(prefers-color-scheme: dark)' }, + { content: 'white', media: '(prefers-color-scheme: light)' }, + ], + }, templateParams: { separator: '·', }, diff --git a/src/runtime/components/ScriptVimeoPlayer.vue b/src/runtime/components/ScriptVimeoPlayer.vue index 771aad79..53e9b3f3 100644 --- a/src/runtime/components/ScriptVimeoPlayer.vue +++ b/src/runtime/components/ScriptVimeoPlayer.vue @@ -118,7 +118,7 @@ const rootEl = ref() const trigger = useScriptTriggerElement({ trigger: props.trigger, el: rootEl }) let clickTriggered = false -if (props.trigger === 'mousedown') { +if (props.trigger === 'mousedown' && trigger instanceof Promise) { trigger.then(() => { clickTriggered = true }) From 2faa0277238d30df94b6d4a8e548fa52cca05625 Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Tue, 3 Sep 2024 19:57:03 +1000 Subject: [PATCH 011/549] feat(useScriptTriggerElement): pre-hydration event triggers (#237) --- .../3.api/3.use-script-trigger-element.md | 39 ++++++++++++++++- src/runtime/components/ScriptCarbonAds.vue | 15 +++++-- src/runtime/components/ScriptCrisp.vue | 9 +++- .../components/ScriptGoogleAdsense.vue | 10 ++++- src/runtime/components/ScriptGoogleMaps.vue | 4 +- src/runtime/components/ScriptIntercom.vue | 19 ++++++--- src/runtime/components/ScriptLemonSqueezy.vue | 13 ++++-- .../components/ScriptStripePricingTable.vue | 13 ++++-- src/runtime/components/ScriptVimeoPlayer.vue | 1 + .../components/ScriptYouTubePlayer.vue | 1 + .../composables/useScriptTriggerElement.ts | 42 +++++++++++++++---- 11 files changed, 136 insertions(+), 30 deletions(-) diff --git a/docs/content/docs/3.api/3.use-script-trigger-element.md b/docs/content/docs/3.api/3.use-script-trigger-element.md index c1674d4f..1cba1793 100644 --- a/docs/content/docs/3.api/3.use-script-trigger-element.md +++ b/docs/content/docs/3.api/3.use-script-trigger-element.md @@ -13,7 +13,7 @@ Create a trigger for an element to load a script based on specific element event ## Signature ```ts -function useScriptTriggerElement(options: ElementScriptTriggerOptions): Promise {} +function useScriptTriggerElement(options: ElementScriptTriggerOptions): Promise & { ssrAttrs?: Record } | 'onNuxtReady' {} ``` ## Arguments @@ -22,8 +22,10 @@ function useScriptTriggerElement(options: ElementScriptTriggerOptions): Promise< export interface ElementScriptTriggerOptions { /** * The event to trigger the script load. + * + * For example we can bind events that we'd normally use addEventListener for: `mousedown`, `mouseenter`, `scroll`, etc. */ - trigger?: ElementScriptTrigger | undefined + trigger?: 'immediate' | 'visible' | string | string[] | false | undefined /** * The element to watch for the trigger event. * @default document.body @@ -36,6 +38,39 @@ export interface ElementScriptTriggerOptions { A promise that resolves when the script is loaded. +## Handling Pre-Hydration Events + +When registering a trigger that depends on user input, such as `mousedown`, it's possible that the user will interact with the element before the hydration process is complete. + +In this case, the event listener will not be attached to the element, and the script will not be loaded. + +To ensure this is handled correctly you should bind the `ssrAttrs` value to the element you're attaching events to. Note that you should verify +that a promise is returned from the function before using the `ssrAttrs` value. + +```vue + + +``` + + ## Examples - Load a script when an element is visible. diff --git a/src/runtime/components/ScriptCarbonAds.vue b/src/runtime/components/ScriptCarbonAds.vue index f8c38d37..5a8bb1c9 100644 --- a/src/runtime/components/ScriptCarbonAds.vue +++ b/src/runtime/components/ScriptCarbonAds.vue @@ -1,7 +1,7 @@