This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-js.git


The following commit(s) were added to refs/heads/main by this push:
     new 2959df2  chore: remove @openpgp/web-stream-tools dependency (#476)
2959df2 is described below

commit 2959df2891b40920319b410edf7a563d723f91c6
Author: Kent Wu <[email protected]>
AuthorDate: Mon Sep 21 15:05:49 2026 -0700

    chore: remove @openpgp/web-stream-tools dependency (#476)
    
    ## Summary
    
    Removes `@openpgp/web-stream-tools` dependency and replaces it with a
    local `concatStream()` implementation.
    
    - The package changed from CommonJS-compatible (v0.0.13) to pure
    ESM-only (v0.3.1), breaking Jest's module resolution
    - Even with Jest 30, dynamic imports of pure ESM packages fail with
    "Cannot find module"
    - Only 3 tests use this package for concatenating ReadableStreams, a
    simple ~15-line function
    - Local implementation eliminates the external dependency and ESM
    compatibility issues
    
    Verified all 696 tests in `test/unit/ipc/reader/streams-dom-tests.ts`
    pass with the local implementation.
    
    ## Test Plan
    
    - [x] `npm run build`
    - [x] `TEST_DOM_STREAMS=true npx jest
    test/unit/ipc/reader/streams-dom-tests.ts` (all 696 tests pass)
    
    ## Related
    
    Closes dependabot PR #434 which attempted to upgrade this package but
    failed CI due to the ESM incompatibility.
---
 jest.config.js                            |  1 -
 package-lock.json                         | 16 ----------------
 package.json                              |  1 -
 test/unit/ipc/reader/streams-dom-tests.ts | 30 +++++++++++++++++++++---------
 4 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/jest.config.js b/jest.config.js
index 5a004ef..68c69a6 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -57,6 +57,5 @@ export default {
     },
     transformIgnorePatterns: [
         "/targets/(es5|es2015|esnext|apache-arrow)/",
-        "/node_modules/(?!@openpgp/web-stream-tools)/",
     ],
 };
diff --git a/package-lock.json b/package-lock.json
index 47f80bb..9e6a43c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18,7 +18,6 @@
         "arrow2csv": "bin/arrow2csv.cjs"
       },
       "devDependencies": {
-        "@openpgp/web-stream-tools": "0.0.13",
         "@rollup/plugin-alias": "6.0.0",
         "@rollup/plugin-node-resolve": "16.0.3",
         "@rollup/stream": "3.0.1",
@@ -3488,21 +3487,6 @@
         "node": ">= 8"
       }
     },
-    "node_modules/@openpgp/web-stream-tools": {
-      "version": "0.0.13",
-      "resolved": 
"https://registry.npmjs.org/@openpgp/web-stream-tools/-/web-stream-tools-0.0.13.tgz";,
-      "integrity": 
"sha512-VQ0O0lUcD9ilLcMLQMJMgPhp8fDgMd4copd+UhSBGjud0vbI1ONQ3ffAhixEMml/AApLJtqCpd7PJcccPliFSA==",
-      "dev": true,
-      "license": "MIT",
-      "peerDependencies": {
-        "typescript": ">=4.2"
-      },
-      "peerDependenciesMeta": {
-        "typescript": {
-          "optional": true
-        }
-      }
-    },
     "node_modules/@oxc-resolver/binding-android-arm-eabi": {
       "version": "11.6.1",
       "resolved": 
"https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.6.1.tgz";,
diff --git a/package.json b/package.json
index 9910a93..7844ebc 100644
--- a/package.json
+++ b/package.json
@@ -52,7 +52,6 @@
     "tslib": "^2.6.2"
   },
   "devDependencies": {
-    "@openpgp/web-stream-tools": "0.0.13",
     "@rollup/plugin-alias": "6.0.0",
     "@rollup/plugin-node-resolve": "16.0.3",
     "@rollup/stream": "3.0.1",
diff --git a/test/unit/ipc/reader/streams-dom-tests.ts 
b/test/unit/ipc/reader/streams-dom-tests.ts
index b3d9bca..5d13b2a 100644
--- a/test/unit/ipc/reader/streams-dom-tests.ts
+++ b/test/unit/ipc/reader/streams-dom-tests.ts
@@ -25,6 +25,27 @@ import {
     Table
 } from 'apache-arrow';
 
+// Concatenates multiple ReadableStreams into a single stream
+function concatStream<T>(streams: ReadableStream<T>[]): ReadableStream<T> {
+    return new ReadableStream({
+        async start(controller) {
+            for (const stream of streams) {
+                const reader = stream.getReader();
+                try {
+                    while (true) {
+                        const { done, value } = await reader.read();
+                        if (done) break;
+                        controller.enqueue(value);
+                    }
+                } finally {
+                    reader.releaseLock();
+                }
+            }
+            controller.close();
+        }
+    });
+}
+
 (() => {
     if (process.env.TEST_DOM_STREAMS !== 'true') {
         return test('not testing DOM streams because 
process.env.TEST_DOM_STREAMS !== "true"', () => { });
@@ -101,9 +122,6 @@ import {
     }
 
     it('readAll() should pipe to separate WhatWG WritableStreams', async () => 
{
-        // @ts-ignore
-        const { concatStream } = await import('@openpgp/web-stream-tools');
-
         expect.hasAssertions();
 
         const tables = [...generateRandomTables([10, 20, 30])];
@@ -141,9 +159,6 @@ import {
     });
 
     it('should not close the underlying WhatWG ReadableStream when reading 
multiple tables to completion', async () => {
-        // @ts-ignore
-        const { concatStream } = await import('@openpgp/web-stream-tools');
-
         expect.hasAssertions();
 
         const tables = [...generateRandomTables([10, 20, 30])];
@@ -174,9 +189,6 @@ import {
     });
 
     it('should close the underlying WhatWG ReadableStream when reading 
multiple tables and we break early', async () => {
-        // @ts-ignore
-        const { concatStream } = await import('@openpgp/web-stream-tools');
-
         expect.hasAssertions();
 
         const tables = [...generateRandomTables([10, 20, 30])];

Reply via email to