-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[v2] Мonorepo, sdk-client, sdk-server, sdk-core package split
#1279
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
[v2] Мonorepo, sdk-client, sdk-server, sdk-core package split
#1279
Conversation
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can break this PR up somehow so that this is more reviewable? E.g. with using git mv to preserve history and provenance of files? As it is it'll be quite hard to verify correctness of the split.
… into feature/v2-monorepo-setup
|
EDITs:
TODOs still:
|
🦋 Changeset detectedLatest commit: c3b1a40 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome refactor, looking great. THANK YOU for taking the time to ensure git history is preserved - that made it MUCH easier to review 95% of this PR as the vast majority of this PR is just shuffling around imports for the new structure.
I peppered with comments, but most of them are questions I had as I was working through so I don't forget - not asks for modifications. Please ignore comments except this one for the next hour or so while I investigate and try to answer my own questions.
Some things I wanted to discuss for sure though:
-
We use!type checker overrides a lot in this PR. Is this an indication of behavior change or we've somehow tightenedtsconfigso we have to do this to satisfy the linter and these are pre-existing problems?
Addressed, we tightened our type checks and this has no runtime effect. If anything it's good to make it explicit so we can periodically fix it. -
I think we missed one test filetest/experimental/tasks/stores/in-memory.test.ts- there are 59 tests less in this version than in the currentmain, and this file contains exactly 59 tests.
Addressed, brought it back. Test count now matches exactly what it was before. -
We're creating a lot of packages andpackage.jsonfiles - my expectation was that we'd have 3 max:client,server,core. Is this typical? Are we adding complexity for either users or ourselves by doing this?
Addressed, welcome to Typescript 2025. Minimize dependencies we force people to import. -
Why change topnpm? What's the advantage of this? Are we making it more difficult for people to install the SDK? Is this a DevX improvement? I have no intuition of what this change means, is this a drop in replacement fornpm?
Addressed, this provides us a lot of utilities for monorepo dev with multiple packages thatnpmdoesn't support. It's also included withcorepackvia Node anyway, so minimal Dev friction for contributors, zero change for consumers of the SDK. -
Did you (or some agent 😄) potentially verify that the examples all still work as written here? Or is that something we still need to do?
Added to follow-ups for myself
|
Noting down some follow-ups to this PR we'll want to do as a note to self:
|
|
Managed to bring back cc @mattzcarey |
| ## v1 (legacy) documentation and fixes | ||
|
|
||
| If you are using the **v1** generation of the SDK, the **v1 documentation** (and any v1-specific fixes) live on the long-lived [`v1.x` branch](https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x). See: | ||
| [`https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x`](https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x). | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need a more visible pointer at the very top of the docs rather than at the bottom. And I think it's actually premature to call this "legacy" -> v1 will remain the primary version for the next few months at least. "legacy" language here implies we're dropping support basically straight away and people should use whatever is on main which isn't actually the case yet.
I think we should only call it legacy once we actually have a stable 2.0.0 release.
Can be a fast follow, noting it down.
…xamples-client->examples-client, sdk-examples-server->examples-server, sdk-examples-shared->examples-shared
felixweinberger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff!
Proof of Concept: v2 monorepo, package split
Motivation and Context
v1of the sdk shipped both client and server in the same package, introducing extra dependencies to users who have a single concern (client or server only). Client and server packages are now split, depending on a sharedcorepackage.Additionally,
v1exported all files as the public API of the SDK, limiting the SDK ability to iterate internally while keeping backwards compatibility. Barrel files are now introduced as the single entrypoint to the SDK and defining the public API of the SDK.How Has This Been Tested?
Unit, integration tests
Breaking Changes
v2
Types of changes
Checklist
Additional context