rename fce to marine

This commit is contained in:
vms 2021-05-10 12:23:26 +03:00
parent 8bc484d2be
commit 7e786f47a7
68 changed files with 65 additions and 47 deletions

View File

@ -1,11 +1,11 @@
[workspace]
members = [
"crates/fce-macro",
"crates/fce-test-macro",
"crates/fce-test-macro-impl",
"crates/main",
"crates/marine-macro",
"crates/marine-macro-impl",
"crates/marine-test-macro",
"crates/marine-test-macro-impl",
"crates/timestamp-macro",
"crates/wit",
"fluence",
"fluence-test"
]

View File

@ -1,9 +1,9 @@
[package]
name = "fluence-sdk-main"
version = "0.6.1" # remember to update html_root_url
version = "0.6.2" # remember to update html_root_url
edition = "2018"
description = "Rust SDK for applications for the Fluence network"
documentation = "https://docs.rs/fluence/fluence-sdk-macro"
documentation = "https://docs.rs/fluence/marine-macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/main"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly"]
@ -19,7 +19,7 @@ crate-type = ["rlib"]
doctest = false
[dependencies]
fluence-sdk-macro = { path = "../fce-macro", version = "=0.6.1" }
marine-macro = { path = "../marine-macro", version = "=0.6.2" }
log = { version = "0.4.8", features = ["std"] }
serde = "=1.0.118"

View File

@ -1,12 +1,12 @@
[package]
name = "fluence-sdk-wit"
version = "0.6.1" # remember to update html_root_url
name = "marine-macro-impl"
version = "0.6.2" # remember to update html_root_url
edition = "2018"
description = "Webassembly interface-types generator"
documentation = "https://docs.rs/fluence/fluence-sdk-macro"
description = "Implementation of the `#[marine]` macro"
documentation = "https://docs.rs/fluence/marine-macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/macro"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "wit", "interface-types"]
keywords = ["fluence", "sdk", "webassembly", "it", "interface-types"]
categories = ["api-bindings", "wasm"]
license = "Apache-2.0"

View File

@ -20,7 +20,7 @@ use proc_macro2::TokenStream;
use quote::ToTokens;
use syn::Result;
pub fn fce(tokens: TokenStream) -> Result<TokenStream> {
pub fn marine(tokens: TokenStream) -> Result<TokenStream> {
let item = syn::parse2::<syn::Item>(tokens)?;
// convert proc_macro2 token to internal AST type
let fce_ast_item = item.parse_macro_input()?;

View File

@ -40,7 +40,7 @@ mod utils;
mod wasm_type;
pub use export_ast_types::*;
pub use fce_macro_impl::fce;
pub use fce_macro_impl::marine;
pub use parsed_type::ParsedType;
pub use token_stream_generator::GENERATED_WRAPPER_FUNC_PREFIX;
pub use token_stream_generator::GENERATED_SECTION_PREFIX;

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
use fluence_sdk_wit::fce;
use marine_macro_impl::marine;
use pretty_assertions::assert_eq;
@ -28,7 +28,7 @@ where
{
let fce_item = stream_from_file(fce_path);
let test_token_stream = quote::quote! { #fce_item };
let fce_token_streams = fce(test_token_stream)
let fce_token_streams = marine(test_token_stream)
.unwrap_or_else(|e| panic!("failed to apply the fce macro due {}", e));
let expanded_item = items_from_file(expanded_path);

View File

@ -1,9 +1,9 @@
[package]
name = "fluence-sdk-macro"
version = "0.6.1" # remember to update html_root_url
name = "marine-macro"
version = "0.6.2" # remember to update html_root_url
edition = "2018"
description = "Definition of the `#[fce]` macro"
documentation = "https://docs.rs/fluence/fluence-sdk-macro"
description = "Definition of the `#[marine]` macro"
documentation = "https://docs.rs/fluence/marine-macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/macro"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
@ -18,4 +18,4 @@ proc-macro = true
doctest = false
[dependencies]
fluence-sdk-wit = { path = "../wit", version = "=0.6.1" }
marine-macro-impl = { path = "../marine-macro-impl", version = "=0.6.2" }

View File

@ -50,7 +50,7 @@
//!
//! ```
#![doc(html_root_url = "https://docs.rs/fluence-sdk-macro/0.5.0")]
#![doc(html_root_url = "https://docs.rs/marine-macro/0.5.0")]
#![deny(
dead_code,
nonstandard_style,
@ -62,13 +62,13 @@
#![warn(rust_2018_idioms)]
#![recursion_limit = "1024"]
use fluence_sdk_wit::fce as fce_impl;
use marine_macro_impl::marine as marine_impl;
use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn fce(_attr: TokenStream, input: TokenStream) -> TokenStream {
pub fn marine(_attr: TokenStream, input: TokenStream) -> TokenStream {
// into converts proc_macro::TokenStream to proc_macro2::TokenStream
match fce_impl(input.into()) {
match marine_impl(input.into()) {
Ok(v) => v,
// converts syn:error to proc_macro2::TokenStream
Err(e) => e.to_compile_error(),
@ -76,3 +76,20 @@ pub fn fce(_attr: TokenStream, input: TokenStream) -> TokenStream {
// converts proc_macro2::TokenStream to proc_macro::TokenStream
.into()
}
// deprecated macro for backwards compatibility
#[deprecated(
since = "0.6.2",
note = "please use the #[marine] macro instead"
)]
#[proc_macro_attribute]
pub fn fce(_attr: TokenStream, input: TokenStream) -> TokenStream {
// into converts proc_macro::TokenStream to proc_macro2::TokenStream
match marine_impl(input.into()) {
Ok(v) => v,
// converts syn:error to proc_macro2::TokenStream
Err(e) => e.to_compile_error(),
}
// converts proc_macro2::TokenStream to proc_macro::TokenStream
.into()
}

View File

@ -1,8 +1,8 @@
[package]
name = "fluence-sdk-test-macro-impl"
name = "marine-test-macro-impl"
version = "0.1.5" # remember to update html_root_url
edition = "2018"
description = "Implementation of the `#[fce_test]` macro"
description = "Implementation of the `#[marine_test]` macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/macro-test"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
@ -13,7 +13,7 @@ license = "Apache-2.0"
all-features = true
[dependencies]
fluence-app-service = { version = "0.7.0", features = ["raw-module-api"] }
#fluence-app-service = { version = "0.7.0", features = ["raw-module-api"] }
fce-wit-parser = "0.5.0"
darling = "0.12.2"

View File

@ -1,8 +1,8 @@
[package]
name = "fluence-sdk-test-macro"
name = "marine-test-macro"
version = "0.1.5" # remember to update html_root_url
edition = "2018"
description = "Definition of the `#[fce_test]` macro"
description = "Definition of the `#[marine_test]` macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/macro-test"
authors = ["Fluence Labs"]
keywords = ["fluence", "sdk", "webassembly", "procedural_macros"]
@ -17,7 +17,7 @@ proc-macro = true
doctest = false
[dependencies]
fluence-sdk-test-macro-impl = { path = "../fce-test-macro-impl", version = "0.1.5" }
marine-test-macro-impl = { path = "../marine-test-macro-impl", version = "0.1.5" }
quote = "1.0.9"
proc-macro2 = "1.0.24"

View File

@ -1,6 +1,6 @@
[package]
name = "fce-timestamp-macro"
version = "0.6.1" # remember to update html_root_url
name = "marine-timestamp-macro"
version = "0.6.2" # remember to update html_root_url
edition = "2018"
description = "Definition of the `#[build_timestamp]` macro"
repository = "https://github.com/fluencelabs/rust-sdk/crates/timestamp-macro"

View File

@ -19,8 +19,8 @@ path = "src/lib.rs"
doctest = false
[dependencies]
fluence-sdk-test-macro = { path = "../crates/fce-test-macro", version = "0.1.5" }
fluence-app-service = { version = "0.7.0", features = ["raw-module-api"] }
marine-test-macro = { path = "../crates/marine-test-macro", version = "0.1.5" }
#fluence-app-service = { version = "0.7.0", features = ["raw-module-api"] }
serde = { version = "1.0.118", features = ["derive"] }
serde_json = "1.0.64"

View File

@ -1,6 +1,6 @@
[package]
name = "fluence"
version = "0.6.2" # remember to update html_root_url
version = "0.6.3" # remember to update html_root_url
description = "Fluence backend SDK for developing backend applications for the Fluence network"
documentation = "https://docs.rs/fluence/"
repository = "https://github.com/fluencelabs/rust-sdk"
@ -19,9 +19,9 @@ path = "src/lib.rs"
doctest = false
[dependencies]
fluence-sdk-macro = { path = "../crates/fce-macro", version = "=0.6.1" }
fluence-sdk-main = { path = "../crates/main", version = "=0.6.1" }
fce-timestamp-macro = { path = "../crates/timestamp-macro", version = "=0.6.1" }
marine-macro = { path = "../crates/marine-macro", version = "=0.6.2" }
fluence-sdk-main = { path = "../crates/main", version = "=0.6.2" }
marine-timestamp-macro = { path = "../crates/timestamp-macro", version = "=0.6.2" }
serde = { version = "1.0.118", features = ["derive"]}

View File

@ -14,13 +14,13 @@
* limitations under the License.
*/
use fluence_sdk_macro::fce;
use marine_macro::marine;
use serde::Serialize;
use serde::Deserialize;
/// Describes an origin that set an argument.
#[fce]
#[marine]
#[derive(Clone, PartialEq, Default, Eq, Debug, Serialize, Deserialize)]
pub struct SecurityTetraplet {
pub peer_pk: String,
@ -30,7 +30,7 @@ pub struct SecurityTetraplet {
}
/// This struct contains parameters that would be accessible by Wasm modules.
#[fce]
#[marine]
#[derive(Clone, PartialEq, Default, Eq, Debug, Serialize, Deserialize)]
pub struct CallParameters {
/// Peer id of the AIR script initiator.

View File

@ -74,7 +74,8 @@ mod mounted_binary;
// fluence is used inside CallParameters and MountedBinaryResult glue code
extern crate self as fluence;
pub use fluence_sdk_macro::fce;
pub use marine_macro::marine;
pub use marine_macro::fce;
pub use call_parameters::CallParameters;
pub use call_parameters::SecurityTetraplet;
@ -99,5 +100,5 @@ pub mod internal {
pub use fluence_sdk_main::set_result_ptr;
pub use fluence_sdk_main::set_result_size;
pub use fluence_sdk_main::add_object_to_release;
pub use fce_timestamp_macro::build_timestamp;
pub use marine_timestamp_macro::build_timestamp;
}

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
use fluence_sdk_macro::fce;
use marine_macro::marine;
use serde::Serialize;
use serde::Deserialize;
@ -22,7 +22,7 @@ use serde::Deserialize;
pub const SUCCESS_CODE: i32 = 0;
/// Describes result of calling a CLI service.
#[fce]
#[marine]
#[derive(Clone, PartialEq, Default, Eq, Debug, Serialize, Deserialize)]
pub struct MountedBinaryResult {
/// Return process exit code or host execution error code, where SUCCESS_CODE means success.
@ -39,7 +39,7 @@ pub struct MountedBinaryResult {
}
/// The same as the MountedBinaryResult, but stdout and stderr are utf8 strings.
#[fce]
#[marine]
#[derive(Clone, PartialEq, Default, Eq, Debug, Serialize, Deserialize)]
pub struct MountedBinaryStringResult {
/// Return process exit code or host execution error code, where SUCCESS_CODE means success.