This version of the module is deprecated: Published under the wrong owner. Use lillian-dot/moonchsrc instead.
A MoonBit-native, preview-first source and registry switcher
curl -fsSL https://raw.githubusercontent.com/trail-it/moonchsrc/main/scripts/install.sh | shirm https://raw.githubusercontent.com/trail-it/moonchsrc/main/scripts/install.ps1 | iexmoon add trail-it/moonchsrcmoon run cmd/main -- list
moon run cmd/main -- list npm
moon run cmd/main -- set --dry-run npm npmmirror user
moon run cmd/main -- set --dry-run pip tuna project
moon run cmd/main -- get --dry-run node user
moon run cmd/main -- set --dry-run go goproxycn user
moon run cmd/main -- set --dry-run composer aliyun user
moon run cmd/main -- set --dry-run npm auto user
moon run cmd/main -- set --dry-run pip first project
moon run cmd/main -- set --dry-run cargo rsproxy user
moon run cmd/main -- set --dry-run moonbit ustc user
moon run cmd/main -- set --dry-run rubygems rubychina user
moon run cmd/main -- set npm npmmirror user
moon run cmd/main -- reset npm user
moon run cmd/main -- restore --dry-run npm user
moon run cmd/main -- restore npm user
moon run cmd/main -- measure npm///|
test "build a source-change plan" {
let plan = plan_change("npm", "npmmirror", scope=Project)
assert_eq(plan.target_id, "npm")
assert_eq(plan.scope, Project)
}pub(all) suberror PlanError {
UnknownTarget(String)
UnknownMirror(target~ : String, mirror~ : String)
InvalidScope(String)
UnsupportedScope(target~ : String, scope~ : Scope)
InvalidSnapshot(target~ : String, expected~ : Int, actual~ : Int)
SnapshotNotRestorable(String)
NoSelectableMirror(String)
ConfigConflict(path~ : String, detail~ : String)
UnsafeConfigValue(String)
} derive(Eq, Debug)pub(all) enum CliAction {
Show(String)
Execute(ChangePlan)
RestoreLatest(String, Scope, Bool)
MeasureTarget(String)
AutoSelect(String, Scope, Bool)
} derive(Eq, Debug)pub(all) enum FileOperation {
ReadCargoSource
SetCargoSource(String)
ResetCargoSource
RestoreContent(SavedValue)
ReadMooncakesSource
SetMooncakesSource(registry~ : String, index~ : String, symbols~ : String)
ResetMooncakesSource
} derive(Eq, Debug)fn capture_command_value(target_name : StringView, exit_code : Int, output : StringView) -> SavedValuefn plan_change(target_name : StringView, mirror_name : StringView, scope? : Scope) -> ChangePlan raise PlanErrorfn set_mooncakes_mirror_config(content : String, registry : String, index : String, symbols : String) -> String raise PlanErrorfn version() -> StringInstall
Download zipA MoonBit-native, preview-first source and registry switcher