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

[Feature Request] Support Yarn 2 Publish Command #382

Closed
latipun7 opened this issue Aug 9, 2021 · 3 comments
Closed

[Feature Request] Support Yarn 2 Publish Command #382

latipun7 opened this issue Aug 9, 2021 · 3 comments

Comments

@latipun7
Copy link

latipun7 commented Aug 9, 2021

Problem

As mentioned in pmowrer/semantic-release-monorepo#107, semantic-release don't use yarn command when publishing so when using yarn workspace protocol, it didn't replace the protocol when published to npm.

Possible Solution

Please support the yarn publishing command.
The gist is:

  • Detect the project if it's using yarn 2. All yarn 2 project always has .yarnrc.yml file in the root project, or the yarn.lock file always contain __metadata while yarn 1 not.
  • If the project using yarn 2, use yarn publishing command (yarn npm publish)

Well, maybe it's not as simple as that to implement.


Thank you

@gr2m
Copy link
Member

gr2m commented Aug 9, 2021

Well, maybe it's not as simple as that to implement.

Maybe not 😁

It might make more sense to create a separate yarn plugin and use that as a replacement for @semantic-release/npm in your setup?

@latipun7
Copy link
Author

latipun7 commented Aug 9, 2021

Maybe not 😁

Guess so 😆

It might make more sense to create a separate yarn plugin and use that as a replacement for @semantic-release/npm in your setup?

Yeah, create separate plugin is cool too 👍

@travi
Copy link
Member

travi commented Aug 10, 2021

to clarify a bit, it sounds like this is only a problem when using yarn 2 with a repo that is structured as a monorepo. am i understanding that correctly?

while i agree with both @gr2m and @pmowrer that it would be better to support this type of approach in a new plugin than to include it in either @semantic-release/npm or semantic-release-monorepo, it is important to remember that semantic-release itself does not officially support monorepos, which is why tools like semantic-release-monorepo exist.

while we would like to take steps to make it simpler for tools like semantic-release-monorepo (@pmowrer we can't promise any timeline, but if you have ideas we're open to discussing), we don't have the bandwidth to take on additional work to build (or support over time) functionality that is specific to monorepos.

in short, you are welcome to approach solving this problem with a custom plugin, but it is unlikely that we will build or maintain an official plugin for this purpose. from our understanding, the existing functionality of the @semantic-release/npm plugin works with yarn as long as the project is not structured as a monorepo. if you do create one and find success using it, let us know and we could link to your plugin. one recommendation i would give is to suggest including workspaces in the name of the plugin in addition to yarn to yarn2 to help make it clear that it is useful in that context, but may not be needed if not using workspaces.

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

No branches or pull requests

3 participants