Repository navigation
refactor(types): strip internals from the built declarations - #107
Merged
Merged
Conversation
What the package marks as internal no longer ships in its declarations (`stripInternal`), such as `WebhookVerifier.receiverConfig()` and `requireInbox()`. The JavaScript is unchanged; an app can no longer call them through the types. `WebhooksModuleRootOptions`, which `forRoot()` takes, and `WebhooksModuleStructure` are now exported. CI now type-checks the built declarations, as a consumer does and with `skipLibCheck` off, so a declaration that names something stripped fails there instead of in an application.
kamilmysliwiec
force-pushed
the
chore/strip-internal
branch
from
December 4, 2026 11:12
92b81ab to
8ef65d5
Compare
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.
PR Checklist
PR Type
What is the current behavior?
Members marked
@internalship in the published declarations, because the build doesn't setstripInternal. An app can call them through the types, which would make them part of what 1.0.0 freezes. Same change as nestjs/authentication#146.What is the new behavior?
Internal members are stripped from the declarations. The JavaScript is unchanged. What disappears from the types:
WebhookVerifier.receiverConfig()andrequireInbox().Now exported, so an app can name what public signatures use:
WebhooksModuleRootOptions(whatforRoot()takes) andWebhooksModuleStructure.Two checks in CI, after the build:
tests/declarationstype-checks the built declarations as a consumer does (it expects an error on each stripped member), andtests/declarations/tsconfig.lib.jsontype-checks the declarations themselves withskipLibCheckoff, so a declaration that names something stripped fails there.Decision to confirm
The strict check also covers the declarations of our dependencies, so a dependency that ships a broken type file would turn
buildred. It passes today.Does this PR introduce a breaking change?
Tests
stripInternal(unused@ts-expect-error), and passes on this one.distremoved, as the e2e jobs run it.