https://github.com/sindresorhus/np/issues/314Go to Github

FundedView inAll private scoped packages detected as non-published#314

voxpellicreated this issue 14 days ago

This is a slight follow up to #313 and #307 + like those two a follow up to the feature introduced in #258.

We recommend np as the go to tool for publishing modules internally at @sydsvenskan, but since the latest version it always claims that our private scoped modules hasn't been published and asks if they should be published publicly (with a dangerous default as fixed in #313).

The reason is that npm-name only detects public packages as npm, correctly, doesn't expose any data about private packages.

To make the feature introduced in #258 work as a default it should really be required that the lookup also works for private scoped modules.

Alternative solutions to the preferred one above would be:

  • Leave this new feature behind a flag, intended for those who mainly publishes publicly
  • Introduce a flag to disable this feature for those of us who mainly published privately (though this would still nag all of my colleagues about our modules not being published until I got them to use that new flag, which isn't that optimal 😕)

What do you think @ru-lai and @sindresorhus? How would this best be solved?

Code example showing that npm-name doesn't work with private scoped modules:

const npmName = require("npm-name");

(async () => {
    console.log(await npmName('chalk'));                           // Exists, returns false
    console.log(await npmName('hallonkola'));                      // Does not exist, returns true
    console.log(await npmName('@hdsydsvenskan/graphql-partials')); // Exists, returns false
    console.log(await npmName('@hdsydsvenskan/config-loader'));    // Exists privately, but returns true
})();

Runnable here: https://runkit.com/embed/6x5oqgbc5kdv

Logs

Amount funded

$80.00

Resolve this issue and earn $72.00

Fund this issue

Fund as

Payment method

Amount(USD)

Please sign in first to fund this issue

Sign in with

Pull requests

0

    Submit

    URL of your pull request

    Submit your pull request

    Please sign in first to submit a pull request

    Sign in with