distributed_cli 4.0.0

The `distributed` CLI for Distributed applications: contracts check/accept, scaffold projects, describe manifests, compile clients, and render schema artifacts. Also a library so other CLIs (e.g. hops) can mount its commands.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::super::ClientCompileError;

pub(super) fn quoted_property(value: &str) -> String {
    // GraphQL response keys are valid identifiers, but quoting them prevents
    // TypeScript keyword collisions without inventing a second public name.
    serde_json::to_string(value).expect("string serialization cannot fail")
}

pub(super) fn json_string(value: &str) -> Result<String, ClientCompileError> {
    serde_json::to_string(value).map_err(|error| {
        ClientCompileError::manifest(
            "client.render.string",
            format!("failed to render generated string literal: {error}"),
        )
    })
}