diff --git a/CHANGELOG.md b/CHANGELOG.md index e73bec911..d646f2b47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ List of changes for this repo, including `atomic-cli`, `atomic-server` and `atom - Fix array length bug in paths - Add docker link to homepage - Add system tray icon #75 +- Removed `ResourceString` +- Improved WASM compliance #76 ## v0.20.3 diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index ef9146917..403e20bda 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -24,7 +24,7 @@ Make sure to `cargo test --all` before opening a PR! 1. Update the versions in cargo.toml files using Semantic Versioning. 1. run `cargo publish` in `lib`, than you can run the same in `cli` and `server` -## Publishing to Docker +## Publishing server to Docker 1. `docker build . -t joepmeneer/atomic-server:v0.20.0 -t joepmeneer/atomic-server:latest` 1. `docker push joepmeneer/atomic-server` @@ -41,9 +41,9 @@ Make sure to `cargo test --all` before opening a PR! 1. `rm -rf ~/.config/atomic/db` (if the db is corrupted / migrated) 1. `./atomic-server-v0.20.0 &> log-v0.20.0-1` to start and log to file -## Publishing to WAPM +## Publishing atomic-cli to WAPM -_Not used at this moment_ - -1. run `cargo wasi build --release` (note: this fails, as ring does not compile to WASI [at this moment](https://github.com/briansmith/ring/issues/657)) +1. Install `wasmer` and `cargo-wasi`. +1. `cd cli` +1. run `cargo wasi build --release --no-default-features` (note: this fails, as ring does not compile to WASI [at this moment](https://github.com/briansmith/ring/issues/1043)) 1. `wapm publish` diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 72d7bb860..098e2441e 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,19 +1,25 @@ [package] -name = "atomic-cli" -version = "0.20.1" authors = ["Joep Meindertsma "] +description = "CLI tool to create, store, query, validate and convert Atomic Data" edition = "2018" license = "MIT" -description = "CLI tool to create, store, query, validate and convert Atomic Data" +name = "atomic-cli" readme = "README.md" repository = "https://github.com/joepio/atomic" +version = "0.20.1" [dependencies] -assert_cmd = "1.0.2" -atomic_lib = { version = "0.20.0", path = "../lib", features = ["config", "db", "rdf"] } +atomic_lib = {version = "0.20.0", path = "../lib", features = ["config", "db", "rdf"]} clap = "2.33.3" colored = "2.0.0" dirs = "3.0.1" -edit = "0.1.2" +edit = {version = "0.1.2", optional = true} promptly = "0.3.0" regex = "1.4.2" + +[dev-dependencies] +assert_cmd = "1.0.2" + +[features] +default = ["native"] +native = ["edit"] diff --git a/cli/src/commit.rs b/cli/src/commit.rs index d6581a082..0fbea5882 100644 --- a/cli/src/commit.rs +++ b/cli/src/commit.rs @@ -16,6 +16,7 @@ pub fn set(context: &Context) -> AtomicResult<()> { } /// Apply a Commit using the Set method, where the value is edited in the user's text editor. +#[cfg(feature = "native")] pub fn edit(context: &Context) -> AtomicResult<()> { let subcommand = "edit"; let subject = argument_to_url(context, subcommand, "subject")?; diff --git a/cli/src/main.rs b/cli/src/main.rs index 4ebabda53..ccf747c2c 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -225,7 +225,12 @@ fn exec_command(context: &mut Context) -> AtomicResult<()> { commit::destroy(context)?; } Some("edit") => { - commit::edit(context)?; + #[cfg(feature = "native")] { + commit::edit(context)?; + } + #[cfg(not(feature = "native"))] { + return Err("Feature not available. Compile with `native` feature.".into()) + } } Some("get") => { path::get_path(context)?; diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 5f0279630..d0701f2c3 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -10,17 +10,17 @@ version = "0.20.1" [dependencies] base64 = "0.13.0" -bincode = { version = "1.3.1", optional = true } -dirs = { version = "3.0.1", optional = true } -rand = "0.8.0" +bincode = {version = "1.3.1", optional = true} +dirs = {version = "3.0.1", optional = true} +rand = {version = "0.8.0"} regex = "1.4.2" ring = "0.16.19" -rio_api = { version = "0.5.0", optional = true } -rio_turtle = { version = "0.5.0", optional = true } -serde = { version = "1.0.118", features = ["derive"] } +rio_api = {version = "0.5.0", optional = true} +rio_turtle = {version = "0.5.0", optional = true} +serde = {version = "1.0.118", features = ["derive"]} serde_json = "1.0.60" -sled = { version = "0.34.6", optional = true } -toml = { version = "0.5.8", optional = true } +sled = {version = "0.34.6", optional = true} +toml = {version = "0.5.8", optional = true} ureq = "1.5.4" url = "2.2.0"