Skip to content

Commit 2ec8be8

Browse files
committed
feat!: Dropped support for Node 20.
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
1 parent a4eea19 commit 2ec8be8

File tree

8 files changed

+37
-60
lines changed

8 files changed

+37
-60
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,19 @@ name: CI
33
on: [push, pull_request, workflow_dispatch]
44
jobs:
55
ci:
6-
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
os: [ubuntu-latest, windows-latest]
10+
node-version: [22, 24, 25]
11+
runs-on: ${{ matrix.os }}
712
steps:
813
- name: Checkout
9-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1015
- name: Use supported Node.js Version
11-
uses: actions/setup-node@v3
16+
uses: actions/setup-node@v4
1217
with:
13-
node-version: 20.18.0
18+
node-version: ${{ matrix.node-version }}
1419
- name: Restore cached dependencies
1520
uses: actions/cache@v3
1621
with:

.swcrc

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

package.json

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,41 +29,35 @@
2929
"exports": "./dist/index.js",
3030
"types": "./dist/index.d.ts",
3131
"scripts": {
32-
"dev": "swc --strip-leading-paths --delete-dir-on-start -s -w -d dist src",
33-
"build": "swc --strip-leading-paths --delete-dir-on-start -d dist src",
34-
"postbuild": "concurrently npm:lint npm:typecheck",
32+
"build": "rm -rf dist && tsc -p tsconfig.json && npm run lint",
3533
"format": "prettier -w src test",
3634
"lint": "eslint --cache",
37-
"typecheck": "tsc -p . --emitDeclarationOnly",
38-
"test": "c8 -c test/config/c8-local.json node --env-file=test.env --test test/*.test.ts",
39-
"test:ci": "c8 -c test/config/c8-ci.json node --env-file=test.env --test-reporter=tap --test test/*.test.ts",
40-
"ci": "npm run build && npm run test:ci",
35+
"test": "c8 -c test/config/c8-local.json node --test --test-reporter=cleaner-spec-reporter test/*.test.ts",
36+
"test:ci": "c8 -c test/config/c8-ci.json node --test --test-reporter=tap test/*.test.ts",
37+
"ci": "npm run build && npm run test",
4138
"prepublishOnly": "npm run ci",
4239
"postpublish": "git push origin && git push origin -f --tags"
4340
},
4441
"dependencies": {
45-
"@fastify/static": "^8.0.3",
46-
"fastify-plugin": "^5.0.1",
47-
"js-yaml": "^4.1.0",
48-
"swagger-ui-dist": "^5.18.2"
42+
"@fastify/static": "^8.3.0",
43+
"fastify-plugin": "^5.1.0",
44+
"js-yaml": "^4.1.1",
45+
"swagger-ui-dist": "^5.30.2"
4946
},
5047
"devDependencies": {
51-
"@cowtech/eslint-config": "10.2.0",
52-
"@swc-node/register": "^1.10.9",
53-
"@swc/cli": "0.5.2",
54-
"@swc/core": "^1.10.3",
48+
"@cowtech/eslint-config": "^11.0.0",
49+
"@cowtech/typescript-config": "^0.2.2",
5550
"@types/js-yaml": "^4.0.9",
56-
"@types/node": "^22.10.2",
57-
"@types/swagger-ui-dist": "^3.30.5",
51+
"@types/node": "^24.10.1",
52+
"@types/swagger-ui-dist": "^3.30.6",
5853
"c8": "^10.1.3",
59-
"chokidar": "^4.0.3",
60-
"concurrently": "^9.1.1",
61-
"eslint": "^9.17.0",
62-
"fastify": "^5.2.0",
63-
"prettier": "^3.4.2",
64-
"typescript": "^5.7.2"
54+
"cleaner-spec-reporter": "^0.5.0",
55+
"eslint": "^9.39.1",
56+
"fastify": "^5.6.2",
57+
"prettier": "^3.6.2",
58+
"typescript": "^5.9.3"
6559
},
6660
"engines": {
67-
"node": ">= 20.18.0"
61+
"node": ">= 22.21.0"
6862
}
6963
}

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
} from 'fastify'
99
import fastifyPlugin from 'fastify-plugin'
1010
import { dump } from 'js-yaml'
11-
import { buildSpec, type Schema } from './spec.js'
12-
import { addUI } from './ui.js'
11+
import { buildSpec, type Schema } from './spec.ts'
12+
import { addUI } from './ui.ts'
1313

1414
export const plugin = fastifyPlugin(
1515
function (instance: FastifyInstance, options: FastifyPluginOptions, done: (error?: FastifyError) => void): void {

test.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/spec.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fastify, { type FastifyReply, type FastifyRequest } from 'fastify'
22
import { deepStrictEqual } from 'node:assert'
33
import { test } from 'node:test'
4-
import { plugin as fastifyOpenApiDocs } from '../src/index.js'
4+
import { plugin as fastifyOpenApiDocs } from '../src/index.ts'
55

66
const openapi = {
77
// All these fields are optional, but they should be provided to satisfy OpenAPI specification.

test/ui.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fastify from 'fastify'
22
import { deepStrictEqual, ok } from 'node:assert'
33
import { test } from 'node:test'
4-
import { plugin as fastifyOpenApiDocs } from '../src/index.js'
4+
import { plugin as fastifyOpenApiDocs } from '../src/index.ts'
55

66
test('UI serving', async () => {
77
await test('should serve the UI by default', async () => {

tsconfig.json

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
{
2+
"extends": "@cowtech/typescript-config",
23
"compilerOptions": {
3-
"target": "ESNext",
4-
"module": "NodeNext",
5-
"moduleResolution": "NodeNext",
6-
"jsx": "preserve",
7-
"declaration": true,
8-
"outDir": "dist",
9-
"allowJs": false,
10-
"allowSyntheticDefaultImports": true,
11-
"esModuleInterop": true,
12-
"strict": true,
13-
"skipLibCheck": true,
14-
"noImplicitAny": true,
15-
"noUnusedLocals": true,
16-
"noUnusedParameters": true,
17-
"strictNullChecks": true,
18-
"useUnknownInCatchVariables": false
4+
"outDir": "./dist",
5+
"rootDir": "./src",
6+
"declaration": true
197
},
20-
"include": ["src/*.ts"]
8+
"include": ["src/*.ts"],
9+
"exclude": ["node_modules", "dist"]
2110
}

0 commit comments

Comments
 (0)