@vnejs/desktop 0.0.28 → 0.0.30
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 -7
- package/src/server.js +3 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/desktop",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"description": "Tools to run desktop app of @vnejs",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
"author": "",
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"commander": "
|
|
18
|
+
"commander": "14.0.3",
|
|
19
19
|
"express": "4.21.2",
|
|
20
|
-
"get-port": "
|
|
21
|
-
"open": "
|
|
20
|
+
"get-port": "7.1.0",
|
|
21
|
+
"open": "11.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@electron/packager": "
|
|
25
|
-
"electron
|
|
26
|
-
"electron": "30.3.1"
|
|
24
|
+
"@electron/packager": "19.0.5",
|
|
25
|
+
"electron": "~40.0.0"
|
|
27
26
|
}
|
|
28
27
|
}
|
package/src/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
2
|
const express = require("express");
|
|
3
|
-
const getPort = require("get-port");
|
|
3
|
+
const getPort = require("get-port").default;
|
|
4
4
|
const bodyParser = require("body-parser");
|
|
5
5
|
const { writeFile, appendFile, readdirSync, existsSync, readFile } = require("fs");
|
|
6
6
|
|
|
@@ -10,16 +10,11 @@ const runServer = async ({ rootDir, oldApp } = {}) => {
|
|
|
10
10
|
const stateJson = path.join(rootDir, "state.json");
|
|
11
11
|
const gamePath = path.join(rootDir, "game");
|
|
12
12
|
|
|
13
|
-
const onSaveState = (req, res) =>
|
|
14
|
-
writeFile(stateJson, JSON.stringify(req.body), (err) =>
|
|
15
|
-
err ? res.json({ status: "error" }) : res.json({ status: "ok" })
|
|
16
|
-
);
|
|
13
|
+
const onSaveState = (req, res) => writeFile(stateJson, JSON.stringify(req.body), (err) => (err ? res.json({ status: "error" }) : res.json({ status: "ok" })));
|
|
17
14
|
|
|
18
15
|
const onGetState = (req, res) =>
|
|
19
16
|
readFile(stateJson, (err, data) =>
|
|
20
|
-
err
|
|
21
|
-
? writeFile(stateJson, "{}", () => res.json({ status: "ok", state: {} }))
|
|
22
|
-
: res.json({ status: "ok", state: JSON.parse(data.toString()) })
|
|
17
|
+
err ? writeFile(stateJson, "{}", () => res.json({ status: "ok", state: {} })) : res.json({ status: "ok", state: JSON.parse(data.toString()) }),
|
|
23
18
|
);
|
|
24
19
|
|
|
25
20
|
const onLog = (req, res) => {
|