Skip to content

chore: remove unnecessary dependencies #183

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,3 @@ quote = "1.0"
syn = { version = "1.0.105", features=["full", "extra-traits", "visit"] }
base64 = "0.13.1"
bigdecimal = "0.3.0"
num-bigint = "0.4.3"
serde_bytes = "0.11.5"
5 changes: 1 addition & 4 deletions packages/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ wrap_manifest_schemas.workspace = true

thiserror.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_bytes.workspace = true

[dev-dependencies]
polywrap_tests_utils.workspace = true
bigdecimal.workspace = true
num-bigint.workspace = true
bigdecimal.workspace = true
6 changes: 3 additions & 3 deletions packages/client/tests/it/wrap_types/bytes.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use polywrap_msgpack_serde::to_vec;
use polywrap_tests_utils::helpers::get_tests_path;
use serde::{Deserialize, Serialize};
use serde_bytes::ByteBuf;
use polywrap_msgpack_serde::bytes;

use crate::wrap_types::get_client;

Expand All @@ -12,7 +12,7 @@ struct BytesMethodArgs {

#[derive(Serialize, Deserialize)]
struct Args {
#[serde(with = "serde_bytes")]
#[serde(with = "bytes")]
prop: Vec<u8>,
}

Expand All @@ -31,7 +31,7 @@ fn bytes_method() {
},
};
let response = client
.invoke::<ByteBuf>(
.invoke::<bytes::ByteBuf>(
&uri,
"bytesMethod",
Some(&to_vec(&args).unwrap()),
Expand Down
4 changes: 2 additions & 2 deletions packages/client/tests/it/wrap_types/object.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use polywrap_client::client::PolywrapClient;
use polywrap_client::core::uri::Uri;
use polywrap_msgpack_serde::to_vec;
use polywrap_msgpack_serde::{to_vec, bytes};
use polywrap_tests_utils::helpers::get_tests_path;
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -34,7 +34,7 @@ struct Arg2 {

#[derive(Serialize)]
struct Arg3 {
#[serde(with = "serde_bytes")]
#[serde(with = "bytes")]
prop: Vec<u8>,
}

Expand Down
1 change: 0 additions & 1 deletion packages/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ wrap_manifest_schemas.workspace = true
polywrap_msgpack_serde.workspace = true
serde.workspace = true
jsonschema.workspace = true
serde_bytes.workspace = true
polywrap_uri.workspace = true
polywrap_core_macros = { workspace = true, optional = true }

Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/resolution/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ use crate::{
client::Client, error::Error, file_reader::FileReader,
interface_implementation::InterfaceImplementations, invoker::Invoker, uri::Uri,
};
use polywrap_msgpack_serde::to_vec;
use polywrap_msgpack_serde::{to_vec, bytes};
use serde::Serialize;
use serde_bytes::ByteBuf;

fn combine_paths(a: &str, b: &str) -> String {
let mut a = a.to_string();
Expand Down Expand Up @@ -63,7 +62,7 @@ impl FileReader for UriResolverExtensionFileReader {
None,
)?;

let result: ByteBuf = polywrap_msgpack_serde::from_slice(&result)?;
let result: bytes::ByteBuf = polywrap_msgpack_serde::from_slice(&result)?;
Ok(result.into_vec())
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ polywrap_plugin_implementor = { workspace = true, optional = true }

serde.workspace = true
bigdecimal.workspace = true
num-bigint.workspace = true

[features]
default = ["implementor"]
Expand Down
1 change: 0 additions & 1 deletion packages/plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ pub mod wrapper;
pub use polywrap_plugin_implementor as implementor;

pub use bigdecimal::BigDecimal as BigNumber;
pub use num_bigint::BigInt;
pub use polywrap_msgpack_serde::Map;
pub use serde_json as JSON;
1 change: 0 additions & 1 deletion packages/plugins/fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ wrap_manifest_schemas.workspace = true
serde.workspace = true

rm_rf = "0.6.2"
serde_bytes.workspace = true
thiserror.workspace = true

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/fs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use wrap::module::{
Module,
};
pub mod wrap;
use serde_bytes::ByteBuf;
use polywrap_msgpack_serde::bytes;

#[derive(Debug)]
pub struct FileSystemPlugin;
Expand Down
5 changes: 2 additions & 3 deletions packages/plugins/fs/src/wrap/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::sync::Arc;
use polywrap_core::invoker::Invoker;
use polywrap_plugin::{error::PluginError, module::PluginModule};
use serde::{Serialize, Deserialize};
use serde_bytes::ByteBuf;
use super::types::*;

#[derive(Clone, Debug, Deserialize, Serialize)]
Expand All @@ -27,7 +26,7 @@ pub struct ArgsExists {
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ArgsWriteFile {
pub path: String,
#[serde(with = "serde_bytes")]
#[serde(with = "bytes")]
pub data: Vec<u8>,
}

Expand All @@ -50,7 +49,7 @@ pub struct ArgsRmdir {
}

pub trait Module: PluginModule {
fn read_file(&mut self, args: &ArgsReadFile, invoker: Arc<dyn Invoker>) -> Result<ByteBuf, PluginError>;
fn read_file(&mut self, args: &ArgsReadFile, invoker: Arc<dyn Invoker>) -> Result<bytes::ByteBuf, PluginError>;

fn read_file_as_string(&mut self, args: &ArgsReadFileAsString, invoker: Arc<dyn Invoker>) -> Result<String, PluginError>;

Expand Down
5 changes: 3 additions & 2 deletions packages/plugins/fs/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use polywrap_resolvers::static_resolver::{StaticResolver, StaticResolverLike};

use polywrap_plugin::package::PluginPackage;
use serde::Serialize;
use serde_bytes::ByteBuf;
use polywrap_msgpack_serde::bytes;
use polywrap_msgpack_serde::bytes::ByteBuf;
use std::path::Path;
use std::sync::Arc;
use std::{env, fs};
Expand Down Expand Up @@ -206,7 +207,7 @@ fn should_return_whether_a_file_exists_or_not() {
#[derive(Serialize)]
struct WriteFileArgs {
path: String,
#[serde(with = "serde_bytes")]
#[serde(with = "bytes")]
data: Vec<u8>,
}

Expand Down
1 change: 0 additions & 1 deletion packages/resolver-extensions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ polywrap_wasm.workspace = true
polywrap_msgpack_serde.workspace = true
polywrap_resolvers.workspace = true
serde.workspace = true
serde_bytes.workspace = true

[dev-dependencies]
polywrap_tests_utils.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion packages/resolver-extensions/src/uri_resolver_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use polywrap_core::{
use polywrap_msgpack_serde::{from_slice, to_vec};
use polywrap_wasm::wasm_package::WasmPackage;
use serde::{Deserialize, Serialize};
use polywrap_msgpack_serde::bytes;

pub struct UriResolverWrapper {
pub implementation_uri: Uri,
Expand All @@ -22,7 +23,7 @@ pub struct UriResolverWrapper {
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct MaybeUriOrManifest {
pub uri: Option<String>,
#[serde(with = "serde_bytes")]
#[serde(with = "bytes")]
pub manifest: Option<Vec<u8>>,
}

Expand Down
1 change: 0 additions & 1 deletion packages/resolvers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ polywrap_core.workspace = true
polywrap_wasm.workspace = true
polywrap_msgpack_serde.workspace = true
serde.workspace = true
serde_bytes.workspace = true

2 changes: 0 additions & 2 deletions packages/tests-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ polywrap_core.workspace = true
wrap_manifest_schemas.workspace = true
thiserror.workspace = true
serde.workspace = true
serde_json.workspace = true
polywrap_plugin.workspace = true
polywrap_msgpack_serde.workspace = true
serde_bytes.workspace = true

reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "1.23.0", features = ["full"] }
Expand Down
3 changes: 2 additions & 1 deletion packages/tests-utils/src/mocks/invoker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ use polywrap_core::{
};
use polywrap_msgpack_serde::to_vec;
use serde::{Deserialize, Serialize};
use polywrap_msgpack_serde::bytes;

#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct MaybeUriOrManifest {
pub uri: Option<String>,
#[serde(with = "serde_bytes")]
#[serde(with = "bytes")]
pub manifest: Option<Vec<u8>>,
}

Expand Down