Skip to content

Commit 9cea678

Browse files
committed
report correct version for v8 and v9
1 parent d47fb41 commit 9cea678

File tree

10 files changed

+32
-1
lines changed

10 files changed

+32
-1
lines changed

packages/firestore/exp/register.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ import { _registerComponent, registerVersion } from '@firebase/app-exp';
1919
import { Component, ComponentType } from '@firebase/component';
2020

2121
import { name, version } from '../package.json';
22+
import { version as SDK_VERSION } from '../../../packages-exp/firebase-exp/package.json';
2223
import { FirebaseFirestore } from '../src/exp/database';
2324
import { Settings } from '../src/exp/settings';
25+
import { setSDKVersion } from '../src/core/version';
2426

2527
declare module '@firebase/component' {
2628
interface NameServiceMapping {
@@ -29,6 +31,7 @@ declare module '@firebase/component' {
2931
}
3032

3133
export function registerFirestore(variant?: string): void {
34+
setSDKVersion(SDK_VERSION);
3235
_registerComponent(
3336
new Component(
3437
'firestore-exp',

packages/firestore/index.console.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ import {
2323
MemoryPersistenceProvider
2424
} from './src/api/database';
2525
import { DatabaseId } from './src/core/database_info';
26+
import { setSDKVersion } from './src/core/version';
2627
import { FirebaseFirestore as FirestoreExp } from './src/exp/database';
2728
import { Code, FirestoreError } from './src/util/error';
29+
import { version as SDK_VERSION } from '../firebase/package.json';
2830
export {
2931
CollectionReference,
3032
DocumentReference,
@@ -71,3 +73,5 @@ function databaseIdFromFirestoreDatabase(
7173
firestoreDatabase.database
7274
);
7375
}
76+
77+
setSDKVersion(SDK_VERSION);

packages/firestore/index.memory.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import firebase from '@firebase/app';
1919
import { FirebaseNamespace } from '@firebase/app-types';
2020

21+
import { version as SDK_VERSION } from '../firebase/package.json';
2122
import {
2223
Firestore,
2324
MemoryPersistenceProvider,
@@ -27,11 +28,13 @@ import { name, version } from './package.json';
2728
import { configureForFirebase } from './src/config';
2829

2930
import './register-module';
31+
import { setSDKVersion } from './src/core/version';
3032

3133
/**
3234
* Registers the memory-only Firestore build with the components framework.
3335
*/
3436
export function registerFirestore(instance: FirebaseNamespace): void {
37+
setSDKVersion(SDK_VERSION);
3538
configureForFirebase(
3639
instance,
3740
(app, auth) =>

packages/firestore/index.node.memory.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@
1818
import firebase from '@firebase/app';
1919
import { FirebaseNamespace } from '@firebase/app-types';
2020

21+
import { version as SDK_VERSION } from '../firebase/package.json';
2122
import { name, version } from './package.json';
2223
import { Firestore, MemoryPersistenceProvider } from './src/api/database';
2324
import { configureForFirebase } from './src/config';
2425
import { FirebaseFirestore } from './src/exp/database';
2526

2627
import './register-module';
28+
import { setSDKVersion } from './src/core/version';
2729

2830
/**
2931
* Registers the memory-only Firestore build for Node with the components
3032
* framework.
3133
*/
3234
export function registerFirestore(instance: FirebaseNamespace): void {
35+
setSDKVersion(SDK_VERSION);
3336
configureForFirebase(
3437
instance,
3538
(app, auth) =>

packages/firestore/index.node.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@
1717
import firebase from '@firebase/app';
1818
import { FirebaseNamespace } from '@firebase/app-types';
1919

20+
import { version as SDK_VERSION } from '../firebase/package.json';
2021
import { name, version } from './package.json';
2122
import { Firestore, IndexedDbPersistenceProvider } from './src/api/database';
2223
import { configureForFirebase } from './src/config';
2324
import { FirebaseFirestore as ExpFirebaseFirestore } from './src/exp/database';
2425

2526
import './register-module';
27+
import { setSDKVersion } from './src/core/version';
2628

2729
/**
2830
* Registers the main Firestore Node build with the components framework.
2931
* Persistence can be enabled via `firebase.firestore().enablePersistence()`.
3032
*/
3133
export function registerFirestore(instance: FirebaseNamespace): void {
34+
setSDKVersion(SDK_VERSION);
3235
configureForFirebase(
3336
instance,
3437
(app, auth) =>

packages/firestore/index.rn.memory.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ import {
2525
} from './export';
2626
import { name, version } from './package.json';
2727
import { configureForFirebase } from './src/config';
28+
import { version as SDK_VERSION } from '../firebase/package.json';
2829

2930
import './register-module';
31+
import { setSDKVersion } from './src/core/version';
3032

3133
/**
3234
* Registers the memory-only Firestore build for ReactNative with the components
3335
* framework.
3436
*/
3537
export function registerFirestore(instance: FirebaseNamespace): void {
38+
setSDKVersion(SDK_VERSION);
3639
configureForFirebase(
3740
instance,
3841
(app, auth) =>

packages/firestore/index.rn.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,17 @@ import {
2424
} from './export';
2525
import { name, version } from './package.json';
2626
import { configureForFirebase } from './src/config';
27+
import { version as SDK_VERSION } from '../firebase/package.json';
2728

2829
import './register-module';
30+
import { setSDKVersion } from './src/core/version';
2931

3032
/**
3133
* Registers the main Firestore ReactNative build with the components framework.
3234
* Persistence can be enabled via `firebase.firestore().enablePersistence()`.
3335
*/
3436
export function registerFirestore(instance: FirebaseNamespace): void {
37+
setSDKVersion(SDK_VERSION);
3538
configureForFirebase(
3639
instance,
3740
(app, auth) =>

packages/firestore/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ import {
2525
} from './export';
2626
import { name, version } from './package.json';
2727
import { configureForFirebase } from './src/config';
28+
import { version as SDK_VERSION } from '../firebase/package.json';
2829

2930
import './register-module';
31+
import { setSDKVersion } from './src/core/version';
3032

3133
/**
3234
* Registers the main Firestore build with the components framework.
3335
* Persistence can be enabled via `firebase.firestore().enablePersistence()`.
3436
*/
3537
export function registerFirestore(instance: FirebaseNamespace): void {
38+
setSDKVersion(SDK_VERSION);
3639
configureForFirebase(
3740
instance,
3841
(app, auth) =>

packages/firestore/lite/register.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
import { _registerComponent, registerVersion } from '@firebase/app-exp';
1919
import { Component, ComponentType } from '@firebase/component';
2020

21+
import { version as SDK_VERSION } from '../../../packages-exp/firebase-exp/package.json';
2122
import { version } from '../package.json';
23+
import { setSDKVersion } from '../src/core/version';
2224
import { FirebaseFirestore } from '../src/lite/database';
2325
import { Settings } from '../src/lite/settings';
2426

@@ -29,6 +31,7 @@ declare module '@firebase/component' {
2931
}
3032

3133
export function registerFirestore(): void {
34+
setSDKVersion(SDK_VERSION);
3235
_registerComponent(
3336
new Component(
3437
'firestore/lite',

packages/firestore/src/core/version.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@
1616
*/
1717

1818
/** The semver (www.semver.org) version of the SDK. */
19-
export { version as SDK_VERSION } from '../../../firebase/package.json';
19+
export let SDK_VERSION = '';
20+
export function setSDKVersion(version: string): void {
21+
SDK_VERSION = version;
22+
}

0 commit comments

Comments
 (0)