fix: avoid DOM-only HeadersInit in v1 declarations - #2570
Conversation
🦋 Changeset detectedLatest commit: 10b945a The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Rebased this branch onto current Re-ran the relevant local checks after the rebase: npm ci
npm run build:esm
npm run build:cjs
npm run typecheck
npm run lint
npm test -- test/client/sse.test.ts test/client/streamableHttp.test.ts
git diff --check upstream/v1.x..HEADResults: ESM/CJS builds passed, typecheck passed, lint/prettier passed, focused client transport tests passed ( Note: before |
6b74bc7 to
10b945a
Compare
commit: |
Summary
Fixes the v1 declaration output so Node-only TypeScript projects do not need the DOM lib just to consume
normalizeHeaders.The generated
shared/transport.d.tscurrently exposes the bare globalHeadersInit, which is not provided by@types/nodeeven when Node fetch globals are enabled. This changes the public signature toRequestInit['headers'], matching the same runtime inputs without pulling in a DOM-only alias.Also updates two internal client header annotations for the same reason and adds a patch changeset.
Verification
npm run build:esm npm run build:cjs npm run typecheck npm run lint npm test -- test/client/sse.test.ts test/client/streamableHttp.test.tsNode-only declaration smoke test:
Result:
npx tsc -p tsconfig.jsonpasses.Fixes #2568