From 7150baa48b78176dd670a8c34ad7b1da1acb4818 Mon Sep 17 00:00:00 2001 From: ihrpr Date: Fri, 27 Jun 2025 15:53:18 +0100 Subject: [PATCH 1/5] add a test to check node version in CI --- src/shared/url-canparse.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/shared/url-canparse.test.ts diff --git a/src/shared/url-canparse.test.ts b/src/shared/url-canparse.test.ts new file mode 100644 index 000000000..2075d0945 --- /dev/null +++ b/src/shared/url-canparse.test.ts @@ -0,0 +1,22 @@ +import { describe, it, expect } from '@jest/globals'; + +describe('URL.canParse compatibility', () => { + it('should use URL.canParse which requires Node.js 18.17.0+', () => { + // This test will fail on Node.js < 18.17.0 + expect(typeof URL.canParse).toBe('function'); + + // Test that it works correctly + expect(URL.canParse('https://example.com')).toBe(true); + expect(URL.canParse('not-a-url')).toBe(false); + }); + + it('demonstrates the actual usage in our codebase', () => { + // This mimics how we use URL.canParse in auth.ts + const validateRedirectUri = (uri: string) => { + return URL.canParse(uri); + }; + + expect(validateRedirectUri('https://example.com/callback')).toBe(true); + expect(validateRedirectUri('invalid://[not-valid')).toBe(false); + }); +}); \ No newline at end of file From a221e1d1b88709474b9adb7c40f5ae7a7d1720f3 Mon Sep 17 00:00:00 2001 From: ihrpr Date: Fri, 27 Jun 2025 16:12:11 +0100 Subject: [PATCH 2/5] cehck build --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04ba17c90..8c3bd5512 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 18.0.0 # Test on minimum supported version cache: npm - run: npm ci From 1c4c06a4a6e1dd6b7bd0837805345930a7539e08 Mon Sep 17 00:00:00 2001 From: ihrpr Date: Fri, 27 Jun 2025 16:32:44 +0100 Subject: [PATCH 3/5] now update to 18.17.0 --- .github/workflows/main.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8c3bd5512..4b08021a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18.0.0 # Test on minimum supported version + node-version: 18.17.0 # Test on minimum supported version cache: npm - run: npm ci diff --git a/package.json b/package.json index 31bc3562c..1f1431fce 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "url": "git+https://github.com/modelcontextprotocol/typescript-sdk.git" }, "engines": { - "node": ">=18" + "node": ">=18.17.0" }, "keywords": [ "modelcontextprotocol", From 2929559c3183037122926daec4b3b3fac881e857 Mon Sep 17 00:00:00 2001 From: ihrpr Date: Fri, 27 Jun 2025 16:40:31 +0100 Subject: [PATCH 4/5] 18 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b08021a2..04ba17c90 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18.17.0 # Test on minimum supported version + node-version: 18 cache: npm - run: npm ci From fc50f6a5011f49e2be96fa16d307d977e2dc8e25 Mon Sep 17 00:00:00 2001 From: ihrpr Date: Fri, 27 Jun 2025 16:43:48 +0100 Subject: [PATCH 5/5] test --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04ba17c90..4b08021a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 18.17.0 # Test on minimum supported version cache: npm - run: npm ci