Browse Source

import export to ModuleJS

Daniel Zlotin 7 years ago
parent
commit
517ab46fc7

+ 11
- 12
lib/src/Navigation.js View File

1
-import NativeCommandsSender from './adapters/NativeCommandsSender';
2
-import NativeEventsReceiver from './adapters/NativeEventsReceiver';
3
-import UniqueIdProvider from './adapters/UniqueIdProvider';
4
-
5
-import Store from './containers/Store';
6
-import ContainerRegistry from './containers/ContainerRegistry';
7
-import Commands from './commands/Commands';
8
-import LayoutTreeParser from './commands/LayoutTreeParser';
9
-import LayoutTreeCrawler from './commands/LayoutTreeCrawler';
10
-import PrivateEventsListener from './events/PrivateEventsListener';
11
-import PublicEventsRegistry from './events/PublicEventsRegistry';
1
+const NativeCommandsSender = require('./adapters/NativeCommandsSender');
2
+const NativeEventsReceiver = require('./adapters/NativeEventsReceiver');
3
+const UniqueIdProvider = require('./adapters/UniqueIdProvider');
4
+const Store = require('./containers/Store');
5
+const ContainerRegistry = require('./containers/ContainerRegistry');
6
+const Commands = require('./commands/Commands');
7
+const LayoutTreeParser = require('./commands/LayoutTreeParser');
8
+const LayoutTreeCrawler = require('./commands/LayoutTreeCrawler');
9
+const PrivateEventsListener = require('./events/PrivateEventsListener');
10
+const PublicEventsRegistry = require('./events/PublicEventsRegistry');
12
 
11
 
13
 class Navigation {
12
 class Navigation {
14
   constructor() {
13
   constructor() {
71
 }
70
 }
72
 
71
 
73
 const singleton = new Navigation();
72
 const singleton = new Navigation();
74
-export default singleton;
73
+module.exports = singleton;

+ 3
- 2
lib/src/adapters/NativeCommandsSender.js View File

1
-import { NativeModules } from 'react-native';
1
+const { NativeModules } = require('react-native');
2
 
2
 
3
-export default class NativeCommandsSender {
3
+class NativeCommandsSender {
4
   constructor() {
4
   constructor() {
5
     this.nativeCommandsModule = NativeModules.RNNBridgeModule;
5
     this.nativeCommandsModule = NativeModules.RNNBridgeModule;
6
   }
6
   }
50
   }
50
   }
51
 }
51
 }
52
 
52
 
53
+module.exports = NativeCommandsSender;

+ 1
- 1
lib/src/adapters/NativeCommandsSender.mock.js View File

1
-export default jest.genMockFromModule('./NativeCommandsSender').default;
1
+module.exports = jest.genMockFromModule('./NativeCommandsSender');

+ 4
- 2
lib/src/adapters/NativeEventsReceiver.js View File

1
-import { NativeModules, NativeEventEmitter } from 'react-native';
1
+const { NativeModules, NativeEventEmitter } = require('react-native');
2
 
2
 
3
-export default class NativeEventsReceiver {
3
+class NativeEventsReceiver {
4
   constructor() {
4
   constructor() {
5
     this.emitter = new NativeEventEmitter(NativeModules.RNNEventEmitter);
5
     this.emitter = new NativeEventEmitter(NativeModules.RNNEventEmitter);
6
   }
6
   }
17
     this.emitter.addListener('RNN.appLaunched', callback);
17
     this.emitter.addListener('RNN.appLaunched', callback);
18
   }
18
   }
19
 }
19
 }
20
+
21
+module.exports = NativeEventsReceiver;

+ 1
- 1
lib/src/adapters/NativeEventsReceiver.mock.js View File

1
-export default jest.genMockFromModule('./NativeEventsReceiver').default;
1
+module.exports = jest.genMockFromModule('./NativeEventsReceiver');

+ 4
- 2
lib/src/adapters/UniqueIdProvider.js View File

1
-import _ from 'lodash';
1
+const _ = require('lodash');
2
 
2
 
3
-export default class UniqueIdProvider {
3
+class UniqueIdProvider {
4
   generate(prefix) {
4
   generate(prefix) {
5
     return _.uniqueId(prefix);
5
     return _.uniqueId(prefix);
6
   }
6
   }
7
 }
7
 }
8
+
9
+module.exports = UniqueIdProvider;

+ 2
- 1
lib/src/adapters/UniqueIdProvider.mock.js View File

1
-export default class UniqueIdProvider {
1
+class UniqueIdProvider {
2
   generate(prefix) {
2
   generate(prefix) {
3
     return `${prefix}+UNIQUE_ID`;
3
     return `${prefix}+UNIQUE_ID`;
4
   }
4
   }
5
 }
5
 }
6
 
6
 
7
+module.exports = UniqueIdProvider;

+ 5
- 4
lib/src/commands/Commands.js View File

1
-import _ from 'lodash';
2
-import optionsProcessor from './OptionsProcessor';
1
+const _ = require('lodash');
2
+const OptionsProcessor = require('./OptionsProcessor');
3
 
3
 
4
-export default class Commands {
4
+class Commands {
5
   constructor(nativeCommandsSender, layoutTreeParser, layoutTreeCrawler) {
5
   constructor(nativeCommandsSender, layoutTreeParser, layoutTreeCrawler) {
6
     this.nativeCommandsSender = nativeCommandsSender;
6
     this.nativeCommandsSender = nativeCommandsSender;
7
     this.layoutTreeParser = layoutTreeParser;
7
     this.layoutTreeParser = layoutTreeParser;
17
 
17
 
18
   setOptions(containerId, options) {
18
   setOptions(containerId, options) {
19
     const input = _.cloneDeep(options);
19
     const input = _.cloneDeep(options);
20
-    optionsProcessor(input);
20
+    OptionsProcessor.processOptions(input);
21
     this.nativeCommandsSender.setOptions(containerId, input);
21
     this.nativeCommandsSender.setOptions(containerId, input);
22
   }
22
   }
23
 
23
 
56
   }
56
   }
57
 }
57
 }
58
 
58
 
59
+module.exports = Commands;

+ 7
- 8
lib/src/commands/Commands.test.js View File

1
-import * as SimpleLayouts from './SimpleLayouts';
2
-import LayoutTreeParser from './LayoutTreeParser';
3
-import LayoutTreeCrawler from './LayoutTreeCrawler';
4
-import Store from '../containers/Store';
5
-import UniqueIdProvider from '../adapters/UniqueIdProvider.mock';
6
-import NativeCommandsSender from '../adapters/NativeCommandsSender.mock';
7
-
8
-import Commands from './Commands';
1
+const SimpleLayouts = require('./SimpleLayouts');
2
+const LayoutTreeParser = require('./LayoutTreeParser');
3
+const LayoutTreeCrawler = require('./LayoutTreeCrawler');
4
+const Store = require('../containers/Store');
5
+const UniqueIdProvider = require('../adapters/UniqueIdProvider.mock');
6
+const NativeCommandsSender = require('../adapters/NativeCommandsSender.mock');
7
+const Commands = require('./Commands');
9
 
8
 
10
 describe('Commands', () => {
9
 describe('Commands', () => {
11
   let uut;
10
   let uut;

+ 7
- 5
lib/src/commands/LayoutTreeCrawler.js View File

1
-import _ from 'lodash';
2
-import LayoutTypes from './LayoutTypes';
3
-import optionsProcessor from './OptionsProcessor';
1
+const _ = require('lodash');
2
+const LayoutTypes = require('./LayoutTypes');
3
+const OptionsProcessor = require('./OptionsProcessor');
4
 
4
 
5
-export default class LayoutTreeCrawler {
5
+class LayoutTreeCrawler {
6
   constructor(uniqueIdProvider, store) {
6
   constructor(uniqueIdProvider, store) {
7
     this.uniqueIdProvider = uniqueIdProvider;
7
     this.uniqueIdProvider = uniqueIdProvider;
8
     this.store = store;
8
     this.store = store;
25
     this.store.setPropsForContainerId(node.id, node.data.passProps);
25
     this.store.setPropsForContainerId(node.id, node.data.passProps);
26
     const clazz = this.store.getOriginalContainerClassForName(node.data.name);
26
     const clazz = this.store.getOriginalContainerClassForName(node.data.name);
27
     node.data.navigationOptions = _.cloneDeep(_.get(clazz, 'navigationOptions', {}));
27
     node.data.navigationOptions = _.cloneDeep(_.get(clazz, 'navigationOptions', {}));
28
-    optionsProcessor(node.data.navigationOptions);
28
+    OptionsProcessor.processOptions(node.data.navigationOptions);
29
   }
29
   }
30
 
30
 
31
   _assertKnownLayoutType(type) {
31
   _assertKnownLayoutType(type) {
40
     }
40
     }
41
   }
41
   }
42
 }
42
 }
43
+
44
+module.exports = LayoutTreeCrawler;

+ 4
- 4
lib/src/commands/LayoutTreeCrawler.test.js View File

1
-import LayoutTypes from './LayoutTypes';
2
-import LayoutTreeCrawler from './LayoutTreeCrawler';
3
-import Store from '../containers/Store';
4
-import UniqueIdProvider from '../adapters/UniqueIdProvider.mock';
1
+const LayoutTypes = require('./LayoutTypes');
2
+const LayoutTreeCrawler = require('./LayoutTreeCrawler');
3
+const Store = require('../containers/Store');
4
+const UniqueIdProvider = require('../adapters/UniqueIdProvider.mock');
5
 
5
 
6
 describe('LayoutTreeCrawler', () => {
6
 describe('LayoutTreeCrawler', () => {
7
   let uut;
7
   let uut;

+ 5
- 3
lib/src/commands/LayoutTreeParser.js View File

1
-import * as _ from 'lodash';
2
-import LayoutTypes from './LayoutTypes';
1
+const _ = require('lodash');
2
+const LayoutTypes = require('./LayoutTypes');
3
 
3
 
4
-export default class LayoutTreeParser {
4
+class LayoutTreeParser {
5
   /**
5
   /**
6
    * returns correct layout tree of {type, children, data?}
6
    * returns correct layout tree of {type, children, data?}
7
    */
7
    */
67
     return children;
67
     return children;
68
   }
68
   }
69
 }
69
 }
70
+
71
+module.exports = LayoutTreeParser;

+ 2
- 2
lib/src/commands/LayoutTreeParser.test.js View File

1
-import * as SimpleLayouts from './SimpleLayouts';
2
-import LayoutTreeParser from './LayoutTreeParser';
1
+const SimpleLayouts = require('./SimpleLayouts');
2
+const LayoutTreeParser = require('./LayoutTreeParser');
3
 
3
 
4
 describe('LayoutTreeParser', () => {
4
 describe('LayoutTreeParser', () => {
5
   let uut;
5
   let uut;

+ 1
- 1
lib/src/commands/LayoutTypes.js View File

1
-export default {
1
+module.exports = {
2
   Container: 'Container',
2
   Container: 'Container',
3
   ContainerStack: 'ContainerStack',
3
   ContainerStack: 'ContainerStack',
4
   BottomTabs: 'BottomTabs',
4
   BottomTabs: 'BottomTabs',

+ 15
- 11
lib/src/commands/OptionsProcessor.js View File

1
-import _ from 'lodash';
2
-import { processColor } from 'react-native';
1
+const _ = require('lodash');
2
+const { processColor } = require('react-native');
3
 
3
 
4
-export default function optionsProcessor(navigationOptions) {
5
-  _.forEach(navigationOptions, (value, key) => {
6
-    if (_.endsWith(key, 'Color')) {
7
-      navigationOptions[key] = processColor(value);
8
-    }
9
-    if (_.isPlainObject(value)) {
10
-      optionsProcessor(value);
11
-    }
12
-  });
4
+class OptionsProcessor {
5
+  static processOptions(navigationOptions) {
6
+    _.forEach(navigationOptions, (value, key) => {
7
+      if (_.endsWith(key, 'Color')) {
8
+        navigationOptions[key] = processColor(value);
9
+      }
10
+      if (_.isPlainObject(value)) {
11
+        OptionsProcessor.processOptions(value);
12
+      }
13
+    });
14
+  }
13
 }
15
 }
16
+
17
+module.exports = OptionsProcessor;

+ 12
- 12
lib/src/commands/OptionsProcessor.test.js View File

1
-import optionsProcessor from './OptionsProcessor';
1
+const OptionsProcessor = require('./OptionsProcessor');
2
 
2
 
3
 describe('navigation options', () => {
3
 describe('navigation options', () => {
4
   let navigationOptions;
4
   let navigationOptions;
9
 
9
 
10
   it('processes colors into numeric AARRGGBB', () => {
10
   it('processes colors into numeric AARRGGBB', () => {
11
     navigationOptions.someKeyColor = 'red';
11
     navigationOptions.someKeyColor = 'red';
12
-    optionsProcessor(navigationOptions);
12
+    OptionsProcessor.processOptions(navigationOptions);
13
     expect(navigationOptions.someKeyColor).toEqual(0xffff0000);
13
     expect(navigationOptions.someKeyColor).toEqual(0xffff0000);
14
 
14
 
15
     navigationOptions.someKeyColor = 'yellow';
15
     navigationOptions.someKeyColor = 'yellow';
16
-    optionsProcessor(navigationOptions);
16
+    OptionsProcessor.processOptions(navigationOptions);
17
     expect(navigationOptions.someKeyColor).toEqual(0xffffff00);
17
     expect(navigationOptions.someKeyColor).toEqual(0xffffff00);
18
   });
18
   });
19
 
19
 
20
   it('processes numeric colors', () => {
20
   it('processes numeric colors', () => {
21
     navigationOptions.someKeyColor = '#123456';
21
     navigationOptions.someKeyColor = '#123456';
22
-    optionsProcessor(navigationOptions);
22
+    OptionsProcessor.processOptions(navigationOptions);
23
     expect(navigationOptions.someKeyColor).toEqual(0xff123456);
23
     expect(navigationOptions.someKeyColor).toEqual(0xff123456);
24
 
24
 
25
     navigationOptions.someKeyColor = 0x123456ff; // wut
25
     navigationOptions.someKeyColor = 0x123456ff; // wut
26
-    optionsProcessor(navigationOptions);
26
+    OptionsProcessor.processOptions(navigationOptions);
27
     expect(navigationOptions.someKeyColor).toEqual(0xff123456);
27
     expect(navigationOptions.someKeyColor).toEqual(0xff123456);
28
   });
28
   });
29
 
29
 
30
   it('process colors with rgb functions', () => {
30
   it('process colors with rgb functions', () => {
31
     navigationOptions.someKeyColor = 'rgb(255, 0, 255)';
31
     navigationOptions.someKeyColor = 'rgb(255, 0, 255)';
32
-    optionsProcessor(navigationOptions);
32
+    OptionsProcessor.processOptions(navigationOptions);
33
     expect(navigationOptions.someKeyColor).toEqual(0xffff00ff);
33
     expect(navigationOptions.someKeyColor).toEqual(0xffff00ff);
34
   });
34
   });
35
 
35
 
36
   it('process colors with special words', () => {
36
   it('process colors with special words', () => {
37
     navigationOptions.someKeyColor = 'fuchsia';
37
     navigationOptions.someKeyColor = 'fuchsia';
38
-    optionsProcessor(navigationOptions);
38
+    OptionsProcessor.processOptions(navigationOptions);
39
     expect(navigationOptions.someKeyColor).toEqual(0xffff00ff);
39
     expect(navigationOptions.someKeyColor).toEqual(0xffff00ff);
40
   });
40
   });
41
 
41
 
42
   it('process colors with hsla functions', () => {
42
   it('process colors with hsla functions', () => {
43
     navigationOptions.someKeyColor = 'hsla(360, 100%, 100%, 1.0)';
43
     navigationOptions.someKeyColor = 'hsla(360, 100%, 100%, 1.0)';
44
-    optionsProcessor(navigationOptions);
44
+    OptionsProcessor.processOptions(navigationOptions);
45
 
45
 
46
     expect(navigationOptions.someKeyColor).toEqual(0xffffffff);
46
     expect(navigationOptions.someKeyColor).toEqual(0xffffffff);
47
   });
47
   });
48
 
48
 
49
   it('unknown colors return undefined', () => {
49
   it('unknown colors return undefined', () => {
50
     navigationOptions.someKeyColor = 'wut';
50
     navigationOptions.someKeyColor = 'wut';
51
-    optionsProcessor(navigationOptions);
51
+    OptionsProcessor.processOptions(navigationOptions);
52
     expect(navigationOptions.someKeyColor).toEqual(undefined);
52
     expect(navigationOptions.someKeyColor).toEqual(undefined);
53
   });
53
   });
54
 
54
 
56
     navigationOptions.otherKeyColor = 'red';
56
     navigationOptions.otherKeyColor = 'red';
57
     navigationOptions.yetAnotherColor = 'blue';
57
     navigationOptions.yetAnotherColor = 'blue';
58
     navigationOptions.andAnotherColor = 'rgb(0, 255, 0)';
58
     navigationOptions.andAnotherColor = 'rgb(0, 255, 0)';
59
-    optionsProcessor(navigationOptions);
59
+    OptionsProcessor.processOptions(navigationOptions);
60
     expect(navigationOptions.otherKeyColor).toEqual(0xffff0000);
60
     expect(navigationOptions.otherKeyColor).toEqual(0xffff0000);
61
     expect(navigationOptions.yetAnotherColor).toEqual(0xff0000ff);
61
     expect(navigationOptions.yetAnotherColor).toEqual(0xff0000ff);
62
     expect(navigationOptions.andAnotherColor).toEqual(0xff00ff00);
62
     expect(navigationOptions.andAnotherColor).toEqual(0xff00ff00);
64
 
64
 
65
   it('keys ending with Color case sensitive', () => {
65
   it('keys ending with Color case sensitive', () => {
66
     navigationOptions.otherKey_color = 'red'; // eslint-disable-line camelcase
66
     navigationOptions.otherKey_color = 'red'; // eslint-disable-line camelcase
67
-    optionsProcessor(navigationOptions);
67
+    OptionsProcessor.processOptions(navigationOptions);
68
     expect(navigationOptions.otherKey_color).toEqual('red');
68
     expect(navigationOptions.otherKey_color).toEqual('red');
69
   });
69
   });
70
 
70
 
71
   it('any nested recursive keys ending with Color', () => {
71
   it('any nested recursive keys ending with Color', () => {
72
     navigationOptions.innerObj = { theKeyColor: 'red' };
72
     navigationOptions.innerObj = { theKeyColor: 'red' };
73
     navigationOptions.innerObj.innerMostObj = { anotherColor: 'yellow' };
73
     navigationOptions.innerObj.innerMostObj = { anotherColor: 'yellow' };
74
-    optionsProcessor(navigationOptions);
74
+    OptionsProcessor.processOptions(navigationOptions);
75
     expect(navigationOptions.innerObj.theKeyColor).toEqual(0xffff0000);
75
     expect(navigationOptions.innerObj.theKeyColor).toEqual(0xffff0000);
76
     expect(navigationOptions.innerObj.innerMostObj.anotherColor).toEqual(0xffffff00);
76
     expect(navigationOptions.innerObj.innerMostObj.anotherColor).toEqual(0xffffff00);
77
   });
77
   });

+ 19
- 8
lib/src/commands/SimpleLayouts.js View File

1
-export const singleScreenApp = {
1
+const singleScreenApp = {
2
   container: {
2
   container: {
3
     name: 'com.example.MyScreen'
3
     name: 'com.example.MyScreen'
4
   }
4
   }
5
 };
5
 };
6
 
6
 
7
-export const passProps = {
7
+const passProps = {
8
   strProp: 'string prop',
8
   strProp: 'string prop',
9
   numProp: 12345,
9
   numProp: 12345,
10
   objProp: { inner: { foo: 'bar' } },
10
   objProp: { inner: { foo: 'bar' } },
11
   fnProp: () => 'Hello from a function'
11
   fnProp: () => 'Hello from a function'
12
 };
12
 };
13
 
13
 
14
-export const singleScreenWithAditionalParams = {
14
+const singleScreenWithAditionalParams = {
15
   container: {
15
   container: {
16
     name: 'com.example.MyScreen',
16
     name: 'com.example.MyScreen',
17
     passProps,
17
     passProps,
20
   }
20
   }
21
 };
21
 };
22
 
22
 
23
-export const tabBasedApp = {
23
+const tabBasedApp = {
24
   bottomTabs: [
24
   bottomTabs: [
25
     {
25
     {
26
       container: {
26
       container: {
40
   ]
40
   ]
41
 };
41
 };
42
 
42
 
43
-export const singleWithSideMenu = {
43
+const singleWithSideMenu = {
44
   container: {
44
   container: {
45
     name: 'com.example.MyScreen'
45
     name: 'com.example.MyScreen'
46
   },
46
   },
53
   }
53
   }
54
 };
54
 };
55
 
55
 
56
-export const singleWithRightSideMenu = {
56
+const singleWithRightSideMenu = {
57
   container: {
57
   container: {
58
     name: 'com.example.MyScreen'
58
     name: 'com.example.MyScreen'
59
   },
59
   },
66
   }
66
   }
67
 };
67
 };
68
 
68
 
69
-export const singleWithBothMenus = {
69
+const singleWithBothMenus = {
70
   container: {
70
   container: {
71
     name: 'com.example.MyScreen'
71
     name: 'com.example.MyScreen'
72
   },
72
   },
84
   }
84
   }
85
 };
85
 };
86
 
86
 
87
-export const tabBasedWithBothSideMenus = {
87
+const tabBasedWithBothSideMenus = {
88
   bottomTabs: [
88
   bottomTabs: [
89
     {
89
     {
90
       container: {
90
       container: {
110
     }
110
     }
111
   }
111
   }
112
 };
112
 };
113
+
114
+module.exports = {
115
+  singleScreenApp,
116
+  passProps,
117
+  singleScreenWithAditionalParams,
118
+  tabBasedApp,
119
+  singleWithSideMenu,
120
+  singleWithRightSideMenu,
121
+  singleWithBothMenus,
122
+  tabBasedWithBothSideMenus
123
+};

+ 5
- 3
lib/src/containers/ContainerRegistry.js View File

1
-import { AppRegistry } from 'react-native';
2
-import ContainerWrapper from './ContainerWrapper';
1
+const { AppRegistry } = require('react-native');
2
+const ContainerWrapper = require('./ContainerWrapper');
3
 
3
 
4
-export default class ContainerRegistry {
4
+class ContainerRegistry {
5
   constructor(store) {
5
   constructor(store) {
6
     this.store = store;
6
     this.store = store;
7
   }
7
   }
13
     AppRegistry.registerComponent(containerName, () => NavigationContainer);
13
     AppRegistry.registerComponent(containerName, () => NavigationContainer);
14
   }
14
   }
15
 }
15
 }
16
+
17
+module.exports = ContainerRegistry;

+ 6
- 5
lib/src/containers/ContainerRegistry.test.js View File

1
-import React, { Component } from 'react';
2
-import { AppRegistry, Text } from 'react-native';
3
-import renderer from 'react-test-renderer';
1
+const React = require('react');
2
+const { Component } = require('react');
3
+const { AppRegistry, Text } = require('react-native');
4
 
4
 
5
-import ContainerRegistry from './ContainerRegistry';
6
-import Store from './Store';
5
+const renderer = require('react-test-renderer');
6
+const ContainerRegistry = require('./ContainerRegistry');
7
+const Store = require('./Store');
7
 
8
 
8
 describe('ContainerRegistry', () => {
9
 describe('ContainerRegistry', () => {
9
   let uut;
10
   let uut;

+ 7
- 3
lib/src/containers/ContainerWrapper.js View File

1
-import _ from 'lodash';
2
-import React, { Component } from 'react';
1
+const _ = require('lodash');
3
 
2
 
4
-export default class ContainerWrapper {
3
+const React = require('react');
4
+const { Component } = require('react');
5
+
6
+class ContainerWrapper {
5
   static wrap(containerName, OriginalContainer, store) {
7
   static wrap(containerName, OriginalContainer, store) {
6
     return class extends Component {
8
     return class extends Component {
7
       constructor(props) {
9
       constructor(props) {
67
     };
69
     };
68
   }
70
   }
69
 }
71
 }
72
+
73
+module.exports = ContainerWrapper;

+ 6
- 6
lib/src/containers/ContainerWrapper.test.js View File

1
-/* eslint-disable consistent-this, react/no-multi-comp */
2
-import React, { Component } from 'react';
3
-import { Text } from 'react-native';
4
-import renderer from 'react-test-renderer';
1
+const React = require('react');
2
+const { Component } = require('react');
5
 
3
 
6
-import ContainerWrapper from './ContainerWrapper';
7
-import Store from './Store';
4
+const { Text } = require('react-native');
5
+const renderer = require('react-test-renderer');
6
+const ContainerWrapper = require('./ContainerWrapper');
7
+const Store = require('./Store');
8
 
8
 
9
 describe('ContainerWrapper', () => {
9
 describe('ContainerWrapper', () => {
10
   let store;
10
   let store;

+ 3
- 1
lib/src/containers/Lifecycle.js View File

1
-export default class Lifecycle {
1
+class Lifecycle {
2
   constructor(store) {
2
   constructor(store) {
3
     this.store = store;
3
     this.store = store;
4
     this.containerStart = this.containerStart.bind(this);
4
     this.containerStart = this.containerStart.bind(this);
19
     }
19
     }
20
   }
20
   }
21
 }
21
 }
22
+
23
+module.exports = Lifecycle;

+ 2
- 2
lib/src/containers/Lifecycle.test.js View File

1
-import Lifecycle from './Lifecycle';
2
-import Store from '../containers/Store';
1
+const Lifecycle = require('./Lifecycle');
2
+const Store = require('../containers/Store');
3
 
3
 
4
 describe('Lifecycle', () => {
4
 describe('Lifecycle', () => {
5
   let store;
5
   let store;

+ 4
- 2
lib/src/containers/Store.js View File

1
-import _ from 'lodash';
1
+const _ = require('lodash');
2
 
2
 
3
-export default class Store {
3
+class Store {
4
   constructor() {
4
   constructor() {
5
     this.propsByContainerId = {};
5
     this.propsByContainerId = {};
6
     this.containersByName = {};
6
     this.containersByName = {};
36
     _.unset(this.propsByContainerId, id);
36
     _.unset(this.propsByContainerId, id);
37
   }
37
   }
38
 }
38
 }
39
+
40
+module.exports = Store;

+ 1
- 1
lib/src/containers/Store.test.js View File

1
-import Store from './Store';
1
+const Store = require('./Store');
2
 
2
 
3
 describe('Store', () => {
3
 describe('Store', () => {
4
   let uut;
4
   let uut;

+ 4
- 2
lib/src/events/PrivateEventsListener.js View File

1
-import Lifecycle from '../containers/Lifecycle';
1
+const Lifecycle = require('../containers/Lifecycle');
2
 
2
 
3
-export default class PrivateEventsListener {
3
+class PrivateEventsListener {
4
   constructor(nativeEventsReceiver, store) {
4
   constructor(nativeEventsReceiver, store) {
5
     this.nativeEventsReceiver = nativeEventsReceiver;
5
     this.nativeEventsReceiver = nativeEventsReceiver;
6
     this.lifecycle = new Lifecycle(store);
6
     this.lifecycle = new Lifecycle(store);
11
     this.nativeEventsReceiver.containerStop(this.lifecycle.containerStop);
11
     this.nativeEventsReceiver.containerStop(this.lifecycle.containerStop);
12
   }
12
   }
13
 }
13
 }
14
+
15
+module.exports = PrivateEventsListener;

+ 3
- 3
lib/src/events/PrivateEventsListener.test.js View File

1
-import PrivateEventsListener from './PrivateEventsListener';
2
-import NativeEventsReceiver from '../adapters/NativeEventsReceiver.mock';
3
-import Store from '../containers/Store';
1
+const PrivateEventsListener = require('./PrivateEventsListener');
2
+const NativeEventsReceiver = require('../adapters/NativeEventsReceiver.mock');
3
+const Store = require('../containers/Store');
4
 
4
 
5
 describe('PrivateEventsListener', () => {
5
 describe('PrivateEventsListener', () => {
6
   let uut;
6
   let uut;

+ 3
- 1
lib/src/events/PublicEventsRegistry.js View File

1
-export default class PublicEventsRegistry {
1
+class PublicEventsRegistry {
2
   constructor(nativeEventsReceiver) {
2
   constructor(nativeEventsReceiver) {
3
     this.nativeEventsReceiver = nativeEventsReceiver;
3
     this.nativeEventsReceiver = nativeEventsReceiver;
4
   }
4
   }
7
     this.nativeEventsReceiver.appLaunched(callback);
7
     this.nativeEventsReceiver.appLaunched(callback);
8
   }
8
   }
9
 }
9
 }
10
+
11
+module.exports = PublicEventsRegistry;

+ 2
- 2
lib/src/events/PublicEventsRegistry.test.js View File

1
-import PublicEventsRegistry from './PublicEventsRegistry';
2
-import NativeEventsReceiver from '../adapters/NativeEventsReceiver.mock';
1
+const PublicEventsRegistry = require('./PublicEventsRegistry');
2
+const NativeEventsReceiver = require('../adapters/NativeEventsReceiver.mock');
3
 
3
 
4
 describe('PublicEventsRegistry', () => {
4
 describe('PublicEventsRegistry', () => {
5
   let uut;
5
   let uut;

+ 1
- 1
lib/src/index.js View File

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