A cargo audit for the MoonBit ecosystem — read moon.mod, walk the entire transitive dependency graph, and give each package a 0–100 health score with actionable diagnostics.
TL;DR — One command to know whether your dependencies are fresh, license-compliant, deprecated-free, reasonably-sized, and actively maintained.
Quick Start (30 seconds)
# 1. Clone this repo
git clone https://github.com/Tino-hue/moonmark.git
cd moonmark
# 2. Build the JS bundle (one-time, ~10s)
moon build --target js
# 3. Audit the included healthy example (run from project root)
node _build/js/debug/build/depsight.js audit --target-pkg examples/healthy_project
You’ll see terminal output like Health Score: 94/100 plus a 5-dimension breakdown (freshness / compliance / size / deprecated / activity). Exit code 0 = pass.
To audit your own project:
cd /path/to/your-project # a directory containing moon.mod
node /path/to/depsight.js audit # or use --target-pkg /path/to/your-project from this repo
Overview
MoonBit Depsight analyzes your moon.mod and recursively inspects the entire transitive dependency tree to surface risks before they become problems.
Features
Dependency Resolution & Visualization
Dependency Tree: Recursive resolution of transitive dependencies with ASCII tree rendering (depsight tree)
Cycle Detection: DFS-based circular dependency detection with structured diagnostics (CYCLE-001)
Topological Sort: Kahn’s algorithm for dependency ordering
git clone https://github.com/Tino-hue/moonmark.git
cd moonmark
moon build --target js
The executable is emitted at _build/js/debug/build/depsight.js (~466 KB single-file bundle).
作为 MoonBit 包依赖
moon add Tino-hue/depsight
Usage
All commands below assume you ran cd moonmark && moon build --target js first, and your working directory is the project root (otherwise the relative _build/... path won’t resolve). For an absolute path you can run node /anywhere/_build/js/debug/build/depsight.js audit directly.
Tested against MoonBit toolchain moon 0.1.20260713 + moonc v0.10.4+2cc641edf (2026-07). All 267 tests pass and moon check --deny-warn is clean. We follow MoonBit’s rolling latest channel; older versions may work but aren’t part of the CI matrix.
License
Apache-2.0
Reproducible Builds
MoonBit Depsight does not use a traditional dependency lock file. To ensure reproducible builds:
The CI pipeline pins MOONBIT_INSTALL_VERSION=latest (see .github/workflows/)
The local package cache is stored in .mooncakes/ (gitignored)
Run moon update to refresh the local cache to the latest registry state
To match the CI environment exactly, install the same MoonBit CLI version via the Chinese mirror:
MoonBit Depsight
A
cargo auditfor the MoonBit ecosystem — readmoon.mod, walk the entire transitive dependency graph, and give each package a 0–100 health score with actionable diagnostics.TL;DR — One command to know whether your dependencies are fresh, license-compliant, deprecated-free, reasonably-sized, and actively maintained.
Quick Start (30 seconds)
You’ll see terminal output like
Health Score: 94/100plus a 5-dimension breakdown (freshness / compliance / size / deprecated / activity). Exit code 0 = pass.To audit your own project:
Overview
MoonBit Depsight analyzes your
moon.modand recursively inspects the entire transitive dependency tree to surface risks before they become problems.Features
Dependency Resolution & Visualization
depsight tree)CYCLE-001)Diagnostic Engine
^,~,~>,>=,>,<=,<,=, bare version)@deprecatedannotations from doc comments onfn/let/const/struct/enum/trait.depsight.toml [scoring]sectionReport Output
depsight audit): Color-coded audit output grouped by Critical/Warning/Info, similar tonpm auditdepsight report --html): Interactive single-file report with collapsible dependency tree, dashboard, and diagnosticsdepsight audit --json): Structured data for CI/CD integrationdepsight audit --sarif): Standard v2.1.0 format for GitHub Code Scanningdepsight audit --markdown): GitHub README / PR compatible formatdepsight tree): ASCII tree with--depthcontrol and inline diagnostic badgesCI/CD Integration
--fail-on-score <n>: Exit with error when health score is below threshold--fail-on-critical: Exit with error when critical issues found--baseline auto: Diff against previous run (auto-saved to.depsight-baseline.json)--offline: Use local cache only--cache-dir <path>: Specify cache directory--quiet: Suppress non-essential output (CI-friendly)Quick Commands
depsight outdated: Check for outdated dependencies with breaking change detectiondepsight why <package>: Trace who depends on a specific packagedepsight check: One-line health check output (PASS/WARN/FAIL) for CI pipelinesConfiguration (
.depsight.toml)ignore: Comma-separated list of diagnostic codes to suppress[severity]: Override default diagnostic levels per code (e.g.LICENSE-001 = "warning")baseline = "auto": Enable automatic baseline comparison by defaultPrerequisites
latest(≥ 0.1.20260713)国内用户 / CI in China — use the Chinese mirror to avoid 403 from the international CDN:
Installation
从源码构建
The executable is emitted at
_build/js/debug/build/depsight.js(~466 KB single-file bundle).作为 MoonBit 包依赖
Usage
命令概览
CI 集成
GitHub Actions 示例
Performance
Tested on Windows 11, Node.js v22.x, MoonBit JS debug mode
For detailed usage guide, see docs/USAGE.md.
For detailed benchmark methodology and bottleneck analysis, see docs/benchmark.md.
Development
Examples
The repo ships three pre-canned example projects covering typical scenarios:
Each example ships its own
moon.mod(and.depsight-baseline.json), so the audit command resolves locally with no network access.Project Structure
For detailed architecture design, see docs/architecture.md.
Compatibility
Tested against MoonBit toolchain
moon 0.1.20260713+moonc v0.10.4+2cc641edf(2026-07). All 267 tests pass andmoon check --deny-warnis clean. We follow MoonBit’s rollinglatestchannel; older versions may work but aren’t part of the CI matrix.License
Apache-2.0
Reproducible Builds
MoonBit Depsight does not use a traditional dependency lock file. To ensure reproducible builds:
MOONBIT_INSTALL_VERSION=latest(see.github/workflows/).mooncakes/(gitignored)moon updateto refresh the local cache to the latest registry stateTo match the CI environment exactly, install the same MoonBit CLI version via the Chinese mirror: