Fix client build

This commit is contained in:
Adrian Wozniak 2020-05-01 23:10:54 +02:00
parent e5b8c0838c
commit d13c31b6ae
6 changed files with 71 additions and 26 deletions

View File

@ -11,10 +11,9 @@ secrets:
tasks: tasks:
- build_config: | - build_config: |
cd jirs/jirs-server cd jirs/jirs-server
echo 'concurrency = 2' >> db.test.toml cp ~/jirs/.builds/db.toml ~/jirs/jirs-server/db.toml
echo 'database_url = "postgres://postgres@localhost:5432/jirs_test"' >> db.test.toml
- setup: | - setup: |
sudo systemctl start postgresql 1
rustup toolchain install nightly rustup toolchain install nightly
rustup default nightly rustup default nightly
cargo install diesel_cli --no-default-features --features postgres cargo install diesel_cli --no-default-features --features postgres

67
Cargo.lock generated
View File

@ -1399,24 +1399,6 @@ checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e"
name = "jirs-cli" name = "jirs-cli"
version = "0.1.0" version = "0.1.0"
[[package]]
name = "jirs-client"
version = "0.1.0"
dependencies = [
"bincode",
"chrono",
"comrak",
"futures 0.1.29",
"jirs-data",
"js-sys",
"seed",
"serde",
"serde_json",
"uuid 0.8.1",
"wasm-bindgen",
"web-sys",
]
[[package]] [[package]]
name = "jirs-css" name = "jirs-css"
version = "0.1.0" version = "0.1.0"
@ -1479,6 +1461,25 @@ dependencies = [
"uuid 0.8.1", "uuid 0.8.1",
] ]
[[package]]
name = "jirs_client"
version = "0.1.0"
dependencies = [
"bincode",
"chrono",
"comrak",
"futures 0.1.29",
"jirs-data",
"js-sys",
"seed",
"serde",
"serde_json",
"uuid 0.8.1",
"wasm-bindgen",
"wasm-bindgen-test",
"web-sys",
]
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.37" version = "0.3.37"
@ -2339,6 +2340,12 @@ dependencies = [
"parking_lot", "parking_lot",
] ]
[[package]]
name = "scoped-tls"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
[[package]] [[package]]
name = "scopeguard" name = "scopeguard"
version = "1.1.0" version = "1.1.0"
@ -2929,6 +2936,30 @@ version = "0.2.60"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "daf76fe7d25ac79748a37538b7daeed1c7a6867c92d3245c12c6222e4a20d639" checksum = "daf76fe7d25ac79748a37538b7daeed1c7a6867c92d3245c12c6222e4a20d639"
[[package]]
name = "wasm-bindgen-test"
version = "0.3.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "648da3460c6d2aa04b715a936329e2e311180efe650b2127d6267f4193ccac14"
dependencies = [
"console_error_panic_hook",
"js-sys",
"scoped-tls",
"wasm-bindgen",
"wasm-bindgen-futures",
"wasm-bindgen-test-macro",
]
[[package]]
name = "wasm-bindgen-test-macro"
version = "0.3.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf2f86cd78a2aa7b1fb4bb6ed854eccb7f9263089c79542dca1576a1518a8467"
dependencies = [
"proc-macro2",
"quote",
]
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.37" version = "0.3.37"

View File

@ -1,5 +1,5 @@
[package] [package]
name = "jirs-client" name = "jirs_client"
version = "0.1.0" version = "0.1.0"
authors = ["Adrian Wozniak <adrian.wozniak@ita-prog.pl>"] authors = ["Adrian Wozniak <adrian.wozniak@ita-prog.pl>"]
edition = "2018" edition = "2018"
@ -23,8 +23,8 @@ seed = { version = "*" }
serde = "*" serde = "*"
serde_json = "*" serde_json = "*"
bincode = "1.2.1" bincode = "1.2.1"
chrono = { version = "*", features = [ "serde" ] } chrono = { version = "0.4", features = [ "serde" ] }
uuid = { version = "*", features = [ "serde" ] } uuid = { version = "0.8.1", features = [ "serde" ] }
wasm-bindgen = "0.2.60" wasm-bindgen = "0.2.60"
futures = "^0.1.26" futures = "^0.1.26"
comrak = "*" comrak = "*"
@ -58,3 +58,6 @@ features = [
"KeyboardEvent", "KeyboardEvent",
"DragEvent", "DragEvent",
] ]
[dev-dependencies]
wasm-bindgen-test = { version = "*" }

View File

@ -20,7 +20,7 @@ mod shared;
mod sign_in; mod sign_in;
mod sign_up; mod sign_up;
mod users; mod users;
mod validations; pub mod validations;
mod ws; mod ws;
pub type AvatarFilterActive = bool; pub type AvatarFilterActive = bool;

12
jirs-client/tests/wasm.rs Normal file
View File

@ -0,0 +1,12 @@
extern crate wasm_bindgen_test;
use wasm_bindgen_test::*;
use jirs_client::validations::*;
#[wasm_bindgen_test]
fn test_is_token() {
assert_eq!(is_email("foo@"), false);
assert_eq!(is_email("foo@bar"), false);
assert_eq!(is_email("foo@bar."), false);
assert_eq!(is_email("foo@bar.com"), true);
}

View File

@ -34,7 +34,7 @@ bincode = "1.2.1"
time = { version = "0.1" } time = { version = "0.1" }
url = { version = "2.1.0" } url = { version = "2.1.0" }
percent-encoding = { version = "2.1.0" } percent-encoding = { version = "2.1.0" }
uuid = { version = ">=0.7.0, <0.9.0", features = ["serde", "v4", "v5"] } uuid = { version = "0.8.1", features = ["serde", "v4", "v5"] }
ipnetwork = { version = ">=0.12.2, <0.17.0" } ipnetwork = { version = ">=0.12.2, <0.17.0" }
num-bigint = { version = ">=0.1.41, <0.3" } num-bigint = { version = ">=0.1.41, <0.3" }
num-traits = { version = "0.2" } num-traits = { version = "0.2" }