Skip to content

RFC: Improving lerna publish #1767

@ThisIsMissEm

Description

@ThisIsMissEm

Proposal for the future of lerna publish:

  • deprecate automatic versioning, use lerna version first instead
    • this enables a more reliable & retryable lerna publish and removes functionality that’s duplicated between lerna version and lerna publish
  • switch to libnpmpublish instead of shelling out to npm/yarn
    • This allows us to avoid a lot of the weird issues that can happen due to things like $PATH, different versions of npm/yarn, and the different capabilities of each.
  • separate tagging as “latest” (dist-tag) from publishing the tarball, as to make “lerna publish” not give partial “latest” releases
    • Essentially whilst a publish is ongoing, installs should not fail
    • This also moves us towards a more “release” based model, which seems to be what people intend (looking at apollo/babel/etc)
  • implement retries via checking the registry for each package at a given version, giving the option to abort the publish or continue
    • this allows for partial publishes to succeed, related to splitting versioning and publishing
  • switch to serial/sequential/queue-based publishing of packages
    • This gives better error handling and OTP support
    • Concurrent publishes lead to a lot of error conditions resulting in complex code & hard to debug errors
  • remove execScripts
    • this functionality is only used by a small subset of lerna users, and is probably better done via a custom “publish” command in your package.json at root level. Or via a custom wrapler around lerna

These are my initial thoughts, and I’m definitely interested to keep discussing these to inform development decisions.

The above list is based on some private conversation with various people, and opens up doors for future developments or improvements whilst greatly simplifying the codebase.

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