Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

egghead.io

Introduction to Monorepos with NPM Workspaces

via egghead.io

Overview

The construction and configuration of your projects can be the difference between a productive or non-constructive experience for you and your team.
As your applications scale and you accrue more projects, having a place to consolidate everything can be very beneficial.
Sharing custom libraries across projects gets complicated when you have to publish each of them online with NPM or the equivalent. Fixing issues that affect multiple repos means fixing issues and pulling repos multiple times. Plus, testing each repo individually can be time-consuming.
Monorepos smooth out the rough edges when managing all of your projects.
A Monorepo is a group of distinct projects that live in the same repository. Because they live in the same place code sharing across projects becomes much easier.
Code in a monorepo, regardless of library, is available for everyone at every time. If you are a front-end engineer, and you're working on the blog application and you see that there is a bug in the backend application, you can go and fix it right away.
You don't have to clone a different repo. You don't have to open a pr in a different repository. All that you have to do is open the backend application, fix the bug, and then push a fix, and it will fix the bug for every other application that uses it.
This course is perfect place to start if you have multiple repositories that are interlinked or want to learn about monorepos. If you haven't worked with monorepos before, there are special considerations that you'll learn about like how to run multiple projects at the same time or what to do when you need to add a project.
In Alejandro's course, you’ll learn about monorepos and how to:
run scripts for all of your projects at the same time
create a TS library to share logic
check for errors in all the projects at the same time
Take Introduction to Monorepos with NPM Workspaces

Syllabus

  • What are Monorepos
  • Configure NPM Workspaces in your Package.json
  • Install a Next.js and a Vite.js Applications Into a Monorepo
  • Add a TypeScript library to your Monorepo using TSUP
  • Run App Specific Commands in a Monorepo
  • Install Dependencies for Specific Packages in a Monorepo
  • Run Dev Scripts for All Packages Simultaniously
  • Share Code Between a Library and Applications Inside a Monorepo
  • Running Quality Checks in your Monorepo
  • Intro to Monorepos with NPM Workspaces Outro

Taught by

Alejandro Ñáñez

Reviews

4.6 rating at egghead.io based on 95 ratings

Start your review of Introduction to Monorepos with NPM Workspaces

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.