Skip to content
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

Update fastify-error dependency #3859

Merged
merged 2 commits into from Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions fastify.d.ts
Expand Up @@ -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";
Expand Down Expand Up @@ -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[];
}
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion lib/errors.js
@@ -1,6 +1,6 @@
'use strict'

const createError = require('fastify-error')
const createError = require('@fastify/error')
const codes = {
/**
* Basic
Expand Down
20 changes: 10 additions & 10 deletions package.json
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion 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,
Expand Down
2 changes: 1 addition & 1 deletion test/types/plugin.test-d.ts
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion test/types/route.test-d.ts
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion types/hooks.d.ts
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion types/instance.d.ts
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion types/logger.d.ts
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion types/route.d.ts
Expand Up @@ -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 {}
Expand Down