fix: match package.json to workspace definition - #2332
Merged
Conversation
lili2311
requested review from
a team,
JamesPatrickGill,
admons,
dekelund,
florindumitrascu,
mika-bar and
muscar
November 1, 2021 16:02
Re-enable windows tests as they have been hiding the fact that the feature broke on Windows. Update the file matching logic to support both Windows & Linux file names as well as different glob types. e.g. 'package/*' is an example given in Yarn docs
lili2311
force-pushed
the
fix/yarn-workspaces-windows
branch
from
November 1, 2021 16:03
7f39200 to
a2dcfdc
Compare
lili2311
commented
Nov 1, 2021
| // the order of folders is important | ||
| // the order of yarnTargetFiles folders is important | ||
| // must have the root level most folders at the top | ||
| // const yarnTargetFiles: { |
Contributor
Author
There was a problem hiding this comment.
deleting commented out code
lili2311
commented
Nov 1, 2021
| const match = micromatch.isMatch( | ||
| filePath, | ||
| workspacesGlobs.map((p) => (p.endsWith('/**') ? p : p + '/**')), | ||
| packageJsonFileName.replace(/\\/g, '/'), |
Contributor
Author
There was a problem hiding this comment.
normalize all paths to / as \\ does not allow path.parse to identify the folder correctly
Contributor
|
lili2311
commented
Nov 1, 2021
| - Jakub | ||
| */ | ||
|
|
||
| const isWindows = |
Contributor
Author
There was a problem hiding this comment.
enable Windows tests again, every test run was successful with no flakes.
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.
What does this PR do?
Re-enable windows tests as they have been hiding the fact that the
feature broke on Windows.
Update the file matching logic to support both Windows & Linux file names
as well as different glob types.
e.g. 'package/*' is an example given in Yarn docs
Where should the reviewer start?
https://github.com/snyk/snyk/compare/fix/yarn-workspaces-windows?expand=1#diff-58a7b63707ecc3959ab8c5f5ec8cfb77660fc185f22cb4c2677b5af04180bba4R165
How should this be manually tested?
Any background context you want to provide?
Disabled tests did not catch that Windows support had a bug
What are the relevant tickets?
https://github.com/snyk/snyk/issues/1560
Screenshots
Additional questions