Skip to content

Fix linked and fixed glob patterns expansion - #2222

Merged
Andarist merged 4 commits into
changesets:mainfrom
itsjxck:fix/config-expand-globs
Aug 9, 2026
Merged

Andarist merged 4 commits into
changesets:mainfrom
itsjxck:fix/config-expand-globs

Conversation

@itsjxck

@itsjxck itsjxck commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes loss of glob pattern support for fixed and linked configuration fields.

@netlify

netlify Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for changesets ready!

Name Link
🔨 Latest commit 3aaccfa
🔍 Latest deploy log https://app.netlify.com/projects/changesets/deploys/6a784e2c9ab95d000853e804
😎 Deploy Preview https://deploy-preview-2222--changesets.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3aaccfa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@changesets/config Patch
@changesets/apply-release-plan Patch
@changesets/cli Patch
@changesets/get-release-plan Patch

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

@Andarist
Andarist requested a review from beeequeue August 7, 2026 14:32
@itsjxck

itsjxck commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

I threw this up while I was digging into some more - the test cases here, they expect the result to be the glob pattern, but in every place I can see that consumes the returned config it expects the actual package names. Is there something I'm missing here or are the tests wrong and should be updated?

@itsjxck

itsjxck commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

I've update the validation rules for finding duplicate packages/globs to work against the writtenConfig and updated the tests to correctly validate the glob matching returns resulting package names and not the raw glob pattern

@codecov

codecov Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.12%. Comparing base (dc79c29) to head (3aaccfa).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2222      +/-   ##
==========================================
+ Coverage   84.09%   84.12%   +0.03%     
==========================================
  Files          80       80              
  Lines        3156     3162       +6     
  Branches      890      890              
==========================================
+ Hits         2654     2660       +6     
  Misses        445      445              
  Partials       57       57              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Andarist

Andarist commented Aug 7, 2026

Copy link
Copy Markdown
Member

Is there something I'm missing here or are the tests wrong and should be updated?

It might be a genuine bug with the wrong expectations. I'd recommend cross-referencing with our v2 branch: https://github.com/changesets/changesets/tree/maintenance/v2

@itsjxck

itsjxck commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Yeah looks like this just didn't survive the rework, v2 does expand the glob patterns and the docs also do still say glob patterns are supported.

Comment thread packages/config/src/rules.ts Outdated
const duplicatedNames = new Set<string>();

for (const fixedGroup of config.fixed) {
for (const fixedGroup of writtenConfig.fixed) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, the written config has unresolved values. I feel the goal here is to validate the resolved groups so we should be using config here. Maybe I'm missing something here. Could you explain the results you see when using both of them?

@beeequeue beeequeue Aug 8, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main question that needs answering is whether the users of .linked and .fixed expect glob patterns or a list of packages, if it's the latter this is the correct fix

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR is right in the sense we should expand globs (that's already what's done for .ignore).

I'm adding extra test coverage + double-checking how those rules here are written. Gonna push out final version in the morning.

Comment thread packages/config/src/rules.ts Outdated
const noDuplicateLinkedPackages: Rule = ({ config, errors }) => {
if (config.linked.length === 0) return;
const noDuplicateLinkedPackages: Rule = ({ writtenConfig, errors }) => {
if (!writtenConfig.linked || writtenConfig.linked.length === 0) return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should default the value to [] instead so we can avoid checks like this

@Andarist Andarist changed the title fix: expand linked and fixed glob patterns Fix linked and fixed glob patterns expansion Aug 9, 2026
@Andarist
Andarist added this pull request to the merge queue Aug 9, 2026
Merged via the queue into changesets:main with commit 68ea6ec Aug 9, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants