Repository navigation
Tweak strict types setup, fix type errors under strictTypes.ts - #806
Merged
Merged
Conversation
- Modified strict type generation to just remove .passthrough() (.strict() is ~a no-op)
- Fixed TypeScript errors when using strictTypes.ts (impl and tests)
- Added a test pass that runs everything with strictTypes imported into src/client/index.ts, src/server/{index.ts,mcp.ts}
- Added type annotations to Client/Server/McpServer methods for rollover ergo
bhosmer-ant
force-pushed
the
basil/zod-types-mods
branch
from
July 24, 2025 04:40
4f23e70 to
a13c3bc
Compare
bhosmer-ant
commented
Jul 24, 2025
| "fetch:spec-types": "curl -o spec.types.ts https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/refs/heads/main/schema/draft/schema.ts", | ||
| "generate:strict-types": "tsx scripts/generateStrictTypes.ts", | ||
| "check:strict-types": "npm run generate:strict-types && git diff --exit-code src/strictTypes.ts || (echo 'Error: strictTypes.ts is out of date. Run npm run generate:strict-types' && exit 1)", | ||
| "test:strict-types": "node scripts/test-strict-types.js", |
Contributor
Author
There was a problem hiding this comment.
this temp replaces the imports of "types.js" with "strictTypes.js" and runs all tests
bhosmer-ant
commented
Jul 24, 2025
|
|
||
| // Remove the @deprecated comment block | ||
| const deprecatedCommentPattern = /\/\*\*\s*\n\s*\*\s*@deprecated[\s\S]*?\*\/\s*\n/; | ||
| content = content.replace(deprecatedCommentPattern, ''); |
Contributor
Author
There was a problem hiding this comment.
this omits the "passthrough will be deprecated" comment that's at the top of types.js
ihrpr
reviewed
Jul 24, 2025
|
|
||
| protected assertRequestHandlerCapability(method: string): void { | ||
| switch (method) { | ||
| case "sampling/createMessage": |
Contributor
There was a problem hiding this comment.
yep, that's the case that convinced me we need to fix types
ihrpr
approved these changes
Jul 24, 2025
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.
Uh oh!
There was an error while loading. Please reload this page.