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

Confusing publish message about scoped repos #527

Closed
slhck opened this issue Apr 20, 2020 · 2 comments · Fixed by #529
Closed

Confusing publish message about scoped repos #527

slhck opened this issue Apr 20, 2020 · 2 comments · Fixed by #529

Comments

@slhck
Copy link
Contributor

slhck commented Apr 20, 2020

Description

I have a scoped package that I want to publish to a private registry. It uses the setting:

  "publishConfig": {
    "registry": "https://npmregistry.example.com"
  },

in the package.json. Also I have specified in .npmrc:

@example:registry=https://npmregistry.example.com

When I run np, I get asked:

This scoped repo @example/foo hasn't been published. Do you want to publish it publicly?

It is unclear to me what this does. I obviously do not want to publish it publicly – that's why I have specified a custom registry. I definitely do not want to publish it publicly… but I want to publish it anyway.

Steps to reproduce

  1. Create a scoped package with the publishConfig specifying a registry
  2. Run np

Expected behavior

I expected np to simply continue publishing the package to the private registry, as it does when you specify "No" to the above question:

? Select semver increment or specify new version major  1.0.0
? This scoped repo @example/foo hasn't been published. Do you want to publish it publicly? No

  ✔ Prerequisite check
  ✔ Git
  ↓ Cleanup [skipped]
  ✔ Installing dependencies using npm
  ✔ Running tests using npm
  ✔ Bumping version using npm
  ✔ Publishing package using npm
  ✔ Pushing tags

Perhaps this is just a misunderstanding of the features, but in that case, it might be helpful to document what this option does, and whether there is a flag to skip it?

Environment

np - 6.2.1
Node.js - 13.6.0
npm - 6.13.4

@sindresorhus
Copy link
Owner

sindresorhus commented Apr 20, 2020

I obviously do not want to publish it publicly – that's why I have specified a custom registry.

That prompt is really meant for scoped packages published against the public registry. I guess we don't have logic to handle case for scoped packages in a custom registry.

This is definitely a bug.

@slhck
Copy link
Contributor Author

slhck commented Apr 20, 2020

Thanks for the quick response. So if I understand you correctly, the solution would consist in checking whether a custom registry is defined and then simply ignoring this check?

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

Successfully merging a pull request may close this issue.

2 participants