You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
3.6 KiB
TOML
89 lines
3.6 KiB
TOML
[package]
|
|
name = "quotesdb"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
license = "MIT OR Apache-2.0"
|
|
default-run = "api"
|
|
|
|
[[bin]]
|
|
name = "api"
|
|
path = "src/bin/api/main.rs"
|
|
|
|
[[bin]]
|
|
name = "ui"
|
|
path = "src/bin/ui/main.rs"
|
|
|
|
# Shared dependencies: compile for both native host and wasm32-unknown-unknown.
|
|
[dependencies]
|
|
common = { path = "../common" }
|
|
# UUID v4 for database primary keys; serde feature for serialisation.
|
|
uuid = { version = "1", features = ["v4", "serde"] }
|
|
# OsRng-based passphrase generation (WASM-compatible via getrandom/wasm_js).
|
|
rand = "0.9"
|
|
# Serialisation for shared types (API request/response models, Quote structs).
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
# Error types with Display/std::error::Error derive — works on both native and wasm32.
|
|
thiserror = "2"
|
|
|
|
# Native-only dependencies (API server binary).
|
|
# tokio, axum, and rusqlite are incompatible with wasm32-unknown-unknown.
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
# Async runtime for the native API server.
|
|
tokio = { version = "1", features = ["full"] }
|
|
# HTTP framework for the native API server.
|
|
axum = { version = "0.8", features = ["json"] }
|
|
# SQLite driver for local development (native only; production uses Cloudflare D1).
|
|
# Version pinned to 0.32 to match tokio-rusqlite 0.6's transitive dependency.
|
|
rusqlite = { version = "0.32", features = ["bundled"] }
|
|
# Async wrapper around rusqlite for use with Tokio.
|
|
tokio-rusqlite = "0.6"
|
|
# Async trait support for the QuoteRepository abstraction.
|
|
async-trait = "0.1"
|
|
|
|
# WASM-only dependencies (Workers API binary + UI binary).
|
|
# workers-rs, getrandom/wasm_js, and UI libraries are wasm32-specific.
|
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
# Add the `js` feature to uuid on wasm32 to enable Web Crypto entropy for v4 UUIDs.
|
|
uuid = { version = "1", features = ["js"] }
|
|
# Cloudflare Workers SDK — provides D1 bindings, fetch, KV, etc.
|
|
worker = { version = "0.5", features = ["d1"] }
|
|
# Entropy source for WASM targets: bridges uuid (v4) and rand (OsRng) to
|
|
# crypto.getRandomValues() via the Web Crypto API.
|
|
getrandom = { version = "0.4", features = ["wasm_js"] }
|
|
# getrandom 0.3 is a transitive dep of rand 0.9 → rand_core 0.9; enable wasm_js feature.
|
|
getrandom_03 = { package = "getrandom", version = "0.3", features = ["wasm_js"] }
|
|
# Yew — Rust/Wasm frontend framework for building the SPA UI.
|
|
yew = { version = "0.22", features = ["csr"] }
|
|
# Yew Router — client-side routing for Yew SPAs.
|
|
yew-router = "0.19"
|
|
# Gloo — utility wrappers for Web APIs (timers, fetch, events, etc.).
|
|
gloo = "0.11"
|
|
# wasm-bindgen — Rust/Wasm JS interop; version must match wasm-bindgen-cli in Nix (0.2.108).
|
|
wasm-bindgen = "0.2"
|
|
# wasm-bindgen-futures — bridges Rust futures to JS Promises for async fetch.
|
|
wasm-bindgen-futures = "0.4"
|
|
# web-sys — raw browser DOM/Web API bindings. Storage and SessionStorage for auth code persistence.
|
|
web-sys = { version = "0.3", features = ["Window", "Document", "HtmlElement", "Storage"] }
|
|
# js-sys — JS standard library bindings, used for URL encoding in API client.
|
|
js-sys = "0.3"
|
|
|
|
# Build-time dependencies for compile-time YAML-to-JSON conversion of the
|
|
# OpenAPI spec. serde_yaml is only needed at build time — it never enters
|
|
# the Workers binary or native binary.
|
|
[build-dependencies]
|
|
serde_json = "1"
|
|
serde_yaml = "0.9"
|
|
|
|
[dev-dependencies]
|
|
# `ServiceExt::oneshot` for sending single test requests to an Axum router.
|
|
tower = { version = "0.5", features = ["util"] }
|
|
# Temporary files for integration test SQLite databases.
|
|
tempfile = "3"
|
|
|
|
[profile.release]
|
|
opt-level = "z"
|
|
lto = true
|
|
strip = true
|
|
codegen-units = 1
|