You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): Ignore empty bin value in Manifest#load (#5743)
**What's the problem this PR addresses?**
Some packages pass an invalid empty string for a `bin` entry in their
`package.json`, for example
[[email protected]](https://github.com/webpack-contrib/mini-css-extract-plugin/blob/v0.4.5/package.json#L10)
The NodeModules linker already ignores empty entries:
https://github.com/yarnpkg/berry/blob/master/packages/plugin-nm/sources/NodeModulesLinker.ts#L982
However `scriptUtils` was not, and would append `""` to the bin path
(resulting in the directory itself, not a binary)
Resolves#5669
**How did you fix it?**
Instead of trying to fix this everywhere that might use a manifest
`.bin` property, I just remove these entries from the manifest when it
is being loaded, since an empty `bin` does not seem to be a valid entry.
The npm docs for `package.json` make no mention of any special case for
when `bin` is set to an empty string.
**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [X] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [X] I have set the packages that need to be released for my changes to
be effective.
<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [X] I will check that all automated PR checks pass before the PR gets
reviewed.
0 commit comments