Automatically start web server when using cargo run

This commit is contained in:
Dennis Kobert 2025-02-28 18:08:00 +01:00
parent b6cdcba9e8
commit 8dd4124817
No known key found for this signature in database
GPG key ID: 5A4358CB9530F933
9 changed files with 18 additions and 2 deletions

View file

@ -24,6 +24,8 @@ members = [
exclude = ["node-graph/gpu-compiler"]
resolver = "2"
default-members = ["frontend/wasm"]
[workspace.dependencies]
# Local dependencies
dyn-any = { path = "libraries/dyn-any", features = ["derive", "glam", "reqwest"] }

View file

@ -8,6 +8,7 @@
"scripts": {
"---------- DEV SERVER ----------": "",
"start": "npm run setup && npm run wasm:build-dev && concurrently -k -n \"VITE,RUST\" \"vite\" \"npm run wasm:watch-dev\"",
"start-cargo": "npm run setup && npm run wasm:build-dev && concurrently -k -n \"VITE,RUST\" \"vite\" \"npm run wasm:watch-dev\" && echo",
"profiling": "npm run setup && npm run wasm:build-profiling && concurrently -k -n \"VITE,RUST\" \"vite\" \"npm run wasm:watch-profiling\"",
"production": "npm run setup && npm run wasm:build-production && concurrently -k -n \"VITE,RUST\" \"vite\" \"npm run wasm:watch-production\"",
"---------- BUILDS ----------": "",

View file

@ -5,7 +5,7 @@ description = "Graphite Desktop"
authors = ["Graphite Authors <contact@graphite.rs>"]
license = "Apache-2.0"
repository = ""
default-run = "graphite-desktop"
# default-run = "graphite-desktop"
edition = "2021"
rust-version = "1.79"

View file

@ -1,4 +1,5 @@
[target.wasm32-unknown-unknown]
runner = "npm start"
rustflags = [
# Currently disabled because of https://github.com/GraphiteEditor/Graphite/issues/1262
# The current simd implementation leads to undefined behavior
@ -10,3 +11,6 @@ rustflags = [
"link-arg=--max-memory=4294967296",
"--cfg=web_sys_unstable_apis",
]
[target.x86_64-unknown-linux-gnu]
runner = "npm run start-cargo"

View file

@ -9,6 +9,7 @@ readme = "../../README.md"
homepage = "https://graphite.rs"
repository = "https://github.com/GraphiteEditor/Graphite"
license = "Apache-2.0"
default-run = "graphite-wasm"
[features]
default = ["gpu"]

View file

@ -0,0 +1,2 @@
[target.x86_64-unknown-linux-gnu]
runner = "npm run start-cargo"

View file

@ -0,0 +1,2 @@
[target.x86_64-unknown-linux-gnu]
runner = "npm run start-cargo"

View file

@ -0,0 +1,2 @@
[target.x86_64-unknown-linux-gnu]
runner = "npm run cmd"

View file

@ -2,6 +2,8 @@
"description": "A convenience package for calling the real package.json in ./frontend",
"private": true,
"scripts": {
"start": "cd frontend && npm start"
"start": "cd frontend && npm start",
"start-cargo": "cd frontend && npm run start-cargo",
"cmd": "true &&"
}
}