Skip to content

Commit 6170832

Browse files
committed
chore: update dependencies
1 parent 2d14727 commit 6170832

File tree

3 files changed

+2
-41
lines changed

3 files changed

+2
-41
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"@japa/snapshot": "^2.0.10",
9292
"@poppinss/ts-exec": "^1.4.1",
9393
"@release-it/conventional-changelog": "^10.0.4",
94-
"@types/node": "^25.0.3",
94+
"@types/node": "^25.0.5",
9595
"@types/pretty-hrtime": "^1.0.3",
9696
"@types/sinon": "^21.0.0",
9797
"@types/supertest": "^6.0.3",
@@ -130,7 +130,7 @@
130130
"@adonisjs/hash": "^10.0.0-next.2",
131131
"@adonisjs/health": "^3.1.0-next.1",
132132
"@adonisjs/http-server": "^8.0.0-next.18",
133-
"@adonisjs/http-transformers": "^1.6.2",
133+
"@adonisjs/http-transformers": "^2.0.1",
134134
"@adonisjs/logger": "^7.1.0-next.3",
135135
"@adonisjs/repl": "^5.0.0-next.1",
136136
"@boringnode/encryption": "^0.2.4",

providers/app_provider.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,14 @@ import { Config } from '../modules/config.ts'
1414
import { Logger } from '../modules/logger.ts'
1515
import { Application } from '../modules/app.ts'
1616
import { Dumper } from '../modules/dumper/dumper.ts'
17-
import { HttpContext } from '../modules/http/main.ts'
1817
import { RuntimeException } from '../src/exceptions.ts'
1918
import { Router, Server } from '../modules/http/main.ts'
2019
import { BaseEvent, Emitter } from '../modules/events.ts'
2120
import { Encryption } from '../modules/encryption/main.ts'
2221
import { configProvider } from '../src/config_provider.ts'
23-
import { serialize } from '../modules/transformers/main.ts'
24-
import { type SerializeFn } from '../types/transformers.ts'
25-
import { type ContainerResolver } from '../modules/container.ts'
2622
import type { ApplicationService, LoggerService } from '../src/types.ts'
2723
import BodyParserMiddleware from '../modules/bodyparser/bodyparser_middleware.ts'
2824

29-
/**
30-
* Extend HTTP request class with the transform method
31-
*/
32-
declare module '@adonisjs/core/http' {
33-
export interface HttpContext {
34-
serialize: SerializeFn
35-
}
36-
}
37-
3825
/**
3926
* The Application Service provider registers all the baseline
4027
* features required to run the framework.
@@ -390,12 +377,6 @@ export default class AppServiceProvider {
390377
*/
391378
async boot() {
392379
BaseEvent.useEmitter(await this.app.container.make('emitter'))
393-
HttpContext.instanceProperty(
394-
'serialize',
395-
function (this: HttpContext, value: any, container?: ContainerResolver<any>) {
396-
return serialize(value, container ?? this.containerResolver) as any
397-
}
398-
)
399380
}
400381

401382
/**

tests/providers.spec.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { test } from '@japa/runner'
1111
import { fileURLToPath } from 'node:url'
1212
import { setTimeout } from 'node:timers/promises'
1313
import { defineConfig } from '@adonisjs/application'
14-
import { HttpContextFactory } from '@adonisjs/http-server/factories'
1514

1615
import { Repl } from '../modules/repl.ts'
1716
import { Config } from '../modules/config.ts'
@@ -391,23 +390,4 @@ test.group('Providers', () => {
391390
}"
392391
`)
393392
}).timeout(5000)
394-
395-
test('add transform method to HTTP context', async ({ assert }) => {
396-
const ignitor = new IgnitorFactory()
397-
.merge({
398-
rcFileContents: defineConfig({
399-
providers: [() => import('../providers/app_provider.js')],
400-
}),
401-
})
402-
.withCoreConfig()
403-
.create(BASE_URL)
404-
405-
const app = ignitor.createApp('repl')
406-
await app.init()
407-
await app.boot()
408-
409-
const { serialize } = new HttpContextFactory().create()
410-
assert.isFunction(serialize)
411-
assert.deepEqual(await serialize({}), {})
412-
})
413393
})

0 commit comments

Comments
 (0)