Package manager for Roblox - supports Wally packages and private Git repositories
npm install yllawbash
npm install -g yllaw
`
使用
`bash
安装所有包(Wally + Git)
yllaw install
yllaw # install 是默认命令,可省略
只安装 Git 包,跳过 Wally
yllaw install -s
yllaw -s # 等同于 yllaw install -s
开发模式:从同级目录安装(用于本地开发测试)
yllaw install -d
yllaw -d -s # 等同于 yllaw install -d -s
强制更新所有 Git 包
yllaw update
指定配置文件
yllaw install --config my-wally.toml
指定输出目录
yllaw install --output Packages
`
> 提示: install 是默认命令,直接使用 yllaw -s -d 等同于 yllaw install -s -d
开发模式 (--dev)
当你在本地开发一个包,想要在另一个项目中测试时,使用 --dev 模式:
`
C:\Workspace\
├── my-game/ ← 当前项目
│ └── wally.toml ← MMS = "...mms-matchmaking.git@1.1.0"
└── mms-matchmaking/ ← 同级目录
└── MMS/
`
`bash
cd my-game
yllaw install -d -s
`
yllaw 会自动检测 mms-matchmaking 在同级目录存在,直接从本地复制,而不是从 Git 克隆。
这样你可以:
1. 修改 mms-matchmaking 中的代码
2. 运行 yllaw install -d -s 快速同步到测试项目
3. 无需提交、推送、更新版本号
配置
在项目根目录创建 wally.toml:
`toml
[package]
name = "your-scope/your-project"
version = "0.1.0"
realm = "shared"
[dependencies]
Wally 公共包
[server-dependencies]
Wally 服务端包
[git-dependencies]
私有 Git 包(共享)
CommonLib = "https://gitlab.example.com/group/common-lib.git@1.0.0"
[server-git-dependencies]
私有 Git 包(服务端)
MMS = "https://gitlab.example.com/group/mms.git@1.1.0"
`
Git 包格式
`
包名 = "仓库地址.git@版本"
`
| 部分 | 说明 | 示例 |
|------|------|------|
| 仓库地址 | HTTPS Git URL | https://gitlab.example.com/group/repo.git |
| 版本 | Git tag / 分支 / commit | 1.0.0, main, abc1234 |
创建私有包
你的 Git 仓库结构:
`
your-package/
├── README.md
├── wally.toml
└── YourModule/
├── init.luau ← 必须有入口文件
├── Foo.luau
└── Bar.luau
`
yllaw 会自动查找包含 init.luau 或 init.lua 的目录。
$3
`bash
git tag 1.0.0
git push origin 1.0.0
`
与 Wally 的关系
yllaw 补充 Wally,而不是替代:
- Wally 负责公共包和私有 Registry
- yllaw 负责私有 Git 仓库的包
运行 yllaw install 时:
1. 先运行 wally install
2. 再安装 [git-dependencies] 和 [server-git-dependencies]
命令
| 命令 | 说明 |
|------|------|
| yllaw install | 安装所有包 |
| yllaw install -s | 跳过 Wally,只安装 Git 包 |
| yllaw update | 强制重新安装所有 Git 包 |
选项
| 选项 | 说明 | 默认值 |
|------|------|--------|
| -s, --skip-wally | 跳过 Wally | false |
| -d, --dev | 开发模式:优先从同级目录安装 | false |
| -c, --config | 配置文件路径 | wally.toml |
| -o, --output | 输出目录 | Packages` |