Hutool-style utility library for MoonBit: all packages depend only on moonbitlang/core (no FFI, fully synchronous); the single exception is the `sched` package, which imports official `moonbitlang/async` for timer firing and therefore ships on three targets, not four
Dependencies
# moon.mod —— 本库的 import 段有且仅有下面这一条,它就是那条例外的全部形状
import { "moonbitlang/async@0.22.4" }本表里的仓内链接一律写成 GitHub 绝对地址:发布包根是模块目录,相对路径在 mooncakes 页面上是死链(这条由门禁 G10 盯着,索引不许漂成死链)。
| 读数(moon test --target wasm,当场跑) | 值 |
|---|---|
| 用例总数 | 1731 —— 绿 1731 / 红 0 |
| 包状态 | 共 23 个:已实现 23 · 实现中 0 · 契约已冻结 0 · 未开工 0 |
moon add mldong/moon-hutool/text
moon add mldong/moon-hutool/digest[deps]
"mldong/moon-hutool/text" = "0.1.0"
"mldong/moon-hutool/digest" = "0.1.0"版本号一律现读:moon.mod 里的 version 是当前待发布的代次,装哪一代请以注册表索引为准 ($MOON_HOME/registry/index/user/mldong/moon-hutool.index),别照抄本文档。发版通道见 .github/workflows/publish.yml, 版本变化记在 CHANGELOG.md。 包与包之间的依赖(typex→num/text/valid、cron→date、codec/id→digest、bloom→hash) 都在同一模块内,引用其中一个包即可自动带上其余。
// moon.pkg —— 只带需要的包
import {
"mldong/moon-hutool/text" @text,
"mldong/moon-hutool/digest" @digest,
}
fn demo() {
assert @text.is_blank(" \t ")
assert @text.format("id={} name={}", ["7"]) == "id=7 name={}" // 参数不足则原样留
assert @digest.md5_hex("abc") == "900150983cd24fb0d6963f7d28e17f72" // RFC 1321
}export MOON_HOME=<moon 工具链目录> # Git Bash 下用 /g/ 之类 POSIX 盘符写法
moon check --target wasm && moon test --target wasm
moon info && moon fmt # .mbti 是公开接口,diff 即 API 变更评审面
scripts/contract_gate.sh # G1~G19 十九条判据Install
Download zipHutool-style utility library for MoonBit: all packages depend only on moonbitlang/core (no FFI, fully synchronous); the single exception is the `sched` package, which imports official `moonbitlang/async` for timer firing and therefore ships on three targets, not four
Dependencies