Skip to content

Bug : Lerna is publishing private packages when they have a dependency #303

Closed

Description

@yvele

Lerna v2.0.0-beta.24

First of all : Thank you for lerna :)

So.. Let's say I have 3 packages :

{
  "name": "@scope/package-a",
  "private": false
}
{
  "name": "@scope/package-b",
  "private": true
}
{
  "name": "@scope/package-c",
  "private": true,
  "peerDependencies": {
    "@scope/package-b": "^0.1.0"
  }
}

Only package-a is public. When I run lerna updated I only get - @scope/package-a and that's what is expected.

But now when I switch package-b to public and I run lerna updated again, I get :

Lerna v2.0.0-beta.24
Checking for updated packages...

- @scope/package-a
- @scope/package-b
- @scope/package-c

You can see that package-c is being published even it is explicitly private...

PS: When I remove peerDependencies from package-c, it's privacy is respected by lerna.

Activity

  1. changed the title [-]Bug? Lerna is publishing private packages when they have a dependency[/-] [+]Bug : Lerna is publishing private packages when they have a dependency[/+] on Aug 9, 2016
  2. ianwremmel commented on Aug 9, 2016

    @ianwremmel
    Contributor

    Same root cause as #286 and #287?

  3. gigabo commented on Aug 10, 2016

    @gigabo
    Contributor

    Just ran into this. :(

    Maybe related to #286? I was not using --canary.

  4. gigabo commented on Aug 10, 2016

    @gigabo
    Contributor

    Just realized that previously all of our private packages were using relative dependencies, like:

        "package-b": "../package-b",

    This was to work around #11. But we recently eliminated deep requires, so we have normal dependencies that Lerna can link now.

    I guess this has been an issue with private packages for a while. 😬

  5. gigabo commented on Aug 10, 2016

    @gigabo
    Contributor

    So, I think the right behavior here would be to update the dependency versions in private packages, but not try to actually publish them.

    What about lerna updated? Private packages would be be modified by lerna publish, so they'd get updated. Maybe output with a (private) tag?

    $ lerna updated
    Lerna v2.0.0-beta.24
    Checking for updated packages...
    
    - generator-react-server
    - react-server
    - react-server-cli
    - react-server-core-middleware
    - react-server-data-bundle-cache
    - react-server-integration-tests (private)
    - react-server-test-pages (private)
    
  6. added a commit that references this issue on Aug 25, 2016
  7. added a commit that references this issue on Sep 8, 2016
  8. gigabo commented on Sep 9, 2016

    @gigabo
    Contributor

    Hi @yvele, #321 landed in [email protected]. That should get publish with private modules working correctly. Please reopen (or start a new ticket) if you still run into trouble after upgrading.

  9. lock commented on Dec 28, 2018

    @lock

    This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  10. locked as resolved and limited conversation to collaborators on Dec 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions