vault-link/sync-server/build.rs
Andras Schmelczer 4d4ffa160a
Some checks failed
Check / build (pull_request) Has been cancelled
E2E tests / build (pull_request) Has been cancelled
Publish CLI / publish-docker (pull_request) Has been cancelled
Publish server Docker image / publish-docker (pull_request) Has been cancelled
Add history-ui workspace and supporting server endpoints
Splits history-ui out of asch/fix-everything into its own branch off
main. Includes the Svelte workspace, the three dedicated server
endpoints (list_vaults, fetch_vault_history, fetch_document_versions),
SPA asset embedding via rust-embed, and the matching TS mirror types in
sync-client.

Note: this branch will not compile against main on its own — the new
endpoints depend on database/error/config additions that live on
asch/fix-everything. Intended to be merged once asch/fix-everything
lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 11:37:22 +01:00

16 lines
710 B
Rust

fn main() {
// trigger recompilation when a new migration is added
println!("cargo:rerun-if-changed=migrations");
// Ensure the history-ui dist directory exists so rust-embed can compile
// even when the frontend hasn't been built yet.
let dist_path = std::path::Path::new("../frontend/history-ui/dist");
if !dist_path.exists() {
std::fs::create_dir_all(dist_path).expect("Failed to create history-ui dist directory");
std::fs::write(
dist_path.join("index.html"),
"<!DOCTYPE html><html><body><p>Run <code>npm run build -w history-ui</code> first.</p></body></html>",
)
.expect("Failed to write placeholder index.html");
}
}