Pick up npm config for alternative npm registries, custom ca, etc.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
調査の方向性
まず、ember-cli-update と boilerplate-update がどのように pacote を呼び出しているかを追跡し、downloadAndCheckForUpdates、getApplicableCodemods、getCodemods、getVersions に焦点を当てます。提案されている npm-conf のアプローチと pacote のオプションを比較し、そのうえで一貫した設定経路を定義します。分散した opts の変更を必要とせず、代替レジストリとカスタム CA 証明書が尊重されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Unfortunately embrer-cli-update won't work in environments that rely on customising the npm registry.
I feel Ember is a good option for enterprises, which are often in this situation of using an internal mirror registry. It would be great to smooth the Ember upgrade experience by being able to use this tool.
Two issues here:
- using wrong registry
- not picking up custom CA certs
❯ ember-cli-update --to 4.12
FetchError: request to https://registry.npmjs.org/ember-cli failed, reason: self-signed certificate in certificate chain
at ClientRequest.<anonymous> (/<redacted global path>/node_modules/ember-cli-update/node_modules/minipass-fetch/lib/index.js:130:14)
at ClientRequest.emit (node:events:517:28)
at TLSSocket.socketErrorListener (node:_http_client:501:9)
at TLSSocket.emit (node:events:517:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'SELF_SIGNED_CERT_IN_CHAIN',
errno: 'SELF_SIGNED_CERT_IN_CHAIN',
type: 'system'
}
I assume the best way for this tool to work is that it is aware of npm config, however that is passed to npm. (env, flags, npmrc)
Hacky solution
I have cobbled together a solution that uses npm-conf to grab the npm configuration and pass it into the various pacote methods' opts param.
In boilerplate-update I also modified these functions to take an opts arg to pass to pacote:
downloadAndCheckForUpdates getApplicableCodemods getCodemods getVersions.
It sort of works, but doesn't feel like the most elegant design.
Considering something more ideal
It would be nice if pacote could be configured to pick up npm config out of the box.
Maybe, as an interim, pacote could be wrapped/proxied within boilerplate-update to pick up npm config when necessary. Expose that same proxy for ember-cli-update to make use of. This should require less changes to the various method signatures within ember-cli-update and boilerplate-update
Then there's npm-conf not npm official, and not well maintained, but has significant use.
To me, this still feels hacky, and really there should be some module npm relies on that we can also rely on for picking up npm config.
What do you reckon @kellyselden? Is there a better approach you're aware of?
- 主要言語
- JavaScript
- スター
- 279
- フォーク
- 44
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ember-cli/ember-cli-update のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
ember-cli/ember-cli-update#1263 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
ember-cli/ember-cli-update#1256 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ember-cli/ember-cli-update#1255 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
ember-cli/ember-cli-update#1254 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
ember-cli/ember-cli-update#1218 · コメント 2 件 ·
ember-cli/ember-cli-update の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
antfu-collective/icones#398 ·
-
ECmail.com オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
wesbos/burner-email-providers#554 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
components-web-app/docs#92 ·