fix(analytics-node): export NodeClient and NodeOptions from Types namespace#1759
Open
budde377 wants to merge 1 commit into
Open
fix(analytics-node): export NodeClient and NodeOptions from Types namespace#1759budde377 wants to merge 1 commit into
budde377 wants to merge 1 commit into
Conversation
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.
Summary
Closes #1758.
The
@amplitude/analytics-nodepackage'sTypesnamespace re-exports a curated list from@amplitude/analytics-corebut omitsNodeClientandNodeOptions. This is asymmetric with@amplitude/analytics-browser'sTypesnamespace, which does re-export the equivalentBrowserClient,BrowserConfig, andBrowserOptions.As a result, code that references
amplitude.Types.NodeClientoramplitude.Types.NodeOptionssilently resolves toany. The most visible victim is the Ampli code generator (Runtimenode.js:typescript-ampli-v2), which emits generated clients of the form:Those generated files ship with
// @ts-nocheck, which hides the breakage from the typechecker, so downstream consumers lose type safety with no warning.This PR adds the two symbols to
packages/analytics-node/src/types.ts, restoring symmetry with the browser package and makingamplitude.Types.NodeClient/amplitude.Types.NodeOptionsresolve to their real types.Checklist
Note
Low Risk
Low risk: this only expands public type re-exports for the Node package and does not change runtime behavior.
Overview
Exports
NodeClientandNodeOptionsfrompackages/analytics-node/src/types.ts, making these core Node-specific types available via the analytics-node package's public types surface.Reviewed by Cursor Bugbot for commit 66d26ce. Bugbot is set up for automated code reviews on this repo. Configure here.