jeasx 0.11.0 → 0.11.2
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 +4 -4
- package/serverless.js +2 -0
- package/serverless.ts +13 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jeasx",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "jeasx - the ease of JSX with the power of SSR",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@fastify/accepts": "4.3.0",
|
|
28
|
-
"@fastify/cookie": "9.
|
|
28
|
+
"@fastify/cookie": "9.4.0",
|
|
29
29
|
"@fastify/formbody": "7.4.0",
|
|
30
30
|
"@fastify/multipart": "8.3.0",
|
|
31
31
|
"@fastify/static": "7.0.4",
|
|
32
32
|
"@fastify/url-data": "5.4.0",
|
|
33
|
-
"@types/node": "20.
|
|
33
|
+
"@types/node": "20.16.1",
|
|
34
34
|
"dotenv": "16.4.5",
|
|
35
|
-
"esbuild": "0.23.
|
|
35
|
+
"esbuild": "0.23.1",
|
|
36
36
|
"fastify": "4.28.1",
|
|
37
37
|
"jsx-async-runtime": "0.5.0",
|
|
38
38
|
"pm2": "5.4.2"
|
package/serverless.js
CHANGED
|
@@ -78,6 +78,8 @@ serverless.all("*", async (request, reply) => {
|
|
|
78
78
|
});
|
|
79
79
|
if (reply.sent) {
|
|
80
80
|
return;
|
|
81
|
+
} else if (typeof response === "string" || Buffer.isBuffer(response)) {
|
|
82
|
+
break;
|
|
81
83
|
} else if (pathname.endsWith("/[...guard].js") && (response === void 0 || !isJSX(response))) {
|
|
82
84
|
continue;
|
|
83
85
|
} else if (pathname.endsWith("/[404].js")) {
|
package/serverless.ts
CHANGED
|
@@ -39,17 +39,17 @@ serverless.register(fastifyStatic, {
|
|
|
39
39
|
wildcard: false,
|
|
40
40
|
setHeaders: FASTIFY_STATIC_HEADERS
|
|
41
41
|
? (reply, path) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
for (const [suffix, headers] of Object.entries(
|
|
43
|
+
FASTIFY_STATIC_HEADERS
|
|
44
|
+
)) {
|
|
45
|
+
if (path.endsWith(suffix)) {
|
|
46
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
47
|
+
reply.setHeader(key, value);
|
|
48
|
+
}
|
|
49
|
+
return;
|
|
48
50
|
}
|
|
49
|
-
return;
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
}
|
|
53
53
|
: undefined,
|
|
54
54
|
});
|
|
55
55
|
|
|
@@ -108,9 +108,9 @@ serverless.all("*", async (request, reply) => {
|
|
|
108
108
|
// Build content hash in development, so we can refresh code via "query string hack".
|
|
109
109
|
const hash = NODE_ENV_IS_DEVELOPMENT
|
|
110
110
|
? "?" +
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
createHash("sha1")
|
|
112
|
+
.update(await readFile(modulePath, "utf-8"))
|
|
113
|
+
.digest("hex")
|
|
114
114
|
: "";
|
|
115
115
|
|
|
116
116
|
// Call the handler with request, reply and optional props
|
|
@@ -124,6 +124,8 @@ serverless.all("*", async (request, reply) => {
|
|
|
124
124
|
|
|
125
125
|
if (reply.sent) {
|
|
126
126
|
return;
|
|
127
|
+
} else if (typeof response === "string" || Buffer.isBuffer(response)) {
|
|
128
|
+
break;
|
|
127
129
|
} else if (
|
|
128
130
|
pathname.endsWith("/[...guard].js") &&
|
|
129
131
|
(response === undefined || !isJSX(response))
|