Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Make just-bash and acorn optional peer dependencies, pulled in only by the backend that needs them

オープン
#220 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

Start with the dependencies block in package.json, then grep for just-bash imports under backends/worker-shell and the acorn import in backends/worker-javascript/module-graph.ts. Move both packages to peerDependencies with optional set in peerDependenciesMeta, and add a constructor check in each backend that throws an error naming the missing package. Update the README sections and Installation. Done when a consumer installs without either package, the filesystem, git and container backends still work, and constructing a backend without its peer throws the named error. Settle the capnweb question separately.

索引モデルが issue の本文から書いたものです。

説明

enhancement

@cloudflare/computer lists acorn and just-bash in dependencies. Every consumer installs them, including ones that only use the filesystem, git, or the container backend:

  • just-bash is imported only by the worker-shell backend (backends/worker-shell/*).
  • acorn is imported only by the worker-javascript backend (backends/worker-javascript/module-graph.ts).

Those backends ship as separate subpath entries, so a bundler drops the code when it isn't imported. The packages still get installed and resolved, and they land in the lockfile. That matters for packages that build on Computer. We want @cloudflare/think in cloudflare/agents to default to a Computer Workspace, and Think users shouldn't pull in a shell interpreter or a JS parser they never run.

Proposal
  • Move just-bash and acorn to peerDependencies and mark them optional in peerDependenciesMeta, the same pattern ai, zod, and @platformatic/vfs already follow.
  • Document in each backend's README section and in Installation that backends/worker-shell needs just-bash and backends/worker-javascript needs acorn.
  • If a backend is constructed and its peer is missing, throw an error naming the package to install.
  • While at it, check whether capnweb can go the same way for consumers that never use the container backend or the remote client.
主要言語
TypeScript
スター
9.5k
フォーク
552
平均マージ
2日 6時間
マージ済み PR(30日)
47

環境構築

はじめの一歩

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

cloudflare/computer のほかの issue

cloudflare/computer の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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