From 409952b11d086f290a369189d07e4544421efa02 Mon Sep 17 00:00:00 2001 From: James Sumners Date: Thu, 28 Apr 2022 11:24:05 -0400 Subject: [PATCH] Update fastify-error dependency (#3859) --- fastify.d.ts | 6 +++--- lib/errors.js | 2 +- package.json | 20 ++++++++++---------- test/types/hooks.test-d.ts | 2 +- test/types/plugin.test-d.ts | 2 +- test/types/route.test-d.ts | 2 +- types/hooks.d.ts | 2 +- types/instance.d.ts | 2 +- types/logger.d.ts | 2 +- types/route.d.ts | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/fastify.d.ts b/fastify.d.ts index de5f9e970b..2af138b45c 100644 --- a/fastify.d.ts +++ b/fastify.d.ts @@ -9,7 +9,7 @@ import { FastifyLoggerInstance, FastifyLoggerOptions } from './types/logger' import { FastifyInstance } from './types/instance' import { FastifyServerFactory } from './types/serverFactory' import { Options as AjvOptions } from '@fastify/ajv-compiler' -import { FastifyError } from 'fastify-error' +import { FastifyError } from '@fastify/error' import { FastifyReply } from './types/reply' import { FastifySchemaValidationError } from './types/schema' import { ConstructorAction, ProtoAction } from "./types/content-type-parser"; @@ -163,7 +163,7 @@ export type FastifyServerOptions< type TrustProxyFunction = (address: string, hop: number) => boolean -declare module 'fastify-error' { +declare module '@fastify/error' { interface FastifyError { validation?: ValidationResult[]; } @@ -188,7 +188,7 @@ export { FastifyContext, FastifyContextConfig } from './types/context' export { RouteHandler, RouteHandlerMethod, RouteOptions, RouteShorthandMethod, RouteShorthandOptions, RouteShorthandOptionsWithHandler } from './types/route' export * from './types/register' export { FastifyBodyParser, FastifyContentTypeParser, AddContentTypeParser, hasContentTypeParser, getDefaultJsonParser, ProtoAction, ConstructorAction } from './types/content-type-parser' -export { FastifyError } from 'fastify-error' +export { FastifyError } from '@fastify/error' export { FastifySchema, FastifySchemaCompiler } from './types/schema' export { HTTPMethods, RawServerBase, RawRequestDefaultExpression, RawReplyDefaultExpression, RawServerDefault, ContextConfigDefault, RequestBodyDefault, RequestQuerystringDefault, RequestParamsDefault, RequestHeadersDefault } from './types/utils' export * from './types/hooks' diff --git a/lib/errors.js b/lib/errors.js index 6d64d6a7e0..b7cad907ff 100644 --- a/lib/errors.js +++ b/lib/errors.js @@ -1,6 +1,6 @@ 'use strict' -const createError = require('fastify-error') +const createError = require('@fastify/error') const codes = { /** * Basic diff --git a/package.json b/package.json index 5394a4a99c..7d1bbdb300 100644 --- a/package.json +++ b/package.json @@ -127,9 +127,8 @@ "@sinonjs/fake-timers": "^9.1.0", "@types/node": "^16.0.0", "@types/pino": "^6.0.1", - "@typescript-eslint/eslint-plugin": "^5.0.0", - "@typescript-eslint/parser": "^5.0.0", - "JSONStream": "^1.3.5", + "@typescript-eslint/eslint-plugin": "^5.21.0", + "@typescript-eslint/parser": "^5.21.0", "ajv": "^6.0.0", "ajv-errors": "^1.0.1", "ajv-formats": "^2.1.1", @@ -140,11 +139,11 @@ "cors": "^2.8.5", "coveralls": "^3.1.0", "dns-prefetch-control": "^0.3.0", - "eslint": "^8.0.1", + "eslint": "^8.14.0", "eslint-config-standard": "^17.0.0-1", - "eslint-import-resolver-node": "^0.3.2", - "eslint-plugin-import": "^2.25.4", - "eslint-plugin-n": "^14.0.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-n": "^15.2.0", "eslint-plugin-promise": "^6.0.0", "fast-json-body": "^1.1.0", "fastify-plugin": "^3.0.0", @@ -157,6 +156,7 @@ "hsts": "^2.2.0", "http-errors": "^2.0.0", "ienoopen": "^1.1.0", + "JSONStream": "^1.3.5", "license-checker": "^25.0.1", "pem": "^1.14.4", "proxyquire": "^2.1.3", @@ -166,7 +166,7 @@ "simple-get": "^4.0.0", "snazzy": "^9.0.0", "split2": "^4.1.0", - "standard": "^17.0.0-2", + "standard": "^17.0.0", "tap": "^15.1.1", "tap-mocha-reporter": "^5.0.1", "then-sleep": "^1.0.1", @@ -178,15 +178,15 @@ }, "dependencies": { "@fastify/ajv-compiler": "^1.0.0", + "@fastify/error": "^2.0.0", "abstract-logging": "^2.0.0", "avvio": "^7.1.2", "fast-json-stringify": "^2.5.2", - "fastify-error": "^0.3.0", - "process-warning": "^1.0.0", "find-my-way": "^4.5.0", "flatstr": "^1.0.12", "light-my-request": "^4.2.0", "pino": "^6.13.0", + "process-warning": "^1.0.0", "proxy-addr": "^2.0.7", "rfdc": "^1.1.4", "secure-json-parse": "^2.0.0", diff --git a/test/types/hooks.test-d.ts b/test/types/hooks.test-d.ts index 61656a38d0..478e10fc9b 100644 --- a/test/types/hooks.test-d.ts +++ b/test/types/hooks.test-d.ts @@ -1,4 +1,4 @@ -import { FastifyError } from 'fastify-error' +import { FastifyError } from '@fastify/error' import { expectAssignable, expectError, expectType } from 'tsd' import fastify, { FastifyInstance, diff --git a/test/types/plugin.test-d.ts b/test/types/plugin.test-d.ts index 206b3d46f1..566ec6682b 100644 --- a/test/types/plugin.test-d.ts +++ b/test/types/plugin.test-d.ts @@ -3,7 +3,7 @@ import * as http from 'http' import * as https from 'https' import { expectType, expectError, expectAssignable } from 'tsd' import { FastifyPluginCallback, FastifyPluginAsync } from '../../types/plugin' -import { FastifyError } from 'fastify-error' +import { FastifyError } from '@fastify/error' // FastifyPlugin & FastifyRegister interface TestOptions extends FastifyPluginOptions { diff --git a/test/types/route.test-d.ts b/test/types/route.test-d.ts index c6de92a2cb..85175fe43a 100644 --- a/test/types/route.test-d.ts +++ b/test/types/route.test-d.ts @@ -3,7 +3,7 @@ import { expectType, expectError, expectAssignable } from 'tsd' import { HTTPMethods } from '../../types/utils' import * as http from 'http' import { RequestPayload } from '../../types/hooks' -import { FastifyError } from 'fastify-error' +import { FastifyError } from '@fastify/error' /* * Testing Fastify HTTP Routes and Route Shorthands. diff --git a/types/hooks.d.ts b/types/hooks.d.ts index 50d8f6dbf6..12fd57a079 100644 --- a/types/hooks.d.ts +++ b/types/hooks.d.ts @@ -4,7 +4,7 @@ import { RouteOptions, RouteGenericInterface } from './route' import { RawServerBase, RawServerDefault, RawRequestDefaultExpression, RawReplyDefaultExpression, ContextConfigDefault } from './utils' import { FastifyRequest } from './request' import { FastifyReply } from './reply' -import { FastifyError } from 'fastify-error' +import { FastifyError } from '@fastify/error' import { FastifyLoggerInstance } from './logger' import { RegisterOptions } from './register' import { FastifyPluginOptions } from './plugin' diff --git a/types/instance.d.ts b/types/instance.d.ts index 549d5bc3c2..82c9500e58 100644 --- a/types/instance.d.ts +++ b/types/instance.d.ts @@ -13,7 +13,7 @@ import { FastifyRegister } from './register' import { onRequestHookHandler, preParsingHookHandler, onSendHookHandler, preValidationHookHandler, preHandlerHookHandler, preSerializationHookHandler, onResponseHookHandler, onErrorHookHandler, onRouteHookHandler, onRegisterHookHandler, onCloseHookHandler, onCloseAsyncHookHandler, onReadyHookHandler, onTimeoutHookHandler, preParsingAsyncHookHandler, preValidationAsyncHookHandler, preHandlerAsyncHookHandler, preSerializationAsyncHookHandler, onSendAsyncHookHandler, onResponseAsyncHookHandler, onTimeoutAsyncHookHandler, onErrorAsyncHookHandler, onReadyAsyncHookHandler, onRequestAsyncHookHandler } from './hooks' import { FastifyRequest } from './request' import { FastifyReply } from './reply' -import { FastifyError } from 'fastify-error' +import { FastifyError } from '@fastify/error' import { AddContentTypeParser, hasContentTypeParser, getDefaultJsonParser, ProtoAction, ConstructorAction, FastifyBodyParser, removeContentTypeParser, removeAllContentTypeParsers } from './content-type-parser' export interface PrintRoutesOptions { diff --git a/types/logger.d.ts b/types/logger.d.ts index 420433e0f8..956e203eb7 100644 --- a/types/logger.d.ts +++ b/types/logger.d.ts @@ -18,7 +18,7 @@ * https://github.com/fastify/fastify/issues/649 */ -import { FastifyError } from 'fastify-error' +import { FastifyError } from '@fastify/error' import { RawServerBase, RawServerDefault, RawRequestDefaultExpression, RawReplyDefaultExpression } from './utils' import { RouteGenericInterface } from './route' import { FastifyRequest } from './request' diff --git a/types/route.d.ts b/types/route.d.ts index 789dd27c4b..4e47e0f1e5 100644 --- a/types/route.d.ts +++ b/types/route.d.ts @@ -5,7 +5,7 @@ import { FastifySchema, FastifySchemaCompiler, FastifySchemaValidationError, Fas import { HTTPMethods, RawServerBase, RawServerDefault, RawRequestDefaultExpression, RawReplyDefaultExpression, ContextConfigDefault } from './utils' import { FastifyLoggerInstance, LogLevel } from './logger' import { preValidationHookHandler, preHandlerHookHandler, preSerializationHookHandler, onRequestHookHandler, preParsingHookHandler, onResponseHookHandler, onSendHookHandler, onErrorHookHandler, onTimeoutHookHandler } from './hooks' -import { FastifyError } from 'fastify-error' +import { FastifyError } from '@fastify/error' import { FastifyContext } from './context' export interface RouteGenericInterface extends RequestGenericInterface, ReplyGenericInterface {}