@rebasepro/firebase 0.12.1-canary.gf5f1d39 → 0.13.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebasepro/firebase",
3
3
  "type": "module",
4
- "version": "0.12.1-canary.gf5f1d39",
4
+ "version": "0.13.0",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -11,16 +11,16 @@
11
11
  "types": "./dist/index.d.ts",
12
12
  "source": "src/index.ts",
13
13
  "dependencies": {
14
- "fast-equals": "6.0.0",
15
- "fuse.js": "^7.4.2",
16
- "react-router-dom": "^7.17.0",
17
- "@rebasepro/admin-types": "0.12.1-canary.gf5f1d39",
18
- "@rebasepro/admin": "0.12.1-canary.gf5f1d39",
19
- "@rebasepro/app": "0.12.1-canary.gf5f1d39",
20
- "@rebasepro/types": "0.12.1-canary.gf5f1d39",
21
- "@rebasepro/ui": "0.12.1-canary.gf5f1d39",
22
- "@rebasepro/common": "0.12.1-canary.gf5f1d39",
23
- "@rebasepro/utils": "0.12.1-canary.gf5f1d39"
14
+ "fast-equals": "6.0.2",
15
+ "fuse.js": "^7.5.0",
16
+ "react-router": "^8.3.0",
17
+ "@rebasepro/admin": "0.13.0",
18
+ "@rebasepro/admin-types": "0.13.0",
19
+ "@rebasepro/app": "0.13.0",
20
+ "@rebasepro/common": "0.13.0",
21
+ "@rebasepro/types": "0.13.0",
22
+ "@rebasepro/utils": "0.13.0",
23
+ "@rebasepro/ui": "0.13.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "firebase": "^10.12.2 || ^11.0.0 || ^12.0.0",
@@ -42,7 +42,7 @@
42
42
  "./package.json": "./package.json"
43
43
  },
44
44
  "devDependencies": {
45
- "@firebase/app": "^0.15.0",
45
+ "@firebase/app": "^0.15.1",
46
46
  "@firebase/app-check": "^0.12.0",
47
47
  "@firebase/auth": "^1.13.3",
48
48
  "@firebase/database": "^1.1.3",
@@ -51,15 +51,15 @@
51
51
  "@firebase/storage": "^0.14.3",
52
52
  "@jest/globals": "^30.4.1",
53
53
  "@types/jest": "^30.0.0",
54
- "@types/node": "^25.9.3",
54
+ "@types/node": "^26.1.2",
55
55
  "@types/react": "^19.2.17",
56
56
  "@types/react-dom": "^19.2.3",
57
- "@vitejs/plugin-react": "^6.0.2",
57
+ "@vitejs/plugin-react": "^6.0.4",
58
58
  "babel-plugin-react-compiler": "19.0.0-beta-ebf51a3-20250411",
59
- "firebase": "^12.15.0",
59
+ "firebase": "^12.16.0",
60
60
  "typescript": "^6.0.3",
61
61
  "typesense": "^3.0.6",
62
- "vite": "^8.0.16"
62
+ "vite": "^8.1.5"
63
63
  },
64
64
  "files": [
65
65
  "dist",
@@ -30,7 +30,7 @@ import { DEFAULT_DATA_SOURCE_KEY, Entity } from "@rebasepro/types";
30
30
  import { PropertyConfig, RebaseContext } from "@rebasepro/admin-types";
31
31
  import { CenteredView, CircularProgressCenter } from "@rebasepro/ui";
32
32
  import { buildRebaseData } from "@rebasepro/common";
33
- import { Route, Outlet, Navigate } from "react-router-dom";
33
+ import { Route, Outlet, Navigate } from "react-router";
34
34
 
35
35
  import { RebaseFirebaseAppProps } from "./RebaseFirebaseAppProps";
36
36
  import { FirebaseLoginView } from "./FirebaseLoginView";
@@ -141,7 +141,7 @@ export function useFirestoreDriver({
141
141
  );
142
142
  }
143
143
 
144
- queryParams.push(whereClause(key, op, cmsToFirestoreModel(value, firestore)));
144
+ queryParams.push(whereClause(key, op, rebaseToFirestoreModel(value, firestore)));
145
145
  });
146
146
  }
147
147
 
@@ -456,7 +456,7 @@ export function useFirestoreDriver({
456
456
  values: valuesProp,
457
457
  collection
458
458
  })
459
- const values = cmsToFirestoreModel(valuesProp, getFirestore(firebaseApp));
459
+ const values = rebaseToFirestoreModel(valuesProp, getFirestore(firebaseApp));
460
460
 
461
461
  console.debug("2", {
462
462
  path,
@@ -485,7 +485,7 @@ export function useFirestoreDriver({
485
485
  return setDoc(documentReference, values as Record<string, unknown>, { merge: true })
486
486
  .then(() => {
487
487
  return {
488
- ...(firestoreToCMSModel(values) as Record<string, unknown>),
488
+ ...(firestoreToRebaseModel(values) as Record<string, unknown>),
489
489
  id: documentReference.id
490
490
  };
491
491
  })
@@ -542,7 +542,7 @@ export function useFirestoreDriver({
542
542
  if (value === undefined || value === null) {
543
543
  return Promise.resolve(true);
544
544
  }
545
- const q = query(collectionClause(firestore, path), whereClause(name, "==", cmsToFirestoreModel(value, firestore)));
545
+ const q = query(collectionClause(firestore, path), whereClause(name, "==", rebaseToFirestoreModel(value, firestore)));
546
546
  const entity = await getDocs(q);
547
547
  return entity.docs.filter(doc => doc.id !== id).length === 0;
548
548
 
@@ -648,7 +648,7 @@ export function useFirestoreDriver({
648
648
  const createRowFromDocument = (
649
649
  docSnap: DocumentSnapshot
650
650
  ): Record<string, unknown> => {
651
- const values = firestoreToCMSModel(docSnap.data()) as Record<string, unknown>;
651
+ const values = firestoreToRebaseModel(docSnap.data()) as Record<string, unknown>;
652
652
  return {
653
653
  ...values,
654
654
  // Spread the canonical document id last so it wins over a literal `id` field
@@ -666,7 +666,7 @@ const createRowFromDocument = (
666
666
  * @param data
667
667
  * @group Firestore
668
668
  */
669
- export function firestoreToCMSModel(data: unknown): unknown {
669
+ export function firestoreToRebaseModel(data: unknown): unknown {
670
670
  if (data === null || data === undefined) return null;
671
671
  if (typeof data === "object" && data !== null && "isEqual" in data && typeof (data as FieldValue).isEqual === "function" && deleteField().isEqual(data as FieldValue)) {
672
672
  return undefined;
@@ -698,12 +698,12 @@ value: (data as { toArray: () => number[] }).toArray() };
698
698
  databaseId });
699
699
  }
700
700
  if (Array.isArray(data)) {
701
- return data.map(firestoreToCMSModel).filter(v => v !== undefined);
701
+ return data.map(firestoreToRebaseModel).filter(v => v !== undefined);
702
702
  }
703
703
  if (typeof data === "object") {
704
704
  const result: Record<string, unknown> = {};
705
705
  for (const key of Object.keys(data)) {
706
- const childValue = firestoreToCMSModel((data as Record<string, unknown>)[key]);
706
+ const childValue = firestoreToRebaseModel((data as Record<string, unknown>)[key]);
707
707
  if (childValue !== undefined)
708
708
  result[key] = childValue;
709
709
  }
@@ -723,13 +723,13 @@ function getCMSPathFromFirestorePath(fsPath: string): string {
723
723
  }
724
724
 
725
725
 
726
- export function cmsToFirestoreModel(data: unknown, firestore: Firestore, inArray = false): unknown {
726
+ export function rebaseToFirestoreModel(data: unknown, firestore: Firestore, inArray = false): unknown {
727
727
  if (data === undefined) {
728
728
  return deleteField();
729
729
  } else if (data === null) {
730
730
  return null;
731
731
  } else if (Array.isArray(data)) {
732
- return (data as unknown[]).filter(v => v !== undefined).map(v => cmsToFirestoreModel(v, firestore, true));
732
+ return (data as unknown[]).filter(v => v !== undefined).map(v => rebaseToFirestoreModel(v, firestore, true));
733
733
  } else if (typeof data === "object" && data !== null && "isEntityReference" in data && typeof (data as Record<string, unknown>).isEntityReference === "function" && (data as { isEntityReference: () => boolean }).isEntityReference()) {
734
734
  const entityRef = data as EntityReference;
735
735
  const targetFirestore = entityRef.databaseId ? getFirestore(firestore.app, entityRef.databaseId) : firestore;
@@ -746,7 +746,7 @@ export function cmsToFirestoreModel(data: unknown, firestore: Firestore, inArray
746
746
  } else if (data && typeof data === "object") {
747
747
  return Object.entries(data)
748
748
  .map(([key, v]) => {
749
- const firestoreModel = cmsToFirestoreModel(v, firestore);
749
+ const firestoreModel = rebaseToFirestoreModel(v, firestore);
750
750
  if (firestoreModel !== undefined)
751
751
  return ({ [key]: firestoreModel });
752
752
  else