@react-native-firebase/crashlytics 12.9.1 → 13.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +24 -0
- package/android/build.gradle +1 -1
- package/lib/version.js +1 -1
- package/package.json +5 -5
- package/plugin/src/android/applyPlugin.ts +29 -0
- package/plugin/src/android/buildscriptDependency.ts +33 -0
- package/plugin/src/android/constants.ts +5 -0
- package/plugin/src/android/index.ts +4 -0
- package/plugin/src/index.ts +13 -0
- package/plugin/tsconfig.json +9 -0
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,30 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [13.0.1](https://github.com/invertase/react-native-firebase/compare/v13.0.0...v13.0.1) (2021-11-05)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @react-native-firebase/crashlytics
|
9
|
+
|
10
|
+
# [13.0.0](https://github.com/invertase/react-native-firebase/compare/v12.9.3...v13.0.0) (2021-10-31)
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
- rename default branch to main ([25e1d3d](https://github.com/invertase/react-native-firebase/commit/25e1d3d5a1a8311588938dc9d8fdf71d11cd9963))
|
15
|
+
|
16
|
+
- feat(sdks, android)!: firebase-android-sdk v29 / minSdkVersion API19 / target+compile API31 (#5825) ([f60afe1](https://github.com/invertase/react-native-firebase/commit/f60afe158b2dc823bd7169e36c3e428470576c7e)), closes [#5825](https://github.com/invertase/react-native-firebase/issues/5825)
|
17
|
+
|
18
|
+
### BREAKING CHANGES
|
19
|
+
|
20
|
+
- firebase-android-sdk 29 requires android/build.gradle minSdkVersion 19 (as required in react-native 0.64+)
|
21
|
+
|
22
|
+
## [12.9.3](https://github.com/invertase/react-native-firebase/compare/v12.9.2...v12.9.3) (2021-10-22)
|
23
|
+
|
24
|
+
**Note:** Version bump only for package @react-native-firebase/crashlytics
|
25
|
+
|
26
|
+
## [12.9.2](https://github.com/invertase/react-native-firebase/compare/v12.9.1...v12.9.2) (2021-10-17)
|
27
|
+
|
28
|
+
**Note:** Version bump only for package @react-native-firebase/crashlytics
|
29
|
+
|
6
30
|
## [12.9.1](https://github.com/invertase/react-native-firebase/compare/v12.9.0...v12.9.1) (2021-10-10)
|
7
31
|
|
8
32
|
**Note:** Version bump only for package @react-native-firebase/crashlytics
|
package/android/build.gradle
CHANGED
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// generated by genversion
|
2
|
-
module.exports = '
|
2
|
+
module.exports = '13.0.1';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/crashlytics",
|
3
|
-
"version": "
|
3
|
+
"version": "13.0.1",
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
5
5
|
"description": "React Native Firebase - Firebase Crashlytics is a lightweight, realtime crash reporter that helps you track, prioritize, and fix stability issues that erode your app quality. React Native Firebase provides automatic crash reporting for both native and JavaScript errors, including unhandled promise rejections.",
|
6
6
|
"main": "lib/index.js",
|
@@ -14,7 +14,7 @@
|
|
14
14
|
},
|
15
15
|
"repository": {
|
16
16
|
"type": "git",
|
17
|
-
"url": "https://github.com/invertase/react-native-firebase/tree/
|
17
|
+
"url": "https://github.com/invertase/react-native-firebase/tree/main/packages/crashlytics"
|
18
18
|
},
|
19
19
|
"license": "Apache-2.0",
|
20
20
|
"keywords": [
|
@@ -29,14 +29,14 @@
|
|
29
29
|
"crashlytics"
|
30
30
|
],
|
31
31
|
"peerDependencies": {
|
32
|
-
"@react-native-firebase/app": "
|
32
|
+
"@react-native-firebase/app": "13.0.1"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
|
-
"@expo/config-plugins": "^4.0.
|
35
|
+
"@expo/config-plugins": "^4.0.3",
|
36
36
|
"stacktrace-js": "^2.0.0"
|
37
37
|
},
|
38
38
|
"publishConfig": {
|
39
39
|
"access": "public"
|
40
40
|
},
|
41
|
-
"gitHead": "
|
41
|
+
"gitHead": "3d5d00d6b1ed7cf9e1afbe62f16b1c77e2bf7693"
|
42
42
|
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { ConfigPlugin, WarningAggregator, withAppBuildGradle } from '@expo/config-plugins';
|
2
|
+
|
3
|
+
import { crashlyticsPlugin } from './constants';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Update `app/build.gradle` by applying crashlytics plugin
|
7
|
+
*/
|
8
|
+
export const withApplyCrashlyticsPlugin: ConfigPlugin = config => {
|
9
|
+
return withAppBuildGradle(config, config => {
|
10
|
+
if (config.modResults.language === 'groovy') {
|
11
|
+
config.modResults.contents = applyPlugin(config.modResults.contents);
|
12
|
+
} else {
|
13
|
+
WarningAggregator.addWarningAndroid(
|
14
|
+
'react-native-firebase-crashlytics',
|
15
|
+
`Cannot automatically configure app build.gradle if it's not groovy`,
|
16
|
+
);
|
17
|
+
}
|
18
|
+
return config;
|
19
|
+
});
|
20
|
+
};
|
21
|
+
|
22
|
+
export function applyPlugin(appBuildGradle: string) {
|
23
|
+
const crashlyticsPattern = new RegExp(`apply\\s+plugin:\\s+['"]${crashlyticsPlugin}['"]`);
|
24
|
+
if (!appBuildGradle.match(crashlyticsPattern)) {
|
25
|
+
appBuildGradle += `\napply plugin: '${crashlyticsPlugin}'`;
|
26
|
+
}
|
27
|
+
|
28
|
+
return appBuildGradle;
|
29
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { ConfigPlugin, WarningAggregator, withProjectBuildGradle } from '@expo/config-plugins';
|
2
|
+
|
3
|
+
import { crashlyticsClassPath, crashlyticsVersion } from './constants';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Update `<project>/build.gradle` by adding google-services dependency to buildscript
|
7
|
+
*/
|
8
|
+
export const withBuildscriptDependency: ConfigPlugin = config => {
|
9
|
+
return withProjectBuildGradle(config, config => {
|
10
|
+
if (config.modResults.language === 'groovy') {
|
11
|
+
config.modResults.contents = setBuildscriptDependency(config.modResults.contents);
|
12
|
+
} else {
|
13
|
+
WarningAggregator.addWarningAndroid(
|
14
|
+
'react-native-firebase-crashlytics',
|
15
|
+
`Cannot automatically configure project build.gradle if it's not groovy`,
|
16
|
+
);
|
17
|
+
}
|
18
|
+
return config;
|
19
|
+
});
|
20
|
+
};
|
21
|
+
|
22
|
+
export function setBuildscriptDependency(buildGradle: string) {
|
23
|
+
// TODO: Find a more stable solution for this
|
24
|
+
if (!buildGradle.includes(crashlyticsClassPath)) {
|
25
|
+
return buildGradle.replace(
|
26
|
+
/dependencies\s?{/,
|
27
|
+
`dependencies {
|
28
|
+
classpath '${crashlyticsClassPath}:${crashlyticsVersion}'`,
|
29
|
+
);
|
30
|
+
}
|
31
|
+
|
32
|
+
return buildGradle;
|
33
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
const appPackageJson = require('@react-native-firebase/app/package.json');
|
2
|
+
|
3
|
+
export const crashlyticsClassPath = 'com.google.firebase:firebase-crashlytics-gradle';
|
4
|
+
export const crashlyticsPlugin = 'com.google.firebase.crashlytics';
|
5
|
+
export const crashlyticsVersion = appPackageJson.sdkVersions.android.firebaseCrashlyticsGradle;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ConfigPlugin, withPlugins, createRunOncePlugin } from '@expo/config-plugins';
|
2
|
+
|
3
|
+
import { withApplyCrashlyticsPlugin, withBuildscriptDependency } from './android';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* A config plugin for configuring `@react-native-firebase/crashlytics`
|
7
|
+
*/
|
8
|
+
const withRnFirebaseCrashlytics: ConfigPlugin = config => {
|
9
|
+
return withPlugins(config, [withBuildscriptDependency, withApplyCrashlyticsPlugin]);
|
10
|
+
};
|
11
|
+
|
12
|
+
const pak = require('@react-native-firebase/crashlytics/package.json');
|
13
|
+
export default createRunOncePlugin(withRnFirebaseCrashlytics, pak.name, pak.version);
|