Skip to content

Commit

Permalink
major: upgrade to fastify v5 (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eomm authored Sep 17, 2024
1 parent 3b9e683 commit b7cd241
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ on:

jobs:
test:
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5.0.0
with:
lint: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ dist

package-lock.json
.vscode
.tap
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,6 @@ package-lock.json
.vscode
.github
.eslintrc
test/types
test/types
asd*
.tap
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"lint": "standard",
"lint:fix": "standard --fix",
"test": "tap test/**.test.* && tsd",
"test": "tap --show-full-coverage && tsd",
"test:types": "tsd"
},
"repository": {
Expand All @@ -34,13 +34,13 @@
"homepage": "https://github.com/Eomm/fastify-raw-body#readme",
"devDependencies": {
"@types/node": "^22.0.0",
"fastify": "^4.19.0",
"fastify": "^5.0.0",
"standard": "^17.0.0",
"tap": "^16.2.0",
"tap": "^21.0.0",
"tsd": "^0.31.0"
},
"dependencies": {
"fastify-plugin": "^4.0.0",
"fastify-plugin": "^5.0.0",
"raw-body": "^3.0.0",
"secure-json-parse": "^2.4.0"
},
Expand Down
2 changes: 1 addition & 1 deletion plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function rawBody (fastify, opts, next) {
}

const plugin = fp(rawBody, {
fastify: '^4.19.x',
fastify: '^5.x',
name: 'fastify-raw-body'
})

Expand Down
2 changes: 1 addition & 1 deletion test/example.test.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as t from 'tap'
import t from 'tap'
import Fastify from 'fastify'

await t.test('register in plugins', async t => {
Expand Down
2 changes: 1 addition & 1 deletion test/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ t.test('wrong fastify version', t => {

app.ready(err => {
t.ok(err)
t.match(err.message, /expected '\^4.19.x' fastify version/)
t.match(err.message, /expected '\^5.x' fastify version/)
})
})

Expand Down
2 changes: 1 addition & 1 deletion test/types/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ fastify.register(rawBodyPlugin, options4)
fastify.register(rawBodyPlugin, options5)

fastify.get('/', { config: { rawBody: true } }, (request, reply) => {
expectType<boolean | undefined>(request.routeConfig.rawBody)
expectType<string | Buffer | undefined>(request.rawBody)
return "rawBody enabled"
})

0 comments on commit b7cd241

Please sign in to comment.