Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update deps and support fastify v5 #23

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FastifyPlugin } from 'fastify';
import { FastifyPluginCallback } from 'fastify';
import { addHealthCheck } from './src/customHealthCheck';

export interface CustomHealthCheckOptions {
Expand All @@ -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<string, any>
schema?: boolean | Record<string, any>;
}

declare module 'fastify' {
Expand All @@ -18,5 +18,5 @@ declare module 'fastify' {
}
}

declare const customHealthCheck: FastifyPlugin<CustomHealthCheckOptions>;
declare const customHealthCheck: FastifyPluginCallback<CustomHealthCheckOptions>;
export default customHealthCheck;
12 changes: 8 additions & 4 deletions lib/src/customHealthCheck.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> | unknown, evaluation?: evaluation): void;
*/
(
label: string,
fn: (...args: any) => Promise<unknown> | unknown,
evaluation?: evaluation
): void;
}

interface evaluation {
/** object or value to compare with healthcheck fn */
value: unknown
}
value: unknown;
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading