Skip to content

Commit

Permalink
Merge next into master (#299)
Browse files Browse the repository at this point in the history
* Update for Fastify v5 (#287)

* update for v5

* update ci

* update workflow

* add node 22

* Update .github/workflows/ci.yml

Signed-off-by: Gürgün Dayıoğlu <[email protected]>

* Update .github/workflows/ci.yml

Signed-off-by: Gürgün Dayıoğlu <[email protected]>

---------

Signed-off-by: Gürgün Dayıoğlu <[email protected]>

* update fastify deps

---------

Signed-off-by: Gürgün Dayıoğlu <[email protected]>
Co-authored-by: Gürgün Dayıoğlu <[email protected]>
  • Loading branch information
jsumners and gurgunday authored Jul 10, 2024
1 parent 7dd4977 commit b07d619
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
test:
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5.0.0
with:
fastify-dependency-integration: true
license-check: true
Expand Down
2 changes: 1 addition & 1 deletion build/build-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const factory = AjvStandaloneCompiler({
readMode: false,
storeFunction (routeOpts, schemaValidationCode) {
const moduleCode = `// This file is autogenerated by ${__filename.replace(__dirname, 'build')}, do not edit
/* istanbul ignore file */
/* c8 ignore start */
/* eslint-disable */
${schemaValidationCode}
`
Expand Down
2 changes: 1 addition & 1 deletion lib/config-validator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is autogenerated by build/build-validation.js, do not edit
/* istanbul ignore file */
/* c8 ignore start */
/* eslint-disable */
"use strict";
module.exports = validate10;
Expand Down
6 changes: 2 additions & 4 deletions lib/form-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,13 @@ function formDataToStream (formdata) {
// header
yield textEncoder.encode(header)
// body
/* istanbul ignore else */
if (value.stream) {
yield * value.stream()
} else {
} /* c8 ignore start */ else {
// shouldn't be here since Blob / File should provide .stream
// and FormData always convert to USVString
/* istanbul ignore next */
yield value
}
} /* c8 ignore stop */
yield linebreak
}
}
Expand Down
8 changes: 6 additions & 2 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ const { isFormDataLike, formDataToStream } = require('./form-data')
const { EventEmitter } = require('node:events')

// request.connectin deprecation https://nodejs.org/api/http.html#http_request_connection
const FST_LIGHTMYREQUEST_DEP01 = createDeprecation({ name: 'FastifyDeprecationLightMyRequest', code: 'FST_LIGHTMYREQUEST_DEP01', message: 'You are accessing "request.connection", use "request.socket" instead.' })
const FST_LIGHTMYREQUEST_DEP01 = createDeprecation({
name: 'FastifyDeprecationLightMyRequest',
code: 'FST_LIGHTMYREQUEST_DEP01',
message: 'You are accessing "request.connection", use "request.socket" instead.'
})

/**
* Get hostname:port
Expand Down Expand Up @@ -182,7 +186,7 @@ function Request (options) {
}

const signal = options.signal
/* istanbul ignore if */
/* c8 ignore next 3 */
if (signal) {
addAbortSignal(signal, this)
}
Expand Down
2 changes: 1 addition & 1 deletion lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Response.prototype.addTrailers = function (trailers) {

function generatePayload (response) {
// This seems only to happen when using `fastify-express` - see https://github.com/fastify/fastify-express/issues/47
/* istanbul ignore if */
/* c8 ignore next 3 */
if (response._lightMyRequest.headers === null) {
copyHeaders(response)
}
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
"types": "types/index.d.ts",
"dependencies": {
"cookie": "^0.6.0",
"process-warning": "^3.0.0",
"set-cookie-parser": "^2.4.1"
"process-warning": "^4.0.0",
"set-cookie-parser": "^2.6.0"
},
"devDependencies": {
"@fastify/ajv-compiler": "^3.1.0",
"@fastify/pre-commit": "^2.0.2",
"@types/node": "^20.1.0",
"@fastify/ajv-compiler": "^4.0.0-pre.fv5.1",
"@fastify/pre-commit": "^2.1.0",
"@types/node": "^20.12.7",
"end-of-stream": "^1.4.4",
"express": "^4.17.1",
"form-auto-content": "^3.0.0",
"express": "^4.19.2",
"form-auto-content": "^3.2.1",
"form-data": "^4.0.0",
"formdata-node": "^4.4.1",
"standard": "^17.0.0",
"tap": "^16.0.0",
"tinybench": "^2.5.1",
"formdata-node": "^6.0.3",
"standard": "^17.1.0",
"tap": "^18.7.2",
"tinybench": "^2.7.0",
"tsd": "^0.31.0",
"undici": "^5.28.4"
"undici": "^6.13.0"
},
"scripts": {
"benchmark": "node benchmark/benchmark.js",
Expand Down

0 comments on commit b07d619

Please sign in to comment.