From 9bb89a64808563a781ee512ec71690ee009a4e8e Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Thu, 31 Dec 2020 16:17:40 +1100 Subject: [PATCH] address feedback --- cli/dts/lib.deno.unstable.d.ts | 7 ++----- cli/ops/runtime_compiler.rs | 8 ++++---- cli/tsc_config.rs | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 5744a4c074bed2..01d2ff2e149166 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -340,9 +340,6 @@ declare namespace Deno { /** Emit the source alongside the source maps within a single file; requires * `inlineSourceMap` or `sourceMap` to be set. Defaults to `false`. */ inlineSources?: boolean; - /** Perform additional checks to ensure that transpile only would be safe. - * Defaults to `true`. */ - isolatedModules?: boolean; /** Support JSX in `.tsx` files: `"react"`, `"preserve"`, `"react-native"`. * Defaults to `"react"`. */ jsx?: "react" | "preserve" | "react-native"; @@ -539,7 +536,7 @@ declare namespace Deno { files: Record; /** An optional array of any compiler options that were ignored by Deno. */ ignoredOptions?: string[]; - /** An array of internal statics related to the emit, for diagnostic + /** An array of internal statistics related to the emit, for diagnostic * purposes. */ stats: Array<[string, number]>; } @@ -551,7 +548,7 @@ declare namespace Deno { * `Deno.emit()` provides a way to provide Deno arbitrary JavaScript * or TypeScript and have it return JavaScript based on the options and * settings provided. The source code can either be provided or the modules - * can be fetched and resolved like other modules are resolved. + * can be fetched and resolved in line with the behavior of the command line. * * Requires `allow-read` and/or `allow-net` if sources are not provided. * diff --git a/cli/ops/runtime_compiler.rs b/cli/ops/runtime_compiler.rs index 3a3f0b4c1c55e4..774b280bae4951 100644 --- a/cli/ops/runtime_compiler.rs +++ b/cli/ops/runtime_compiler.rs @@ -9,9 +9,9 @@ use crate::specifier_handler::FetchHandler; use crate::specifier_handler::MemoryHandler; use crate::specifier_handler::SpecifierHandler; -use deno_core::error::anyhow; use deno_core::error::generic_error; use deno_core::error::AnyError; +use deno_core::error::Context; use deno_core::serde_json; use deno_core::serde_json::json; use deno_core::serde_json::Value; @@ -76,9 +76,9 @@ async fn op_emit( }; let maybe_import_map = if let Some(import_map_str) = args.import_map_path { let import_map_specifier = - ModuleSpecifier::resolve_url_or_path(&import_map_str).map_err(|_| { - anyhow!("Bad file path (\"{}\") for import map.", import_map_str) - })?; + ModuleSpecifier::resolve_url_or_path(&import_map_str).context( + format!("Bad file path (\"{}\") for import map.", import_map_str), + )?; let import_map_url = import_map_specifier.as_url(); let import_map = if let Some(value) = args.import_map { ImportMap::from_json(&import_map_url.to_string(), &value.to_string())? diff --git a/cli/tsc_config.rs b/cli/tsc_config.rs index 2409106fd849af..1f420ed3a79661 100644 --- a/cli/tsc_config.rs +++ b/cli/tsc_config.rs @@ -73,7 +73,6 @@ pub const IGNORED_COMPILER_OPTIONS: &[&str] = &[ "importHelpers", "inlineSourceMap", "inlineSources", - "isolatedModules", "module", "noEmitHelpers", "noLib", @@ -106,6 +105,7 @@ pub const IGNORED_RUNTIME_COMPILER_OPTIONS: &[&str] = &[ "help", "incremental", "init", + "isolatedModules", "listEmittedFiles", "listFiles", "mapRoot",