Conversation
- Upgrade development Node.js version from v18 to v22 in .nvmrc - Update CI lint workflow to use Node 22 - Expand CI test matrix to cover Node 18, 20, 22, and 23 - Fix type guard functions (isRequest, isResponse, isNotification) to return strict boolean values instead of falsy values - Add comprehensive tests for type guards, environment detection, McpError serialization, and Zod schema validation - Keep package.json engines at >=18 for user compatibility
There was a problem hiding this comment.
Pull request overview
This PR upgrades the development Node.js version from v18 to v22 while maintaining backward compatibility, expands CI test coverage across Node 18, 20, 22, and 23, and adds comprehensive test suites for type guards, environment detection, and Zod schemas.
Changes:
- Update development Node.js version to v22 in
.nvmrcand lint workflow - Expand CI test matrix to include Node 18, 20, 22, and 23
- Wrap type guard return expressions in
Boolean()for strict boolean returns - Add comprehensive tests for type guards (
isRequest,isResponse,isNotification), environment detection (isNode,isBrowser), andMcpErrorserialization - Add new test file for validating Zod schemas and ErrorCode constants
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.nvmrc |
Updates development Node.js version from v18 to v22 |
.github/workflows/lint.yml |
Updates lint workflow to use Node 22 |
.github/workflows/test.yml |
Expands test matrix to include Node 18, 20, 22, and 23 |
src/shared/utils.ts |
Wraps type guard return expressions in Boolean() for explicit boolean coercion |
test/utils.test.ts |
Adds comprehensive tests for type guards, environment detection, and McpError serialization |
test/types.test.ts |
Adds new test file covering JSON-RPC schemas, Tool/Resource schemas, and ErrorCode validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
.nvmrcpackage.jsonengines at>=18for user compatibilityTest plan