This is a modern and clean project template for a new Screeps project in Typescript.
Features:
- Fast development environment with Bun
- Linting with biomejs (
bun lint+bun format) - Unit tests with screeps-jest (
bun run test) - Code bundling using rollup and rollup-plugin-screeps
- Bun must be installed
To install dependencies:
$ bun installTo run linting:
$ bun lintTo auto format code (and write the changes):
$ bun formatTo run tests:
(Note it's important to preload the setup script in ./src/test/setup.ts to
create globals like Game, Memory etc. from screeps-jest which is why
bun run test is preferred over bun test here.)
$ bun run testTo push to screeps:
- First create
screeps.jsonwith your screeps credentials. Seescreeps.sample.jsonfor an example. - Run
bun push-mainto push to your main branch on screeps.com.
Alternatively run bun watch-main to watch for changes in your code as you edit
and push on demand.
Note: Although bun build runs significantly faster than tsc for a large
codebase, the build from bun is not currently able to target the slightly
old node runtime that Screeps runs on. For this reason we still use a vanilla
tsc compile step in the rollup script.