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

Separate module-author internals from the user-facing entry point

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, node.js, typescript
領域
api, backend

調査の方向性

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.

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

説明

maintenance major

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, Retry
  • Uuid, RandomUuid, randomUuid
  • PortGenerator, RandomPortGenerator
  • BoundPorts, getContainerPort, hasHostBinding
  • getReaper, LABEL_TESTCONTAINERS_SESSION_ID
  • ContainerRuntimeClient, getContainerRuntimeClient, waitForContainer

Dockerode types are part of the public contract as well:

  • WaitStrategy.waitUntilReady(container: Dockerode.Container, ...)
  • StartupCheckStrategy.checkStartupState(dockerClient: Dockerode, ...)
  • the protected createOpts: ContainerCreateOptions and hostConfig: HostConfig on GenericContainer, 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 exports map closes off deep imports.
  • Dockerode types stay out of the user-facing signatures where possible.

Where

  • packages/testcontainers/src/index.ts
  • packages/testcontainers/package.json
  • biome.json (the import boundary rule that pins modules to the testcontainers entry point)

Notes

  • Removing exports and adding an exports map are both breaking, hence major.
  • Related: #1528 (types that should be exported but are not).
  • Go keeps this split with internal/ packages.

Dependencies

  • Blocked by #1558: that removes Dockerode.Container and BoundPorts from the wait strategy interface, which decides what is left to move.
  • Blocked by #1561: that removes the Uuid exports outright.
  • Coordinate with #1528: both edit index.ts.
  • Coordinate with #1550: an escape hatch is the alternative to subclasses reaching into the protected fields.
主要言語
TypeScript
スター
2.6k
フォーク
274
平均マージ
1日 14時間
マージ済み PR(30日)
44

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

testcontainers/testcontainers-node のほかの issue

testcontainers/testcontainers-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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