Add metadata (#45)

* Add wasm-pack metadata
* Add Wasm tests directory
* Add basic Cargo manifest metadata
* Make web frontend unpublishable to npm
This commit is contained in:
ProTheory8 2021-03-27 15:16:05 +05:00 committed by Keavon Chambers
parent e58f314527
commit 2f2bbb3a8b
8 changed files with 61 additions and 25 deletions

20
Cargo.lock generated
View file

@ -47,6 +47,16 @@ dependencies = [
name = "graphite-renderer-core"
version = "0.1.0"
[[package]]
name = "graphite-wasm-wrapper"
version = "0.1.0"
dependencies = [
"console_error_panic_hook",
"graphite-editor-core",
"wasm-bindgen",
"wasm-bindgen-test",
]
[[package]]
name = "js-sys"
version = "0.3.49"
@ -202,16 +212,6 @@ dependencies = [
"quote",
]
[[package]]
name = "wasm-wrapper"
version = "0.1.0"
dependencies = [
"console_error_panic_hook",
"graphite-editor-core",
"wasm-bindgen",
"wasm-bindgen-test",
]
[[package]]
name = "web-sys"
version = "0.3.49"

View file

@ -3,7 +3,9 @@ name = "graphite-cli"
version = "0.1.0"
authors = ["Graphite Authors <contact@graphite.design>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
readme = "../../README.md"
homepage = "https://www.graphite.design"
repository = "https://github.com/GraphiteEditor/Graphite"
license = "Apache-2.0"
[dependencies]

View file

@ -2,6 +2,7 @@
"name": "graphite-web-frontend",
"version": "0.1.0",
"description": "Graphite's web app frontend. Planned to be replaced by a Rust native GUI framework in the future.",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",

View file

@ -1,9 +1,13 @@
[package]
name = "wasm-wrapper"
publish = false
name = "graphite-wasm-wrapper"
version = "0.1.0"
authors = ["Graphite Authors <contact@graphite.design>"]
edition = "2018"
readme = "../../../README.md"
homepage = "https://www.graphite.design"
repository = "https://github.com/GraphiteEditor/Graphite"
license = "Apache-2.0"
publish = false
[lib]
crate-type = ["cdylib", "rlib"]
@ -12,14 +16,25 @@ crate-type = ["cdylib", "rlib"]
default = ["console_error_panic_hook"]
[dependencies]
wasm-bindgen = "0.2.72"
graphite-editor-core = { path = "../../../core/editor" }
# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
# code size when deploying.
console_error_panic_hook = { version = "0.1.6", optional = true }
graphite-editor-core = { path = "../../../core/editor" }
wasm-bindgen = "0.2.72"
[dev-dependencies]
wasm-bindgen-test = "0.3.22"
[package.metadata.wasm-pack.profile.dev]
wasm-opt = false
[package.metadata.wasm-pack.profile.dev.wasm-bindgen]
debug-js-glue = true
demangle-name-section = true
dwarf-debug-info = true
[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-Os"]
[package.metadata.wasm-pack.profile.release.wasm-bindgen]
debug-js-glue = false
demangle-name-section = false
dwarf-debug-info = false

View file

@ -0,0 +1,10 @@
#![cfg(target_arch = "wasm32")]
use wasm_bindgen_test::*;
wasm_bindgen_test_configure!(run_in_browser);
#[wasm_bindgen_test]
fn pass() {
assert_eq!(1 + 1, 2);
}

View file

@ -3,7 +3,9 @@ name = "graphite-document-core"
version = "0.1.0"
authors = ["Graphite Authors <contact@graphite.design>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
readme = "../../README.md"
homepage = "https://www.graphite.design"
repository = "https://github.com/GraphiteEditor/Graphite"
license = "Apache-2.0"
[dependencies]

View file

@ -3,6 +3,10 @@ name = "graphite-editor-core"
version = "0.1.0"
authors = ["Graphite Authors <contact@graphite.design>"]
edition = "2018"
readme = "../../README.md"
homepage = "https://www.graphite.design"
repository = "https://github.com/GraphiteEditor/Graphite"
license = "Apache-2.0"
[dependencies]
log = "0.4"

View file

@ -3,7 +3,9 @@ name = "graphite-renderer-core"
version = "0.1.0"
authors = ["Graphite Authors <contact@graphite.design>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
readme = "../../README.md"
homepage = "https://www.graphite.design"
repository = "https://github.com/GraphiteEditor/Graphite"
license = "Apache-2.0"
[dependencies]