cli: help examples are fixed at construction and can't reflect where a command is mounted
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
- 68/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Start at Command.withExamples and buildHelpDoc, which already receives commandPath for the USAGE line. Trace how examples are stored and rendered, then verify that the new callback form resolves against the mounted path while the existing array form remains unchanged. Confirm the generated help examples work for commands mounted directly and as subcommands.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What is the problem this feature would solve?
USAGE reflects where a command is mounted; its examples don't — they're fixed strings written at construction. Mount one command in two places (own bin, and subcommand of a larger CLI) and its examples describe an invocation that doesn't work.
It can't be fixed in user land: a child is built before withSubcommands attaches it, so the path isn't knowable when withExamples runs. The only workaround is threading the mount path into every command factory by hand.
What is the feature you are proposing to solve the problem?
An overload of Command.withExamples taking (commandPath: ReadonlyArray<string>) => ReadonlyArray<Example>, resolved in buildHelpDoc, which already receives commandPath for the USAGE line. Additive — the array form is unchanged.
Command.withExamples(create, (path) => [
{ command: `${path.join(" ")} --yes`, description: "Take every default." },
])
What alternatives have you considered?
- Threading the mount path in by hand — what we do now: every command factory takes the path it's mounted at and interpolates it into its own examples. Works, but re-supplies what the parser already computes, and nothing checks the two agree.
- Prefixing examples at the mount site via the public
examplesfield andwithExamples. Same information written in the same place, and it doesn't recurse into grandchildren. - Auto-prefixing relative examples with the usage path. Nicest to write, but breaks every existing absolute example — would need its own combinator.
- A custom help renderer that rewrites examples against the path. Not available:
runtakes only{ version }.
- Ngôn ngữ chính
- TypeScript
- Star
- 16.7k
- Fork
- 808
- Merge trung bình
- 11 giờ 11 phút
- Pull request đã merge (30 ngày)
- 840
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Effect-TS/effect
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
@effect/ai-anthropic: text_editor_20250728 insert decodes `new_str`, but the API sends `insert_text`Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[email protected]: crypto/KeyFormat declarations require the global JsonWebKey, breaking Node-only type-checksCó thể đã có người làm @effect-bot đã nhận hôm nay. Đang mở
Effect-TS/effect#10115 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sql-pg: send several statements in one extended-query Sync (transaction-local context without extra round trips)Có thể đã có người làm @effect-bot đã nhận hôm nay. Đang mở
Effect-TS/effect#10113 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Effect-TS/effect
Issue tương tự
-
Parallel reticle_verify opens per-flow leases without the source lease's ignoreHTTPSErrorsCó thể đã có người làm @as992949791 đã nhận hôm nay. Đang mởgood first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
reticlehq/reticle#2033 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:quality p3-medium ready-for-agent type:docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
fderuiter/deruiter.dev#3589 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
manfredsteyer/angular-oauth2-oidc#1514 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
marmelab/react-admin#11431 ·
Maintainer thường phản hồi trong vòng 1 ngày