From ec34e8a7e6c5070fc9b72e77341d48b14b58bc35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 07:18:55 +0000 Subject: [PATCH 1/2] Bump typescript from 5.3.3 to 5.5.2 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.3.3 to 5.5.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](https://github.com/Microsoft/TypeScript/compare/v5.3.3...v5.5.2) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb801cb..a026bd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "ts-mocha": "^10.0.0", "ts-node": "^10.9.2", "tsx": "^4.7.0", - "typescript": "^5.0.4", + "typescript": "^5.5.2", "web-streams-polyfill": "^3.3.2" }, "engines": { @@ -6048,9 +6048,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -10889,9 +10889,9 @@ } }, "typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "dev": true }, "ua-parser-js": { diff --git a/package.json b/package.json index 2ebcf0c..b848c6f 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "ts-mocha": "^10.0.0", "ts-node": "^10.9.2", "tsx": "^4.7.0", - "typescript": "^5.0.4", + "typescript": "^5.5.2", "web-streams-polyfill": "^3.3.2" }, "peerDependencies": { From 832727338127a7ff3f9435a27dca3820a70df231 Mon Sep 17 00:00:00 2001 From: larabr <7375870+larabr@users.noreply.github.com> Date: Fri, 21 Jun 2024 18:39:59 +0200 Subject: [PATCH 2/2] Tests: bump web-streams-polyfill to v4 to fix tests --- package-lock.json | 14 +++++++------- package.json | 2 +- test/node.test.ts | 6 +++--- test/typescript.test.ts | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index a026bd1..f1fbab7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "ts-node": "^10.9.2", "tsx": "^4.7.0", "typescript": "^5.5.2", - "web-streams-polyfill": "^3.3.2" + "web-streams-polyfill": "^4.0.0" }, "engines": { "node": ">= 18.0.0" @@ -6224,9 +6224,9 @@ } }, "node_modules/web-streams-polyfill": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz", - "integrity": "sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0.tgz", + "integrity": "sha512-0zJXHRAYEjM2tUfZ2DiSOHAa2aw1tisnnhU3ufD57R8iefL+DcdJyRBRyJpG+NUimDgbTI/lH+gAE1PAvV3Cgw==", "dev": true, "engines": { "node": ">= 8" @@ -11004,9 +11004,9 @@ } }, "web-streams-polyfill": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz", - "integrity": "sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0.tgz", + "integrity": "sha512-0zJXHRAYEjM2tUfZ2DiSOHAa2aw1tisnnhU3ufD57R8iefL+DcdJyRBRyJpG+NUimDgbTI/lH+gAE1PAvV3Cgw==", "dev": true }, "webpack": { diff --git a/package.json b/package.json index b848c6f..123940f 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "ts-node": "^10.9.2", "tsx": "^4.7.0", "typescript": "^5.5.2", - "web-streams-polyfill": "^3.3.2" + "web-streams-polyfill": "^4.0.0" }, "peerDependencies": { "typescript": ">=4.2" diff --git a/test/node.test.ts b/test/node.test.ts index a624736..abb19ea 100644 --- a/test/node.test.ts +++ b/test/node.test.ts @@ -37,16 +37,16 @@ describe('Node integration tests', () => { it('polyfilled web stream cannot be converted into node native stream', async () => { const { ReadableStream: PolyfilledReadableStream } = await import ('web-streams-polyfill'); - // this test is just to keep track that this behaviour is expected + // this test is just to keep track that this behaviour is expected: it does not cause a TS error, but a runtime one const input = 'chunk'; - const stream = new PolyfilledReadableStream({ + const stream: NodeWebReadableStream = new PolyfilledReadableStream({ start(controller) { controller.enqueue(input); controller.close(); } }); const streamedData = toStream(stream); - // @ts-expect-error `fromWeb` does not accept the polyfilled stream + // `fromWeb` does not accept the polyfilled stream expect(() => NodeNativeReadableStream.fromWeb(streamedData)).to.throw(/must be an instance of ReadableStream/); }); }); diff --git a/test/typescript.test.ts b/test/typescript.test.ts index af19767..0103aa2 100644 --- a/test/typescript.test.ts +++ b/test/typescript.test.ts @@ -33,10 +33,10 @@ const newEmptyWebStream = (): WebStream => new WebReadableStr const expectedWebStreamButActualNodeStream: WebStream = toStream(nodeWebStream); assert(expectedWebStreamButActualNodeStream instanceof NodeWebReadableStream); const newStringStream: Stream = toStream('chunk'); - assert(newStringStream instanceof WebReadableStream); // ReadableStream is polyfilled + assert(newStringStream instanceof NodeWebReadableStream); // @ts-expect-error detect type parameter mismatch const anotherStringStream: Stream = toStream('chunk'); - assert(anotherStringStream instanceof WebReadableStream); // ReadableStream is polyfilled + assert(anotherStringStream instanceof NodeWebReadableStream); assert(isArrayStream(new ArrayStream())) ; // ensure Array is actually extended in e.g. es5