Skip to content

Commit 72b5604

Browse files
authored
ci: use nodejs 24 by default (#1330)
* test: check `ProcessPromise.id` is unique * ci: use nodejs 24 by default
1 parent 4dfbaee commit 72b5604

File tree

12 files changed

+42
-32
lines changed

12 files changed

+42
-32
lines changed

.github/workflows/dev-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
persist-credentials: false
1919
- uses: actions/setup-node@v4
2020
with:
21-
node-version: 22
21+
node-version: 24
2222
cache: 'npm'
2323
- run: npm ci
2424
- run: npm test
@@ -74,7 +74,7 @@ jobs:
7474
persist-credentials: false
7575
- uses: actions/setup-node@v4
7676
with:
77-
node-version: 22
77+
node-version: 24
7878
cache: 'npm'
7979
- name: Configure npmrc
8080
run: |
@@ -116,7 +116,7 @@ jobs:
116116
persist-credentials: false
117117
- uses: actions/setup-node@v4
118118
with:
119-
node-version: 22
119+
node-version: 24
120120
cache: 'npm'
121121
- uses: actions/download-artifact@v5
122122
with:

.github/workflows/jsr-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
persist-credentials: false
1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 22
17+
node-version: 24
1818
cache: 'npm'
1919
- run: npm ci
2020
- run: npm test
@@ -40,7 +40,7 @@ jobs:
4040
persist-credentials: false
4141
- uses: actions/setup-node@v4
4242
with:
43-
node-version: 22
43+
node-version: 24
4444
cache: 'npm'
4545
- uses: actions/download-artifact@v5
4646
with:

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
persist-credentials: false
2121
- uses: actions/setup-node@v4
2222
with:
23-
node-version: 22
23+
node-version: 24
2424
cache: 'npm'
2525
- run: npm ci
2626
- run: npm test
@@ -72,7 +72,7 @@ jobs:
7272
persist-credentials: false
7373
- uses: actions/setup-node@v4
7474
with:
75-
node-version: 22
75+
node-version: 24
7676
cache: 'npm'
7777
- name: Configure npmrc
7878
run: |
@@ -109,7 +109,7 @@ jobs:
109109
persist-credentials: false
110110
- uses: actions/setup-node@v4
111111
with:
112-
node-version: 22
112+
node-version: 24
113113
cache: 'npm'
114114
- uses: actions/download-artifact@v5
115115
with:

.github/workflows/test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
with:
2424
persist-credentials: false
2525

26-
- name: Use Node.js 22.x
26+
- name: Use Node.js 24
2727
uses: actions/setup-node@v4
2828
with:
29-
node-version: 22.x
29+
node-version: 24
3030
cache: 'npm'
3131

3232
- run: npm ci
@@ -53,10 +53,10 @@ jobs:
5353
persist-credentials: false
5454
fetch-depth: ${{ github.event_name == 'pull_request' && '15' || '1' }} # to ensure we have enough history for commitlint
5555

56-
- name: Use Node.js 22.x
56+
- name: Use Node.js 24
5757
uses: actions/setup-node@v4
5858
with:
59-
node-version: 22.x
59+
node-version: 24
6060
cache: 'npm'
6161

6262
- uses: actions/download-artifact@v5
@@ -104,10 +104,10 @@ jobs:
104104
with:
105105
persist-credentials: false
106106

107-
- name: Use Node.js 22.x
107+
- name: Use Node.js 24
108108
uses: actions/setup-node@v4
109109
with:
110-
node-version: 22.x
110+
node-version: 24
111111
cache: 'npm'
112112

113113
- uses: actions/download-artifact@v5
@@ -268,10 +268,10 @@ jobs:
268268
- uses: actions/checkout@v5
269269
with:
270270
persist-credentials: false
271-
- name: Use Node.js 22.x
271+
- name: Use Node.js 24
272272
uses: actions/setup-node@v4
273273
with:
274-
node-version: 22.x
274+
node-version: 24
275275
cache: 'npm'
276276

277277
- name: Install deps

build/cli.js

100644100755
File mode changed.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
"author": "Anton Medvedev <[email protected]>",
201201
"license": "Apache-2.0",
202202
"volta": {
203-
"node": "22.12.0"
203+
"node": "24.6.0"
204204
},
205205
"tsd": {
206206
"compilerOptions": {

scripts/build-versions.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const copyright = await fs.readFileSync(
2323
path.resolve(root, 'test/fixtures/copyright.txt'),
2424
'utf8'
2525
)
26+
const license = copyright.replace('YEAR', new Date().getFullYear())
2627
const deps = [
2728
'chalk',
2829
'depseek',
@@ -67,10 +68,10 @@ const list = JSON.stringify(argv, null, 2)
6768
.replaceAll('"', "'")
6869
.replace(/\n}$/, ',\n}')
6970

70-
const versionsTs = `${copyright.replace('YEAR', new Date().getFullYear())}
71+
const versionsTs = `${license}
7172
export const versions: Record<string, string> = ${list}
7273
`
73-
const versionsCjs = `${copyright.replace('YEAR', new Date().getFullYear())}
74+
const versionsCjs = `${license}
7475
module.exports = { versions: ${list}
7576
`
7677

test/cli.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ console.log(a);
211211

212212
test('scripts from https 500', async () => {
213213
const port = await getPort()
214-
const server = await fakeServer(['HTTP/1.1 500\n\n']).listen(port)
214+
const server = await fakeServer([`HTTP/1.1 500\n\n500\n`]).listen(port)
215215
const out = await $`node build/cli.js http://127.0.0.1:${port}`.nothrow()
216216
assert.match(out.stderr, /Error: Can't get/)
217217
await server.stop()

test/core.test.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,18 @@ describe('core', () => {
526526
assert.ok(p.output instanceof ProcessOutput)
527527
})
528528

529+
test('id is unique', async () => {
530+
const p1 = $`echo foo`
531+
const p2 = $`echo bar`
532+
533+
assert.ok(p1.id !== p2.id)
534+
assert.ok(p1.id.length > 5)
535+
assert.ok(p2.id.length > 5)
536+
537+
await p1
538+
await p2
539+
})
540+
529541
describe('state machine transitions', () => {
530542
it('running > fulfilled', async () => {
531543
const p = $`echo foo`
@@ -975,14 +987,14 @@ describe('core', () => {
975987

976988
describe('unpipe()', () => {
977989
it('disables piping', async () => {
978-
const p1 = $`echo foo && sleep 0.1 && echo bar && sleep 0.1 && echo baz && sleep 0.1 && echo qux`
979-
const p2 = $`echo 1 && sleep 0.15 && echo 2 && sleep 0.1 && echo 3`
990+
const p1 = $`echo foo && sleep 0.2 && echo bar && sleep 0.2 && echo baz && sleep 0.2 && echo qux`
991+
const p2 = $`echo 1 && sleep 0.3 && echo 2 && sleep 0.2 && echo 3`
980992
const p3 = $`cat`
981993

982994
p1.pipe(p3)
983995
p2.pipe(p3)
984996

985-
setTimeout(() => p1.unpipe(p3), 150)
997+
setTimeout(() => p1.unpipe(p3), 300)
986998

987999
const { stdout } = await p3
9881000
assert.equal(stdout, 'foo\n1\nbar\n2\n3\n')

test/export.test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,12 @@ describe('index', () => {
230230
assert.equal(typeof index.fs, 'object', 'index.fs')
231231
assert.equal(typeof index.fs.Dir, 'function', 'index.fs.Dir')
232232
assert.equal(typeof index.fs.Dirent, 'function', 'index.fs.Dirent')
233-
assert.equal(typeof index.fs.F_OK, 'number', 'index.fs.F_OK')
234233
assert.equal(typeof index.fs.FileReadStream, 'function', 'index.fs.FileReadStream')
235234
assert.equal(typeof index.fs.FileWriteStream, 'function', 'index.fs.FileWriteStream')
236-
assert.equal(typeof index.fs.R_OK, 'number', 'index.fs.R_OK')
237235
assert.equal(typeof index.fs.ReadStream, 'function', 'index.fs.ReadStream')
238236
assert.equal(typeof index.fs.Stats, 'function', 'index.fs.Stats')
239-
assert.equal(typeof index.fs.W_OK, 'number', 'index.fs.W_OK')
237+
assert.equal(typeof index.fs.Utf8Stream, 'function', 'index.fs.Utf8Stream')
240238
assert.equal(typeof index.fs.WriteStream, 'function', 'index.fs.WriteStream')
241-
assert.equal(typeof index.fs.X_OK, 'number', 'index.fs.X_OK')
242239
assert.equal(typeof index.fs._toUnixTimestamp, 'function', 'index.fs._toUnixTimestamp')
243240
assert.equal(typeof index.fs.access, 'function', 'index.fs.access')
244241
assert.equal(typeof index.fs.accessSync, 'function', 'index.fs.accessSync')
@@ -314,6 +311,7 @@ describe('index', () => {
314311
assert.equal(typeof index.fs.mkdirs, 'function', 'index.fs.mkdirs')
315312
assert.equal(typeof index.fs.mkdirsSync, 'function', 'index.fs.mkdirsSync')
316313
assert.equal(typeof index.fs.mkdtemp, 'function', 'index.fs.mkdtemp')
314+
assert.equal(typeof index.fs.mkdtempDisposableSync, 'function', 'index.fs.mkdtempDisposableSync')
317315
assert.equal(typeof index.fs.mkdtempSync, 'function', 'index.fs.mkdtempSync')
318316
assert.equal(typeof index.fs.move, 'function', 'index.fs.move')
319317
assert.equal(typeof index.fs.moveSync, 'function', 'index.fs.moveSync')

0 commit comments

Comments
 (0)