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] yarn npm publish should print registry URL where it is publishing #6191

Open
1 of 2 tasks
earshinov opened this issue Mar 30, 2024 · 0 comments
Open
1 of 2 tasks
Labels
enhancement New feature or request

Comments

@earshinov
Copy link

earshinov commented Mar 30, 2024

  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

I just spent another hour trying to publish my package with yarn 4 instead of npm, because I want workspace: cross-references in package.json to be properly handled.

With npm I had:

package.json:

  "publishConfig": {
    "@earshinov:registry": "https://private-registry/packages/npm/"
  }

.npmrc:

//private-registry/packages/npm/:_authToken=$CI_JOB_TOKEN

With Yarn, I had to figure out:

  1. Does Yarn look into .npmrc? Apparently, the answer is No for Yarn Classic and No for Yarn Berry (or maybe they just don't handle these particular kinds of keys).

  2. How do I give the auth token then? Apparently, that's yarn config set _authToken "$CI_JOB_TOKEN" for Yarn classic (found on GitHub) and yarn config set 'npmRegistries["//private-registry"].npmAuthToken' "$CI_JOB_TOKEN" for Yarn Berry (thanks for this useful example in yarn config set docs, by the way!).

  3. Now I am still facing YN0033: No authentication configured for request when running yarn npm publish, and have no idea if I misconfigured the token or the registry URL. And yarn npm publish has no verbosity flags.

If yarn npm publish printed the registry URL it is accessing, it would help.

Describe the solution you'd like

A log line similar to YN00xx: Publishing to npm.example.com

Describe the drawbacks of your solution

None?

Describe alternatives you've considered

  • Let developers continue spending time to figure out what's wrong with their project configuration. May be a feasible option, because apparently I am the only one having problems with it as I don't see any similar reports.
@earshinov earshinov added the enhancement New feature or request label Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant