Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit a501dc2

Browse files
committed
refactor: upgrade
BREAKING CHANGE: change activeTintColor -> activeColor
1 parent 3165ede commit a501dc2

29 files changed

Lines changed: 7654 additions & 8110 deletions

.circleci/config.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22

33
defaults: &defaults
44
docker:
5-
- image: circleci/node:7.10
5+
- image: circleci/node:10.9.0
66
working_directory: ~/project
77

88
jobs:
@@ -21,8 +21,7 @@ jobs:
2121
- v1-dependencies-example-{{ checksum "example/package.json" }}
2222
- v1-dependencies-example-
2323
- run: |
24-
yarn install --ignore-engines
25-
yarn install --cwd example
24+
yarn bootstrap
2625
- save_cache:
2726
key: v1-dependencies-{{ checksum "package.json" }}
2827
paths: node_modules
@@ -32,32 +31,39 @@ jobs:
3231
- persist_to_workspace:
3332
root: .
3433
paths: .
35-
lint-and-flow:
34+
lint-and-typecheck:
3635
<<: *defaults
3736
steps:
3837
- attach_workspace:
3938
at: ~/project
4039
- run: |
4140
yarn lint
42-
yarn flow
41+
yarn typescript
4342
unit-tests:
4443
<<: *defaults
4544
steps:
4645
- attach_workspace:
4746
at: ~/project
48-
- run: yarn test -- --coverage
47+
- run: |
48+
yarn test --coverage
4949
- store_artifacts:
5050
path: coverage
5151
destination: coverage
52+
build:
53+
<<: *defaults
54+
steps:
55+
- attach_workspace:
56+
at: ~/project
57+
- run: yarn prepare
5258

5359
workflows:
5460
version: 2
5561
build-and-test:
5662
jobs:
5763
- install-dependencies
58-
- lint-and-flow:
64+
- lint-and-typecheck:
5965
requires:
6066
- install-dependencies
61-
- unit-tests:
67+
- build:
6268
requires:
6369
- install-dependencies

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
node_modules/
22
flow-typed/
33
dist/
4+
5+
# generated by bob
6+
lib/

.eslintrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@
33

44
"plugins": ["react-native-globals"],
55

6+
"settings": {
7+
"react": {
8+
"version": "detect"
9+
}
10+
},
11+
612
"env": {
713
"es6": true,
814
"react-native-globals/all": true,
15+
},
16+
17+
"rules": {
18+
"import/named": "off"
919
}
1020
}

.flowconfig

Lines changed: 0 additions & 80 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
# VSCode
99
.vscode/
10-
tsconfig.json
1110
jsconfig.json
1211

1312
# Xcode
@@ -51,3 +50,6 @@ android/keystores/debug.keystore
5150

5251
# Build
5352
dist/
53+
54+
# generated by bob
55+
lib/

.release-it.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
2-
"increment": "conventional:angular",
3-
"changelogCommand": "conventional-changelog -p angular | tail -n +3",
4-
"safeBump": false,
5-
"src": {
2+
"git": {
63
"commitMessage": "chore: release %s",
74
"tagName": "v%s"
85
},
@@ -11,5 +8,10 @@
118
},
129
"github": {
1310
"release": true
11+
},
12+
"plugins": {
13+
"@release-it/conventional-changelog": {
14+
"preset": "angular"
15+
}
1416
}
1517
}

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ export default createMaterialBottomTabNavigator({
4545
});
4646
```
4747

48-
For more info, see: https://github.com/react-navigation/react-navigation-tabs
49-
5048
## Docs
5149

5250
Documentation can be found on the [React Navigation website](https://reactnavigation.org/docs/material-bottom-tab-navigator.html).

__setup__/enzyme.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

commitlint.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* eslint-disable import/no-commonjs */
2+
3+
module.exports = {
4+
extends: ['@commitlint/config-conventional'],
5+
};
Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,54 @@
11
import * as React from 'react';
2-
import Expo from 'expo';
2+
import { StyleSheet } from 'react-native';
3+
import { registerRootComponent } from 'expo';
4+
import { Asset } from 'expo-asset';
35
import {
46
FlatList,
57
createAppContainer,
6-
createStackNavigator,
8+
NavigationScreenProp,
79
} from 'react-navigation';
10+
import {
11+
createStackNavigator,
12+
Assets as StackAssets,
13+
} from 'react-navigation-stack';
814
import { List, Divider } from 'react-native-paper';
915

10-
// eslint-disable-next-line import/no-unresolved
11-
import { Assets as StackAssets } from 'react-navigation-stack';
12-
1316
import SimpleTabs from './src/SimpleTabs';
1417
import ShiftingTabs from './src/ShiftingTabs';
1518
import IconTabs from './src/IconTabs';
1619

17-
Expo.Asset.loadAsync(StackAssets);
20+
Asset.loadAsync(StackAssets);
1821

1922
const data = [
2023
{ component: ShiftingTabs, title: 'Shifting', routeName: 'ShiftingTabs' },
2124
{ component: SimpleTabs, title: 'Simple', routeName: 'SimpleTabs' },
2225
{ component: IconTabs, title: 'Icons only', routeName: 'IconTabs' },
2326
];
2427

25-
class Home extends React.Component {
28+
type Props = {
29+
navigation: NavigationScreenProp<any>;
30+
};
31+
32+
type Item = { title: string; routeName: string };
33+
34+
class Home extends React.Component<Props> {
2635
static navigationOptions = {
2736
title: 'Examples',
2837
};
2938

30-
_renderItem = ({ item }) => (
39+
_renderItem = ({ item }: { item: Item }) => (
3140
<List.Item
3241
title={item.title}
3342
onPress={() => this.props.navigation.navigate(item.routeName)}
3443
/>
3544
);
3645

37-
_keyExtractor = item => item.routeName;
46+
_keyExtractor = (item: Item) => item.routeName;
3847

3948
render() {
4049
return (
4150
<FlatList
42-
style={{ backgroundColor: '#fff' }}
51+
style={styles.container}
4352
ItemSeparatorComponent={Divider}
4453
renderItem={this._renderItem}
4554
keyExtractor={this._keyExtractor}
@@ -51,7 +60,12 @@ class Home extends React.Component {
5160

5261
const MainStack = createStackNavigator({
5362
Home,
54-
...data.reduce((acc, it) => {
63+
...data.reduce<{
64+
[key: string]: {
65+
screen: React.ComponentType;
66+
navigationOptions: { title: string };
67+
};
68+
}>((acc, it) => {
5569
acc[it.routeName] = {
5670
screen: it.component,
5771
navigationOptions: {
@@ -64,4 +78,12 @@ const MainStack = createStackNavigator({
6478
});
6579

6680
const App = createAppContainer(MainStack);
67-
Expo.registerRootComponent(App);
81+
82+
// @ts-ignore
83+
registerRootComponent(App);
84+
85+
const styles = StyleSheet.create({
86+
container: {
87+
backgroundColor: '#fff',
88+
},
89+
});

0 commit comments

Comments
 (0)