Skip to content

[PM-21902] Migrate back to tsify #284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ serde_repr = ">=0.1.12, <0.2"
syn = ">=2.0.87, <3"
thiserror = ">=1.0.40, <3"
tokio = { version = "1.36.0", features = ["macros"] }
tsify-next = { version = ">=0.5.4, <0.6", features = [
tsify = { version = ">=0.5.5, <0.6", features = [
"js",
], default-features = false }
uniffi = "=0.29.1"
Expand Down
4 changes: 2 additions & 2 deletions crates/bitwarden-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ wasm = [
"bitwarden-error/wasm",
"dep:wasm-bindgen",
"dep:wasm-bindgen-futures",
"dep:tsify-next"
"dep:tsify"
] # WASM support

[dependencies]
Expand All @@ -47,7 +47,7 @@ serde_json = { workspace = true }
serde_qs = { workspace = true }
serde_repr = { workspace = true }
thiserror = { workspace = true }
tsify-next = { workspace = true, optional = true }
tsify = { workspace = true, optional = true }
uniffi = { workspace = true, optional = true, features = ["tokio"] }
uuid = { workspace = true }
wasm-bindgen = { workspace = true, optional = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/bitwarden-core/src/client/client_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize};
#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
#[cfg_attr(
feature = "wasm",
derive(tsify_next::Tsify),
derive(tsify::Tsify),
tsify(into_wasm_abi, from_wasm_abi)
)]
pub struct ClientSettings {
Expand Down Expand Up @@ -51,7 +51,7 @@ impl Default for ClientSettings {
#[cfg_attr(feature = "uniffi", derive(uniffi::Enum))]
#[cfg_attr(
feature = "wasm",
derive(tsify_next::Tsify),
derive(tsify::Tsify),
tsify(into_wasm_abi, from_wasm_abi)
)]
pub enum DeviceType {
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-core/src/key_management/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use bitwarden_error::bitwarden_error;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[cfg(feature = "wasm")]
use {tsify_next::Tsify, wasm_bindgen::prelude::*};
use {tsify::Tsify, wasm_bindgen::prelude::*};

use crate::{
client::{encryption_settings::EncryptionSettingsError, LoginMethod, UserLoginMethod},
Expand Down
4 changes: 2 additions & 2 deletions crates/bitwarden-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ keywords.workspace = true

[features]
default = []
wasm = ["dep:tsify-next", "dep:wasm-bindgen"] # WASM support
wasm = ["dep:tsify", "dep:wasm-bindgen"] # WASM support

uniffi = ["dep:uniffi"] # Uniffi bindings
no-memory-hardening = [] # Disable memory hardening features
Expand Down Expand Up @@ -52,7 +52,7 @@ sha1 = ">=0.10.5, <0.11"
sha2 = ">=0.10.6, <0.11"
subtle = ">=2.5.0, <3.0"
thiserror = { workspace = true }
tsify-next = { workspace = true, optional = true }
tsify = { workspace = true, optional = true }
typenum = ">=1.18.0, <1.19.0"
uniffi = { workspace = true, optional = true }
uuid = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-crypto/src/keys/kdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use sha2::Digest;
#[cfg(feature = "wasm")]
use tsify_next::Tsify;
use tsify::Tsify;
use typenum::U32;
use zeroize::Zeroize;

Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-crypto/src/signing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub use message::SerializedMessage;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[cfg(feature = "wasm")]
use {tsify_next::Tsify, wasm_bindgen::prelude::*};
use {tsify::Tsify, wasm_bindgen::prelude::*};

/// The type of key / signature scheme used for signing and verifying.
#[derive(Serialize, Deserialize, Debug, JsonSchema, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-error-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ bitwarden-error = { workspace = true, features = ["wasm"] }
js-sys.workspace = true
serde.workspace = true
thiserror.workspace = true
tsify-next.workspace = true
tsify.workspace = true
wasm-bindgen.workspace = true
2 changes: 1 addition & 1 deletion crates/bitwarden-error-macro/src/full/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(crate) fn bitwarden_error_full(

let wasm_attributes = cfg!(feature = "wasm").then(|| {
quote! {
#[derive(bitwarden_error::tsify_next::Tsify)]
#[derive(bitwarden_error::tsify::Tsify)]
#[tsify(into_wasm_abi)]
}
});
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-error-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mod full;
/// }
/// ```
///
/// will use tsify_next::Tsify to generate roughly the following TypeScript definition:
/// will use tsify::Tsify to generate roughly the following TypeScript definition:
///
/// ```typescript
/// export type CryptoError =
Expand Down
4 changes: 2 additions & 2 deletions crates/bitwarden-error/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ keywords.workspace = true
wasm = [
"bitwarden-error-macro/wasm",
"dep:js-sys",
"dep:tsify-next",
"dep:tsify",
"dep:wasm-bindgen"
]

[dependencies]
bitwarden-error-macro = { workspace = true }
js-sys = { workspace = true, optional = true }
tsify-next = { workspace = true, optional = true }
tsify = { workspace = true, optional = true }
wasm-bindgen = { workspace = true, optional = true }

[lints]
Expand Down
4 changes: 2 additions & 2 deletions crates/bitwarden-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ pub mod wasm;
#[cfg(feature = "wasm")]
#[doc(hidden)]
pub use ::js_sys;
/// Re-export the `tsify_next` crate since the proc macro depends on it.
/// Re-export the `tsify` crate since the proc macro depends on it.
#[cfg(feature = "wasm")]
#[doc(hidden)]
pub use ::tsify_next;
pub use ::tsify;
/// Re-export the `wasm_bindgen` crate since the proc macro depends on it.
#[cfg(feature = "wasm")]
#[doc(hidden)]
Expand Down
4 changes: 2 additions & 2 deletions crates/bitwarden-exporters/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ keywords.workspace = true
uniffi = ["dep:uniffi", "bitwarden-core/uniffi"] # Uniffi bindings
wasm = [
"bitwarden-vault/wasm",
"dep:tsify-next",
"dep:tsify",
"dep:wasm-bindgen"
] # WebAssembly bindings

Expand All @@ -37,7 +37,7 @@ num-traits = ">=0.2, <0.3"
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
tsify-next = { workspace = true, optional = true }
tsify = { workspace = true, optional = true }
uniffi = { workspace = true, optional = true }
uuid = { workspace = true }
wasm-bindgen = { workspace = true, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-exporters/src/cxf/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use credential_exchange_format::{
};
use uuid::Uuid;
#[cfg(feature = "wasm")]
use {tsify_next::Tsify, wasm_bindgen::prelude::*};
use {tsify::Tsify, wasm_bindgen::prelude::*};

use crate::{cxf::CxfError, Cipher, CipherType, Login};

Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-exporters/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub use error::ExportError;
#[cfg_attr(feature = "uniffi", derive(uniffi::Enum))]
#[cfg_attr(
feature = "wasm",
derive(serde::Serialize, serde::Deserialize, tsify_next::Tsify),
derive(serde::Serialize, serde::Deserialize, tsify::Tsify),
tsify(into_wasm_abi, from_wasm_abi)
)]
pub enum ExportFormat {
Expand Down
4 changes: 2 additions & 2 deletions crates/bitwarden-generators/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ keywords.workspace = true
uniffi = ["dep:uniffi"] # Uniffi bindings
wasm = [
"bitwarden-core/wasm",
"dep:tsify-next",
"dep:tsify",
"dep:wasm-bindgen"
] # WebAssembly bindings

Expand All @@ -32,7 +32,7 @@ schemars = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
tsify-next = { workspace = true, optional = true }
tsify = { workspace = true, optional = true }
uniffi = { workspace = true, optional = true }
wasm-bindgen = { workspace = true, optional = true }

Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-generators/src/passphrase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use thiserror::Error;
#[cfg(feature = "wasm")]
use tsify_next::Tsify;
use tsify::Tsify;

use crate::util::capitalize_first_letter;

Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-generators/src/password.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use thiserror::Error;
#[cfg(feature = "wasm")]
use tsify_next::Tsify;
use tsify::Tsify;

#[allow(missing_docs)]
#[bitwarden_error(flat)]
Expand Down
6 changes: 3 additions & 3 deletions crates/bitwarden-generators/src/username.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use thiserror::Error;
#[cfg(feature = "wasm")]
use tsify_next::Tsify;
use tsify::Tsify;

use crate::util::capitalize_first_letter;

Expand Down Expand Up @@ -42,7 +42,7 @@ pub enum AppendType {
#[cfg_attr(feature = "uniffi", derive(uniffi::Enum))]
#[cfg_attr(
feature = "wasm",
derive(tsify_next::Tsify),
derive(tsify::Tsify),
tsify(into_wasm_abi, from_wasm_abi)
)]
/// Configures the email forwarding service to use.
Expand Down Expand Up @@ -81,7 +81,7 @@ pub enum ForwarderServiceType {
#[cfg_attr(feature = "uniffi", derive(uniffi::Enum))]
#[cfg_attr(
feature = "wasm",
derive(tsify_next::Tsify),
derive(tsify::Tsify),
tsify(into_wasm_abi, from_wasm_abi)
)]
pub enum UsernameGeneratorRequest {
Expand Down
4 changes: 2 additions & 2 deletions crates/bitwarden-ipc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ keywords.workspace = true

[features]
wasm = [
"dep:tsify-next",
"dep:tsify",
"dep:wasm-bindgen",
"dep:wasm-bindgen-futures",
"dep:js-sys",
Expand All @@ -28,7 +28,7 @@ serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
tokio = { features = ["sync", "time", "rt"], workspace = true }
tsify-next = { workspace = true, optional = true }
tsify = { workspace = true, optional = true }
wasm-bindgen = { workspace = true, optional = true }
wasm-bindgen-futures = { workspace = true, optional = true }

Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-ipc/src/endpoint.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
#[cfg(feature = "wasm")]
use {tsify_next::Tsify, wasm_bindgen::prelude::*};
use {tsify::Tsify, wasm_bindgen::prelude::*};

#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))]
Expand Down
Loading
Loading