@open-xamu-co/firebase-nuxt 1.1.1-next.1 → 1.1.1-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  Firebase nuxt
2
2
 
3
+ ## [1.1.1-next.3](https://github.com/xamu-co/firebase-nuxt/compare/v1.1.1-next.2...v1.1.1-next.3) (2026-01-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * restore optimization excludes ([e7c0337](https://github.com/xamu-co/firebase-nuxt/commit/e7c0337b2b4c539b833615e592ab26fe907287e9))
9
+
10
+ ## [1.1.1-next.2](https://github.com/xamu-co/firebase-nuxt/compare/v1.1.1-next.1...v1.1.1-next.2) (2026-01-10)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * handle get app errors on get firebase helper ([3e6f7f1](https://github.com/xamu-co/firebase-nuxt/commit/3e6f7f1c35bc2b23595d6e5ce01755b8da9a8efc))
16
+
3
17
  ## [1.1.1-next.1](https://github.com/xamu-co/firebase-nuxt/compare/v1.1.0...v1.1.1-next.1) (2026-01-10)
4
18
 
5
19
 
package/README.md CHANGED
@@ -36,8 +36,6 @@ yarn build
36
36
 
37
37
  ## Extras
38
38
 
39
- Due to an [issue with volar](https://github.com/vuejs/language-tools/issues/5018#issuecomment-2495098549), typescript version is fixed at @5.6.3
40
-
41
39
  Firebase requires 2 keys, the private one from recaptcha, and the site key from recaptcha enterprise. The former one is passed from the config file.
42
40
 
43
41
  For app check create the key from Recaptcha v3 console instead of enterprise to avoid issues with legacy keys validation. The debug token allows bypassing the validation on dev environments
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "1.1.0",
7
+ "version": "1.1.1-next.2",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -11,6 +11,14 @@ const module$1 = defineNuxtModule({
11
11
  async setup(moduleOptions, nuxt) {
12
12
  const { resolve } = createResolver(import.meta.url);
13
13
  const runtimePath = resolve("./runtime");
14
+ const firebaseDeps = [
15
+ "firebase",
16
+ "firebase/app",
17
+ "firebase/auth",
18
+ "firebase/app-check",
19
+ "firebase/firestore",
20
+ "firebase/analytics"
21
+ ];
14
22
  nuxt.options.devtools.enabled = debugNuxt;
15
23
  nuxt.options.devtools.timeline = { enabled: debugNuxt };
16
24
  nuxt.options.experimental.asyncContext = true;
@@ -20,6 +28,7 @@ const module$1 = defineNuxtModule({
20
28
  ...nuxt.options.vite.optimizeDeps,
21
29
  exclude: [
22
30
  ...nuxt.options.vite.optimizeDeps?.exclude || [],
31
+ ...firebaseDeps,
23
32
  // Server imports
24
33
  "nitropack/runtime"
25
34
  ]
@@ -28,12 +37,8 @@ const module$1 = defineNuxtModule({
28
37
  ...nuxt.options.vite.resolve,
29
38
  dedupe: [
30
39
  ...nuxt.options.vite.resolve?.dedupe || [],
31
- "firebase",
32
- "firebase/app",
33
- "firebase/auth",
34
- "firebase/app-check",
35
- "firebase/firestore",
36
- "firebase/analytics",
40
+ ...firebaseDeps,
41
+ // Pinia store
37
42
  "pinia"
38
43
  ]
39
44
  };
@@ -108,7 +113,11 @@ const module$1 = defineNuxtModule({
108
113
  const runtimePath = resolve("./runtime");
109
114
  return {
110
115
  "nuxt-csurf": {
111
- version: ">=1.6.5"
116
+ version: ">=1.6.5",
117
+ defaults: {
118
+ addCsrfTokenToEventCtx: true
119
+ // Run server side
120
+ }
112
121
  },
113
122
  "@open-xamu-co/ui-nuxt": {
114
123
  version: ">=4.0.0-next.4",
@@ -5,7 +5,7 @@ import { eIdDocumentType } from "../functions/utils/enums.js";
5
5
  * @component
6
6
  */
7
7
  type __VLS_Props = {
8
- value: number;
8
+ value: any;
9
9
  node?: {
10
10
  user?: {
11
11
  documentType?: eIdDocumentType;
@@ -8,7 +8,7 @@
8
8
  <script setup>
9
9
  import { eIdDocumentType } from "../functions/utils/enums";
10
10
  defineProps({
11
- value: { type: Number, required: true },
11
+ value: { type: null, required: true },
12
12
  node: { type: Object, required: false }
13
13
  });
14
14
  </script>
@@ -5,7 +5,7 @@ import { eIdDocumentType } from "../functions/utils/enums.js";
5
5
  * @component
6
6
  */
7
7
  type __VLS_Props = {
8
- value: number;
8
+ value: any;
9
9
  node?: {
10
10
  user?: {
11
11
  documentType?: eIdDocumentType;
@@ -4,7 +4,7 @@
4
4
  * @component
5
5
  */
6
6
  type __VLS_Props = {
7
- value: number;
7
+ value: any;
8
8
  node?: {
9
9
  locationCity?: string;
10
10
  locationState?: string;
@@ -6,7 +6,7 @@
6
6
  <script setup>
7
7
  import { computed } from "vue";
8
8
  const props = defineProps({
9
- value: { type: Number, required: true },
9
+ value: { type: null, required: true },
10
10
  node: { type: Object, required: false }
11
11
  });
12
12
  const city = computed(() => {
@@ -4,7 +4,7 @@
4
4
  * @component
5
5
  */
6
6
  type __VLS_Props = {
7
- value: number;
7
+ value: any;
8
8
  node?: {
9
9
  locationCity?: string;
10
10
  locationState?: string;
@@ -8,9 +8,8 @@ import {
8
8
  } from "firebase/auth";
9
9
  import { FirebaseError } from "firebase/app";
10
10
  import { ref } from "vue";
11
- import { useRouter, useRoute } from "vue-router";
12
11
  import { useSwal } from "@open-xamu-co/ui-common-helpers";
13
- import { useAppLogger, useNuxtApp } from "#imports";
12
+ import { useAppLogger, useNuxtApp, useRouter, useRoute } from "#imports";
14
13
  export function useGoogleAuth(defaultRdrPath = "/") {
15
14
  const { $clientAuth } = useNuxtApp();
16
15
  const Swal = useSwal();
@@ -18,7 +18,7 @@ export declare const useSessionStore: import("pinia").StoreDefinition<"session",
18
18
  setUser: ({ createdAt, updatedAt, ...userData }: User, token: string) => void;
19
19
  unsetSession: (expiredToken?: boolean) => void;
20
20
  logout: (clientAuth?: Auth) => Promise<void>;
21
- remove: (clientAuth?: Auth) => Promise<void>;
21
+ remove: (navigateTo: (...args: any[]) => any, clientAuth?: Auth) => Promise<void>;
22
22
  }, "user" | "token" | "expiredToken">, Pick<{
23
23
  token: import("#app").CookieRef<string | null>;
24
24
  expiredToken: import("#app").CookieRef<boolean>;
@@ -27,7 +27,7 @@ export declare const useSessionStore: import("pinia").StoreDefinition<"session",
27
27
  setUser: ({ createdAt, updatedAt, ...userData }: User, token: string) => void;
28
28
  unsetSession: (expiredToken?: boolean) => void;
29
29
  logout: (clientAuth?: Auth) => Promise<void>;
30
- remove: (clientAuth?: Auth) => Promise<void>;
30
+ remove: (navigateTo: (...args: any[]) => any, clientAuth?: Auth) => Promise<void>;
31
31
  }, "path">, Pick<{
32
32
  token: import("#app").CookieRef<string | null>;
33
33
  expiredToken: import("#app").CookieRef<boolean>;
@@ -36,6 +36,6 @@ export declare const useSessionStore: import("pinia").StoreDefinition<"session",
36
36
  setUser: ({ createdAt, updatedAt, ...userData }: User, token: string) => void;
37
37
  unsetSession: (expiredToken?: boolean) => void;
38
38
  logout: (clientAuth?: Auth) => Promise<void>;
39
- remove: (clientAuth?: Auth) => Promise<void>;
39
+ remove: (navigateTo: (...args: any[]) => any, clientAuth?: Auth) => Promise<void>;
40
40
  }, "remove" | "setUser" | "unsetSession" | "logout">>;
41
41
  export {};
@@ -1,7 +1,6 @@
1
1
  import { deleteUser } from "firebase/auth";
2
2
  import { defineStore, skipHydrate } from "pinia";
3
3
  import { computed } from "vue";
4
- import { useRouter } from "vue-router";
5
4
  import { getDocumentId } from "../../client/utils/resolver.js";
6
5
  import { useCookie, useRuntimeConfig, useSwal } from "#imports";
7
6
  const cookieOptionsDefaults = {
@@ -58,9 +57,8 @@ export const useSessionStore = defineStore("session", () => {
58
57
  window.location.href = "/";
59
58
  }
60
59
  }
61
- async function remove(clientAuth) {
60
+ async function remove(navigateTo, clientAuth) {
62
61
  if (import.meta.server) return;
63
- const router = useRouter();
64
62
  const Swal = useSwal();
65
63
  const { value } = await Swal.firePrevent({
66
64
  title: "Eliminar cuenta",
@@ -70,7 +68,7 @@ export const useSessionStore = defineStore("session", () => {
70
68
  const user2 = clientAuth?.currentUser;
71
69
  if (user2 && value) {
72
70
  await deleteUser(user2);
73
- router.push("/");
71
+ navigateTo("/");
74
72
  }
75
73
  }
76
74
  return {
@@ -1,6 +1,6 @@
1
- import { type AppOptions } from "firebase-admin/app";
1
+ import { type App, type AppOptions } from "firebase-admin/app";
2
2
  export declare function getFirebase(at?: string, appOptions?: AppOptions): {
3
- firebaseApp: import("firebase-admin/app").App;
3
+ firebaseApp: App;
4
4
  firebaseFirestore: FirebaseFirestore.Firestore;
5
5
  firebaseAuth: import("firebase-admin/auth").Auth;
6
6
  firebaseStorage: import("firebase-admin/storage").Storage;
@@ -5,7 +5,12 @@ import { getStorage } from "firebase-admin/storage";
5
5
  export function getFirebase(at = "Unknown", appOptions) {
6
6
  if (import.meta.client) throw new Error("This function is only available in server context");
7
7
  try {
8
- const firebaseApp = getApps().length ? getApp() : initializeApp(appOptions);
8
+ let firebaseApp;
9
+ try {
10
+ firebaseApp = getApps().length ? getApp() : initializeApp(appOptions);
11
+ } catch (err) {
12
+ firebaseApp = initializeApp(appOptions);
13
+ }
9
14
  const firebaseFirestore = getFirestore(firebaseApp);
10
15
  const firebaseAuth = getAuth(firebaseApp);
11
16
  const firebaseStorage = getStorage();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xamu-co/firebase-nuxt",
3
- "version": "1.1.1-next.1",
3
+ "version": "1.1.1-next.3",
4
4
  "description": "Nuxt 3 module for the xamu project",
5
5
  "author": "@xamu-co",
6
6
  "type": "module",