Skip to content

Commit c12f86d

Browse files
committed
feat!: Dropped support for Node 18 and updated dependencies.
1 parent 15f8289 commit c12f86d

16 files changed

+33
-42
lines changed

.eslintrc.json

-7
This file was deleted.

.github/workflows/ci.yml

+2-2
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

+1-1
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

+12
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

+14-14
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"build": "swc --strip-leading-paths --delete-dir-on-start -d dist src",
3232
"postbuild": "concurrently npm:lint npm:typecheck",
3333
"format": "prettier -w src test",
34-
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx src test",
34+
"lint": "eslint --cache",
3535
"typecheck": "tsc -p . --emitDeclarationOnly",
3636
"test": "TS_NODE_PROJECT=tsconfig.test.json c8 -c test/config/c8-local.json node --import @swc-node/register/esm-register --test test/*.test.ts",
3737
"test:ci": "TS_NODE_PROJECT=tsconfig.test.json c8 -c test/config/c8-ci.json node --import @swc-node/register/esm-register --test-reporter=tap --test test/*.test.ts",
@@ -40,25 +40,25 @@
4040
"postpublish": "git push origin && git push origin -f --tags"
4141
},
4242
"dependencies": {
43-
"@swc-node/register": "^1.9.0",
44-
"acquerello": "^2.0.8",
43+
"@swc-node/register": "^1.10.9",
44+
"acquerello": "^3.0.0",
4545
"hdr-histogram-js": "^3.0.0",
4646
"table": "^6.8.2"
4747
},
4848
"devDependencies": {
49-
"@cowtech/eslint-config": "^9.0.3",
50-
"@swc/cli": "^0.3.12",
51-
"@swc/core": "^1.4.13",
52-
"@types/node": "^20.12.7",
53-
"c8": "^9.1.0",
54-
"chokidar": "^3.6.0",
55-
"concurrently": "^8.2.2",
56-
"eslint": "^8.57.0",
57-
"prettier": "^3.2.5",
49+
"@cowtech/eslint-config": "10.0.0",
50+
"@swc/cli": "0.4.1-nightly.20240914",
51+
"@swc/core": "^1.7.36",
52+
"@types/node": "^22.7.7",
53+
"c8": "^10.1.2",
54+
"chokidar": "^4.0.1",
55+
"concurrently": "^9.0.1",
56+
"eslint": "^9.13.0",
57+
"prettier": "^3.3.3",
5858
"proxyquire": "^2.1.3",
59-
"typescript": "^5.4.5"
59+
"typescript": "^5.6.3"
6060
},
6161
"engines": {
62-
"node": ">= 18.18.0"
62+
"node": ">= 20.18.0"
6363
}
6464
}

src/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ function run(context: Context): void {
9696
})
9797
}
9898

99-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
10099
export function cronometro(tests: Tests): Promise<Results> | void
101100
export function cronometro(tests: Tests, options: Partial<Options>): Promise<Results>
102101
export function cronometro(tests: Tests, options: Partial<Options>, cb: Callback): undefined
@@ -105,7 +104,6 @@ export function cronometro(
105104
tests: Tests,
106105
options?: Partial<Options> | Callback,
107106
cb?: Callback
108-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
109107
): Promise<Results> | void {
110108
if (!isMainThread) {
111109
workerData.tests = Object.entries(tests)

src/models.ts

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export interface PrintOptions {
1010

1111
export type SetupFunctionCallback = (err?: Error | null) => void
1212

13-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
1413
export type SetupFunction = (cb: SetupFunctionCallback) => Promise<any> | void
1514

1615
export interface Options {

test.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NODE_OPTIONS=--import @swc-node/register/esm-register

test/callbacks.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-floating-promises */
2-
31
import { deepStrictEqual, match, ok } from 'node:assert'
42
import { test } from 'node:test'
53
import { Worker, isMainThread, parentPort } from 'node:worker_threads'

test/errorHandling.test.ts

-2
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, ok, rejects } from 'node:assert'
42
import { test } from 'node:test'
53
import { isMainThread } from 'node:worker_threads'

test/fixture/sample.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import cronometro from '../../dist/index.js'
1+
import { cronometro } from '../../dist/index.js'
22

33
const pattern = /[1-3]/g
4-
const replacements: Record<string, string> = { 1: 'a', 2: 'b', 3: 'c' }
4+
const replacements = { 1: 'a', 2: 'b', 3: 'c' }
55

66
const subject =
77
'123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123'

test/optionsValidation.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-floating-promises */
2-
31
import { deepStrictEqual, ok, rejects } from 'node:assert'
42
import { test } from 'node:test'
53
import { cronometro } from '../src/index.js'

test/print.test.ts

-2
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, match, ok } from 'node:assert'
42
import { test } from 'node:test'
53
import { isMainThread } from 'node:worker_threads'

test/testsCallbacks.test.ts

-2
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, ok } from 'node:assert'
42
import { test } from 'node:test'
53
import { isMainThread } from 'node:worker_threads'

test/worker.test.ts

-2
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, ok } from 'node:assert'
42
import { test } from 'node:test'
53
import { percentiles, type AsyncTest, type Result } from '../src/index.js'

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2022",
3+
"target": "ESNext",
44
"module": "NodeNext",
55
"moduleResolution": "NodeNext",
66
"jsx": "preserve",

0 commit comments

Comments
 (0)