-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix license check script to ignore sub-dependencies of ignored packages #21606
Conversation
Size Change: 0 B Total Size: 842 kB ℹ️ View Unchanged
|
This is a bit of a tricky problem, thanks for diving into it, @ceyhun! To give some history, the This is clearly a special case worth working around, so I would suggest reworking I suspect the simplest option will be to switch to path = `${ pkg._where }/node_modules${ pkg._location }`; With this in place, the dependency tree recursor can just skip any module (and its dependencies) that are passed in the |
Thanks for the suggestion @pento! Pushed the changes implementing that and it seems to work, feel free to take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, nice work on the clean rewrite, @ceyhun!
Given the size of the output from npm ls
, there's the potential for weird failures in the future, should the dependency tree grow big enough to overrun the buffer size. I'm okay with leaving it as is for now, we can investigate converting it to using a streaming JSON parser if it turns out to be a problem in the future.
It would be great to cherry-pick changes applied to |
I agree the script changes should go to master 👍 |
Sounds good 👍 |
cd0c3cc
to
b8a745e
Compare
This reverts commit fe2aa19.
Awesome, thanks for all updates 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This is a part of the migration of gutenberg-mobile to the gutenberg repo.
Related to #19861
Updated
check-licenses
script to parse JSON dependency tree recursively so sub-dependencies of packages passed in--ignore
flag are ignored as well.How has this been tested?
npm run check-licenses
should complete without errorsScreenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: