reactivated 0.38.2 → 0.39.0-a2286
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/server.mjs +7 -3
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
- package/scripts/setup_environment.sh +5 -2
- package/src/server.mts +9 -4
package/dist/server.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import express from "express";
|
|
2
|
+
import http from "node:http";
|
|
2
3
|
import { render } from "./render.mjs";
|
|
3
4
|
const isProduction = process.env.NODE_ENV === "production";
|
|
4
|
-
const port = process.env.REACTIVATED_VITE_PORT || 5173;
|
|
5
5
|
const base = process.env.BASE || "/";
|
|
6
6
|
const escapedBase = base.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
7
7
|
const reactivatedEndpoint = "/_reactivated/".replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -17,7 +17,11 @@ app.use("/_reactivated/", async (req, res) => {
|
|
|
17
17
|
res.status(500).json({ error: {} });
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
// By telling express to listen in port 0, we let the OS auto select a currently
|
|
21
|
+
// available port.
|
|
22
|
+
const server = http.createServer(app);
|
|
23
|
+
server.listen(0, () => {
|
|
24
|
+
const addr = server.address();
|
|
25
|
+
process.stdout.write(`RENDERER:http://localhost:${addr.port}:LISTENING`);
|
|
22
26
|
});
|
|
23
27
|
//# sourceMappingURL=server.mjs.map
|
package/dist/server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","sourceRoot":"","sources":["../src/server.mts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"server.mjs","sourceRoot":"","sources":["../src/server.mts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,IAAI,MAAM,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E;IAClB,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAiB,CAAC;IAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,IAAI,CAAC,IAAI,YAAY,CAAC,CAAC;AAC7E,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,6 +11,10 @@ POSTGRESQL_LOGS="$VIRTUAL_ENV/postgresql/logs.txt"
|
|
|
11
11
|
# $PWD returning /tmp or /private/tmp, we resolve with readlink.
|
|
12
12
|
TMP_ENV="$TMPDIR/reactivated/$(readlink -f "$VIRTUAL_ENV" | md5sum | awk '{print $1}')"
|
|
13
13
|
|
|
14
|
+
# https://github.com/python/mypy/issues/13392
|
|
15
|
+
# https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior
|
|
16
|
+
export SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
|
|
17
|
+
|
|
14
18
|
export PGPORT=1
|
|
15
19
|
export PGDATABASE="database"
|
|
16
20
|
export PGHOST=$TMP_ENV
|
|
@@ -23,8 +27,7 @@ if [ ! -d "$VIRTUAL_ENV" ]; then
|
|
|
23
27
|
fi
|
|
24
28
|
|
|
25
29
|
rm -rf "$TMP_ENV"
|
|
26
|
-
|
|
27
|
-
mkdir "$VIRTUAL_ENV/static"
|
|
30
|
+
python -m venv "$VIRTUAL_ENV"
|
|
28
31
|
pip install -r requirements.txt
|
|
29
32
|
fi
|
|
30
33
|
|
package/src/server.mts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import express from "express";
|
|
3
|
-
import path from "path";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import http from "node:http";
|
|
5
|
+
import type {AddressInfo} from "node:net";
|
|
4
6
|
import react from "@vitejs/plugin-react";
|
|
5
7
|
import ReactDOMServer from "react-dom/server";
|
|
6
8
|
import {render} from "./render.mjs";
|
|
@@ -12,7 +14,6 @@ import {vanillaExtractPlugin} from "@vanilla-extract/vite-plugin";
|
|
|
12
14
|
import {Provider, getTemplate} from "@reactivated";
|
|
13
15
|
|
|
14
16
|
const isProduction = process.env.NODE_ENV === "production";
|
|
15
|
-
const port = process.env.REACTIVATED_VITE_PORT || 5173;
|
|
16
17
|
const base = process.env.BASE || "/";
|
|
17
18
|
const escapedBase = base.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
18
19
|
const reactivatedEndpoint = "/_reactivated/".replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -31,6 +32,10 @@ app.use("/_reactivated/", async (req, res) => {
|
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
// By telling express to listen in port 0, we let the OS auto select a currently
|
|
36
|
+
// available port.
|
|
37
|
+
const server = http.createServer(app);
|
|
38
|
+
server.listen(0, () => {
|
|
39
|
+
const addr = server.address() as AddressInfo;
|
|
40
|
+
process.stdout.write(`RENDERER:http://localhost:${addr.port}:LISTENING`);
|
|
36
41
|
});
|