M0: WIT package, MoonBit components, JS host, docs, CI (#1)
CI / test (push) Successful in 19s

This commit was merged in pull request #1.
This commit is contained in:
nandi committed 2026-11-24 23:51:26 +00:00
1 parent e5548fc067
commit 880ecd4102
141 files changed
+9681 -1

No files matched your search

@@ -0,0 +1,2 @@
Host-brokered capabilities. A component can only call what its world
imports AND what the host grants it in the desktop manifest.
@@ -0,0 +1,24 @@
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
fn wasmImportNow(p0 : Int) = "moonplasma:desktop/clock@0.1.0" "now"
///|
extern "wasm" fn mbt_ffi_free(position : Int) =
#|(func (param i32) local.get 0 call $moonbit.decref)
///|
extern "wasm" fn mbt_ffi_load8_u(offset : Int) -> Int =
#|(func (param i32) (result i32) local.get 0 i32.load8_u)
///|
extern "wasm" fn mbt_ffi_malloc(size : Int) -> Int =
#|(func (param i32) (result i32) (local i32)
#| local.get 0 i32.const 4 i32.add call $moonbit.gc.malloc
#| local.tee 1 i32.const 0 call $moonbit.init_array8
#| local.get 1)
///|
extern "wasm" fn mbt_ffi_load32(offset : Int) -> Int =
#|(func (param i32) (result i32) local.get 0 i32.load)
@@ -0,0 +1,5 @@
import {
"moonplasma/desktop/interface/moonplasma/desktop/types" @types,
}
warnings = "-44"
@@ -0,0 +1,17 @@
// Generated using `moon info`, DON'T EDIT IT
package "moonplasma/desktop/interface/moonplasma/desktop/clock"
import {
"moonplasma/desktop/interface/moonplasma/desktop/types",
}
// Values
pub fn now() -> @types.Datetime
// Errors
// Types and methods
// Type aliases
// Traits
@@ -0,0 +1,13 @@
// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT!
///|
/// Local wall-clock time (the host owns the time zone).
pub fn now() -> @types.Datetime {
let return_area = mbt_ffi_malloc(12)
wasmImportNow(return_area);
let ret = @types.Datetime::{year : (mbt_ffi_load32((return_area) + 0)).reinterpret_as_uint(), month : (mbt_ffi_load8_u((return_area) + 4)).to_byte(), day : (mbt_ffi_load8_u((return_area) + 5)).to_byte(), hour : (mbt_ffi_load8_u((return_area) + 6)).to_byte(), minute : (mbt_ffi_load8_u((return_area) + 7)).to_byte(), second : (mbt_ffi_load8_u((return_area) + 8)).to_byte(), weekday : (mbt_ffi_load8_u((return_area) + 9)).to_byte()}
mbt_ffi_free(return_area)
return ret
}