mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 05:35:33 +00:00
refactor: create util folder, move nap_sym to napi/sym, move http_cache to cache folder (#16857)
This commit is contained in:
parent
f526513d74
commit
2d4c46c975
57 changed files with 940 additions and 920 deletions
33
cli/main.rs
33
cli/main.rs
|
@ -3,20 +3,13 @@
|
|||
mod args;
|
||||
mod auth_tokens;
|
||||
mod cache;
|
||||
mod checksum;
|
||||
mod deno_std;
|
||||
mod diff;
|
||||
mod display;
|
||||
mod emit;
|
||||
mod errors;
|
||||
mod file_fetcher;
|
||||
mod file_watcher;
|
||||
mod fs_util;
|
||||
mod graph_util;
|
||||
mod http_cache;
|
||||
mod http_util;
|
||||
mod js;
|
||||
mod logger;
|
||||
mod lsp;
|
||||
mod module_loader;
|
||||
mod napi;
|
||||
|
@ -24,15 +17,12 @@ mod node;
|
|||
mod npm;
|
||||
mod ops;
|
||||
mod proc_state;
|
||||
mod progress_bar;
|
||||
mod resolver;
|
||||
mod standalone;
|
||||
mod text_encoding;
|
||||
mod tools;
|
||||
mod tsc;
|
||||
mod unix_util;
|
||||
mod util;
|
||||
mod version;
|
||||
mod windows_util;
|
||||
mod worker;
|
||||
|
||||
use crate::args::flags_from_vec;
|
||||
|
@ -63,11 +53,12 @@ use crate::args::UpgradeFlags;
|
|||
use crate::args::VendorFlags;
|
||||
use crate::cache::TypeCheckCache;
|
||||
use crate::file_fetcher::File;
|
||||
use crate::file_watcher::ResolutionResult;
|
||||
use crate::graph_util::graph_lock_or_exit;
|
||||
use crate::proc_state::ProcState;
|
||||
use crate::resolver::CliResolver;
|
||||
use crate::tools::check;
|
||||
use crate::util::display;
|
||||
use crate::util::file_watcher::ResolutionResult;
|
||||
|
||||
use args::CliOptions;
|
||||
use args::Lockfile;
|
||||
|
@ -482,7 +473,7 @@ async fn bundle_command(
|
|||
if let Some(out_file) = out_file.as_ref() {
|
||||
let output_bytes = bundle_output.code.as_bytes();
|
||||
let output_len = output_bytes.len();
|
||||
fs_util::write_file(out_file, output_bytes, 0o644)?;
|
||||
util::fs::write_file(out_file, output_bytes, 0o644)?;
|
||||
info!(
|
||||
"{} {:?} ({})",
|
||||
colors::green("Emit"),
|
||||
|
@ -498,7 +489,7 @@ async fn bundle_command(
|
|||
"map".to_string()
|
||||
};
|
||||
let map_out_file = out_file.with_extension(ext);
|
||||
fs_util::write_file(&map_out_file, map_bytes, 0o644)?;
|
||||
util::fs::write_file(&map_out_file, map_bytes, 0o644)?;
|
||||
info!(
|
||||
"{} {:?} ({})",
|
||||
colors::green("Emit"),
|
||||
|
@ -515,10 +506,10 @@ async fn bundle_command(
|
|||
};
|
||||
|
||||
if cli_options.watch_paths().is_some() {
|
||||
file_watcher::watch_func(
|
||||
util::file_watcher::watch_func(
|
||||
resolver,
|
||||
operation,
|
||||
file_watcher::PrintConfig {
|
||||
util::file_watcher::PrintConfig {
|
||||
job_name: "Bundle".to_string(),
|
||||
clear_screen: !cli_options.no_clear_screen(),
|
||||
},
|
||||
|
@ -660,11 +651,11 @@ async fn run_with_watch(flags: Flags, script: String) -> Result<i32, AnyError> {
|
|||
})
|
||||
};
|
||||
|
||||
file_watcher::watch_func2(
|
||||
util::file_watcher::watch_func2(
|
||||
receiver,
|
||||
operation,
|
||||
(sender, main_module),
|
||||
file_watcher::PrintConfig {
|
||||
util::file_watcher::PrintConfig {
|
||||
job_name: "Process".to_string(),
|
||||
clear_screen: !flags.no_clear_screen,
|
||||
},
|
||||
|
@ -952,8 +943,8 @@ fn unwrap_or_exit<T>(result: Result<T, AnyError>) -> T {
|
|||
pub fn main() {
|
||||
setup_panic_hook();
|
||||
|
||||
unix_util::raise_fd_limit();
|
||||
windows_util::ensure_stdio_open();
|
||||
util::unix::raise_fd_limit();
|
||||
util::windows::ensure_stdio_open();
|
||||
#[cfg(windows)]
|
||||
colors::enable_ansi(); // For Windows 10
|
||||
|
||||
|
@ -984,7 +975,7 @@ pub fn main() {
|
|||
init_v8_flags(&flags.v8_flags);
|
||||
}
|
||||
|
||||
logger::init(flags.log_level);
|
||||
util::logger::init(flags.log_level);
|
||||
|
||||
get_subcommand(flags).await
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue