refactor(docker): split docker.ts into modules - #1093
Merged
Merged
Conversation
`lib/docker.ts` had grown to 825 lines covering container lifecycle, command execution, app installation, the Composer bootstrap, log extraction, snapshots and user creation. Split it into one module per concern under `lib/docker/`, with `lib/docker/index.ts` re-exporting the same 20 public names so the `@nextcloud/e2e-test-server/docker` subpath and the built entry names are unchanged. This is a pure move: no behaviour change. Three deltas were required to break the module cycle and are the only edits to the moved code: * the `_serverBranch` module state moved to `client.ts` behind `getServerBranch()`/`setServerBranch()`, since `lifecycle.ts` writes it and `configure.ts` reads it * `pathExists`, `sleep`, `asNodeStream`, `pruneAppsWritableVolume` and `APPS_WRITABLE_VOLUME` gained `export` to stay reachable across modules; they are not re-exported from the barrel and remain private * `getContainerIP` got an explicit `Container` annotation on its defaulted parameter `package.json` needed the `./docker` types path repointed to `./dist/docker/index.d.ts`; the previous `./dist/docker.d.ts` is no longer emitted, which would otherwise have left TypeScript consumers of that subpath without types. Verified with `ts:check`, `lint`, `build` (dist entry names and the runtime/type export sets are identical), and both node integration specs: 13/13 pass. Assisted-by: ClaudeCode:claude-sonnet-5 Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
skjnldsv
enabled auto-merge
September 4, 2026 11:12
susnux
approved these changes
Sep 4, 2026
susnux
left a comment
Contributor
There was a problem hiding this comment.
TBH not sure I find this more maintainable 😅
Contributor
Author
Really?? 😅😅😅 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lib/docker.tshad grown to 825 lines and mixed container lifecycle, commandexecution, app installation, the Composer bootstrap, log extraction, snapshots
and user creation. This splits it into one module per concern under
lib/docker/, withlib/docker/index.tsre-exporting the same 20 public names.No behaviour change, it is just a move.
This change was AI assisted.