Commit Graph

91 Commits

Author SHA1 Message Date
AnturK
dec62713b5 Updates webpack to latest (#73457)
Alright this node situation is pretty complicated, so let's start with
making it work.
The surface level issue is webpack version we use does not support new
node provided in windows images.
This doesn't change any node dependencies/how we install it in the
runners.
2023-02-16 10:56:11 -08:00
Jeremiah
a32522d0d8 tgui: Updates typescript, other dependencies (#72279)
## About The Pull Request
The largest change to this is that it updates typescript from 4.3.5 to
4.9.4.

It also does some QoL to update @ types, yarn version, and
typescript-eslint-parser (OPTIONAL)

I did this by:
1. Updating typescript `yarn add typescript`
2. Updating other types `yarn add @types/...`
3. Repackaging typescript (and other) workplace sdks `yarn dlx
@yarnpkg/sdks`
4. Updates yarn via corepack `yarn set version stable`
5. Fixes a couple places where typescript was mad

## Why It's Good For The Game
- I want to do things like make discriminating type unions
- Huge leap into typescript so I can better type out tgui core
- TS >>> JS

## Changelog
N/A Nothing player facing

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2022-12-31 14:38:57 -08:00
AnturK
4ae83ab362 Disables browserlist update message (#69209)
We only care about IE functionality here, the data updates are pretty irrelevant for us and it's confusing for new coders.
2022-08-15 12:31:20 -07:00
Jeremiah
731ab29aa7 Adds Prettierx - or how I broke TGUI for the nth time (#67935)
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2022-06-23 18:10:22 -07:00
Aleksej Komarov
b86cf89125 tgui: API improvements + docs (#65943)
About The Pull Request

This pull request improves tgui API in many ways.

Using TGUI for custom HTML popups

This standardizes and simplifies the process of HTML popup creation and DM <-> JS communication.

Makes tgui window API a perfect alternative for old-style browser panels. It will be super useful for @Iamgoofball since he wanted to make a lightweight browser element that plays background music, and this will make his life a lot easier.

It is now possible to create tgui windows with fully inlined JS and CSS, which can be used to make unkillable tgui-based UIs (can't white/blue screen due to network errors). You can split files into JS and CSS, and still serve a single HTML file using this.

Moved sendMessage function to the Byond API object, where it rightfully belongs, and now supports a shorthand form: Byond.sendMessage(type, payload). This shortens and simplifies a lot of code.

Refactored window.update to no longer be public. Now to subscribe to incoming messages, you should use new public APIs: Byond.subscribe(fn) and Byond.subscribeTo(type, fn), and TGUI internally uses these functions as well, which reduces boilerplate in index.js.

Renamed window.__windowId__ to Byond.windowId (old variable is still available for backwards compatibility).

Byond API now supports null id, e.g. Byond.winget(null, 'url'), which makes things like this possible:

// Fetch URL of a currently connected server
Byond.winget(null, 'url').then((serverUrl) => {
  // Connect to this server (opens a new dreamseeker instance)
  Byond.call(serverUrl);
  // Close this client because new instance is connecting
  Byond.command('.quit');
});

Certain polyfills are now statically compiled (commited into git) and are baked into tgui.html. The downside is that HTML went 16 kB -> 50 kB. The upside is that you can now use a relatively modern level API with full support for IE8 when writing plain old html UIs using /datum/tgui_window directly. They are committed into git, because polyfills will never need to be updated (unless of course we randomly decide to get rid of ie8.js and html5shiv.js).
Breaking Changes

No breaking changes. This should be tested for regressions. Upgrading is simple if you're on a relatively up-to-date branch - copy paste all affected tgui files and you're good.
2022-04-18 14:07:55 +12:00
Aleksej Komarov
8707ea0755 Yarn 3.1 (#63088) 2021-11-29 00:49:55 +01:00
Mothblocks
5a4c87a9fc tgui Preferences Menu + total rewrite of the preferences backend (#61313)
About The Pull Request

Rewrites the entire preferences menu in tgui. Rewrites the entire backend to be built upon datumized preferences, rather than constant additions to the preferences base datum.

Splits game preferences into its own window.

Antagonists are now split into their individual rulesets. You can now be a roundstart heretic without signing up for latejoin heretic, as an example.

This iteration matches parity, and provides very little new functionality, but adding anything new will be much easier.

Fixes #60823
Fixes #28907
Fixes #44887
Fixes #59912
Fixes #58458
Fixes #59181
Major TODOs

Quirk icons, from @Fikou (with some slight adjustments from me)
Lore text, from @EOBGames (4/6, need moths and then ethereal lore from @AMonkeyThatCodes)
Heavy documentation on how one would add new preferences, species, jobs, etc

    A lot of specialized testing so that people's real data don't get corrupted

Changelog

cl Mothblocks, Floyd on lots of the design
refactor: The preferences menu has been completely rewritten in tgui.
refactor: The "Stop Sounds" verb has been moved to OOC.
/cl
2021-09-15 10:11:11 +12:00
Aleksej Komarov
26f56653c6 tgui-bench (#61081)
Added a package that allows precisely benchmarking tgui components on IE11 without having the game launched.

It has a convenient syntax for writing tests, just create a file packages/tgui-bench/tests/*.test.tsx, and export a function which you want to benchmark

Performance improvements
As part of this PR, I have also improved the raw performance of some tgui components:

Button component - 1.8x faster
Flex component - 1.1x faster
Stack component - 1.3x faster
This improves performance of heavy UIs by a tiny bit.
2021-09-09 18:11:41 +01:00
Aleksej Komarov
a7753ad6fd Juke Build 0.9.0 (#61005)
* Juke Build 0.9.0

* Fix a small bug with build.js

* Distill cmds

* Return sonar

* Revert those build.cmd changes

* Some improvements

* Treat all sonar warnings as errors because they should fail the sonar target

* Do not clean up bootstrap cache because it locks up on removing it
2021-08-25 16:09:00 +02:00
Aleksej Komarov
9bbabfe36b tgui maintenance chores (#60859)
## About The Pull Request

**Upgrades:**

- Yarn 3.0
- TypeScript 4.3
- Sass 1.37
  - Required some refactoring of `/` into `math.div()` in CSS

**Dependency removals:**

- Removed ESM package, see: https://github.com/standard-things/esm/pull/902

I initially thought it was impossible to stop relying on this package, but fortunately, ES module support in Node 12+ now comes standard and I only had to convert the very few external module imports to `require()` (because Yarn PnP).

I also moved `logging.js` directly into `tgui-dev-server` package, because that's where it is used. One less internal dependency.

**Sidegrades:**

- Removed creation of a common tgui chunk, because in practice it creates unnecessary complexity (devs sometimes get a white screen due to this chunk being invalid) and doesn't really save that much data on CDN, and **definitely** doesn't make tgui load faster.

I think that is all. I tested it a bit and everything seemingly works.
2021-08-16 12:21:45 -04:00
Aleksej Komarov
b4d526f768 Upgrade tgui dependencies (#58484) 2021-04-17 22:49:40 -07:00
Aleksej Komarov
29556e879b Upgrade tgui dependencies, make yarn task skippable (#58081)
* Upgrade tgui dependencies, make yarn task skippable

* Use a phony target to avoid double rebuilds
2021-04-01 11:00:35 +02:00
Aleksej Komarov
8080a5132c tgui: ESLint and VSCode settings improvements (#57905)
Added column 80 rulers to all javascript and scss files.
    Added a "prettier" config to have sensible defaults for those who prefer to use it.
    Added RadarJS (fork of SonarQube's SonarJS). Launchable only via bin/tgui --lint-harder for now.
    Disabled ESLint rule for parens around arrow function arguments, because in TypeScript they're pretty much always required, and I don't want to replace it throughout the codebase.
    Removed unused javascript extensions from tooling (jsx, mjs).
2021-03-23 23:35:19 +00:00
Aleksej Komarov
9447383f5a tgui: Upgrade to Yarn 2.4.1 and TypeScript 4.2 (#57465) 2021-03-06 14:42:56 -08:00
Aleksej Komarov
21d5a65346 Fix a number of build issues (#57251)
* Fix finding of dreamseeker instances and not die on cache copy failures

* Upgrade dependencies, resolve webpack dependencies explicitly

* Preload tgui asset to fix reloading of a not yet sent tgui asset

* Rewrite node bootstrap and DM build task

* Redundant array accessor

* Add install-state.gz to tgui build dependencies

* Update build.js

* Use a proper dmlang vscode var
2021-02-28 14:24:34 +01:00
Aleksej Komarov
1fb5d68b53 tgui: Typescript and Jest update (#57081)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-02-22 01:18:35 -08:00
Aleksej Komarov
25aae82af1 Upgrade marked to 2.0.0, along with other deps (#56767) 2021-02-08 20:56:16 -08:00
Aleksej Komarov
ba5d1f1c7e Fix ExoFab UI and Section bugs, improve Tabs, upgrade deps (#56721)
Fixes #56237
    Unblocks #56704

Besides fixing the above mentioned issue with ExoFab UI, I fixed a few tgui component bugs and added a few improvements. Not really atomizable, sorry.
Section changes

    level property is now gone, section level is automatically calculated.
    Nested sections automatically become transparent.
    Nested sections are now properly incapsulated and won't inherit properties of parent sections.
        This allows using nested non-scrollable sections, while parent is, for example, scrollable.

Tabs changes

    Tabs without a parent section will pretend they are a section (and will look as such, with dark background).
    Top corners of tabs are a bit rounded to make it look more like a tab.
    Background color for selected and hovered tabs (previously it was just an underline).
    2px margin around the tabs, to make them stand out a bit from the section background.

Two new props:

    fill - Same as <Section fill>
    fluid - Tabs use full width of the container.

scrollable property was not implemented because it's a bit complicated (requires converting it into a class, registering its scrollable node with tgui, etc). If you need scrollable, just wrap tabs with a Section like a good man.
2021-02-08 18:19:25 -03:00
Aleksej Komarov
a6e60e47e7 tgui 4.3 (#56080) 2021-01-16 19:54:31 -08:00
Aleksej Komarov
6723b1a85f Periodic tgui maintenance (#54567)
Upgraded Yarn to 2.3.3
        Fixes building for people who use non-latin characters and spaces in their paths to tgstation repo.
    Removed webpack notifier
        RIP
        WSL users can now build tgui and not get errors about .pipe.
2020-10-24 19:52:53 +01:00
Emmanuel S
953e337eb3 Pod launcher renaissance squash (#52611)
Refactoring of Flex, Fix Section scrollable

Getting presets working


wip


Upgrade dependencies

preset notice, tooltip fixes, pod spawnlocation fixes


finishes UI, final polish


quells one travismoment


Apply suggestions from code review

Co-authored-by: Rohesie <rohesie@gmail.com>
better var names


better vars


sound for loop


Further review addressing


runtime fixes


Update code/modules/asset_cache/asset_list_items.dm

Co-authored-by: Rohesie <rohesie@gmail.com>
More review addressing


tgui merge


why was that there


Small improvements


Small Improvements Part 2


dropoff / wall moving improvements


compile!


more fixes
2020-09-10 20:22:47 +03:00
Aleksej Komarov
c59d88470a tgui: Yarn Berry (#53026)
This pull request upgrades Yarn to version 2 (also known as Yarn Berry).
* Update build validator

* Provide inferno in the root level package

* Remove type module from package.json

* Powershell build script
2020-08-19 02:26:30 -03:00
Aleksej Komarov
64dcf44cc6 tgchat: Hotfixes, Message Annotations (#52947)
This PR changes the message pipeline a little bit to support list-based messages, which can be annotated with custom data. Function signature of to_chat was slightly changed as well:

// Plain text message
to_chat(client,
  type = MESSAGE_TYPE_INFO,
  text = "foo")

// HTML message
to_chat(client,
  type = MESSAGE_TYPE_INFO,
  html = "<span class='notice'>foo</span>")

Old to_chat format is still supported, but handle_whitespace, trailing_newline and confidential flags have no effect. confidential flag could still be revived though, if there is enough merit in it, for example to filter out confidential messages when saving a chat log.

The reason for using /list and not /datum, is because lists are plain faster, and there are minimal data transformations - these lists are fed directly to json_encode and sent to tgchat.

Plain text messages do not need to be HTML-escaped, which makes them safer and more performant than HTML messages. Plain text messages can be made interactive (or formatted with CSS) by custom-handling them in javscript based on message type and annotations.

It would be impossible to annotate every single message in the game (at the moment of writing, there are 9447 to_chat calls in the code), but it could be done selectively, for only those messages that are hard to classify by span classes (and there are still A LOT of them).
Please annotate more messages. Thank you.

    Fixes #52943
    Fixes #52908
    Fixes #52816

Changelog

cl
add: tgchat: Unread message count is now smarter and won't increase on other tabs if you have already read the same message in the active tab.
add: tgchat: Admin PMs are now properly annotated and can be filtered into separate tabs.
fix: tgchat: Fix: Highlighted message overlay no longer blocks clicks. Clicking a highlighted (F) link should work as it should.
fix: tgui: Fixed NTOS bluescreen due to calling .includes() on a stylesheet href which could be null on certain browsers.
code: tgchat: Chat schema bumped to version 5. All chat-related settings were reset to avoid breakage.
/cl
2020-08-17 10:38:38 +12:00
Aleksej Komarov
2eb5ee5017 tgui 4.1 version bump (#52408) 2020-07-22 04:23:45 +03:00
Aleksej Komarov
0cf00a2645 tgui 4.0 (#52085)
* tgui 4.0 hyper squash

* Upgrade dependencies
2020-07-16 20:13:04 +02:00
Aleksej Komarov
78327339b3 Increment the version number 2020-04-19 19:38:54 +03:00
Aleksej Komarov
baf9bd2f95 REMOVES TGUI (#49330)
* Removes tgui

* Make tgui script executable again

* Set version of packages to 2.0.0

* Update copypasta docs to match the current best practice

* Rebuild tgui

* Update .github/CONTRIBUTING.md

Co-Authored-By: BadSS13Player <58376109+BadSS13Player@users.noreply.github.com>

* Remove holy bible by Arcane

* rebuild

Co-authored-by: BadSS13Player <58376109+BadSS13Player@users.noreply.github.com>
Co-authored-by: Rob Bailey <actioninja@gmail.com>
2020-02-17 04:51:56 -08:00
dependabot-preview[bot]
475e2d4399 Bump ie8 from 0.8.0 to 0.8.1 in /tgui (#46664)
Bumps [ie8](https://github.com/WebReflection/ie8) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/WebReflection/ie8/releases)
- [Commits](https://github.com/WebReflection/ie8/compare/v0.8.0...v0.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-20 21:25:30 -04:00
dependabot-preview[bot]
bcfcb8c76f Bump lodash from 4.17.14 to 4.17.15 in /tgui (#46613)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.14 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.14...4.17.15)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-20 16:22:51 -04:00
dependabot-preview[bot]
ad53041383 Bump postcss-opacity from 3.0.0 to 5.0.0 in /tgui (#46599)
Bumps [postcss-opacity](https://github.com/iamvdo/postcss-opacity) from 3.0.0 to 5.0.0.
- [Release notes](https://github.com/iamvdo/postcss-opacity/releases)
- [Changelog](https://github.com/iamvdo/postcss-opacity/blob/master/ChangeLog.md)
- [Commits](https://github.com/iamvdo/postcss-opacity/compare/3.0.0...5.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-20 16:20:45 -04:00
dependabot-preview[bot]
4461b1c11d Bump paths-js from 0.4.2 to 0.4.10 in /tgui (#46603)
Bumps [paths-js](https://github.com/andreaferretti/paths-js) from 0.4.2 to 0.4.10.
- [Release notes](https://github.com/andreaferretti/paths-js/releases)
- [Changelog](https://github.com/andreaferretti/paths-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/andreaferretti/paths-js/compare/0.4.2...0.4.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-20 10:20:55 -04:00
dependabot-preview[bot]
2fa877f07a Bump gulp-uglify from 1.5.2 to 3.0.2 in /tgui (#46611)
Bumps [gulp-uglify](https://github.com/terinjokes/gulp-uglify) from 1.5.2 to 3.0.2.
- [Release notes](https://github.com/terinjokes/gulp-uglify/releases)
- [Changelog](https://github.com/terinjokes/gulp-uglify/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terinjokes/gulp-uglify/compare/v1.5.2...v3.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-20 10:05:11 -04:00
dependabot-preview[bot]
039df24d31 Bump gulp-if from 2.0.0 to 3.0.0 in /tgui (#46610)
Bumps [gulp-if](https://github.com/robrich/gulp-if) from 2.0.0 to 3.0.0.
- [Release notes](https://github.com/robrich/gulp-if/releases)
- [Commits](https://github.com/robrich/gulp-if/compare/2.0.0...3.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-20 10:03:50 -04:00
dependabot-preview[bot]
8f4484a8b3 Bump postcss from 5.0.16 to 7.0.18 in /tgui (#46609)
Bumps [postcss](https://github.com/postcss/postcss) from 5.0.16 to 7.0.18.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/master/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/5.0.16...7.0.18)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-20 10:02:40 -04:00
dependabot-preview[bot]
669acd5e62 Bump stylus from 0.54.5 to 0.54.7 in /tgui (#46612)
Bumps [stylus](https://github.com/stylus/stylus) from 0.54.5 to 0.54.7.
- [Release notes](https://github.com/stylus/stylus/releases)
- [Changelog](https://github.com/stylus/stylus/blob/dev/History.md)
- [Commits](https://github.com/stylus/stylus/compare/0.54.5...0.54.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-09-19 20:39:03 -04:00
Tad Hardesty
975604a015 Run npm audit fix 2019-07-20 12:22:08 -07:00
AnturK
0d5c0f16f9 Updates FontAwesome to 5.9.0 (#45031)
* removes duplicated tgui asset definition.

* Puts fa in separate asset

* Makes it work.

* Not needed anymore

* Removes brands css and font

* we're not using logos anywhere right

* duh

* Fixes the chat settings width while i'm at it.

* TGUI build
2019-07-10 22:27:53 +10:00
Tad Hardesty
06be8a91e6 Update npm dependencies of tgui (#44588)
* Run npm audit fix

* Remove deprecated gulp-cssnano

* Use a non-alpha gulp 4.0

* Compile tgui
2019-06-18 09:27:32 +02:00
Jordan Brown
fdaa9eb7a4 Remove lodash vuln 2019-02-07 22:16:30 -05:00
Jordan Brown
f4dc7b5304 Fix tgui dependency vulnerability (#41480) 2018-11-15 10:14:55 +01:00
Tad Hardesty
12f556dc35 Remove carets from tgui dependencies 2018-09-13 16:24:43 -07:00
Tad Hardesty
4e2792fa77 Remove unused tgui dependency (#39592) 2018-08-07 21:43:33 +03:00
Tad Hardesty
02036af15a Update node dependencies (#38536) 2018-06-18 08:51:39 +02:00
vuonojenmustaturska
ebb9809484 maybe? (#37504) 2018-04-29 22:57:58 +02:00
MoreRobustThanYou
ed0195be4f Chemisty recipe macros (#34149)
* Chemistry recipe macros

* Fix energy not being drained

* reee tgui travis

* Finishing touches
2018-01-07 19:48:55 -05:00
MoreRobustThanYou
efdfc0470e Revert gulpfs version to 6d71a65 in tgui 2017-12-22 20:23:30 -05:00
Matt Smith
bed964043f Update AI Airlock UI to use TGUI (#32594)
* Update AI Airlock UI

* Update to use TGUI for AI airlock interface

Update the TGUI package to allow you to natively run the gulp binaries, which makes it easier to work cross platform
`npm run build` and `npm run watch` are both supported.

Also fixed a few minor style changes in the files as i went through.
2017-11-14 21:29:25 +13:00
Jalleo
2f9537c7a9 Refactor of base machinery a tiny bit more. DONE (#32546)
* Moves a base uid from machienry to a bunch of children as it was literally setting a var that most machines never used. This is probably a good candidate for a component replacement.

* Just checking something

* Does this fix the compiling not working properly?

* And this?

* What is going wrong ugh!

* params["target"] instead of params["set"] bug was there before I even touched it but my compiling of TGUI caused it or something?

* Slight tidying up for what Cyberboss and Antur likes.

* Fixes the things that I was asked to fix
2017-11-12 14:19:04 -05:00
AnturK
f96eaeaa86 Fixes tgui dependencies 2017-03-19 18:05:34 +01:00
Lzimann
9d62a76892 Hopefully unfucks tgui dependencies for IE < 11 2017-01-13 10:20:38 -02:00