Repository navigation
Conversation
Passing a package that exists but is skipped (private while `privatePackages.version` is not enabled, listed in `ignore`, or without a `version` field) to `--major`, `--minor` or `--patch` used to report it as not found and possibly misspelled. The error now says the package is skipped and why. Unknown names keep the existing message. Fixes changesets#2339
🦋 Changeset detectedLatest commit: 4072ddc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for changesets ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2350 +/- ##
==========================================
+ Coverage 87.48% 87.54% +0.05%
==========================================
Files 78 78
Lines 2973 2987 +14
Branches 851 855 +4
==========================================
+ Hits 2601 2615 +14
Misses 337 337
Partials 35 35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
$ changeset --patch priv -m "Fix" |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2339
When I pass a package to
--major,--minoror--patchand it exists in the workspace but is skipped,changeset addsays it can't be found and that I may have misspelled it.adddrops non-versionable packages beforecreateChangesetvalidates the flags, so the validation can't tell a skipped package from a name that doesn't exist.This change has
addbuild a map of skipped package names to the reason they are skipped and pass it tocreateChangeset. The reasons follow the same order asshouldSkipPackage: listed inignore, private whileprivatePackages.versionis not enabled, or noversionfield. Packages that really don't exist keep the current message. Nothing changes about which packages are versionable, and the command still exits with code 1.Before, with the setup from the issue (pnpm workspace,
packages/privis{"name":"priv","version":"1.0.0","private":true}, default config):After:
The other two reasons read:
How I tested it:
packages/cli/src/commands/add/__tests__/add.test.tsthat passes a private package, an ignored package, a package without a version and an unknown name in one call, and checks all four messages. It fails onmain(all three skipped packages get the "misspelled" message) and passes with the change. The existing tests for unknown names and duplicate flags pass unchanged.pnpm test run packages/cli/src/commands/add: 27 passedpnpm test run: 39 files, 817 passed, 2 todopnpm types:check,pnpm lintandpnpm formatall exit 0privgets the new message, a typo likepbustill gets the "misspelled" message, and withprivatePackages: { version: true, tag: false }the private package gets a changeset as before.Changeset included, patch bump for
@changesets/cli.@pintu544 asked on the issue whether a PR along these lines would be welcome. I didn't see one opened, so here's mine; if you already have one in progress, I'm happy to close this in favour of it.
Happy to take suggested changes on the message wording.