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

chore(npm): update dependencies #209

Merged
merged 3 commits into from
Jan 23, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,654 changes: 971 additions & 683 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/http",
"version": "5.23.0",
"version": "5.24.0",
"description": "The Athenna Http server. Built on top of fastify.",
"license": "MIT",
"author": "João Lenon <lenon@athenna.io>",
Expand Down Expand Up @@ -74,23 +74,23 @@
"#tests": "./tests/index.js"
},
"devDependencies": {
"@athenna/artisan": "^5.3.0",
"@athenna/common": "^5.4.0",
"@athenna/config": "^5.1.0",
"@athenna/ioc": "^5.0.0",
"@athenna/logger": "^5.1.0",
"@athenna/test": "^5.2.0",
"@athenna/artisan": "^5.6.0",
"@athenna/common": "^5.7.0",
"@athenna/config": "^5.3.0",
"@athenna/ioc": "^5.1.0",
"@athenna/logger": "^5.3.0",
"@athenna/test": "^5.3.0",
"@athenna/tsconfig": "^5.0.0",
"@athenna/view": "^5.1.0",
"@athenna/vite": "^5.10.0",
"@fastify/cors": "^10.0.1",
"@fastify/helmet": "^13.0.0",
"@fastify/rate-limit": "^10.2.1",
"@fastify/static": "^8.0.3",
"@fastify/swagger": "^9.4.0",
"@fastify/swagger-ui": "^5.2.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@athenna/view": "^5.3.0",
"@athenna/vite": "^5.12.0",
"@fastify/cors": "^10.0.2",
"@fastify/helmet": "^13.0.1",
"@fastify/rate-limit": "^10.2.2",
"@fastify/static": "^8.0.4",
"@fastify/swagger": "^9.4.2",
"@fastify/swagger-ui": "^5.2.1",
"@typescript-eslint/eslint-plugin": "^8.21.0",
"@typescript-eslint/parser": "^8.21.0",
"autocannon": "^7.15.0",
"commitizen": "^4.3.1",
"cz-conventional-changelog": "^3.3.0",
Expand All @@ -106,7 +106,7 @@
"lint-staged": "^12.5.0",
"ora": "^8.1.1",
"prettier": "^2.8.8",
"vite": "^6.0.6",
"vite": "^6.0.11",
"vite-plugin-restart": "^0.4.2"
},
"c8": {
Expand Down
6 changes: 4 additions & 2 deletions src/context/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
* file that was distributed with this source code.
*/

import { Is, Json } from '@athenna/common'
import type { AddressInfo } from 'node:net'
import type { FastifyRequest } from 'fastify'
import { Is, Json, Macroable } from '@athenna/common'

export class Request {
export class Request extends Macroable {
/**
* The fastify request object.
*/
private request: FastifyRequest

public constructor(request: FastifyRequest) {
super()

this.request = request
}

Expand Down
5 changes: 4 additions & 1 deletion src/context/Response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
*/

import { View } from '@athenna/view'
import { Macroable } from '@athenna/common'
import type { FastifyReply } from 'fastify'
import type { SendOptions } from '@fastify/static'
import type { Request } from '#src/context/Request'
import type { FastifyHelmetOptions } from '@fastify/helmet'

export class Response {
export class Response extends Macroable {
/**
* The fastify response object.
*/
Expand All @@ -25,6 +26,8 @@ export class Response {
private request: Request

public constructor(response: FastifyReply, request?: Request) {
super()

this.response = response
this.request = request
}
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/FastifyHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { Response } from '#src/context/Response'
import type { RequestHandler } from '#src/types/contexts/Context'
import type { ErrorHandler } from '#src/types/contexts/ErrorContext'
import type { InterceptHandler, TerminateHandler } from '#src/types'
import type { FastifyReply, FastifyRequest, RouteHandlerMethod } from 'fastify'
import { NotFoundException } from '#src/exceptions/NotFoundException'
import type { FastifyReply, FastifyRequest, RouteHandlerMethod } from 'fastify'

export class FastifyHandler {
/**
Expand Down
6 changes: 4 additions & 2 deletions src/router/Route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import type {
InterceptorRouteType
} from '#src/types'

import { Is, Options, Route as RouteHelper } from '@athenna/common'
import type { HTTPMethods, FastifySchema, RouteOptions } from 'fastify'
import { Is, Options, Macroable, Route as RouteHelper } from '@athenna/common'
import { UndefinedMethodException } from '#src/exceptions/UndefinedMethodException'
import { NotFoundValidatorException } from '#src/exceptions/NotFoundValidatorException'
import { NotFoundMiddlewareException } from '#src/exceptions/NotFoundMiddlewareException'

export class Route {
export class Route extends Macroable {
/**
* Holds all the route implementations to be registered in the Server.
*/
Expand All @@ -43,6 +43,8 @@ export class Route {
methods: HTTPMethods[],
handler: RouteHandler
) {
super()

this.route = {
url,
methods,
Expand Down
5 changes: 4 additions & 1 deletion src/router/RouteGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ import type {
} from '#src/types'

import { Route } from '#src/router/Route'
import { Macroable } from '@athenna/common'
import { RouteResource } from '#src/router/RouteResource'

export class RouteGroup {
export class RouteGroup extends Macroable {
/**
* All routes registered in the group.
*/
// eslint-disable-next-line no-use-before-define
public routes: (Route | RouteGroup | RouteResource)[]

public constructor(routes: (Route | RouteGroup | RouteResource)[]) {
super()

this.routes = routes
}

Expand Down
6 changes: 4 additions & 2 deletions src/router/RouteResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import type {

import type { HTTPMethods } from 'fastify'
import { Route } from '#src/router/Route'
import { Is, String } from '@athenna/common'
import { Is, String, Macroable } from '@athenna/common'

export class RouteResource {
export class RouteResource extends Macroable {
/**
* All routes registered in the resource.
*/
Expand All @@ -35,6 +35,8 @@ export class RouteResource {
public controller: any

public constructor(resource: string, controller: any) {
super()

this.resource = resource
this.controller = controller

Expand Down
4 changes: 2 additions & 2 deletions src/router/Router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
* file that was distributed with this source code.
*/

import { Is } from '@athenna/common'
import { Route } from '#src/router/Route'
import { Server } from '#src/facades/Server'
import { Is, Macroable } from '@athenna/common'
import { RouteGroup } from '#src/router/RouteGroup'
import { RouteResource } from '#src/router/RouteResource'
import type { RouteJson, RequestHandler, RouteHandler } from '#src/types'
import type { HTTPMethods, FastifyInstance, RouteOptions } from 'fastify'
import { UndefinedMethodException } from '#src/exceptions/UndefinedMethodException'

export class Router {
export class Router extends Macroable {
/**
* All routes registered.
*/
Expand Down
8 changes: 5 additions & 3 deletions src/server/ServerImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ import type {
SwaggerDocument
} from '#src/types'

import { Options } from '@athenna/common'
import type { FastifyVite } from '@athenna/vite'
import type { AddressInfo } from 'node:net'
import type { FastifyVite } from '@athenna/vite'
import { Options, Macroable } from '@athenna/common'
import { FastifyHandler } from '#src/handlers/FastifyHandler'

export class ServerImpl {
export class ServerImpl extends Macroable {
/**
* Holds the fastify server instance.
*/
Expand All @@ -46,6 +46,8 @@ export class ServerImpl {
public isListening: boolean

public constructor(options?: FastifyServerOptions) {
super()

this.fastify = fastify.fastify({ ...options, exposeHeadRoutes: false })
this.isListening = false

Expand Down
3 changes: 2 additions & 1 deletion src/testing/plugins/request/TestRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@

import { Server } from '#src'
import { Assert } from '@japa/assert'
import { Macroable } from '@athenna/common'
import type { InjectOptions } from '#src/types'
import { TestResponse } from '#src/testing/plugins/request/TestResponse'

export class TestRequest {
export class TestRequest extends Macroable {
/**
* Japa assert class instance.
*/
Expand Down
5 changes: 4 additions & 1 deletion src/testing/plugins/request/TestResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
*/

import { Assert } from '@japa/assert'
import { Macroable } from '@athenna/common'
import type { Response } from 'light-my-request'

export class TestResponse {
export class TestResponse extends Macroable {
/**
* Japa assert class instance.
*/
Expand All @@ -22,6 +23,8 @@ export class TestResponse {
public response: Response

public constructor(assert: Assert, response: Response) {
super()

this.assert = assert
this.response = response
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/server/ServerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class ServerTest {

@Test()
public async shouldBeAbleToGetTheFastifyVersionFromTheHttpServer({ assert }: Context) {
assert.equal(Server.getFastifyVersion(), '5.2.0')
assert.equal(Server.getFastifyVersion(), '5.2.1')
}

@Test()
Expand Down
Loading