A basic mono repo template using
Build the app / packages
npm run build
Clean the output from the app / packages
npm run clean
Run the app / package with --watch so that it automatically builds on changes to files
npm run dev
Run the app / package lint commands
npm run build
Run Prettier over project
npm run pretty
Run the app / package tests
npm run test
To add a new package to the monorepo.
- Copy
packages/example
to a new folder - example:cp -R packages/example packages/new-package
. - Update the
package.json
for the new package. You will need to change thename
at a minimum but will probably want to update other fields too. - From the project root run
npm i
. This will add the new package to thepackage-lock.json
in the project root.
You should now check that everything works by running the following commands
npm ci
npm run pretty
npm run lint
npm run test
npm run build
During commands 2-5 you should see Turbo running commands for the new package.
To remove a package from the monorepo.
- Remove the folder from in the
packages
folder - example:rm -rf packages/old-package
- From the project root run
npm i
. This will remove the old package from thepackage-lock.json
in the project root.
You should now check that everything works by running the following commands
npm ci
npm run pretty
npm run lint
npm run test
npm run build
During commands 2-5 you should not see Turbo running commands for the old package.