-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update codebase and make deploy to shuttle manual:
- Loading branch information
glendc
committed
Oct 18, 2023
1 parent
0b2674c
commit cc2717b
Showing
18 changed files
with
162 additions
and
152 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[workspace] | ||
members = [ | ||
"nes-studio-app", | ||
"nes-studio", | ||
"nes-studio-website", | ||
] | ||
resolver = "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,42 @@ | ||
run: | ||
cargo shuttle run | ||
|
||
watch: | ||
cargo watch -x "shuttle run" -i Cargo.lock | ||
|
||
deploy: | ||
cargo shuttle deploy | ||
|
||
trunk: | ||
check: | ||
cargo check --workspace --all-targets | ||
|
||
check-wasm32: | ||
cargo check --workspace --all-features --lib --target wasm32-unknown-unknown | ||
|
||
check-fmt: | ||
cargo fmt --all -- --check | ||
|
||
clippy: | ||
cargo clippy --workspace --all-targets --all-features -- -D warnings -W clippy::all | ||
|
||
test: | ||
cargo test --workspace --all-targets --all-features | ||
|
||
test-docs: | ||
cargo test --workspace --doc | ||
cd nes-studio && trunk build | ||
|
||
trunk-build: | ||
cd nes-studio-app && trunk build | ||
|
||
trunk-watch: | ||
cd nes-studio-app && trunk watch | ||
|
||
qa: check check-wasm32 check-fmt clippy test test-docs trunk-build | ||
|
||
fmt: | ||
cargo fmt --all | ||
|
||
clippy-fix: | ||
cargo clippy --fix --workspace --all-targets --all-features --allow-dirty | ||
|
||
fix: fmt clippy-fix | ||
|
||
git-push: qa | ||
git push | ||
|
||
shuttle-deploy: qa | ||
cargo shuttle deploy | ||
|
||
shuttle-watch: | ||
cargo watch -x 'shuttle run' -i 'nes-studio-app,Cargo.lock' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[package] | ||
name = "nes-studio-app" | ||
version = "0.1.0" | ||
authors = ["Glen Henri J. De Cauwsemaecker <[email protected]>"] | ||
edition = "2021" | ||
|
||
|
||
[dependencies] | ||
egui = "0.23.0" | ||
eframe = { version = "0.23.0", default-features = false, features = [ | ||
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies. | ||
"default_fonts", # Embed the default egui fonts. | ||
"wgpu", # Use the wgpu rendering backend. | ||
"persistence", # Enable restoring app state when restarting the app. | ||
] } | ||
log = "0.4" | ||
|
||
# You only need serde if you want app persistence: | ||
serde = { version = "1", features = ["derive"] } | ||
|
||
# native: | ||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
env_logger = "0.10" | ||
|
||
# web: | ||
[target.'cfg(target_arch = "wasm32")'.dependencies] | ||
wasm-bindgen-futures = "0.4" | ||
|
||
|
||
[profile.release] | ||
opt-level = 2 # fast and small wasm | ||
|
||
# Optimize all dependencies even in debug builds: | ||
[profile.dev.package."*"] | ||
opt-level = 2 | ||
|
||
|
||
[patch.crates-io] | ||
|
||
# If you want to use the bleeding edge version of egui and eframe: | ||
# egui = { git = "https://github.com/emilk/egui", branch = "master" } | ||
# eframe = { git = "https://github.com/emilk/egui", branch = "master" } | ||
|
||
# If you fork https://github.com/emilk/egui you can test with: | ||
# egui = { path = "../egui/crates/egui" } | ||
# eframe = { path = "../egui/crates/eframe" } |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+8.64 MB
.../dist/nes-studio-53894f64447dc15a_bg.wasm → ...t/nes-studio-app-f98dff9e3f5d751c_bg.wasm
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#![warn(clippy::all, rust_2018_idioms)] | ||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release | ||
|
||
// When compiling natively: | ||
#[cfg(not(target_arch = "wasm32"))] | ||
fn main() -> eframe::Result<()> { | ||
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`). | ||
|
||
let native_options = eframe::NativeOptions { | ||
initial_window_size: Some([400.0, 300.0].into()), | ||
min_window_size: Some([300.0, 220.0].into()), | ||
..Default::default() | ||
}; | ||
eframe::run_native( | ||
"eframe template", | ||
native_options, | ||
Box::new(|cc| Box::new(nes_studio_app::TemplateApp::new(cc))), | ||
) | ||
} | ||
|
||
// When compiling to web using trunk: | ||
#[cfg(target_arch = "wasm32")] | ||
fn main() { | ||
// Redirect `log` message to `console.log` and friends: | ||
eframe::WebLogger::init(log::LevelFilter::Debug).ok(); | ||
|
||
let web_options = eframe::WebOptions::default(); | ||
|
||
wasm_bindgen_futures::spawn_local(async { | ||
eframe::WebRunner::new() | ||
.start( | ||
"the_canvas_id", // hardcode it | ||
web_options, | ||
Box::new(|cc| Box::new(nes_studio_app::TemplateApp::new(cc))), | ||
) | ||
.await | ||
.expect("failed to start eframe"); | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,12 @@ | ||
[package] | ||
name = "nes-studio" | ||
version = "0.1.0" | ||
authors = ["Glen Henri J. De Cauwsemaecker <[email protected]>"] | ||
edition = "2021" | ||
|
||
|
||
[dependencies] | ||
egui = "0.23.0" | ||
eframe = { version = "0.23.0", default-features = false, features = [ | ||
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies. | ||
"default_fonts", # Embed the default egui fonts. | ||
"wgpu", # Use the wgpu rendering backend. | ||
"persistence", # Enable restoring app state when restarting the app. | ||
] } | ||
log = "0.4" | ||
|
||
# You only need serde if you want app persistence: | ||
serde = { version = "1", features = ["derive"] } | ||
|
||
# native: | ||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
env_logger = "0.10" | ||
|
||
# web: | ||
[target.'cfg(target_arch = "wasm32")'.dependencies] | ||
wasm-bindgen-futures = "0.4" | ||
|
||
|
||
[profile.release] | ||
opt-level = 2 # fast and small wasm | ||
|
||
# Optimize all dependencies even in debug builds: | ||
[profile.dev.package."*"] | ||
opt-level = 2 | ||
|
||
|
||
[patch.crates-io] | ||
|
||
# If you want to use the bleeding edge version of egui and eframe: | ||
# egui = { git = "https://github.com/emilk/egui", branch = "master" } | ||
# eframe = { git = "https://github.com/emilk/egui", branch = "master" } | ||
|
||
# If you fork https://github.com/emilk/egui you can test with: | ||
# egui = { path = "../egui/crates/egui" } | ||
# eframe = { path = "../egui/crates/eframe" } | ||
axum = "0.6" | ||
shuttle-axum = "0.29" | ||
shuttle-runtime = "0.29" | ||
tokio = "1.28" | ||
tower = { version = "0.4", features = ["tracing"] } | ||
tower-http = { version = "0.4", features = ["fs", "trace", "compression-full", "normalize-path"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,22 @@ | ||
#![warn(clippy::all, rust_2018_idioms)] | ||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release | ||
use std::path::PathBuf; | ||
|
||
// When compiling natively: | ||
#[cfg(not(target_arch = "wasm32"))] | ||
fn main() -> eframe::Result<()> { | ||
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`). | ||
use axum::Router; | ||
use tower::ServiceBuilder; | ||
use tower_http::{ | ||
compression::CompressionLayer, normalize_path::NormalizePathLayer, services::ServeDir, | ||
trace::TraceLayer, | ||
}; | ||
|
||
let native_options = eframe::NativeOptions { | ||
initial_window_size: Some([400.0, 300.0].into()), | ||
min_window_size: Some([300.0, 220.0].into()), | ||
..Default::default() | ||
}; | ||
eframe::run_native( | ||
"eframe template", | ||
native_options, | ||
Box::new(|cc| Box::new(nes_studio::TemplateApp::new(cc))), | ||
) | ||
} | ||
|
||
// When compiling to web using trunk: | ||
#[cfg(target_arch = "wasm32")] | ||
fn main() { | ||
// Redirect `log` message to `console.log` and friends: | ||
eframe::WebLogger::init(log::LevelFilter::Debug).ok(); | ||
|
||
let web_options = eframe::WebOptions::default(); | ||
#[shuttle_runtime::main] | ||
async fn main() -> shuttle_axum::ShuttleAxum { | ||
let router = Router::new() | ||
.nest_service("/", ServeDir::new(PathBuf::from("nes-studio-app/dist"))) | ||
.layer( | ||
ServiceBuilder::new() | ||
.layer(TraceLayer::new_for_http()) | ||
.layer(CompressionLayer::new()) | ||
.layer(NormalizePathLayer::trim_trailing_slash()), | ||
); | ||
|
||
wasm_bindgen_futures::spawn_local(async { | ||
eframe::WebRunner::new() | ||
.start( | ||
"the_canvas_id", // hardcode it | ||
web_options, | ||
Box::new(|cc| Box::new(nes_studio::TemplateApp::new(cc))), | ||
) | ||
.await | ||
.expect("failed to start eframe"); | ||
}); | ||
Ok(router.into()) | ||
} |