Skip to content

Commit 621f0ed

Browse files
authored
Leverage Cargo's workspace inheritance feature (#340)
Try to reduce the number of places versions are mentioned and encourage shared dependencies between crates.
1 parent 6d3913d commit 621f0ed

File tree

20 files changed

+144
-112
lines changed

20 files changed

+144
-112
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "wit-bindgen-cli"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[workspace]
88
members = [
@@ -12,12 +12,44 @@ members = [
1212
]
1313
resolver = "2"
1414

15+
[workspace.package]
16+
edition = "2021"
17+
version = "0.2.0"
18+
19+
[workspace.dependencies]
20+
anyhow = "1.0.65"
21+
bitflags = "1.3.2"
22+
heck = "0.3"
23+
structopt = { version = "0.3", default-features = false }
24+
pulldown-cmark = { version = "0.8", default-features = false }
25+
clap = { version = "3.2.22", features = ["derive"] }
26+
27+
wasmtime = "1.0"
28+
wasmtime-wasi = "1.0"
29+
wasmprinter = "0.2.40"
30+
wasmparser = "0.91.0"
31+
wasm-encoder = "0.17.0"
32+
wat = "1.0.49"
33+
34+
wit-bindgen-core = { path = 'crates/bindgen-core', version = '0.2.0' }
35+
wit-bindgen-gen-guest-c = { path = 'crates/gen-guest-c', version = '0.2.0' }
36+
wit-bindgen-gen-guest-rust = { path = "crates/gen-guest-rust", version = "0.2.0" }
37+
wit-bindgen-gen-guest-teavm-java = { path = 'crates/gen-guest-teavm-java', version = '0.2.0' }
38+
wit-bindgen-gen-host-js = { path = 'crates/gen-host-js', version = '0.2.0' }
39+
wit-bindgen-gen-host-wasmtime-py = { path = 'crates/gen-host-wasmtime-py', version = '0.2.0' }
40+
wit-bindgen-gen-host-wasmtime-rust = { path = 'crates/gen-host-wasmtime-rust', version = '0.2.0' }
41+
wit-bindgen-gen-markdown = { path = 'crates/gen-markdown', version = '0.2.0' }
42+
wit-bindgen-gen-rust-lib = { path = 'crates/gen-rust-lib', version = '0.2.0' }
43+
wit-bindgen-guest-rust = { path = 'crates/guest-rust', version = '0.2.0' }
44+
wit-bindgen-host-wasmtime-rust = { path = 'crates/host-wasmtime-rust', version = '0.2.0' }
45+
wit-parser = { path = 'crates/wit-parser', version = '0.2.0' }
46+
1547
[[bin]]
1648
name = "wit-bindgen"
1749
test = false
1850

1951
[dependencies]
20-
anyhow = "1.0"
52+
anyhow = { workspace = true }
2153
structopt = { version = "0.3", default-features = false }
2254
wit-bindgen-core = { path = 'crates/bindgen-core' }
2355
wit-bindgen-gen-guest-rust = { path = 'crates/gen-guest-rust', features = ['structopt'] }

crates/bindgen-core/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "wit-bindgen-core"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[lib]
88
doctest = false
99

1010
[dependencies]
11-
wit-parser = { path = '../wit-parser' }
12-
anyhow = "1"
11+
wit-parser = { workspace = true }
12+
anyhow = { workspace = true }

crates/gen-guest-c/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[package]
22
name = "wit-bindgen-gen-guest-c"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[lib]
88
doctest = false
99
test = false
1010

1111
[dependencies]
12-
wit-bindgen-core = { path = '../bindgen-core', version = '0.2.0' }
13-
heck = "0.3"
14-
structopt = { version = "0.3", default-features = false, optional = true }
12+
wit-bindgen-core = { workspace = true }
13+
heck = { workspace = true }
14+
structopt = { workspace = true, optional = true }
1515

1616
[dev-dependencies]
1717
test-helpers = { path = '../test-helpers', features = ['guest-c'] }

crates/gen-guest-rust/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[package]
22
name = "wit-bindgen-gen-guest-rust"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[lib]
88
test = false
99
doctest = false
1010

1111
[dependencies]
12-
wit-bindgen-core = { path = '../bindgen-core', version = '0.2.0' }
13-
wit-bindgen-gen-rust-lib = { path = '../gen-rust-lib', version = '0.2.0' }
14-
heck = "0.3"
15-
structopt = { version = "0.3", default-features = false, optional = true }
12+
wit-bindgen-core = { workspace = true }
13+
wit-bindgen-gen-rust-lib = { workspace = true }
14+
heck = { workspace = true }
15+
structopt = { workspace = true, optional = true }
1616

1717
[dev-dependencies]
1818
wit-bindgen-guest-rust = { path = '../guest-rust' }
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "wit-bindgen-gen-guest-teavm-java"
3-
version = "0.1.0"
4-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
55

66
[dependencies]
7-
wit-bindgen-core = { path = '../bindgen-core', version = '0.2.0' }
8-
heck = { version = "0.4.0", features = [ "unicode" ] }
9-
structopt = { version = "0.3", default-features = false, optional = true }
7+
wit-bindgen-core = { workspace = true }
8+
heck = { version = "0.4", features = [ "unicode" ] }
9+
structopt = { workspace = true, optional = true }
1010

1111
[dev-dependencies]
1212
test-helpers = { path = '../test-helpers', default-features = false, features = ['guest-teavm-java'] }

crates/gen-host-js/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[package]
22
name = "wit-bindgen-gen-host-js"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[lib]
88
doctest = false
99
test = false
1010

1111
[dependencies]
12-
wit-bindgen-core = { path = '../bindgen-core', version = '0.2.0' }
13-
heck = "0.3"
14-
structopt = { version = "0.3", default-features = false, optional = true }
12+
wit-bindgen-core = { workspace = true }
13+
heck = { workspace = true }
14+
structopt = { workspace = true, optional = true }
1515

1616
[dev-dependencies]
1717
test-helpers = { path = '../test-helpers', features = ['host-js'] }
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "wit-bindgen-gen-host-wasmtime-py"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[dependencies]
8-
wit-bindgen-core = { path = '../bindgen-core', version = '0.2.0' }
9-
heck = "0.3"
10-
structopt = { version = "0.3", default-features = false, optional = true }
8+
wit-bindgen-core = { workspace = true }
9+
heck = { workspace = true }
10+
structopt = { workspace = true, optional = true }
1111

1212
[dev-dependencies]
1313
test-helpers = { path = '../test-helpers', features = ['host-wasmtime-py'] }
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[package]
22
name = "wit-bindgen-gen-host-wasmtime-rust"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[lib]
88
test = false
99
doctest = false
1010

1111
[dependencies]
12-
wit-bindgen-core = { path = '../bindgen-core', version = '0.2.0' }
13-
wit-bindgen-gen-rust-lib = { path = '../gen-rust-lib', version = '0.2.0' }
14-
heck = "0.3"
15-
structopt = { version = "0.3", default-features = false, optional = true }
12+
wit-bindgen-core = { workspace = true }
13+
wit-bindgen-gen-rust-lib = { workspace = true }
14+
heck = { workspace = true }
15+
structopt = { workspace = true, optional = true }
1616

1717
[dev-dependencies]
18-
anyhow = "1.0"
18+
anyhow = { workspace = true }
1919
test-helpers = { path = '../test-helpers', features = ['host-wasmtime-rust'] }
20-
wasmtime = "1.0"
21-
wasmtime-wasi = "1.0"
22-
wit-bindgen-host-wasmtime-rust = { path = '../host-wasmtime-rust', features = ['tracing', 'async'] }
20+
wasmtime = { workspace = true }
21+
wasmtime-wasi = { workspace = true }
22+
wit-bindgen-host-wasmtime-rust = { workspace = true, features = ['tracing', 'async'] }

crates/gen-markdown/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "wit-bindgen-gen-markdown"
3-
version = "0.2.0"
4-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
55

66
[lib]
77
doctest = false
88
test = false
99

1010
[dependencies]
11-
heck = "0.3"
12-
pulldown-cmark = { version = "0.8", default-features = false }
13-
structopt = { version = "0.3", default-features = false, optional = true }
14-
wit-bindgen-core = { path = '../bindgen-core', version = '0.2.0' }
11+
heck = { workspace = true }
12+
pulldown-cmark = { workspace = true }
13+
structopt = { workspace = true, optional = true }
14+
wit-bindgen-core = { workspace = true }

crates/gen-rust-lib/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "wit-bindgen-gen-rust-lib"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[lib]
88
doctest = false
99
test = false
1010

1111
[dependencies]
12-
wit-bindgen-core = { path = '../bindgen-core' }
13-
heck = "0.3"
12+
wit-bindgen-core = { workspace = true }
13+
heck = { workspace = true }

crates/guest-rust-macro/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "wit-bindgen-guest-rust-macro"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[lib]
88
proc-macro = true
@@ -12,5 +12,5 @@ test = false
1212
[dependencies]
1313
proc-macro2 = "1.0"
1414
syn = "1.0"
15-
wit-bindgen-core = { path = "../bindgen-core", version = "0.2" }
16-
wit-bindgen-gen-guest-rust = { path = "../gen-guest-rust", version = "0.2" }
15+
wit-bindgen-core = { workspace = true }
16+
wit-bindgen-gen-guest-rust = { workspace = true }

crates/guest-rust/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "wit-bindgen-guest-rust"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[dependencies]
88
wit-bindgen-guest-rust-macro = { path = "../guest-rust-macro", optional = true }
9-
bitflags = "1.3"
9+
bitflags = { workspace = true }
1010

1111
[features]
1212
default = ["macros"]

crates/host-wasmtime-rust-macro/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "wit-bindgen-host-wasmtime-rust-macro"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[lib]
88
proc-macro = true
@@ -12,8 +12,8 @@ test = false
1212
[dependencies]
1313
proc-macro2 = "1.0"
1414
syn = "1.0"
15-
wit-bindgen-core = { path = "../bindgen-core", version = "0.2" }
16-
wit-bindgen-gen-host-wasmtime-rust = { path = "../gen-host-wasmtime-rust", version = "0.2" }
15+
wit-bindgen-core = { workspace = true }
16+
wit-bindgen-gen-host-wasmtime-rust = { workspace = true }
1717

1818
[features]
1919
tracing = []

crates/host-wasmtime-rust/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "wit-bindgen-host-wasmtime-rust"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66

77
[dependencies]
8-
anyhow = "1.0"
9-
bitflags = "1.2"
8+
anyhow = { workspace = true }
9+
bitflags = { workspace = true }
1010
thiserror = "1.0"
11-
wasmtime = "1.0"
11+
wasmtime = { workspace = true }
1212
wit-bindgen-host-wasmtime-rust-macro = { path = "../host-wasmtime-rust-macro", version = "0.2" }
1313
tracing-lib = { version = "0.1.26", optional = true, package = 'tracing' }
1414
async-trait = { version = "0.1.50", optional = true }

crates/test-helpers/Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "test-helpers"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66
publish = false
77

88
[lib]
@@ -12,24 +12,24 @@ test = false
1212

1313
[dependencies]
1414
backtrace = "0.3"
15-
heck = "0.3"
15+
heck = { workspace = true }
1616
ignore = "0.4"
1717
proc-macro2 = "1.0.27"
1818
quote = "1.0.9"
19-
wit-bindgen-core = { path = '../bindgen-core' }
20-
wit-bindgen-gen-guest-rust = { path = '../gen-guest-rust', optional = true }
21-
wit-bindgen-gen-host-wasmtime-rust = { path = '../gen-host-wasmtime-rust', optional = true }
22-
wit-bindgen-gen-host-wasmtime-py = { path = '../gen-host-wasmtime-py', optional = true }
23-
wit-bindgen-gen-host-js = { path = '../gen-host-js', optional = true }
24-
wit-bindgen-gen-guest-c = { path = '../gen-guest-c', optional = true }
25-
wit-bindgen-gen-guest-teavm-java = { path = '../gen-guest-teavm-java', optional = true }
26-
wit-parser = { path = '../wit-parser' }
19+
wit-bindgen-core = { workspace = true }
20+
wit-bindgen-gen-guest-rust = { workspace = true, optional = true }
21+
wit-bindgen-gen-host-wasmtime-rust = { workspace = true, optional = true }
22+
wit-bindgen-gen-host-wasmtime-py = { workspace = true, optional = true }
23+
wit-bindgen-gen-host-js = { workspace = true, optional = true }
24+
wit-bindgen-gen-guest-c = { workspace = true, optional = true }
25+
wit-bindgen-gen-guest-teavm-java = { workspace = true, optional = true }
26+
wit-parser = { workspace = true }
2727
filetime = "0.2"
2828

2929
[build-dependencies]
30-
wit-bindgen-gen-guest-c = { path = '../gen-guest-c' }
31-
wit-bindgen-gen-guest-teavm-java = { path = '../gen-guest-teavm-java' }
32-
wit-bindgen-core = { path = '../bindgen-core' }
30+
wit-bindgen-gen-guest-c = { workspace = true }
31+
wit-bindgen-gen-guest-teavm-java = { workspace = true }
32+
wit-bindgen-core = { workspace = true }
3333

3434
[features]
3535
default = ['guest-rust', 'guest-c', 'guest-teavm-java', 'host-js', 'host-wasmtime-py', 'host-wasmtime-rust']

crates/test-rust-wasm/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "test-rust-wasm"
3-
version = "0.2.0"
43
authors = ["Alex Crichton <[email protected]>"]
5-
edition = "2021"
4+
version.workspace = true
5+
edition.workspace = true
66
publish = false
77

88
[dependencies]

0 commit comments

Comments
 (0)