Skip to content

Commit 16dd11c

Browse files
committed
revision: readd sdk crate
1 parent 974c88e commit 16dd11c

File tree

5 files changed

+86
-5
lines changed

5 files changed

+86
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ package.repository = "https://github.com/DioxusLabs/sdk/"
1313
dioxus-time = { path = "packages/time" }
1414
dioxus-storage = { path = "packages/storage" }
1515
dioxus-geolocation = { path = "packages/geolocation" }
16+
dioxus-notification = { path = "packages/notification" }
1617
dioxus-sync = { path = "packages/sync" }
1718
dioxus-window = { path = "packages/window" }
1819

packages/sdk/Cargo.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[package]
2+
name = "dioxus-sdk"
3+
version = "0.7.0"
4+
5+
description = "A platform agnostic library for supercharging your productivity with Dioxus."
6+
readme = "../../README.md"
7+
keywords = ["gui", "dioxus", "hooks"]
8+
categories = ["gui", "wasm"]
9+
10+
edition.workspace = true
11+
authors.workspace = true
12+
license.workspace = true
13+
homepage.workspace = true
14+
repository.workspace = true
15+
16+
[dependencies]
17+
dioxus-geolocation = { workspace = true, optional = true }
18+
dioxus-notification = { workspace = true, optional = true }
19+
dioxus-storage = { workspace = true, optional = true }
20+
dioxus-sync = { workspace = true, optional = true }
21+
dioxus-time = { workspace = true, optional = true }
22+
dioxus-window = { workspace = true, optional = true }
23+
24+
[features]
25+
geolocation = ["dep:dioxus-geolocation"]
26+
notification = ["dep:dioxus-notification"]
27+
storage = ["dep:dioxus-storage"]
28+
sync = ["dep:dioxus-sync"]
29+
time = ["dep:dioxus-time"]
30+
window = ["dep:dioxus-window"]
31+
32+
[package.metadata.docs.rs]
33+
all-features = true

packages/sdk/src/lib.rs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//! # Dioxus SDK
2+
//! The Dioxus SDK is a group of platform agnostic crates for common apis and functionality.
3+
//!
4+
//! This crate, `dioxus-sdk`, acts as an entrypoint to explore the variety of crates in the SDK ecosystem.
5+
//! Individual crates from the SDK ecosystem can be used directly from `crates.io` or you can enable the
6+
//! corresponding feature for a crate here.
7+
//!
8+
//! SDK is growing, and not all functionality supports every platform. Platform support will be documented in
9+
//! each crate, and in the majority of cases a runtime `Err(Unsupported)` will be returned if you target an unsupported platform.
10+
//!
11+
//! ## Available Crates
12+
//! Below is a table of the crates in our ecosystem, a short description, and their corresponding feature flag.
13+
//!
14+
//! | Crate | Description | Feature |
15+
//! | ------------------------- | ------------------------------------- | ----------------- |
16+
//! | [`dioxus-geolocation`] | Access user location services. | `geolocation` |
17+
//! | [`dioxus-storage`] | Store local and persistent data. | `storage` |
18+
//! | [`dioxus-time`] | Common timing utilities. | `time` |
19+
//! | [`dioxus-window`] | Common window utilities. | `window` |
20+
//! | [`dioxus-notification`] | Send notifications. | `notification` |
21+
//! | [`dioxus-sync`] | Synchronization primities for Dioxus. | `sync` |
22+
//!
23+
//! [`dioxus-geolocation`]: https://dioxuslabs.com
24+
//! [`dioxus-storage`]: https://dioxuslabs.com
25+
//! [`dioxus-time`]: https://dioxuslabs.com
26+
//! [`dioxus-window`]: https://dioxuslabs.com
27+
//! [`dioxus-notification`]: https://dioxuslabs.com
28+
//! [`dioxus-sync`]: https://dioxuslabs.com
29+
30+
#[cfg(feature = "geolocation")]
31+
pub use dioxus_geolocation;
32+
33+
#[cfg(feature = "notification")]
34+
pub use dioxus_notification;
35+
36+
#[cfg(feature = "storage")]
37+
pub use dioxus_storage;
38+
39+
#[cfg(feature = "sync")]
40+
pub use dioxus_sync;
41+
42+
#[cfg(feature = "time")]
43+
pub use dioxus_time;
44+
45+
#[cfg(feature = "window")]
46+
pub use dioxus_window;

packages/storage/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ enum StorageMode {
8787

8888
impl StorageMode {
8989
// Get the active mode
90+
#[allow(unreachable_code)]
9091
const fn current() -> Self {
9192
server_only! {
9293
return StorageMode::Server;

packages/window/src/size.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//! Window size utilities.
2-
//!
2+
//!
33
//! Acces the window size directly in your Dioxus app.
4-
//!
4+
//!
55
//! #### Platform Support
66
//! Window size is available on every platform.
7-
//!
7+
//!
88
//! # Examples
9-
//!
9+
//!
1010
//! ```rust
1111
//! use dioxus::prelude::*;
1212
//! use dioxus_window::size::use_window_size;
@@ -44,7 +44,7 @@ pub struct WindowSize {
4444
#[derive(Debug, Clone, PartialEq)]
4545
pub enum WindowSizeError {
4646
/// Window size is not supported on this platform.
47-
///
47+
///
4848
/// This error only exists for proper SSR hydration.
4949
Unsupported,
5050
/// Failed to get the window size.

0 commit comments

Comments
 (0)