Skip to content

Commit 7e1a273

Browse files
authored
fix(nuxt): import nuxt composables from #imports (#1457)
1 parent 343207c commit 7e1a273

18 files changed

+18
-18
lines changed

packages/nuxt/src/runtime/admin/plugin.server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type App as AdminApp } from 'firebase-admin/app'
22
import { ensureAdminApp } from 'vuefire/server'
3-
import { defineNuxtPlugin, useRequestEvent, useRuntimeConfig } from '#app'
3+
import { defineNuxtPlugin, useRequestEvent, useRuntimeConfig } from '#imports'
44

55
export default defineNuxtPlugin(() => {
66
const event = useRequestEvent()

packages/nuxt/src/runtime/analytics/plugin.client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { FirebaseApp } from 'firebase/app'
22
import { isSupported, initializeAnalytics } from 'firebase/analytics'
3-
import { defineNuxtPlugin, useRuntimeConfig } from '#app'
3+
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
44

55
/**
66
* Plugin to initialize the analytics module.

packages/nuxt/src/runtime/app-check/plugin.client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
type AppCheckOptions,
77
} from 'firebase/app-check'
88
import { VueFireAppCheck } from 'vuefire'
9-
import { defineNuxtPlugin, useRuntimeConfig } from '#app'
9+
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
1010

1111
/**
1212
* Plugin to initialize the appCheck module on the server.

packages/nuxt/src/runtime/app-check/plugin.server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { App as FirebaseAdminApp } from 'firebase-admin/app'
22
import type { FirebaseApp } from 'firebase/app'
33
import { VueFireAppCheckServer } from 'vuefire/server'
4-
import { defineNuxtPlugin } from '#app'
4+
import { defineNuxtPlugin } from '#imports'
55

66
/**
77
* Makes AppCheck work on the server. This requires SSR and the admin SDK to be available

packages/nuxt/src/runtime/app/composables.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { FirebaseApp } from 'firebase/app'
2-
import { useNuxtApp } from '#app'
2+
import { useNuxtApp } from '#imports'
33

44
/**
55
* Gets the firebase instance from the current Nuxt App. This can be used anywhere the `useNuxtApp()` can be used. Differently from `vuefire`'s `useFirebaseApp()`, this doesn't accept a name.

packages/nuxt/src/runtime/app/plugin.client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { initializeApp } from 'firebase/app'
2-
import { defineNuxtPlugin, useRuntimeConfig } from '#app'
2+
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
33

44
/**
55
* Initializes the app and provides it to others.

packages/nuxt/src/runtime/app/plugin.server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { type DecodedIdToken } from 'firebase-admin/auth'
44
import { logger } from '../logging'
55
import { DECODED_ID_TOKEN_SYMBOL } from '../constants'
66
import { appCache } from './lru-cache'
7-
import { defineNuxtPlugin, useRuntimeConfig } from '#app'
7+
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
88

99
/**
1010
* Initializes the app and provides it to others.

packages/nuxt/src/runtime/auth/plugin-mint-cookie.client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
beforeAuthStateChanged,
66
type User,
77
} from 'firebase/auth'
8-
import { defineNuxtPlugin } from '#app'
8+
import { defineNuxtPlugin } from '#imports'
99

1010
/**
1111
* Sets up a watcher that mints a cookie based auth session. On the server, it reads the cookie to

packages/nuxt/src/runtime/auth/plugin-user-token.server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { App as AdminApp } from 'firebase-admin/app'
22
import { decodeSessionCookie, AUTH_COOKIE_NAME } from 'vuefire/server'
33
import { getCookie } from 'h3'
44
import { DECODED_ID_TOKEN_SYMBOL } from '../constants'
5-
import { defineNuxtPlugin, useRequestEvent } from '#app'
5+
import { defineNuxtPlugin, useRequestEvent } from '#imports'
66

77
/**
88
* Decodes the user token if any. Should only be added on the server and before the firebase/app

packages/nuxt/src/runtime/auth/plugin.client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { FirebaseApp } from 'firebase/app'
22
import type { User } from 'firebase/auth'
33
import { VueFireAuth } from 'vuefire'
4-
import { defineNuxtPlugin } from '#app'
4+
import { defineNuxtPlugin } from '#imports'
55

66
/**
77
* Setups VueFireAuth for the client. This version creates some listeners that shouldn't be set on server.

packages/nuxt/src/runtime/auth/plugin.server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { App as AdminApp } from 'firebase-admin/app'
88
import { VueFireAuthServer } from 'vuefire/server'
99
import { DECODED_ID_TOKEN_SYMBOL, UserSymbol } from '../constants'
1010
import { logger } from '../logging'
11-
import { defineNuxtPlugin, useRequestEvent } from '#app'
11+
import { defineNuxtPlugin, useRequestEvent } from '#imports'
1212

1313
/**
1414
* Setups the auth state based on the cookie.

packages/nuxt/src/runtime/emulators/auth.plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { connectAuthEmulator, getAuth } from 'firebase/auth'
22
import type { FirebaseApp } from 'firebase/app'
33
import { logger } from '../logging'
4-
import { defineNuxtPlugin, useRuntimeConfig } from '#app'
4+
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
55

66
/**
77
* Setups the auth Emulators

packages/nuxt/src/runtime/emulators/database.plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getDatabase, connectDatabaseEmulator } from 'firebase/database'
22
import type { FirebaseApp } from 'firebase/app'
33
import { logger } from '../logging'
4-
import { defineNuxtPlugin, useRuntimeConfig } from '#app'
4+
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
55

66
/**
77
* Setups the Database Emulators

packages/nuxt/src/runtime/emulators/firestore.plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getFirestore, connectFirestoreEmulator } from 'firebase/firestore'
22
import type { FirebaseApp } from 'firebase/app'
33
import { logger } from '../logging'
4-
import { defineNuxtPlugin, useRuntimeConfig } from '#app'
4+
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
55

66
/**
77
* Setups the Firestore Emulators

packages/nuxt/src/runtime/emulators/functions.plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getFunctions, connectFunctionsEmulator } from 'firebase/functions'
22
import type { FirebaseApp } from 'firebase/app'
33
import { logger } from '../logging'
4-
import { defineNuxtPlugin, useRuntimeConfig } from '#app'
4+
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
55

66
/**
77
* Setups the Functions Emulators

packages/nuxt/src/runtime/emulators/storage.plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getStorage, connectStorageEmulator } from 'firebase/storage'
22
import type { FirebaseApp } from 'firebase/app'
33
import { logger } from '../logging'
4-
import { defineNuxtPlugin, useRuntimeConfig } from '#app'
4+
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
55

66
/**
77
* Setups the Storage Emulators

packages/nuxt/src/runtime/payload-plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
definePayloadPlugin,
55
definePayloadReducer,
66
definePayloadReviver,
7-
} from '#app'
7+
} from '#imports'
88

99
/**
1010
* Handles Firestore Timestamps, GeoPoint, and other types that needs special handling for serialization.

packages/nuxt/templates/plugin.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
VueFire,
33
useSSRInitialState,
44
} from 'vuefire'
5-
import { defineNuxtPlugin } from '#app'
5+
import { defineNuxtPlugin } from '#imports'
66

77
export default defineNuxtPlugin((nuxtApp) => {
88
const firebaseApp = nuxtApp.$firebaseApp

0 commit comments

Comments
 (0)