Skip to content

RedTTGMoss/moos-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moos-sdk

runs_on License: GPL v3

A sdk to build moss extensions easily with moonbit

Getting Started

  1. Create a new project with moon new
  2. Add moos as dependency moon add furesoft/moos-sdk
  3. Create those functions
pub fn moss_extension_register() -> Int {
  let extensionInfo: @moss.ExtensionInfo = {
    files: []
  }

  @host.output_json_value(extensionInfo.to_json())
  0
}

pub fn moss_extension_loop() -> Int {
  0
}

pub fn moss_extension_unregister() -> Int {
  0
}
  1. import the moos-sdk and export those functions in the moon.pkg.json
{
  "import": [
    "gmlewis/moonbit-pdk/pdk",
    "gmlewis/moonbit-pdk/pdk/host",
    {"path": "furesoft/moos-sdk/lib", "alias": "moss"}
  ],
  "link": {
    "wasm": {
      "exports": [
        "moss_extension_register",
        "moss_extension_unregister",
        "moss_extension_loop"
      ],
      "export-memory-name": "memory"
    }
  }
}
  1. Build it with moon build --target wasm

About

A moos sdk for developing plugins with moonbit

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •