MoonBit dependency health analysis engine — WASM API for browser/Node.js
| Export | Signature | Description |
|---|---|---|
| analyze_from_context_json | (String) -> String | Full transitive analysis from a complete context; returns JSON |
| analyze_from_mod_text | (String) -> String | Shallow analysis of a single moon.mod; does not expand dependencies |
| version | () -> String | ABI contract version, currently "0.8.0-wasm" |
const { instance } = await WebAssembly.instantiateStreaming(
fetch("./depsight.wasm"),
{},
{ builtins: ["js-string"], importedStringConstants: "_" },
);
const resultJson = instance.exports.analyze_from_context_json(contextJson);
const result = JSON.parse(resultJson);
console.log(result.overall_score, result.diagnostics);{
"root": "<moon.mod.json or moon.mod TOML text>",
"modules": { "<name@version>": "<moon.mod.json text>" },
"metadata": {
"<name@version>": {
"license": "MIT",
"latest_version": "1.2.3",
"last_commit_days_ago": 45,
"self_size": 12345,
"total_api_count": 256,
"deprecated_apis": ["api1"],
"yanked": false,
"yanked_reason": null,
"source_unavailable": false
}
},
"options": { "max_depth": 10 }
}moon add Tino-hue/depsight-wasm-apilet v = @main.version()
let json = @main.analyze_from_mod_text(mod_text)moon build --target wasm-gc --release
# artifact: _build/wasm-gc/release/build/main/main.wasmmoon test # 47 testsInstall
Download zipMoonBit dependency health analysis engine — WASM API for browser/Node.js