Creates a node compatibility mode (#82334)

## About The Pull Request
By default this will install node v20 LTS, but if a user is detected to
be using win 7 it's node v14

This lets us run higher node versions (with presumably more stable and
performant content) while allowing win 7 users to play

I should note that this is making clean tgui builds run at ~6.7sec which
is about a 6.9% speed increase (nice) from the previous #80310
## Why It's Good For The Game
Better tools
## Changelog
N/A nothing player facing
This commit is contained in:
Jeremiah
2024-03-31 21:41:25 -06:00
committed by GitHub
parent 435e6b4b93
commit b3f1c44db3
4 changed files with 18 additions and 4 deletions
+2 -1
View File
@@ -12,7 +12,8 @@ export RUST_G_VERSION=3.1.0
#node version
export NODE_VERSION=14
export NODE_VERSION_PRECISE=14.16.1
export NODE_VERSION_LTS=20.12.0
export NODE_VERSION_COMPAT=14.16.1
# SpacemanDMM git tag
export SPACEMAN_DMM_VERSION=suite-1.8
+1
View File
@@ -6,6 +6,7 @@
/yarn.lock
/.pnp.*
.swcrc
/docs
/public
/packages/tgui-polyfill
+2 -2
View File
@@ -16,9 +16,9 @@ if [ "$TG_BOOTSTRAP_CACHE" ]; then
fi
OldPWD="$PWD"
cd "$Bootstrap/../.."
. ./dependencies.sh # sets NODE_VERSION_PRECISE
. ./dependencies.sh # sets NODE_VERSION_LTS
cd "$OldPWD"
NodeVersion="$NODE_VERSION_PRECISE"
NodeVersion="$NODE_VERSION_LTS"
NodeFullVersion="node-v$NodeVersion-win-x64"
NodeDir="$Cache/$NodeFullVersion"
NodeExe="$NodeDir/node.exe"
+13 -1
View File
@@ -30,7 +30,19 @@ $Cache = "$BaseDir\.cache"
if ($Env:TG_BOOTSTRAP_CACHE) {
$Cache = $Env:TG_BOOTSTRAP_CACHE
}
$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_PRECISE"
# Get OS version
$OSVersion = (Get-WmiObject -Class Win32_OperatingSystem).Version
# Set Node version based on OS version
if ($OSVersion -gt 6.1) {
# Windows 7 is version 6.1
$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_COMPAT"
}
else {
$NodeVersion = Extract-Variable -Path "$BaseDir\..\..\dependencies.sh" -Key "NODE_VERSION_LTS"
}
$NodeSource = "https://nodejs.org/download/release/v$NodeVersion/win-x64/node.exe"
$NodeTargetDir = "$Cache\node-v$NodeVersion-x64"
$NodeTarget = "$NodeTargetDir\node.exe"