From 87b45d138f7cb31e3cecbd07a69736db8916661d Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Mon, 21 Jul 2025 22:42:32 +0200 Subject: [PATCH] some fixes (#18030) * some fixes * . * observer state * . * . * . * . * fix * update * bun up --- .prettierignore | 1 + biome.json | 5 +- code/datums/ghost_spawn.dm | 2 +- dependencies.sh | 2 +- html/create_object.html | 236 ++++++++---------- tgui/bun.lock | 6 +- tgui/package.json | 4 +- tgui/packages/tgui/components/NanoMap.tsx | 1 - .../WikiPages/WikiSubPages/WikiBloodTable.tsx | 230 +++++++++++++++++ tools/build/package.json | 2 +- tools/dm-invalid-utf8-discovery/index.js | 6 +- tools/nano-tester/index.js | 10 +- tools/playsound_finder/index.js | 26 +- 13 files changed, 371 insertions(+), 160 deletions(-) create mode 100644 tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WikiSubPages/WikiBloodTable.tsx diff --git a/.prettierignore b/.prettierignore index bfb94bab391..5e6414db00e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,6 +8,7 @@ juke **/dist **/node_modules html/templates +html/create_object.html # File names / types *.min.* diff --git a/biome.json b/biome.json index 81114a5cc9a..7f8442ce907 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.1.1/schema.json", + "$schema": "https://biomejs.dev/schemas/2.1.2/schema.json", "assist": { "actions": { "source": { @@ -50,7 +50,8 @@ "noDangerouslySetInnerHtml": "off" }, "style": { - "noNonNullAssertion": "off" + "noNonNullAssertion": "off", + "useSelfClosingElements": "error" }, "suspicious": { "noArrayIndexKey": "off", diff --git a/code/datums/ghost_spawn.dm b/code/datums/ghost_spawn.dm index f56146e1270..01bb3a9073a 100644 --- a/code/datums/ghost_spawn.dm +++ b/code/datums/ghost_spawn.dm @@ -11,7 +11,7 @@ GLOBAL_VAR_INIT(allowed_ghost_spawns, 2) var/active_tab = GHOST_POD_TAB /datum/tgui_module/ghost_spawn_menu/tgui_state(mob/user) - return GLOB.tgui_self_state + return GLOB.tgui_observer_state /datum/tgui_module/ghost_spawn_menu/tgui_close(mob/user) . = ..() diff --git a/dependencies.sh b/dependencies.sh index ad77875b17d..1ec51a8aebe 100644 --- a/dependencies.sh +++ b/dependencies.sh @@ -17,7 +17,7 @@ export RUST_G_VERSION=3.11.0 export NODE_VERSION_LTS=22.14.0 # Bun version -export BUN_VERSION=1.2.18 +export BUN_VERSION=1.2.19 # SpacemanDMM git tag export SPACEMAN_DMM_VERSION=suite-1.10 diff --git a/html/create_object.html b/html/create_object.html index 92f4bf29e89..c9b8b091b3a 100644 --- a/html/create_object.html +++ b/html/create_object.html @@ -1,149 +1,129 @@ - - Create Object - - + + Create Object + + - Type - -
- Offset: - + +
+ + /* hreftokenfield */ + - A R -
+ Type
+ Offset: - Number: - - Dir: - - Name: -
- Where: - -

- Number of matches: -
-

+ A + R
-
- -
+ Number: + Dir: + Name:
+ Where: + +

+ Number of matches:
+

-
- -
+
+ +
- + - if (event.keyCode == 13 || event.which == 13) { - object_list.options[0].selected = "true"; - } - } - - diff --git a/tgui/bun.lock b/tgui/bun.lock index 53cb3942c1f..a790120ac18 100644 --- a/tgui/bun.lock +++ b/tgui/bun.lock @@ -7,7 +7,7 @@ "@happy-dom/global-registrator": "^17.6.3", "@rspack/cli": "^1.4.8", "@rspack/core": "^1.4.8", - "@types/bun": "^1.2.18", + "@types/bun": "^1.2.19", "@types/react": "^19.1.8", "@types/react-dom": "^19.1.6", "@types/webpack-env": "^1.18.8", @@ -234,7 +234,7 @@ "@types/bonjour": ["@types/bonjour@3.5.13", "", { "dependencies": { "@types/node": "*" } }, "sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ=="], - "@types/bun": ["@types/bun@1.2.18", "", { "dependencies": { "bun-types": "1.2.18" } }, "sha512-Xf6RaWVheyemaThV0kUfaAUvCNokFr+bH8Jxp+tTZfx7dAPA8z9ePnP9S9+Vspzuxxx9JRAXhnyccRj3GyCMdQ=="], + "@types/bun": ["@types/bun@1.2.19", "", { "dependencies": { "bun-types": "1.2.19" } }, "sha512-d9ZCmrH3CJ2uYKXQIUuZ/pUnTqIvLDS0SK7pFmbx8ma+ziH/FRMoAq5bYpRG7y+w1gl+HgyNZbtqgMq4W4e2Lg=="], "@types/connect": ["@types/connect@3.4.38", "", { "dependencies": { "@types/node": "*" } }, "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug=="], @@ -396,7 +396,7 @@ "bufferstreams": ["bufferstreams@4.0.0", "", { "dependencies": { "readable-stream": "^3.4.0", "yerror": "^8.0.0" } }, "sha512-azX778/2VQ9K2uiYprSUKLgK2K6lR1KtJycJDsMg7u0+Cc994A9HyGaUKb01e/T+M8jse057429iKXurCaT35g=="], - "bun-types": ["bun-types@1.2.18", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-04+Eha5NP7Z0A9YgDAzMk5PHR16ZuLVa83b26kH5+cp1qZW4F6FmAURngE7INf4tKOvCE69vYvDEwoNl1tGiWw=="], + "bun-types": ["bun-types@1.2.19", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-uAOTaZSPuYsWIXRpj7o56Let0g/wjihKCkeRqUBhlLVM/Bt+Fj9xTo+LhC1OV1XDaGkz4hNC80et5xgy+9KTHQ=="], "bundle-name": ["bundle-name@4.1.0", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="], diff --git a/tgui/package.json b/tgui/package.json index d751be25bd8..3a53d71843d 100644 --- a/tgui/package.json +++ b/tgui/package.json @@ -2,7 +2,7 @@ "private": true, "name": "tgui-workspace", "version": "6.0.0", - "packageManager": "bun@1.2.18", + "packageManager": "bun@1.2.19", "workspaces": [ "packages/*" ], @@ -17,7 +17,7 @@ "@happy-dom/global-registrator": "^17.6.3", "@rspack/cli": "^1.4.8", "@rspack/core": "^1.4.8", - "@types/bun": "^1.2.18", + "@types/bun": "^1.2.19", "@types/react": "^19.1.8", "@types/react-dom": "^19.1.6", "@types/webpack-env": "^1.18.8", diff --git a/tgui/packages/tgui/components/NanoMap.tsx b/tgui/packages/tgui/components/NanoMap.tsx index 814a8dd3196..630b032865d 100644 --- a/tgui/packages/tgui/components/NanoMap.tsx +++ b/tgui/packages/tgui/components/NanoMap.tsx @@ -1,4 +1,3 @@ -import type React from 'react'; import { Component, type CSSProperties, type PropsWithChildren } from 'react'; import { resolveAsset } from 'tgui/assets'; import { useBackend } from 'tgui/backend'; diff --git a/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WikiSubPages/WikiBloodTable.tsx b/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WikiSubPages/WikiBloodTable.tsx new file mode 100644 index 00000000000..d2d51e3fc6b --- /dev/null +++ b/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WikiSubPages/WikiBloodTable.tsx @@ -0,0 +1,230 @@ +import { Box, Icon, Section, Table } from 'tgui-core/components'; + +export const WikiBloodTypes = (props) => { + return ( +
+ + + + + You can receive + + + + + + + + O+ + + + O- + + + A+ + + + A- + + + B+ + + + B- + + + AB+ + + + AB- + + + + + y + + + + + o + + + O+ + + + + + + + + + + + + + + + + + u + + + O- + + + + + + + + + + + + + + + r + + + A+ + + + + + + + + + + + + + + + + + + + + + + A- + + + + + + + + + + + + + + + + + t + + + B+ + + + + + + + + + + + + + + + + + + + + + y + + + B- + + + + + + + + + + + + + + + + + p + + + AB+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + e + + + AB- + + + + + + + + + + + + + + + + + + +
+
+ ); +}; diff --git a/tools/build/package.json b/tools/build/package.json index be04a88c3f8..9f9470f3b76 100644 --- a/tools/build/package.json +++ b/tools/build/package.json @@ -2,6 +2,6 @@ "private": true, "type": "module", "devDependencies": { - "@types/bun": "^1.2.18" + "@types/bun": "^1.2.19" } } diff --git a/tools/dm-invalid-utf8-discovery/index.js b/tools/dm-invalid-utf8-discovery/index.js index ef2d3cecff5..a08ba698c17 100644 --- a/tools/dm-invalid-utf8-discovery/index.js +++ b/tools/dm-invalid-utf8-discovery/index.js @@ -6,7 +6,7 @@ let files = {}; let count = 0; while (queue.length) { - let entries = await Promise.all( + const entries = await Promise.all( queue.slice(0, 100).map((path) => readdir(path, { withFileTypes: true })), ); for (let i = 0; i < entries.length; ++i) { @@ -24,8 +24,8 @@ while (queue.length) { files = Object.keys(files); while (files.length) { - let queue = files.slice(0, 100); - let buffers = await Promise.all(queue.map((path) => readFile(path))); + const queue = files.slice(0, 100); + const buffers = await Promise.all(queue.map((path) => readFile(path))); for (let i = 0; i < queue.length; ++i) { if (!isValidUTF8(buffers[i])) { console.log(queue[i]); diff --git a/tools/nano-tester/index.js b/tools/nano-tester/index.js index ecfd01ea68a..6aaa9151cda 100644 --- a/tools/nano-tester/index.js +++ b/tools/nano-tester/index.js @@ -38,13 +38,13 @@ const extFolderMapping = { var genIndexHtml = dot.template(fs.readFileSync("index.html", "utf8")); // the main thing -var server = http.createServer(function (request, response) { +var server = http.createServer((request, response) => { // extract the pathname from the request URL var pathname = url.parse(request.url).pathname; // Exception for front page if (pathname === "/") { - let initialData = JSON.parse(fs.readFileSync("initialData.json", "utf8")); + const initialData = JSON.parse(fs.readFileSync("initialData.json", "utf8")); response.writeHead(200, { "Content-Type": "text/html" }); response.write( genIndexHtml({ @@ -70,7 +70,7 @@ var server = http.createServer(function (request, response) { // console.log("Trying to serve ", pathname, " from ", filename); // Does this path exist? - fs.exists(filename, function (gotPath) { + fs.exists(filename, (gotPath) => { // no, bail out if (!gotPath) { console.warn("Path: %s File: %s NOT FOUND", pathname, filename); @@ -93,10 +93,10 @@ var server = http.createServer(function (request, response) { mode: 0x3146, // 0666 bufferSize: 4 * 1024, }) - .addListener("data", function (chunk) { + .addListener("data", (chunk) => { response.write(chunk, "binary"); }) - .addListener("close", function () { + .addListener("close", () => { response.end(); }); }); diff --git a/tools/playsound_finder/index.js b/tools/playsound_finder/index.js index df09677c1ea..13188e0b2e5 100644 --- a/tools/playsound_finder/index.js +++ b/tools/playsound_finder/index.js @@ -1,10 +1,10 @@ var fs = require("fs"); // List all files in a directory in Node.js recursively in a synchronous fashion -var walkSync = function (dir, filelist) { +var walkSync = (dir, filelist) => { var files = fs.readdirSync(dir); filelist = filelist || []; - files.forEach(function (file) { + files.forEach((file) => { if (fs.statSync(dir + file).isDirectory()) { filelist = walkSync(dir + file + "/", filelist); } else { @@ -16,8 +16,8 @@ var walkSync = function (dir, filelist) { var findNearestAbsolute = (data, line) => { for (let i = line; i > 0; i--) { - let str = data[i]; - if (str && str.match(/^\//)) { + const str = data[i]; + if (str?.match(/^\//)) { return str.trim().replace(/,/g, "|"); } } @@ -25,9 +25,9 @@ var findNearestAbsolute = (data, line) => { }; var main = () => { - let files = walkSync("code/"); - let matches = {}; - for (let file of files) { + const files = walkSync("code/"); + const matches = {}; + for (const file of files) { const data = fs.readFileSync(file, "utf8"); if (!data.match(/playsound.*/)) { @@ -38,9 +38,9 @@ var main = () => { const dataArray = data.split("\n"); let i = 1; - for (let line of dataArray) { + for (const line of dataArray) { i++; - let m = line.match(/playsound.*/); + const m = line.match(/playsound.*/); if (m) { matches[file].push({ line: i, @@ -52,10 +52,10 @@ var main = () => { } Object.keys(matches).map((file) => { - let allResults = matches[file]; + const allResults = matches[file]; allResults.map((obj) => { obj.params = obj.match.split(","); - for (var i = 0; i < obj.params.length; i++) { + for (let i = 0; i < obj.params.length; i++) { obj.params[i] = obj.params[i] .trim() .replace(/playsound\(/g, "") @@ -67,8 +67,8 @@ var main = () => { // Final loop, spit out a csv Object.keys(matches).map((file) => { let thisFileCsvEntry = ""; - let allResults = matches[file]; - for (let matchObj of allResults) { + const allResults = matches[file]; + for (const matchObj of allResults) { thisFileCsvEntry += `${file},${matchObj.line},${matchObj.src},${matchObj.params.join(",")}\n`; } fs.appendFileSync("results.csv", thisFileCsvEntry);