-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Support for Fastify v3 #22
Changes from all commits
01d637f
00fe678
269195a
98578d1
732912e
f13b4f6
a66b9b4
3ac0811
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Node CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
node-version: [10.x, 12.x, 14.x] | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install | ||
run: | | ||
npm install | ||
|
||
- name: Test | ||
run: | | ||
npm test |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { expectType, expectAssignable } from 'tsd' | ||
import fastify from 'fastify' | ||
import fastifySensible from '.' | ||
|
||
const app = fastify() | ||
|
||
app.register(fastifySensible, { | ||
errorHandler: true | ||
}) | ||
|
||
app.get('/', (req, reply) => { | ||
expectAssignable<void>(reply.notFound()) | ||
}) | ||
|
||
app.get('/', async (req, reply) => { | ||
expectAssignable<Error>(app.httpErrors.notFound()) | ||
}) | ||
|
||
app.get('/', async (req, reply) => { | ||
expectType<string>(app.assert.equal(1, 2)) | ||
}) | ||
|
||
app.get('/', async (req, reply) => { | ||
expectType<Promise<[Error, void]>>(app.to<void>(new Promise(resolve => resolve()))) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"description": "Defaults for Fastify that everyone can agree on", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "standard && tap test/*.test.js && tsc --project ./tsconfig.json" | ||
"test": "standard && tap test/*.test.js && tsd" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -23,18 +23,22 @@ | |
}, | ||
"homepage": "https://github.com/fastify/fastify-sensible#readme", | ||
"devDependencies": { | ||
"fastify": "^2.3.0", | ||
"standard": "^12.0.1", | ||
"tap": "^12.7.0" | ||
"fastify": "^3.0.0-alpha.1", | ||
"standard": "^14.3.3", | ||
"tap": "^14.10.7", | ||
"tsd": "^0.11.0" | ||
}, | ||
"dependencies": { | ||
"@types/node": "^12.0.7", | ||
"fast-deep-equal": "^2.0.1", | ||
"fastify-plugin": "^1.5.0", | ||
"@types/node": "^13.13.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not put this in dependencies. It should be a devDep. |
||
"fast-deep-equal": "^3.1.1", | ||
"fastify-plugin": "^2.0.0", | ||
"forwarded": "^0.1.2", | ||
"http-errors": "^1.7.2", | ||
"proxy-addr": "^2.0.5", | ||
"http-errors": "^1.7.3", | ||
"proxy-addr": "^2.0.6", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need proxy-addr? I think this feature is built in Fastify now..? |
||
"type-is": "^1.6.18", | ||
"vary": "^1.1.2" | ||
}, | ||
"engines": { | ||
"node": ">=10.0.0" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use
rc
instead ofalpha