@adonisjs/http-server 7.2.4 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import {
6
6
  Router,
7
7
  Server,
8
8
  defineConfig
9
- } from "../chunk-Q2EOMKJE.js";
9
+ } from "../chunk-2UUPHZPW.js";
10
10
 
11
11
  // factories/http_context.ts
12
12
  import { Container } from "@adonisjs/fold";
package/build/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  defineConfig,
19
19
  exceptions_exports,
20
20
  parseRange
21
- } from "./chunk-Q2EOMKJE.js";
21
+ } from "./chunk-2UUPHZPW.js";
22
22
 
23
23
  // src/exception_handler.ts
24
24
  import is from "@sindresorhus/is";
@@ -46,7 +46,7 @@ export declare const E_HTTP_REQUEST_ABORTED: {
46
46
  code?: string;
47
47
  status?: number;
48
48
  }): {
49
- handle(error: any, ctx: HttpContext): void;
49
+ handle(error: /*elided*/ any, ctx: HttpContext): void;
50
50
  body: any;
51
51
  name: string;
52
52
  help?: string;
@@ -154,6 +154,7 @@ export declare class Response extends Macroable {
154
154
  "content-range"?: string | undefined;
155
155
  "content-security-policy"?: string | undefined;
156
156
  "content-security-policy-report-only"?: string | undefined;
157
+ "content-type"?: string | undefined;
157
158
  cookie?: string | string[] | undefined;
158
159
  dav?: string | string[] | undefined;
159
160
  dnt?: string | undefined;
@@ -174,7 +175,7 @@ export declare class Response extends Macroable {
174
175
  location?: string | undefined;
175
176
  "max-forwards"?: string | undefined;
176
177
  origin?: string | undefined;
177
- prgama?: string | string[] | undefined;
178
+ pragma?: string | string[] | undefined;
178
179
  "proxy-authenticate"?: string | string[] | undefined;
179
180
  "proxy-authorization"?: string | undefined;
180
181
  "public-key-pins"?: string | undefined;
@@ -276,6 +277,11 @@ export declare class Response extends Macroable {
276
277
  * Use this function, when you want to compute etag manually for some other resons.
277
278
  */
278
279
  setEtag(body: any, weak?: boolean): this;
280
+ /**
281
+ * Set X-Request-Id header by copying the header value from the request if it exists.
282
+ *
283
+ */
284
+ setRequestId(): this;
279
285
  /**
280
286
  * Returns a boolean telling if the new response etag evaluates same
281
287
  * as the request header `if-none-match`. In case of `true`, the
@@ -38,6 +38,12 @@ export declare class Router extends LookupStore {
38
38
  * Shortcut methods for commonly used route matchers
39
39
  */
40
40
  matchers: Matchers;
41
+ /**
42
+ * Check if routes have been committed to the store. Once
43
+ * routes are committed, defining new set of routes will
44
+ * have no impact
45
+ */
46
+ get commited(): boolean;
41
47
  constructor(app: Application<any>, encryption: Encryption, qsParser: Qs);
42
48
  /**
43
49
  * Parses the route pattern
@@ -18,6 +18,10 @@ import { HttpContext } from '../http_context/main.js';
18
18
  */
19
19
  export declare class Server {
20
20
  #private;
21
+ /**
22
+ * Check if the server has already been booted
23
+ */
24
+ get booted(): boolean;
21
25
  /**
22
26
  * Know if async local storage is enabled or not.
23
27
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonisjs/http-server",
3
- "version": "7.2.4",
3
+ "version": "7.3.0",
4
4
  "description": "AdonisJS HTTP server with support packed with Routing and Cookies",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -20,9 +20,8 @@
20
20
  "scripts": {
21
21
  "pretest": "npm run lint",
22
22
  "test": "cross-env NODE_DEBUG=adonisjs:http c8 npm run quick:test",
23
- "clean": "del-cli build",
24
23
  "typecheck": "tsc --noEmit",
25
- "precompile": "npm run lint && npm run clean",
24
+ "precompile": "npm run lint",
26
25
  "compile": "tsup-node && tsc --emitDeclarationOnly --declaration",
27
26
  "build": "npm run compile",
28
27
  "prebenchmark": "npm run build",
@@ -31,9 +30,8 @@
31
30
  "version": "npm run build",
32
31
  "format": "prettier --write .",
33
32
  "prepublishOnly": "npm run build",
34
- "lint": "eslint . --ext=.ts",
35
- "sync-labels": "github-label-sync --labels .github/labels.json adonisjs/http-server",
36
- "quick:test": "node --loader=ts-node/esm --enable-source-maps bin/test.ts",
33
+ "lint": "eslint",
34
+ "quick:test": "node --import=ts-node-maintained/register/esm --enable-source-maps bin/test.ts",
37
35
  "citgm": "cross-env FORCE_COLOR=0 node --loader=ts-node/esm bin/test.ts"
38
36
  },
39
37
  "keywords": [
@@ -43,70 +41,65 @@
43
41
  "author": "virk,adonisjs",
44
42
  "license": "MIT",
45
43
  "devDependencies": {
46
- "@adonisjs/application": "^8.2.2",
44
+ "@adonisjs/application": "^8.3.1",
45
+ "@adonisjs/assembler": "^7.8.2",
47
46
  "@adonisjs/encryption": "^6.0.2",
48
- "@adonisjs/eslint-config": "^1.3.0",
47
+ "@adonisjs/eslint-config": "^2.0.0-beta.7",
49
48
  "@adonisjs/events": "^9.0.2",
50
- "@adonisjs/fold": "^10.1.2",
51
- "@adonisjs/logger": "^6.0.3",
52
- "@adonisjs/prettier-config": "^1.3.0",
53
- "@adonisjs/tsconfig": "^1.3.0",
54
- "@commitlint/cli": "^19.3.0",
55
- "@commitlint/config-conventional": "^19.2.2",
56
- "@fastify/middie": "^8.3.1",
49
+ "@adonisjs/fold": "^10.1.3",
50
+ "@adonisjs/logger": "^6.0.5",
51
+ "@adonisjs/prettier-config": "^1.4.0",
52
+ "@adonisjs/tsconfig": "^1.4.0",
53
+ "@fastify/middie": "^9.0.2",
57
54
  "@japa/assert": "^3.0.0",
58
55
  "@japa/expect-type": "^2.0.2",
59
56
  "@japa/runner": "^3.1.4",
60
- "@swc/core": "^1.5.7",
57
+ "@release-it/conventional-changelog": "^9.0.3",
58
+ "@swc/core": "^1.9.3",
61
59
  "@types/accepts": "^1.3.7",
62
60
  "@types/content-disposition": "^0.5.8",
63
- "@types/cookie": "^0.6.0",
64
61
  "@types/destroy": "^1.0.3",
65
62
  "@types/encodeurl": "^1.0.2",
66
63
  "@types/etag": "^1.8.3",
67
64
  "@types/fresh": "^0.5.2",
68
65
  "@types/fs-extra": "^11.0.4",
69
- "@types/http-status-codes": "^1.2.0",
70
66
  "@types/mime-types": "^2.1.4",
71
- "@types/node": "^20.12.12",
67
+ "@types/node": "^22.10.1",
72
68
  "@types/on-finished": "^2.3.4",
73
69
  "@types/pem": "^1.14.4",
74
70
  "@types/proxy-addr": "^2.0.3",
75
- "@types/qs": "^6.9.15",
71
+ "@types/qs": "^6.9.17",
76
72
  "@types/supertest": "^6.0.2",
77
73
  "@types/type-is": "^1.6.6",
78
74
  "@types/vary": "^1.1.3",
79
- "@vinejs/vine": "^2.0.0",
80
- "autocannon": "^7.15.0",
81
- "c8": "^9.1.0",
75
+ "@vinejs/vine": "^2.1.0",
76
+ "autocannon": "^8.0.0",
77
+ "c8": "^10.1.2",
82
78
  "cross-env": "^7.0.3",
83
- "del-cli": "^5.1.0",
84
- "eslint": "^8.57.0",
85
- "fastify": "^4.27.0",
79
+ "eslint": "^9.15.0",
80
+ "fastify": "^5.1.0",
86
81
  "fs-extra": "^11.2.0",
87
82
  "get-port": "^7.1.0",
88
- "github-label-sync": "^2.3.1",
89
83
  "http-status-codes": "^2.3.0",
90
- "husky": "^9.0.11",
91
84
  "pem": "^1.14.8",
92
- "prettier": "^3.2.5",
85
+ "prettier": "^3.4.1",
93
86
  "reflect-metadata": "^0.2.2",
94
- "release-it": "^17.3.0",
87
+ "release-it": "^17.10.0",
95
88
  "supertest": "^7.0.0",
96
- "ts-node": "^10.9.2",
97
- "tsup": "^8.0.2",
98
- "typescript": "^5.4.5"
89
+ "ts-node-maintained": "^10.9.4",
90
+ "tsup": "^8.3.5",
91
+ "typescript": "^5.7.2"
99
92
  },
100
93
  "dependencies": {
101
94
  "@paralleldrive/cuid2": "^2.2.2",
102
- "@poppinss/macroable": "^1.0.2",
95
+ "@poppinss/macroable": "^1.0.3",
103
96
  "@poppinss/matchit": "^3.1.2",
104
- "@poppinss/middleware": "^3.2.3",
105
- "@poppinss/utils": "^6.7.3",
106
- "@sindresorhus/is": "^6.3.1",
97
+ "@poppinss/middleware": "^3.2.4",
98
+ "@poppinss/utils": "^6.8.3",
99
+ "@sindresorhus/is": "^7.0.1",
107
100
  "accepts": "^1.3.8",
108
101
  "content-disposition": "^0.5.4",
109
- "cookie": "^0.7.2",
102
+ "cookie": "^1.0.2",
110
103
  "destroy": "^1.2.0",
111
104
  "encodeurl": "^2.0.0",
112
105
  "etag": "^1.8.1",
@@ -114,11 +107,11 @@
114
107
  "mime-types": "^2.1.35",
115
108
  "on-finished": "^2.4.1",
116
109
  "proxy-addr": "^2.0.7",
117
- "qs": "^6.12.1",
110
+ "qs": "^6.13.1",
118
111
  "tmp-cache": "^1.1.0",
119
112
  "type-is": "^1.6.18",
120
113
  "vary": "^1.1.2",
121
- "youch": "^3.3.3"
114
+ "youch": "^3.3.4"
122
115
  },
123
116
  "peerDependencies": {
124
117
  "@adonisjs/application": "^8.0.2",
@@ -135,30 +128,32 @@
135
128
  "url": "https://github.com/adonisjs/http-server/issues"
136
129
  },
137
130
  "homepage": "https://github.com/adonisjs/http-server#readme",
138
- "commitlint": {
139
- "extends": [
140
- "@commitlint/config-conventional"
141
- ]
142
- },
143
131
  "publishConfig": {
144
132
  "access": "public",
145
- "tag": "latest"
133
+ "provenance": true
146
134
  },
147
135
  "release-it": {
148
136
  "git": {
137
+ "requireCleanWorkingDir": true,
138
+ "requireUpstream": true,
149
139
  "commitMessage": "chore(release): ${version}",
150
140
  "tagAnnotation": "v${version}",
141
+ "push": true,
151
142
  "tagName": "v${version}"
152
143
  },
153
- "hooks": {
154
- "before:init": [
155
- "npm test"
156
- ]
157
- },
158
144
  "github": {
159
- "release": true,
160
- "releaseName": "v${version}",
161
- "web": true
145
+ "release": true
146
+ },
147
+ "npm": {
148
+ "publish": true,
149
+ "skipChecks": true
150
+ },
151
+ "plugins": {
152
+ "@release-it/conventional-changelog": {
153
+ "preset": {
154
+ "name": "angular"
155
+ }
156
+ }
162
157
  }
163
158
  },
164
159
  "c8": {
@@ -172,9 +167,6 @@
172
167
  ".yalc/**"
173
168
  ]
174
169
  },
175
- "eslintConfig": {
176
- "extends": "@adonisjs/eslint-config/package"
177
- },
178
170
  "prettier": "@adonisjs/prettier-config",
179
171
  "tsup": {
180
172
  "entry": [