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).

Filter by
Sorted by
Tagged with
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
2 answers
3k views

ddev mount additional folders for shared composer packages

Having a monorepo with multiple ddev projects and a shared composer packages folder, I would like to mount additional folders into the webcontainers. I am trying to develop a set of TYPO3 extensions ...
ksjogo's user avatar
  • 63
6 votes
1 answer
10k views

`pnpm add` within a workspace does not add projects from workspace

I am working with a very simple monorepo with the following structure: .npmrc package.json pnpm-workspaces.yml packages/ package-1/ package-2/ When I cd into package-1, I am trying to add a ...
Ryan Wheale's user avatar
  • 27.6k
6 votes
2 answers
11k views

Is there a better way to build an Angular monorepo app with libraries?

I have several apps in my Angular monorepo project. Also there are about 5 libraries I've written to use across the apps. What I want to know is how to better build/architect these libraries. The ...
Sergey's user avatar
  • 7,536
6 votes
3 answers
7k views

Migrating a Create React App (Webpack) to NX and Vite - URI malformed at decodeURI

This is going to be a tricky one because there's a lot going on in here. Therefore, I'll try to be as succinct as possible not to overload you with too much information. I'm currently in the process ...
Jose A's user avatar
  • 10.8k
6 votes
2 answers
3k views

Can't resolve 'fs' in firebase-admin/lib' when using nextjs monorepo project with lerna

I have a Lerna MonoRepo project setup. Like root/ lerna.json packgae.json package.lock.json packages/ app1 - Create react app (with firebase sdk dependency) app2 - Next Js ...
paritosh raj's user avatar
6 votes
3 answers
7k views

TypeORM migration with nx-Monorepo Issue

I tried this a lot but now I think I need some help. I have a nx-monorepo with angular-frontend and nestjs backend. Now I added a Postgres-SQL database with TypeORM. Everything is working fine, ...
igl1991's user avatar
  • 61
6 votes
1 answer
2k views

Yarn workspace + lerna is creating node_modules in each sub-package

I have a monorepo which I'm managing with yarn workspaces + lerna. From what I understand, running yarn should create a node_modules directory at the root of the project but not in each individual ...
Mark's user avatar
  • 10.6k
6 votes
2 answers
2k views

Webpack Cannot Resolve node_modules lazy assets

I'm working on a vuejs project and we're trying to use external vue cli applications as libraries. In these libraries we want to be able to export a router config, which lazy loads the components ...
Evan Burbidge's user avatar
6 votes
1 answer
6k views

Expo: Cannot resolve entry file: The `main` field defined in your `package.json` points to a non-existent path

I am working with the default typescript template generated from the command line npx create-expo-app -t expo-template-blank-typescript and I get this error when I try to start the project. The main ...
TOPKAT's user avatar
  • 7,989
6 votes
2 answers
656 views

Git worktree performance impact

I've just learned about the git worktree feature. It seems to fit my use-case well: I'm used to having a separate repo clone to do side tasks on. I'm working in a big monorepo with lots of frequent ...
Klas Mellbourn's user avatar
6 votes
2 answers
2k views

What is a correct approach to a javascript monorepo

I'm trying to figure out correct approach for a javascript monorepo. Imagine monorepo containing packages / libraries: root - node_modules - packages + lib-a * node_modules +...
user3056783's user avatar
  • 2,536
6 votes
1 answer
4k views

How Can I Fix VSCode Import Path Suggestions In Lerna Monorepo?

VSCode does a great job with autosuggesting imports, however inside a (Lerna) monorepo it only suggests relative paths from one package to another, for example: import example from '../../../@scope/...
Undistraction's user avatar
6 votes
1 answer
2k views

Is lerna bootstrap command useful when using yarn workspace

I'm using lerna in combination with yarn workspaces. In that case, all the package hoisting and symlinking is handled by yarn workspaces. In that particular case, what's the role of the lerna bootsrap ...
Clement's user avatar
  • 4,010
6 votes
2 answers
906 views

Pointing the main field in package.json conditionally

I have a Monorepo under Lerna and Yarn Workspaces. The repo has packages which are published to npm and consumed outside the monorepo as well as within the monorepo. While developing in the monorepo ...
Hamid Aghdaee's user avatar
6 votes
5 answers
981 views

How To Implement a Buildless Pipeline in a TypeScript Monorepo

suppose I have this monorepo: /apps /apps/app1 /apps/app1/src (contains index.ts and many other files and subfolders here) /apps/app1/tsconfig.json /apps/app1/package.json /apps/app2 /apps/app2/src ...
Alex's user avatar
  • 67.5k
6 votes
2 answers
2k views

Target monorepo root directory in jest config within monorepo package

I have the following file structure in my monorepo 📦monorepo ┣ 📂node_modules ┣ 📂packages ┃ ┣ 📂package-1 ┃ ┃ ┗ 📜jest.config.js ┃ ┣ 📂package-2 ┃ ┃ ┗ 📜jest.config.js ┃ ┣ 📂package-3 ┃ ┃ ┗ �...
mcclosa's user avatar
  • 1,285
6 votes
2 answers
9k views

How to share SASS styles between libs inside my NX monorepo?

I'm trying to build a component library for angular and react. That's why I want to use the same styles(sass) for both libs. I created a separate folder for my styles and included my main sass inside ...
Safiul islam's user avatar
6 votes
1 answer
4k views

Turborepo -- how to nest applications in the 'apps' folder or different top-level directory?

I'm trying to create a turborepo that contains several types of infrastructure like terraform, potentially 100+ 'serverless' functions. Ideally, I'd like to organize them a bit more into a subfolder ...
SebastianG's user avatar
  • 9,217
6 votes
2 answers
9k views

Nrwl Nx and monorepo - handle package.json for particular apps

for a frontend architecture I'm evaluating the usage of monorepo with Nrwl Nx. I understood from the docs that Nx strongly recommends the single-policy for dependencies (a root package.json with all ...
diego.gazzola's user avatar
6 votes
1 answer
704 views

Optimal usage of codecov in a monorepo context with separate flags for each package

I was just wondering what’s the best way to configure codecov for a monorepo setting. For example, let’s say I have packages A and B under my monorepo. The way I’m currently using codecov is by using ...
Devorein's user avatar
  • 1,259
6 votes
2 answers
3k views

How to do code sharing in NestJS through Yarn Workspaces

I'm trying to do a proof of concept for a simple monorepo application. I decided to just use Yarn Workspaces (I think Lerna maybe here is overkill) to set up my package architecture. I have a shared ...
Alfonso's user avatar
  • 1,275
6 votes
1 answer
2k views

with lerna monorepo, how to reference different versions of a shared package?

New to lerna and monorepo, my understanding is with lerna, we put all shared packages and all consumer packages in a single repo. Then after 'lerna bootstrap', consumer1 and consumer2 will both have a ...
Nan Li's user avatar
  • 593
6 votes
1 answer
2k views

Folder hierarchy in packages - Turbo/Monorepo

Many articles and tutorials teach how to share components in monorepo projects. But they show something in an unproductive way. Share each component (package1, package2) separately in workspace. What ...
rick's user avatar
  • 691
6 votes
1 answer
2k views

Are Webpack 5 Module Federation micro frontends and Nx monorepos mutually exclusive?

I'm investigating micro frontend and monorepo architecture for an Angular 12 project. Webpack 5 recently became production ready and with it, Module Federation, Webpack's solution for micro frontends. ...
Kyle Vassella's user avatar
6 votes
1 answer
3k views

How do you publish and install a private npm package to GitHub packages as an organisation?

We have a monorepo with a shared package called "@myorganization/common", that is used by both the app and Google cloud functions. Google cloud functions requires that the package is ...
Xiiryo's user avatar
  • 3,207
6 votes
1 answer
2k views

Dealing with Docker images in a Javascript/Typescript monorepo with unpublished packages

I've been trying to find a clear answer to this problem, but unfortunately I haven't been able to. There are two similar SO questions that touch on this subject, Should a developer be able to create a ...
McFlurriez's user avatar
6 votes
1 answer
956 views

react-native cannot find node_modules that exists. this probably only occurs when I use yarn workspaces

In order to add it I ran the following command: yarn workspace mobile add react-native-webview I literally have looked in the node_modules folders that is specific by the error below and react-...
Kurnal saini's user avatar
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
1 answer
6k views

Monorepo with `rootDirs` produces unwanted sudirectories such as `src` in `outDir`

I am planning a monorepo typescript project like below: / (root) +--backend/ | +-src/ | \-tsconfig.json +--shared/ | \-src/ \--frontend/ \-src/ tsconfig.json is defined like below: { "...
Jeon's user avatar
  • 4,056
5 votes
9 answers
7k views

Angular monorepo error TS6059: File 'ng-youtube-api.service.ngtypecheck.ts' is not under 'rootDir'. 'rootDir' is expected to contain all source files

I've created 3 angular libraries/packages: @example/ng-youtube-player containing a YoutubePlayerComponent and YoutubeApiService @example/ng-dailymotion-player containing a DailymotionPlayerComponent ...
Pieterjan's user avatar
  • 3,526
5 votes
6 answers
7k views

React native monorepo with PNPM

My goal I am trying to use React native monorepo with PNPM, because I need performance of pnpm. Expected I should be able to bundle React native app with pnpm android and start development server with ...
Petr Špác's user avatar
5 votes
6 answers
10k views

NX ERROR - Nx failed to install dependencies

I'm not sure what could be going wrong and the error message is blank whenever I open it. I've searched online for fixes but nothing has helped hence I'm asking here. My version of node is: v16.1.0 My ...
thursdaysboy's user avatar
5 votes
2 answers
9k views

Can Lerna bump prerelease version according to the Conventional Commits specification?

It doesn't seem that Lerna 3.20.2 is able to bump prerelease versions (e.g. 1.0.0-alpha.0) according to the Conventional Commits specification. I made a Minimal Reproducible Example if you want to ...
customcommander's user avatar
5 votes
1 answer
10k views

yarn not installing packages from workspace but instead tries pulling down from npmjs with turborepo

Version: "packageManager": "[email protected]" I have based my project off of the npx create-turbo@latest command. I have eslint-config-custom and tsconfig projects inside my /packages ...
SebastianG's user avatar
  • 9,217

1 2 3
4
5
29