Allow overrides to affect dependencies bundled in a dependency

オープン
#10,120 コメント 0 件 リアクション 6 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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時間
マージ済み PR(30日)
26

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

npm/cli のほかの issue

npm/cli の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。