fix(daemon): ship the OpenRPC document inside the crate
docs/openrpc.json lived at the repository root, outside the soulseek-rs package, so the include_str! in proto compiled from a checkout but not from the published tarball - cargo publish failed verification and the v13.0.0 release stopped after publishing the lib. The document moves into the crate's own docs/, where packaging can see it; the generator test and every link follow.
This commit is contained in:
@@ -348,10 +348,10 @@ fn document() -> Value {
|
||||
})
|
||||
}
|
||||
|
||||
/// Where the published document lives, relative to this source file.
|
||||
/// Where the published document lives. Inside this crate, not the repository's
|
||||
/// docs/: `include_str!` has to find it in the published package too.
|
||||
fn document_path() -> std::path::PathBuf {
|
||||
std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("..")
|
||||
.join("docs")
|
||||
.join("openrpc.json")
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ pub const PROTOCOL_VERSION: u32 = 1;
|
||||
|
||||
/// The OpenRPC document, served by `rpc.discover` so a generator can point at
|
||||
/// a running daemon instead of needing this repository.
|
||||
pub const OPENRPC: &str = include_str!("../../../../docs/openrpc.json");
|
||||
pub const OPENRPC: &str = include_str!("../../../docs/openrpc.json");
|
||||
|
||||
mod dto;
|
||||
mod envelope;
|
||||
|
||||
Reference in New Issue
Block a user