From 1d3002e33dc6f9831290831006574096d76ee6d6 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Thu, 10 Aug 2023 07:19:59 -0300 Subject: [PATCH] fix(docs): enable `tauri/dox` feature on docs.rs build --- .changes/fix-docs-build.md | 31 +++++++++++++++++++++++++ Cargo.lock | 34 ++++++++++++++++++++++++++++ plugins/app/Cargo.toml | 6 +++++ plugins/authenticator/Cargo.toml | 6 +++++ plugins/autostart/Cargo.toml | 6 +++++ plugins/cli/Cargo.toml | 6 +++++ plugins/clipboard-manager/Cargo.toml | 6 +++++ plugins/dialog/Cargo.toml | 6 +++++ plugins/fs/Cargo.toml | 4 ++++ plugins/global-shortcut/Cargo.toml | 6 +++++ plugins/http/Cargo.toml | 4 ++++ plugins/localhost/Cargo.toml | 6 +++++ plugins/log/Cargo.toml | 4 ++++ plugins/notification/Cargo.toml | 4 ++++ plugins/os/Cargo.toml | 6 +++++ plugins/persisted-scope/Cargo.toml | 4 ++++ plugins/positioner/Cargo.toml | 4 ++++ plugins/process/Cargo.toml | 6 +++++ plugins/shell/Cargo.toml | 6 +++++ plugins/single-instance/Cargo.toml | 6 +++++ plugins/sql/Cargo.toml | 3 ++- plugins/store/Cargo.toml | 6 +++++ plugins/stronghold/Cargo.toml | 6 +++++ plugins/updater/Cargo.toml | 4 ++++ plugins/upload/Cargo.toml | 4 ++++ plugins/websocket/Cargo.toml | 4 ++++ plugins/window-state/Cargo.toml | 6 +++++ plugins/window/Cargo.toml | 4 ++++ shared/template/Cargo.toml | 8 ++++++- 29 files changed, 204 insertions(+), 2 deletions(-) create mode 100644 .changes/fix-docs-build.md diff --git a/.changes/fix-docs-build.md b/.changes/fix-docs-build.md new file mode 100644 index 00000000..1e6c0b1a --- /dev/null +++ b/.changes/fix-docs-build.md @@ -0,0 +1,31 @@ +--- +"app": patch +"authenticator": patch +"autostart": patch +"cli": patch +"clipboard-manager": patch +"dialog": patch +"fs": patch +"global-shortcut": patch +"http": patch +"localhost": patch +"log-plugin": patch +"notification": patch +"os": patch +"persisted-scope": patch +"positioner": patch +"process": patch +"shell": patch +"single-instance": patch +"sql": patch +"store": patch +"stronghold": patch +"updater": patch +"upload": patch +"websocket": patch +"window": patch +"window-state": patch +--- + +Fixes docs.rs build by enabling the `tauri/dox` feature flag. + diff --git a/Cargo.lock b/Cargo.lock index 457bbe4d..f9031ea6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -744,6 +744,7 @@ checksum = "f3125b15ec28b84c238f6f476c6034016a5f6cc0221cb514ca46c532139fc97d" dependencies = [ "bitflags 1.3.2", "cairo-sys-rs", + "freetype-rs", "glib", "libc", "once_cell", @@ -759,6 +760,7 @@ dependencies = [ "glib-sys", "libc", "system-deps", + "x11", ] [[package]] @@ -917,6 +919,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + [[package]] name = "cocoa" version = "0.24.1" @@ -1686,6 +1697,28 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "freetype-rs" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4200d5c6da26d4b5acff9098c1747f9f86da5e0f23bd7d63fed4c4a07e0b60ba" +dependencies = [ + "bitflags 1.3.2", + "freetype-sys", + "libc", +] + +[[package]] +name = "freetype-sys" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17c696ead7d51c6c585f3513eee3b604a73c4e8345b16d450843eb0a59591b2" +dependencies = [ + "cmake", + "libc", + "pkg-config", +] + [[package]] name = "fsevent-sys" version = "4.1.0" @@ -2058,6 +2091,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", + "log", "once_cell", "smallvec", "thiserror", diff --git a/plugins/app/Cargo.toml b/plugins/app/Cargo.toml index 6ae1ca3f..b71352bc 100644 --- a/plugins/app/Cargo.toml +++ b/plugins/app/Cargo.toml @@ -6,5 +6,11 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] tauri = { workspace = true } + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/authenticator/Cargo.toml b/plugins/authenticator/Cargo.toml index 4ce3b98e..6138095c 100644 --- a/plugins/authenticator/Cargo.toml +++ b/plugins/authenticator/Cargo.toml @@ -7,6 +7,9 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -25,3 +28,6 @@ chrono = "0.4" [dev-dependencies] rand = "0.8" rusty-fork = "0.3" + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/autostart/Cargo.toml b/plugins/autostart/Cargo.toml index 15e757bd..1b0660f3 100644 --- a/plugins/autostart/Cargo.toml +++ b/plugins/autostart/Cargo.toml @@ -7,6 +7,9 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -14,3 +17,6 @@ tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } auto-launch = "0.4" + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/cli/Cargo.toml b/plugins/cli/Cargo.toml index b3a2ca7d..9aa64df1 100644 --- a/plugins/cli/Cargo.toml +++ b/plugins/cli/Cargo.toml @@ -6,6 +6,9 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -13,3 +16,6 @@ tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } clap = { version = "4", features = [ "string" ] } + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/clipboard-manager/Cargo.toml b/plugins/clipboard-manager/Cargo.toml index c0881b49..11de6b74 100644 --- a/plugins/clipboard-manager/Cargo.toml +++ b/plugins/clipboard-manager/Cargo.toml @@ -7,6 +7,9 @@ authors = { workspace = true } license = { workspace = true } links = "tauri-plugin-clipboard-manager" +[package.metadata.docs.rs] +features = [ "dox" ] + [build-dependencies] tauri-build = { workspace = true } @@ -19,3 +22,6 @@ thiserror = { workspace = true } [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] arboard = "3" + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/dialog/Cargo.toml b/plugins/dialog/Cargo.toml index 7ca49870..e84ed676 100644 --- a/plugins/dialog/Cargo.toml +++ b/plugins/dialog/Cargo.toml @@ -7,6 +7,9 @@ authors = { workspace = true } license = { workspace = true } links = "tauri-plugin-dialog" +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -24,3 +27,6 @@ raw-window-handle = "0.5" [build-dependencies] tauri-build = { workspace = true } + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/fs/Cargo.toml b/plugins/fs/Cargo.toml index e355ff6c..2df8ff60 100644 --- a/plugins/fs/Cargo.toml +++ b/plugins/fs/Cargo.toml @@ -7,6 +7,9 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } tauri = { workspace = true } @@ -18,4 +21,5 @@ notify = { version = "5", optional = true, features = [ "serde" ] } notify-debouncer-mini = { version = "0.2.1", optional = true, features = [ "serde" ] } [features] +dox = [ "tauri/dox" ] watch = [ "notify", "notify-debouncer-mini" ] diff --git a/plugins/global-shortcut/Cargo.toml b/plugins/global-shortcut/Cargo.toml index b281d2b0..4f823c00 100644 --- a/plugins/global-shortcut/Cargo.toml +++ b/plugins/global-shortcut/Cargo.toml @@ -6,6 +6,9 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -15,3 +18,6 @@ thiserror = { workspace = true } [target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies] global-hotkey = "0.2.1" + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/http/Cargo.toml b/plugins/http/Cargo.toml index 95f74bfe..526fc698 100644 --- a/plugins/http/Cargo.toml +++ b/plugins/http/Cargo.toml @@ -6,6 +6,9 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -19,6 +22,7 @@ url = "2.4" data-url = "0.3" [features] +dox = [ "tauri/dox" ] multipart = ["reqwest/multipart"] json = ["reqwest/json"] stream = ["reqwest/stream"] diff --git a/plugins/localhost/Cargo.toml b/plugins/localhost/Cargo.toml index a5586cbe..92297ead 100644 --- a/plugins/localhost/Cargo.toml +++ b/plugins/localhost/Cargo.toml @@ -7,6 +7,9 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -15,3 +18,6 @@ log = { workspace = true } thiserror = { workspace = true } tiny_http = "0.12" http = "0.2" + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/log/Cargo.toml b/plugins/log/Cargo.toml index 06a19f4a..78e4a256 100644 --- a/plugins/log/Cargo.toml +++ b/plugins/log/Cargo.toml @@ -7,6 +7,9 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [build-dependencies] tauri-build = { workspace = true } @@ -29,4 +32,5 @@ objc = "0.2" cocoa = "0.24" [features] +dox = [ "tauri/dox" ] colored = [ "fern/colored" ] diff --git a/plugins/notification/Cargo.toml b/plugins/notification/Cargo.toml index fddbde5c..169bbd54 100644 --- a/plugins/notification/Cargo.toml +++ b/plugins/notification/Cargo.toml @@ -7,6 +7,9 @@ authors = { workspace = true } license = { workspace = true } links = "tauri-plugin-notification" +[package.metadata.docs.rs] +features = [ "dox" ] + [build-dependencies] tauri-build = { workspace = true } @@ -28,4 +31,5 @@ notify-rust = "4.5" win7-notifications = { version = "0.3.1", optional = true } [features] +dox = [ "tauri/dox" ] windows7-compat = [ "win7-notifications" ] diff --git a/plugins/os/Cargo.toml b/plugins/os/Cargo.toml index e2280410..26a13aca 100644 --- a/plugins/os/Cargo.toml +++ b/plugins/os/Cargo.toml @@ -6,6 +6,9 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -16,3 +19,6 @@ os_info = "3" sys-locale = "0.3" gethostname = "0.4" serialize-to-javascript = "=0.1.1" + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/persisted-scope/Cargo.toml b/plugins/persisted-scope/Cargo.toml index ea38618d..4dbd3edc 100644 --- a/plugins/persisted-scope/Cargo.toml +++ b/plugins/persisted-scope/Cargo.toml @@ -7,6 +7,9 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -18,4 +21,5 @@ bincode = "1" tauri-plugin-fs = { path = "../fs", version = "2.0.0-alpha.0" } [features] +dox = [ "tauri/dox" ] protocol-asset = [ "tauri/protocol-asset" ] diff --git a/plugins/positioner/Cargo.toml b/plugins/positioner/Cargo.toml index 25927a26..bebdaf39 100644 --- a/plugins/positioner/Cargo.toml +++ b/plugins/positioner/Cargo.toml @@ -7,6 +7,9 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -16,4 +19,5 @@ thiserror = { workspace = true } serde_repr = "0.1" [features] +dox = [ "tauri/dox" ] system-tray = [ "tauri/system-tray" ] diff --git a/plugins/process/Cargo.toml b/plugins/process/Cargo.toml index f018daa1..1962e056 100644 --- a/plugins/process/Cargo.toml +++ b/plugins/process/Cargo.toml @@ -6,5 +6,11 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] tauri = { workspace = true } + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/shell/Cargo.toml b/plugins/shell/Cargo.toml index 2502b782..ba4ea847 100644 --- a/plugins/shell/Cargo.toml +++ b/plugins/shell/Cargo.toml @@ -6,6 +6,9 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -17,3 +20,6 @@ regex = "1" open = "4" encoding_rs = "0.8" os_pipe = "1" + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/single-instance/Cargo.toml b/plugins/single-instance/Cargo.toml index 9c4fc139..cd6c0aed 100644 --- a/plugins/single-instance/Cargo.toml +++ b/plugins/single-instance/Cargo.toml @@ -8,6 +8,9 @@ edition = { workspace = true } rust-version = { workspace = true } exclude = [ "/examples" ] +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -29,3 +32,6 @@ features = [ [target."cfg(target_os = \"linux\")".dependencies] zbus = "3" + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/sql/Cargo.toml b/plugins/sql/Cargo.toml index d6ae7bed..b8b74166 100644 --- a/plugins/sql/Cargo.toml +++ b/plugins/sql/Cargo.toml @@ -8,7 +8,7 @@ edition = { workspace = true } rust-version = { workspace = true } [package.metadata.docs.rs] -features = [ "sqlite" ] +features = [ "dox", "sqlite" ] [dependencies] serde = { workspace = true } @@ -22,6 +22,7 @@ time = "0.3" tokio = { version = "1", features = [ "sync" ] } [features] +dox = [ "tauri/dox" ] sqlite = [ "sqlx/sqlite" ] mysql = [ "sqlx/mysql" ] postgres = [ "sqlx/postgres" ] diff --git a/plugins/store/Cargo.toml b/plugins/store/Cargo.toml index a2ec5226..66d2ecdb 100644 --- a/plugins/store/Cargo.toml +++ b/plugins/store/Cargo.toml @@ -7,9 +7,15 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } thiserror = { workspace = true } + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/stronghold/Cargo.toml b/plugins/stronghold/Cargo.toml index 709131c1..21ba6cd2 100644 --- a/plugins/stronghold/Cargo.toml +++ b/plugins/stronghold/Cargo.toml @@ -7,6 +7,9 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -21,3 +24,6 @@ zeroize = { version = "1", features = [ "zeroize_derive" ] } [dev-dependencies] rand = "0.8" rusty-fork = "0.3" + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/updater/Cargo.toml b/plugins/updater/Cargo.toml index f2492ea2..e31bc7ef 100644 --- a/plugins/updater/Cargo.toml +++ b/plugins/updater/Cargo.toml @@ -6,6 +6,9 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] tauri = { workspace = true } serde = { workspace = true } @@ -33,6 +36,7 @@ zip = { version = "0.6", default-features = false } mockito = "0.31" [features] +dox = [ "tauri/dox" ] native-tls = [ "reqwest/native-tls" ] native-tls-vendored = [ "reqwest/native-tls-vendored" ] rustls-tls = [ "reqwest/rustls-tls" ] diff --git a/plugins/upload/Cargo.toml b/plugins/upload/Cargo.toml index 0f4da100..c316d5e9 100644 --- a/plugins/upload/Cargo.toml +++ b/plugins/upload/Cargo.toml @@ -7,6 +7,9 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -20,6 +23,7 @@ futures-util = "0.3" read-progress-stream = "1.0.0" [features] +dox = [ "tauri/dox" ] native-tls = [ "reqwest/native-tls" ] native-tls-vendored = [ "reqwest/native-tls-vendored" ] rustls-tls = [ "reqwest/rustls-tls" ] diff --git a/plugins/websocket/Cargo.toml b/plugins/websocket/Cargo.toml index a9c00ba1..f6a2501c 100644 --- a/plugins/websocket/Cargo.toml +++ b/plugins/websocket/Cargo.toml @@ -8,6 +8,9 @@ edition = { workspace = true } rust-version = { workspace = true } exclude = [ "/examples" ] +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -20,6 +23,7 @@ tokio = { version = "1", features = [ "net", "sync" ] } tokio-tungstenite = { version = "0.19" } [features] +dox = [ "tauri/dox" ] native-tls = [ "tokio-tungstenite/native-tls" ] native-tls-vendored = [ "tokio-tungstenite/native-tls-vendored" ] rustls-tls-webpki-roots = [ "tokio-tungstenite/rustls-tls-webpki-roots" ] diff --git a/plugins/window-state/Cargo.toml b/plugins/window-state/Cargo.toml index b1f6c802..72097ae7 100644 --- a/plugins/window-state/Cargo.toml +++ b/plugins/window-state/Cargo.toml @@ -7,6 +7,9 @@ license = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] serde = { workspace = true } serde_json = { workspace = true } @@ -15,3 +18,6 @@ log = { workspace = true } thiserror = { workspace = true } bincode = "1.3" bitflags = "2" + +[features] +dox = [ "tauri/dox" ] diff --git a/plugins/window/Cargo.toml b/plugins/window/Cargo.toml index 7e52814d..03445321 100644 --- a/plugins/window/Cargo.toml +++ b/plugins/window/Cargo.toml @@ -6,12 +6,16 @@ edition = { workspace = true } authors = { workspace = true } license = { workspace = true } +[package.metadata.docs.rs] +features = [ "dox" ] + [dependencies] tauri = { workspace = true } serde = { workspace = true } thiserror = { workspace = true } [features] +dox = [ "tauri/dox" ] icon-png = [ "tauri/icon-png" ] icon-ico = [ "tauri/icon-ico" ] devtools = [ ] diff --git a/shared/template/Cargo.toml b/shared/template/Cargo.toml index 071f5654..22fa8075 100644 --- a/shared/template/Cargo.toml +++ b/shared/template/Cargo.toml @@ -6,6 +6,9 @@ authors = { workspace = true } license = { workspace = true } links = "tauri-plugin-{{name}}" +[package.metadata.docs.rs] +features = [ "dox" ] + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [build-dependencies] @@ -16,4 +19,7 @@ serde = { workspace = true } serde_json = { workspace = true } tauri = { workspace = true } log = { workspace = true } -thiserror = { workspace = true } \ No newline at end of file +thiserror = { workspace = true } + +[features] +dox = [ "tauri/dox" ]