This is my personal, opinionated template for how a nontrivial React app should be organized and configured.
This template is currently in progress.
- Create a new repository from this template: https://github.com/spautz/example-template-app/generate
./scripts/prepare-new-app.shto remove files that the app doesn't need- Find/replace occurrences of
"spautz"and"example-template-app"to match the new repository
This is built on top of react-scripts / create-react-app.
Running yarn install will install everything you need.
Most standard commands and scripts are available: yarn build, yarn clean, yarn test, yarn start,
yarn storybook, etc. See package.json for the full list.
There are also several batch commands to run useful groups of those scripts:
yarn devruns some quick "check the code" tools: prettier, eslint, typescriptyarn dev:readonlyruns the same tools asdev, but in read-only modeyarn allruns all the "check the code + app" tools, including tests and buildsyarn all:readonlyruns the same tools asall, but in read-only modeyarn testis an alias you can switch between watch mode and no-watch mode
For more destructive operations and things outside of the repo:
scripts/clean-everything.shwipes ALL caches and temporary files. This includes global caches, so other projects will be affected.scripts/build-everything.shruns ALL setup and build commands for the project.scripts/full-ci.shdoes some environment checks and then runs a ci script
The opinions and experiences which shaped this template are written up under docs/.