Skip to content

Commit

Permalink
Merge pull request #17 from FrankIglesias/development
Browse files Browse the repository at this point in the history
Corrected run script, readme and added husky tasks
  • Loading branch information
FrankIglesias authored Mar 15, 2018
2 parents c13f33f + 8453591 commit 5466016
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ wolox-react-bootstrap

## Prerequisites

React: https://facebook.github.io/react/docs/getting-started.html
node & npm: https://github.com/creationix/nvm#install-script
yarn: https://yarnpkg.com/lang/en/docs/install/#alternatives-tab
- [React](https://facebook.github.io/react/docs/getting-started.html)

- [Node (minimum version: 6.2.0) and npm](https://github.com/creationix/nvm#install-script)

- [Yarn](https://yarnpkg.com/lang/en/docs/install/#alternatives-tab)

- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)


## TL;DR

You don't need to clone this repository. Just run the following in your terminal:

1- bash <(curl -s https://raw.githubusercontent.com/Wolox/react-bootstrap/development/run.sh) folderName
1- bash <(curl -s https://raw.githubusercontent.com/Wolox/react-bootstrap/development/run.sh) githubRepo

2- Track and add or delete comment lines: with: // TODO Add this if you need it with: // TODO import your {..}

3- Add .env with your API_BASE_URL
10 changes: 6 additions & 4 deletions generators/app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@
"react-scripts": "^1.0.13"
},
"scripts": {
"lint": "./node_modules/eslint/bin/eslint.js src",
"precommit": "npm run lint-diff",
"start": "./node_modules/react-scripts/bin/react-scripts.js start",
"build": "./node_modules/react-scripts/bin/react-scripts.js build",
"test":
"./node_modules/react-scripts/bin/react-scripts.js test --env=jsdom",
"eject": "./node_modules/react-scripts/bin/react-scripts.js eject",
"deploy": "npm run build"
}
"deploy": "npm run build",
"lint": "./node_modules/eslint/bin/eslint.js src",
"lint-fix": "./node_modules/eslint/bin/eslint.js src --fix",
"lint-diff": "git diff --name-only --cached --relative | grep \\.js$ | xargs eslint",
"precommit": "npm run lint-diff"
},
}
13 changes: 13 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ system_has() {
type "$1" > /dev/null 2>&1
}

currentnodeversion="$(node --version)"
requirednodeversion="v6.2.0"
if ! system_has git; then
echo "git is mandatory to continue"
echo "Check this guide to complete the installation: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git"
Expand All @@ -18,10 +20,16 @@ elif ! system_has node; then
echo "- https://github.com/creationix/nvm#install-script"
echo "- https://github.com/creationix/nvm#usage"
exit 1
elif [ "$(printf '%s\n' "$requirednodeversion" "$currentnodeversion" | sort -V | head -n1)" != "$requirednodeversion" ]; then
echo "The node version must be >= v6.2.0"
exit 1
elif ! system_has yarn; then
echo "Yarn is mandatory to continue"
echo "Check this guide to complete the installation: https://yarnpkg.com/lang/en/docs/install/#alternatives-tab"
exit 1
elif [[ $PATH != *"$HOME/.yarn/bin"* ]]; then
echo "Yarn global bin path must be cointained inside PATH varible"
exit 1
fi


Expand All @@ -36,6 +44,11 @@ yarn global add package-json-merge > /dev/null 2>&1
package-json-merge package.json packageB.json > packageA.json
mv packageA.json package.json
rm packageB.json
git init

if ! [[-z "$1" ]]; then
git remote add origin $1
fi
yarn && yarn start

wait $!
Expand Down

0 comments on commit 5466016

Please sign in to comment.