Node.js Web Prototype
Web prototype build with Node.js, React, Redux, React-Router v4, Redux-JsonApi.
Setup and run locally
- Make sure you have node.js and yarn installed
- Clone the repo
yarn buildto build the app
yarn startto start the Node server. You can reach it on http://localhost:9000/new You can disable prerendering with
yarn start --prerender=false.
- For development, run
yarn devto run the dev server. It will watch changes and hot reload. Open it on http://localhost:8080/new
You can run all tests with
yarn test. Run a specific test with
yarn test [filePath].
Build the library package and use it in mojo (integration/staging/production)
- Merge your PR and wait for the new release from semantic-release
moda-web-libraryin your mojo PR and merge it
Build the library package and use it in mojo (sandbox)
- Publish a pre-release (e.g.
npm publish --tag pre.
- Update package.json in mojo with the new version and push your branch.
- Your sandbox now should have the new version of moda-web-librar
Build the library package and use it in mojo (development)
- Make sure you have yalc installed globally:
npm install --global yalc
yalc add moda-web-libraryin mojo
- Start the rails server
- After you're done with development, run
yalc remove moda-web-libraryin mojo
Generating types for Apollo
yarn apollo:types:generate to re-generate the Apollo types in
Using the linter
Running the linter from console is as simple as running
To autofix formatting errors, run
Setting up linter in your editor
Most editors have plugins which can highlight lint errors in real time, and autoformat using jsPrettier. The setup is different for each editor, I will provide a guide for SublimeText v3.