1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600)

This commit is contained in:
Ry Dahl 2020-01-05 11:56:18 -05:00 committed by GitHub
parent 5f1df038fb
commit 76e44ddfd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 164 additions and 155 deletions

38
Cargo.lock generated
View file

@ -255,22 +255,6 @@ dependencies = [
[[package]]
name = "deno"
version = "0.28.1"
dependencies = [
"downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rusty_v8 0.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "deno_cli"
version = "0.28.1"
dependencies = [
"ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
@ -278,7 +262,7 @@ dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"deno 0.28.1",
"deno_core 0.28.1",
"deno_typescript 0.28.1",
"dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"dlopen 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -316,11 +300,27 @@ dependencies = [
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "deno_core"
version = "0.28.1"
dependencies = [
"downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rusty_v8 0.0.23 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "deno_typescript"
version = "0.28.1"
dependencies = [
"deno 0.28.1",
"deno_core 0.28.1",
"serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1555,7 +1555,7 @@ name = "test_plugin"
version = "0.0.1"
dependencies = [
"deno 0.28.1",
"deno_cli 0.28.1",
"deno_core 0.28.1",
"futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

View file

@ -1,7 +1,7 @@
# Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
[package]
name = "deno_cli"
name = "deno"
version = "0.28.1"
license = "MIT"
authors = ["the Deno authors"]
@ -11,7 +11,7 @@ repository = "https://github.com/denoland/deno"
default-run = "deno"
[lib]
name = "deno_cli"
name = "deno"
path = "lib.rs"
[[bin]]
@ -22,7 +22,7 @@ path = "main.rs"
deno_typescript = { path = "../deno_typescript", version = "0.28.1" }
[dependencies]
deno = { path = "../core", version = "0.28.1" }
deno_core = { path = "../core", version = "0.28.1" }
deno_typescript = { path = "../deno_typescript", version = "0.28.1" }
ansi_term = "0.12.1"

View file

@ -3,7 +3,7 @@ use crate::compilers::CompiledModule;
use crate::compilers::CompiledModuleFuture;
use crate::file_fetcher::SourceFile;
use crate::futures::future::FutureExt;
use deno::ErrBox;
use deno_core::ErrBox;
use regex::Regex;
use std::pin::Pin;
use std::str;

View file

@ -1,5 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use deno::ErrBox;
use deno_core::ErrBox;
use futures::Future;
mod js;

View file

@ -12,9 +12,9 @@ use crate::startup_data;
use crate::state::*;
use crate::version;
use crate::worker::Worker;
use deno::Buf;
use deno::ErrBox;
use deno::ModuleSpecifier;
use deno_core::Buf;
use deno_core::ErrBox;
use deno_core::ModuleSpecifier;
use futures::future::FutureExt;
use futures::Future;
use regex::Regex;
@ -604,7 +604,7 @@ mod tests {
use super::*;
use crate::fs as deno_fs;
use crate::tokio_util;
use deno::ModuleSpecifier;
use deno_core::ModuleSpecifier;
use std::path::PathBuf;
use tempfile::TempDir;
@ -652,7 +652,7 @@ mod tests {
.parent()
.unwrap()
.join("tests/002_hello.ts");
use deno::ModuleSpecifier;
use deno_core::ModuleSpecifier;
let module_name = ModuleSpecifier::resolve_url_or_path(p.to_str().unwrap())
.unwrap()
.to_string();

View file

@ -3,9 +3,9 @@ use crate::diagnostics::Diagnostic;
use crate::fmt_errors::JSError;
use crate::import_map::ImportMapError;
pub use crate::msg::ErrorKind;
use deno::AnyError;
use deno::ErrBox;
use deno::ModuleResolutionError;
use deno_core::AnyError;
use deno_core::ErrBox;
use deno_core::ModuleResolutionError;
use dlopen::Error as DlopenError;
use http::uri;
use hyper;
@ -355,9 +355,9 @@ mod tests {
use crate::diagnostics::Diagnostic;
use crate::diagnostics::DiagnosticCategory;
use crate::diagnostics::DiagnosticItem;
use deno::ErrBox;
use deno::StackFrame;
use deno::V8Exception;
use deno_core::ErrBox;
use deno_core::StackFrame;
use deno_core::V8Exception;
fn js_error() -> JSError {
JSError::new(V8Exception {

View file

@ -8,8 +8,8 @@ use crate::http_util;
use crate::http_util::FetchOnceResult;
use crate::msg;
use crate::progress::Progress;
use deno::ErrBox;
use deno::ModuleSpecifier;
use deno_core::ErrBox;
use deno_core::ModuleSpecifier;
use futures::future::Either;
use futures::future::FutureExt;
use serde_json;

View file

@ -3,9 +3,9 @@
use crate::colors;
use crate::source_maps::apply_source_map;
use crate::source_maps::SourceMapGetter;
use deno::ErrBox;
use deno::StackFrame;
use deno::V8Exception;
use deno_core::ErrBox;
use deno_core::StackFrame;
use deno_core::V8Exception;
use std::error::Error;
use std::fmt;

View file

@ -5,7 +5,7 @@ use std::io::ErrorKind;
use std::io::Write;
use std::path::{Path, PathBuf};
use deno::ErrBox;
use deno_core::ErrBox;
use rand;
use rand::Rng;
use url::Url;

View file

@ -13,8 +13,8 @@ use crate::metrics::Metrics;
use crate::msg;
use crate::permissions::DenoPermissions;
use crate::progress::Progress;
use deno::ErrBox;
use deno::ModuleSpecifier;
use deno_core::ErrBox;
use deno_core::ModuleSpecifier;
use std;
use std::env;
use std::future::Future;

View file

@ -3,7 +3,7 @@ use crate::deno_error;
use crate::deno_error::DenoError;
use crate::version;
use bytes::Bytes;
use deno::ErrBox;
use deno_core::ErrBox;
use futures::future::FutureExt;
use reqwest;
use reqwest::header::HeaderMap;

View file

@ -1,5 +1,5 @@
use deno::ErrBox;
use deno::ModuleSpecifier;
use deno_core::ErrBox;
use deno_core::ModuleSpecifier;
use indexmap::IndexMap;
use serde_json::Map;
use serde_json::Value;

View file

@ -28,9 +28,11 @@ pub fn get_asset(name: &str) -> Option<&'static str> {
#[test]
fn cli_snapshot() {
let mut isolate =
deno::Isolate::new(deno::StartupData::Snapshot(CLI_SNAPSHOT), false);
deno::js_check(isolate.execute(
let mut isolate = deno_core::Isolate::new(
deno_core::StartupData::Snapshot(CLI_SNAPSHOT),
false,
);
deno_core::js_check(isolate.execute(
"<anon>",
r#"
if (!window) {
@ -43,9 +45,11 @@ fn cli_snapshot() {
#[test]
fn compiler_snapshot() {
let mut isolate =
deno::Isolate::new(deno::StartupData::Snapshot(COMPILER_SNAPSHOT), false);
deno::js_check(isolate.execute(
let mut isolate = deno_core::Isolate::new(
deno_core::StartupData::Snapshot(COMPILER_SNAPSHOT),
false,
);
deno_core::js_check(isolate.execute(
"<anon>",
r#"
if (!compilerMain) {

View file

@ -7,7 +7,7 @@ extern crate futures;
#[macro_use]
extern crate serde_json;
extern crate clap;
extern crate deno;
extern crate deno_core;
extern crate indexmap;
#[cfg(unix)]
extern crate nix;
@ -58,9 +58,9 @@ use crate::ops::io::get_stdio;
use crate::progress::Progress;
use crate::state::ThreadSafeState;
use crate::worker::Worker;
use deno::v8_set_flags;
use deno::ErrBox;
use deno::ModuleSpecifier;
use deno_core::v8_set_flags;
use deno_core::ErrBox;
use deno_core::ModuleSpecifier;
use flags::DenoFlags;
use flags::DenoSubcommand;
use log::Level;

View file

@ -1,5 +1,5 @@
extern crate deno_cli;
extern crate deno;
fn main() {
deno_cli::main();
deno::main();
}

View file

@ -4,8 +4,8 @@ use crate::futures::future::try_join_all;
use crate::msg;
use crate::ops::json_op;
use crate::state::ThreadSafeState;
use deno::Loader;
use deno::*;
use deno_core::Loader;
use deno_core::*;
pub fn init(i: &mut Isolate, s: &ThreadSafeState) {
i.register_op("cache", s.core_op(json_op(s.stateful_op(op_cache))));

View file

@ -1,5 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use deno::*;
use deno_core::*;
use futures::future::FutureExt;
use futures::task::SpawnExt;
pub use serde_derive::Deserialize;

View file

@ -7,11 +7,11 @@
use crate::deno_error::GetErrorKind;
use crate::msg::ErrorKind;
use byteorder::{LittleEndian, WriteBytesExt};
use deno::Buf;
use deno::CoreOp;
use deno::ErrBox;
use deno::Op;
use deno::PinnedBuf;
use deno_core::Buf;
use deno_core::CoreOp;
use deno_core::ErrBox;
use deno_core::Op;
use deno_core::PinnedBuf;
use futures::future::FutureExt;
use std::future::Future;
use std::pin::Pin;

View file

@ -5,7 +5,7 @@ use crate::ops::json_op;
use crate::source_maps::get_orig_position;
use crate::source_maps::CachedMaps;
use crate::state::ThreadSafeState;
use deno::*;
use deno_core::*;
use std::collections::HashMap;
pub fn init(i: &mut Isolate, s: &ThreadSafeState) {

View file

@ -4,7 +4,7 @@ use super::io::StreamResource;
use crate::http_util::{get_client, HttpBody};
use crate::ops::json_op;
use crate::state::ThreadSafeState;
use deno::*;
use deno_core::*;
use futures::future::FutureExt;
use http::header::HeaderName;
use http::header::HeaderValue;

View file

@ -7,7 +7,7 @@ use crate::deno_error::ErrorKind;
use crate::fs as deno_fs;
use crate::ops::json_op;
use crate::state::ThreadSafeState;
use deno::*;
use deno_core::*;
use futures::future::FutureExt;
use std;
use std::convert::From;

View file

@ -6,7 +6,7 @@ use crate::deno_error::ErrorKind;
use crate::fs as deno_fs;
use crate::ops::json_op;
use crate::state::ThreadSafeState;
use deno::*;
use deno_core::*;
use remove_dir_all::remove_dir_all;
use std::convert::From;
use std::fs;

View file

@ -4,9 +4,9 @@ use crate::deno_error::bad_resource;
use crate::http_util::HttpBody;
use crate::ops::minimal_op;
use crate::state::ThreadSafeState;
use deno::ErrBox;
use deno::Resource;
use deno::*;
use deno_core::ErrBox;
use deno_core::Resource;
use deno_core::*;
use futures::future::FutureExt;
use futures::ready;
use std::future::Future;

View file

@ -5,8 +5,8 @@ use crate::deno_error::bad_resource;
use crate::ops::json_op;
use crate::resolve_addr::resolve_addr;
use crate::state::ThreadSafeState;
use deno::Resource;
use deno::*;
use deno_core::Resource;
use deno_core::*;
use futures::future::FutureExt;
use std;
use std::convert::From;

View file

@ -6,7 +6,7 @@ use crate::ops::json_op;
use crate::state::ThreadSafeState;
use crate::version;
use atty;
use deno::*;
use deno_core::*;
use std::collections::HashMap;
use std::env;
use std::io::{Error, ErrorKind};

View file

@ -3,7 +3,7 @@ use super::dispatch_json::{Deserialize, JsonOp, Value};
use crate::deno_error::type_error;
use crate::ops::json_op;
use crate::state::ThreadSafeState;
use deno::*;
use deno_core::*;
pub fn init(i: &mut Isolate, s: &ThreadSafeState) {
i.register_op(

View file

@ -2,13 +2,17 @@ use super::dispatch_json::{Deserialize, JsonOp, Value};
use crate::fs as deno_fs;
use crate::ops::json_op;
use crate::state::ThreadSafeState;
use deno::*;
use deno_core::*;
use dlopen::symbor::Library;
use std::collections::HashMap;
use std::ffi::OsStr;
use std::sync::Arc;
pub fn init(i: &mut Isolate, s: &ThreadSafeState, r: Arc<deno::OpRegistry>) {
pub fn init(
i: &mut Isolate,
s: &ThreadSafeState,
r: Arc<deno_core::OpRegistry>,
) {
let r_ = r;
i.register_op(
"open_plugin",
@ -52,7 +56,7 @@ struct OpenPluginArgs {
}
pub fn op_open_plugin(
registry: &Arc<deno::OpRegistry>,
registry: &Arc<deno_core::OpRegistry>,
state: &ThreadSafeState,
args: Value,
_zero_copy: Option<PinnedBuf>,

View file

@ -5,7 +5,7 @@ use crate::deno_error::bad_resource;
use crate::ops::json_op;
use crate::signal::kill;
use crate::state::ThreadSafeState;
use deno::*;
use deno_core::*;
use futures;
use futures::future::FutureExt;
use futures::future::TryFutureExt;

View file

@ -2,7 +2,7 @@
use super::dispatch_json::{JsonOp, Value};
use crate::ops::json_op;
use crate::state::ThreadSafeState;
use deno::*;
use deno_core::*;
use rand::thread_rng;
use rand::Rng;

View file

@ -5,8 +5,8 @@ use crate::ops::json_op;
use crate::repl;
use crate::repl::Repl;
use crate::state::ThreadSafeState;
use deno::Resource;
use deno::*;
use deno_core::Resource;
use deno_core::*;
use std::sync::Arc;
use std::sync::Mutex;

View file

@ -2,7 +2,7 @@
use super::dispatch_json::{JsonOp, Value};
use crate::ops::json_op;
use crate::state::ThreadSafeState;
use deno::*;
use deno_core::*;
pub fn init(i: &mut Isolate, s: &ThreadSafeState) {
i.register_op("resources", s.core_op(json_op(s.stateful_op(op_resources))));

View file

@ -2,7 +2,7 @@
use super::dispatch_json::{Deserialize, JsonOp, Value};
use crate::ops::json_op;
use crate::state::ThreadSafeState;
use deno::*;
use deno_core::*;
use futures::future::FutureExt;
use std;
use std::time::Duration;

View file

@ -7,8 +7,8 @@ use crate::deno_error::ErrorKind;
use crate::ops::json_op;
use crate::resolve_addr::resolve_addr;
use crate::state::ThreadSafeState;
use deno::Resource;
use deno::*;
use deno_core::Resource;
use deno_core::*;
use futures::future::FutureExt;
use std;
use std::convert::From;

View file

@ -8,7 +8,7 @@ use crate::ops::json_op;
use crate::startup_data;
use crate::state::ThreadSafeState;
use crate::worker::Worker;
use deno::*;
use deno_core::*;
use futures;
use futures::future::FutureExt;
use futures::future::TryFutureExt;

View file

@ -4,7 +4,7 @@ use crate::flags::DenoFlags;
use ansi_term::Style;
#[cfg(not(test))]
use atty;
use deno::ErrBox;
use deno_core::ErrBox;
use log;
use std::collections::HashSet;
use std::fmt;

View file

@ -1,6 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use crate::deno_dir::DenoDir;
use deno::ErrBox;
use deno_core::ErrBox;
use rustyline;
use std::fs;
use std::path::PathBuf;

View file

@ -1,5 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use deno::ErrBox;
use deno_core::ErrBox;
use std::future::Future;
use std::net::SocketAddr;
use std::net::ToSocketAddrs;

View file

@ -10,7 +10,7 @@ use std::fmt;
use std::io::prelude::*;
use atty;
use deno::ErrBox;
use deno_core::ErrBox;
use termcolor::Color::{Cyan, Green, Red, Yellow};
use termcolor::{self, Color, ColorSpec, StandardStream, WriteColor};

View file

@ -1,4 +1,4 @@
use deno::ErrBox;
use deno_core::ErrBox;
#[cfg(unix)]
pub fn kill(pid: i32, signo: i32) -> Result<(), ErrBox> {

View file

@ -1,7 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
//! This mod provides functions to remap a deno::V8Exception based on a source map
use deno::StackFrame;
use deno::V8Exception;
//! This mod provides functions to remap a deno_core::V8Exception based on a source map
use deno_core::StackFrame;
use deno_core::V8Exception;
use serde_json;
use source_map_mappings::parse_mappings;
use source_map_mappings::Bias;

View file

@ -1,10 +1,10 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
#[cfg(feature = "no-snapshot-init")]
use deno::Script;
use deno_core::Script;
use crate::js::CLI_SNAPSHOT;
use crate::js::COMPILER_SNAPSHOT;
use deno::StartupData;
use deno_core::StartupData;
#[cfg(feature = "no-snapshot-init")]
pub fn deno_isolate_init() -> StartupData<'static> {

View file

@ -9,14 +9,14 @@ use crate::ops::MinimalOp;
use crate::permissions::DenoPermissions;
use crate::worker::Worker;
use crate::worker::WorkerChannels;
use deno::Buf;
use deno::CoreOp;
use deno::ErrBox;
use deno::Loader;
use deno::ModuleSpecifier;
use deno::Op;
use deno::PinnedBuf;
use deno::ResourceTable;
use deno_core::Buf;
use deno_core::CoreOp;
use deno_core::ErrBox;
use deno_core::Loader;
use deno_core::ModuleSpecifier;
use deno_core::Op;
use deno_core::PinnedBuf;
use deno_core::ResourceTable;
use futures::channel::mpsc;
use futures::future::FutureExt;
use futures::future::TryFutureExt;
@ -43,7 +43,7 @@ pub struct ThreadSafeState(Arc<State>);
#[cfg_attr(feature = "cargo-clippy", allow(stutter))]
pub struct State {
pub global_state: ThreadSafeGlobalState,
pub modules: Arc<Mutex<deno::Modules>>,
pub modules: Arc<Mutex<deno_core::Modules>>,
pub permissions: Arc<Mutex<DenoPermissions>>,
pub main_module: Option<ModuleSpecifier>,
pub worker_channels: Mutex<WorkerChannels>,
@ -179,13 +179,13 @@ impl Loader for ThreadSafeState {
&self,
module_specifier: &ModuleSpecifier,
maybe_referrer: Option<ModuleSpecifier>,
) -> Pin<Box<deno::SourceCodeInfoFuture>> {
) -> Pin<Box<deno_core::SourceCodeInfoFuture>> {
self.metrics.resolve_count.fetch_add(1, Ordering::SeqCst);
let module_url_specified = module_specifier.to_string();
let fut = self
.global_state
.fetch_compiled_module(module_specifier, maybe_referrer)
.map_ok(|compiled_module| deno::SourceCodeInfo {
.map_ok(|compiled_module| deno_core::SourceCodeInfo {
// Real module name, might be different from initial specifier
// due to redirections.
code: compiled_module.code,
@ -231,7 +231,7 @@ impl ThreadSafeState {
None => None,
};
let modules = Arc::new(Mutex::new(deno::Modules::new()));
let modules = Arc::new(Mutex::new(deno_core::Modules::new()));
let permissions = if let Some(perm) = shared_permissions {
perm
} else {

View file

@ -680,8 +680,8 @@ itest!(top_level_for_await_ts {
});
mod util {
use deno_cli::colors::strip_ansi_codes;
pub use deno_cli::test_util::*;
use deno::colors::strip_ansi_codes;
pub use deno::test_util::*;
use os_pipe::pipe;
use std::io::Read;
use std::io::Write;

View file

@ -6,7 +6,7 @@
mod tests {
extern crate lazy_static;
extern crate tempfile;
use deno_cli::test_util::*;
use deno::test_util::*;
use std::process::Command;
use tempfile::TempDir;

View file

@ -3,5 +3,5 @@ pub const DENO: &str = env!("CARGO_PKG_VERSION");
pub const TYPESCRIPT: &str = crate::js::TS_VERSION;
pub fn v8() -> &'static str {
deno::v8_version()
deno_core::v8_version()
}

View file

@ -2,12 +2,12 @@
use crate::fmt_errors::JSError;
use crate::ops;
use crate::state::ThreadSafeState;
use deno;
use deno::Buf;
use deno::ErrBox;
use deno::ModuleSpecifier;
use deno::RecursiveLoad;
use deno::StartupData;
use deno_core;
use deno_core::Buf;
use deno_core::ErrBox;
use deno_core::ModuleSpecifier;
use deno_core::RecursiveLoad;
use deno_core::StartupData;
use futures::channel::mpsc;
use futures::future::FutureExt;
use futures::future::TryFutureExt;
@ -30,12 +30,12 @@ pub struct WorkerChannels {
pub receiver: mpsc::Receiver<Buf>,
}
/// Wraps deno::Isolate to provide source maps, ops for the CLI, and
/// Wraps deno_core::Isolate to provide source maps, ops for the CLI, and
/// high-level module loading.
#[derive(Clone)]
pub struct Worker {
pub name: String,
isolate: Arc<Mutex<deno::Isolate>>,
isolate: Arc<Mutex<deno_core::Isolate>>,
pub state: ThreadSafeState,
external_channels: Arc<Mutex<WorkerChannels>>,
}
@ -47,7 +47,8 @@ impl Worker {
state: ThreadSafeState,
external_channels: WorkerChannels,
) -> Self {
let isolate = Arc::new(Mutex::new(deno::Isolate::new(startup_data, false)));
let isolate =
Arc::new(Mutex::new(deno_core::Isolate::new(startup_data, false)));
{
let mut i = isolate.lock().unwrap();
let op_registry = i.op_registry.clone();

View file

@ -1,7 +1,7 @@
# Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
[package]
name = "deno"
name = "deno_core"
version = "0.28.1"
edition = "2018"
description = "A secure JavaScript/TypeScript runtime built with V8, Rust, and Tokio"
@ -21,9 +21,7 @@ libc = "0.2.65"
log = "0.4.8"
serde_json = "1.0.41"
url = "2.1"
rusty_v8 = "0.0.23"
# rusty_v8 = { path = "../../rusty_v8" }
[[example]]
name = "deno_core_http_bench"

View file

@ -2,7 +2,7 @@
///
/// > DENO_BUILD_MODE=release ./tools/build.py && \
/// ./target/release/deno_core_http_bench --multi-thread
extern crate deno;
extern crate deno_core;
extern crate futures;
extern crate libc;
extern crate num_cpus;
@ -13,7 +13,7 @@ extern crate log;
#[macro_use]
extern crate lazy_static;
use deno::*;
use deno_core::*;
use futures::future::Future;
use futures::future::FutureExt;
use futures::task::{Context, Poll};
@ -141,7 +141,7 @@ fn http_op(
fn main() {
let args: Vec<String> = env::args().collect();
// NOTE: `--help` arg will display V8 help and exit
let args = deno::v8_set_flags(args);
let args = deno_core::v8_set_flags(args);
log::set_logger(&LOGGER).unwrap();
log::set_max_level(if args.iter().any(|a| a == "-D") {
@ -157,7 +157,7 @@ fn main() {
filename: "http_bench.js",
});
let isolate = deno::Isolate::new(startup_data, false);
let isolate = deno_core::Isolate::new(startup_data, false);
isolate.register_op("listen", http_op(op_listen));
isolate.register_op("accept", http_op(op_accept));
isolate.register_op("read", http_op(op_read));

View file

@ -19,6 +19,6 @@ exclude = [
path = "lib.rs"
[dependencies]
deno = { path = "../core", version = "0.28.1" }
deno_core = { path = "../core", version = "0.28.1" }
serde_json = "1.0.41"
serde = { version = "1.0.102", features = ["derive"] }

View file

@ -1,17 +1,17 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
extern crate deno;
extern crate deno_core;
extern crate serde;
extern crate serde_json;
mod ops;
use deno::js_check;
pub use deno::v8_set_flags;
use deno::CoreOp;
use deno::ErrBox;
use deno::Isolate;
use deno::ModuleSpecifier;
use deno::PinnedBuf;
use deno::StartupData;
use deno_core::js_check;
pub use deno_core::v8_set_flags;
use deno_core::CoreOp;
use deno_core::ErrBox;
use deno_core::Isolate;
use deno_core::ModuleSpecifier;
use deno_core::PinnedBuf;
use deno_core::StartupData;
pub use ops::EmitResult;
use ops::WrittenFile;
use std::fs;
@ -306,7 +306,9 @@ pub fn get_asset(name: &str) -> Option<&'static str> {
/// Sets the --trace-serializer V8 flag for debugging snapshots.
pub fn trace_serializer() {
let dummy = "foo".to_string();
let r =
deno::v8_set_flags(vec![dummy.clone(), "--trace-serializer".to_string()]);
let r = deno_core::v8_set_flags(vec![
dummy.clone(),
"--trace-serializer".to_string(),
]);
assert_eq!(r, vec![dummy]);
}

View file

@ -1,8 +1,8 @@
use crate::TSState;
use deno::CoreOp;
use deno::ErrBox;
use deno::ModuleSpecifier;
use deno::Op;
use deno_core::CoreOp;
use deno_core::ErrBox;
use deno_core::ModuleSpecifier;
use deno_core::Op;
use serde::Deserialize;
use serde_json::json;
use serde_json::Value;

View file

@ -10,5 +10,5 @@ crate-type = ["cdylib"]
[dependencies]
futures = "0.3"
deno = { path = "../core" }
deno_cli = { path = "../cli" }
deno_core = { path = "../core" }
deno = { path = "../cli" }

View file

@ -1,11 +1,11 @@
#[macro_use]
extern crate deno;
extern crate deno_core;
extern crate futures;
use deno::CoreOp;
use deno::Op;
use deno::PluginInitContext;
use deno::{Buf, PinnedBuf};
use deno_core::CoreOp;
use deno_core::Op;
use deno_core::PluginInitContext;
use deno_core::{Buf, PinnedBuf};
use futures::future::FutureExt;
fn init(context: &mut dyn PluginInitContext) {

View file

@ -1,4 +1,4 @@
use deno_cli::test_util::*;
use deno::test_util::*;
use std::process::Command;
fn deno_cmd() -> Command {