summaryrefslogtreecommitdiff
path: root/cli/resolver.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-02-13 21:52:30 +0530
committerGitHub <noreply@github.com>2024-02-13 21:52:30 +0530
commita68eb3fcc3997fce8680f87edce46f6450e79635 (patch)
tree6839607033226fdfb2ce1be3187ef93791096507 /cli/resolver.rs
parent492a9fbb9194a24a1f9223f797b4f4df9efde2bd (diff)
feat: denort binary for `deno compile` (#22205)
This introduces the `denort` binary - a slim version of deno without tooling. The binary is used as the default for `deno compile`. Improves `deno compile` final size by ~2.5x (141 MB -> 61 MB) on Linux x86_64.
Diffstat (limited to 'cli/resolver.rs')
-rw-r--r--cli/resolver.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/resolver.rs b/cli/resolver.rs
index 2c04823a7..5bb9e66d0 100644
--- a/cli/resolver.rs
+++ b/cli/resolver.rs
@@ -40,7 +40,7 @@ use std::sync::Arc;
use crate::args::package_json::PackageJsonDeps;
use crate::args::JsxImportSourceConfig;
use crate::args::PackageJsonDepsProvider;
-use crate::graph_util::format_range_with_colors;
+use crate::colors;
use crate::node::CliNodeCodeTranslator;
use crate::npm::ByonmCliNpmResolver;
use crate::npm::CliNpmResolver;
@@ -48,6 +48,15 @@ use crate::npm::InnerCliNpmResolverRef;
use crate::util::path::specifier_to_file_path;
use crate::util::sync::AtomicFlag;
+pub fn format_range_with_colors(range: &deno_graph::Range) -> String {
+ format!(
+ "{}:{}:{}",
+ colors::cyan(range.specifier.as_str()),
+ colors::yellow(&(range.start.line + 1).to_string()),
+ colors::yellow(&(range.start.character + 1).to_string())
+ )
+}
+
pub struct ModuleCodeStringSource {
pub code: ModuleCodeString,
pub found_url: ModuleSpecifier,