7 个不稳定版本
0.3.2 | 2023年6月5日 |
---|---|
0.3.1 | 2021年11月12日 |
0.2.1 | 2021年10月1日 |
0.1.0 | 2021年8月3日 |
0.0.0 | 2020年10月7日 |
100 在 游戏 中排名
每月 下载量 65
365KB
5K SLoC
包含 (WOFF 字体,20KB) iosevka-extendedheavyoblique.woff2,(WOFF 字体,19KB) iosevka-extended.woff2,(WOFF 字体,19KB) iosevka-extendedbold.woff2,(WOFF 字体,20KB) iosevka-extendedboldoblique.woff2,(WOFF 字体,19KB) iosevka-extendedheavy.woff2,(WOFF 字体,19KB) iosevka-extendedlight.woff2 等 更多。
Wally,Roblox 的包管理器
关于
Wally 是一个受 Cargo (Rust) 和 npm (JavaScript) 启发的 Roblox 包管理器。它将来自其他社区的代码共享的熟悉、社区导向的世界引入 Roblox 生态系统。
Wally 由两个部分组成,它们协同工作:一个名为 wally
的命令行工具和一个托管包的注册表服务器。大多数用户将仅与命令行工具交互,但这两个工具都包含在这个存储库中。
安装
从 GitHub
可以从 Wally 的 GitHub 发布页面 获取 Windows、macOS 和 Linux 的预构建二进制文件。
使用 Foreman
Foreman 是为 Roblox 社区开发的工具链管理器。您可以使用它来安装 Wally。
wally = { source = "UpliftGames/wally", version = "0.3.2" }
从源代码
从源代码编译 Wally 非常简单。Wally 需要 Rust 1.51.0 或更高版本。
克隆存储库并使用
cargo install --locked --path .
命令
wally init
创建一个新的空包。
与
cargoinit
npm init
wally install[--锁定]
安装所有包。
--locked
与 cargo XXX --locked
匹配,如果没有最新的锁定文件将产生错误。旨在在 CI 机器上使用。(锁定是一个计划中的功能,尚未实现)
与
npm install
不带参数
wally update [package-names]
(未实现)
递归更新包。默认情况下,将更新所有包。如果提供了包名(形式为 作用域//名称
或 作用域//名称@版本-要求
),则只更新这些包。
与
cargo发布
npm update
(npm 7+,相当于 npm 6.x 及更早版本中的--depth 9999
)
wally publish
发布当前包。
与
cargo发布
npm publish
wally login
登录账户以向注册表发布包。
您也可以通过 wally login --token "$WALLY_AUTH_TOKEN"
直接提供令牌。
与
cargo登录
npm login
wally logout
从注册表账户注销。
与
cargo注销
npm logout
wally package[--list] --output<path>
将当前项目打包为适用于上传到包注册表的 zip 文件。对于向注册表添加条目和调试最终将上传到 blob 中的内容非常有用。--list
将输出将包含哪些文件,而不是创建 zip 文件。
与
cargopackage
wally manifest-to-json
以 JSON 行的形式打印当前项目的清单。用于向包索引添加条目。
与
cargoread-manifest
wally search<query>
在注册表中搜索可用的包。
先前的技术
Wally 希望站在巨人的肩膀上。我们做出的决策部分是基于查看其他包管理器和公共文档。
- 所以你想要编写一个包管理器
- crates.io 和 Cargo 来自 Rust 生态系统
- npm 来自 JavaScript 生态系统
- PyPI、pip、pipenv 和 Poetry 来自 Python
清单格式
包清单文件描述了一个包及其所有依赖项。包清单以 TOML 编写,并存储在名为 wally.toml
的文件中。
清单文件由人类编写。它们可以包含注释和格式化决策,这些决策难以通过自动编辑工具保留。这应该没问题——编辑包清单应该是容易的。
清单文件定义了有关包的所有必要信息。
以下是一个示例包清单,带注释
[package]
# Package names are always "SCOPE/NAME"
# They can include lowercase letters, numbers, and dashes.
name = "lpghatguy/asink"
# Descriptions are free-form. These will be used as part of package listings
# and search results.
description = "Asynchronous programming primitives"
# Versions follow Semantic Versioning.
# https://semver.org/
version = "2.0.7"
# Contains an SPDX License Expression.
# Licenses are required for publishing code to public registries.
license = "MIT OR Apache-2.0"
# The author list is a free-form list, but conventionally contains names and
# email addresses.
authors = ["Lucien Greathouse <[email protected]>"]
# Packages belong to a "realm", which helps prevent using code in the wrong
# context. For now, we have "server" and "shared" realms.
# The server realm should only be used for packages which shouldn't be replicated.
realm = "shared"
# Wally supports multiple registries.
# This feature can be used to have split public/private registries to
# keep internal code private and isolated.
registry = "https://github.com/upliftgames/wally-index"
# You can also specify files to include or exclude from the package
# By default gitignore files are respected and Wally won't include hidden
# files/directories or packages downloaded by Wally.
# include = []
exclude = ["node_modules"]
# Packages can be marked as private to prevent them from being published.
private = true
[dependencies]
# Most dependencies will look like this.
#
# The name on the left is an alias. It defines what name we would like to
# use to refer to this package.
#
# The value on the right will usually be a string of the form
# "SCOPE/NAME@VERSION_REQ"
# Versions are SemVer version requirements. The default behavior matches
# Cargo, or npm with the `^` version specifier.
Roact = "roblox/[email protected]"
Promise = "evaera/[email protected]"
[server-dependencies]
# Dependencies in the server realm can be required here as shown above.
# These are dependencies which should only ever exist on the server.
[dev-dependencies]
# Dev dependencies can be server or shared but are only needed during development.
TestEZ = "roblox/[email protected]"
锁定文件格式
锁定文件包含项目依赖的每个依赖的确切版本。它们是一个关键特性,确保所有参与游戏开发的人都获得每个包的确切版本。
锁定文件以 TOML 编写,并存储在名为 wally.lock
的文件中。它们是可读的,但仅由工具编写。我们对锁定文件格式进行了优化,以便于阅读和比较,以便尽可能容易地进行审查。
[[package]]
name = "registry:lpghatguy/asink"
version = "2.0.7"
dependencies = [
"registry:roblox/roact",
"registry:evaera/roblox-lua-promise",
"registry:roblox/mono-thing",
"git:https://github.com/Roblox/cool-thing.git",
]
[[package]]
name = "registry:evaera/roblox-lua-promise"
version = "2.1.0"
checksum = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
[[package]]
name = "registry:roblox/mono-thing"
version = "1.3.2"
checksum = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
[[package]]
name = "git:https://github.com/Roblox/cool-thing.git"
rev = "foo"
commit = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
注册表
像许多编程语言包管理器一样,Wally 包被发布到注册表中。
Wally 注册表由两部分组成,灵感来自 Cargo 和 crates.io
- 包含包索引的 Git 仓库
- 处理包内容下载和发布的注册表 API
官方 Wally 注册表可在 https://github.com/upliftgames/wally-index 上找到。
注册表API
- GET
/v1/package-contents/<scope>/<name>/<version>
- 返回安装包的内容
- 包内容是ZIP文件
- GET
/v1/package-metadata/<scope>/<name>
- 返回包的元数据
- GET
/v1/package-search?query=phrase
- 查询此注册表上可用的包
- POST
/api/v1/publish
- 客户端将发布一个从服务器提取并发布的包tar包。
许可证
Wally在Mozilla公共许可证第2.0版下可用。条款和条件可在LICENSE.txt中找到或访问https://www.mozilla.org/en-US/MPL/2.0/。
依赖项
~29–45MB
~817K SLoC