Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use path dependencies in examples #1015

Merged
merged 1 commit into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,6 @@ members = [

[patch.crates-io]
wasm-bindgen = { path = '.' }
wasm-bindgen-futures = { path = 'crates/futures' }
js-sys = { path = 'crates/js-sys' }
web-sys = { path = 'crates/web-sys' }
4 changes: 2 additions & 2 deletions examples/add/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "add"
version = "0.1.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
authors = ["The wasm-bindgen Developers"]

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
wasm-bindgen = "0.2.27"
6 changes: 3 additions & 3 deletions examples/canvas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ authors = ["The wasm-bindgen Developers"]
crate-type = ["cdylib"]

[dependencies]
js-sys = { path = "../../crates/js-sys" }
wasm-bindgen = { path = "../.." }
js-sys = "0.3.4"
wasm-bindgen = "0.2.27"

[dependencies.web-sys]
path = "../../crates/web-sys"
version = "0.3.4"
features = [
'CanvasRenderingContext2d',
'Document',
Expand Down
8 changes: 2 additions & 6 deletions examples/char/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
[package]
name = "char"
version = "0.1.0"
authors = ["Robert Masen <r@robertmasen.com>"]
authors = ["The wasm-bindgen Developers"]

[lib]
crate-type = ["cdylib"]

[dependencies]
# Here we're using a path dependency to use what's already in this repository,
# but you'd use the commented out version below if you're copying this into your
# project.
wasm-bindgen = { path = "../.." }
#wasm-bindgen = "0.2"
wasm-bindgen = "0.2.27"
8 changes: 4 additions & 4 deletions examples/closures/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "closures"
version = "0.1.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
authors = ["The wasm-bindgen Developers"]

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
js-sys = { path = "../../crates/js-sys" }
wasm-bindgen = "0.2.27"
js-sys = "0.3.4"

[dependencies.web-sys]
path = "../../crates/web-sys"
version = "0.3.4"
features = [
'CssStyleDeclaration',
'Document',
Expand Down
6 changes: 3 additions & 3 deletions examples/console_log/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "console_log"
version = "0.1.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
authors = ["The wasm-bindgen Developers"]

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
web-sys = { path = '../../crates/web-sys', features = ['console'] }
wasm-bindgen = "0.2.27"
web-sys = { version = "0.3.4", features = ['console'] }
4 changes: 2 additions & 2 deletions examples/dom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ authors = ["The wasm-bindgen Developers"]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
wasm-bindgen = "0.2.27"

[dependencies.web-sys]
path = '../../crates/web-sys'
version = "0.3.4"
features = [
'Document',
'Element',
Expand Down
2 changes: 1 addition & 1 deletion examples/duck-typed-interfaces/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ authors = ["The wasm-bindgen Developers"]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
wasm-bindgen = "0.2.27"
8 changes: 4 additions & 4 deletions examples/fetch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ crate-type = ["cdylib"]

[dependencies]
futures = "0.1.20"
wasm-bindgen = { path = "../..", features = ["serde-serialize"] }
js-sys = { path = "../../crates/js-sys" }
wasm-bindgen-futures = { path = "../../crates/futures" }
wasm-bindgen = { version = "0.2.27", features = ["serde-serialize"] }
js-sys = "0.3.4"
wasm-bindgen-futures = "0.3.4"
serde = "^1.0.59"
serde_derive = "^1.0.59"

[dependencies.web-sys]
path = "../../crates/web-sys"
version = "0.3.4"
features = [
'Headers',
'Request',
Expand Down
4 changes: 2 additions & 2 deletions examples/guide-supported-types-examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "guide-supported-types-examples"
version = "0.1.0"
authors = ["Nick Fitzgerald <fitzgen@gmail.com>"]
authors = ["The wasm-bindgen Developers"]

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
wasm-bindgen = "0.2.27"
6 changes: 1 addition & 5 deletions examples/hello_world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@ authors = ["The wasm-bindgen Developers"]
crate-type = ["cdylib"]

[dependencies]
# Here we're using a path dependency to use what's already in this repository,
# but you'd use the commented out version below if you're copying this into your
# project.
wasm-bindgen = { path = "../.." }
#wasm-bindgen = "0.2"
wasm-bindgen = "0.2.27"
4 changes: 2 additions & 2 deletions examples/import_js/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "import_js"
version = "0.1.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
authors = ["The wasm-bindgen Developers"]

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
wasm-bindgen = "0.2.27"
6 changes: 3 additions & 3 deletions examples/julia_set/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "julia_set"
version = "0.1.0"
authors = ["Marcin Baraniecki <marcinbar1@gmail.com>"]
authors = ["The wasm-bindgen Developers"]

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
wasm-bindgen = "0.2.27"

[dependencies.web-sys]
path = '../../crates/web-sys'
version = "0.3.4"
features = [
'ImageData',
'CanvasRenderingContext2d',
Expand Down
4 changes: 2 additions & 2 deletions examples/no_modules/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "no_modules"
version = "0.1.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
authors = ["The wasm-bindgen Developers"]

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
wasm-bindgen = "0.2.27"
6 changes: 3 additions & 3 deletions examples/paint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ authors = ["The wasm-bindgen Developers"]
crate-type = ["cdylib"]

[dependencies]
js-sys = { path = "../../crates/js-sys" }
wasm-bindgen = { path = "../.." }
js-sys = "0.3.4"
wasm-bindgen = "0.2.27"

[dependencies.web-sys]
path = "../../crates/web-sys"
version = "0.3.4"
features = [
'CanvasRenderingContext2d',
'CssStyleDeclaration',
Expand Down
4 changes: 2 additions & 2 deletions examples/performance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ authors = ["The wasm-bindgen Developers"]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
wasm-bindgen = "0.2.27"
humantime = "1"

[dependencies.web-sys]
path = '../../crates/web-sys'
version = "0.3.4"
features = ['Window', 'Performance', 'PerformanceTiming']
8 changes: 4 additions & 4 deletions examples/raytrace-parallel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ crate-type = ["cdylib"]
[dependencies]
console_error_panic_hook = "0.1"
futures = "0.1"
js-sys = { path = '../../crates/js-sys' }
js-sys = "0.3.4"
raytracer = { git = 'https://github.com/alexcrichton/raytracer', branch = 'update-deps' }
wasm-bindgen = { path = "../..", features = ['serde-serialize'] }
wasm-bindgen-futures = { path = '../../crates/futures' }
wasm-bindgen = { version = "0.2.27", features = ['serde-serialize'] }
wasm-bindgen-futures = "0.3.4"

[dependencies.web-sys]
path = '../../crates/web-sys'
version = "0.3.4"
features = [
'CanvasRenderingContext2d',
'ErrorEvent',
Expand Down
6 changes: 3 additions & 3 deletions examples/todomvc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ crate-type = ["cdylib"]
askama = "0.7.2"

[dependencies]
js-sys = { path = "../../crates/js-sys" }
wasm-bindgen = { path = "../../" }
js-sys = "0.3.4"
wasm-bindgen = "0.2.27"
askama = "0.7.2"

[dependencies.web-sys]
path = "../../crates/web-sys"
version = "0.3.4"
features = [
'console',
'CssStyleDeclaration',
Expand Down
6 changes: 3 additions & 3 deletions examples/wasm-in-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "wasm-in-wasm"
version = "0.1.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
authors = ["The wasm-bindgen Developers"]

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
js-sys = { path = "../../crates/js-sys" }
wasm-bindgen = "0.2.27"
js-sys = "0.3.4"
8 changes: 2 additions & 6 deletions examples/wasm2js/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
[package]
name = "wasm2js"
version = "0.1.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
authors = ["The wasm-bindgen Developers"]

[lib]
crate-type = ["cdylib"]

[dependencies]
# Here we're using a path dependency to use what's already in this repository,
# but you'd use the commented out version below if you're copying this into your
# project.
wasm-bindgen = { path = "../.." }
#wasm-bindgen = "0.2"
wasm-bindgen = "0.2.27"
4 changes: 2 additions & 2 deletions examples/webaudio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ authors = ["The wasm-bindgen Developers"]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = { path = "../.." }
wasm-bindgen = "0.2.27"

[dependencies.web-sys]
path = "../../crates/web-sys"
version = "0.3.4"
features = [
'AudioContext',
'AudioDestinationNode',
Expand Down
6 changes: 3 additions & 3 deletions examples/webgl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ authors = ["The wasm-bindgen Developers"]
crate-type = ["cdylib"]

[dependencies]
js-sys = { path = "../../crates/js-sys" }
wasm-bindgen = { path = "../.." }
js-sys = "0.3.4"
wasm-bindgen = "0.2.27"

[dependencies.web-sys]
path = "../../crates/web-sys"
version = "0.3.4"
features = [
'Document',
'Element',
Expand Down
5 changes: 4 additions & 1 deletion publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ fn main() {
let mut crates = Vec::new();
crates.push(read_crate("./Cargo.toml".as_ref()));
find_crates("crates".as_ref(), &mut crates);
find_crates("examples".as_ref(), &mut crates);

let pos = CRATES_TO_PUBLISH.iter()
.chain(CRATES_TO_AVOID_PUBLISH)
.enumerate()
.map(|(i, c)| (*c, i))
.collect::<HashMap<_, _>>();
crates.sort_by_key(|krate| pos[&krate.name[..]]);
crates.sort_by_key(|krate| pos.get(&krate.name[..]));

match &env::args().nth(1).expect("must have one argument")[..] {
"bump" => {
Expand All @@ -90,6 +91,8 @@ fn find_crates(dir: &Path, dst: &mut Vec<Crate>) {
.any(|c| krate.name == *c)
{
dst.push(krate);
} else if dir.iter().any(|s| s == "examples") {
dst.push(krate);
} else {
panic!("failed to find {:?} in whitelist or blacklist", krate.name);
}
Expand Down