Skip to content

Commit fa33aec

Browse files
committed
feat!: Dropped support for Node 18 and updated dependencies.
1 parent c39e67f commit fa33aec

File tree

14 files changed

+45
-41
lines changed

14 files changed

+45
-41
lines changed

.eslintrc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
steps:
88
- name: Checkout
99
uses: actions/checkout@v3
10-
- name: Use Node.js LTS
10+
- name: Use supported Node.js Version
1111
uses: actions/setup-node@v3
1212
with:
13-
node-version: lts/*
13+
node-version: 20.18.0*
1414
- name: Restore cached dependencies
1515
uses: actions/cache@v3
1616
with:

.swcrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"jsc": {
3-
"target": "es2022",
3+
"target": "esnext",
44
"parser": {
55
"syntax": "typescript",
66
"tsx": false,

eslint.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { cowtech } from '@cowtech/eslint-config'
2+
3+
export default [
4+
...cowtech,
5+
{
6+
languageOptions: {
7+
parserOptions: {
8+
project: './tsconfig.test.json'
9+
}
10+
}
11+
}
12+
]

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,32 @@
4545
"build": "swc --strip-leading-paths --delete-dir-on-start -d dist src",
4646
"postbuild": "concurrently npm:lint npm:typecheck",
4747
"format": "prettier -w src test",
48-
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx src test",
48+
"lint": "eslint --cache",
4949
"typecheck": "tsc -p . --emitDeclarationOnly",
50-
"test": "c8 -c test/config/c8-local.json node --import tsx --test test/*.test.ts",
51-
"test:ci": "c8 -c test/config/c8-ci.json node --import tsx --test-reporter=tap --test test/*.test.ts",
50+
"test": "c8 -c test/config/c8-local.json node --env-file=test.env --test test/*.test.ts",
51+
"test:ci": "c8 -c test/config/c8-ci.json node --env-file=test.env --test-reporter=tap --test test/*.test.ts",
5252
"ci": "npm run build && npm run test:ci",
5353
"prepublishOnly": "npm run ci",
5454
"postpublish": "git push origin && git push origin -f --tags"
5555
},
5656
"dependencies": {
5757
"image-size": "^1.1.1",
58-
"undici": "^6.13.0"
58+
"undici": "^6.20.1"
5959
},
6060
"devDependencies": {
61-
"@cowtech/eslint-config": "^9.0.3",
62-
"@swc/cli": "^0.3.12",
63-
"@swc/core": "^1.4.13",
64-
"@types/node": "^20.12.7",
65-
"c8": "^9.1.0",
66-
"chokidar": "^3.6.0",
67-
"concurrently": "^8.2.2",
68-
"eslint": "^8.57.0",
69-
"prettier": "^3.2.5",
70-
"tsx": "^4.7.2",
71-
"typescript": "^5.4.5"
61+
"@cowtech/eslint-config": "10.0.0",
62+
"@swc-node/register": "^1.10.9",
63+
"@swc/cli": "0.4.1-nightly.20240914",
64+
"@swc/core": "^1.7.36",
65+
"@types/node": "^22.7.7",
66+
"c8": "^10.1.2",
67+
"chokidar": "^4.0.1",
68+
"concurrently": "^9.0.1",
69+
"eslint": "^9.13.0",
70+
"prettier": "^3.3.3",
71+
"typescript": "^5.6.3"
7272
},
7373
"engines": {
74-
"node": ">= 18.18.0"
74+
"node": ">= 20.18.0"
7575
}
7676
}

src/internals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export function handleError(error: FastImageError, url: string): Error {
148148
case 'ECONNREFUSED':
149149
message = 'Connection refused from the remote host.'
150150
break
151-
/* c8 ignore next */
151+
/* c8 ignore next 2 */
152152
case 'ETIMEDOUT':
153153
case 'UND_ERR_HEADERS_TIMEOUT':
154154
message = 'Connection to the remote host timed out.'

src/stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ export class FastImageStream extends Writable {
3939
)
4040
}
4141

42+
/* c8 ignore start */
4243
_write(chunk: Buffer, _e: BufferEncoding, cb: (error?: Error | null) => void): void {
4344
this.analyze(chunk)
4445
cb()
4546
}
4647

47-
/* c8 ignore start */
4848
_writev(chunks: { chunk: Buffer }[], cb: (error?: Error | null) => void): void {
4949
for (const { chunk } of chunks) {
5050
this.analyze(chunk)

test.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NODE_OPTIONS=--import @swc-node/register/esm-register

test/buffersAndStreams.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-floating-promises */
2-
31
import { deepStrictEqual, rejects } from 'node:assert'
42
import { createReadStream, readFileSync } from 'node:fs'
53
import { test } from 'node:test'

test/files.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-floating-promises */
2-
31
import { deepStrictEqual, ifError } from 'node:assert'
42
import { chmodSync, existsSync, unlinkSync, writeFileSync } from 'node:fs'
53
import { dirname } from 'node:path'

0 commit comments

Comments
 (0)