Skip to content
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

Dependabot sometimes hoists optional dependencies to dependencies #4851

Open
1 task
domoscargin opened this issue Mar 11, 2024 · 0 comments
Open
1 task

Dependabot sometimes hoists optional dependencies to dependencies #4851

domoscargin opened this issue Mar 11, 2024 · 0 comments
Labels
dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code small story

Comments

@domoscargin
Copy link
Contributor

What

For some packages/groups (especially @types/node), dependabot will hoist a devDependency or optionalDependency to a dependency.

This is likely due to a problem with overrides at the npm level, so not something that'll go away any time soon.
npm/cli#7018
npm/cli#7019

Why

The fix is simple: we just need to run npm install which removes the hoisted dependency, then commit that change. But it is an annoyance to have to do that manually each time!

Enough of an annoyance that we have a test to check when it happens:

it("should not hoist 'optionalDependencies' to 'dependencies'", () => {

It'd be good to automate this process, ie: have GitHub Actions run npm install if that particular test fails, and commit the changes, so we don't have to manually fix it.

Who needs to work on this

Developer

Who needs to review this

Developer

Done when

  • devDependencies and optionalDependencies are no longer hoisted to dependencies by Dependabot
@domoscargin domoscargin added dependencies Pull requests that update a dependency file small story github_actions Pull requests that update GitHub Actions code labels Mar 11, 2024
@domoscargin domoscargin changed the title Dependabot sometimes hoists devDependencies to dependencies Dependabot sometimes hoists optional dependencies to dependencies Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file github_actions Pull requests that update GitHub Actions code small story
Projects
None yet
Development

No branches or pull requests

1 participant