Skip to content

Commit 06fef9d

Browse files
committed
Moved moonc_wasm to be a submodule as it is not published yet
1 parent 307e067 commit 06fef9d

File tree

8 files changed

+13
-21
lines changed

8 files changed

+13
-21
lines changed

Cargo.lock

Lines changed: 4 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ heck = "0.5.0"
2626
include_dir = "0.7.4"
2727
indoc = "2.0.6"
2828
lazy_static = "1.5.0"
29+
libc = "0.2.172"
2930
log = "0.4.27"
30-
moonc_wasm = { path = "moonc_wasm" }
3131
serde = { version = "1", features = ["derive"] }
3232
serde_json = "1"
3333
topologic = "1.1.0"
34+
v8 = "0.106.0"
3435
wit-bindgen-core = "0.43.0"
3536
wit-bindgen-moonbit = "0.43.0"
3637
wit-component = "0.235.0"

moonc_wasm/src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ pub fn run_wasmoo(argv: Vec<String>) -> anyhow::Result<()> {
2323
global_proxy.set(scope, ident.into(), process_argv.into());
2424

2525
let mut script = String::new();
26-
let js_glue = include_str!(concat!(
27-
env!("CARGO_MANIFEST_DIR"),
28-
"/src/moonc/js_glue_for_wasmoo.js"
29-
));
26+
let js_glue = include_str!("moonc/js_glue_for_wasmoo.js");
3027
script.push_str(js_glue);
3128
let code = v8::String::new(scope, &script).unwrap();
3229
let name = v8::String::new(scope, "moonc").unwrap();

moonc_wasm/src/wasmoo_extern.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,10 +1467,7 @@ fn load_wasm_file(
14671467
_args: v8::FunctionCallbackArguments,
14681468
mut ret: v8::ReturnValue,
14691469
) {
1470-
let contents = Vec::from(include_bytes!(concat!(
1471-
env!("CARGO_MANIFEST_DIR"),
1472-
"/src/moonc/moonc.wasm"
1473-
)));
1470+
let contents = Vec::from(include_bytes!("moonc/moonc.wasm"));
14741471
let len = contents.len();
14751472
let array_buffer = v8::ArrayBuffer::with_backing_store(
14761473
scope,

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ use topologic::AcyclicDependencyGraph;
1515
use wit_component::{ComponentEncoder, StringEncoding};
1616
use wit_parser::{PackageId, PackageName, Resolve, WorldId};
1717

18+
mod moonc_wasm;
19+
1820
/// An example generator that embeds and exports a script (arbitrary string) into a MoonBit component.
1921
#[cfg(feature = "get-script")]
2022
pub mod get_script;

src/moonc_wasm/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../moonc_wasm/src/lib.rs

src/moonc_wasm/moonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../moonc_wasm/src/moonc

src/moonc_wasm/wasmoo_extern.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../moonc_wasm/src/wasmoo_extern.rs

0 commit comments

Comments
 (0)