Skip to content

Commit c3672cf

Browse files
Jukkishthymikee
authored andcommitted
feat: compile to ES5 for publishing (#50)
### Summary Fixes #49
1 parent a052349 commit c3672cf

File tree

5 files changed

+271
-8
lines changed

5 files changed

+271
-8
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
flow-typed/
2+
build/

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
*.log
33
.eslintcache
4+
build

package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
"name": "react-native-testing-library",
33
"version": "1.4.0",
44
"description": "Simple React Native testing utilities helping you write better tests with less effort",
5-
"main": "src/index.js",
5+
"main": "build/index.js",
66
"typings": "./typings/index.d.ts",
77
"repository": "[email protected]:callstack/react-native-testing-library.git",
88
"author": "Michał Pierzchała <[email protected]>",
99
"license": "MIT",
1010
"private": false,
1111
"devDependencies": {
12+
"@babel/cli": "^7.1.2",
1213
"@babel/core": "^7.1.2",
1314
"@babel/runtime": "^7.1.2",
1415
"@callstack/eslint-config": "^3.0.0",
@@ -21,6 +22,7 @@
2122
"dedent": "^0.7.0",
2223
"eslint": "^5.6.1",
2324
"flow-bin": "^0.86.0",
25+
"flow-copy-source": "^2.0.2",
2426
"jest": "^23.6.0",
2527
"metro-react-native-babel-preset": "^0.49.0",
2628
"react": "16.6.1",
@@ -42,7 +44,10 @@
4244
"flow-check": "flow check",
4345
"typescript-check": "tsc --noEmit --skipLibCheck --jsx react ./typings/__tests__/*",
4446
"lint": "eslint src --cache",
45-
"release": "release-it"
47+
"release": "release-it",
48+
"prepublish": "yarn build && yarn copy-flowtypes",
49+
"copy-flowtypes": "flow-copy-source --ignore __tests__/*.js src build",
50+
"build": "rm -rf build; babel src --out-dir build --presets=module:metro-react-native-babel-preset --ignore 'src/__tests__/*'"
4651
},
4752
"jest": {
4853
"preset": "react-native"

src/__tests__/renderRNComponents.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class RNComponents extends React.Component<*> {
2626
<Text>t2</Text>
2727
<Text>t3</Text>
2828
</TouchableOpacity>
29-
<ActivityIndicator show />
29+
<ActivityIndicator />
3030
</ScrollView>
3131
</Modal>
3232
</View>

0 commit comments

Comments
 (0)