Resolve `npm:`/`jsr:` versions from the installed tree for Deno-based presets
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- deno, typescript
- 領域
- backend, build-system
調査の方向性
既存の TracedPackage.versions ロギングがある src/build/plugins/externals.ts と、nitro.options.node のチェックがある src/build/plugins.ts から始め、deno_deploy と bunny のプリセットがこれらのパスをどのように設定しているかを比較してください。オプトイン設定と推移的依存関係の動作を明確にし、その後、関連する Deno プリセットでインストール済みの直接依存関係のバージョンが出力されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Describe the feature
While fixing something on the Bunny preset (#4025) I've made the Deno-based presets keep npm: and jsr: specifiers external, so import { escape } from "npm:[email protected]" survives the bundle and gets resolved by the runtime instead of failing to resolve at build time.
That part works, but pinning the version is currently entirely on the user. What I would actually like is to mark a package as external and have Nitro emit the version that is installed, so a plain import { decodeJwt } from "unjwt" comes out as npm:[email protected] even when package.json says ^0.7.0.
The clearest win is on Bunny, where the script is a single file with a 10MB cap, so keeping deps out of the bundle actually matters. Tho it would apply to deno_server and deno_deploy just as well, for custom implementations and runtimes.
Most of the machinery seems to already be there: nf3 hands us the exact resolved versions per package (TracedPackage.versions), and we already consume that hook in
externals.ts only to log them.
Two things I got stuck on though:
- the trace only runs when
nitro.options.nodeistrue, and the presets that would want this (deno_deploy,bunny) setnode: false. So the version resolution would need to be independent from the file-copying path - it only pins the direct dependency. Deno then resolves the transitive ones from the registry on its side, so it is a partial pin and not really a lockfile equivalent. I am not sure whether that is acceptable or if it defeats the point
I also have no strong opinion on the config surface, an opt-in list of packages feels right but that is about as far as I got.
Additional information
- Would you be willing to help implement this feature?
- 主要言語
- TypeScript
- スター
- 11.5k
- フォーク
- 968
- 平均マージ
- 4日 9時間
- マージ済み PR(30日)
- 64
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nitrojs/nitro のほかの issue
-
pending triage
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
メンテナーはふだん 2 日以内に返信
-
cloudflare: `nitro deploy` fails when a parent directory has a Wrangler config対応中かも @draarivpatel-ui が 13 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 2 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
pending triage
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
nitrojs/nitro#5205 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
amosblomqvist/learnharness#1141 ·
メンテナーはふだん 4 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ranxianglei/billion-context#8319 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
tencent-connect/dsh-qqbot#148 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
JimLiu/open-artifact#126 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100