Skip to content

Commit

Permalink
move remaining APIs on Deno namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Apr 15, 2020
1 parent a2c146b commit f9bf07b
Show file tree
Hide file tree
Showing 5 changed files with 1,257 additions and 101 deletions.
14 changes: 7 additions & 7 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ fn main() {
println!("cargo:rerun-if-changed={}", bundle_path.display());
let snapshot_path = o.join("CLI_SNAPSHOT.bin");

let main_module_name = deno_typescript::compile_bundle(
&bundle_path,
root_names,
Some(extern_crate_modules.clone()),
)
.expect("Bundle compilation failed");
// let main_module_name = deno_typescript::compile_bundle(
// &bundle_path,
// root_names,
// Some(extern_crate_modules.clone()),
// )
// .expect("Bundle compilation failed");
assert!(bundle_path.exists());

let runtime_isolate = &mut Isolate::new(StartupData::None, true);
Expand All @@ -54,7 +54,7 @@ fn main() {
runtime_isolate,
&snapshot_path,
&bundle_path,
&main_module_name,
"asdf",
)
.expect("Failed to create snapshot");

Expand Down
10 changes: 5 additions & 5 deletions cli/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ pub const TS_VERSION: &str = env!("TS_VERSION");

pub static CLI_SNAPSHOT: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.bin"));
pub static CLI_SNAPSHOT_MAP: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.js.map"));
#[allow(dead_code)]
pub static CLI_SNAPSHOT_DTS: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.d.ts"));
// pub static CLI_SNAPSHOT_MAP: &[u8] =
// include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.js.map"));
// #[allow(dead_code)]
// pub static CLI_SNAPSHOT_DTS: &[u8] =
// include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.d.ts"));

pub static COMPILER_SNAPSHOT: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/COMPILER_SNAPSHOT.bin"));
Expand Down
3 changes: 2 additions & 1 deletion cli/source_maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ fn builtin_source_map(_: &str) -> Option<Vec<u8>> {
#[cfg(not(feature = "check-only"))]
fn builtin_source_map(file_name: &str) -> Option<Vec<u8>> {
if file_name.ends_with("CLI_SNAPSHOT.js") {
Some(crate::js::CLI_SNAPSHOT_MAP.to_vec())
// Some(crate::js::CLI_SNAPSHOT_MAP.to_vec())
None
} else if file_name.ends_with("COMPILER_SNAPSHOT.js") {
Some(crate::js::COMPILER_SNAPSHOT_MAP.to_vec())
} else {
Expand Down
Loading

0 comments on commit f9bf07b

Please sign in to comment.