From ae6172e4003d91fbda08ee292c0da1be65692ff0 Mon Sep 17 00:00:00 2001 From: Bunyanuch Saengnet Date: Wed, 22 Apr 2020 05:56:10 +0000 Subject: [PATCH 1/2] Avoid scoped repo message for private registries --- source/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ui.js b/source/ui.js index d516da14..1def8208 100644 --- a/source/ui.js +++ b/source/ui.js @@ -5,7 +5,7 @@ const githubUrlFromGit = require('github-url-from-git'); const isScoped = require('is-scoped'); const util = require('./util'); const git = require('./git-util'); -const {prereleaseTags, checkIgnoreStrategy, getRegistryUrl} = require('./npm/util'); +const {prereleaseTags, checkIgnoreStrategy, getRegistryUrl, isExternalRegistry} = require('./npm/util'); const version = require('./version'); const prettyVersionDiff = require('./pretty-version-diff'); @@ -139,7 +139,7 @@ module.exports = async (options, pkg) => { { type: 'confirm', name: 'publishScoped', - when: isScoped(pkg.name) && !options.availability.isAvailable && !options.availability.isUnknown && options.publish && !pkg.private, + when: isScoped(pkg.name) && !options.availability.isAvailable && !options.availability.isUnknown && options.publish && !pkg.private && !isExternalRegistry(pkg), message: `This scoped repo ${chalk.bold.magenta(pkg.name)} hasn't been published. Do you want to publish it publicly?`, default: false } From be255f986c5e56f1628ac5df7a8c93c252d34109 Mon Sep 17 00:00:00 2001 From: Bunyanuch Saengnet <53788417+bunysae@users.noreply.github.com> Date: Wed, 22 Apr 2020 10:01:23 +0000 Subject: [PATCH 2/2] Update source/ui.js Co-Authored-By: Sindre Sorhus --- source/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ui.js b/source/ui.js index b758b4d2..ce38a78b 100644 --- a/source/ui.js +++ b/source/ui.js @@ -139,7 +139,7 @@ module.exports = async (options, pkg) => { { type: 'confirm', name: 'publishScoped', - when: isScoped(pkg.name) && !options.availability.isAvailable && !options.availability.isUnknown && options.runPublish && (pkg.publishConfig && pkg.publishConfig.access !== 'restricted') && !isExternalRegistry(pkg), + when: isScoped(pkg.name) && options.availability.isAvailable && !options.availability.isUnknown && options.runPublish && (pkg.publishConfig && pkg.publishConfig.access !== 'restricted') && !isExternalRegistry(pkg), message: `This scoped repo ${chalk.bold.magenta(pkg.name)} hasn't been published. Do you want to publish it publicly?`, default: false }