Skip to content
This repository was archived by the owner on Oct 17, 2024. It is now read-only.

thinknathan/tsd-template-bun

Repository files navigation

Defold TypeScript Template (minimal - Bun version)

Chat with us! CI/CD GitHub License

A dev environment for Defold that transpiles TypeScript into lua using TypeScriptToLua and Bun.

Features

  • Full Lua and Defold API type definitions for TypeScript auto-complete and type checking
  • Library of types for Defold extensions via bun run resolve
  • Eslint config for handling the caveats of TypeScriptToLua and keeping your code correct
  • Handles script, gui_script, and module exports using familiar ES6 export syntax
  • Full BoilerPlate game project ready to transpile and go
  • File watcher via bun run dev to transpile on save

Note that you will need to have Bun installed.

Quick Start

  • Use bun run dev to start a watcher that compiles and emits lua and script when you save
  • Use bun run build to just compile your ts, sans watcher

Installation

  1. Fork this template or use degit to download the template locally
npx degit thinknathan/tsd-template-bun my-game
# or
git clone https://github.com/thinknathan/tsd-template-bun.git my-game
  1. Initialize
cd my-game
bun install
  1. Generate
bun run build # Transpile the TypeScript files to lua
# or
bun run dev # Watch for changes and regenerate files on save
  1. Code
code .
  1. Open app/game.project in Defold
  • Start making games with TypesScript!

TypeScript ❤️ Defold