Skip to content

Commit 5f39e1e

Browse files
authored
feat: Support Node v18 (#1041)
update package-lock `npm audit fix --force` This fixed `digital envelope routines`. In v17 there was an openssl breaking change. webpack needed to be updated. `npm update webpack` Change the test helper `chunkCipherTextStream` to use the `queueMicrotask`. This keeps the call stack in bounds for v18.
1 parent bbba82e commit 5f39e1e

File tree

6 files changed

+138
-81
lines changed

6 files changed

+138
-81
lines changed

codebuild/browser.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ env:
66

77
phases:
88
install:
9-
runtime-versions:
10-
nodejs: latest
119
commands:
10+
- n 18
1211
- npm ci --unsafe-perm
1312
- npm run build
1413
build:
1514
commands:
15+
- npm -v
16+
- node -v
1617
- npm run coverage-browser

codebuild/nodejs_latest.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ env:
66

77
phases:
88
install:
9-
runtime-versions:
10-
nodejs: latest
119
commands:
10+
- n 18
1211
- node --version ; npm --version
1312
- npm ci --unsafe-perm
1413
- npm run build

codebuild/test_vectors/browser.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ env:
77

88
phases:
99
install:
10-
runtime-versions:
11-
nodejs: latest
1210
commands:
11+
- n 18
1312
- npm ci
1413
- |-
1514
if [ "$PUBLISH_LOCAL" = "true" ]; then
1615
npm run build
1716
fi
1817
build:
1918
commands:
19+
- npm -v
20+
- node -v
2021
- |-
2122
if [ "$PUBLISH_LOCAL" = "true" ]; then
2223
npm run verdaccio-publish

codebuild/test_vectors/nodejs_latest.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ env:
77

88
phases:
99
install:
10-
runtime-versions:
11-
nodejs: latest
1210
commands:
11+
- n 18
1312
- npm ci
1413
- |-
1514
if [ "$PUBLISH_LOCAL" = "true" ]; then

modules/decrypt-node/test/decrypt.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ function chunkCipherTextStream(ciphertext: Buffer, { size }: { size: number }) {
225225
next: (err: Error | null, chunk: Uint8Array | null) => void
226226
) => {
227227
const { value, done } = eat(i, size)
228-
if (done) return next(null, null)
229-
next(null, new Uint8Array(value))
228+
if (done) return queueMicrotask(() => next(null, null))
229+
queueMicrotask(() => next(null, new Uint8Array(value)))
230230
}
231231
)
232232

0 commit comments

Comments
 (0)