@vesk/adapter 0.2.88 → 0.2.90
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/dist/middleware.d.ts.map +1 -1
- package/dist/middleware.js +18 -0
- package/package.json +4 -4
package/dist/middleware.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,yBAAyB,CAAC;AAS5F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,yBAAyB,CAAC;AAS5F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmFhG;AAED,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAiF5E"}
|
package/dist/middleware.js
CHANGED
|
@@ -61,6 +61,15 @@ export function compileMiddleware(mwChain, _appDir) {
|
|
|
61
61
|
' const target = start === -1 ? \'\' : msg.slice(start + prefix.length).trim().split(\' \')[0];',
|
|
62
62
|
' return new Response(null, { status: 302, headers: { Location: target } });',
|
|
63
63
|
' }',
|
|
64
|
+
' // Any other TypeError from the middleware (e.g. reading a property of',
|
|
65
|
+
' // `undefined` like `ctx.cookies[SESSION_COOKIE]` when `ctx.cookies` is',
|
|
66
|
+
' // missing) must not crash the server. On serverless platforms (Vercel,',
|
|
67
|
+
' // Netlify, Cloudflare) an uncaught throw surfaces as',
|
|
68
|
+
' // FUNCTION_INVOCATION_FAILED — Next.js avoids this by wrapping entry',
|
|
69
|
+
' // points the same way. Return a 500 instead.',
|
|
70
|
+
' if (e instanceof TypeError) {',
|
|
71
|
+
' return new Response(null, { status: 500 });',
|
|
72
|
+
' }',
|
|
64
73
|
' throw e;',
|
|
65
74
|
' }',
|
|
66
75
|
' }',
|
|
@@ -133,6 +142,15 @@ export function compileMiddlewareCode(mwSourceTexts) {
|
|
|
133
142
|
' const target = start === -1 ? \'\' : msg.slice(start + prefix.length).trim().split(\' \')[0];',
|
|
134
143
|
' return new Response(null, { status: 302, headers: { Location: target } });',
|
|
135
144
|
' }',
|
|
145
|
+
' // Any other TypeError from the middleware (e.g. reading a property of',
|
|
146
|
+
' // `undefined` like `ctx.cookies[SESSION_COOKIE]` when `ctx.cookies` is',
|
|
147
|
+
' // missing) must not crash the server. On serverless platforms (Vercel,',
|
|
148
|
+
' // Netlify, Cloudflare) an uncaught throw surfaces as',
|
|
149
|
+
' // FUNCTION_INVOCATION_FAILED — Next.js avoids this by wrapping entry',
|
|
150
|
+
' // points the same way. Return a 500 instead.',
|
|
151
|
+
' if (e instanceof TypeError) {',
|
|
152
|
+
' return new Response(null, { status: 500 });',
|
|
153
|
+
' }',
|
|
136
154
|
' throw e;',
|
|
137
155
|
' }',
|
|
138
156
|
' }',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesk/adapter",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.90",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vesk adapter — builds deployable .vesk/ output for Deno and Node serverless",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"sharp": "^0.35.3"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@vesk/compiler": "^0.2.
|
|
27
|
-
"@vesk/runtime": "^0.2.
|
|
28
|
-
"@vesk/types": "^0.2.
|
|
26
|
+
"@vesk/compiler": "^0.2.90",
|
|
27
|
+
"@vesk/runtime": "^0.2.90",
|
|
28
|
+
"@vesk/types": "^0.2.90"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/ws": "^8.18.1",
|