Skip to content

Commit 76ef275

Browse files
jayuwojteg1337
authored andcommitted
docs: add run example scripts and contribution instructions (#127)
1 parent 2688de8 commit 76ef275

File tree

5 files changed

+38
-8
lines changed

5 files changed

+38
-8
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,32 @@ Assigns a single image for the track. Only static images are supported. The cent
263263
| ---------------------- | -------- | -------- |
264264
| Image.propTypes.source | No | iOS |
265265

266+
## Contributing
267+
268+
While developing, you can run the [example app](/example/README.md) to test your changes.
269+
270+
Make sure your code passes Flow, ESLint and the tests. Run the following to verify:
271+
272+
```sh
273+
yarn validate:flow
274+
yarn validate:eslint
275+
yarn test:jest
276+
```
277+
or
278+
279+
```sh
280+
yarn test
281+
```
282+
to run them all.
283+
284+
To fix formatting errors, run the following:
285+
286+
```sh
287+
yarn validate:eslint --fix
288+
```
289+
290+
Remember to cover your changes with tests if possible.
291+
266292
## Maintainers
267293

268294
- [Michał Chudziak](https://github.com/michalchudziak) - [Callstack](https://callstack.com/)

example/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Run the example locally
2+
3+
- Clone the repository
4+
- Run `yarn` to install the dependencies
5+
- Checkout to this directory `cd example`
6+
- Run `yarn run:android` or `yarn run:ios` to start packager and the app

example/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
"name": "example",
44
"version": "0.0.1",
55
"scripts": {
6-
"start": "node node_modules/react-native/local-cli/cli.js start"
6+
"start": "node node_modules/react-native/local-cli/cli.js start",
7+
"run:android": "react-native run-android",
8+
"run:ios": "react-native run-ios"
79
},
810
"dependencies": {
911
"react": "16.9.0",
1012
"react-native": "0.61.2",
1113
"@react-native-community/slider": "./src"
1214
}
13-
}
15+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"workspaces": ["src", "example"],
44
"scripts": {
5-
"validate:eslint": "eslint src",
5+
"validate:eslint": "eslint src example",
66
"validate:flow": "flow check src",
77
"test:jest": "jest src",
88
"test": "yarn validate:eslint && yarn validate:flow && yarn test:jest"

src/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
},
1111
"main": "js/Slider.js",
1212
"types": "typings/index.d.ts",
13-
"scripts": {
14-
"start": "node node_modules/react-native/local-cli/cli.js start",
15-
"start:android": "react-native run-android --root example/"
16-
},
1713
"keywords": [
1814
"react-native",
1915
"react native",
@@ -42,4 +38,4 @@
4238
"type": "git",
4339
"url": "https://github.com/react-native-community/react-native-slider.git"
4440
}
45-
}
41+
}

0 commit comments

Comments
 (0)