packages
folder can we installed using pnpm like any package we install from the NPM repository.
/apps
folder.
apps
folder represent the individual apps that we have in the monorepo.
/apps
folder by just installing them with pnpm.
Turborepo build dependencies makes using these packages super easy as you can add a build dependency of the package to the build/dev script of the app, so the packages are transpiled in real-time.
For example:
We share the TS-Rest contracts between apps i.e. the frontend and the backend.
For this we use a shared package /packages/contract
which is installed in both all the apps that we want. Now we can import any code from these packages like we do for any other package installed by NPM.
@repo
prefix by default, you can change that to anything that you like. For example @rapid/db
etc.
To do this, just find and replace all instances of @repo
to your desired name.
@
is encouraged as it helps with scoped packages. Learn More.