XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore: switch to esm, support raw running via node (#2696)

Using ESM so the `import` syntax we use is actually valid without compilation. Now, Node can run the TypeScript code directly, albeit without typechecking and requiring use of an experimental feature. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2696 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

1ead04dd
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

21 个文件 +49 -46
Modified package-lock.json +4 -4
@@ -23,7 +23,7 @@
23 23 "ncp": "^2.0.0",
24 24 "typescript": "^5.7",
25 25 "undici": "^7.10.0",
26 "warframe-public-export-plus": "^0.5.82",
26 "warframe-public-export-plus": "^0.5.83",
27 27 "warframe-riven-info": "^0.1.2",
28 28 "winston": "^3.17.0",
29 29 "winston-daily-rotate-file": "^5.0.0",
@@ -5507,9 +5507,9 @@
5507 5507 }
5508 5508 },
5509 5509 "node_modules/warframe-public-export-plus": {
5510 "version": "0.5.82",
5511 "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.82.tgz",
5512 "integrity": "sha512-hZa9KpMDA2wy0Hn03y9Nfyzbjxer1I6Rvb52b363uzrqS0cvDO56rhiDo71JbraeV34qF6yo+Vca1zwFmw2srA=="
5510 "version": "0.5.83",
5511 "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.83.tgz",
5512 "integrity": "sha512-SJgw6NxQaiLgMfnKGML8mRY9lT3wJb3HEABSvuCd/XiKpUqPgqTCp7EwPhbG3D/FMtN+IZjBQgykLD5R7/MSRA=="
5513 5513 },
5514 5514 "node_modules/warframe-riven-info": {
5515 5515 "version": "0.1.2",
Modified package.json +8 -6
@@ -11,20 +11,22 @@
11 11 "build:dev:tsc": "tsc --incremental --sourceMap",
12 12 "build-and-start": "npm run build && npm run start",
13 13 "build-and-start:bun": "npm run verify && npm run bun-run",
14 "dev": "node scripts/dev.js",
15 "dev:bun": "bun scripts/dev.js",
14 "dev": "node scripts/dev.cjs",
15 "dev:bun": "bun scripts/dev.cjs",
16 16 "verify": "tsgo --noEmit",
17 17 "verify:tsc": "tsc --noEmit",
18 "bun-run": "bun src/index.ts",
18 "raw": "node --experimental-transform-types src/index.ts",
19 "raw:bun": "bun src/index.ts",
19 20 "lint": "eslint --ext .ts .",
20 21 "lint:ci": "eslint --ext .ts --rule \"prettier/prettier: off\" .",
21 22 "lint:fix": "eslint --fix --ext .ts .",
22 23 "prettier": "prettier --write .",
23 "update-translations": "cd scripts && node update-translations.js",
24 "fix-imports": "cd scripts && node fix-imports.js",
24 "update-translations": "cd scripts && node update-translations.cjs",
25 "fix-imports": "cd scripts && node fix-imports.cjs",
25 26 "fix": "npm run update-translations && npm run fix-imports && npm run prettier"
26 27 },
27 28 "license": "GNU",
29 "type": "module",
28 30 "dependencies": {
29 31 "@types/express": "^5",
30 32 "@types/morgan": "^1.9.9",
@@ -40,7 +42,7 @@
40 42 "ncp": "^2.0.0",
41 43 "typescript": "^5.7",
42 44 "undici": "^7.10.0",
43 "warframe-public-export-plus": "^0.5.82",
45 "warframe-public-export-plus": "^0.5.83",
44 46 "warframe-riven-info": "^0.1.2",
45 47 "winston": "^3.17.0",
46 48 "winston-daily-rotate-file": "^5.0.0",
Renamed scripts/dev.cjs +1 -1
@@ -39,7 +39,7 @@ function run(changedFile) {
39 39 buildproc = undefined;
40 40 if (code === 0) {
41 41 console.log(`${process.versions.bun ? "Verified" : "Built"} in ${Date.now() - thisbuildstart} ms`);
42 runproc = spawn("npm", ["run", process.versions.bun ? "bun-run" : "start", "--", ...args], spawnopts);
42 runproc = spawn("npm", ["run", process.versions.bun ? "raw:bun" : "start", "--", ...args], spawnopts);
43 43 runproc.on("exit", () => {
44 44 runproc = undefined;
45 45 });
Renamed scripts/fix-imports.cjs +0 -0
此文件没有可显示的逐行差异。
Renamed scripts/update-translations.cjs +0 -0
此文件没有可显示的逐行差异。
Modified src/controllers/api/getShipController.ts +1 -1
@@ -1,6 +1,6 @@
1 1 import type { RequestHandler } from "express";
2 2 import { config } from "../../services/configService.ts";
3 import allShipFeatures from "../../../static/fixed_responses/allShipFeatures.json";
3 import allShipFeatures from "../../../static/fixed_responses/allShipFeatures.json" with { type: "json" };
4 4 import { getAccountIdForRequest } from "../../services/loginService.ts";
5 5 import { createGarden, getPersonalRooms } from "../../services/personalRoomsService.ts";
6 6 import type { IGetShipResponse, IPersonalRoomsClient } from "../../types/personalRoomsTypes.ts";
Modified src/controllers/api/inventoryController.ts +1 -1
@@ -3,7 +3,7 @@ import { getAccountForRequest } from "../../services/loginService.ts";
3 3 import type { TInventoryDatabaseDocument } from "../../models/inventoryModels/inventoryModel.ts";
4 4 import { Inventory } from "../../models/inventoryModels/inventoryModel.ts";
5 5 import { config } from "../../services/configService.ts";
6 import allDialogue from "../../../static/fixed_responses/allDialogue.json";
6 import allDialogue from "../../../static/fixed_responses/allDialogue.json" with { type: "json" };
7 7 import type { ILoadoutDatabase } from "../../types/saveLoadoutTypes.ts";
8 8 import type { IInventoryClient, IShipInventory } from "../../types/inventoryTypes/inventoryTypes.ts";
9 9 import { equipmentKeys } from "../../types/inventoryTypes/inventoryTypes.ts";
Modified src/controllers/api/redeemPromoCodeController.ts +1 -1
@@ -1,6 +1,6 @@
1 1 import { getJSONfromString } from "../../helpers/stringHelpers.ts";
2 2 import type { RequestHandler } from "express";
3 import glyphCodes from "../../../static/fixed_responses/glyphsCodes.json";
3 import glyphCodes from "../../../static/fixed_responses/glyphsCodes.json" with { type: "json" };
4 4 import { getAccountIdForRequest } from "../../services/loginService.ts";
5 5 import { addItem, getInventory } from "../../services/inventoryService.ts";
6 6
Modified src/controllers/custom/getItemListsController.ts +2 -2
@@ -21,8 +21,8 @@ import {
21 21 ExportWarframes,
22 22 ExportWeapons
23 23 } from "warframe-public-export-plus";
24 import allIncarnons from "../../../static/fixed_responses/allIncarnonList.json";
25 import varzia from "../../../static/fixed_responses/worldState/varzia.json";
24 import allIncarnons from "../../../static/fixed_responses/allIncarnonList.json" with { type: "json" };
25 import varzia from "../../../static/fixed_responses/worldState/varzia.json" with { type: "json" };
26 26
27 27 interface ListedItem {
28 28 uniqueName: string;
Modified src/controllers/dynamic/aggregateSessionsController.ts +1 -1
@@ -1,5 +1,5 @@
1 1 import type { RequestHandler } from "express";
2 import aggregateSessions from "../../../static/fixed_responses/aggregateSessions.json";
2 import aggregateSessions from "../../../static/fixed_responses/aggregateSessions.json" with { type: "json" };
3 3
4 4 const aggregateSessionsController: RequestHandler = (_req, res) => {
5 5 res.json(aggregateSessions);
Modified src/controllers/stats/viewController.ts +1 -1
@@ -1,7 +1,7 @@
1 1 import type { RequestHandler } from "express";
2 2 import { getAccountIdForRequest } from "../../services/loginService.ts";
3 3 import { config } from "../../services/configService.ts";
4 import allScans from "../../../static/fixed_responses/allScans.json";
4 import allScans from "../../../static/fixed_responses/allScans.json" with { type: "json" };
5 5 import { ExportEnemies } from "warframe-public-export-plus";
6 6 import { getInventory } from "../../services/inventoryService.ts";
7 7 import { getStats } from "../../services/statsService.ts";
Modified src/helpers/pathHelper.ts +1 -1
@@ -1,4 +1,4 @@
1 1 import path from "path";
2 2
3 export const rootDir = path.join(__dirname, "../..");
3 export const rootDir = path.join(import.meta.dirname, "../..");
4 4 export const repoDir = path.basename(rootDir) != "build" ? rootDir : path.join(rootDir, "..");
Modified src/services/configWatcherService.ts +1 -1
Modified src/services/guildService.ts +1 -1
Modified src/services/inventoryService.ts +1 -1
Modified src/services/loginRewardService.ts +1 -1
Modified src/services/missionInventoryUpdateService.ts +5 -5
Modified src/services/questService.ts +1 -1
Modified src/services/worldStateService.ts +11 -11
Modified src/services/wsService.ts +6 -5
Modified tsconfig.json +1 -1