A basic mono repo template using
Build the app / packages
npm run buildClean the output from the app / packages
npm run cleanRun the app / package with --watch so that it automatically builds on changes to files
npm run devRun the app / package lint commands
npm run buildRun Prettier over project
npm run prettyRun the app / package tests
npm run testTo add a new package to the monorepo.
- Copy
packages/exampleto a new folder - example:cp -R packages/example packages/new-package. - Update the
package.jsonfor the new package. You will need to change thenameat 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.jsonin the project root.
You should now check that everything works by running the following commands
npm cinpm run prettynpm run lintnpm run testnpm 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
packagesfolder - example:rm -rf packages/old-package - From the project root run
npm i. This will remove the old package from thepackage-lock.jsonin the project root.
You should now check that everything works by running the following commands
npm cinpm run prettynpm run lintnpm run testnpm run build
During commands 2-5 you should not see Turbo running commands for the old package.