diff --git a/.husky/pre-commit b/.husky/pre-commit index 9a1ab05..1c50108 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -3,4 +3,4 @@ . "$(dirname "$0")/_/husky.sh" -npm run lint && npm run format \ No newline at end of file +npm run format && npm run lint \ No newline at end of file diff --git a/README.md b/README.md index a623918..9cb8e8b 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,10 @@ - Support for Storybook ### Commands -- `yarn install` to install dependencies. +- `./setup.sh` to install dependencies. - `yarn start` to develop locally. - `yarn test` to test and see the code coverage. +- `yarn test:watch` to test in the watch mode. - `yarn build` to create a production build. - `yarn lint` to lint your code using `eslint`. - `yarn start-prod` to serve production build on port `5000`. diff --git a/package.json b/package.json index 3076b3c..5330810 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,12 @@ "private": true, "scripts": { "test": "jest --config jest.config.ts", - "test:watch": "jest --watchAll --config jest.config.ts", + "test:watch": "jest --watchAll --config jest.config.ts --collectCoverage=false", "start": "webpack serve --config webpack.dev.js ", "start-prod": "rm -rf dist && yarn build && npx -y serve dist", "build": "webpack --config webpack.prod.js", "lint": "eslint -c .eslintrc.js --ext .ts src", "format": "prettier --write .", - "postinstall": "husky install", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook", "start-prod-storybook": "yarn build-storybook && npx -y serve storybook-static -l 5858" diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..9df08ae --- /dev/null +++ b/setup.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +echo "Making sure all dependencies are met" + +if ! command -v yarn &> /dev/null; then + echo "Yarn is not installed" + echo "See yarn install docs: https://yarnpkg.com/getting-started/install" + exit 1 +fi + +echo "Installing dependencies ..." +yarn + +echo "Setting up git hooks ..." +yarn husky install + + +echo "Done, run \"yarn start\" and start developing" +exit 0 \ No newline at end of file