bare-media 1.5.0 → 1.6.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.
package/client.js CHANGED
@@ -42,6 +42,17 @@ export class WorkerClient extends ReadyResource {
42
42
  this.worker?.IPC.end()
43
43
  }
44
44
 
45
+ #reset() {
46
+ this.opening = null
47
+ this.closing = null
48
+
49
+ this.opened = false
50
+ this.closed = false
51
+
52
+ this.worker = null
53
+ this.rpc = null
54
+ }
55
+
45
56
  async #run() {
46
57
  const { filename, requireSource, args } = this.opts
47
58
  const source = requireSource?.()
@@ -50,7 +61,13 @@ export class WorkerClient extends ReadyResource {
50
61
  const ipc = this.worker.IPC
51
62
 
52
63
  ipc.on('end', () => ipc.end())
53
- ipc.on('close', () => this.onClose?.())
64
+ ipc.on('close', () => {
65
+ this.#reset()
66
+ this.onClose?.()
67
+ console.error(
68
+ '[bare-media] Worker has exited. IPC channel closed unexpectedly.'
69
+ )
70
+ })
54
71
 
55
72
  this.rpc = new HRPC(ipc)
56
73
  }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "bare-media",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build:rpc": "cd shared/spec && bare ./build.js",
8
8
  "format": "prettier --write .",
9
9
  "format:check": "prettier --check .",
10
- "test": "npm run format:check && brittle-bare test/index.js"
10
+ "lint": "lunte",
11
+ "test": "npm run lint && npm run format:check && brittle-bare test/index.js"
11
12
  },
12
13
  "keywords": [],
13
14
  "author": "Holepunch Inc",
@@ -17,6 +18,7 @@
17
18
  "b4a": "^1.6.7",
18
19
  "bare-fetch": "^2.4.1",
19
20
  "bare-fs": "^4.1.5",
21
+ "bare-gif": "^1.1.2",
20
22
  "bare-heif": "^1.0.5",
21
23
  "bare-image-resample": "^1.0.1",
22
24
  "bare-jpeg": "^1.0.1",
@@ -35,6 +37,7 @@
35
37
  "corestore": "^7.4.5",
36
38
  "hyperblobs": "^2.8.0",
37
39
  "hypercore-blob-server": "^1.11.0",
40
+ "lunte": "^1.3.0",
38
41
  "prettier": "^3.6.2",
39
42
  "prettier-config-holepunch": "^1.0.0",
40
43
  "test-tmp": "^1.4.0"
package/shared/codecs.js CHANGED
@@ -7,7 +7,8 @@ export const codecs = {
7
7
  'image/webp': () => import('bare-webp'),
8
8
  'image/png': () => import('bare-png'),
9
9
  'image/tif': () => import('bare-tiff'),
10
- 'image/tiff': () => import('bare-tiff')
10
+ 'image/tiff': () => import('bare-tiff'),
11
+ 'image/gif': () => import('bare-gif')
11
12
  }
12
13
 
13
14
  export function isCodecSupported(mimetype) {