Skip to content

Commit 484b5f6

Browse files
authored
Merge pull request #218 from AthennaIO/develop
chore(npm): update dependencies
2 parents 36a8d7d + e459d2f commit 484b5f6

File tree

8 files changed

+2372
-1160
lines changed

8 files changed

+2372
-1160
lines changed

package-lock.json

Lines changed: 2334 additions & 1095 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/http",
3-
"version": "5.32.0",
3+
"version": "5.33.0",
44
"description": "The Athenna Http server. Built on top of fastify.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",
@@ -74,40 +74,40 @@
7474
"#tests": "./tests/index.js"
7575
},
7676
"devDependencies": {
77-
"@athenna/artisan": "^5.6.0",
78-
"@athenna/common": "^5.7.0",
79-
"@athenna/config": "^5.3.0",
80-
"@athenna/ioc": "^5.1.0",
81-
"@athenna/logger": "^5.3.0",
82-
"@athenna/test": "^5.3.0",
77+
"@athenna/artisan": "^5.7.0",
78+
"@athenna/common": "^5.14.0",
79+
"@athenna/config": "^5.4.0",
80+
"@athenna/ioc": "^5.2.0",
81+
"@athenna/logger": "^5.7.0",
82+
"@athenna/test": "^5.5.0",
8383
"@athenna/tsconfig": "^5.0.0",
8484
"@athenna/view": "^5.3.0",
8585
"@athenna/vite": "^5.13.0",
86-
"@fastify/cors": "^10.0.2",
86+
"@fastify/cors": "^10.1.0",
8787
"@fastify/helmet": "^13.0.1",
8888
"@fastify/multipart": "^9.0.3",
89-
"@fastify/rate-limit": "^10.2.2",
90-
"@fastify/static": "^8.0.4",
91-
"@fastify/swagger": "^9.4.2",
92-
"@fastify/swagger-ui": "^5.2.1",
93-
"@typescript-eslint/eslint-plugin": "^8.21.0",
94-
"@typescript-eslint/parser": "^8.21.0",
89+
"@fastify/rate-limit": "^10.3.0",
90+
"@fastify/static": "^8.2.0",
91+
"@fastify/swagger": "^9.5.1",
92+
"@fastify/swagger-ui": "^5.2.3",
93+
"@typescript-eslint/eslint-plugin": "^8.38.0",
94+
"@typescript-eslint/parser": "^8.38.0",
9595
"autocannon": "^7.15.0",
9696
"commitizen": "^4.3.1",
9797
"cz-conventional-changelog": "^3.3.0",
9898
"eslint": "^8.57.1",
99-
"eslint-config-prettier": "^8.10.0",
99+
"eslint-config-prettier": "^8.10.2",
100100
"eslint-config-standard": "^17.1.0",
101-
"eslint-plugin-import": "^2.31.0",
101+
"eslint-plugin-import": "^2.32.0",
102102
"eslint-plugin-n": "^15.7.0",
103-
"eslint-plugin-prettier": "^4.2.1",
103+
"eslint-plugin-prettier": "^4.2.5",
104104
"eslint-plugin-promise": "^6.6.0",
105105
"foreground-child": "^2.0.0",
106106
"husky": "^3.1.0",
107107
"lint-staged": "^12.5.0",
108-
"ora": "^8.1.1",
108+
"ora": "^8.2.0",
109109
"prettier": "^2.8.8",
110-
"vite": "^6.0.11",
110+
"vite": "^6.3.5",
111111
"vite-plugin-restart": "^0.4.2"
112112
},
113113
"c8": {

src/commands/RouteListCommand.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ export class RouteListCommand extends BaseCommand {
7777
* Resolve the http routes file.
7878
*/
7979
private async resolveRoute() {
80-
const path = Config.get(
81-
'rc.commands.route:list.route',
82-
Path.routes(`http.${Path.ext()}`)
83-
)
80+
const path = Config.get('rc.http.route', Path.routes(`http.${Path.ext()}`))
8481

8582
await Module.resolve(path, this.getParentURL())
8683
}
@@ -89,14 +86,11 @@ export class RouteListCommand extends BaseCommand {
8986
* Get the http kernel module from RC file or resolve the default one.
9087
*/
9188
private async getHttpKernel() {
92-
if (!Config.exists('rc.commands.route:list.kernel')) {
89+
if (!Config.exists('rc.http.kernel')) {
9390
return HttpKernel
9491
}
9592

96-
return Module.resolve(
97-
Config.get('rc.commands.route:list.kernel'),
98-
this.getParentURL()
99-
)
93+
return Module.resolve(Config.get('rc.http.kernel'), this.getParentURL())
10094
}
10195

10296
/**

src/handlers/HttpExceptionHandler.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,27 +71,13 @@ export class HttpExceptionHandler {
7171
error = error.toAthennaException()
7272
}
7373

74-
const isUsingJsonFormatter = Config.is(
75-
'logging.channels.exception.formatter',
76-
'json'
77-
)
78-
79-
if (isUsingJsonFormatter) {
80-
Log.channelOrVanilla('exception').error({
81-
name: error.name,
82-
code: error.code,
83-
status: error.status,
84-
message: error.message,
85-
help: error.help,
86-
cause: error.cause,
87-
details: error.details,
88-
stack: error.stack
89-
})
74+
if (Config.is('http.logger.prettifyException', true)) {
75+
Log.channelOrVanilla('exception').error(await error.prettify())
9076

9177
return
9278
}
9379

94-
Log.channelOrVanilla('exception').error(await error.prettify())
80+
Log.channelOrVanilla('exception').error(error)
9581
}
9682

9783
/**

tests/fixtures/consoles/base-console.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ await Config.loadAll(Path.fixtures('config'))
2020

2121
Config.set('rc.parentURL', Path.toHref(Path.pwd() + sep))
2222

23+
Config.set('rc.http', {
24+
route: './tests/fixtures/routes/http.js',
25+
kernel: './tests/fixtures/kernels/HttpKernel.js'
26+
})
27+
2328
Config.set('rc.commands', {
24-
'route:list': {
25-
path: '#src/commands/RouteListCommand',
26-
route: './tests/fixtures/routes/http.js',
27-
kernel: './tests/fixtures/kernels/HttpKernel.js'
28-
},
29+
'route:list': '#src/commands/RouteListCommand',
2930
'make:controller': '#src/commands/MakeControllerCommand',
3031
'make:interceptor': '#src/commands/MakeInterceptorCommand',
3132
'make:middleware': '#src/commands/MakeMiddlewareCommand',

tests/fixtures/consoles/console-mock-dest-import.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ await Config.loadAll(Path.fixtures('config'))
2020

2121
Config.set('rc.parentURL', Path.toHref(Path.pwd() + sep))
2222

23+
Config.set('rc.http', {
24+
route: './tests/fixtures/routes/http.js',
25+
kernel: './tests/fixtures/kernels/HttpKernel.js'
26+
})
27+
2328
Config.set('rc.commands', {
24-
'route:list': {
25-
path: '#src/commands/RouteListCommand',
26-
route: './tests/fixtures/routes/http.js',
27-
kernel: './tests/fixtures/kernels/HttpKernel.js'
28-
},
29+
'route:list': '#src/commands/RouteListCommand',
2930
'make:controller': {
3031
path: '#src/commands/MakeControllerCommand',
3132
destination: './tests/fixtures/storage/controllers'

tests/unit/kernels/HttpKernelTest.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,6 @@ export default class HttpKernelTest {
298298
assert.isFalse(Server.fastify.hasPlugin('cls-rtracer'))
299299
}
300300

301-
@Test()
302-
public async shouldNotRegisterTheFastifyRTracerPluginIfTheTraceOptionsIsSetToFalse({ assert }: Context) {
303-
const { HttpKernel } = await import(`../../../src/kernels/HttpKernel.js?v=${Math.random()}`)
304-
const kernel = new HttpKernel()
305-
await kernel.registerRTracer(false)
306-
307-
assert.isFalse(Server.fastify.hasPlugin('cls-rtracer'))
308-
}
309-
310301
@Test()
311302
@Cleanup(() => Config.set('http.rTracer.enabled', true))
312303
public async shouldNotRegisterTheFastifyRTracerPluginIfTheConfigurationIsDisabled({ assert }: Context) {

tests/unit/server/ServerTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default class ServerTest {
5757

5858
@Test()
5959
public async shouldBeAbleToGetTheFastifyVersionFromTheHttpServer({ assert }: Context) {
60-
assert.equal(Server.getFastifyVersion(), '5.2.1')
60+
assert.equal(Server.getFastifyVersion(), '5.4.0')
6161
}
6262

6363
@Test()

0 commit comments

Comments
 (0)