Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#220 3 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend, build-system

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
TypeScript
Star
9.5k
Fork
552
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
49

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cloudflare/computer

Tất cả issue của cloudflare/computer

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.