Separate module-author internals from the user-facing entry point
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- docker, node.js, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 2.6k
- Fork
- 274
- Merge medio
- 1g 14h
- PR unite (30g)
- 44
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di testcontainers/testcontainers-node
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
testcontainers/testcontainers-node#1539 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
testcontainers/testcontainers-node#1533 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
testcontainers/testcontainers-node#1531 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
testcontainers/testcontainers-node#1529 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
testcontainers/testcontainers-node#1528 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di testcontainers/testcontainers-node
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
siyuan-note/siyuan#20629 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Volume eject does not refuse system, root or /home mountsForse già presa @bernardopg l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
spacedriveapp/spacedrive#3159 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
melgarafael/DeskcommCRM#3000 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
callstackincubator/simlock#639 ·
I maintainer di solito rispondono entro 1 giorno