Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is best reviewed commit-by-commit
1. fix broken revert code after publish failure
it didn't work because of a missing await and
.pkg
2. make boolean logic easier to understand
because pkg.publishConfig will often be
undefined
, canBePublishedPublicly would short circuit toundefined
, butundefined
meanstrue
in inquirer'swhen
option.change this by always returning an explicit true or false.
this should not bring any changes.
also put isScoped(pkg.name) into the bool for consistency.
3 fix yarn npm publish for scoped packages
this will make yarn berry
yarn npm publish
behave likenpm publish
:npm publish
on an already public scoped package will publish it gladlyhowever for
yarn npm publish
, even if the scoped package is already published publiclywe need to specify the
--access public
argument, or it will fail with 402 (Payment Required)here I add a check (currently only for yarn berry) for whether the published version of the package is public,
and if so, set publishScoped to true (and don't ask for it)