Skip to content

Commit

Permalink
Improved WASM compliance #76
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Jan 14, 2021
1 parent 77132cd commit cc35d6d
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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`
18 changes: 12 additions & 6 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
[package]
name = "atomic-cli"
version = "0.20.1"
authors = ["Joep Meindertsma <[email protected]>"]
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"]
1 change: 1 addition & 0 deletions cli/src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")?;
Expand Down
7 changes: 6 additions & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
16 changes: 8 additions & 8 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit cc35d6d

Please sign in to comment.