Mix-and-match TypeScript and Lua for your Picotron projects
Go to file Use this template
2026-01-17 10:09:53 +01:00
src First commit 2025-12-14 14:20:25 +01:00
_G.d.ts Update 2026-01-17 10:09:53 +01:00
.gitignore First commit 2025-12-14 14:20:25 +01:00
.prettierrc.json Update 2026-01-17 10:09:53 +01:00
eslint.config.mts Update 2026-01-17 10:09:53 +01:00
game.p64 Update game.p64 2025-12-14 17:50:26 +01:00
package.json Update 2026-01-17 10:09:53 +01:00
pnpm-lock.yaml Update 2026-01-17 10:09:53 +01:00
README.md Update 2026-01-17 10:09:53 +01:00
tsconfig.json Update 2026-01-17 10:09:53 +01:00

TypeScript for Picotron

This is an experimental template project to mix-and-match TypeScript and Lua for your Picotron projects.

Most of the _G.d.ts file has been AI-generated from the official documentation, with progressive manual adjustments.

Important

TypeScript code converted to Lua code is not guaranteed to be correct or efficient. Read the TypeScriptToLua documentation, follow best practices, and review the generated Lua code.

Setup

Requirements

Create your project

  • Create a new project (i.e. my-project) from this template
  • Clone my-project in your Picotron's drive folder
  • cd my-project then
    • pnpm install
    • pnpm build
  • Inside Picotron:
    • Open the terminal, cd my-project then load game
    • Edit main.lua to change the cd line to cd("/my-project/build")
    • Run the game

Development

  • pnpm dev will watch and rebuild your TypeScript code.
  • pnpm build is required when you change Lua code.

The resulting code is a single build/bundle.lua file.

Publish

In Picotron

> cd my-project
> load game
  • Open the code inside Picotron
  • Comment the cd() line in main.lua
  • Save

On the host

pnpm build

In Picotron

Open the terminal:

> cp -f /my-project/build/src /ram/cart/build/src
> save
> export my-project.bin