Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
  • Loading branch information
mifi and sindresorhus committed Dec 5, 2023
1 parent 0f9184e commit f456aff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const np = async (input = 'patch', options, {pkg, rootDir, isYarnBerry}) => {
function getPackageManagerName() {
if (options.yarn === true) {
if (isYarnBerry) {
return 'Yarn berry';
return 'Yarn Berry';
}

return 'Yarn';
Expand Down
4 changes: 2 additions & 2 deletions source/npm/handle-npm-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const handleNpmError = (error, task, message, executor) => {
// https://stackoverflow.com/a/44862841/10292952
if (
error.code === 402
|| error.stderr.includes('npm ERR! 402 Payment Required') // Npm
|| error.stdout.includes('Response Code: 402 (Payment Required)') // Yarn berry
|| error.stderr.includes('npm ERR! 402 Payment Required') // npm

Check failure on line 31 in source/npm/handle-npm-error.js

View workflow job for this annotation

GitHub Actions / Node.js 18

Comments should not begin with a lowercase character.
|| error.stdout.includes('Response Code: 402 (Payment Required)') // Yarn Berry
) {
throw new Error('You cannot publish a scoped package privately without a paid plan. Did you mean to publish publicly?');
}
Expand Down
4 changes: 2 additions & 2 deletions source/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const ui = async (options, {pkg, rootDir, isYarnBerry}) => {

function getPkgManager() {
if (!options.yarn) {
return npm;
return 'npm';
}

if (isYarnBerry) {
Expand All @@ -140,7 +140,7 @@ const ui = async (options, {pkg, rootDir, isYarnBerry}) => {
const pkgManager = getPkgManager();

if (isYarnBerry && npm.isExternalRegistry(pkg)) {
throw new Error('External registry not supported yet with yarn berry');
throw new Error('External registry is not yet supported with Yarn Berry');
}

const registryUrl = await npm.getRegistryUrl(pkgManager, pkg);
Expand Down

0 comments on commit f456aff

Please sign in to comment.