Skip to content

Commit

Permalink
feat!: Dropped support for Node 18 and updated dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda committed Oct 21, 2024
1 parent 15f8289 commit c12f86d
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 42 deletions.
7 changes: 0 additions & 7 deletions .eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js LTS
- name: Use supported Node.js Version
uses: actions/setup-node@v3
with:
node-version: lts/*
node-version: 20.18.0
- name: Restore cached dependencies
uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .swcrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"jsc": {
"target": "es2022",
"target": "esnext",
"parser": {
"syntax": "typescript",
"tsx": false,
Expand Down
12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { cowtech } from '@cowtech/eslint-config'

export default [
...cowtech,
{
languageOptions: {
parserOptions: {
project: './tsconfig.test.json'
}
}
}
]
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"build": "swc --strip-leading-paths --delete-dir-on-start -d dist src",
"postbuild": "concurrently npm:lint npm:typecheck",
"format": "prettier -w src test",
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx src test",
"lint": "eslint --cache",
"typecheck": "tsc -p . --emitDeclarationOnly",
"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",
"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",
Expand All @@ -40,25 +40,25 @@
"postpublish": "git push origin && git push origin -f --tags"
},
"dependencies": {
"@swc-node/register": "^1.9.0",
"acquerello": "^2.0.8",
"@swc-node/register": "^1.10.9",
"acquerello": "^3.0.0",
"hdr-histogram-js": "^3.0.0",
"table": "^6.8.2"
},
"devDependencies": {
"@cowtech/eslint-config": "^9.0.3",
"@swc/cli": "^0.3.12",
"@swc/core": "^1.4.13",
"@types/node": "^20.12.7",
"c8": "^9.1.0",
"chokidar": "^3.6.0",
"concurrently": "^8.2.2",
"eslint": "^8.57.0",
"prettier": "^3.2.5",
"@cowtech/eslint-config": "10.0.0",
"@swc/cli": "0.4.1-nightly.20240914",
"@swc/core": "^1.7.36",
"@types/node": "^22.7.7",
"c8": "^10.1.2",
"chokidar": "^4.0.1",
"concurrently": "^9.0.1",
"eslint": "^9.13.0",
"prettier": "^3.3.3",
"proxyquire": "^2.1.3",
"typescript": "^5.4.5"
"typescript": "^5.6.3"
},
"engines": {
"node": ">= 18.18.0"
"node": ">= 20.18.0"
}
}
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ function run(context: Context): void {
})
}

// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
export function cronometro(tests: Tests): Promise<Results> | void
export function cronometro(tests: Tests, options: Partial<Options>): Promise<Results>
export function cronometro(tests: Tests, options: Partial<Options>, cb: Callback): undefined
Expand All @@ -105,7 +104,6 @@ export function cronometro(
tests: Tests,
options?: Partial<Options> | Callback,
cb?: Callback
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
): Promise<Results> | void {
if (!isMainThread) {
workerData.tests = Object.entries(tests)
Expand Down
1 change: 0 additions & 1 deletion src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export interface PrintOptions {

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

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

export interface Options {
Expand Down
1 change: 1 addition & 0 deletions test.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_OPTIONS=--import @swc-node/register/esm-register
2 changes: 0 additions & 2 deletions test/callbacks.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-floating-promises */

import { deepStrictEqual, match, ok } from 'node:assert'
import { test } from 'node:test'
import { Worker, isMainThread, parentPort } from 'node:worker_threads'
Expand Down
2 changes: 0 additions & 2 deletions test/errorHandling.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-floating-promises */

import { deepStrictEqual, ifError, ok, rejects } from 'node:assert'
import { test } from 'node:test'
import { isMainThread } from 'node:worker_threads'
Expand Down
4 changes: 2 additions & 2 deletions test/fixture/sample.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cronometro from '../../dist/index.js'
import { cronometro } from '../../dist/index.js'

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

const subject =
'123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123'
Expand Down
2 changes: 0 additions & 2 deletions test/optionsValidation.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-floating-promises */

import { deepStrictEqual, ok, rejects } from 'node:assert'
import { test } from 'node:test'
import { cronometro } from '../src/index.js'
Expand Down
2 changes: 0 additions & 2 deletions test/print.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-floating-promises */

import { deepStrictEqual, ifError, match, ok } from 'node:assert'
import { test } from 'node:test'
import { isMainThread } from 'node:worker_threads'
Expand Down
2 changes: 0 additions & 2 deletions test/testsCallbacks.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-floating-promises */

import { deepStrictEqual, ifError, ok } from 'node:assert'
import { test } from 'node:test'
import { isMainThread } from 'node:worker_threads'
Expand Down
2 changes: 0 additions & 2 deletions test/worker.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-floating-promises */

import { deepStrictEqual, ifError, ok } from 'node:assert'
import { test } from 'node:test'
import { percentiles, type AsyncTest, type Result } from '../src/index.js'
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2022",
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"jsx": "preserve",
Expand Down

0 comments on commit c12f86d

Please sign in to comment.