Browse Source

migrate to using regular export

Daniel Zlotin 7 years ago
parent
commit
ee675c516f

+ 1
- 2
lib/src/Navigation.js View File

134
   }
134
   }
135
 }
135
 }
136
 
136
 
137
-const singleton = new Navigation();
138
-module.exports = singleton;
137
+export const singleton = new Navigation();

+ 0
- 4
lib/src/index.js View File

1
-const Navigation = require('./Navigation');
2
-
3
-module.exports = Navigation;
4
-module.exports.default = Navigation;

+ 3
- 0
lib/src/index.ts View File

1
+import { singleton } from "./Navigation";
2
+
3
+export const Navigation = singleton;

+ 1
- 0
package.json View File

169
       "import/order": 0,
169
       "import/order": 0,
170
       "import/named": 0,
170
       "import/named": 0,
171
       "import/no-unassigned-import": 0,
171
       "import/no-unassigned-import": 0,
172
+      "import/prefer-default-export": 0,
172
       "import/no-unresolved": [
173
       "import/no-unresolved": [
173
         2,
174
         2,
174
         {
175
         {

+ 1
- 1
playground/src/app.js View File

1
-const Navigation = require('react-native-navigation');
1
+const { Navigation } = require('react-native-navigation');
2
 const { registerScreens } = require('./screens');
2
 const { registerScreens } = require('./screens');
3
 
3
 
4
 function start() {
4
 function start() {

+ 1
- 1
playground/src/screens/CustomDialog.js View File

2
 const { PureComponent } = require('react');
2
 const { PureComponent } = require('react');
3
 
3
 
4
 const { View, Text, Button } = require('react-native');
4
 const { View, Text, Button } = require('react-native');
5
-const Navigation = require('react-native-navigation');
5
+const { Navigation } = require('react-native-navigation');
6
 
6
 
7
 class CustomDialog extends PureComponent {
7
 class CustomDialog extends PureComponent {
8
 
8
 

+ 1
- 1
playground/src/screens/CustomTransitionDestination.js View File

1
 const React = require('react');
1
 const React = require('react');
2
 const { Component } = require('react');
2
 const { Component } = require('react');
3
 const { View, TouchableOpacity, Image, Text } = require('react-native');
3
 const { View, TouchableOpacity, Image, Text } = require('react-native');
4
-const Navigation = require('react-native-navigation');
4
+const { Navigation } = require('react-native-navigation');
5
 
5
 
6
 class CustomTransitionDestination extends Component {
6
 class CustomTransitionDestination extends Component {
7
   constructor(props) {
7
   constructor(props) {

+ 1
- 1
playground/src/screens/CustomTransitionOrigin.js View File

1
 const React = require('react');
1
 const React = require('react');
2
 const { Component } = require('react');
2
 const { Component } = require('react');
3
 const { View, Text, Image, TouchableOpacity } = require('react-native');
3
 const { View, Text, Image, TouchableOpacity } = require('react-native');
4
-const Navigation = require('react-native-navigation');
4
+const { Navigation } = require('react-native-navigation');
5
 
5
 
6
 class CustomTransitionOrigin extends Component {
6
 class CustomTransitionOrigin extends Component {
7
   constructor(props) {
7
   constructor(props) {

+ 1
- 1
playground/src/screens/LifecycleScreen.js View File

3
 
3
 
4
 const { View, Text, Button } = require('react-native');
4
 const { View, Text, Button } = require('react-native');
5
 
5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7
 const testIDs = require('../testIDs');
7
 const testIDs = require('../testIDs');
8
 
8
 
9
 class LifecycleScreen extends Component {
9
 class LifecycleScreen extends Component {

+ 1
- 1
playground/src/screens/ModalScreen.js View File

5
 
5
 
6
 const { View, Text, Button } = require('react-native');
6
 const { View, Text, Button } = require('react-native');
7
 
7
 
8
-const Navigation = require('react-native-navigation');
8
+const { Navigation } = require('react-native-navigation');
9
 const testIDs = require('../testIDs');
9
 const testIDs = require('../testIDs');
10
 
10
 
11
 class ModalScreen extends Component {
11
 class ModalScreen extends Component {

+ 1
- 1
playground/src/screens/OptionsScreen.js View File

3
 
3
 
4
 const { View, Text, Button } = require('react-native');
4
 const { View, Text, Button } = require('react-native');
5
 
5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7
 const testIDs = require('../testIDs');
7
 const testIDs = require('../testIDs');
8
 
8
 
9
 const BUTTON_ONE = 'buttonOne';
9
 const BUTTON_ONE = 'buttonOne';

+ 1
- 1
playground/src/screens/OrientationDetectScreen.js View File

3
 
3
 
4
 const { View, Text, Button } = require('react-native');
4
 const { View, Text, Button } = require('react-native');
5
 
5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7
 const testIDs = require('../testIDs');
7
 const testIDs = require('../testIDs');
8
 
8
 
9
 class OrientationDetectScreen extends Component {
9
 class OrientationDetectScreen extends Component {

+ 1
- 1
playground/src/screens/OrientationSelectScreen.js View File

2
 const { Component } = require('react');
2
 const { Component } = require('react');
3
 const { View, Text, Button } = require('react-native');
3
 const { View, Text, Button } = require('react-native');
4
 
4
 
5
-const Navigation = require('react-native-navigation');
5
+const { Navigation } = require('react-native-navigation');
6
 const testIDs = require('../testIDs');
6
 const testIDs = require('../testIDs');
7
 
7
 
8
 class OrientationSelectScreen extends Component {
8
 class OrientationSelectScreen extends Component {

+ 1
- 1
playground/src/screens/PushedScreen.js View File

5
 
5
 
6
 const { View, Text, Button } = require('react-native');
6
 const { View, Text, Button } = require('react-native');
7
 
7
 
8
-const Navigation = require('react-native-navigation');
8
+const { Navigation } = require('react-native-navigation');
9
 const testIDs = require('../testIDs');
9
 const testIDs = require('../testIDs');
10
 
10
 
11
 class PushedScreen extends Component {
11
 class PushedScreen extends Component {

+ 1
- 1
playground/src/screens/ScrollViewScreen.js View File

3
 
3
 
4
 const { StyleSheet, ScrollView, View, Button } = require('react-native');
4
 const { StyleSheet, ScrollView, View, Button } = require('react-native');
5
 
5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7
 const testIDs = require('../testIDs');
7
 const testIDs = require('../testIDs');
8
 
8
 
9
 class ScrollViewScreen extends Component {
9
 class ScrollViewScreen extends Component {

+ 1
- 1
playground/src/screens/SideMenuScreen.js View File

3
 
3
 
4
 const { View, Text, Button } = require('react-native');
4
 const { View, Text, Button } = require('react-native');
5
 
5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7
 const testIDs = require('../testIDs');
7
 const testIDs = require('../testIDs');
8
 
8
 
9
 class SideMenuScreen extends Component {
9
 class SideMenuScreen extends Component {

+ 1
- 1
playground/src/screens/TextScreen.js View File

3
 
3
 
4
 const { View, Text, Button } = require('react-native');
4
 const { View, Text, Button } = require('react-native');
5
 
5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7
 const testIDs = require('../testIDs');
7
 const testIDs = require('../testIDs');
8
 
8
 
9
 let globalFirstComponentID;
9
 let globalFirstComponentID;

+ 1
- 1
playground/src/screens/TopTabOptionsScreen.js View File

2
 const { PureComponent } = require('react');
2
 const { PureComponent } = require('react');
3
 const testIDs = require('../testIDs');
3
 const testIDs = require('../testIDs');
4
 const { View, Text, Button } = require('react-native');
4
 const { View, Text, Button } = require('react-native');
5
-const Navigation = require('react-native-navigation');
5
+const { Navigation } = require('react-native-navigation');
6
 
6
 
7
 class TopTabOptionsScreen extends PureComponent {
7
 class TopTabOptionsScreen extends PureComponent {
8
   static get options() {
8
   static get options() {

+ 1
- 1
playground/src/screens/TopTabScreen.js View File

1
 const React = require('react');
1
 const React = require('react');
2
 const { PureComponent } = require('react');
2
 const { PureComponent } = require('react');
3
 const { View, Text } = require('react-native');
3
 const { View, Text } = require('react-native');
4
-const Navigation = require('react-native-navigation');
4
+const { Navigation } = require('react-native-navigation');
5
 
5
 
6
 class TopTabScreen extends PureComponent {
6
 class TopTabScreen extends PureComponent {
7
   static get options() {
7
   static get options() {

+ 1
- 1
playground/src/screens/WelcomeScreen.js View File

4
 
4
 
5
 const testIDs = require('../testIDs');
5
 const testIDs = require('../testIDs');
6
 
6
 
7
-const Navigation = require('react-native-navigation');
7
+const { Navigation } = require('react-native-navigation');
8
 
8
 
9
 class WelcomeScreen extends Component {
9
 class WelcomeScreen extends Component {
10
   static get options() {
10
   static get options() {

+ 1
- 1
playground/src/screens/index.js View File

1
-const Navigation = require('react-native-navigation');
1
+const { Navigation } = require('react-native-navigation');
2
 const WelcomeScreen = require('./WelcomeScreen');
2
 const WelcomeScreen = require('./WelcomeScreen');
3
 const TextScreen = require('./TextScreen');
3
 const TextScreen = require('./TextScreen');
4
 const PushedScreen = require('./PushedScreen');
4
 const PushedScreen = require('./PushedScreen');