Conversation
The maintainer "add a changeset" link listed every changed workspace package, including ignored and private ones. Adding such a changeset then fails with "Mixed changesets that contain both ignored and not ignored packages are not allowed". Filter the changed packages with `@changesets/should-skip-package`, matching what `@changesets/cli add` does, so ignored packages, private packages (unless `privatePackages.version` is enabled) and packages without a `version` are no longer suggested.
|
@JounQin is attempting to deploy a commit to the Changesets Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The reviewed changes are covered by tests with no blocking issues identified.
Review effort: Lite
Findings: None
What changed in this PR
Updates the maintainer changeset link to include only versionable changed workspace packages.
Changes:
- Filters ignored, private, and unversioned packages.
- Adds the Changesets helper dependency and lockfile entry.
- Adds regression tests and updates fixtures.
| File | Description |
|---|---|
test/index.test.ts |
Adds filtering tests and fixture versions. |
pnpm-lock.yaml |
Locks the new dependency. |
package.json |
Adds the filtering dependency. |
get-changed-packages.ts |
Applies package filtering. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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 #44
Problem
The maintainer "add a changeset if you're a maintainer" link listed every changed workspace package, including ignored and private ones. Adding a changeset from that link then fails with:
This is especially confusing for external contributors who aren't familiar with the repo's changesets config.
Solution
Filter the changed packages with
@changesets/should-skip-package, which is the same helper used by@changesets/cli add. A package is no longer suggested when it is:ignoreconfig, orprivatewithoutprivatePackages.versionenabled, orversionfield (it cannot be versioned).Tests
does not include private packages in the add-changeset linkincludes private packages in the add-changeset link when opted indoes not include ignored packages in the add-changeset linkdoes not include packages without a version in the add-changeset linkExisting fixtures used unversioned packages; they now declare a
versionso they remain versionable.