roblox-tooling
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRoblox tooling
Roblox 工具链
Pick a sync model
选择同步模型
| Need | Use |
|---|---|
| Edit scripts in an external editor / git for code only; keep Studio as source of truth; Team Create | Studio Script Sync (built in: right-click a folder → Sync to…) |
| Whole project as files, file system is the source of truth, CI builds, packages | Rojo ( |
Script Sync syncs only /// (≤ 10,000 scripts per synced
root, ≤ 128 roots); don't sync scripts that carry attributes/tags (they're not written to disk).
Pair either with the Luau Language Server VS Code extension + its Luau Language Server Companion
Studio plugin (sends the DataModel tree so requires and instance paths type-check).
ScriptLocalScriptModuleScriptFolder| 需求 | 使用方式 |
|---|---|
| 仅在外部编辑器/git 中编辑脚本代码;以 Studio 为事实来源;Team Create | Studio Script Sync(内置:右键单击文件夹 → Sync to…) |
| 将整个项目以文件形式管理;以文件系统为事实来源;使用 CI 构建和包 | Rojo( |
Script Sync 仅同步 ///(每个已同步根目录 ≤ 10,000 个脚本,≤ 128 个根目录);不要同步带有 attributes/tags 的脚本(它们不会写入磁盘)。
任一方案都可搭配 Luau Language Server VS Code 扩展及其 Luau Language Server Companion Studio 插件(该插件会发送 DataModel 树,使 require 和实例路径能够通过类型检查)。
ScriptLocalScriptModuleScriptFolderRokit: pinned toolchain
Rokit:固定版本工具链
toml
undefinedtoml
undefinedrokit.toml (commit it; run rokit install
)
rokit installrokit.toml (commit it; run rokit install
)
rokit install[tools]
rojo = "rojo-rbx/rojo@7.7.0"
wally = "UpliftGames/wally@0.3.2"
lune = "lune-org/lune@0.10.5"
stylua = "JohnnyMorganz/StyLua@2.5.2"
selene = "Kampfkarren/selene@0.31.0"
luau-lsp = "JohnnyMorganz/luau-lsp@1.70.1"
darklua = "seaofvoices/darklua@0.19.0"
Install Rokit: `curl -sSf https://raw.githubusercontent.com/rojo-rbx/rokit/main/scripts/install.sh | bash`
(Windows: `install.ps1`). Add tools with `rokit add owner/repo`. Versions above are current as of
September 2026; bump deliberately. (Aftman and Foreman are older equivalents.)[tools]
rojo = "rojo-rbx/rojo@7.7.0"
wally = "UpliftGames/wally@0.3.2"
lune = "lune-org/lune@0.10.5"
stylua = "JohnnyMorganz/StyLua@2.5.2"
selene = "Kampfkarren/selene@0.31.0"
luau-lsp = "JohnnyMorganz/luau-lsp@1.70.1"
darklua = "seaofvoices/darklua@0.19.0"
安装 Rokit:`curl -sSf https://raw.githubusercontent.com/rojo-rbx/rokit/main/scripts/install.sh | bash`
(Windows:`install.ps1`)。使用 `rokit add owner/repo` 添加工具。上述版本截至 2026 年 9 月为最新;升级版本时应审慎执行。(Aftman 和 Foreman 是较早的同类工具。)Rojo project
Rojo 项目
json
{
"name": "my-game",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"Shared": { "$path": "src/shared" },
"Packages": { "$path": "Packages" }
},
"ServerScriptService": {
"Server": { "$path": "src/server" },
"ServerPackages": { "$path": "ServerPackages" }
},
"StarterPlayer": {
"StarterPlayerScripts": {
"Client": { "$path": "src/client" }
}
},
"Workspace": {
"$properties": { "StreamingEnabled": true }
}
}
}File mapping: → ModuleScript, → Script, → LocalScript,
folder with // → that script with children,
→ properties/attributes, // → instances, //
→ ModuleScript returning data / StringValue. Commands: , ,
(for luau-lsp), / Open Cloud for
publishing. Keep maps/art in Studio (or files) and code in Rojo — partially managed trees are fine.
Foo.luauFoo.server.luauFoo.client.luauinit.luauinit.server.luauinit.client.luau*.meta.json*.model.json.rbxm.rbxmx*.json*.toml*.txtrojo serverojo build -o game.rbxlrojo sourcemap default.project.json -o sourcemap.jsonrojo upload.rbxmjson
{
"name": "my-game",
"tree": {
"$className": "DataModel",
"ReplicatedStorage": {
"Shared": { "$path": "src/shared" },
"Packages": { "$path": "Packages" }
},
"ServerScriptService": {
"Server": { "$path": "src/server" },
"ServerPackages": { "$path": "ServerPackages" }
},
"StarterPlayer": {
"StarterPlayerScripts": {
"Client": { "$path": "src/client" }
}
},
"Workspace": {
"$properties": { "StreamingEnabled": true }
}
}
}文件映射: → ModuleScript, → Script, → LocalScript,
包含 // 的文件夹 → 带子项的对应脚本,
→ properties/attributes,// → 实例,//
→ 返回数据/StringValue 的 ModuleScript。命令:、、
(供 luau-lsp 使用)、 / Open Cloud
用于发布。在 Studio(或 文件)中保留地图/美术资源,在 Rojo 中保留代码——允许只管理部分树。
Foo.luauFoo.server.luauFoo.client.luauinit.luauinit.server.luauinit.client.luau*.meta.json*.model.json.rbxm.rbxmx*.json*.toml*.txtrojo serverojo build -o game.rbxlrojo sourcemap default.project.json -o sourcemap.jsonrojo upload.rbxmPackages
包管理
- Wally (,
wally.toml→wally install,Packages/forServerPackages/):realm = "server"Wally thunks lose types: runtoml[dependencies] React = "jsdotlua/react@17.2.1" ReactRoblox = "jsdotlua/react-roblox@17.2.1" [server-dependencies] ProfileStore = "lm-loleris/profilestore@1.0.3"after install. Check each package's page on wally.run for its exact name/version.wally-package-types --sourcemap sourcemap.json Packages/ - pesde (): newer manager for Roblox/Lune/Luau that can also depend on Wally packages.
pesde.toml - Commit /
wally.lock; don't commitpesde.lock.Packages/
- Wally(、
wally.toml→wally install;对于Packages/→realm = "server"):ServerPackages/Wally thunk 会丢失类型信息:安装后运行toml[dependencies] React = "jsdotlua/react@17.2.1" ReactRoblox = "jsdotlua/react-roblox@17.2.1" [server-dependencies] ProfileStore = "lm-loleris/profilestore@1.0.3"。 请在 wally.run 上查看每个包的准确名称和版本。wally-package-types --sourcemap sourcemap.json Packages/ - pesde():用于 Roblox/Lune/Luau 的较新包管理器,也可以依赖 Wally 包。
pesde.toml - 提交 /
wally.lock;不要提交pesde.lock。Packages/
Code quality
代码质量
- luau-lsp (editor + CLI) — type checking against Roblox definitions. CLI:
(definitions:
luau-lsp analyze --definitions=@roblox=globalTypes.d.luau --sourcemap=sourcemap.json --base-luaurc=.luaurc src/). Enable the new solver in the editor (https://raw.githubusercontent.com/JohnnyMorganz/luau-lsp/main/scripts/globalTypes.d.luau) to match Studio.luau-lsp.fflags.enableNewSolver - StyLua — formatter. :
stylua.toml,indent_type = "Tabs".column_width = 120.stylua --check src - selene — linter. :
selene.toml(generate/refresh withstd = "roblox").selene generate-roblox-std - darklua — code transforms (e.g. convert string requires, bundle) for publishing pipelines.
- — per-directory type-check mode and require aliases:
.luaurcRoblox resolves string requires relative to the DataModel (json{ "languageMode": "strict", "aliases": { "Shared": "src/shared", "Packages": "Packages" } },./,../,@self); custom@gamealiases need tooling (luau-lsp/darklua) that understands your mapping..luaurc
- luau-lsp(编辑器 + CLI)——根据 Roblox 定义执行类型检查。CLI:
(定义文件:
luau-lsp analyze --definitions=@roblox=globalTypes.d.luau --sourcemap=sourcemap.json --base-luaurc=.luaurc src/)。 在编辑器中启用新的 solver(https://raw.githubusercontent.com/JohnnyMorganz/luau-lsp/main/scripts/globalTypes.d.luau),以与 Studio 保持一致。luau-lsp.fflags.enableNewSolver - StyLua——格式化工具。:
stylua.toml、indent_type = "Tabs"。column_width = 120。stylua --check src - selene——静态检查器。:
selene.toml(可使用std = "roblox"生成或刷新)。selene generate-roblox-std - darklua——用于发布管线的代码转换工具(例如转换字符串形式的 require、bundle)。
- ——按目录配置类型检查模式和 require 别名:
.luaurcRoblox 会相对于 DataModel 解析字符串形式的 require(json{ "languageMode": "strict", "aliases": { "Shared": "src/shared", "Packages": "Packages" } }、./、../、@self);自定义@game别名需要 luau-lsp/darklua 等能够理解映射关系的工具。.luaurc
Lune
Lune
Standalone Luau runtime for scripts outside Roblox: build steps, place file manipulation
( reads/writes /), asset pipelines, running pure-Luau unit tests, calling
Open Cloud with . .
@lune/roblox.rbxl.rbxm@lune/netlune run scripts/build用于在 Roblox 之外运行脚本的独立 Luau runtime:构建步骤、place 文件操作
( 读取/写入 /)、资源管线、运行纯 Luau 单元测试,以及通过
调用 Open Cloud。。
@lune/roblox.rbxl.rbxm@lune/netlune run scripts/buildroblox-ts
roblox-ts
If the repo has , with and , write TypeScript:
compiles to , and Rojo syncs . Use ,
packages from npm. Don't hand-edit generated Luau.
tsconfig.jsonpackage.jsonroblox-ts@rbxts/typesnpx rbxtsc -wsrc/*.tsout/*.luauout/@rbxts/services@rbxts/*如果仓库包含 ,以及包含 和 的 ,则可编写 TypeScript:
会将 编译为 ,然后由 Rojo 同步 。使用 npm 上的
、 包。不要手动编辑生成的 Luau。
tsconfig.jsonroblox-ts@rbxts/typespackage.jsonnpx rbxtsc -wsrc/*.tsout/*.luauout/@rbxts/services@rbxts/*Git and CI
Git 和 CI
.gitignore*.rbxl.lock*.rbxlx.lockPackages/ServerPackages/sourcemap.json.gitignore*.rbxl.lock*.rbxlx.lockPackages/ServerPackages/sourcemap.jsonRelated skills
相关 skill
roblox-testingroblox-open-cloudroblox-studio-mcproblox-luauroblox-testingroblox-open-cloudroblox-studio-mcproblox-luau