question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lerna : create - handle the case when several packages directories are defined in lerna.json

See original GitHub issue

I have two packages directories in lerna.json :

{
    "packages": [
      "components/*",
      "design-tokens/**"
    ],
    "version": "independent"
}

Expected Behavior

I would want to create a new package in the design-tokens/ directory.

Current Behavior

Using lerna create, the package keeps creating in components/ directory.

Possible Solution

Make some changes around https://github.com/lerna/lerna/blob/285bd7e9dbc2ead8a764e2e64fddb866f70fee86/commands/create/index.js#L59

Steps to Reproduce (for bugs)

I tried :

  • node_modules/.bin/lerna create icons ./design-tokens/
  • node_modules/.bin/lerna create icons "design-tokens/icons"
  • node_modules/.bin/lerna create icons "design-tokens/*" and some variants.
lerna.json

{
    "packages": [
      "components/*",
      "design-tokens/**"
    ],
    "version": "independent"
}

Context

I have two packages directories in lerna.json :

{
    "packages": [
      "components/*",
      "design-tokens/**"
    ],
    "version": "independent"
}

I would want to create a new package in the design-tokens/ directory using the lerna create command.

Your Environment

Executable Version
lerna --version 3.14.1
npm --version 6.4.1
yarn --version VERSION
node --version v10.15.3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
evocateurcommented, May 22, 2019

Yeah, the check is pretty cheesy right now. npx lerna create <pkg> design-tokens should work, in your case. (I’ve used it several times in lerna’s own monorepo with that pattern)

0reactions
github-actions[bot]commented, Jun 17, 2022

Hi Folks 👋

You will have seen in our message above that we at Nrwl are working really hard to bring the lerna repo up to date with what matters most to its community in June 2022.

As previously stated in that message, because we have not heard from the original author of this issue within the last 14 days, we are now automatically closing it.

If any users, including the original author, are still impacted by this issue then we still want to hear from you!

All we ask is that you first update to the latest lerna (5.1.4 at the time of writing) to make sure it is still reproducible, and then fill out one of our new issue templates, providing all the requested details which apply to your situation:

https://github.com/lerna/lerna/issues/new/choose

Many thanks again! 🙏


P.S. Over and above getting to grips with the repo, we have also been hard at work launching a new website, resolving all vulnerabilities, merging exciting new features and reigniting community PR contributions! 🚀

You can read our recent blog post to learn more about what we’ve been up to: https://blog.nrwl.io/lerna-5-1-new-website-new-guides-new-lerna-example-repo-distributed-caching-support-and-speed-64d66410bec7

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lerna Workspaces - Managing Projects With Multiple Packages
Lerna workspace allows to create/manage various packages, like app (react application), web (react.js application), common (common business ...
Read more >
How To Manage Monorepos With Lerna - DigitalOcean
A monorepo is a repository containing a project (or multiple projects) and multiple packages. The folders and packages created here are ...
Read more >
Create a monorepo with Lerna | by Damian Cyrus - Medium
Introduction to Lerna and a example project to create a Lerna repository to manage multiple packages in a structured way.
Read more >
Setting up a monorepo with Lerna for a TypeScript project
Ours will consist of multiple packages for our project, ... This command will create a lerna.json file with a default folder structure in...
Read more >
Managing multiples projects with Lerna and Yarn Workspaces
Later, you will learn how to define more settings in the root package.json . Creating and importing packages​. You have a monorepo, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found