An experimental TypeScript toolchain for GMRT
This project isn't doing anything SUPER fancy at the moment, fundamentally it just makes some non-destructive adjustments to the GMRT build process to slot in a TypeScript compilation step. Fortunately, the GMRT compiler (runtime?) is quite flexible with what files you can pass to it and thus control how your project is built. At the moment, generating a project with gmts will create two files that are needed for TypeScript compilation:
- 1.)
buildgraph.xml(this is created in the root of your project, used to tell gmrt that it needs to invoketscprior to building; this file comes from your currently installed GMRT packages) - 2.)
tsconfig.json(this is also created in the root of your project, used bytscto know what files to (and not to) compile when the project is built; this is generated at build-time)
As of now, gmts is self-contained... what that means is that you'll need to use gmts --create --name=<project name> and gmts --run [--name=<project name>] to utilize TypeScript features at the moment.
gmts --create will create a blank project with a room named Room1 and a single JavaScript script named main. Inside of <project name>/scripts/main/ exists a main.ts file which you can modify to your liking. Please note that for creation of extra scripts, you must do so within the GameMaker IDE. There shouldn't be any incompatibility with opening the generated YYP, as this is created from your IDE installation itself. (sidenote: gmts --create will create a .gmrecent file which is used by gmts --run if no --name parameter is provided, if you're having problem make sure that the value in .gmrecent actually exists in the /projects/ directory)
gmts functionality itself relies heavily on the paths in gmconfig.json being correct, it mostly infers based off the system username... but it may not be 100% accurate for your setup. Please ensure that the branch value is set accordingly (set to -Beta, as in expecting GameMaker-Beta to be installed)
- The GameMaker editor does not (easily) support reading TypeScript files, please note that scripts opened within GameMaker will show the
.jsoutput - Asset definitions do not exist, the goal is to generate/read them from
.yyp - Generated type definitions are soon to come, the included
.d.jsfile from GMRT doesn't seem to play nicely with real TS - JavaScript support for GMRT is not finalized, and this extends out to TypeScript (which is NOT currently supported by GMRT at all). Given that this project is an experiment, please do not expect any long term support. This may blossom into something bigger/better, for now this is just to see what's possible with GMRT current day (2/9/2026 as of writing)
- Make this into a drop-in solution for setting up TS with GMRT
- Create comprehensive typings for all GameMaker functions and for popular extensions (if they exist for GMRT at this point)
- Make this into something useful, or just wait for YYG to add in actual TS support
,