server-esm: Fix a few more straightforward imports

This commit is contained in:
Elian Doran 2024-07-18 23:48:14 +03:00
parent 508b5e3c69
commit 93a0782009
No known key found for this signature in database
4 changed files with 18 additions and 4 deletions

13
package-lock.json generated
View File

@ -94,6 +94,7 @@
"@types/compression": "^1.7.5", "@types/compression": "^1.7.5",
"@types/cookie-parser": "^1.4.7", "@types/cookie-parser": "^1.4.7",
"@types/csurf": "^1.11.5", "@types/csurf": "^1.11.5",
"@types/debounce": "^1.2.4",
"@types/ejs": "^3.1.5", "@types/ejs": "^3.1.5",
"@types/escape-html": "^1.0.4", "@types/escape-html": "^1.0.4",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
@ -1289,6 +1290,12 @@
"resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.3.tgz", "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.3.tgz",
"integrity": "sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw==" "integrity": "sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw=="
}, },
"node_modules/@types/debounce": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@types/debounce/-/debounce-1.2.4.tgz",
"integrity": "sha512-jBqiORIzKDOToaF63Fm//haOCHuwQuLa2202RK4MozpA6lh93eCBc+/8+wZn5OzjJt3ySdc+74SXWXB55Ewtyw==",
"dev": true
},
"node_modules/@types/debug": { "node_modules/@types/debug": {
"version": "4.1.9", "version": "4.1.9",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz",
@ -14355,6 +14362,12 @@
"resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.3.tgz", "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.3.tgz",
"integrity": "sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw==" "integrity": "sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw=="
}, },
"@types/debounce": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@types/debounce/-/debounce-1.2.4.tgz",
"integrity": "sha512-jBqiORIzKDOToaF63Fm//haOCHuwQuLa2202RK4MozpA6lh93eCBc+/8+wZn5OzjJt3ySdc+74SXWXB55Ewtyw==",
"dev": true
},
"@types/debug": { "@types/debug": {
"version": "4.1.9", "version": "4.1.9",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz",

View File

@ -116,6 +116,7 @@
"@types/compression": "^1.7.5", "@types/compression": "^1.7.5",
"@types/cookie-parser": "^1.4.7", "@types/cookie-parser": "^1.4.7",
"@types/csurf": "^1.11.5", "@types/csurf": "^1.11.5",
"@types/debounce": "^1.2.4",
"@types/ejs": "^3.1.5", "@types/ejs": "^3.1.5",
"@types/escape-html": "^1.0.4", "@types/escape-html": "^1.0.4",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",

View File

@ -132,7 +132,7 @@ function getIcon() {
} }
async function createSetupWindow() { async function createSetupWindow() {
const { BrowserWindow } = require('electron'); // should not be statically imported const { BrowserWindow } = await import("electron"); // should not be statically imported
setupWindow = new BrowserWindow({ setupWindow = new BrowserWindow({
width: 800, width: 800,
height: 800, height: 800,
@ -156,7 +156,7 @@ function closeSetupWindow() {
} }
async function registerGlobalShortcuts() { async function registerGlobalShortcuts() {
const { globalShortcut } = require('electron'); const { globalShortcut } = await import("electron");
await sqlInit.dbReady; await sqlInit.dbReady;

View File

@ -14,8 +14,8 @@ import { IncomingMessage, Server } from 'http';
import { EntityChange } from './entity_changes_interface'; import { EntityChange } from './entity_changes_interface';
if (env.isDev()) { if (env.isDev()) {
const chokidar = require('chokidar'); const chokidar = (await import("chokidar")).default;
const debounce = require('debounce'); const debounce = (await import("debounce")).default;
const debouncedReloadFrontend = debounce(() => reloadFrontend("source code change"), 200); const debouncedReloadFrontend = debounce(() => reloadFrontend("source code change"), 200);
chokidar chokidar
.watch('src/public') .watch('src/public')