v0.13.17

v0.13.17 · for World of Warcraft addon developers · macOS, Linux, Windows · MIT

Addons that work before you /reload

wowlua is a language, compiler, framework and package manager for World of Warcraft AddOns, shipped as one binary. It type-checks your code against the WoW API of every game flavor, builds a complete AddOn, and publishes it to CurseForge, Wago, WoWInterface and GitHub with one command. Every Lua file you have today is already valid wowlua.

curl -fsSL https://github.com/DomenikIrrgang/wowlua/releases/latest/download/install.sh | sh

Windows: irm …/install.ps1 | iex · all install options

bring an existing addon

every Lua file is valid wowlua.pkgmeta projects adopt in one commandbuilds match the packager's on 36 real addons

[ checked ]

Catch bugs before the game does

The checker knows the whole WoW API of the client you build for, generated from Blizzard's documentation, plus your own types. Typos, wrong arguments, accidental globals and, in strict mode, possible nils show up in your editor and terminal instead of in an error popup.

  • → every API function, widget method and event payload typed
  • → secret values checked as you type, not discovered in a boss fight
  • → plain .lua files only get warnings, so nothing breaks while you adopt
  • → gradual types: annotate what you want, inference does the rest
how types work →
src/bags.wowluawowlua
export function freeSlots(): number    local free = 0    for bag = 0, NUM_BAG_SLOTS do        free += C_Container.GetContainerNumFreeSlots("bag" .. bag)    end    return freeend
error[E2001]: `string` is not assignable to `number`
  ┌─ src/bags.wowlua:4:54
  │
4 │         free += C_Container.GetContainerNumFreeSlots("bag" .. bag)
  │                                                      ^^^^^^^^^^^^ here

error: aborting due to 1 previous error
[ standard library ]

The boring parts, already written

Events, saved variables, slash commands, timers, an options page, a minimap button, keybindings and addon messages, without embedding third-party libraries. Decorators are wired up at compile time, every handler is typed against the event's payload, and only the modules you import end up in your addon.

before · plain Lualua
local f = CreateFrame("Frame")f:RegisterEvent("ADDON_LOADED")f:RegisterEvent("PLAYER_MONEY")f:SetScript("OnEvent", function(self, event, name)    if event == "ADDON_LOADED" and name == "Ledger" then        LedgerDB = LedgerDB or { }        if LedgerDB.gold == nil then LedgerDB.gold = 0 end    elseif event == "PLAYER_MONEY" then        LedgerDB.gold = GetMoney()    endend) SLASH_LEDGER1 = "/ledger"SlashCmdList.LEDGER = function()    print("Ledger: " .. GetCoinTextureString(LedgerDB.gold))end
after · src/main.wowluawowlua
import event from "wowlua:events"import slash from "wowlua:slash"import print from "wowlua:log"import * as saved from "wowlua:saved" local db = saved.bind("LedgerDB", {    version = 1,    defaults = { gold = 0 },    profiles = true,}) @event("PLAYER_MONEY")local function onMoney()    db.gold = GetMoney()end @slash("/ledger")local function show()    print(GetCoinTextureString(db.gold))end
[ vs code ]

Debug your addon next to the game's screen

The wowlua extension runs your addon in an emulated WoW client and shows the UI beside your code, drawn with your own installation's textures and fonts. Set a breakpoint on PLAYER_LOGIN or a button's OnClick, click in the picture, and step through what happens.

VS Code debugging an addon with wowlua: paused at a breakpoint in Root.wowlua inside an @onLogin handler, the call stack shows event PLAYER_LOGIN, the breakpoints list includes stopping when execution becomes tainted or a protected action is blocked, and the wowlua: UI panel shows the addon's welcome window drawn as the game draws it
An addon paused in an @onLogin handler. Left: variables, the call stack back to event PLAYER_LOGIN, and breakpoints for taint and blocked protected actions. Right: the game's screen, live.
  • Errors as you type

    The language server checks your unsaved edits a moment after you stop typing, against the API of every flavor you build for.

  • The API explained on hover

    Every game function shows what it does, its parameters and a link to its warcraft.wiki.gg page. The API reference has the same text.

  • Rename and find references

    F2 renames a method across files and packages, or tells you why it can't. Find All References finds self. fields too.

  • Colours, hints and fixes

    Names coloured by what they are, the inferred type after a local, quick fixes on Ctrl/Cmd+., and each function's reference count above it.

  • Tests in the Testing view

    Run or debug a single test with a click, and see which lines your tests covered.

get the extension ↗set up VS Code →
[ tested ]

Test your addon without logging in

wowlua test loads your addon into an emulated client: a Lua 5.1 VM with WoW's taint and secret values, WoW Forever's API and Blizzard's own UI. Type slash commands, click buttons, spawn units, move time forward, then check what the player would see, down to a screenshot.

  • → runs anywhere, in CI too, no game client needed
  • → screenshot tests drawn with your installation's textures and fonts
  • → world profiles: a character with its gear and bags, the units around it, a party
  • → your real character as a world profile: /wl snapshot in the game, wowlua profile snapshot at home
  • → perf scenarios: wowlua perf run fails when a change makes your addon cost more per frame than the baseline
  • → examples in your doc comments run as tests
write your first test →
tests/window.test.wowluawowlua
import test, expect from "wowlua:test"import * as mock from "wowlua:mock" @test("/ledger opens the window and reset clears the session")local function resets()    mock.slash("/ledger")    expect(GoldLedgerWindow).toBeShown()    mock.click(GoldLedgerWindow.reset)    expect(GoldLedgerWindow.session).toHaveText("+0g")    expect(GoldLedgerWindow).toMatchScreenshot()end
~/GoldLedgerzsh
$ wowlua test
 PASS tests/window.test.wowlua (camelot, 3.56s)
   ✓ /ledger opens the window and reset clears the session
   ✓ the session survives a /reload
      Tested 2 passed, 0 failed, 0 skipped (1 file) in 3.67s
[ 3d world ]

Your UI over the world it runs in

With --world, tests and screenshots stand your character and the units on the zone's ground from your WoW installation: terrain, buildings, trees and creatures, lit by the realm's time of day. Nameplates follow their units, names float over them, and UnitPosition answers the ground's height.

A screenshot drawn by wowlua screenshot --world: a level 1 character in Northshire Valley in front of the abbey, test NPCs named with their titles such as Garrick, Warrior Trainer and Clara, Cloth Armor Merchant, kobolds and a target dummy nearby, and Blizzard's UI with the minimap, unit frame, chat and action bars over the world
wowlua screenshot --world of a test in wowlua's own northshire profile, drawn from a WoW Forever installation: no game client running.
  • Lit as in the game

    The zone's sky, sun, fog and shadows at the realm's time of day. mock.setTimeOfDay(21, 30) shows the evening.

  • Weather and water

    mock.setWeather("rain", 0.5) makes it rain; lakes, rivers and lava move, banners, lanterns and mills turn near you.

  • Spells you can see

    A caster's hands glow, a Fireball flies and bursts on its target, and auras glow on the unit while they are up.

  • A world to test in

    The northshire profile: vendors, a trainer of each class, a banker, an auctioneer, a flight master and things to fight.

the 3D world in tests →
[ wow api ]

The whole WoW API, documented

Every function, event and widget method of the camelot client, searchable, with what it does, its parameters and its results; retail and Classic Era are coming. Where Blizzard and the wiki are silent, wowlua wrote the description. Each page also tells you how well the emulator knows it, so you know what your tests can rely on.

  • implemented modelled by the emulator
  • recorded answered as the real client answered
  • guessed worked out from the documentation
  • not implemented calls fail with "not mocked"
search the API →
[wl] wowlua dev GoldLedger ×
overview profiler monitor log errors 2 watch inspector
functioncallstotal ↓selfmaxavg onBagUpdate1,28458.36.2021.40.05 Ledger:update1,28441.229.80.410.03 Ledger:summary1218.73.101.201.56 Ring:push1,28411.411.40.090.01
[wl]wowlua devGoldLedger
overviewprofilermonitorlogerrors 2
functioncallstotal ↓maxonBagUpdate1,28458.321.4Ledger:update1,28441.20.41Ledger:summary1218.71.20Ring:push1,28411.40.09
[ in game ]

A dev window inside the game

Dev builds profile every function, monitor events, scripts and timers, capture errors and watch values, without a single change to your code. Type /wl. Release builds contain none of it.

  • → Profiler for every function: calls, total, self, max and average time.
  • → Monitor for events, scripts and timers, plus memory over time.
  • → Error capture that keeps BugSack and the default error frame working.
  • → Watches and a table inspector, live while the window is open.
  • → wowlua trace maps errors and stacks from the game back to your source lines, also through the source maps of bundled builds.
debugging guide →
[ shipped ]

From one source folder to every addon site

wowlua writes the TOC file, embeds your libraries and builds a complete, installable AddOn, for any of five game flavors. WoW Forever (camelot) runs in every part of wowlua today; retail (standard, the default), Classic Era, TBC Anniversary and MoP Classic are checked and built, and run in the emulator soon.

Compiles to the Lua you'd write

Types disappear and sugar becomes plain Lua 5.1. Dev builds keep your line numbers, so errors point at your code.

wowlua
kills += 1label = `{kills} kills`
emittedlua 5.1
kills = kills + 1label = tostring(kills) .. " kills"

No TOC, no Libs folder to babysit

The TOC file is generated from wowlua.json. Lua libraries are fetched, locked and embedded with only the files the game loads.

wowlua.jsonjson
{  "package": {    "name": "gold-ledger",    "version": "1.2.0"  },  "addon": { "title": "Gold Ledger" },  "flavors": {    "standard": {},    "camelot": {}  }}

Publish with one command

Builds, runs your tests, packages the zip and uploads it to CurseForge, Wago, WoWInterface and GitHub Releases. Push a tag and CI does it for you.

~/GoldLedgerzsh
# bundled, optimized build
$ wowlua build --release
# package and upload to every configured addon site
$ wowlua publish
[ bring your addon ]

Keep your code. Get the tools today.

init turns your TOC files into wowlua.json, moves Lua and XML files into src/ and updates the in-game paths to them. .pkgmeta externals become dependencies, and the build matches the BigWigs packager's: the same loaded code, the same shipped files, line endings and TOC versions. This is checked on 36 addons, including BigWigs, DBM, WeakAuras, ElvUI and Details. Your packager workflows stay untouched; init prints how to switch them to wowlua publish.

read the adoption guide →
~/MyExistingAddonzsh
$ wowlua init --from-pkgmeta
$ wowlua dev               # build, sync, watch
$ wowlua types convert src # LuaLS annotations → types

Working with an AI agent?

wowlua mcp lets it start your addon in the emulated client, look at screenshots, click, type slash commands, set breakpoints and profile, then check, format and test its own fix, just like you can. Register it once and it works in any addon, even one without wowlua.json.

how it works →

Your next addon, in about a minute

~zsh
$ wowlua new GoldLedger && cd GoldLedger
     Created addon package in GoldLedger
$ wowlua dev
       Built GoldLedger 0.1.0-dev (dev: standard) in 0.08s
   Installed /Applications/World of Warcraft/_retail_/Interface/AddOns/GoldLedger
       Ready type /reload in game to load the changes