Skip to content

Commit 4596d4a

Browse files
authored
Add package.include to all crates (#4046)
This significantly reduces package size and notably excludes any bash files from landing on a user device. Adds `package.publish = false` to any crate not being published. Removes unnecessary version specifiers in e.g. dev-dependencies, reducing churn during a new version release.
1 parent 739ade1 commit 4596d4a

File tree

61 files changed

+197
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+197
-151
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@
119119
* MSRV of CLI tools bumped to v1.76. This does not affect libraries like `wasm-bindgen`, `js-sys` and `web-sys`!
120120
[#4037](https://github.com/rustwasm/wasm-bindgen/pull/4037)
121121

122+
* Filtered files in published crates, significantly reducing the package size and notably excluding any bash files.
123+
[#4046](https://github.com/rustwasm/wasm-bindgen/pull/4046)
124+
122125
### Fixed
123126

124127
* Copy port from headless test server when using `WASM_BINDGEN_TEST_ADDRESS`.

Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Easy support for interacting between JS and Rust.
1313
"""
1414
edition = "2021"
1515
rust-version = "1.57"
16+
include = ["/build.rs", "/LICENSE-*", "/src"]
1617

1718
[package.metadata.docs.rs]
1819
features = ["serde-serialize"]
@@ -48,12 +49,12 @@ serde_json = { version = "1.0", optional = true }
4849
cfg-if = "1.0.0"
4950

5051
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
51-
js-sys = { path = 'crates/js-sys', version = '0.3.69' }
52-
wasm-bindgen-test = { path = 'crates/test', version = '=0.3.42' }
53-
wasm-bindgen-futures = { path = 'crates/futures', version = '=0.4.42' }
52+
js-sys = { path = 'crates/js-sys' }
53+
wasm-bindgen-test = { path = 'crates/test' }
54+
wasm-bindgen-futures = { path = 'crates/futures' }
5455
serde_derive = "1.0"
55-
wasm-bindgen-test-crate-a = { path = 'tests/crates/a', version = '0.1' }
56-
wasm-bindgen-test-crate-b = { path = 'tests/crates/b', version = '0.1' }
56+
wasm-bindgen-test-crate-a = { path = 'tests/crates/a' }
57+
wasm-bindgen-test-crate-b = { path = 'tests/crates/b' }
5758

5859
[workspace]
5960
members = [

benchmarks/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[package]
22
name = "wasm-bindgen-benchmark"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
authors = ["The wasm-bindgen Developers"]
55
edition = "2021"
6+
publish = false
67

78
[dependencies]
89
wasm-bindgen = { path = '../' }

crates/backend/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Backend code generation of the wasm-bindgen tool
1111
"""
1212
edition = "2021"
1313
rust-version = "1.57"
14+
include = ["/LICENSE-*", "/src"]
1415

1516
[features]
1617
spans = []

crates/cli-support/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Shared support for the wasm-bindgen-cli package, an internal dependency
1111
"""
1212
edition = "2021"
1313
rust-version = "1.76"
14+
include = ["/LICENSE-*", "/src"]
1415

1516
[dependencies]
1617
anyhow = "1.0"

crates/cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ information see https://github.com/rustwasm/wasm-bindgen.
1414
edition = "2021"
1515
default-run = 'wasm-bindgen'
1616
rust-version = "1.76"
17+
include = ["/LICENSE-*", "/src"]
1718

1819
[package.metadata.binstall]
1920
pkg-url = "https://github.com/rustwasm/wasm-bindgen/releases/download/{ version }/wasm-bindgen-{ version }-{ target }{ archive-suffix }"

crates/example-tests/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[package]
22
name = "example-tests"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
authors = ["The wasm-bindgen Developers"]
55
edition = "2021"
6+
publish = false
67

78
[dependencies]
89
anyhow = "1.0.75"

crates/externref-xform/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Internal externref transformations for wasm-bindgen
1111
"""
1212
edition = "2021"
1313
rust-version = "1.76"
14+
include = ["/LICENSE-*", "/src"]
1415

1516
[dependencies]
1617
anyhow = "1.0"

crates/futures/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ readme = "./README.md"
1010
version = "0.4.42"
1111
edition = "2021"
1212
rust-version = "1.57"
13+
include = ["/LICENSE-*", "/src"]
1314

1415
[package.metadata.docs.rs]
1516
all-features = true
@@ -33,6 +34,6 @@ features = [
3334
]
3435

3536
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
36-
wasm-bindgen-test = { path = '../test', version = '0.3.42' }
37+
wasm-bindgen-test = { path = '../test' }
3738
futures-channel-preview = { version = "0.3.0-alpha.18" }
3839
futures-lite = { version = "1.11.3", default-features = false }

crates/js-sys/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Node.js and browsers, built on `#[wasm_bindgen]` using the `wasm-bindgen` crate.
1414
license = "MIT OR Apache-2.0"
1515
edition = "2021"
1616
rust-version = "1.57"
17+
include = ["/LICENSE-*", "/src"]
1718

1819
[lib]
1920
test = false
@@ -23,9 +24,9 @@ doctest = false
2324
wasm-bindgen = { path = "../..", version = "0.2.92" }
2425

2526
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
26-
wasm-bindgen-test = { path = '../test', version = '=0.3.42' }
27-
wasm-bindgen-futures = { path = '../futures', version = '0.4.42' }
28-
web-sys = { path = "../web-sys", version = "0.3.69", features = ["Headers", "Response", "ResponseInit"] }
27+
wasm-bindgen-test = { path = '../test' }
28+
wasm-bindgen-futures = { path = '../futures' }
29+
web-sys = { path = "../web-sys", features = ["Headers", "Response", "ResponseInit"] }
2930

3031
[lints.rust]
3132
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(js_sys_unstable_apis)'] }

0 commit comments

Comments
 (0)