Move existing code to subcrate
This commit is contained in:
parent
3c9a59df3f
commit
080f509385
|
@ -1,2 +1,2 @@
|
||||||
/target
|
target/
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
|
|
31
Cargo.toml
31
Cargo.toml
|
@ -1,32 +1,13 @@
|
||||||
[package]
|
[package]
|
||||||
|
authors = ["Rob Watson <rfwatson@users.no-reply.github.com>"]
|
||||||
|
description = "Rust-powered audio editing"
|
||||||
name = "audioview"
|
name = "audioview"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
authors = ["Rob Watson <rob@netflux.io>"]
|
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[lib]
|
[workspace]
|
||||||
crate-type = ["cdylib", "rlib"]
|
members = [
|
||||||
|
"frontend-core",
|
||||||
[dependencies]
|
|
||||||
yew = "0.17"
|
|
||||||
#yew = { path = "/home/rob/dev/yew/yew" }
|
|
||||||
yewtil = "0.3.1"
|
|
||||||
wasm-bindgen = "0.2"
|
|
||||||
js-sys = "0.3.44"
|
|
||||||
futures = "0.3.5"
|
|
||||||
cpal = { path = "/home/rob/dev/cpal", version = "0.12.1", features = ["wasm-bindgen"] }
|
|
||||||
wasm-bindgen-futures = "0.4"
|
|
||||||
console_error_panic_hook = "0.1.6"
|
|
||||||
|
|
||||||
[dependencies.web-sys]
|
|
||||||
version = "0.3.44"
|
|
||||||
features = [
|
|
||||||
"console",
|
|
||||||
"AudioContext",
|
|
||||||
"AudioBuffer",
|
|
||||||
"HtmlCanvasElement",
|
|
||||||
"CanvasRenderingContext2d",
|
|
||||||
"Window",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
|
11
Makefile
11
Makefile
|
@ -1,19 +1,16 @@
|
||||||
# Based on https://raw.githubusercontent.com/saschagrunert/webapp.rs/master/Makefile
|
# Based on https://raw.githubusercontent.com/saschagrunert/webapp.rs/master/Makefile
|
||||||
|
|
||||||
.PHONY: \
|
all: build-frontend
|
||||||
build \
|
|
||||||
run
|
|
||||||
|
|
||||||
all: build
|
build-frontend:
|
||||||
|
cd frontend-core && \
|
||||||
build:
|
|
||||||
wasm-pack build --dev --target web --out-name wasm --out-dir ./static
|
wasm-pack build --dev --target web --out-name wasm --out-dir ./static
|
||||||
|
|
||||||
build-doc:
|
build-doc:
|
||||||
cargo doc --all --no-deps
|
cargo doc --all --no-deps
|
||||||
|
|
||||||
run:
|
run:
|
||||||
simple-http-server -i ./static/ -p 3000 --nocache --try-file ./static/index.html
|
simple-http-server -i ./frontend-core/static/ -p 3000 --nocache --try-file ./frontend-core/static/index.html
|
||||||
|
|
||||||
lint: lint-rustfmt lint-clippy
|
lint: lint-rustfmt lint-clippy
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
[package]
|
||||||
|
name = "audioview-frontend-core"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["Rob Watson <rob@netflux.io>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
yew = "0.17"
|
||||||
|
#yew = { path = "/home/rob/dev/yew/yew" }
|
||||||
|
yewtil = "0.3.1"
|
||||||
|
wasm-bindgen = "0.2"
|
||||||
|
js-sys = "0.3.44"
|
||||||
|
futures = "0.3.5"
|
||||||
|
cpal = { path = "/home/rob/dev/cpal", version = "0.12.1", features = ["wasm-bindgen"] }
|
||||||
|
wasm-bindgen-futures = "0.4"
|
||||||
|
console_error_panic_hook = "0.1.6"
|
||||||
|
|
||||||
|
[dependencies.web-sys]
|
||||||
|
version = "0.3.44"
|
||||||
|
features = [
|
||||||
|
"console",
|
||||||
|
"AudioContext",
|
||||||
|
"AudioBuffer",
|
||||||
|
"HtmlCanvasElement",
|
||||||
|
"CanvasRenderingContext2d",
|
||||||
|
"Window",
|
||||||
|
]
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
#![recursion_limit = "1024"]
|
||||||
|
|
||||||
|
extern crate console_error_panic_hook;
|
||||||
|
extern crate js_sys;
|
||||||
|
|
||||||
|
use std::panic;
|
||||||
|
use wasm_bindgen::prelude::*;
|
||||||
|
use yew::prelude::*;
|
||||||
|
|
||||||
|
mod agents;
|
||||||
|
mod components;
|
||||||
|
mod utils;
|
||||||
|
|
||||||
|
#[wasm_bindgen(start)]
|
||||||
|
pub fn run_app() {
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
panic::set_hook(Box::new(console_error_panic_hook::hook));
|
||||||
|
|
||||||
|
App::<components::App>::new().mount_to_body();
|
||||||
|
}
|
21
src/lib.rs
21
src/lib.rs
|
@ -1,20 +1 @@
|
||||||
#![recursion_limit = "1024"]
|
// Core library
|
||||||
|
|
||||||
extern crate console_error_panic_hook;
|
|
||||||
extern crate js_sys;
|
|
||||||
|
|
||||||
use std::panic;
|
|
||||||
use wasm_bindgen::prelude::*;
|
|
||||||
use yew::prelude::*;
|
|
||||||
|
|
||||||
mod agents;
|
|
||||||
mod components;
|
|
||||||
mod utils;
|
|
||||||
|
|
||||||
#[wasm_bindgen(start)]
|
|
||||||
pub fn run_app() {
|
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
panic::set_hook(Box::new(console_error_panic_hook::hook));
|
|
||||||
|
|
||||||
App::<components::App>::new().mount_to_body();
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue