This is an exploratory project using Turborepo and pnpm to create a monorepo working environment for multiple applications and a shared common core library (or set of libraries.
You'll need PNPM installed.
pnpm is used here based on significant performance gains reported by Jared Palmer from a customer.
pnpm i
pnpm turbo run build
This will build (and cache) the library packages and applications.
You can start the template next.js app:
cd apps/next-product-starter && pnpm run dev
The build command needs to be scoped to the specific project so we aren't building all of the repos for every single run. The -w
flag runs ppm in the root of the project so all projects are built.
build
:
pnpm build -w -- --scope="rust-adventure" --includeDependencies
The install command needs to also add pnpn
and then run install.
install
:
npm i pnpm -g && pnpm i
Because of the way vercel handles monorepo projects, you can only have a single project linked locally at a given time.
In the root of the project:
vercel link
vercel dev
Calling vercel link
asks if you want to link the project (yes), has you pick the account (skillrecordings
), and
finally you enter the project name for the project you are working on.
Repeat this process if you want to work on a different project.
abstracting the complex configuration needed for most monorepos into a single cohesive build system
Turbo is the core of the developer experience that this playground is exploring and provides cohesive logical building of a monorepo that contains many apps and library packages.
It's a closed source paid product that we are excited to use and support.
🦋 A way to manage your versioning and changelogs with a focus on monorepos
Changeset is an Atlassian library that makes releasing library versions a little nicer.
Fast, disk space efficient package manager
performant npm is just what it says it is and a modern evolution of npm/yarn etc that follows the same conventions and gives efficiency in a monorepo environment and can shave a lot of time off of builds.
for integration and e2e testing!
Here's a general tour of Turborepo from Jared:
Some good examples and background in Jared's TSDX monorepo platground.