New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lerna import
fails when package root is repo root
#1872
Comments
I'd be happy to submit a PR for this but I wanted to open this up to feedback first 😄 |
The test coverage is indeed a little sparse around edge cases like this. Make that "completely absent," if I'm being honest. 😅 I don't think anyone anticipated your structure, so a PR is perfectly welcome. :) |
I'm taking a look into a PR for this today |
wavebeem
pushed a commit
to wavebeem/lerna
that referenced
this issue
Jan 18, 2019
wavebeem
pushed a commit
to wavebeem/lerna
that referenced
this issue
Jan 18, 2019
9 tasks
evocateur
pushed a commit
that referenced
this issue
Jan 18, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When we run
lerna import ../mycompany-legacy --flatten
it fails to import because lerna cannot automatically detect our lerna package root.Note that we are keeping our lerna packages at the top level of the git repo and requiring all of them to be prefixed with
mycompany-
. There is no "packages/" directory or similar.Expected Behavior
Expected that lerna would import
mycompany-legacy
into the lerna project root directory.Current Behavior
Possible Solution
The method getPackageDirectories here: https://github.com/lerna/lerna/blob/master/commands/import/index.js#L116-L118
Could be upgraded to return
["."]
or similar in the case where no base directory can be found.Steps to Reproduce (for bugs)
"packages": ["mycompany-*"]
lerna import ../some-other-repo
lerna.json
Context
I'm trying to import another repo into our lerna monorepo. I am going to need to work around the issue by importing the package into a temporary directory and then using
git mv
afterward.Your Environment
lerna --version
npm --version
yarn --version
node --version
The text was updated successfully, but these errors were encountered: