Significant refactoring of globals and entry points. Oh my.
- The global variables previously accessible throughout the codebase
have been restructured as private static properties of the Program
class. Public static getter methods have been added to allow read access
to these properties throughout the codebase.
- Entry points, which were dispersed across multiple files, have been
consolidated and simplified into a static method on the Program class,
making the entry logic easier to follow.
- Removed unnecessary ~~globals~~ Program static properties.
- Adjusted imports and references across the codebase to reflect the new
structure.
Try not to focus on the `gulpfile.mjs` changes, as it won't be around
for much longer. *[winky face]*
Co-authored-by: Chomp <27521899+chompDev@users.noreply.github.com>
Should handle the websockets asynchronously, also has some typing
updates considering ws's server is not called Server anymore but is now
'WebSocketServer'
---------
Co-authored-by: Chomp <27521899+chompDev@users.noreply.github.com>
Reworked `PmcLootGenerator` to make use of new property
Unified how pocket/vest/backpack slots create blacklist
Utilise set when combining blacklist sources
Blacklisted prestige dogtags from reward pool and PMC loot
- Enables TS strict mode
- Adds script to check types
- Adds workflow to run check-type script
- Updates the code-checking workflows to share the same set-up job
This updates the `tsconfig.json` option to enable strict mode.
*However*, we use TSX for development and SWC for release, which do not
type-check, so this option only gives additional linting/visual-feedback
in VSCode.
Additionally, I've added a NPM script `npm run lint:types` and a GitHub
workflow that runs it.
**This depends on #1005.**
---------
Co-authored-by: Chomp <27521899+chompDev@users.noreply.github.com>
- Updates version numbers in `.nvmrc`, `package.json`, and
`Server.code-workspace`
- Updates `@yao-pkg/pkg`, `@yao-pkg/pkg-fetch`, and `@types/node` to
latest
- Updates JSON import to FS read operation in `gulpfile.mjs`
- Updates node build target in `gulpfile.mjs`
Tested with local runs, Windows builds, and Linux builds. Have not
tested a Windows build on Linux, but see no reason it wouldn't work.
*[knocks on wood]*
I feel this is safe to merge.
- Adds support for `tsx`
- Drops support for `ts-node`, `ts-node-dev`, and `tsconfig-paths`
- Changed workspace debug configuration to use `tsx` in watch mode
- Changed `npm run run:debug` command from using gulp to running `tsx`
directly (not in watch mode)
- Changed TypeScript settings for improved module handling
- Changed TypeScript to be a development dependency
Co-authored-by: Chomp <27521899+chompDev@users.noreply.github.com>