File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 30
30
override : true
31
31
- name : Install moonbit
32
32
run : |
33
- curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
33
+ curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s -- 0.6.19
34
34
echo "$HOME/.moon/bin" >> $GITHUB_PATH
35
35
- name : Bundle core MoonBit library
36
36
run : moon bundle --target wasm
60
60
override : true
61
61
- name : Install moonbit
62
62
run : |
63
- curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
63
+ curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s -- 0.6.19
64
64
echo "$HOME/.moon/bin" >> $GITHUB_PATH
65
65
- name : Bundle core MoonBit library
66
66
run : moon bundle --target wasm
90
90
override : true
91
91
- name : Install moonbit
92
92
run : |
93
- curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
93
+ curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s -- 0.6.19
94
94
echo "$HOME/.moon/bin" >> $GITHUB_PATH
95
95
- name : Bundle core MoonBit library
96
96
run : moon bundle --target wasm
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ Some example use cases are exposed by crate features:
16
16
The crate implements the general machinery for generating WASM components from MoonBit source, and it also exports a few example use cases:
17
17
18
18
### "Get Script" component
19
- The simplest example generates a WASM component that exports a single function ` get-script ` which returns a string.
20
- This can be used to attach dynamic content to a statically compiled WASM component via composition,
21
- for example providing user-defined JavaScript code to a precompiled WASM JavaScript engine.
19
+ The simplest example generates a WASM component that exports a single function ` get-script ` which returns a string.
20
+ This can be used to attach dynamic content to a statically compiled WASM component via composition,
21
+ for example providing user-defined JavaScript code to a precompiled WASM JavaScript engine.
22
22
23
23
To use this generator, just provide the script contents and the target WASM path:
24
24
@@ -72,7 +72,10 @@ fn main() {
72
72
73
73
To update and build the MoonBit core library:
74
74
75
+ ** NOTE** : requires the 0.6.19 version of MoonBit currently
76
+
75
77
```
78
+ curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s -- 0.6.19
76
79
git submodule update --recursive
77
80
moon bundle --target wasm
78
81
```
Original file line number Diff line number Diff line change 1
- use anyhow:: anyhow;
1
+ use anyhow:: { Context , anyhow} ;
2
2
use camino:: { Utf8Path , Utf8PathBuf } ;
3
3
use camino_tempfile:: Utf8TempDir ;
4
4
use heck:: { ToLowerCamelCase , ToSnakeCase } ;
@@ -608,7 +608,9 @@ impl MoonBitComponent {
608
608
let resolve = self . resolve . as_ref ( ) . unwrap ( ) ;
609
609
let world = & self . world_id . unwrap ( ) ;
610
610
611
- let mut wasm = std:: fs:: read ( self . module_wasm ( ) ) ?;
611
+ let module_wasm = self . module_wasm ( ) ;
612
+ let mut wasm = std:: fs:: read ( & module_wasm)
613
+ . context ( format ! ( "Failed to read module WASM from {module_wasm}" ) ) ?;
612
614
613
615
wit_component:: embed_component_metadata ( & mut wasm, resolve, * world, StringEncoding :: UTF16 ) ?;
614
616
You can’t perform that action at this time.
0 commit comments