Questions tagged [monorepo]

A monorepo is a single repository containing more than one project (in contrast to the single-repository-per-project approach).

This definition is reduced from the Atlassian blog entry:

Definitions vary, but we define a monorepo as follows:

  • The repository contains more than one logical project (e.g. an iOS client and a web-application)
  • These projects are most likely unrelated, loosely connected or can be connected by other means (e.g via dependency management tools)

(for more, click on their link). Monorepos are not limited to ; any system can hold a monorepo.

1307 questions
55
votes
1 answer

the difference between nx and Lerna ? (monorepos)

hello i'm in new in monorepos world and i'm now searching about different monorepos tools and i found two intersting tools Nx(nrwl) and lerna but i didn't understand the real differnce between these two tools so any help and thanks
anis khalfaoui
  • 779
  • 1
  • 6
  • 12
52
votes
4 answers

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

We are currently looking into CI/CD with our team for our website. We recently also adapted to a monorepo structure as this keeps our dependencies and overview a lot easier. Currently testing etc is ready for the CI but I'm now onto the deployment.…
33Fraise33
  • 641
  • 1
  • 6
  • 6
35
votes
1 answer

How to version products inside monorepo?

I have been educating myself about monorepos as I believe it is a great solution for my team and the current state of our projects. We have multiple web products (Client portal, Internal Portal, API, Core shared code). Where I am struggling to find…
32
votes
1 answer

How to manage SCSS stylesheets across a monorepo with different libraries sharing variables?

I have an angular monorepo set up via Nrwl and am using Angular Material's theming, which uses SASS. I want the SCSS source files to import at the project level where I'll override default color variables for theming. The problem I'm running into is…
Kevin Beal
  • 10,500
  • 12
  • 66
  • 92
31
votes
5 answers

Sharing a typescript library in a monorepo

I'm trying to setup a monorepo with 3 services sharing some library code. This is the current situation: repo: web pdf/ package.json reference to shared-ts using github url tsconfig.json frontend/ package.json reference to shared-ts…
Corentin S.
  • 5,750
  • 2
  • 17
  • 21
27
votes
1 answer

Peer Dependencies In A Monorepo

When packages in a monorepo have peer dependencies, how should these dependencies be made available to them during development? For example a package at /packages/namespace/alpha/ might have a devDependency of styled-components in its package.json.…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
27
votes
4 answers

nohoist with workspaces still hoisting

Inside my Monorepo I have one packages in which I want all the dependencies inside its node_modules. But whatever I do, it's node_modules remains empty. So, for the purpose of my question I was able to reproduce the issue with the following…
Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333
24
votes
1 answer

Can I exclude directories from GitHub Dependabot?

I have a directory /experiments in my repo which contains - surprise! - experiments. Those usually come with their own package.json which includes dependencies that were up to date at the time I made the experiment but might be outdated by now. I…
Fred
  • 1,103
  • 2
  • 14
  • 35
24
votes
4 answers

Publishing Github packages for a monorepo as part of an organization

I have a Lerna monorepo on Github Enterprise which currently has two npm packages that I'm trying to publish to the Github package registry under the same repo. For reference say they…
MVarrieur
  • 513
  • 1
  • 5
  • 19
23
votes
1 answer

Yarn workspace, react, monorepo issue with conflict library version

I'm experimenting with yarn workspace monorepo. It is consisting of a TestProject created with create-react-app, and a SharedLib1 which is created with create-react-library. TestProject imports code from SharedLib1. The problem being, TestProject…
Xun Yang
  • 4,209
  • 8
  • 39
  • 68
23
votes
3 answers

GitHub Cloud Build Integration with multiple cloudbuild.yamls in monorepo

GitHub's Google Cloud Build integration does not detect a cloudbuild.yaml or Dockerfile if it is not in the root of the repository. When using a monorepo that contains multiple cloudbuild.yamls, how can GitHub's Google Cloud Build integration be…
sabrehagen
  • 1,517
  • 1
  • 13
  • 38
23
votes
2 answers

Install package from lerna-managed monorepo via git URL

I am using yarn for my project. My project has a dependency which happened to be a subpackage of larger monorepo maintained by lerna. The subpackage was updated but not published yet and I need that unpublished code. Is there any way to install…
Max Komarychev
  • 2,836
  • 1
  • 21
  • 32
22
votes
2 answers

Preventing inappropriate imports and enforcing project hierarchy in Typescript

In a TS project I'd like the following to be blocked: A file from folder common importing from folder projectA A file from folder projectB importing from folder projectA I'd like the following to be allowed: A file from folder projectA importing…
Ben Carp
  • 24,214
  • 9
  • 60
  • 72
22
votes
6 answers

Building Typescript: [!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)

I've encountered problem building typescript packages with rollup inside lerna managed monorepo. Error: lerna ERR! rollup --config ../../rollup.config.js stderr: loaded ../../rollup.config.js with warnings (!) Unused external imports terser imported…
Kirill Morozov
  • 493
  • 1
  • 3
  • 12
22
votes
2 answers

How to deploy one app from a large monorepo with dependencies to packages in the same repo to google app engine?

I have a large node.js monorepo with several applications and packages and inter dependencies. It is all managed with yarn workspaces and a little bit of lerna. Everything works great for me, however I am having trouble trying to deploy one of the…
1
2 3
86 87