Publish Support For `Yarn Berry`/`Yarn 2`
See original GitHub issueAffected Packages
@changesets/cli
Problem
I recently setup yarn berry
and changesets
in my repo. First I noticed that status
wasn’t working because it wasn’t running yarn
in front of npm
commands so it wasn’t looking for my yarnrc.yml
. I worked around that but then was seeing a similar issue with publish
. Digging in, I can see that it’s a similar problem in that publish
isn’t running yarn npm publish
like yarn berry
wants.
Proposed solution
Probably need to make something a little more flexible instead of just publishTool.name
, or have the name
for yarn berry
be yarn npm
instead of just yarn
.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
yarn publish
Publishes a package to the npm registry. Once a package is published, you can never modify that specific version, so take care before...
Read more >JavaScript package managers compared: npm, Yarn, or ...
Its successor, Yarn v2 or Berry, is now the active development branch. ... With the help of Corepack, you don't have to install...
Read more >yarn
For defining a registry you must use the .yarnrc.yml located in the root of your project or global configuration. When you publish a...
Read more >Migrating to Yarn 2
This article is intended to help current Heroku users migrate from Yarn 1 to Yarn 2. Apps being migrated should already be using...
Read more >Configure and use Yarn with CodeArtifact
After you create a repository, you can use the Yarn client to manage npm ... and uses information from your npm configuration file...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for this comment and the done testing related to this ❤️ I’d like to merge this stuff into the
main
branch - it’s already hanging there for quite a bit of time. Honestly… I’m a little bit scared of that PR as it’s so delicate and so hard to test out all of the package managers with different combinations of private/public packages etcThis is very helpful.
@Andarist We’re using
2.22.0-temp.0
(mostly) successfully to publish our packages, we ran into a snag usingyarn
v3 with private packages though.The current
npm info
command only works if.npmrc
exists and is configured (which it no longer is). We usedyarn patch
(likepatch-package
) to patch@changesets/cli
to useyarn npm info {package} --json
instead. This seems to be working great - the comment on caching issues probably no longer applies toyarn npm info
(vs. the legacyyarn info
)This obviously doesn’t work for
npm
users so it’d likely need a conditional “if yarn v2+, use yarn npm info”.