fix: Export the package root for require - #1013
Merged
Merged
Conversation
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
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.
Problem
SDK audit finding L1a (low): the exports map gave
"."onlytypes+importconditions, so CommonJS consumers (Jest, webpack CJS, ts-node CJS) gotERR_PACKAGE_PATH_NOT_EXPORTEDfromrequire('@seamapi/http'), while"./connect"useddefaultand worked. The declared engine (Node ≥22.12) supportsrequire(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
defaultcondition as"./connect".Verification
Built the package and verified end-to-end:
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