Skip to content

Commit

Permalink
refactor: Share models between backend and frontend (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrzlgnm authored Oct 30, 2024
1 parent 2c34f27 commit 52f7bcc
Show file tree
Hide file tree
Showing 12 changed files with 548 additions and 379 deletions.
1 change: 1 addition & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
enhancement: ["feature/*", "feat/*"]
chore: ["chore/*"]
refactor: ["refactor/*"]
documentation: ["docs/*"]
dependencies: ["renovate/*"]
bug: ["fix/*", "bugfix/*"]
2 changes: 2 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
workspaces: |
.
src-tauri
models
shared_constants
- name: 📥 Cached install trunk
uses: taiki-e/cache-cargo-install-action@caa6f48d18d42462f9c30df89e2b4f71a42b7c2c # v2.0.1
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/desktop-tauri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
workspaces: |
.
src-tauri
models
shared_constants
- name: 🌍 Export GitHub Actions cache environment variables windows
if: contains(matrix.os, 'windows')
Expand Down Expand Up @@ -115,7 +117,7 @@ jobs:
- name: ✅ Run tests
run: |
cargo test
cargo test --all
- name: 📥 Cached install trunk
uses: taiki-e/cache-cargo-install-action@caa6f48d18d42462f9c30df89e2b4f71a42b7c2c # v2.0.1
Expand Down
5 changes: 4 additions & 1 deletion .taurignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/src
/shared_constants
/models
/public
/Cargo.toml
/Cargo.toml

9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ opt-level = "z" # Optimize for binary size
strip = true # Remove debug symbols

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# crates
chrono = "0.4.38"
console_error_panic_hook = "0.1.7"
console_log = "1.0.0"
Expand All @@ -25,14 +27,19 @@ log = "0.4.22"
serde = { version = "1.0.210", features = ["derive"] }
serde-wasm-bindgen = "0.6.5"
strsim = "0.11.1"
thaw = { version = "0.3.4", features = ["csr"] }
thaw_utils = { version = "0.0.6", features = ["csr"] }
tokio = "1.40.0"

# git
tauri-sys = { git = "https://github.com/JonasKruckenberg/tauri-sys", branch = "v2", features = [
"core",
"event",
] }
thaw = { version = "0.3.4", features = ["csr"] }
thaw_utils = { version = "0.0.6", features = ["csr"] }
tokio = "1.40.0"

# local
shared_constants = { path = "./shared_constants" }
models = { path = "./models" }

[workspace]
members = ["shared_constants", "src-tauri"]
members = ["models", "shared_constants", "src-tauri"]
7 changes: 7 additions & 0 deletions models/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "models"
version = "0.1.0"
edition = "2021"

[dependencies]
serde = { version = "1.0.210", features = ["derive"] }
Loading

0 comments on commit 52f7bcc

Please sign in to comment.