Separate module-author internals from the user-facing entry point
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/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ệ
- docker, node.js, typescript
Hướng nghiên cứu
Start with packages/testcontainers/src/index.ts, packages/testcontainers/package.json, and biome.json; review the imports used by the five named modules and the blockers #1558 and #1561, plus coordination issues #1528 and #1550. Define the test-author exports, the module subpath, and the deep-import boundary, then check that module imports and public Dockerode type exposure match the agreed split.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
testcontainers has a single entry point (main: build/index.js, no exports map) that serves both test authors and module authors. Utilities that exist for the modules and for core itself are exported next to the user-facing API, and every one of them is covered by semver:
log,IntervalRetry,RetryUuid,RandomUuid,randomUuidPortGenerator,RandomPortGeneratorBoundPorts,getContainerPort,hasHostBindinggetReaper,LABEL_TESTCONTAINERS_SESSION_IDContainerRuntimeClient,getContainerRuntimeClient,waitForContainer
Dockerode types are part of the public contract as well:
WaitStrategy.waitUntilReady(container: Dockerode.Container, ...)StartupCheckStrategy.checkStartupState(dockerClient: Dockerode, ...)- the protected
createOpts: ContainerCreateOptionsandhostConfig: HostConfigonGenericContainer, which subclasses read and write directly
That is why @types/dockerode is a runtime dependency, and why a Dockerode major is a breaking change here.
Because there is no exports map, consumers can also import anything under testcontainers/build/....
Usage inside this repo is narrow. Most modules import only GenericContainer, AbstractStartedContainer, Wait and StartedTestContainer. Five of them (kafka, redpanda, localstack, ollama, couchbase) reach for the runtime client, BoundPorts, waitForContainer or getReaper.
Expected
- The main entry exports what a test author needs.
- Module-author utilities move to a separate subpath (for example
testcontainers/module) with its own, looser stability promise. - An
exportsmap closes off deep imports. - Dockerode types stay out of the user-facing signatures where possible.
Where
packages/testcontainers/src/index.tspackages/testcontainers/package.jsonbiome.json(the import boundary rule that pins modules to thetestcontainersentry point)
Notes
- Removing exports and adding an
exportsmap are both breaking, hencemajor. - Related: #1528 (types that should be exported but are not).
- Go keeps this split with
internal/packages.
Dependencies
- Blocked by #1558: that removes
Dockerode.ContainerandBoundPortsfrom the wait strategy interface, which decides what is left to move. - Blocked by #1561: that removes the
Uuidexports outright. - Coordinate with #1528: both edit
index.ts. - Coordinate with #1550: an escape hatch is the alternative to subclasses reaching into the protected fields.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.6k
- Fork
- 274
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 44
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 testcontainers/testcontainers-node
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
testcontainers/testcontainers-node#1539 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
testcontainers/testcontainers-node#1533 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
testcontainers/testcontainers-node#1531 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
testcontainers/testcontainers-node#1529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
testcontainers/testcontainers-node#1528 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của testcontainers/testcontainers-node
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
xdjs/MusicNerdWeb#1532 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sebastian-software/ardo#352 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@react95/core good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 3 ngày
-
@shikijs/stream: `ShikiStreamTokenizer.clone()` shares its `tokensStable` array with the originalCó thể đã có người làm @xyrolle đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày