Questions tagged [lerna]

Lerna is a tool designed to help develop JavaScript projects in a single git repo containing multiple related npm packages.

The two primary commands in Lerna are lerna bootstrap and lerna publish.

bootstrap will link dependencies in the repo together. publish will help publish any updated packages.

Related links:

644 questions
11
votes
1 answer

"Lerna List" and "Lerna Changed" Returns 0 Packages

Gist I have a monorepo and I am using yarn workspaces and lerna to manage it. I had no issues with it until now. I need to know all the changed packages since the last release. Issue So I run lerna changed (docs), but this is what it returns: info…
Florian Ludewig
  • 4,338
  • 11
  • 71
  • 137
11
votes
1 answer

How do I share context between a library component, and my application component?

I'm using lerna to create a monorepo where I'd have a structure like this: root packages application - Our root application components - Just some react components, that are to be used by the application Here is a working Github with…
dwjohnston
  • 11,163
  • 32
  • 99
  • 194
11
votes
1 answer

How to Share Build Scripts In Lerna Packages

I have a lerna repo that contains multiple packages organised in the usual structure: package.json /packages - alpha package.json - bravo package.json - charlie package.json I need to transpile all packages, and I currently have…
Undistraction
  • 42,754
  • 56
  • 195
  • 331
10
votes
0 answers

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 reason for using a monorepo). So far I have been…
10
votes
1 answer

Lerna, yarn, and Typescript: Cannot find module or its corresponding type declarations

I have a lerna + yarn workspaces monorepo, with independent versioning. I'm having trouble importing a package in its sibling. I have two packages, one of which should depend on the other, as illustrated below: (root) |--packages |--money …
James
  • 615
  • 1
  • 4
  • 22
10
votes
2 answers

Lerna with watch tasks - lerna run --parallel

I have three packages: A, depends on C B, depends on C C When using lerna run build, C builds before A and B (good!) But when I start a watch task lerna run watch, C never completes and therefor A and B dont get watched. Using lerna run watch…
Mick
  • 8,203
  • 10
  • 44
  • 66
10
votes
1 answer

Configure Lerna to publish NPM packages to private Gitlab repo

I'm doing some tests with Lerna to create a mono-repo with a bunch of packages that I'd like to share with some applications. I've followed Lerna's documentation to setup a project and this is the file structure: - lernatest/ - lerna.json -…
Fel
  • 4,428
  • 9
  • 43
  • 94
10
votes
0 answers

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 | - src > source TypeScript | - lib > compiled…
Xiiryo
  • 3,021
  • 5
  • 31
  • 48
10
votes
2 answers

How to package only the dist folder in a monorepo

I am using lerna and yarn workspaces in my monorepo. The package structure looks like this: root `--- packages |--- pkg1 | |--- src | | `--- index.ts | `--- dist | `--- index.js `--- pkg2 …
Naresh
  • 23,937
  • 33
  • 132
  • 204
10
votes
5 answers

Lerna always lists all packages ready to publish when running workflow of Github actions

Lerna does not correctly detect packages change during running workflow of Github actions. If I make none packages related changes, commit and runlerna updatedlocally. it tells me No changed packages found which is correct and expected. If I make…
eded
  • 3,778
  • 8
  • 28
  • 42
10
votes
3 answers

Debugging a lerna-typescript project in VSCode

I'm trying to build a monorepo using lerna+typescript, I'm using this repo as a start: https://github.com/Izhaki/mono.ts What i'm trying to achieve is to debug the code inside visual studio code. I've tried something to add the launch.json like…
MajinDageta
  • 250
  • 3
  • 14
10
votes
1 answer

Enforcing shared dependencies in a monorepo

We have a monorepo using lerna and yarn workspaces. Multiple teams contribute packages to it and there are some common dependencies where we want to force people to use the same version. What are the options to force all packages to use the same…
adanilev
  • 3,008
  • 3
  • 15
  • 20
10
votes
0 answers

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-level yarn.lock file, with no per-package yarn.lock…
Matthew Herbst
  • 29,477
  • 23
  • 85
  • 128
10
votes
1 answer

separating commit messages between modules of a monorepo

I have a fullstack project like this: myProject packages myProjectCommon myProjectFrontEndApp1 myProjectFrontEndApp2 myProjectBackEnd I use Lerna so that I can use myProjectCommon as an internal dependency. If I…
Lev
  • 13,856
  • 14
  • 52
  • 84
9
votes
1 answer

Lerna not generating package-lock.json for every package

Below is the description of the issue:- Expected behaviour is to have a package-lock.json file generated for every package in packages folder. Current Behaviour My current project structure look…
Vishesh
  • 3,599
  • 4
  • 22
  • 36
1 2
3
42 43