Skip to content

fix(sdk-recorder): fix CapRecorder.on unsubscribe type error and add tsconfig reference - #2917

Open
ryder777777 wants to merge 2 commits into
CapSoftware:mainfrom
ryder777777:fix/sdk-recorder-dts-build-2915
Open

ryder777777 wants to merge 2 commits into
CapSoftware:mainfrom
ryder777777:fix/sdk-recorder-dts-build-2915

Conversation

@ryder777777

@ryder777777 ryder777777 commented Oct 22, 2026 •

Copy link
Copy Markdown

Summary

  • Fixes the TypeScript type error (TS2345) in CapRecorder.on's unsubscribe callback (packages/sdk-recorder/src/index.ts:88) by casting handler to EventHandler<keyof RecorderEventMap> before passing it to Set.add and Set.delete.
  • Enables "composite": true and "emitDeclarationOnly": true in packages/sdk-recorder/tsconfig.json and adds { "path": "./packages/sdk-recorder" } to the root tsconfig.json references so bun run typecheck checks @cap/sdk-recorder.

Closes #2915

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Fixes the unsubscribe type error in CapRecorder.on and adds @cap/sdk-recorder to root typechecking.

  • Recorder event listeners can now be unsubscribed without a type mismatch.
  • The root TypeScript build now checks the recorder SDK.

Reviews (1) · Last reviewed commit: "fix(sdk-recorder): fix CapRecorder.on un..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@ryder777777 is attempting to deploy a commit to the Cap Software Inc Team on Vercel.

A member of the Team first needs to authorize it.

@richiemcilroy

Copy link
Copy Markdown
Member

Thanks @ryder777777, nice catch on #2915! The castHandler change in packages/sdk-recorder/src/index.ts is right: add and delete now get the same reference, and tsc --noEmit passes on this branch. One problem though: adding "composite": true to packages/sdk-recorder/tsconfig.json breaks the package's own build. tsup's DTS step reads that tsconfig, and with composite on, bun run --cwd packages/sdk-recorder build now fails with TS6307: File '.../src/core/mime-types.ts' is not listed within the file list of project '' (same for stream-manager.ts and upload/multipart-client.ts). So the build from #2915 still exits 1, it just fails on a different error now. Could you turn composite off for the tsup DTS pass in packages/sdk-recorder/tsup.config.ts, i.e. replace dts: true, with dts: { compilerOptions: { composite: false } },? With that change tsup emits dist/index.d.ts, dist/react/index.d.ts and the shared types chunk, and tsc -b from the root still covers the package through the new reference. Thanks!

@ryder777777

Copy link
Copy Markdown
Author

Good catch, thanks! Just updated tsup.config.ts to set dts: { compilerOptions: { composite: false } } and pushed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: bun run build fails on @cap/sdk-recorder DTS — package is outside the typecheck graph

2 participants