Skip to content

Commit

Permalink
cope with deno migration
Browse files Browse the repository at this point in the history
  • Loading branch information
dmah42 committed Aug 8, 2023
1 parent 9d2b3e8 commit 1383642
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion auraescript/macros/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<proc_macro2::TokenStream> = op_idents.map(|op_ident| {
quote! {
#op_ident::decl()
#op_ident::DECL
}
}).collect();

Expand Down
10 changes: 5 additions & 5 deletions auraescript/src/builtin/auraescript_client.rs
Original file line number Diff line number Diff line change
@@ -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`
Expand Down Expand Up @@ -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,
]
}

Expand Down
2 changes: 2 additions & 0 deletions auraescript/src/cells.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@
* *
\* -------------------------------------------------------------------------- */

use deno_core::Op;

macros::ops_generator!("../api/v0/cells/cells.proto", cells, CellService,);
2 changes: 2 additions & 0 deletions auraescript/src/cri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions auraescript/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* *
\* -------------------------------------------------------------------------- */

use deno_core::Op;

macros::ops_generator!(
"../api/v0/discovery/discovery.proto",
discovery,
Expand Down
2 changes: 2 additions & 0 deletions auraescript/src/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion auraescript/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
Expand Down

0 comments on commit 1383642

Please sign in to comment.