Bundling cheats, validating changes, and packaging for each platform.
- Run
npm install. - Use Node 18 for packaging (
pkgtargets Node 18). - Build
cheats.jsbefore running (build once or use the watcher).
npm install
npm run build:cheats
npm run startnpm run startlaunches the injector and web server using the existingcheats.jsbundle.- Start does not rebuild cheats; rebuild and restart after changes.
- No hot reload for the injected game context.
For cheat development, run the watcher to keep cheats.js current:
npm run watch:cheatsKeep the watcher running in one terminal and run npm run start in another.
rollup.config.mjs builds the browser bundle:
- Input:
src/cheats/main.js. - Output:
cheats.js(IIFE format). strict: falseto avoid issues in the game context.- Injects a banner with version info and date.
- Prints bundle stats (chunks, size, modules) after build.
- Bundles all cheat modules with
moduleSideEffects: truefor safety. - The cheat bundle is required for both dev and packaged builds.
Build once:
npm run build:cheatsNote: cheats.js is gitignored and generated during builds.
npm run validate runs these checks:
npm run build:cheats(ensures bundle is current).node --check cheats.js config.js(syntax check).npx eslint .(lint).node -e "require('./src/ui/config/optionsAccountSchema.json')"(schema validity).
Run this before packaging or releasing.
To lint only cheats: npx eslint src/cheats/.
To check formatting with Prettier: npm run format:check.
To auto-format all files: npm run format.
pkg bundles Node 18 with the app. Commands in package.json:
npm run build # Windows: InjectCheatsUI.exe
npm run build-unix # Linux: InjectCheatsUI-linux
npm run build-macos-x64 # macOS Intel: InjectCheatsUI-macos-x64
npm run build-macos-arm64 # macOS Apple Silicon: InjectCheatsUI-macos-arm64Each script runs npm run build:cheats first, then packages with --compress Gzip.
pkg includes src/ui/**/* as assets so the web UI ships with the binary.
New UI assets should go under src/ui or be added to pkg.assets.
- Run
npm run validate. - Rebuild cheats if not using the watcher.
- Build target binaries.
- Run
InjectCheatsUIand verify:- UI loads at
http://localhost:8080. - Cheats list and config load.
- A sample cheat executes.
- CLI autocomplete works.
- UI loads at
- Syntax errors in
cheats.jsorconfig.jswill failnode --check. ENOENT: cheats.jsmeans the bundle was not built (runnpm run build:cheats).- If
pkgfails, check Node 18 compatibility and that dependencies are installed. - If the UI fails to load in packaged builds, check that
src/ui/**/*is inpkg.assets.