Skip to content

Commit f95e735

Browse files
committed
feat: Update WASM build, add wasm-bindgen-futures, and regenerate package files.
1 parent a681775 commit f95e735

File tree

7 files changed

+64
-93
lines changed

7 files changed

+64
-93
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
[package]
2-
authors = ["zuisong <378818573@qq.com>"]
3-
default-run = "chen_lang"
4-
edition = "2024"
52
name = "chen_lang"
63
version = "0.1.0"
7-
description = "A tiny programming language written in rust"
4+
edition = "2024"
85
rust-version = "1.90"
9-
10-
[package.metadata.wasm-pack.profile.release]
11-
wasm-opt = false
6+
description = "A tiny programming language written in rust"
7+
default-run = "chen_lang"
128

139
[lib]
1410
crate-type = ["cdylib", "rlib"]
1511

1612
[features]
1713
binaries = ["dep:clap", "dep:clap_complete", "dep:tracing-subscriber"]
18-
wasm = ["dep:wasm-bindgen"]
14+
wasm = ["dep:wasm-bindgen", "dep:wasm-bindgen-futures"]
1915
pest-parser = ["dep:pest", "dep:pest_derive"]
2016
http = ["dep:reqwest"] # HTTP 客户端(支持 WASM)
21-
default = ["binaries", "wasm", "winnow-tokenizer", "http"]
2217
winnow-tokenizer = ["dep:winnow"]
23-
24-
18+
default = ["binaries", "wasm", "winnow-tokenizer", "http"]
2519

2620
[dependencies]
2721
thiserror = "2"
28-
winnow = { version = "0.7",optional = true }
22+
winnow = { version = "0.7", optional = true }
2923
tracing = { version = "0.1" }
3024
tracing-subscriber = { version = "0.3", optional = true }
3125
wasm-bindgen = { version = "0.2", optional = true }
26+
wasm-bindgen-futures = { version = "0.4", optional = true }
3227
clap = { version = "4", optional = true, default-features = false, features = ["derive", "help", "suggestions"] }
3328
clap_complete = { version = "4", optional = true }
3429
pest = { version = "2.8.4", optional = true }
@@ -38,26 +33,17 @@ jiff = { version = "0.2", features = ["js"] }
3833
serde = { version = "1.0", features = ["derive"] }
3934
serde_json = "1.0"
4035
anyhow = { version = "1.0.100" }
41-
codespan-reporting = { version = "0.13.1",default-features = false , features = ["std"]}
36+
codespan-reporting = { version = "0.13.1", default-features = false, features = ["std"] }
4237
rust_decimal = { version = "1.39.0", features = ["serde-float", "macros"] }
43-
tokio = { version = "1.48.0", default-features = false, features = ["sync", "macros", "rt", "time", "io-util"] }
44-
reqwest = { version = "0.13", features = ["json"], optional = true }
45-
46-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
47-
tokio = { version = "1.48.0", features = ["full"] }
48-
49-
[target.'cfg(target_arch = "wasm32")'.dependencies]
5038
reqwest = { version = "0.13", features = ["json"], optional = true }
51-
wasm-bindgen-futures = "0.4"
52-
getrandom = { version = "0.2", features = ["js"] }
39+
tokio = { version = "1.48.0", default-features = false, features = ["sync", "macros", "rt", "time", "io-util"] }
5340

5441
[dev-dependencies]
42+
pretty_assertions = { version = "1", features = ["unstable"] }
5543
assert_cmd = "2"
5644
mockito = "1.7.1"
57-
pretty_assertions = { version = "1", features = ["unstable"] }
5845
tempfile = "3"
5946

60-
6147
#[profile.release]
6248
#strip = true # Automatically strip symbols from the binary.
6349
#opt-level = "z" # Optimize for size.

docs/pkg/chen_lang.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ export interface InitOutput {
99
readonly memory: WebAssembly.Memory;
1010
readonly run: (a: number, b: number) => void;
1111
readonly run_wasm: (a: number, b: number) => any;
12-
readonly wasm_bindgen_3453c9d0e447211b___convert__closures_____invoke___wasm_bindgen_3453c9d0e447211b___JsValue_____: (a: number, b: number, c: any) => void;
13-
readonly wasm_bindgen_3453c9d0e447211b___closure__destroy___dyn_core_1ea7ec8b69c1cd75___ops__function__FnMut__wasm_bindgen_3453c9d0e447211b___JsValue____Output_______: (a: number, b: number) => void;
14-
readonly wasm_bindgen_3453c9d0e447211b___convert__closures_____invoke______: (a: number, b: number) => void;
15-
readonly wasm_bindgen_3453c9d0e447211b___closure__destroy___dyn_core_1ea7ec8b69c1cd75___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
16-
readonly wasm_bindgen_3453c9d0e447211b___convert__closures_____invoke___wasm_bindgen_3453c9d0e447211b___JsValue__wasm_bindgen_3453c9d0e447211b___JsValue_____: (a: number, b: number, c: any, d: any) => void;
12+
readonly wasm_bindgen_fe44445030365f0d___convert__closures_____invoke______: (a: number, b: number) => void;
13+
readonly wasm_bindgen_fe44445030365f0d___closure__destroy___dyn_core_1ea7ec8b69c1cd75___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
14+
readonly wasm_bindgen_fe44445030365f0d___convert__closures_____invoke___wasm_bindgen_fe44445030365f0d___JsValue_____: (a: number, b: number, c: any) => void;
15+
readonly wasm_bindgen_fe44445030365f0d___closure__destroy___dyn_core_1ea7ec8b69c1cd75___ops__function__FnMut__wasm_bindgen_fe44445030365f0d___JsValue____Output_______: (a: number, b: number) => void;
16+
readonly wasm_bindgen_fe44445030365f0d___convert__closures_____invoke___wasm_bindgen_fe44445030365f0d___JsValue__wasm_bindgen_fe44445030365f0d___JsValue_____: (a: number, b: number, c: any, d: any) => void;
1717
readonly __wbindgen_malloc: (a: number, b: number) => number;
1818
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
1919
readonly __wbindgen_exn_store: (a: number) => void;

0 commit comments

Comments
 (0)