expo-firebase-core
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -1,45 +0,1 @@ | ||
const pkg = require('./package.json'); | ||
const { withDangerousMod, createRunOncePlugin, IOSConfig } = require('@expo/config-plugins'); | ||
const fs = require('fs-extra'); | ||
const methodInvocationBlock = `[FIRApp configure];`; | ||
const withFirebaseAppDelegate = config => { | ||
return withDangerousMod(config, [ | ||
'ios', | ||
async config => { | ||
const fileInfo = IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot); | ||
let contents = await fs.readFile(fileInfo.path, 'utf-8'); | ||
if (fileInfo.language === 'objc') { | ||
// Add import | ||
if (!contents.includes('@import Firebase;')) { | ||
contents = contents.replace( | ||
/\#import \"AppDelegate.h\"/g, | ||
`#import "AppDelegate.h" | ||
@import Firebase;` | ||
); | ||
} | ||
// Add invocation | ||
if (!contents.includes(methodInvocationBlock)) { | ||
// self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] | ||
contents = contents.replace( | ||
/self\.moduleRegistryAdapter \= \[\[UMModuleRegistryAdapter alloc\]/g, | ||
`${methodInvocationBlock} | ||
self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc]` | ||
); | ||
} | ||
} else { | ||
// TODO: Support Swift | ||
throw new Error( | ||
`Cannot add Firebase code to AppDelegate of language "${fileInfo.language}"` | ||
); | ||
} | ||
await fs.writeFile(fileInfo.path, contents); | ||
return config; | ||
}, | ||
]); | ||
}; | ||
module.exports = createRunOncePlugin(withFirebaseAppDelegate, pkg.name, pkg.version); | ||
module.exports = require('./plugin/build/withFirebaseCore'); |
@@ -1,6 +0,15 @@ | ||
import { IFirebaseOptions } from './FirebaseOptions'; | ||
declare const _default: { | ||
readonly DEFAULT_APP_NAME: string; | ||
readonly DEFAULT_APP_OPTIONS: void | IFirebaseOptions; | ||
readonly DEFAULT_APP_OPTIONS: void | Partial<{ | ||
appId: string; | ||
apiKey: string; | ||
databaseURL: string; | ||
trackingId: string; | ||
messagingSenderId: string; | ||
storageBucket: string; | ||
projectId: string; | ||
authDomain: string; | ||
measurementId: string; | ||
}>; | ||
}; | ||
export default _default; |
@@ -1,2 +0,2 @@ | ||
export interface IFirebaseOptions { | ||
export declare type IFirebaseOptions = Partial<{ | ||
appId: string; | ||
@@ -11,3 +11,3 @@ apiKey: string; | ||
measurementId: string; | ||
} | ||
}>; | ||
export declare function getDefaultWebOptions(): IFirebaseOptions | void; |
@@ -11,6 +11,13 @@ # Changelog | ||
## 2.0.0 — 2021-01-15 | ||
## 3.0.0 — 2021-03-10 | ||
_This version does not introduce any user-facing changes._ | ||
### 📚 native library updates | ||
- Updated native `firebase sdk version` from `6.14.0` to `7.7.0` on iOS. ([#12125](https://github.com/expo/expo/pull/12125) by [@bbarthec](https://github.com/bbarthec)) | ||
### 🎉 New features | ||
- Converted plugin to TypeScript. ([#11715](https://github.com/expo/expo/pull/11715) by [@EvanBacon](https://github.com/EvanBacon)) | ||
- Updated Android build configuration to target Android 11 (added support for Android SDK 30). ([#11647](https://github.com/expo/expo/pull/11647) by [@bbarthec](https://github.com/bbarthec)) | ||
## 2.0.0 — 2021-01-15 | ||
@@ -17,0 +24,0 @@ |
{ | ||
"name": "expo-firebase-core", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Core support for Google Firebase", | ||
@@ -38,3 +38,3 @@ "main": "build/FirebaseCore.js", | ||
"devDependencies": { | ||
"expo-module-scripts": "^1.1.1" | ||
"expo-module-scripts": "^2.0.0" | ||
}, | ||
@@ -44,3 +44,3 @@ "jest": { | ||
}, | ||
"gitHead": "e362887ddc6ba4e3518efd623d64b3cbd301a6a9" | ||
"gitHead": "5b57d1fd0a20294c1dec7c43b5df34dd6425d1a5" | ||
} |
import Constants from 'expo-constants'; | ||
export interface IFirebaseOptions { | ||
export type IFirebaseOptions = Partial<{ | ||
appId: string; | ||
@@ -13,3 +13,3 @@ apiKey: string; | ||
measurementId: string; | ||
} | ||
}>; | ||
@@ -16,0 +16,0 @@ export function getDefaultWebOptions(): IFirebaseOptions | void { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
37832
41
524