diff --git a/auraescript/macros/src/ops.rs b/auraescript/macros/src/ops.rs index cf498c305..523e27f52 100644 --- a/auraescript/macros/src/ops.rs +++ b/auraescript/macros/src/ops.rs @@ -114,7 +114,7 @@ pub(crate) fn ops_generator(input: TokenStream) -> TokenStream { // generate a OpDecl for each function for conveniently adding to the deno runtime let op_decls: Vec = op_idents.map(|op_ident| { quote! { - #op_ident::decl() + #op_ident::DECL } }).collect(); diff --git a/auraescript/src/builtin/auraescript_client.rs b/auraescript/src/builtin/auraescript_client.rs index 2b6f397cd..71fbd65b6 100644 --- a/auraescript/src/builtin/auraescript_client.rs +++ b/auraescript/src/builtin/auraescript_client.rs @@ -1,6 +1,6 @@ use anyhow::Result; use client::{AuraeConfig, Client}; -use deno_core::{OpState, Resource, ResourceId}; +use deno_core::{Op, OpState, Resource, ResourceId}; use std::{cell::RefCell, rc::Rc}; // `AuraeConfig` `try_default` @@ -63,10 +63,10 @@ pub(crate) async fn as__client_new( pub(crate) fn op_decls() -> Vec<::deno_core::OpDecl> { vec![ - as__aurae_config__try_default::decl(), - as__aurae_config__from_options::decl(), - as__aurae_config__parse_from_file::decl(), - as__client_new::decl(), + as__aurae_config__try_default::DECL, + as__aurae_config__from_options::DECL, + as__aurae_config__parse_from_file::DECL, + as__client_new::DECL, ] } diff --git a/auraescript/src/cells.rs b/auraescript/src/cells.rs index 70831e85b..177151593 100644 --- a/auraescript/src/cells.rs +++ b/auraescript/src/cells.rs @@ -28,4 +28,6 @@ * * \* -------------------------------------------------------------------------- */ +use deno_core::Op; + macros::ops_generator!("../api/v0/cells/cells.proto", cells, CellService,); diff --git a/auraescript/src/cri.rs b/auraescript/src/cri.rs index 1e846b145..aac309fb0 100644 --- a/auraescript/src/cri.rs +++ b/auraescript/src/cri.rs @@ -28,6 +28,8 @@ * * \* -------------------------------------------------------------------------- */ +use deno_core::Op; + // TODO: macro doesn't support streaming. Does deno? macros::ops_generator!( "../api/cri/v1/release-1.26.proto", diff --git a/auraescript/src/discovery.rs b/auraescript/src/discovery.rs index 5b9cacdb9..03f9c1791 100644 --- a/auraescript/src/discovery.rs +++ b/auraescript/src/discovery.rs @@ -28,6 +28,8 @@ * * \* -------------------------------------------------------------------------- */ +use deno_core::Op; + macros::ops_generator!( "../api/v0/discovery/discovery.proto", discovery, diff --git a/auraescript/src/health.rs b/auraescript/src/health.rs index 3c12ef925..549974c08 100644 --- a/auraescript/src/health.rs +++ b/auraescript/src/health.rs @@ -28,6 +28,8 @@ * * \* -------------------------------------------------------------------------- */ +use deno_core::Op; + // TODO: macro doesn't support streaming. Does deno? macros::ops_generator!( "../api/grpc/health/v1/health.proto", diff --git a/auraescript/src/lib.rs b/auraescript/src/lib.rs index 48b4078c5..1c31a3ece 100644 --- a/auraescript/src/lib.rs +++ b/auraescript/src/lib.rs @@ -79,6 +79,7 @@ use deno_runtime::permissions::PermissionsContainer; use deno_runtime::worker::{MainWorker, WorkerOptions}; use deno_runtime::{BootstrapOptions, WorkerLogLevel}; +use std::borrow::Cow; use std::pin::Pin; use std::rc::Rc; @@ -95,7 +96,8 @@ fn get_error_class_name(e: &AnyError) -> &'static str { pub fn init(main_module: Url) -> MainWorker { let extension = - Extension::builder("").ops(stdlib()).build(); + //Extension::builder("").ops(stdlib()).build(); + Extension{name: "", ops: Cow::from(stdlib()), ..Default::default()}; MainWorker::bootstrap_from_options( main_module,