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 GitHub
parent 1a7dceeb82
commit 6eefc98e49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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 // eslint-disable-next-line @typescript-eslint/no-unused-vars
export function useElementScriptTrigger (...args: unknown[]) { export function useScriptTriggerElement (...args: unknown[]) {
renderStubMessage('useElementScriptTrigger') renderStubMessage('useScriptTriggerElement')
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
export function useConsentScriptTrigger (...args: unknown[]) { export function useScriptTriggerConsent (...args: unknown[]) {
renderStubMessage('useConsentScriptTrigger') renderStubMessage('useScriptTriggerConsent')
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
export function useAnalyticsPageEvent (...args: unknown[]) { export function useScriptEventPage (...args: unknown[]) {
renderStubMessage('useAnalyticsPageEvent') renderStubMessage('useScriptEventPage')
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars

View File

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

View File

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