Allow overrides to affect dependencies bundled in a dependency

未关闭
#10,120 0 条评论 6 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
12/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript, nodejs
领域
devtools

调研方向

The payload names no source files or tests. Start with the linked discussion in npm/cli#8938 and with how overrides and bundleDependencies are documented, to see where they conflict. The issue asks whether npm would take this on, so there is no defined patch yet. It is done when maintainers agree on a design for applying overrides to bundled dependencies.

由索引模型根据 Issue 内容生成。

描述

config:overrides Enhancement Priority 2

The discussion about the removal of npm-shrinkwrap mentions a few times allowing overrides to apply when bundleDependencies is used, with what looks like some agreement that it’d be useful.

Quotes from the discussion

The real issue to solve here, and one which I think is worth exploring, is allowing for overrides to take place even in a bundled/shrinkwrap setting. The discussion would be one of priority, I think.
https://github.com/npm/cli/issues/8938#issuecomment-3862766889

... I think the goal should be:

  1. Have a standard way that npm itself uses for it’s CLI to deliver an optimized CLI package for use primarily via npx
  2. Have a standard way for package authors to ship opinions on the shape of their dependencies that consumers can take control of via overrides
  3. Allow for package authors to specify dependencies included in the package source but not via npm managed tooling
    https://github.com/npm/cli/issues/8938#issuecomment-3873277646

I think those goals are on the money, and that right now we have 1. and 3. but not 2. due to overrides not having the highest priority
https://github.com/npm/cli/issues/8938#issuecomment-3873406454

We’re raising this issue to discuss whether you’d consider implementing it in npm.

This is something that’d be helpful for our GOV.UK Prototype Kit project. Our package is used:

  1. As a CLI run with npx that lets users easily create new prototypes
  2. As a dependency of the created prototypes, where it provides the server for the prototype

Our main audience is designers/user researchers that cannot be expected to know the ins and out of dependency management and software vulnerability. To take on the dependency management for them, we've set up bundleDependencies to control which dependencies get installed. Previously we used shrinkwrap to that same effect.

However, this prevents teams with more developer support from taking more control over the prototypes’ dependencies, leaving them unable to address vulnerabilities as quickly as their organisations expect to meet their security policies.

This is where having overrides apply to bundled dependencies would be great! We could still abstract dependency management for less tech-savy users while giving control to teams that need quicker vulnerability resolutions.

主要语言
JavaScript
星标
10.3k
派生
5k
平均合并
4 天 11 小时
30 天内合并 PR
26

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

npm/cli 的其他 Issue

查看 npm/cli 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。