Skip to content

Commit

Permalink
Merge pull request #13 from wordpress-mobile/try/fix-clean-procedure
Browse files Browse the repository at this point in the history
Improve package.json files.
  • Loading branch information
daniloercoli authored Apr 23, 2018
2 parents b42efaf + 613fe9d commit 03f2d99
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 31 deletions.
27 changes: 5 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ GPL v2

## Android: Run the example app

At the root folder, run:
```
$ yarn clean:install
```

Make sure to have an emulator running or an Android device connected, and then:

```
Expand All @@ -25,18 +20,9 @@ This will build the Android library (via `gradle`) and example app, then launch

## iOS: Run the example app

At the root folder, clean the library:
```
$ yarn clean:install
```

Then move to the example folder:
Simply do:
```
$ cd example/
```

Clean the example app and run it:
```
$ yarn clean:install
$ yarn ios
```
Expand All @@ -60,22 +46,19 @@ Q: The example app gets compiled but ReactNative shows an error

A: try running, from the root folder in the project
```
yarn clean
yarn
cd example/
yarn start --reset-cache
$ cd example/
$ yarn start --reset-cache
```

Open a new shell window and run either of these depending on the platform:

```
yarn android
$ yarn android
```

or

```
yarn ios
$ yarn ios
```

12 changes: 6 additions & 6 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"description": "Example for running ponies",
"main": "index.js",
"scripts": {
"install-aztec": "pushd ../ && (yarn install; popd;)",
"start": "node node_modules/react-native/local-cli/cli.js start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "jest",
"clean": "watchman watch-del-all; rm -rf node_modules/ yarn.lock package-lock.json; yarn clean-react; yarn clean-metro; yarn clean-jest; yarn clean-ios;",
"clean-ios": "type xcodebuild &> /dev/null && (xcodebuild -project ./iOS/example.xcodeproj -alltargets clean && rm -rf ./iOS/build);",
"clean-jest": "rm -rf $TMPDIR/jest_*",
"clean-metro": "rm -rf $TMPDIR/metro-cache-*; rm -rf $TMPDIR/metro-bundler-cache-*;",
"clean-react": "rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/react-native-packager-cache-*",
"clean:install": "yarn clean; yarn;"
"clean": "yarn clean-aztec; yarn clean-node; yarn clean-ios;",
"clean-aztec": "pushd ../ && (yarn clean; popd;)",
"clean-ios": "type xcodebuild &> /dev/null && (xcodebuild -project ./ios/example.xcodeproj -alltargets clean && rm -rf ./ios/build);",
"clean-node": "rm -rf node_modules/;",
"clean:install": "yarn clean && yarn install-aztec && yarn install"
},
"dependencies": {
"react": "16.3.1",
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
"version": "0.0.1",
"license": "GPL-2.0",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"clean": "watchman watch-del-all; rm -rf node_modules/ yarn.lock package-lock.json; rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/metro-cache-*; rm -rf $TMPDIR/jest_*",
"clean:install": "yarn clean; yarn; pushd example; yarn; popd"
"clean": "yarn clean-watchman; yarn clean-node; yarn clean-react; yarn clean-metro; yarn clean-jest;",
"clean-jest": "rm -rf $TMPDIR/jest_*;",
"clean-metro": "rm -rf $TMPDIR/metro-cache-*; rm -rf $TMPDIR/metro-bundler-cache-*;",
"clean-node": "rm -rf node_modules/;",
"clean-react": "rm -rf $TMPDIR/react-*; rm -rf $TMPDIR/react-native-packager-cache-*;",
"clean-watchman": "watchman watch-del-all;",
"clean:install": "yarn clean && yarn install"
},
"peerDependencies": {
"react": "16.3.1",
Expand Down

0 comments on commit 03f2d99

Please sign in to comment.