This is a big one. 🔥
**Changes:**
- Targets next major release (v4.0.0)
- Switch runtimes from NodeJS to BunJS (bun.sh)
- Typescript library support moved to `ESNext`
- Typescript compile option `verbatimModuleSyntax` enabled
- Updated all interfaces to be imported explicitly as types
- Strict mode enabled
- Reduces the number of tsconfig files
- Pins all dep packages to specific patch versions
- Includes Bun lock file in repo (doesn't cause issues like the
package-lock did)
- Replaces Gulp with a new Typescript based build system
- Adds `core-js` as a workaround for Bun not playing nice with
`reflect-metadata`
- Removes `pkg` and `swc` (Yay Bun!)
- Updated package scripts and entry point system to be more intuitive
- Updated VSCode workspace configurations
- Updated `.gitignore` to align with updated project structure
- Updated Biome configuration to align with updated project structure
- `Program.ts` - Removes call to set encoding on the process
- `global.d.ts` - Added underscores to build globals to match other
global names
- `JsonUtil.ts` - Replaced old `fixJson` package with newer `jsonrepair`
package
- `HashUtil.ts` - Replaced old `buffer-crc32` package with built-in
`node:zlib` package
- `DatabaseImporter.ts` - Updates database validation object to be flat,
where the keys are the relative path to the file
- `BunTimer.ts` - Adds an easy to use timer class that's compatible with
nanoseconds.
**TODO:**
- Look into mod loading. I think we use a TS transpiler for mods and I
believe that can be removed now.
- Bun includes a number of APIs that can be used in place of Node's
packages (built-in or otherwise); HTTP server, WebSocket server, File
IO, Hashing, File Globing, Testing... Each of these should be utilized
where ever possible.
- Update in-repo documentation to reference BunJS instead of NodeJS.
Boogidy, boogidy, boogidy. Let's go racing! 🏎️
Removes the over-complicated and super-slow setup we had with ESLint & Prettier in favour of Biome. The largest change with the formatting is moving from Allman braces to 1TBS braces. Other than that, it's *pretty much* the same. Ah, and that Biome runs formatting and linting on the entire project about x10 faster than the old system ran formatting on one file. Seriously, the guy who came up with that last solution should be fired. :runs:
I've kept all of the formatting and linting commands the same as before, with the main mamma-jamma being: `npm run format`, which applies formatting and linting changes to the entire project.
Formatting-on-save works (quickly!) by (1) ensuring that you're working within the VSC workspace (as you should be), and (2) have the recommended Biome VSC extension installed. The link to the Biome extension is in the README.
This limits our options on code formatting going forward; Biome, like prettier, is very opinionated with very few formatting options available. But I see this as a good thing. I'd rather spend my time arguing about which gun in Tarkov is the best, rather than coding brace styles...
...It's the TOZ, and it always will be. Don't DM me.
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: SPT/Server#383
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
Rebranded src code and scripts to SPT
Co-authored-by: clodan <clodan@clodan.com>
Reviewed-on: SPT-AKI/Server#345
Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com>
Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
This update now runs Prettier before ESLint (with the Stylistic plugin) for code formatting. This takes care of a lot of the edge cases that ESLint doesn't touch by itself. Also adds the `eslint-plugin-unused-imports` ESLint plugin to remove unused imports and the `eslint-plugin-switch-allman` ESLint plugin to enforce Allman braces on case declarations.
The VSCode format-on-save function now requires two additional extentions to be installed: Prettier and Format Code Action. Links can be found in the README and in the recommended extentions section of VSCode when the workspace is open.
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: SPT-AKI/Server#336
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
The built-in ESLint import settings will lint the imports, but not fix them, as that's concidered stylistic. The ESLint Stylistic package doesn't currently support sorting. We have to use the ESLint Import plugin to force import sorting. This Import plugin doesn't yet support the new ESLint flat-configuration file format so we've had to convert back to the old no-flat format.
- Drops DPrint
- Drops Biome
- Adds ESList Stylistic
- Updates ESLint config to new FlatConfig format
- Removed the `dprint.dprint` and `biomejs.biome` VSC extentions from the recommendations list
- Updates README to reflect all the above changes
TODO: Import sorting & minor fixes after `npm run lint:fix`.
Curse you, Alex!
- Updates the Server project README to include additional information about installation, development, and contribuation guidelines.
- Moves the feature list to a dedicated FEATURE.md file (linked from the README.md).
- Reviewed the FEATURES.md file to clean it up a little bit.
Reviewed-on: SPT-AKI/Server#306
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
These are the basic config changes that enable auto-formatting. This is being run directly within this branch to prevent a plethora of merge conflicts when `fix/linting-errors` is merged into this branch.