Skip to content

Publish npm packages in topological order.#595

Merged
doug-wade merged 1 commit intolerna:masterfrom
loganfsmyth:topological-publish
Feb 16, 2017
Merged

Publish npm packages in topological order.#595
doug-wade merged 1 commit intolerna:masterfrom
loganfsmyth:topological-publish

Conversation

@loganfsmyth
Copy link
Copy Markdown
Contributor

Expanding on the work done in #412 by @seansfkelley.

This makes the publish command publish packages to npm in topological order so that there is never a time where npm could have a package whose dependencies do not yet exist in the registry. There's already some dist-tags toggling going on, but that doesn't have any effect on users who already have dependencies on a version range in their deps.

Feedback welcome. Main questions:

If you have dependency cycles in your repo, this means Lerna will start logging "Encountered a cycle in the dependency graph. This may cause instability!" on every call to lerna publish where it wouldn't have before, is that cool?

@gigabo
Copy link
Copy Markdown
Contributor

gigabo commented Feb 10, 2017

Thanks @loganfsmyth, this is an important improvement. I actually wonder if it should even be an option. Is there ever a time when publishing out of dependency order is appropriate?

@loganfsmyth
Copy link
Copy Markdown
Contributor Author

Happy to remove the option usage, I only included it to be consistent with the other PR.

@gigabo
Copy link
Copy Markdown
Contributor

gigabo commented Feb 10, 2017

Yeah, I guess there's value in just being consistent across commands. At least the default is to sort.

Incidentally noticed that the sort option is only supported on the command-line. Added #596 for durable config via lerna.json.

@loganfsmyth
Copy link
Copy Markdown
Contributor Author

Cool. Let me know if there's anything else I need to do.

Copy link
Copy Markdown
Member

@evocateur evocateur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@doug-wade doug-wade merged commit 8790656 into lerna:master Feb 16, 2017
@hzoo
Copy link
Copy Markdown
Contributor

hzoo commented Feb 16, 2017

Tested in the Babel 6.23 (npm link) release so, seems like it worked!! (and not much celebration since we had a different regression)

@loganfsmyth loganfsmyth deleted the topological-publish branch February 17, 2017 02:38
@lock
Copy link
Copy Markdown

lock Bot commented Dec 27, 2018

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.

@lock lock Bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants