mirror of
https://github.com/zellij-org/zellij.git
synced 2024-11-26 22:15:19 +03:00
8031d6bf64
* xtask/pipeline: Fix publish task which was previously stuck in an infinite loop after successfully publishing a crate. The error originated in the code only checking for error conditions but not breaking out of the inner infinite loop in case of success. * xtask: Improve publish failure UX by offering the user more actions to choose from when an error occured. * utils/assets: Add generated prost files to assets to make sure they're available at build time and are picked up by all components. It seems we hit some strange bug with the build script where, when running `cargo publish --dry-run` the build script **is not** run before regularly compiling zellij-utils. This shouldn't happen according to the docs, but I cannot explain what's causing it. So we're using this as a workaround for now to make a smooth release. * xtask: Prevent accidental git commit deletion when dry-running a publish. * utils: Add comments to protobuf-related code to explain why these changes were performed. The comments all include a link to an issue comment explaining the situation in greater detail. * xtask: Build protobuf definitions when building any part of the project, similar to how we build the plugins when required. This should ensure that all crates built through `cargo xtask` (which is the officially supported build method) will receive up-to-date protobuf definitions.
132 lines
4.6 KiB
Rust
132 lines
4.6 KiB
Rust
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct Style {
|
|
#[prost(message, optional, tag = "1")]
|
|
pub palette: ::core::option::Option<Palette>,
|
|
#[prost(bool, tag = "2")]
|
|
pub rounded_corners: bool,
|
|
#[prost(bool, tag = "3")]
|
|
pub hide_session_name: bool,
|
|
}
|
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct Palette {
|
|
#[prost(enumeration = "ThemeHue", tag = "1")]
|
|
pub theme_hue: i32,
|
|
#[prost(message, optional, tag = "2")]
|
|
pub fg: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "3")]
|
|
pub bg: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "4")]
|
|
pub black: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "5")]
|
|
pub red: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "6")]
|
|
pub green: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "7")]
|
|
pub yellow: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "8")]
|
|
pub blue: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "9")]
|
|
pub magenta: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "10")]
|
|
pub cyan: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "11")]
|
|
pub white: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "12")]
|
|
pub orange: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "13")]
|
|
pub gray: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "14")]
|
|
pub purple: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "15")]
|
|
pub gold: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "16")]
|
|
pub silver: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "17")]
|
|
pub pink: ::core::option::Option<Color>,
|
|
#[prost(message, optional, tag = "18")]
|
|
pub brown: ::core::option::Option<Color>,
|
|
}
|
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct Color {
|
|
#[prost(enumeration = "ColorType", tag = "1")]
|
|
pub color_type: i32,
|
|
#[prost(oneof = "color::Payload", tags = "2, 3")]
|
|
pub payload: ::core::option::Option<color::Payload>,
|
|
}
|
|
/// Nested message and enum types in `Color`.
|
|
pub mod color {
|
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
#[derive(Clone, PartialEq, ::prost::Oneof)]
|
|
pub enum Payload {
|
|
#[prost(message, tag = "2")]
|
|
RgbColorPayload(super::RgbColorPayload),
|
|
#[prost(uint32, tag = "3")]
|
|
EightBitColorPayload(u32),
|
|
}
|
|
}
|
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
pub struct RgbColorPayload {
|
|
#[prost(uint32, tag = "1")]
|
|
pub red: u32,
|
|
#[prost(uint32, tag = "2")]
|
|
pub green: u32,
|
|
#[prost(uint32, tag = "3")]
|
|
pub blue: u32,
|
|
}
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
|
#[repr(i32)]
|
|
pub enum ColorType {
|
|
Rgb = 0,
|
|
EightBit = 1,
|
|
}
|
|
impl ColorType {
|
|
/// String value of the enum field names used in the ProtoBuf definition.
|
|
///
|
|
/// The values are not transformed in any way and thus are considered stable
|
|
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
|
|
pub fn as_str_name(&self) -> &'static str {
|
|
match self {
|
|
ColorType::Rgb => "Rgb",
|
|
ColorType::EightBit => "EightBit",
|
|
}
|
|
}
|
|
/// Creates an enum from field names used in the ProtoBuf definition.
|
|
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
|
|
match value {
|
|
"Rgb" => Some(Self::Rgb),
|
|
"EightBit" => Some(Self::EightBit),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
|
#[repr(i32)]
|
|
pub enum ThemeHue {
|
|
Dark = 0,
|
|
Light = 1,
|
|
}
|
|
impl ThemeHue {
|
|
/// String value of the enum field names used in the ProtoBuf definition.
|
|
///
|
|
/// The values are not transformed in any way and thus are considered stable
|
|
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
|
|
pub fn as_str_name(&self) -> &'static str {
|
|
match self {
|
|
ThemeHue::Dark => "Dark",
|
|
ThemeHue::Light => "Light",
|
|
}
|
|
}
|
|
/// Creates an enum from field names used in the ProtoBuf definition.
|
|
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
|
|
match value {
|
|
"Dark" => Some(Self::Dark),
|
|
"Light" => Some(Self::Light),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|