Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@

#Ignore compiled files and other files generated during compilation.
*.mdme
*.mdme.*
*.dmb
*.rsc
*.m.dme
*.test.dme
*.lk
*.int
*.backup
Expand Down Expand Up @@ -223,4 +226,4 @@ tgui/.pnp.js
tgui/.yarn/*

# Common build tooling
!/tools/build
!/tools/build
5 changes: 3 additions & 2 deletions Build.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@call tools\build\build
@pause
@echo off
call "%~dp0\tools\build\build.bat" %*
pause
3 changes: 3 additions & 0 deletions Clean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
call "%~dp0\tools\build\build.bat" dist-clean
pause
3 changes: 3 additions & 0 deletions Run_Server.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
call "%~dp0\tools\build\build.bat" server %*
pause
19 changes: 14 additions & 5 deletions code/modules/asset_cache/asset_list_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
/datum/asset/simple/tgui_common
keep_local_name = TRUE
assets = list(
"tgui-common.chunk.js" = 'tgui/public/tgui-common.chunk.js',
"tgui-common.bundle.js" = file("tgui/public/tgui-common.bundle.js"),
)

/datum/asset/simple/tgui
keep_local_name = TRUE
assets = list(
"tgui.bundle.js" = 'tgui/public/tgui.bundle.js',
"tgui.bundle.css" = 'tgui/public/tgui.bundle.css',
"tgui.bundle.js" = file("tgui/public/tgui.bundle.js"),
"tgui.bundle.css" = file("tgui/public/tgui.bundle.css"),
)

/datum/asset/simple/tgui_panel
keep_local_name = TRUE
assets = list(
"tgui-panel.bundle.js" = 'tgui/public/tgui-panel.bundle.js',
"tgui-panel.bundle.css" = 'tgui/public/tgui-panel.bundle.css',
"tgui-panel.bundle.js" = file("tgui/public/tgui-panel.bundle.js"),
"tgui-panel.bundle.css" = file("tgui/public/tgui-panel.bundle.css"),
)

/datum/asset/simple/headers
Expand Down Expand Up @@ -172,6 +172,15 @@
)
parents = list("font-awesome.css" = 'html/font-awesome/css/all.min.css')

/datum/asset/simple/namespaced/tgfont
assets = list(
"tgfont.eot" = file("tgui/packages/tgfont/dist/tgfont.eot"),
"tgfont.woff2" = file("tgui/packages/tgfont/dist/tgfont.woff2"),
)
parents = list(
"tgfont.css" = file("tgui/packages/tgfont/dist/tgfont.css"),
)

/datum/asset/spritesheet/chat
name = "chat"

Expand Down
2 changes: 1 addition & 1 deletion dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export RUST_G_VERSION=0.7.0

#node version
export NODE_VERSION=12
export NODE_VERSION_PRECISE=12.20.0
export NODE_VERSION_PRECISE=12.22.4

# PHP version
export PHP_VERSION=7.2
Expand Down
12 changes: 12 additions & 0 deletions node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tgui/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
parser: babel-eslint
parser: "@babel/eslint-parser"
parserOptions:
ecmaVersion: 2019
sourceType: module
Expand Down
55 changes: 0 additions & 55 deletions tgui/.yarn/releases/yarn-2.4.1.cjs

This file was deleted.

768 changes: 768 additions & 0 deletions tgui/.yarn/releases/yarn-3.1.1.cjs

Large diffs are not rendered by default.

86 changes: 0 additions & 86 deletions tgui/.yarn/releases/yarn-berry.js

This file was deleted.

2 changes: 1 addition & 1 deletion tgui/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarnPath: ".yarn/releases/yarn-berry.js"
yarnPath: ".yarn/releases/yarn-3.1.1.cjs"
37 changes: 37 additions & 0 deletions tgui/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
*/

const createBabelConfig = options => {
const { mode, presets = [], plugins = [] } = options;
return {
presets: [
['@babel/preset-env', {
modules: 'commonjs',
useBuiltIns: 'entry',
corejs: '3.8',
spec: false,
loose: true,
targets: [],
}],
...presets,
],
plugins: [
'@babel/plugin-transform-jscript',
'babel-plugin-inferno',
'babel-plugin-transform-remove-console',
'common/string.babel-plugin.cjs',
...plugins,
],
};
};

module.exports = (api) => {
api.cache(true);
const mode = process.env.NODE_ENV;
return createBabelConfig({ mode });
};

module.exports.createBabelConfig = createBabelConfig;
4 changes: 2 additions & 2 deletions tgui/bin/tgui
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi

## Fall back to running Yarn from the repo
if ! hash yarn 2>/dev/null; then
alias yarn="node '${base_dir}/.yarn/releases/yarn.cjs'"
alias yarn="node '${base_dir}/.yarn/releases/yarn3.1.1.cjs'"
fi


Expand Down Expand Up @@ -79,7 +79,7 @@ task-clean() {
rm -rf .yarn/unplugged
rm -rf .yarn/build-state.yml
rm -rf .yarn/install-state.gz
rm -f .pnp.js
rm -f .pnp.*
## NPM artifacts
rm -rf **/node_modules
rm -f **/package-lock.json
Expand Down
4 changes: 2 additions & 2 deletions tgui/bin/tgui.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Set-Location $basedir
## --------------------------------------------------------

function yarn {
node.exe ".yarn\releases\yarn-2.4.1.cjs" @Args
node.exe ".yarn\releases\yarn-3.1.1.cjs" @Args
}

function Remove-Quiet {
Expand Down Expand Up @@ -53,7 +53,7 @@ function task-clean {
Remove-Quiet -Recurse -Force ".yarn\unplugged"
Remove-Quiet -Recurse -Force ".yarn\build-state.yml"
Remove-Quiet -Recurse -Force ".yarn\install-state.gz"
Remove-Quiet -Force ".pnp.js"
Remove-Quiet -Force ".pnp.*"
## NPM artifacts
Get-ChildItem -Path "." -Include "node_modules" -Recurse -File:$false | Remove-Item -Recurse -Force
Remove-Quiet -Force "package-lock.json"
Expand Down
70 changes: 49 additions & 21 deletions tgui/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,64 @@
{
"private": true,
"name": "tgui-workspace",
"version": "4.2.0",
"version": "4.3.0",
"packageManager": "yarn@3.1.1",
"workspaces": [
"packages/*"
],
"scripts": {
"tgui:analyze": "webpack --analyze",
"tgui:build": "webpack",
"tgui:dev": "node --experimental-modules packages/tgui-dev-server/index.js",
"tgui:lint": "eslint packages --ext .js,.cjs,.ts,.tsx",
"tgui:prettier": "prettierx --check .",
"tgui:sonar": "eslint packages --ext .js,.cjs,.ts,.tsx -c .eslintrc-sonar.yml",
"tgui:test": "jest --watch",
"tgui:test-simple": "CI=true jest --color",
"tgui:test-ci": "CI=true jest --color --collect-coverage"
},
"dependencies": {
"@babel/core": "^7.6.2",
"@babel/plugin-transform-jscript": "^7.2.0",
"@babel/preset-env": "^7.6.2",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"babel-plugin-inferno": "^6.1.0",
"@babel/core": "^7.15.0",
"@babel/eslint-parser": "^7.15.0",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-transform-jscript": "^7.14.5",
"@babel/preset-env": "^7.15.0",
"@babel/preset-typescript": "^7.15.0",
"@types/jest": "^27.0.1",
"@types/jsdom": "^16.2.13",
"@types/node": "^14.17.9",
"@types/webpack": "^5.28.0",
"@types/webpack-env": "^1.16.2",
"@typescript-eslint/parser": "^4.29.1",
"babel-jest": "^27.0.6",
"babel-loader": "^8.2.2",
"babel-plugin-inferno": "^6.3.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"common": "workspace:*",
"css-loader": "^3.2.0",
"cssnano": "^4.1.10",
"eslint": "^7.4.0",
"eslint-plugin-react": "^7.17.0",
"css-loader": "^5.2.7",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-radar": "^0.2.1",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-unused-imports": "^1.1.4",
"extract-css-chunks-webpack-plugin": "^4.6.0",
"file-loader": "^6.0.0",
"inferno": "^8.0.3",
"file-loader": "^6.2.0",
"inferno": "^^8.0.3",
"jest": "^27.0.6",
"jest-circus": "^27.0.6",
"jsdom": "^16.7.0",
"mini-css-extract-plugin": "^1.6.2",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"pnp-webpack-plugin": "^1.6.4",
"prettier": "npm:prettierx@0.19.0",
"sass": "^1.22.12",
"sass-loader": "^9.0.2",
"style-loader": "^1.0.0",
"terser-webpack-plugin": "^3.0.6",
"url-loader": "^4.1.0",
"webpack": "^4.40.2",
"webpack-build-notifier": "^2.0.0",
"webpack-bundle-analyzer": "^3.5.1",
"webpack-cli": "^3.3.12"
"sass-loader": "^11.1.1",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.1.4",
"typescript": "^4.3.5",
"url-loader": "^4.1.1",
"webpack": "^5.50.0",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-cli": "^4.7.2"
}
}
6 changes: 4 additions & 2 deletions tgui/packages/tgui-panel/styles/components/Chat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* SPDX-License-Identifier: MIT
*/

@use "sass:math";

@use 'sass:color';
@use '~tgui/styles/base.scss';
@use '~tgui/styles/colors.scss';
Expand Down Expand Up @@ -62,7 +64,7 @@ $color-bg-section: base.$color-bg-section !default;
content: '';
display: block;
margin-top: -0.75em;
border-bottom: (1em / 6) solid colors.$red;
border-bottom: math.div(1em, 6) solid colors.$red;
}
}

Expand All @@ -82,7 +84,7 @@ $color-bg-section: base.$color-bg-section !default;

.ChatMessage--highlighted {
position: relative;
border-left: (1em / 6) solid rgba(255, 221, 68);
border-left: math.div(1em, 6) solid rgba(255, 221, 68);
padding-left: 0.5em;

&:after {
Expand Down
4 changes: 3 additions & 1 deletion tgui/packages/tgui-panel/styles/components/Ping.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
* SPDX-License-Identifier: MIT
*/

@use "sass:math";

$border-color: rgba(140, 140, 140, 0.5) !default;

.Ping {
position: relative;
padding: 0.125em 0.25em;
border: (1em / 12) solid $border-color;
border: math.div(1em, 12) solid $border-color;
border-radius: 0.25em;
width: 3.75em;
text-align: right;
Expand Down
2 changes: 0 additions & 2 deletions tgui/packages/tgui/interfaces/AiDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export const AiDashboard = (props, context) => {
bad: [750, Infinity],
}}
value={data.temperature}

maxValue={750}>{data.temperature}K
</ProgressBar>
Uplink Temperature
Expand Down Expand Up @@ -88,7 +87,6 @@ export const AiDashboard = (props, context) => {
bad: [0, data.current_ram * 0.3],
}}
value={data.used_ram}

maxValue={data.current_ram}>
{data.used_ram ? data.used_ram : 0}/{data.current_ram} TB
</ProgressBar>
Expand Down
1 change: 0 additions & 1 deletion tgui/packages/tgui/interfaces/AiServerConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const AiServerConsole = (props, context) => {
bad: [750, Infinity],
}}
value={server.temp}

maxValue={750}>{server.temp}K
</ProgressBar>
<Box textAlign="center">Capacity: <Box inline bold>{server.card_capacity} cards</Box></Box>
Expand Down
54 changes: 26 additions & 28 deletions tgui/packages/tgui/interfaces/CommunicationsConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,34 +305,32 @@ const PageMain = (props, context) => {
<Box>
<Section title="Emergency Shuttle">
{
shuttleCalled
? <Button.Confirm
icon="space-shuttle"
content="Recall Emergency Shuttle"
color="bad"
disabled={!canRecallShuttles || !shuttleRecallable}
tooltip={(
canRecallShuttles && (
!shuttleRecallable && "It's too late for the emergency shuttle to be recalled."
) || (
"You do not have permission to recall the emergency shuttle."
)
)}
tooltipPosition="bottom-right"
onClick={() => act("recallShuttle")}
/>
: <Button
icon="space-shuttle"
content="Call Emergency Shuttle"
disabled={shuttleCanEvacOrFailReason !== 1}
tooltip={
shuttleCanEvacOrFailReason !== 1
? shuttleCanEvacOrFailReason
: undefined
}
tooltipPosition="bottom-right"
onClick={() => setCallingShuttle(true)}
/>
shuttleCalled ? <Button.Confirm
icon="space-shuttle"
content="Recall Emergency Shuttle"
color="bad"
disabled={!canRecallShuttles || !shuttleRecallable}
tooltip={(
canRecallShuttles && (
!shuttleRecallable && "It's too late for the emergency shuttle to be recalled."
) || (
"You do not have permission to recall the emergency shuttle."
)
)}
tooltipPosition="bottom-right"
onClick={() => act("recallShuttle")}
/> : <Button
icon="space-shuttle"
content="Call Emergency Shuttle"
disabled={shuttleCanEvacOrFailReason !== 1}
tooltip={
shuttleCanEvacOrFailReason !== 1
? shuttleCanEvacOrFailReason
: undefined
}
tooltipPosition="bottom-right"
onClick={() => setCallingShuttle(true)}
/>
}

{!!shuttleCalledPreviously && (
Expand Down
Loading