

Changes made by others in other services at different times should not affect the outcome of my build/deploy pipeline. If I merge changes to serviceA and want to run my CI/CD, I'd really only want to run it for that service. There are no other projects in the npm registry using pnpm-isolate-workspace.
#PNPM WORKSPACES CODE#
Instead, pnpm, lerna and IDEs like VS Code use the word 'workspace' for 'a group of related projects'. Indeed, you must configure the workspaces field in package.json. Yarn Workspaces aims to make working with. Start using pnpm-isolate-workspace in your project by running npm i pnpm-isolate-workspace. 23.3k 8 69 88 It's because other package managers (npm and yarn) use the word 'workspace' differently: they call each package in the monorepo a workspace. Late addition: I recommend using pnpm workspaces as first choice. I think the benefits are cool locally but they become kind of a pain in CI/CD?įor example I ran into the following: - repo Latest version: 0.0.9, last published: 2 months ago. Not having to download the same package multiple timesīeing able to run scripts like build and lint across all packages/services/etc. json in the workspace, given a cwd JSON is a data.
#PNPM WORKSPACES INSTALL#
From the package: cd packages/foo pnpm build. So pnpm creates a hard link for each file of the dependency. Yarn Workspaces is a feature that allows users to install dependencies from. From the package: cd packages/foo pnpm start. These seem like cool tools when working locally for a few reasons: Install ( pnpm i from root) Run start to verify that the application works a. I have a monorepo for one of my projects and went ahead and tried out PNPM and NPM workspaces along with Turbo. So right now we not just having faster dependencies installation time but also no conflicts coming from lock file.I don't know what I'm missing here. And one more advantage we got when switched to yarn workspaces that we also switched from npm to yarn what improved the state of the lock file a lot, because with npm package-lock file was updated every time you run npm install, frequent updates of package-lock file were causing very often merge conflicts. When upgrading a dependency intended to be consistent across workspace packages, any blocks under the importers. Next round of evolution was yarn workspaces, we are still using it and are pretty happy with dev experience it provides. Merge conflicts in pnpm-lock.yaml are reduced.

Since they already had the low-level part (package manager), they only added a new module to handle workspaces whenever you have a pnpm-workspace.yaml file in the root level of your project. Its goal was to fill this gap of the easy-to-use and well-maintained monorepo tool we currently have. First we tried out lerna which was fine at the beginning, but later along the way we had issues with adding new dependencies which came out of the blue and were not easy to fix. pnpm Workspaces pnpm introduced workspaces feature on v2. Therefor to keep all code in one place, at the same time keeping in separated in different modules we decided to give a try to monorepo.

This issues would be even more critical when building the project from scratch what we did at Joyn. Previously we had different repositories and it was very hard to keep the development process when changes were done in multiple repositories, as we had to synchronize code reviews as well as merging and then updating the dependencies of projects.
#PNPM WORKSPACES TV#
As we have to build the application for many different TV platforms we want to split the application logic from the device/platform specific code.
