fix(nuxt): update renamed stub composables from nuxt/scripts (#28449)

This commit is contained in:
Martin Masevski 2024-08-08 10:48:52 +02:00 committed by Daniel Roe
parent 93801def67
commit 219653e2c6
No known key found for this signature in database
GPG Key ID: CBC814C393D93268
3 changed files with 12 additions and 12 deletions

View File

@ -18,18 +18,18 @@ export function useScript<T extends Record<string | symbol, any>> (input: UseScr
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function useElementScriptTrigger (...args: unknown[]) {
renderStubMessage('useElementScriptTrigger')
export function useScriptTriggerElement (...args: unknown[]) {
renderStubMessage('useScriptTriggerElement')
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function useConsentScriptTrigger (...args: unknown[]) {
renderStubMessage('useConsentScriptTrigger')
export function useScriptTriggerConsent (...args: unknown[]) {
renderStubMessage('useScriptTriggerConsent')
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function useAnalyticsPageEvent (...args: unknown[]) {
renderStubMessage('useAnalyticsPageEvent')
export function useScriptEventPage (...args: unknown[]) {
renderStubMessage('useScriptEventPage')
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars

View File

@ -117,9 +117,9 @@ const granularAppPresets: InlinePreset[] = [
export const scriptsStubsPreset = {
imports: [
'useConsentScriptTrigger',
'useAnalyticsPageEvent',
'useElementScriptTrigger',
'useScriptTriggerConsent',
'useScriptEventPage',
'useScriptTriggerElement',
'useScript',
'useScriptGoogleAnalytics',
'useScriptPlausibleAnalytics',

View File

@ -200,9 +200,9 @@ describe('imports:nuxt/scripts', () => {
const scripts = scriptRegistry().map(s => s.import?.name).filter(Boolean)
const globalScripts = new Set([
'useScript',
'useAnalyticsPageEvent',
'useElementScriptTrigger',
'useConsentScriptTrigger',
'useScriptEventPage',
'useScriptTriggerElement',
'useScriptTriggerConsent',
// registered separately
'useScriptGoogleTagManager',
'useScriptGoogleAnalytics',