Skip to content

Commit b1590f9

Browse files
authored
Create Barrel Entry File (#801)
1 parent 75bc209 commit b1590f9

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"homepage": "https://www.instabug.com/platforms/react-native",
88
"bugs": "https://github.com/Instabug/Instabug-React-Native/issues",
99
"license": "MIT",
10-
"main": "src/modules/Instabug.js",
10+
"main": "src/index.js",
1111
"types": "src/index.d.ts",
1212
"keywords": [
1313
"react-native",

src/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Instabug from './modules/Instabug';
2+
import BugReporting from './modules/BugReporting';
3+
import APM from './modules/APM';
4+
import Surveys from './modules/Surveys';
5+
import FeatureRequests from './modules/FeatureRequests';
6+
import Replies from './modules/Replies';
7+
import CrashReporting from './modules/CrashReporting';
8+
import NetworkLogger from './modules/NetworkLogger';
9+
10+
export { APM, BugReporting, CrashReporting, FeatureRequests, NetworkLogger, Replies, Surveys };
11+
12+
export default Instabug;

src/modules/Instabug.js

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,9 @@ import IBGEventEmitter from '../utils/IBGEventEmitter';
99
import InstabugUtils, { stringifyIfNotString } from '../utils/InstabugUtils';
1010
import InstabugConstants from '../utils/InstabugConstants';
1111
import Report from '../models/Report';
12-
import BugReporting from './BugReporting';
13-
import APM from './APM';
14-
import Surveys from './Surveys';
15-
import FeatureRequests from './FeatureRequests';
16-
import Replies from './Replies';
17-
import CrashReporting from './CrashReporting';
1812
import NetworkLogger from './NetworkLogger';
1913
import ArgsRegistry from '../utils/ArgsRegistry';
2014

21-
InstabugUtils.captureJsErrors();
22-
NetworkLogger.setEnabled(true);
23-
2415
var _currentScreen = null;
2516
var _lastScreen = null;
2617
var _isFirstScreen = false;
@@ -42,7 +33,11 @@ const InstabugModule = {
4233
* the SDK's UI.
4334
*/
4435
start: function (token, invocationEvent) {
36+
InstabugUtils.captureJsErrors();
37+
NetworkLogger.setEnabled(true);
38+
4539
Instabug.start(token, invocationEvent);
40+
4641
_isFirstScreen = true;
4742
_currentScreen = firstScreen;
4843
setTimeout(function () {
@@ -687,14 +682,4 @@ const InstabugModule = {
687682
strings: ArgsRegistry.strings,
688683
};
689684

690-
export {
691-
BugReporting,
692-
Surveys,
693-
FeatureRequests,
694-
Replies,
695-
CrashReporting,
696-
NetworkLogger,
697-
APM,
698-
};
699-
700685
export default InstabugModule;

0 commit comments

Comments
 (0)