Repository navigation
Fix linked and fixed glob patterns expansion - #2222
Conversation
✅ Deploy Preview for changesets ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 3aaccfa The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
|
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? |
|
I've update the validation rules for finding duplicate packages/globs to work against the |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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 |
|
Yeah looks like this just didn't survive the rework, |
| const duplicatedNames = new Set<string>(); | ||
|
|
||
| for (const fixedGroup of config.fixed) { | ||
| for (const fixedGroup of writtenConfig.fixed) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
| const noDuplicateLinkedPackages: Rule = ({ config, errors }) => { | ||
| if (config.linked.length === 0) return; | ||
| const noDuplicateLinkedPackages: Rule = ({ writtenConfig, errors }) => { | ||
| if (!writtenConfig.linked || writtenConfig.linked.length === 0) return; |
There was a problem hiding this comment.
we should default the value to [] instead so we can avoid checks like this
Fixes loss of glob pattern support for
fixedandlinkedconfiguration fields.