From baf3338181798d483963381cd0398308d58aa1ed Mon Sep 17 00:00:00 2001 From: Georgios Kampitakis <50364739+gkampitakis@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:27:14 +0100 Subject: [PATCH] feat: update deps and support fastify v5 (#23) --- .github/workflows/ci.yml | 10 +++++----- lib/index.d.ts | 6 +++--- lib/src/customHealthCheck.d.ts | 12 ++++++++---- package.json | 12 ++++++------ 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d519bb3..79b3fad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,20 +3,20 @@ name: CI on: pull_request: paths-ignore: - - 'docs/**' - - '*.md' + - "docs/**" + - "*.md" jobs: test: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [14, 16, 18] + node-version: [20, 22] os: [ubuntu-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v2.1.5 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Install Dependencies diff --git a/lib/index.d.ts b/lib/index.d.ts index eed7ec1..44af77c 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -1,4 +1,4 @@ -import { FastifyPlugin } from 'fastify'; +import { FastifyPluginCallback } from 'fastify'; import { addHealthCheck } from './src/customHealthCheck'; export interface CustomHealthCheckOptions { @@ -9,7 +9,7 @@ export interface CustomHealthCheckOptions { /** Flag that enables additional information to be presented in health check object when a check fails. */ exposeFailure?: boolean; /** If set to true, default schema is used for the route definition, if to false - no schema. If object is passed, it will be used as a schema. Default value is "true" */ - schema?: boolean | Record + schema?: boolean | Record; } declare module 'fastify' { @@ -18,5 +18,5 @@ declare module 'fastify' { } } -declare const customHealthCheck: FastifyPlugin; +declare const customHealthCheck: FastifyPluginCallback; export default customHealthCheck; diff --git a/lib/src/customHealthCheck.d.ts b/lib/src/customHealthCheck.d.ts index 4072635..08b7709 100644 --- a/lib/src/customHealthCheck.d.ts +++ b/lib/src/customHealthCheck.d.ts @@ -3,11 +3,15 @@ export interface addHealthCheck { * @param label string for registering checks, must be unique * @param fn callback function supports Promises * @param evaluation object containing a value to compare with healthcheck fn return value - */ - (label: string, fn: (...args: any) => Promise | unknown, evaluation?: evaluation): void; + */ + ( + label: string, + fn: (...args: any) => Promise | unknown, + evaluation?: evaluation + ): void; } interface evaluation { /** object or value to compare with healthcheck fn */ - value: unknown -} \ No newline at end of file + value: unknown; +} diff --git a/package.json b/package.json index f956f81..7047f15 100644 --- a/package.json +++ b/package.json @@ -29,16 +29,16 @@ }, "dependencies": { "fast-deep-equal": "^3.1.3", - "fastify-plugin": "^4.0.0" + "fastify-plugin": "^5.0.1" }, "devDependencies": { - "fastify": "^4.0.0", - "fastify-type-provider-zod": "^1.1.7", - "jest": "^29.0.1", + "fastify": "^5.2.0", + "fastify-type-provider-zod": "^4.0.2", + "jest": "^29.7.0", "mongodb": "^4.7.0", - "semistandard": "^16.0.1", + "semistandard": "^17.0.0", "snazzy": "^9.0.0", - "zod": "^3.19.1" + "zod": "^3.24.1" }, "jest": { "collectCoverage": true,