Rojo project conversion
Use -p to walk a Rojo project file and compile every script it references in one command.
How it works
luau2ts -p default.project.json -o out/ does:
- Reads
default.project.json. - Recursively walks the
treeproperty. - For each
$pathentry, resolves the directory (or single file) on disk. - Inside each directory, classifies files by Rojo's naming convention:
Name.luau→ ModuleScript namedNameName.server.luau→ Script namedNameName.client.luau→ LocalScript namedNameinit.luau→ the containing folder itself is a ModuleScriptinit.server.luau/init.client.luau→ folder is a Script / LocalScript
- Compiles every discovered
.luau/.luaand writes the.tscounterpart underout/, preserving the directory structure relative to the project file.
File-suffix preservation
The output keeps the Rojo suffix. Main.server.luau → Main.server.ts. This is the same convention roblox-ts uses, so a downstream roblox-ts build picks up the script kind correctly.
Nested children
A node with children but no $path becomes a Folder. Children are written under a subdirectory named after the node:
{
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"Modules": { "$path": "src/modules" }
}
}
}
Emits to out/Modules/....
What's not supported (yet)
.json/.csv/.txt"model files" (data-only Instances). These don't produce TypeScript, they're skipped silently. Add them to your TS code as plain JSON imports if you need them..rbxm/.rbxmxmodel bundles. Out of scope; these are binary Roblox formats.- Live file watching (
luau2ts -p ... --watch). Coming in 0.2.