Skip to content
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

bootstrap: packages not found after bootstrapping #2052

Closed
anshumanv opened this issue Apr 23, 2019 · 6 comments
Closed

bootstrap: packages not found after bootstrapping #2052

anshumanv opened this issue Apr 23, 2019 · 6 comments
Labels

Comments

@anshumanv
Copy link

anshumanv commented Apr 23, 2019

Packages are not found even after bootstrapping

https://github.com/webpack/webpack-cli

Expected Behavior

Packages should be available once symlinked.

Current Behavior

After running lerna bootstrap, I tried using absolute import and ran into this issue
image

Possible Solution

Steps to Reproduce (for bugs)

  1. lerna bootstrap
  2. npm changed to absolute import by package
lerna.json

{
  "lerna": "3.4.0",
  "packages": [
    "packages/*"
  ],
  "version": "0.1.5"
}

lerna-debug.log

<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->

Context

Your Environment

Executable Version
lerna --version 3.13.1
npm --version 6.4.1
yarn --version 1.12.3
node --version 10.15.3
OS Version
macOS Mojave 10.14.4

Please do lmk if I missed anything, thanks! 😄

@evocateur
Copy link
Member

You shouldn't be using subpath imports like that, especially in a Typescript project (that is, the file path-utils.js does not exist in the leaf package directory).

Also, unclear why a test of a local file is using the absolute package name. That just doesn't make sense, even forgetting the Typescript detour.

@paul-sachs
Copy link

@evocateur just for clarification, what do you mean by not using subpath imports? I'm looking to introduce lerna into our major projects, and I frequently import files nested within our packages:

eg:

import SomeComponent from "@company/lib/components/X";

Where the actual published package is @company/lib. Is it just because @webpack-cli is a monorepo in itself?

@evocateur
Copy link
Member

  1. A test file should import the file it is testing with a relative path.
  2. Sub-path imports tightly couple the internal structure of your package (an implementation detail) to your public API. In most cases, those subpaths should be separate packages (Lerna makes this relatively easy).

@paul-sachs
Copy link

@evocateur I agree that it is not ideal, but it is also currently common practice, and it should be supported (perhaps with warnings) as a way to allow migration to lerna without large changes to the codebase.

@evocateur
Copy link
Member

I'm not saying you can't shoot yourself in the foot, I'm just saying there are better options when it comes to feet.

I am saying that there is no way Lerna can magically make this work for unbuilt modules (or modules that do wacky prepublish modifications to the package structure) when required locally by the full package name. Even npm can't make this work for unbuilt/wacky packages. Lerna isn't magic, you should use relative imports for tests.

@github-actions github-actions bot added the stale label Jun 3, 2022
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

Hi Folks 👋

You may or may not know that lerna is now under the stewardship of Nrwl (announcement here #3121), a company with a long history of not just producing valuable open-source software (OSS), but also backing others (at the time of writing, Nrwl has donated over $50,000 to OSS it hasn't created, see https://opencollective.com/nx for full details).

Quite simply, Nrwl ❤️ OSS, and is committed to making lerna the best it can be. We use it ourselves.

In order to take this awesome project forward from its current state, it is important that we focus our finite resources on what is most important to lerna users in 2022.

With that in mind, we have identified this issue as being potentially stale due to its age and/or lack of recent activity.


Next steps:

We want to give you some time to read through this comment and take action per one of the steps outlined below, so for the next 14 days we will not make any further updates to this issue.

@anshumanv as the original author of this issue, we are looking to you to update us on the latest state of this as it relates to the latest version of lerna.

Please choose one of the steps below, depending on what type of issue this is:

  • A) If this issue relates to a potential BUG in the latest version of lerna:

  • B) If this issue is a FEATURE request to be added to the latest version of lerna:

    • Simply comment back on this thread so that we know you still want us to consider the request for the latest version of lerna.
  • C) If this issue is a QUESTION which is applicable to latest version of lerna:

  • D) If this issue is no longer applicable to the latest version of lerna:

    • Please close the issue.

If we do not hear from @anshumanv on this thread within the next 14 days, we will automatically close this issue.

If you are another user impacted by this issue but it ends up being closed as part of this process, we still want to hear from you! Please simply head over to our new issue templates and fill out all the requested details on the template which applies to your situation:

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

Thank you all for being a part of this awesome community, we could not be more excited to help move things forward from here 🙏 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants