jeasx 0.14.0 → 0.15.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.
- package/package.json +6 -8
- package/serverless.js +1 -5
- package/serverless.ts +1 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jeasx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "jeasx - the ease of JSX with the power of SSR",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
@@ -24,16 +24,14 @@
|
|
|
24
24
|
"jeasx": "cli.js"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@fastify/
|
|
28
|
-
"@fastify/
|
|
29
|
-
"@fastify/
|
|
30
|
-
"@fastify/
|
|
31
|
-
"@fastify/static": "7.0.4",
|
|
32
|
-
"@fastify/url-data": "5.4.0",
|
|
27
|
+
"@fastify/cookie": "10.0.0",
|
|
28
|
+
"@fastify/formbody": "8.0.0",
|
|
29
|
+
"@fastify/multipart": "9.0.0",
|
|
30
|
+
"@fastify/static": "8.0.0",
|
|
33
31
|
"@types/node": "20.16.5",
|
|
34
32
|
"dotenv": "16.4.5",
|
|
35
33
|
"esbuild": "0.23.1",
|
|
36
|
-
"fastify": "
|
|
34
|
+
"fastify": "5.0.0",
|
|
37
35
|
"jsx-async-runtime": "0.5.1",
|
|
38
36
|
"pm2": "5.4.2"
|
|
39
37
|
},
|
package/serverless.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import fastifyAccepts from "@fastify/accepts";
|
|
2
1
|
import fastifyCookie from "@fastify/cookie";
|
|
3
2
|
import fastifyFormbody from "@fastify/formbody";
|
|
4
3
|
import fastifyMultipart from "@fastify/multipart";
|
|
5
4
|
import fastifyStatic from "@fastify/static";
|
|
6
|
-
import fastifyUrlData from "@fastify/url-data";
|
|
7
5
|
import "dotenv/config";
|
|
8
6
|
import Fastify from "fastify";
|
|
9
7
|
import { jsxToString } from "jsx-async-runtime";
|
|
@@ -16,11 +14,9 @@ const serverless = Fastify({
|
|
|
16
14
|
disableRequestLogging: NODE_ENV_IS_DEVELOPMENT,
|
|
17
15
|
bodyLimit: Number(process.env.FASTIFY_BODY_LIMIT) || void 0
|
|
18
16
|
});
|
|
19
|
-
serverless.register(fastifyAccepts);
|
|
20
17
|
serverless.register(fastifyCookie);
|
|
21
18
|
serverless.register(fastifyFormbody);
|
|
22
19
|
serverless.register(fastifyMultipart);
|
|
23
|
-
serverless.register(fastifyUrlData);
|
|
24
20
|
const FASTIFY_STATIC_HEADERS = !NODE_ENV_IS_DEVELOPMENT && process.env.FASTIFY_STATIC_HEADERS ? JSON.parse(String(process.env.FASTIFY_STATIC_HEADERS)) : void 0;
|
|
25
21
|
serverless.register(fastifyStatic, {
|
|
26
22
|
root: ["public", "dist/browser"].map((dir) => join(process.cwd(), dir)),
|
|
@@ -42,7 +38,7 @@ serverless.register(fastifyStatic, {
|
|
|
42
38
|
serverless.all("*", async (request, reply) => {
|
|
43
39
|
let response;
|
|
44
40
|
const context = {};
|
|
45
|
-
const requestPath = request.
|
|
41
|
+
const [requestPath] = request.url.split("?", 1);
|
|
46
42
|
const pathSegments = requestPath.split("/").filter((segment) => segment !== "").reduce((acc, segment) => {
|
|
47
43
|
acc.push((acc.length > 0 ? acc[acc.length - 1] : "") + "/" + segment);
|
|
48
44
|
return acc;
|
package/serverless.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import fastifyAccepts from "@fastify/accepts";
|
|
2
1
|
import fastifyCookie from "@fastify/cookie";
|
|
3
2
|
import fastifyFormbody from "@fastify/formbody";
|
|
4
3
|
import fastifyMultipart from "@fastify/multipart";
|
|
5
4
|
import fastifyStatic from "@fastify/static";
|
|
6
|
-
import fastifyUrlData from "@fastify/url-data";
|
|
7
5
|
import "dotenv/config";
|
|
8
6
|
import Fastify from "fastify";
|
|
9
7
|
import { jsxToString } from "jsx-async-runtime";
|
|
@@ -21,11 +19,9 @@ const serverless = Fastify({
|
|
|
21
19
|
});
|
|
22
20
|
|
|
23
21
|
// Register required plugins
|
|
24
|
-
serverless.register(fastifyAccepts);
|
|
25
22
|
serverless.register(fastifyCookie);
|
|
26
23
|
serverless.register(fastifyFormbody);
|
|
27
24
|
serverless.register(fastifyMultipart);
|
|
28
|
-
serverless.register(fastifyUrlData);
|
|
29
25
|
|
|
30
26
|
// Setup static file plugin
|
|
31
27
|
const FASTIFY_STATIC_HEADERS =
|
|
@@ -61,7 +57,7 @@ serverless.all("*", async (request, reply) => {
|
|
|
61
57
|
const context = {};
|
|
62
58
|
|
|
63
59
|
// Extract pathname without query parameters
|
|
64
|
-
const requestPath = request.
|
|
60
|
+
const [requestPath] = request.url.split("?", 1);
|
|
65
61
|
|
|
66
62
|
// Transform "/a/b/c" into ["/a/b/c", "/a/b", "/a", ""]
|
|
67
63
|
const pathSegments = requestPath
|