why does yarn warn when adding a dependency to the root workspaces package.json

Since you are using Yarn Workspaces and it manages the dependencies of all projects (workspaces), you should add dependencies of each project to its own package.json, not the workspace root. Yarn uses only one yarn.lock file that is placed in the workspace root. Also, it tries to move dependencies of all projects to node_modules of … Read more

How to use yarn workspaces with typescript and out folders?

I created a Github Repository to make it easier to follow the following code description: Code Description TypeScript Project References make it possible to compile a TypeScript project that consist of multiple smaller TypeScript projects, each project having a tsconfig.json file. (Source: Project References Documentation) TypeScript Setup We have a root tsconfig.json file that only … Read more

How to build a docker image from a nodejs project in a monorepo with yarn workspaces

I’ve worked on a project following a structure similar to yours, it was looking like: project ├── package.json ├── packages │   ├── package1 │  │  ├── package.json │  │ └── src │   ├── package2 │  │  ├── package.json │  │ └── src │   └── package3 │    ├── package.json │  └── src ├── services │   … Read more