-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix: Barrel file exports #870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix: Barrel file exports #870
Conversation
…lcontextprotocol/sdk/client and @modelcontextprotocol/sdk/shared
@cliffhall @ihrpr this is an extension to #851 |
This looks good to me in this view. One important thing for reviewers to do is make certain that the new |
Let's include it in V2 |
@ihrpr maybe we could add a |
I'm marking those PRs with V2 milestone |
Extension to #851 and #511
Motivation and Context
The SDK currently exports from all files, which leads to users/implementors having to import from multiple places from the SDK.
Example:
This PR introduced index.ts barrel files under the following namespaces:
The above snippet would now look like:
How Has This Been Tested?
Unit tests continue to run with no issues.
Breaking Changes
No, it's an improvement and not a breaking change.
Types of changes
Checklist
Additional context
There are two files which were a bit controversial "./types.ts", and "./inMemory.ts". These are currently residing at the root level, although they are really "shared". Thus the shared namespace is re-exporting them.
Additionally, the previous client/index.ts contents was moved to client/client.ts and server/index.ts was moved to server/server.ts respectively. Since these two files are now re-exported by the index.ts files, there is no breaking change.