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
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',