rajt 0.0.63 → 0.0.65
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.
- package/package.json +3 -3
- package/src/cli/commands/dev/index.ts +1 -1
- package/src/request.ts +13 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rajt",
|
|
3
3
|
"description": "A serverless bundler layer, fully typed for AWS Lambda (Node.js and LLRT) and Cloudflare Workers.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.65",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -55,7 +55,9 @@
|
|
|
55
55
|
"cripta": "^0.1",
|
|
56
56
|
"forj": "^0.0.4",
|
|
57
57
|
"t0n": "^0.1",
|
|
58
|
+
"@hono/node-server": "^1.19.9",
|
|
58
59
|
"@hono/zod-validator": "^0.7.6",
|
|
60
|
+
"@iarna/toml": "^2.2.5",
|
|
59
61
|
"chokidar-cli": "^3.0.0",
|
|
60
62
|
"citty": "^0.1.6",
|
|
61
63
|
"dotenv": "^16.5.0",
|
|
@@ -69,8 +71,6 @@
|
|
|
69
71
|
},
|
|
70
72
|
"devDependencies": {
|
|
71
73
|
"@cloudflare/workers-types": "^4.20251230.0",
|
|
72
|
-
"@hono/node-server": "^1.14.1",
|
|
73
|
-
"@iarna/toml": "^2.2.5",
|
|
74
74
|
"@miniflare/core": "^2.14.4",
|
|
75
75
|
"@miniflare/d1": "^2.14.4",
|
|
76
76
|
"@miniflare/durable-objects": "^2.14.4",
|
|
@@ -212,7 +212,7 @@ function withPort(desiredPort: number, cb: (port: number) => void) {
|
|
|
212
212
|
getAvailablePort(desiredPort)
|
|
213
213
|
.then((port: number) => {
|
|
214
214
|
if (port != desiredPort)
|
|
215
|
-
logger.
|
|
215
|
+
logger.stepWarn(`Port ${desiredPort} was in use, using ${port} as a fallback`)
|
|
216
216
|
|
|
217
217
|
cb(port)
|
|
218
218
|
}).catch(e => logger.error('Error finding available port:', e))
|
package/src/request.ts
CHANGED
|
@@ -24,10 +24,15 @@ export default class $Request {
|
|
|
24
24
|
#cookie: ReturnType<typeof cookieWrapper>
|
|
25
25
|
#u: Authnz<any> | null = null
|
|
26
26
|
|
|
27
|
+
#host: string
|
|
28
|
+
|
|
27
29
|
constructor(c: Context) {
|
|
28
30
|
this.#c = c
|
|
29
31
|
this.#cookie = cookieWrapper(c)
|
|
30
32
|
this.#u = Authnz.fromToken(Token.fromRequest(this))
|
|
33
|
+
|
|
34
|
+
const url = new URL(c.req.raw.url)
|
|
35
|
+
this.#host = url.protocol +'://'+ url.host
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
get user() {
|
|
@@ -81,14 +86,18 @@ export default class $Request {
|
|
|
81
86
|
return this.#c.req.routePath
|
|
82
87
|
}
|
|
83
88
|
|
|
84
|
-
get path() {
|
|
85
|
-
return this.#c.req.path
|
|
86
|
-
}
|
|
87
|
-
|
|
88
89
|
get url() {
|
|
89
90
|
return this.#c.req.raw.url
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
get host() {
|
|
94
|
+
return this.#host
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
get path() {
|
|
98
|
+
return this.#c.req.path
|
|
99
|
+
}
|
|
100
|
+
|
|
92
101
|
get method() {
|
|
93
102
|
return this.#c.req.raw.method
|
|
94
103
|
}
|