Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/dev-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: 'npm'
- run: npm ci
- run: npm test
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: 'npm'
- name: Configure npmrc
run: |
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: 'npm'
- uses: actions/download-artifact@v5
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jsr-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: 'npm'
- run: npm ci
- run: npm test
Expand All @@ -40,7 +40,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: 'npm'
- uses: actions/download-artifact@v5
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: 'npm'
- run: npm ci
- run: npm test
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: 'npm'
- name: Configure npmrc
run: |
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: 'npm'
- uses: actions/download-artifact@v5
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
with:
persist-credentials: false

- name: Use Node.js 22.x
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 24
cache: 'npm'

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

- name: Use Node.js 22.x
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 24
cache: 'npm'

- uses: actions/download-artifact@v5
Expand Down Expand Up @@ -104,10 +104,10 @@ jobs:
with:
persist-credentials: false

- name: Use Node.js 22.x
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 24
cache: 'npm'

- uses: actions/download-artifact@v5
Expand Down Expand Up @@ -268,10 +268,10 @@ jobs:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Use Node.js 22.x
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 24
cache: 'npm'

- name: Install deps
Expand Down
Empty file modified build/cli.js
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
"author": "Anton Medvedev <[email protected]>",
"license": "Apache-2.0",
"volta": {
"node": "22.12.0"
"node": "24.6.0"
},
"tsd": {
"compilerOptions": {
Expand Down
5 changes: 3 additions & 2 deletions scripts/build-versions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const copyright = await fs.readFileSync(
path.resolve(root, 'test/fixtures/copyright.txt'),
'utf8'
)
const license = copyright.replace('YEAR', new Date().getFullYear())
const deps = [
'chalk',
'depseek',
Expand Down Expand Up @@ -67,10 +68,10 @@ const list = JSON.stringify(argv, null, 2)
.replaceAll('"', "'")
.replace(/\n}$/, ',\n}')

const versionsTs = `${copyright.replace('YEAR', new Date().getFullYear())}
const versionsTs = `${license}
export const versions: Record<string, string> = ${list}
`
const versionsCjs = `${copyright.replace('YEAR', new Date().getFullYear())}
const versionsCjs = `${license}
module.exports = { versions: ${list}
`

Expand Down
2 changes: 1 addition & 1 deletion test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ console.log(a);

test('scripts from https 500', async () => {
const port = await getPort()
const server = await fakeServer(['HTTP/1.1 500\n\n']).listen(port)
const server = await fakeServer([`HTTP/1.1 500\n\n500\n`]).listen(port)
const out = await $`node build/cli.js http://127.0.0.1:${port}`.nothrow()
assert.match(out.stderr, /Error: Can't get/)
await server.stop()
Expand Down
18 changes: 15 additions & 3 deletions test/core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,18 @@ describe('core', () => {
assert.ok(p.output instanceof ProcessOutput)
})

test('id is unique', async () => {
const p1 = $`echo foo`
const p2 = $`echo bar`

assert.ok(p1.id !== p2.id)
assert.ok(p1.id.length > 5)
assert.ok(p2.id.length > 5)

await p1
await p2
})

describe('state machine transitions', () => {
it('running > fulfilled', async () => {
const p = $`echo foo`
Expand Down Expand Up @@ -975,14 +987,14 @@ describe('core', () => {

describe('unpipe()', () => {
it('disables piping', async () => {
const p1 = $`echo foo && sleep 0.1 && echo bar && sleep 0.1 && echo baz && sleep 0.1 && echo qux`
const p2 = $`echo 1 && sleep 0.15 && echo 2 && sleep 0.1 && echo 3`
const p1 = $`echo foo && sleep 0.2 && echo bar && sleep 0.2 && echo baz && sleep 0.2 && echo qux`
const p2 = $`echo 1 && sleep 0.3 && echo 2 && sleep 0.2 && echo 3`
const p3 = $`cat`

p1.pipe(p3)
p2.pipe(p3)

setTimeout(() => p1.unpipe(p3), 150)
setTimeout(() => p1.unpipe(p3), 300)

const { stdout } = await p3
assert.equal(stdout, 'foo\n1\nbar\n2\n3\n')
Expand Down
6 changes: 2 additions & 4 deletions test/export.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,12 @@ describe('index', () => {
assert.equal(typeof index.fs, 'object', 'index.fs')
assert.equal(typeof index.fs.Dir, 'function', 'index.fs.Dir')
assert.equal(typeof index.fs.Dirent, 'function', 'index.fs.Dirent')
assert.equal(typeof index.fs.F_OK, 'number', 'index.fs.F_OK')
assert.equal(typeof index.fs.FileReadStream, 'function', 'index.fs.FileReadStream')
assert.equal(typeof index.fs.FileWriteStream, 'function', 'index.fs.FileWriteStream')
assert.equal(typeof index.fs.R_OK, 'number', 'index.fs.R_OK')
assert.equal(typeof index.fs.ReadStream, 'function', 'index.fs.ReadStream')
assert.equal(typeof index.fs.Stats, 'function', 'index.fs.Stats')
assert.equal(typeof index.fs.W_OK, 'number', 'index.fs.W_OK')
assert.equal(typeof index.fs.Utf8Stream, 'function', 'index.fs.Utf8Stream')
assert.equal(typeof index.fs.WriteStream, 'function', 'index.fs.WriteStream')
assert.equal(typeof index.fs.X_OK, 'number', 'index.fs.X_OK')
assert.equal(typeof index.fs._toUnixTimestamp, 'function', 'index.fs._toUnixTimestamp')
assert.equal(typeof index.fs.access, 'function', 'index.fs.access')
assert.equal(typeof index.fs.accessSync, 'function', 'index.fs.accessSync')
Expand Down Expand Up @@ -314,6 +311,7 @@ describe('index', () => {
assert.equal(typeof index.fs.mkdirs, 'function', 'index.fs.mkdirs')
assert.equal(typeof index.fs.mkdirsSync, 'function', 'index.fs.mkdirsSync')
assert.equal(typeof index.fs.mkdtemp, 'function', 'index.fs.mkdtemp')
assert.equal(typeof index.fs.mkdtempDisposableSync, 'function', 'index.fs.mkdtempDisposableSync')
assert.equal(typeof index.fs.mkdtempSync, 'function', 'index.fs.mkdtempSync')
assert.equal(typeof index.fs.move, 'function', 'index.fs.move')
assert.equal(typeof index.fs.moveSync, 'function', 'index.fs.moveSync')
Expand Down
7 changes: 3 additions & 4 deletions test/fixtures/echo.http
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
HTTP/1.1 200 OK
Content-Type: text/javascript; charset=UTF-8
Content-Length: 15
Server: netcat!

$`echo 'test'`
Content-Length: 14

$`echo 'test'`
2 changes: 1 addition & 1 deletion test/fixtures/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const fakeServer = (data = []) => {
server.on('connection', (conn) => {
conn.on('data', () => {
const d = data.shift() || 'pong'
const _d = typeof d === 'string' ? d.replace(/\r?\n/gm, '\r\n') : d
const _d = d.toString('utf-8').split(/\r?\n/).join('\r\n')
conn.write(_d)
})
})
Expand Down
Loading