Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TwirlingTechGoddess/dac4f4ec586be1b2cef76a21c255b184 to your computer and use it in GitHub Desktop.
Save TwirlingTechGoddess/dac4f4ec586be1b2cef76a21c255b184 to your computer and use it in GitHub Desktop.
On any npm package you can use -S to save to dependency and -D to save to dev-dependency
-g can be used to install globally
Basic React installs from scratch
npm i -S react react-dom redux react-redux react-router-dom redux-devtools-extension
Basic React installs using create react app
React: create-react-app <name> --use -npm
React/Redux: npm i -S redux react-redux
React-Router: npm i -S react-router-dom
Redux-Devtools Extension: npm i -S redux-devtools-extension
Redux-Thunk: npm i -S redux-thunk
Styling
SCSS: npm i -S node-sass-chokidar npm-run-all
Important scripts to include for using SCSS
"build-css": "node-sass-chokidar src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
"start": "npm-run-all -p watch-css start-js",
"build": "npm-run-all build-css build-js",
Testing
Mocha: npm i -D mocha
Enzyme: npm i -D enzyme enzyme-adapter-react-16
Prop Type: npm i -S prop-types
File Linting
Eslint: npm i -D eslint
Important scripts to use for eslint
"eslint": "./node_modules/eslint/bin/eslint.js ./src/**/**/*.js"
Unique Id generator
Uuid: npm i -S uuid
Test coverage: npm t -- --coverage
Create new React project with all dependencies....
create-react-app <name> --use -npm
then cd into the new app and run ...
npm i -S redux react-redux react-router-dom redux-devtools-extension redux-thunk prop-types node-sass-chokidar npm-run-all uuid
npm i -D enzyme enzyme-adapter-react-16 eslint
then run npm start
If something is broken see if you need to update
brew install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment