Skip to main content

Questions tagged [monorepo]

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

803 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
23 votes
0 answers
3k views

With Yarn workspaces, how can compiled binaries be linked to the workspace post-compilation?

Context Yarn workspaces provide for a convenient mono-repo-like functionality where packages are automatically linked. I.e. they can require/import each other, and their binaries are linked and ...
Tom's user avatar
  • 8,028
20 votes
0 answers
5k views

Typescript pnpm monorepo, path aliases conflicts between local dependencies during build

I have a PNPM with TurbeRepo monorepo, used this template. In this monorepo I have a NextJS app that uses a ui-shared package (local shared code, not actually an npm package). The ui-shared is made in ...
Nikola-Milovic's user avatar
14 votes
1 answer
4k views

lerna link vs. lerna bootstrap

I have a Lerna project which until recently was using lerna bootstrap --hoist. This worked well but I found the devDependencies in the many sub folders were mostly identical. Upgrading to Lerna v3 I ...
user2965155's user avatar
12 votes
1 answer
1k views

How can i Deploy a single npm workspace which depends on packages and other workspaces?

I created a project using npm workspaces and Typescript Project References pretty much exactly like this example repo: https://github.com/Quramy/npm-ts-workspaces-example. This setup keeps all ...
Jeremias Nater's user avatar
12 votes
2 answers
9k views

How to use Turborepo for an existing react app created with Create React App in order to make it a monorepo?

I have a fun project made with create react app. I want to convert the same application to a browser extension. This idea forces me to make the project a mono repo. Because in both applications, I ...
cooskun's user avatar
  • 628
11 votes
1 answer
4k views

Managing a Python Monorepo in PyCharm

I'm experimenting with monorepos & python. The idea is having multiple projects in the same repo, each project should have its own virtualenv. I find it kinda cumbersome managing all of that in ...
orlevii's user avatar
  • 487
11 votes
0 answers
3k views

How to generate per-package package-lock.json for existing Lerna mono-repo

We have an existing Lerna mono-repo that has a structure like: / /packages /package1 /package2 /package3 ... We currently use Yarn for our project, and actually only have a top-...
Matthew Herbst's user avatar
10 votes
0 answers
1k views

create-react-app + gatsby packages in monorepo won't both run

I'm trying to create a monorepo with these packages: a web app created using create-react-app a gatsby site a library of components etc. that the web app and gatsby app will share (which is my main ...
toranpetto's user avatar
10 votes
0 answers
702 views

Deploying yarn workspace monorepo app with internal dependencies to Google App Engine

I want to deploy my app from my monorepo to GAE. The app depends on local packages that I pre-publish to github packages. To make life easy, I just tell my app to always get latest: "...
FrozenKiwi's user avatar
  • 1,483
10 votes
0 answers
860 views

How do you share uncompiled typescript between React Native and Next.js in a monorepo?

I have settled a monorepo with Lerna and Yarn Workspaces with this structure: project | - packages | - ReactNativeApp | - NextJsApp | - FirebaseCloudFunctions | - Common | - ...
Xiiryo's user avatar
  • 3,207
9 votes
1 answer
2k views

Running ESLint in project subdir yields "heap out of memory"

If I run eslint . from my project-root, it prints all errors and warnings to the console, as I would expect it to. However, when I cd into a subdirectory of the project, eslint . yields the following ...
Tim Hilt's user avatar
  • 654
9 votes
0 answers
785 views

Importing files in subdirectories when using Yarn Workspaces and Typescript

I'm having trouble porting a Yarn Workspaces monorepo to TypeScript. In the previous working version of the monorepo, moduleA could import something from a subdirectory of moduleB. The new ported code ...
shennan's user avatar
  • 11.4k
9 votes
0 answers
361 views

Monorepo + Pipelines: Can't specify buildpacks for review apps, and app.json can't be in the project root

I'm trying to set up a pipeline for my Monorepo structure similar to this: > yarn.lock > package.json > packages > my-heroku-app > app.json > Procfile ...
Nazaire's user avatar
  • 195
9 votes
1 answer
23k views

TypeScript: Error: Cannot find module when using paths

I have a monorepo containing the Back-end(NodeJS), Front-end(Angular) and Shared directory (container models shared by the front-end and back-end.) preagree-mono/ preagree-api/ preagree-app/ ...
Aaron Nebbs's user avatar
8 votes
0 answers
2k views

Lerna avoid symlink

I'm using the below command lerna bootstrap --hoist I want lerna to install all dev and prod dependencies of the packages to the main root node_modules. Some packages are dependencies of each other. ...
javauser35's user avatar
  • 1,255
8 votes
2 answers
10k views

Jest: "Directory in the roots[0] option was not found"

I am trying to set up monorepo to run all of its Jest tests at once. In each package, I'm using react-app-rewired to get Babel to transpile code imported from other packages without ejecting from ...
mrwnt10's user avatar
  • 1,334
7 votes
1 answer
2k views

How to setup lint-staged with turbo monorepo?

I have a turbo monorepo, with packages/... and apps/app-a, apps/app-b . I have set up husky pre-commit hook, which will run pnpm dlx lint-staged I want lint-staged to run lint script from the closest ...
Nez Nez's user avatar
  • 103
7 votes
0 answers
3k views

When using npm workspaces, how to force a package to be installed in the relative node_modules?

Here are some related questions: When using yarn workspaces, how to force a package to be installed in the relative node_modules? NPM 7 Workspaces - Multiple node_modules? Should I have to use no-...
TrumanGao's user avatar
7 votes
2 answers
8k views

How to use monorepo packages with nestjs using turborepo?

Here's what a real simple monorepo with nestjs using turborepo looks like: . ├── README.md ├── apps │   └── nest │   ├── README.md │   ├── nest-cli.json │   ├── package.json │   ├── ...
SugarMouse's user avatar
7 votes
0 answers
789 views

How to pass arguments to filtered workspaces separately using Turborepo?

My use case is, I have two workspaces say foo and bar, and I want to pass the different command line args, is it possible to achieve such functionality with Turborepo. I want to do something like this:...
Victordanny's user avatar
7 votes
0 answers
1k views

Command to build/run typescript project with NX

I am trying to run typescript file (within an app) that depends on a couple libraries with NX but I can not figure out how to do it. I've tried numerous methods, here are a couple ways I tried: First ...
David Van Isacker's user avatar
7 votes
1 answer
2k views

"Error: Invalid hook call." when importing React component from shared component library in monorepo (turborepo & npm workspaces)

I've been setting up a monorepo with the goal of creating a shared component library to use for several different Next.js apps (following this example) but whenever I import a component from the ...
jbaumann's user avatar
  • 211
7 votes
0 answers
2k views

how can i use absolute paths in same library in NX monorepo

I am working on Nx monorepo. We have 5 library and are using imports like this '../../components/Button' in library. but instead of this, we want to use absolute imports. For example: there are 2 ...
efdali's user avatar
  • 71
7 votes
2 answers
4k views

TypeScript tsc type check with references in monorepos

I'm using Yarn Workspaces, and I want a cli-command to check the types of my source ts files located at packages/*. Originally I build my project by using webpack (with esbuild, which does not check ...
swwind's user avatar
  • 155
7 votes
0 answers
620 views

Deduplicating assets in a monorepo

My file structure is as follows: - packages - app1 - node_modules - shared - public - svg1 - src/pages - app2 - node_modules ...
slider's user avatar
  • 2,766
7 votes
1 answer
1k views

Install Python package from monorepo

We have a private git monorepo which hosts a number of Python packages. Poetry was the dependency management tool initially chosen for the project. Anyway, due to this Poetry issue, it would not be ...
hblanco's user avatar
  • 126
7 votes
0 answers
2k views

Force Hoisting Of Package Dependencies In Yarn (v1) Workspace

I have a monorepo containing many packages. It is using yarn(v1) workspaces. One of the packages contains a set of development dependencies (packages/example-dev/@example/dev) that are consumed as a ...
Undistraction's user avatar
7 votes
0 answers
4k views

Connect local packages in monorepo with lerna

I'm trying to setup a Monorepo with Lerna and yarn workspaces, but the thing that I cannot get to work is where I try to add packages as a dependency of an other local package So, what does that mean ...
Jeanluca Scaljeri's user avatar
7 votes
0 answers
7k views

Passing all node_modules path to AWS CodeBuild cache

Currently I'm using AWS CodeBuild to deploy my monorepo project and I'm trying to use its cache properties. I want to cache my node_modules folder and my buildspec.yml is: version: 0.2 phases: ...
Pedro Arantes's user avatar
7 votes
0 answers
629 views

How do I get Heroku CI to run tests when using a monorepo?

I have a nodejs app in a subdirectory called node-server of a monorepo project. I was able to leverage heroku-buildpack-monorepo project to allow me to deploy just the node-server directory to ...
Javid Jamae's user avatar
  • 8,921
6 votes
0 answers
1k views

Turborepo preparing engine: Could not find "___ROOT___#build" in root turbo.json

When i run yarn build i get this error : ERROR run failed: error preparing engine: Could not find "___ROOT___#build" in root turbo.json Turbo error: error preparing engine: Could not find &...
Samyar's user avatar
  • 481
6 votes
0 answers
854 views

Can I publish only a subset of packages in one Turborepo, using Changesets?

As seen in the Turborepo docs, the monorepo can include internal packages in order to share code between apps inside the monorepo. There is also a docs section on how to publish packages in a monorepo,...
Magnus's user avatar
  • 7,461
6 votes
0 answers
530 views

Eslint not working in VSCode for Next.js in a monorepo setup

I have a monorepo project for a full stack application. Two services that I'm working on right now are NestJs API and Next.js ssr/frontend. My folder structure is as follows: services/ api-main/ ...
Koy's user avatar
  • 608
6 votes
0 answers
563 views

Create Common Shared Pages Working With Next JS and Turborepo

I have a monorepo created with turborepo which contains two next.js apps. The structures is as follows base |---apps | |---editor | | |---pages | | |---index.js //this file is ...
Vipul Rajan's user avatar
6 votes
0 answers
961 views

What is the convention for using symbols like @, ~, #, etc. for path aliases in TypeScript

In a recent project, in the tsconfig.json, I found path aliases using the symbol @. { "compilerOptions": { "target": "es5", ... "baseUrl": ".&...
EternalObserver's user avatar
6 votes
0 answers
936 views

How to use local resolutions in yarn workspaces?

I have a monorepo based on yarn workspaces, with two projects, A and B. Both projects depend on the foo package. I would like to create a resolution in the parent package.json file (since resolutions ...
Ruben Aguilar's user avatar
6 votes
1 answer
4k views

How to publish yarn workspace with root package.json dependencies?

I'm trying to publish one (yarn) workspace from a monorepo to npm repository, and include root project's dependencies in the published package. The setup is as follows: package.json (contains shared ...
skrat's user avatar
  • 5,552
6 votes
0 answers
1k views

How to include 3rd party dependencies in Nx library

New to Nx and not sure yet when it makes sense to extract code into libraries... Is it possible/does it make sense to build an Nx library using a 3rd party dependency (let's say angular material) and ...
Patric's user avatar
  • 1,549
6 votes
0 answers
1k views

Wrong dependency is getting picked up in monorepo and with yarn workspaces

We just started to use monorepo and yarn workspaces for two of our main projects. One is originally built on Angular 11 and another is in React. We set up yarn workspaces, and on one project (Angular) ...
Alex A.'s user avatar
  • 2,557
6 votes
0 answers
2k views

Creating a usable library on npm... with yarn workspaces

I'm looking for feedback on a pattern I coded while tinkering around. Context I'm creating a package for my company, which going to be released publicly. The DX (Developer Experience) is the most ...
y_nk's user avatar
  • 2,234
6 votes
0 answers
198 views

How to automate publish in a CI environment?

We are using lerna to manage a monorepo and we want to automate the publishing process: The developer makes changes in one of the packages in the monorepo The CI detects that changes have been made ...
abnormi's user avatar
  • 668
6 votes
0 answers
1k views

lerna not generating node_module in packages

I have a monorepo with Lerna and typescript with a basic structure - root package.json - packages package-A package.json src package-B package.json ...
AngularDebutant's user avatar
6 votes
0 answers
3k views

typescript monorepo "@/*" alias

I'm moving my projects to a monorepo with Lerna and yarn workspace. I managed to setup the basic stuffs but I'm stuck with this issue and can't find similar problem on the web. As you can see on the ...
jeremy castelli's user avatar
6 votes
1 answer
1k views

Is there any way to avoid symlinking in monorepo built with yarn workspaces and lerna?

Lets say there is a monorepo with package A and B. Package A is dependent on B. Package B is also published in npm registry. So when installing dependencies it does not install the package B from npm ...
tofaelahmed's user avatar
6 votes
0 answers
496 views

How do I use ES6 imports in Detox tests with Yarn Workspaces?

I have already integrated Detox to my react native project (using yarn workspaces) and it works ok. But when I want to use import syntax the tests fail. This is the error: import { linkBarTest } ...
Andy Esp's user avatar
6 votes
0 answers
803 views

How to do group permissions in a Monorepo on Github

So we moving over to a monorepo structure and I'm left with the problem of how to restrict access to individual components within the repo on a team by team basis. There isn't a feature on github(yet) ...
CoderWhoSaysNie's user avatar
5 votes
0 answers
491 views

How to manage databases in a NX workspace

What is the best practice for managing databases in NX? I am using Knex migrations to manage the schema of a database and would like to add this to the NX monorepo to simplify development, deployment, ...
Jonah's user avatar
  • 111
5 votes
0 answers
543 views

Bundle Prisma Client in a module

I'm having questions, on prisma generated clients, maybe I'm doing things wrong. I Have a monorepo with the following modules dependency tree: Module A - |- Module C Module B - Module A ...
Quadear's user avatar
  • 487
5 votes
0 answers
740 views

How to use two different React versions in a monorepo with Turborepo and avoid conflicts?

I'm creating a monorepo using Turborepo and have two applications in my apps folder: app-x, which uses "react": "17.0.2", and app-y, which uses "react": "18.0.2"...
Nightcrawler's user avatar
  • 1,061
5 votes
1 answer
1k views

Error: Cannot find module '@nrwl/workspace/src/utilities/perf-logging'

I have try run Angular project of nxMonrepo and I have already install all node_modules and it didnot show any error when I try to run PS C:\Users\Dell\Desktop\MEANAPP\EAAPP> nx migrate --run-...
Abdul Haseeb's user avatar

1
2 3 4 5
17