From b07d6198a111fd2d273d92be286dc3c32430f920 Mon Sep 17 00:00:00 2001 From: James Sumners <321201+jsumners@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:43:46 -0400 Subject: [PATCH] Merge `next` into `master` (#299) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 * Update .github/workflows/ci.yml Signed-off-by: Gürgün Dayıoğlu --------- Signed-off-by: Gürgün Dayıoğlu * update fastify deps --------- Signed-off-by: Gürgün Dayıoğlu Co-authored-by: Gürgün Dayıoğlu --- .github/workflows/ci.yml | 2 +- build/build-validation.js | 2 +- lib/config-validator.js | 2 +- lib/form-data.js | 6 ++---- lib/request.js | 8 ++++++-- lib/response.js | 2 +- package.json | 24 ++++++++++++------------ 7 files changed, 24 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f7d384..eb32ee7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/build/build-validation.js b/build/build-validation.js index 92d70b7..4dc7131 100644 --- a/build/build-validation.js +++ b/build/build-validation.js @@ -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} ` diff --git a/lib/config-validator.js b/lib/config-validator.js index 8b8b221..734c2e5 100644 --- a/lib/config-validator.js +++ b/lib/config-validator.js @@ -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; diff --git a/lib/form-data.js b/lib/form-data.js index 05ef796..2812f14 100644 --- a/lib/form-data.js +++ b/lib/form-data.js @@ -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 } } diff --git a/lib/request.js b/lib/request.js index 809ba0c..f0f620b 100644 --- a/lib/request.js +++ b/lib/request.js @@ -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 @@ -182,7 +186,7 @@ function Request (options) { } const signal = options.signal - /* istanbul ignore if */ + /* c8 ignore next 3 */ if (signal) { addAbortSignal(signal, this) } diff --git a/lib/response.js b/lib/response.js index 4daacc0..322bc22 100644 --- a/lib/response.js +++ b/lib/response.js @@ -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) } diff --git a/package.json b/package.json index 17f3955..0bff1b0 100644 --- a/package.json +++ b/package.json @@ -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",