* Fix tgui dev server on Windows (#82032)
## About The Pull Request
Fixes starting the tgui dev server on Windows machines.
Currently on Windows when starting the tgui dev server, it will be
unable to find the Byond cache at any of the predefined paths it
searches, and resort to using the registry even if one of the predefined
paths should successfully locate it. Then, it will fail to find the tmp#
folder inside that cache folder even if it exists.
The reason is that on Windows, the glob package requires forward slashes
when you call its methods such as sync(), as documented in the glob
module's documentation:
>Note Glob patterns should always use / as a path separator, even on
Windows systems, as \ is used to escape glob characters. If you wish to
use \ as a path separator instead of using it as an escape character on
Windows platforms, you may set windowsPathsNoEscape:true in the options.
In this mode, special glob characters cannot be escaped, making it
impossible to match a literal * ? and so on in filenames.
The function being used to assemble the path, node's path.resolve(),
uses backslashes if you call it on a Windows platform. It does not
accept any arguments to alter this, nor are there any
delimter-conversion functions in the path package. There is an
alternative to change the delimiter, forcing POSIX-style path.resolve()
by calling path.posix.resolve(), however this removes the drive letter
and does not work as a valid path on Windows.
For example:
What we need to pass to globPkg.sync():
`C:/Users/SomeName/Documents/Byond/cache`
What path.resolve() returns: `C:\Users\SomeName\Documents\Byond\cache`
What path.posix.resolve() returns:
`/Users/SomeName/Documents/Byond/cache`
Unfortunately there is not a method in the node path module to return
what we need. Instead, we use the workaround provided in glob's
documentation and add the windowsPathsNoEscape option. This COULD have a
negative effect when searching for * and ? literals, however a search of
resolveGlob() callers shows that none of them do this. * and ? in all
callers is intended to be a wildcard, not a literal, so this won't have
any impact on anything.
## Why It's Good For The Game
Helps development efforts for developers using Windows.
* Fix tgui dev server on Windows
---------
Co-authored-by: Aronai Sieyes <arokha@arokha.com>
* Fixes tgui dev server [NO GBP] (#79898)
## About The Pull Request
- the .js extensions were required, this is my fault.
- fixes a crash "automatic publicPath is not supported in this browser"
## Why It's Good For The Game
Bug fixes. Dev server is working
## Changelog
N/A nothing player facing
* Fixes tgui dev server [NO GBP]
---------
Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
* MIT license headers
* various tweaks
- Tweak jsdoc headers a bit
- Use an old-school format with SPDX-License-Identifier for SCSS
- Add headers to tgui dmcode
* Simplify the license section
* Rebuild tgui, small tweaks
Co-authored-by: ZeWaka <zewakagamer@gmail.com>
About The Pull Request
All relevant source code now contains copyright headers, that explicitly assert copyright and license for every file.
This has been done to prepare TGUI for wider adoption. Goon station devs are interested in using TGUI, and hopefully this will result in a nice collaboration and improvements to both codebases.
The following files were relicensed under MIT:
code/controllers/subsystem/tgui.dm
code/modules/tgui/*.dm
tgui/**/*.js
tgui/**/*.scss
The following files were kept untouched:
tgui/packages/tgui/interfaces/**/*.js
tgui/packages/tgui/styles/interfaces/**/*.scss
Project is still basically AGPL-3.0 under /tg/station's parent license (with added MIT texts), but allows importing MIT code into MIT-compatible codebases.