From f01cf2b7ea0fff2a41d145265dcd5bcc33f14a4b Mon Sep 17 00:00:00 2001 From: Andrew Stein Date: Mon, 2 Sep 2024 21:22:02 -0400 Subject: [PATCH] Support packaging in CI Signed-off-by: Andrew Stein --- .cargo/config.toml | 1 + .github/actions/install-deps/action.yaml | 6 ++--- rust-toolchain.toml | 2 +- rust/bootstrap-runtime/lib.rs | 1 + .../src/rust/config/plugin.rs | 10 ++++--- rust/perspective-client/src/rust/session.rs | 12 ++++----- rust/perspective-client/src/rust/table.rs | 4 +-- .../src/rust/utils/console_logger.rs | 11 ++++---- rust/perspective-js/src/rust/utils/errors.rs | 5 +++- rust/perspective-js/src/rust/utils/futures.rs | 4 ++- .../src/less/status-bar.less | 9 ++++--- .../components/containers/dragdrop_list.rs | 4 ++- .../rust/components/datetime_column_style.rs | 4 +-- .../src/rust/components/form/mod.rs | 7 ++--- .../rust/components/number_column_style.rs | 10 +++---- .../rust/components/string_column_style.rs | 4 +-- .../src/rust/components/style/mod.rs | 10 ++++--- .../rust/components/style/style_provider.rs | 7 ++--- .../src/rust/config/columns_config.rs | 1 + .../src/rust/config/number_column_style.rs | 9 ++++--- .../src/rust/custom_elements/debug_plugin.rs | 13 ++++----- .../src/rust/custom_elements/modal.rs | 6 +++-- .../src/rust/exprtk/cursor.rs | 2 ++ .../src/rust/exprtk/tokenize.rs | 9 ++++--- .../perspective-viewer/src/rust/js/testing.rs | 6 +++-- rust/perspective-viewer/src/rust/lib.rs | 6 +++-- .../src/rust/model/columns_iter_set.rs | 2 ++ .../src/rust/model/copy_export.rs | 2 ++ .../src/rust/model/get_viewer_config.rs | 9 ++++--- .../src/rust/model/plugin_column_styles.rs | 27 ++++++++++--------- .../src/rust/model/update_and_render.rs | 2 ++ rust/perspective-viewer/src/rust/utils/mod.rs | 7 ++--- .../src/rust/utils/pubsub.rs | 13 +++++---- rust/perspective-viewer/src/rust/utils/tee.rs | 21 ++++++++------- 34 files changed, 143 insertions(+), 103 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index f14f7f5a53..486fe209d8 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -20,6 +20,7 @@ frequency = 'never' [unstable] bindeps = true +package-workspace = true [term] quiet = false diff --git a/.github/actions/install-deps/action.yaml b/.github/actions/install-deps/action.yaml index d62ea00557..f45a21e71c 100644 --- a/.github/actions/install-deps/action.yaml +++ b/.github/actions/install-deps/action.yaml @@ -148,7 +148,7 @@ runs: uses: dtolnay/rust-toolchain@nightly if: ${{ inputs.rust == 'true' && inputs.arch != 'aarch64' }} with: - toolchain: nightly-2024-05-07 + toolchain: nightly-2024-08-29 targets: wasm32-unknown-unknown components: rustfmt, clippy, rust-src @@ -156,7 +156,7 @@ runs: uses: dtolnay/rust-toolchain@nightly if: ${{ inputs.rust == 'true' && inputs.arch == 'aarch64' && runner.os == 'macOS' }} with: - toolchain: nightly-2024-05-07 + toolchain: nightly-2024-08-29 targets: aarch64-apple-darwin components: rustfmt, clippy, rust-src @@ -164,7 +164,7 @@ runs: uses: dtolnay/rust-toolchain@nightly if: ${{ inputs.rust == 'true' && inputs.arch == 'aarch64' && runner.os == 'Linux' }} with: - toolchain: nightly-2024-05-07 + toolchain: nightly-2024-08-29 targets: aarch64-unknown-linux-gnu components: rustfmt, clippy, rust-src diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 0c2fc7a56c..7822610563 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -11,6 +11,6 @@ # ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ [toolchain] -channel = "nightly-2024-05-07" +channel = "nightly-2024-08-29" components = ["rustfmt", "clippy", "rust-src"] targets = ["wasm32-unknown-unknown", "wasm32-unknown-emscripten"] diff --git a/rust/bootstrap-runtime/lib.rs b/rust/bootstrap-runtime/lib.rs index 2449960d39..5254f58a69 100644 --- a/rust/bootstrap-runtime/lib.rs +++ b/rust/bootstrap-runtime/lib.rs @@ -37,6 +37,7 @@ use alloc::vec::Vec; use zune_inflate::DeflateDecoder; +#[allow(unused_unsafe)] #[global_allocator] static ALLOCATOR: talc::Talck = { static mut MEMORY: [u8; 64000000] = [0; 64000000]; diff --git a/rust/perspective-client/src/rust/config/plugin.rs b/rust/perspective-client/src/rust/config/plugin.rs index 7b5f21662a..a3a80f5a29 100644 --- a/rust/perspective-client/src/rust/config/plugin.rs +++ b/rust/perspective-client/src/rust/config/plugin.rs @@ -46,9 +46,11 @@ pub struct DefaultStyleAttributes { pub bool: serde_json::Value, } -/// The data needed to populate a column's settings. These are typically default -/// values, a listing of possible values, or other basic configuration settings -/// for the plugin. This is the result of calling plugin.plugin_attributes +/// The data needed to populate a column's settings. +/// +/// These are typically default values, a listing of possible values, or other +/// basic configuration settings for the plugin. This is the result of calling +/// plugin.plugin_attributes #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] pub struct PluginAttributes { pub symbol: Option, @@ -64,4 +66,4 @@ pub struct PluginConfig { /// Refers to the currently active columns. Maps name to configuration. #[serde(default)] pub columns: HashMap, -} \ No newline at end of file +} diff --git a/rust/perspective-client/src/rust/session.rs b/rust/perspective-client/src/rust/session.rs index ffd863f92c..816fea34e0 100644 --- a/rust/perspective-client/src/rust/session.rs +++ b/rust/perspective-client/src/rust/session.rs @@ -22,12 +22,12 @@ use crate::{Client, ClientError}; #[cfg(doc)] use crate::{Table, View}; -/// The server-side representation of a connection to a -/// [`Client`]. For each [`Client`] that -/// wants to connect to a `perspective_server::Server`, a dedicated [`Session`] -/// must be created. The [`Session`] handles routing messages emitted by the -/// `perspective_server::Server`ve_server::Server`, as well as owning any -/// resources the [`Client`] may request. +/// The server-side representation of a connection to a [`Client`]. +/// +/// For each [`Client`] that wants to connect to a `perspective_server::Server`, +/// a dedicated [`Session`] must be created. The [`Session`] handles routing +/// messages emitted by the `perspective_server::Server`ve_server::Server`, as +/// well as owning any resources the [`Client`] may request. pub trait Session { /// Handle an incoming request from the [`Client`]. Calling /// [`Session::handle_request`] will result in the `send_response` parameter diff --git a/rust/perspective-client/src/rust/table.rs b/rust/perspective-client/src/rust/table.rs index 92391df914..6b2528e55c 100644 --- a/rust/perspective-client/src/rust/table.rs +++ b/rust/perspective-client/src/rust/table.rs @@ -32,9 +32,7 @@ use crate::view::View; pub type Schema = HashMap; /// Options which impact the behavior of [`Client::table`], as well as -/// subsequent calls to [`Table::update`], even though this latter method -/// itself does not take [`TableInitOptions`] as an argument, since this -/// parameter is fixed at creation. +/// subsequent calls to [`Table::update`]. #[derive(Clone, Debug, Default, Serialize, Deserialize, TS)] pub struct TableInitOptions { #[serde(default)] diff --git a/rust/perspective-js/src/rust/utils/console_logger.rs b/rust/perspective-js/src/rust/utils/console_logger.rs index d19af34428..b188dd1670 100644 --- a/rust/perspective-js/src/rust/utils/console_logger.rs +++ b/rust/perspective-js/src/rust/utils/console_logger.rs @@ -200,11 +200,12 @@ impl LookupSpan<'a>> Layer for WasmLogger { } } -/// Configure `WasmLogger` as a global default for tracing. This operation will -/// conflict with any other library which sets a global default -/// `tracing::Subscriber`, so it should not be called when `perspective` is used -/// as a library from a larger app; in this case the app itself should configure -/// `tracing` explicitly. +/// Configure `WasmLogger` as a global default for tracing. +/// +/// This operation will conflict with any other library which sets a global +/// default `tracing::Subscriber`, so it should not be called when `perspective` +/// is used as a library from a larger app; in this case the app itself should +/// configure `tracing` explicitly. pub fn set_global_logging() { static INIT_LOGGING: OnceLock<()> = OnceLock::new(); INIT_LOGGING.get_or_init(|| { diff --git a/rust/perspective-js/src/rust/utils/errors.rs b/rust/perspective-js/src/rust/utils/errors.rs index cbbfc08cfa..c14b26ad05 100644 --- a/rust/perspective-js/src/rust/utils/errors.rs +++ b/rust/perspective-js/src/rust/utils/errors.rs @@ -15,7 +15,9 @@ use std::fmt::Display; use wasm_bindgen::prelude::*; /// A bespoke error class for chaining a litany of various error types with the -/// `?` operator. `anyhow`, `web_sys::JsError` are candidates for replacing +/// `?` operator. +/// +/// `anyhow`, `web_sys::JsError` are candidates for replacing /// this, but we'd need a way to get around syntacitc conveniences we get /// from avoiding orphan instance issues (e.g. converting `JsValue` to an error /// in `anyhow`). @@ -23,6 +25,7 @@ use wasm_bindgen::prelude::*; /// We'd still like to implement this, but instead must independently implement /// the instance for each error, as otherwise `rustc` will complain that the /// `wasm_bindgen` authors may themselves implement `Error` for `JsValue`. +/// /// ``` /// impl From for ApiError /// where diff --git a/rust/perspective-js/src/rust/utils/futures.rs b/rust/perspective-js/src/rust/utils/futures.rs index 5aa61b9001..880cb70717 100644 --- a/rust/perspective-js/src/rust/utils/futures.rs +++ b/rust/perspective-js/src/rust/utils/futures.rs @@ -25,7 +25,9 @@ use wasm_bindgen_futures::{future_to_promise, JsFuture}; use super::errors::*; /// A newtype wrapper for a `Future` trait object which supports being -/// marshalled to a `JsPromise`, avoiding an API which requires type casting to +/// marshalled to a `JsPromise`. +/// +/// This avoids implementing an API which requires type casting to /// and from `JsValue` and the associated loss of type safety. #[must_use] pub struct ApiFuture(Pin>>>) diff --git a/rust/perspective-viewer/src/less/status-bar.less b/rust/perspective-viewer/src/less/status-bar.less index c2348400ba..e01c6fabad 100644 --- a/rust/perspective-viewer/src/less/status-bar.less +++ b/rust/perspective-viewer/src/less/status-bar.less @@ -140,10 +140,6 @@ flex: 0 1000000 auto; .button { height: 22px; - select { - height: 20px; - font-size: var(--label--font-size, 0.75em); - } } } @@ -295,12 +291,17 @@ } #theme { + height: 48px; &:before { -webkit-mask-image: url("../svg/theme-icon.svg"); mask-image: url("../svg/theme-icon.svg"); } } + #menu-bar .button select#theme_selector { + height: 48px; + } + .button { display: inline-flex; justify-content: center; diff --git a/rust/perspective-viewer/src/rust/components/containers/dragdrop_list.rs b/rust/perspective-viewer/src/rust/components/containers/dragdrop_list.rs index 340781ec54..cbb0bf944c 100644 --- a/rust/perspective-viewer/src/rust/components/containers/dragdrop_list.rs +++ b/rust/perspective-viewer/src/rust/components/containers/dragdrop_list.rs @@ -81,7 +81,9 @@ pub enum DragDropListMsg { } /// A sub-selector for a list-like component of a `JsViewConfig`, such as -/// `filters` and `sort`. `DragDropList` is parameterized by two `Component` +/// `filters` and `sort`. +/// +/// `DragDropList` is parameterized by two `Component` /// types, the parent component `T` and the inner item compnent `U`, which must /// additionally implement `DragDropListItemProps` trait on its own `Properties` /// associated type. diff --git a/rust/perspective-viewer/src/rust/components/datetime_column_style.rs b/rust/perspective-viewer/src/rust/components/datetime_column_style.rs index b81c449d72..090090d959 100644 --- a/rust/perspective-viewer/src/rust/components/datetime_column_style.rs +++ b/rust/perspective-viewer/src/rust/components/datetime_column_style.rs @@ -94,9 +94,7 @@ impl PartialEq for DatetimeColumnStyleProps { } } -/// The `ColumnStyle` component stores its UI state privately in its own struct, -/// rather than its props (which has two version of this data itself, the -/// JSON serializable config record and the defaults record). +/// Column style controls for the `datetime` type. #[derive(Debug)] pub struct DatetimeColumnStyle { config: DatetimeColumnStyleConfig, diff --git a/rust/perspective-viewer/src/rust/components/form/mod.rs b/rust/perspective-viewer/src/rust/components/form/mod.rs index cdf35a7177..cc9303300d 100644 --- a/rust/perspective-viewer/src/rust/components/form/mod.rs +++ b/rust/perspective-viewer/src/rust/components/form/mod.rs @@ -11,9 +11,10 @@ // ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ //! A module for form controls (though form controls like `