[core] Add SDK_VERSION

This commit is contained in:
Chris Bianca 2018-01-09 17:31:54 +00:00
parent 301f2749c0
commit d700bf9d6d
5 changed files with 55 additions and 11 deletions

1
.gitignore vendored
View File

@ -77,3 +77,4 @@ local.properties
**/ios/Pods/**
**/ios/ReactNativeFirebaseDemo.xcworkspace/
dist
version.js

View File

@ -7,6 +7,7 @@ import { NativeModules } from 'react-native';
import APPS from '../../utils/apps';
import INTERNALS from '../../utils/internals';
import App from './firebase-app';
import VERSION from '../../version';
// module imports
import { statics as AdMobStatics, MODULE_NAME as AdmobModuleName } from '../admob';
@ -112,6 +113,14 @@ class Firebase {
get apps(): Array<App> {
return APPS.apps();
}
/**
* The current SDK version.
* @return {string}
*/
get SDK_VERSION(): string {
return VERSION;
}
}
export default new Firebase();

View File

@ -1,11 +1,8 @@
// @flow
import { NativeModules } from 'react-native';
// import { version as ReactVersion } from 'react';
// import ReactNativeVersion from 'react-native/Libraries/Core/ReactNativeVersion';
import INTERNALS from '../../utils/internals';
import { isIOS } from '../../utils';
import ModuleBase from '../../utils/ModuleBase';
import PACKAGE from '../../../package.json';
import type App from '../core/firebase-app';
const FirebaseCoreModule = NativeModules.RNFirebase;
@ -106,10 +103,4 @@ export default class RNFirebaseUtils extends ModuleBase {
}
export const statics = {
// VERSIONS: {
// react: ReactVersion,
// 'react-native': Object.values(ReactNativeVersion.version).slice(0, 3).join('.'),
// 'react-native-firebase': PACKAGE.version,
// },
};
export const statics = {};

42
package-lock.json generated
View File

@ -2680,6 +2680,15 @@
}
}
},
"find-package": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/find-package/-/find-package-1.0.0.tgz",
"integrity": "sha1-13ONpn48XwVcJNPhmqGu7QY8PoM=",
"dev": true,
"requires": {
"parents": "1.0.1"
}
},
"find-up": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
@ -2690,6 +2699,12 @@
"pinkie-promise": "2.0.1"
}
},
"firstline": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/firstline/-/firstline-1.2.1.tgz",
"integrity": "sha1-uIZzxCAJ+IIfrCkm6ZcgrO6ST64=",
"dev": true
},
"flat-cache": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz",
@ -3819,6 +3834,18 @@
"lodash.padstart": "4.6.1"
}
},
"genversion": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/genversion/-/genversion-2.0.1.tgz",
"integrity": "sha1-cCAQ5VD3d6VtsWbrFzL4BA8mGao=",
"dev": true,
"requires": {
"commander": "2.11.0",
"find-package": "1.0.0",
"firstline": "1.2.1",
"mkdirp": "0.5.1"
}
},
"get-caller-file": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz",
@ -5829,6 +5856,15 @@
"p-limit": "1.1.0"
}
},
"parents": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz",
"integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=",
"dev": true,
"requires": {
"path-platform": "0.11.15"
}
},
"parse-glob": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz",
@ -5889,6 +5925,12 @@
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
"dev": true
},
"path-platform": {
"version": "0.11.15",
"resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz",
"integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=",
"dev": true
},
"path-type": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",

View File

@ -6,7 +6,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "npm run build-lib && npm run build-flow",
"build": "genversion lib/version.js && npm run build-lib && npm run build-flow",
"build-flow": "flow-copy-source -i */__tests__* lib dist",
"build-lib": "BABEL_ENV=publish babel lib -d dist --ignore __tests__ --copy-files",
"clean": "rimraf dist/",
@ -88,6 +88,7 @@
"eslint-plugin-react": "^7.4.0",
"flow-bin": "^0.56.0",
"flow-copy-source": "^1.2.1",
"genversion": "^2.0.1",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-native": "^0.50.3",