jeasx 1.0.1 → 1.1.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/ecosystem.config.cjs +1 -1
- package/esbuild.config.js +3 -6
- package/package.json +7 -7
- package/server.js +1 -1
- package/serverless.js +3 -2
- package/serverless.ts +5 -5
package/ecosystem.config.cjs
CHANGED
package/esbuild.config.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import "dotenv/config";
|
|
1
|
+
import "dotenv-flow/config";
|
|
2
2
|
import * as esbuild from "esbuild";
|
|
3
3
|
|
|
4
|
-
const BUILD_TIME =
|
|
5
|
-
process.env.NODE_ENV === "development"
|
|
6
|
-
? `"snapshot"`
|
|
7
|
-
: `"${Date.now().toString(36)}"`;
|
|
4
|
+
const BUILD_TIME = `"${Date.now().toString(36)}"`;
|
|
8
5
|
|
|
9
6
|
const BROWSER_PUBLIC_ENV = Object.keys(process.env)
|
|
10
7
|
.filter((key) => key.startsWith("BROWSER_PUBLIC_"))
|
|
@@ -18,7 +15,7 @@ const BROWSER_PUBLIC_ENV = Object.keys(process.env)
|
|
|
18
15
|
|
|
19
16
|
const ESBUILD_BROWSER_TARGET = process.env.ESBUILD_BROWSER_TARGET
|
|
20
17
|
? process.env.ESBUILD_BROWSER_TARGET.replace(/\s/g, "").split(",")
|
|
21
|
-
: ["
|
|
18
|
+
: ["chrome126", "edge126", "firefox128", "safari17"];
|
|
22
19
|
|
|
23
20
|
const args = process.argv.slice(2);
|
|
24
21
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jeasx",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Jeasx - the ease of JSX with the power of SSR",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
7
7
|
"ssr",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"@fastify/cookie": "11.0.1",
|
|
28
28
|
"@fastify/formbody": "8.0.1",
|
|
29
29
|
"@fastify/multipart": "9.0.1",
|
|
30
|
-
"@fastify/static": "8.0.
|
|
31
|
-
"@types/node": "22.
|
|
32
|
-
"dotenv": "
|
|
30
|
+
"@fastify/static": "8.0.3",
|
|
31
|
+
"@types/node": "22.10.1",
|
|
32
|
+
"dotenv-flow": "4.1.0",
|
|
33
33
|
"esbuild": "0.24.0",
|
|
34
34
|
"fastify": "5.1.0",
|
|
35
|
-
"jsx-async-runtime": "0.
|
|
36
|
-
"pm2": "5.4.
|
|
35
|
+
"jsx-async-runtime": "0.6.1",
|
|
36
|
+
"pm2": "5.4.3"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "esbuild --platform=node --format=esm --outdir=. serverless.ts"
|
package/server.js
CHANGED
package/serverless.js
CHANGED
|
@@ -2,7 +2,7 @@ import fastifyCookie from "@fastify/cookie";
|
|
|
2
2
|
import fastifyFormbody from "@fastify/formbody";
|
|
3
3
|
import fastifyMultipart from "@fastify/multipart";
|
|
4
4
|
import fastifyStatic from "@fastify/static";
|
|
5
|
-
import "dotenv/config";
|
|
5
|
+
import "dotenv-flow/config";
|
|
6
6
|
import Fastify from "fastify";
|
|
7
7
|
import { jsxToString } from "jsx-async-runtime";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
@@ -17,11 +17,12 @@ const serverless = Fastify({
|
|
|
17
17
|
serverless.register(fastifyCookie);
|
|
18
18
|
serverless.register(fastifyFormbody);
|
|
19
19
|
serverless.register(fastifyMultipart);
|
|
20
|
-
const FASTIFY_STATIC_HEADERS =
|
|
20
|
+
const FASTIFY_STATIC_HEADERS = process.env.FASTIFY_STATIC_HEADERS ? JSON.parse(String(process.env.FASTIFY_STATIC_HEADERS)) : void 0;
|
|
21
21
|
serverless.register(fastifyStatic, {
|
|
22
22
|
root: ["public", "dist/browser"].map((dir) => join(process.cwd(), dir)),
|
|
23
23
|
prefix: "/",
|
|
24
24
|
wildcard: false,
|
|
25
|
+
cacheControl: false,
|
|
25
26
|
setHeaders: FASTIFY_STATIC_HEADERS ? (reply, path) => {
|
|
26
27
|
for (const [suffix, headers] of Object.entries(
|
|
27
28
|
FASTIFY_STATIC_HEADERS
|
package/serverless.ts
CHANGED
|
@@ -2,7 +2,7 @@ import fastifyCookie from "@fastify/cookie";
|
|
|
2
2
|
import fastifyFormbody from "@fastify/formbody";
|
|
3
3
|
import fastifyMultipart from "@fastify/multipart";
|
|
4
4
|
import fastifyStatic from "@fastify/static";
|
|
5
|
-
import "dotenv/config";
|
|
5
|
+
import "dotenv-flow/config";
|
|
6
6
|
import Fastify from "fastify";
|
|
7
7
|
import { jsxToString } from "jsx-async-runtime";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
@@ -24,15 +24,15 @@ serverless.register(fastifyFormbody);
|
|
|
24
24
|
serverless.register(fastifyMultipart);
|
|
25
25
|
|
|
26
26
|
// Setup static file plugin
|
|
27
|
-
const FASTIFY_STATIC_HEADERS =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
: undefined;
|
|
27
|
+
const FASTIFY_STATIC_HEADERS = process.env.FASTIFY_STATIC_HEADERS
|
|
28
|
+
? JSON.parse(String(process.env.FASTIFY_STATIC_HEADERS))
|
|
29
|
+
: undefined;
|
|
31
30
|
|
|
32
31
|
serverless.register(fastifyStatic, {
|
|
33
32
|
root: ["public", "dist/browser"].map((dir) => join(process.cwd(), dir)),
|
|
34
33
|
prefix: "/",
|
|
35
34
|
wildcard: false,
|
|
35
|
+
cacheControl: false,
|
|
36
36
|
setHeaders: FASTIFY_STATIC_HEADERS
|
|
37
37
|
? (reply, path) => {
|
|
38
38
|
for (const [suffix, headers] of Object.entries(
|