Skip to content

fix: Export the package root for require - #1013

Merged
razor-x merged 1 commit into
mainfrom
claude/js-sdk-audit-6x115l-l1a-cjs-exports
Aug 24, 2026
Merged

fix: Export the package root for require#1013
razor-x merged 1 commit into
mainfrom
claude/js-sdk-audit-6x115l-l1a-cjs-exports

Conversation

@razor-x

@razor-x razor-x commented Aug 24, 2026

Copy link
Copy Markdown
Member

Problem

SDK audit finding L1a (low): the exports map gave "." only types + import conditions, so CommonJS consumers (Jest, webpack CJS, ts-node CJS) got ERR_PACKAGE_PATH_NOT_EXPORTED from require('@seamapi/http'), while "./connect" used default and worked. The declared engine (Node ≥22.12) supports require(esm), so the missing condition was the sole blocker — and the README-advertised entry point was the broken one.

Fix

The root export uses the same default condition as "./connect".

Verification

Built the package and verified end-to-end:

old exports: require('@seamapi/http') → ERR_PACKAGE_PATH_NOT_EXPORTED
new exports: require('@seamapi/http') → SeamHttp function; ./connect unchanged

Full suite (125 tests) green.

Part of applying the rev-3 SDK audit (one PR per finding). Related: #1002#1012.

🤖 Generated with Claude Code

https://claude.ai/code/session_01B8xeJm2Hd923k8uo6eoFd2


Generated by Claude Code

The root export only declared types and import conditions, so
require('@seamapi/http') failed with ERR_PACKAGE_PATH_NOT_EXPORTED for
CommonJS consumers, while require('@seamapi/http/connect') worked
through its default condition. The declared Node engine supports
require of ES modules, so the missing condition was the only blocker.

Use the same default condition for the root export.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8xeJm2Hd923k8uo6eoFd2
@razor-x
razor-x requested a review from a team as a code owner August 24, 2026 19:52
@razor-x
razor-x merged commit 221aaef into main Aug 24, 2026
16 checks passed
@razor-x
razor-x deleted the claude/js-sdk-audit-6x115l-l1a-cjs-exports branch August 24, 2026 23:05
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.

2 participants