Template repository to demonstrate how to set up a monorepo with Flow. Other tools include:
- Babel
- ESLint
- Flow
- Jest
- Lerna
- Prettier
- Rollup
- Terser
- Yarn
Install dependencies
$ yarn
Rename package scope. Search for @yangshun
in the repository and make the following changes:
- Update import statements in
packages
- Update the Jest/Flow config mapping in
jest.config.js
and.flowconfig
├── packages
│ ├── bar
│ │ ├── __tests__
│ │ │ └── bar.test.js
│ │ ├── src
│ │ │ └── index.js
│ │ └── package.json
│ └── foo
│ ├── __tests__
│ │ └── foo.test.js
│ ├── src
│ │ └── index.js
│ └── package.json
└── package.json
yarn build
- Runs rollup on all packages to build bundles for each environmentyarn check-all
- Runs all necessary checks, tests and builds. Useful for CI environmentsyarn clean
- Removes all the rollup bundle directories in each packageyarn flow
- Checks thepackages
directory for Flow violationsyarn prettier
- Formats all the files in all the JS filesyarn prettier:report
- Reports any formatting violations in all the JS filesyarn publish-packages
- Runs Lerna publishyarn lint
- Fixes the ESLint violations in all the JS filesyarn lint:report
- Reports ESLint violations in all the JS filesyarn test
- Tests all the files with Jest