thread-stream 2.7.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,15 +38,11 @@ jobs:
38
38
  contents: read
39
39
  strategy:
40
40
  matrix:
41
- node-version: [14, 16, 18, 20]
41
+ node-version: [18, 20, 22]
42
42
  os: [macos-latest, ubuntu-latest, windows-latest]
43
43
  exclude:
44
44
  - os: windows-latest
45
- node-version: 14
46
- - os: macos-latest
47
- node-version: 14
48
- - os: macos-latest
49
- node-version: 16
45
+ node-version: 22
50
46
 
51
47
  steps:
52
48
  - name: Check out repo
package/lib/worker.js CHANGED
@@ -159,7 +159,6 @@ process.once('exit', exitCode => {
159
159
  process.exit(exitCode)
160
160
  return
161
161
  }
162
-
163
162
  if (destination?.writableNeedDrain && !destination?.writableEnded) {
164
163
  parentPort.postMessage({
165
164
  code: 'WARNING',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thread-stream",
3
- "version": "2.7.0",
3
+ "version": "3.0.0",
4
4
  "description": "A streaming way to send data to a Node.js Worker Thread",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -22,7 +22,9 @@ function retryUntilTimeout (fn, timeout) {
22
22
  })
23
23
  }
24
24
 
25
- test('emit warning when the worker gracefully exit without the stream ended', async function (t) {
25
+ const isNode18 = process.version.indexOf('v18') === 0
26
+
27
+ test('emit warning when the worker gracefully exit without the stream ended', { skip: !isNode18 }, async function (t) {
26
28
  const expectedWarning = 'ThreadStream: process exited before destination stream was drained. this may indicate that the destination stream try to write to a another missing stream'
27
29
  const stream = new ThreadStream({
28
30
  filename: join(__dirname, 'to-next.js')
@@ -14,6 +14,8 @@ test('worker test when packaged into executable using pkg', async (t) => {
14
14
  // package the app into several node versions, check config for more info
15
15
  const filePath = `${join(__dirname, packageName)}.js`
16
16
  const configPath = join(__dirname, 'pkg.config.json')
17
+ process.env.NODE_OPTIONS ||= ''
18
+ process.env.NODE_OPTIONS = '--no-warnings'
17
19
  const { stderr } = await exec(`npx pkg ${filePath} --config ${configPath}`)
18
20
 
19
21
  // there should be no error when packaging