docs: fix index.ts as the only public surface (ADR-0006) - #293
Closed
diegolmello wants to merge 4 commits into
Closed
docs: fix index.ts as the only public surface (ADR-0006)#293diegolmello wants to merge 4 commits into
diegolmello wants to merge 4 commits into
Conversation
The file is a one-line re-export that forwards nothing and has no importer in this repository. It exists only to serve a deep path, which is the practice the ADR bans, so it belongs in the Decision rather than unmentioned. Also states the consumer exception as an invariant — deep imports from test files only — instead of two hardcoded paths in another repository.
This was referenced Aug 14, 2026
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.
Proposed changes
The package ships TypeScript source with
mainatindex.ts, noexportsmap and nofileslist, so every path in the repository resolves for a consuming app whileindex.tsnames onlysettingsandRocketchat. No line was drawn between the two, so no change to a module underlib/could be judged as breaking or not — deleting an unused helper was answerable only by grepping the consuming app.ADR-0006 draws it:
index.tsis the only public surface, and anything not exported from it is internal. No exception is written for Rocket.Chat.ReactNative's remaining deep imports oflib/drivers/ddp— whether one still held is a fact about the other repository that nothing here can observe. The ADR states the expectation instead, and theexportsmap is what would make it true.CONTEXT.mdgains the two terms the ADR introduces, Public surface and Deep import.clients/Rocketchat.tsis deleted with the same change. It is a one-lineexport *over a module whose only export is a default, so it forwards nothing, and no file in this repository imports it — it exists only to serve the deep path@rocket.chat/sdk/clients/Rocketchat, which is the practice the ADR bans.The ADR is explicit that this is unenforced convention until an
exportsmap exists, and gives the order that would make it real: widenindex.tswith the realtime contracts, move the consuming app onto that path, then add the map.Merge #257 first. The ADR cites the
debouncedeletion fromlib/util.tsas the change that had no rule to judge it, and that deletion lands in #257 — until it merges, the sentence describes something the base branch has not seen yet.Steps to reproduce
grep -rn "clients/Rocketchat"over this repository matches the deleted file itself and one more line:index.tsimporting the default fromlib/clients/Rocketchat. Nothing imports the root-level file.export *forwarded nothing at all.Tests
No tests added — the deleted file has no importer and no runtime behaviour.
npm run typecheckclean.