mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
refactor(cli): add Emitter
struct (#18690)
Removes the functions in the `emit` module and replaces them with an `Emitter` struct that can have "ctor dependencies" injected rather than using functions to pass along the dependencies. This is part of a long term refactor to move more functionality out of proc state.
This commit is contained in:
parent
6e8618ae0f
commit
d192d84a0e
5 changed files with 102 additions and 80 deletions
|
@ -1,7 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
use crate::args::TsTypeLib;
|
||||
use crate::emit::emit_parsed_source;
|
||||
use crate::node;
|
||||
use crate::proc_state::ProcState;
|
||||
use crate::util::text_encoding::code_without_source_map;
|
||||
|
@ -117,14 +116,10 @@ impl CliModuleLoader {
|
|||
| MediaType::Jsx
|
||||
| MediaType::Tsx => {
|
||||
// get emit text
|
||||
emit_parsed_source(
|
||||
&self.ps.emit_cache,
|
||||
&self.ps.parsed_source_cache,
|
||||
self.ps.emitter.emit_parsed_source(
|
||||
specifier,
|
||||
*media_type,
|
||||
source,
|
||||
&self.ps.emit_options,
|
||||
self.ps.emit_options_hash,
|
||||
)?
|
||||
}
|
||||
MediaType::TsBuildInfo | MediaType::Wasm | MediaType::SourceMap => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue