Skip to content

Commit b29cbd9

Browse files
committed
clean up dependencies
1 parent 9a4474a commit b29cbd9

25 files changed

+296
-1289
lines changed

build.plugin-server.mjs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { build } from "esbuild";
2+
3+
build({
4+
entryPoints: ["src/main/index.ts"],
5+
bundle: true,
6+
outfile: "dist/plugin-server/index.js",
7+
plugins: [
8+
],
9+
tsconfig: "tsconfig.node.json",
10+
platform:"node",
11+
12+
13+
});

package.json

+3-45
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@
66
"main": "dist/electron/main/index.js",
77
"typings": "dist/types/index.d.ts",
88
"scripts": {
9-
"dev": "vite",
9+
"plugin-server": "vite -c vite.config.plugin-server.ts",
1010
"sanity": "yarn types:check && yarn test:once",
11-
"deep-cleanse": "yarn eslint .",
1211
"types:check": "tsc --noEmit",
1312
"test": "jest --watchAll",
1413
"test:once": "jest --runInBand",
1514
"test:debug": "node --inspect node_modules/jest/bin/jest --runInBand",
1615
"clear-cache": "rimraf .cache dist",
17-
"build:src": "vite build",
18-
"build:electron": "electron-builder",
19-
"build": "build && build:electron",
2016
"lint": "yarn eslint . && yarn prettier --check .",
21-
"clean-dev-win": "taskkill /f /im node.exe",
2217
"postinstall": "git apply -v --stat --directory=node_modules/scm-extractor build/patches/scm-extractor.patch",
2318
"build-api-types": "ts-node -T .\\build\\api-types\\index.ts",
2419
"build-api-docs:host": "typedoc --out docs/host --tsconfig tsconfig.host-api.json build/api-types/host/index.d.ts",
@@ -31,36 +26,10 @@
3126
"url": "git+https://github.com/imbateam-gg/titan-reactor.git"
3227
},
3328
"author": "Alex Pineda <[email protected]>",
34-
"license": "GPL-3.0",
3529
"bugs": {
3630
"url": "https://github.com/imbateam-gg/titan-reactor/issues"
3731
},
3832
"homepage": "https://github.com/imbateam-gg/titan-reactor#readme",
39-
"build": {
40-
"directories": {
41-
"output": "release",
42-
"buildResources": "build"
43-
},
44-
"files": [
45-
"dist"
46-
],
47-
"appId": "imbateam.titan-reactor",
48-
"productName": "Titan Reactor",
49-
"mac": {
50-
"category": "An OpenBW Renderer"
51-
},
52-
"linux": {
53-
"category": "Game",
54-
"icon": "icon256x256.ico"
55-
},
56-
"extraResources": [
57-
{
58-
"from": "bundled",
59-
"to": "bundled"
60-
}
61-
],
62-
"electronDist": "C:\\Users\\Game_Master\\Projects\\electron\\src\\out\\zip"
63-
},
6433
"debug": {
6534
"env": {
6635
"VITE_DEV_SERVER_HOSTNAME": "127.0.0.1",
@@ -69,7 +38,6 @@
6938
}
7039
},
7140
"dependencies": {
72-
"@brakebein/threeoctree": "^2.0.1",
7341
"@codemirror/autocomplete": "^6.5.1",
7442
"@codemirror/commands": "^6.2.2",
7543
"@codemirror/lang-javascript": "^6.1.6",
@@ -80,20 +48,15 @@
8048
"@codemirror/view": "^6.9.5",
8149
"@npmcli/package-json": "^2.0.0",
8250
"@types/lodash.set": "^4.3.7",
83-
"@types/rbush": "^3.0.0",
8451
"@typescript/vfs": "^1.4.0",
8552
"bl": "^5.0.0",
8653
"buffer": "^6.0.3",
87-
"bw-casclib": "^2.0.2",
8854
"bw-chk": "^1.4.0",
8955
"camera-controls": "1.37.2",
9056
"concat-stream": "^2.0.0",
9157
"deep-diff": "^1.0.2",
9258
"deepmerge": "^4.2.2",
93-
"electron-devtools-installer": "^3.2.0",
94-
"electron-is-dev": "^2.0.0",
9559
"express": "^4.17.3",
96-
"iconv-lite": "0.6.3",
9760
"immer": "^9.0.15",
9861
"leva": "^0.9.23",
9962
"libnpmsearch": "^5.0.0",
@@ -104,10 +67,8 @@
10467
"lodash.set": "^4.3.2",
10568
"lodash.shuffle": "^4.2.0",
10669
"lodash.throttle": "^4.1.1",
107-
"mkdirp": "^1.0.4",
10870
"node-fetch": "3.2.10",
10971
"pacote": "^14.0.0",
110-
"pkware-wasm": "^1.0.0",
11172
"postprocessing": "6.32.2",
11273
"process-replay": "0.0.11",
11374
"random": "^3.0.6",
@@ -123,9 +84,6 @@
12384
"three-gpu-pathtracer": "^0.0.6",
12485
"three-instanced-uniforms-mesh": "^0.46.0",
12586
"three-janitor": "^2.0.1",
126-
"threejs-shader-materials": "MasatoMakino/threejs-shader-materials",
127-
"troika-three-utils": "^0.46.0",
128-
"ts-morph": "^16.0.0",
12987
"typescript": "^4.8.4",
13088
"winreg": "^1.2.4",
13189
"zustand": "4.1.1"
@@ -158,7 +116,7 @@
158116
"@typescript-eslint/parser": "^5.1.0",
159117
"@vitejs/plugin-react": "^2.1.0",
160118
"dotenv": "^16.0.3",
161-
"electron-builder": "^23.3.3",
119+
"esbuild": "^0.19.5",
162120
"eslint": "^8.24.0",
163121
"eslint-config-prettier": "^8.5.0",
164122
"eslint-import-resolver-alias": "^1.1.2",
@@ -172,14 +130,14 @@
172130
"jest-environment-jsdom": "^29.0.3",
173131
"jest-extended": "^3.1.0",
174132
"memfs": "^4.6.0",
175-
"nunjucks": "^3.2.4",
176133
"prettier": "^2.7.1",
177134
"prettier-plugin-glsl": "^0.0.5",
178135
"reflect-metadata": "^0.1.13",
179136
"rimraf": "^3.0.2",
180137
"source-map-support": "^0.5.19",
181138
"spectorjs": "^0.9.27",
182139
"ts-jest": "^29.0.1",
140+
"ts-morph": "^16.0.0",
183141
"ts-node": "^10.9.1",
184142
"typedoc": "^0.25.1",
185143
"vite": "^3.1.3",

src/common/casclib.ts

-62
This file was deleted.

src/common/tmp-common.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export const REMOTE_HOST_URL = "http://localhost:8080";
1+
export const REMOTE_HOST_URL = "http://localhost:8080";
2+
export const PLUGIN_PORT = 8090;
File renamed without changes.

src/main/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2+
3+
import { PLUGIN_PORT } from "common/tmp-common";
4+
import pluginServer from "./plugins/plugin-server";
5+
6+
pluginServer.listen( PLUGIN_PORT, "localhost" );
7+
18
// import { app, powerSaveBlocker, nativeTheme, crashReporter } from "electron";
29
// import path from "path";
310

src/main/plugins/plugin-manager.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import deepMerge from "deepmerge";
88

99
import { PluginConfig, PluginMetaData, PluginPackage } from "common/types";
1010

11-
import readFolder from "../starcraft/get-files";
11+
import readFolder from "../get-files";
1212
import { withErrorMessage } from "common/utils/with-error-message";
1313
import log from "../log";
1414
import { fileExists } from "common/utils/file-exists";

src/main/plugins/plugin-server.ts

+43-45
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@ import path, { normalize } from "path";
22
import fs from "fs";
33
import express from "express";
44
import { transpile } from "../typescript/transpile";
5-
// import browserWindows from "../windows";
6-
// import { LOG_MESSAGE_REMOTE } from "common/ipc-handle-names";
75
import settings from "../settings/singleton";
86
import { fileExists } from "common/utils/file-exists";
97
import { logService } from "../logger/singleton";
108
import fetch from "node-fetch";
11-
import * as casclib from "bw-casclib";
129
import runtimeHTML from "./runtime.html?raw";
1310
import runtimeJSX from "./runtime.tsx?raw";
1411
import { BUNDLED_SUBPATH, PLUGIN_PATH, RESOURCES_PATH } from "main/tmp-main";
1512

1613

1714

18-
let _handle: any = null;
15+
// let _handle: any = null;
1916
const app = express();
2017

2118
app.use( function ( _, res, next ) {
@@ -25,47 +22,48 @@ app.use( function ( _, res, next ) {
2522
} );
2623

2724
app.get( "*", async function ( req, res ) {
28-
if ( req.url.startsWith( "/m_api" ) ) {
29-
if ( req.method === "GET" ) {
30-
if ( req.query.iconPNG ) {
31-
const icon = Number( req.query.iconPNG );
32-
33-
// if ( _handle === null ) {
34-
// _handle = ( await casclib.openStorage(
35-
// settings.get().directories.starcraft
36-
// ) ) as unknown;
37-
// }
38-
const data = await casclib.readFile(
39-
_handle,
40-
`webui/dist/lib/images/cmdicons.${icon}.png`
41-
);
42-
43-
res.setHeader( "Content-Type", "image/png" );
44-
res.send( data );
45-
res.end();
46-
return;
47-
// POST wasn't working
48-
} else if ( req.query.macroId ) {
49-
// browserWindows.main!.webContents.send(
50-
// EXEC_MACRO_LOCAL,
51-
// req.query.macroId
52-
// );
53-
return res.status( 200 ).send();
54-
}
55-
56-
try {
57-
req.headers;
58-
const lastRevision = req.headers["X-LastRevision"];
59-
if ( lastRevision === `${settings.get().macros.revision}` ) {
60-
res.status( 304 ).send();
61-
return;
62-
}
63-
} catch ( e ) {}
64-
res.setHeader( "Content-Type", "application/json" );
65-
res.send( settings.get().macros );
66-
}
67-
return;
68-
}
25+
// todo: this moves to app
26+
// if ( req.url.startsWith( "/m_api" ) ) {
27+
// if ( req.method === "GET" ) {
28+
// if ( req.query.iconPNG ) {
29+
// const icon = Number( req.query.iconPNG );
30+
31+
// // if ( _handle === null ) {
32+
// // _handle = ( await casclib.openStorage(
33+
// // settings.get().directories.starcraft
34+
// // ) ) as unknown;
35+
// // }
36+
// const data = await casclib.readFile(
37+
// _handle,
38+
// `webui/dist/lib/images/cmdicons.${icon}.png`
39+
// );
40+
41+
// res.setHeader( "Content-Type", "image/png" );
42+
// res.send( data );
43+
// res.end();
44+
// return;
45+
// // POST wasn't working
46+
// } else if ( req.query.macroId ) {
47+
// // browserWindows.main!.webContents.send(
48+
// // EXEC_MACRO_LOCAL,
49+
// // req.query.macroId
50+
// // );
51+
// return res.status( 200 ).send();
52+
// }
53+
54+
// try {
55+
// req.headers;
56+
// const lastRevision = req.headers["X-LastRevision"];
57+
// if ( lastRevision === `${settings.get().macros.revision}` ) {
58+
// res.status( 304 ).send();
59+
// return;
60+
// }
61+
// } catch ( e ) {}
62+
// res.setHeader( "Content-Type", "application/json" );
63+
// res.send( settings.get().macros );
64+
// }
65+
// return;
66+
// }
6967

7068
if ( req.query.proxy ) {
7169
const proxy = req.query.proxy;

src/main/settings/settings.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import log from "../log";
1010
import { sanitizeMacros } from "common/macros/sanitize-macros";
1111
import { logService } from "../logger/singleton";
1212
import { PluginManager } from "../plugins/plugin-manager";
13-
import { setStorageIsCasc } from "common/casclib";
1413
import uniq from "common/utils/uniq";
15-
import { PLUGIN_PATH } from "main/tmp-main";
14+
import { PLUGIN_PATH } from "../tmp-main";
1615

1716
const supportedLanguages = [ "en-US", "es-ES", "ko-KR", "pl-PL", "ru-RU" ];
1817

@@ -216,7 +215,7 @@ export class Settings {
216215
}
217216
);
218217

219-
setStorageIsCasc( true ); //await this.isCascStorage() );
218+
// setStorageIsCasc( true ); //await this.isCascStorage() );
220219
// setStoragePath( this.#settings.directories.starcraft );
221220

222221
return this.#settings;

0 commit comments

Comments
 (0)