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
Publish Support For Yarn Berry
/Yarn 2
#714
Comments
The publishing issue is being fixed here: #674 . You can even install the version from this PR (roughly) as it’s available on npm as Could you expand on the status issue though? Im not using this command myself and have no access to the computer right now to look through the code but i dont see why using yarn over npm would matter for it. Why reading |
Thanks @Andarist, I'm actually already running your changes but haven't pulled them in since you fixed publish. I'll try it out!
It was related to this line running
|
Hm, what exact version/commit are you running then? 🤔
This shouldn't affect the |
Whatever the state of that tag was about 5 days ago. I'm on
Ah, I think that's where I saw the issue now that you mention it! |
Can you try this version: |
Changeset currently does not support yarn 2 :-( See changesets/changesets#714
@Andarist We're using The current diff --git a/dist/cli.cjs.dev.js b/dist/cli.cjs.dev.js
index 8d826de63e1289666b7a47c4f2260348febcf523..b8d1ec1c3e228840dd8bff85ae901e750cca1f5f 100644
--- a/dist/cli.cjs.dev.js
+++ b/dist/cli.cjs.dev.js
@@ -665,7 +665,7 @@ function getPackageInfo(packageJson) {
// as they will always give a 404, which will tell `publish` to always try to publish.
// See: https://github.com/yarnpkg/yarn/issues/2935#issuecomment-355292633
- let result = await spawn__default['default']("npm", ["info", packageJson.name, "--registry", getCorrectRegistry(packageJson), "--json"]); // Github package registry returns empty string when calling npm info
+ let result = await spawn__default['default']("yarn", ["npm", "info", packageJson.name, "--json"]); // Github package registry returns empty string when calling npm info
// for a non-existent package instead of a E404
if (result.stdout.toString() === "") {
diff --git a/dist/cli.cjs.prod.js b/dist/cli.cjs.prod.js
index ab0ea013e7e93781c3026ec2674937376e4d87ae..0d5de9375abca0a3b0fb5ed3b07e03b30d49fbd9 100644
--- a/dist/cli.cjs.prod.js
+++ b/dist/cli.cjs.prod.js
@@ -388,7 +388,7 @@ async function getTokenIsRequired() {
function getPackageInfo(packageJson) {
return npmRequestLimit((async () => {
logger.info("npm info " + packageJson.name);
- let result = await spawn__default.default("npm", [ "info", packageJson.name, "--registry", getCorrectRegistry(packageJson), "--json" ]);
+ let result = await spawn__default.default("yarn", ["npm", "info", packageJson.name, "--json"]);
return "" === result.stdout.toString() ? {
error: {
code: "E404"
diff --git a/dist/cli.esm.js b/dist/cli.esm.js
index d03dfdfde80ebf068fe1a80504fe88dc24bdb0be..8620fb73d2554eeb78f53b505485ef3e235a4c9d 100644
--- a/dist/cli.esm.js
+++ b/dist/cli.esm.js
@@ -643,7 +643,7 @@ function getPackageInfo(packageJson) {
// as they will always give a 404, which will tell `publish` to always try to publish.
// See: https://github.com/yarnpkg/yarn/issues/2935#issuecomment-355292633
- let result = await spawn$1("npm", ["info", packageJson.name, "--registry", getCorrectRegistry(packageJson), "--json"]); // Github package registry returns empty string when calling npm info
+ let result = await spawn$1("yarn", ["npm", "info", packageJson.name, "--json"]); // Github package registry returns empty string when calling npm info
// for a non-existent package instead of a E404
if (result.stdout.toString() === "") {
This obviously doesn't work for |
Thanks for this comment and the done testing related to this ❤️ I'd like to merge this stuff into the This is very helpful. |
Affected Packages
@changesets/cli
Problem
I recently setup
yarn berry
andchangesets
in my repo. First I noticed thatstatus
wasn't working because it wasn't runningyarn
in front ofnpm
commands so it wasn't looking for myyarnrc.yml
. I worked around that but then was seeing a similar issue withpublish
. Digging in, I can see that it's a similar problem in thatpublish
isn't runningyarn npm publish
likeyarn berry
wants.changesets/packages/cli/src/commands/publish/npm-utils.ts
Line 171 in 94f6097
Proposed solution
Probably need to make something a little more flexible instead of just
publishTool.name
, or have thename
foryarn berry
beyarn npm
instead of justyarn
.The text was updated successfully, but these errors were encountered: