Skip to content

Commit bbc7e5a

Browse files
authored
chore: downgrade p-queue as it is esm-only (#341)
Fix up p-queue@6 since importing it from cjs generated by ipjs breaks.
1 parent 17142a8 commit bbc7e5a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/ipfs-repo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"merge-options": "^3.0.4",
9292
"mortice": "^2.0.1",
9393
"multiformats": "^9.0.4",
94-
"p-queue": "^7.1.0",
94+
"p-queue": "^6.0.0",
9595
"proper-lockfile": "^4.0.0",
9696
"sort-keys": "^5.0.0",
9797
"uint8arrays": "^3.0.0"

packages/ipfs-repo/src/config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import { Key } from 'interface-datastore/key'
3-
import Queue from 'p-queue'
3+
import PQueue from 'p-queue'
44
import _get from 'just-safe-get'
55
import _set from 'just-safe-set'
66
import errCode from 'err-code'
@@ -9,6 +9,10 @@ import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
99
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
1010
import { getWithFallback, hasWithFallback } from './utils/level.js'
1111

12+
// @ts-ignore types are broken in [email protected] - also, if we imported via esm
13+
// we can use the default, if via cjs we need to get the default via prop access
14+
const Queue = PQueue.default ? PQueue.default : PQueue
15+
1216
const configKey = new Key('config')
1317

1418
/**

0 commit comments

Comments
 (0)