Skip to content

Commit

Permalink
Remove deno_typescript (denoland#6813)
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jul 20, 2020
1 parent 903d28f commit 2460689
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .dprintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"includes": ["**/*.{ts,tsx,js,jsx,json,md}"],
"excludes": [
".cargo_home",
"deno_typescript/typescript",
"cli/typescript",
"gh-pages",
"std/**/testdata",
"std/**/vendor",
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
path = third_party
url = https://github.com/denoland/deno_third_party.git
[submodule "typescript"]
path = deno_typescript/typescript
path = cli/typescript
url = https://github.com/microsoft/TypeScript.git
fetchRecurseSubmodules = false
shallow = true
10 changes: 0 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
members = [
"cli",
"core",
"deno_typescript",
"test_plugin",
"test_util",
]
Expand Down
4 changes: 2 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ path = "main.rs"

[build-dependencies]
deno_core = { path = "../core", version = "0.49.0" }
deno_typescript = { path = "../deno_typescript", version = "0.49.0" }
serde = { version = "1.0.112", features = ["derive"] }
serde_json = { version = "1.0.55", features = [ "preserve_order" ] }

[target.'cfg(windows)'.build-dependencies]
winres = "0.1"
Expand All @@ -25,7 +26,6 @@ winapi = "0.3.8"
[dependencies]
deno_core = { path = "../core", version = "0.49.0" }
deno_lint = "0.1.16"
deno_typescript = { path = "../deno_typescript", version = "0.49.0" }

atty = "0.2.14"
base64 = "0.12.2"
Expand Down
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

This provides the actual deno executable and the user-facing APIs.

The deno crate uses the deno_core and deno_typescript to provide the executable.
The deno crate uses the deno_core to provide the executable.
24 changes: 15 additions & 9 deletions cli/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
//
mod op_fetch_asset;

use deno_core::js_check;
use deno_core::CoreIsolate;
Expand Down Expand Up @@ -64,29 +66,33 @@ fn create_compiler_snapshot(
);
runtime_isolate.register_op(
"op_fetch_asset",
deno_typescript::op_fetch_asset(custom_libs),
op_fetch_asset::op_fetch_asset(custom_libs),
);

js_check(
runtime_isolate.execute("typescript.js", deno_typescript::TYPESCRIPT_CODE),
);
js_check(runtime_isolate.execute(
"typescript.js",
&std::fs::read_to_string("typescript/lib/typescript.js").unwrap(),
));

create_snapshot(runtime_isolate, snapshot_path, files);
}

fn ts_version() -> String {
let data = include_str!("typescript/package.json");
let pkg: serde_json::Value = serde_json::from_str(data).unwrap();
pkg["version"].as_str().unwrap().to_string()
}

fn main() {
// Don't build V8 if "cargo doc" is being run. This is to support docs.rs.
if env::var_os("RUSTDOCFLAGS").is_some() {
return;
}

// To debug snapshot issues uncomment:
// deno_typescript::trace_serializer();
// op_fetch_asset::trace_serializer();

println!(
"cargo:rustc-env=TS_VERSION={}",
deno_typescript::ts_version()
);
println!("cargo:rustc-env=TS_VERSION={}", ts_version());

println!(
"cargo:rustc-env=TARGET={}",
Expand Down
2 changes: 0 additions & 2 deletions cli/js2/99_main_compiler.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.

// TODO(ry) Combine this implementation with //deno_typescript/compiler_main.js

// This module is the entry point for "compiler" isolate, ie. the one
// that is created when Deno needs to compile TS/WASM to JS.
//
Expand Down
1 change: 1 addition & 0 deletions cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ mod metrics;
mod module_graph;
pub mod msg;
pub mod op_error;
mod op_fetch_asset;
pub mod ops;
pub mod permissions;
mod repl;
Expand Down
12 changes: 1 addition & 11 deletions deno_typescript/lib.rs → cli/op_fetch_asset.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
extern crate deno_core;
extern crate serde;
extern crate serde_json;
// Note: this module is used both in build.rs and main.rs.

pub use deno_core::v8_set_flags;
use deno_core::CoreIsolateState;
Expand All @@ -11,14 +9,6 @@ use deno_core::ZeroCopyBuf;
use std::collections::HashMap;
use std::path::PathBuf;

pub static TYPESCRIPT_CODE: &str = include_str!("typescript/lib/typescript.js");

pub fn ts_version() -> String {
let data = include_str!("typescript/package.json");
let pkg: serde_json::Value = serde_json::from_str(data).unwrap();
pkg["version"].as_str().unwrap().to_string()
}

fn get_asset(name: &str) -> Option<&'static str> {
macro_rules! inc {
($e:expr) => {
Expand Down
2 changes: 1 addition & 1 deletion cli/ops/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ pub fn init(i: &mut CoreIsolate, _s: &State) {
// TODO(bartlomieju): is this op even required?
i.register_op(
"op_fetch_asset",
deno_typescript::op_fetch_asset(custom_assets),
crate::op_fetch_asset::op_fetch_asset(custom_assets),
);
}
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions cli/tests/unit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

Files in this directory are unit tests for Deno runtime.

They are run under compiled Deno binary as opposed to files in `cli/js/` which
are bundled and snapshotted using `deno_typescript` crate.

Testing Deno runtime code requires checking API under different runtime
permissions (ie. running with different `--allow-*` flags). To accomplish this
all tests exercised are created using `unitTest()` function.
Expand Down
24 changes: 0 additions & 24 deletions deno_typescript/Cargo.toml

This file was deleted.

82 changes: 0 additions & 82 deletions deno_typescript/README.md

This file was deleted.

0 comments on commit 2460689

Please sign in to comment.