mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 05:35:33 +00:00
refactor: add RootConfig
(#14985)
This commit is contained in:
parent
5b7bcefa11
commit
01adbb1efb
21 changed files with 917 additions and 819 deletions
|
@ -1,8 +1,9 @@
|
|||
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
use crate::colors;
|
||||
use crate::emit::TypeLib;
|
||||
use crate::emit::TsTypeLib;
|
||||
use crate::errors::get_error_class_name;
|
||||
|
||||
use deno_core::error::custom_error;
|
||||
use deno_core::error::AnyError;
|
||||
use deno_core::ModuleSpecifier;
|
||||
|
@ -43,7 +44,7 @@ pub enum ModuleEntry {
|
|||
ts_check: bool,
|
||||
/// A set of type libs that the module has passed a type check with this
|
||||
/// session. This would consist of window, worker or both.
|
||||
checked_libs: HashSet<TypeLib>,
|
||||
checked_libs: HashSet<TsTypeLib>,
|
||||
maybe_types: Option<Resolved>,
|
||||
},
|
||||
Configuration {
|
||||
|
@ -385,7 +386,7 @@ impl GraphData {
|
|||
pub fn set_type_checked(
|
||||
&mut self,
|
||||
roots: &[(ModuleSpecifier, ModuleKind)],
|
||||
lib: &TypeLib,
|
||||
lib: TsTypeLib,
|
||||
) {
|
||||
let specifiers: Vec<ModuleSpecifier> =
|
||||
match self.walk(roots, true, true, true) {
|
||||
|
@ -396,7 +397,7 @@ impl GraphData {
|
|||
if let ModuleEntry::Module { checked_libs, .. } =
|
||||
self.modules.get_mut(&specifier).unwrap()
|
||||
{
|
||||
checked_libs.insert(lib.clone());
|
||||
checked_libs.insert(lib);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -405,7 +406,7 @@ impl GraphData {
|
|||
pub fn is_type_checked(
|
||||
&self,
|
||||
roots: &[(ModuleSpecifier, ModuleKind)],
|
||||
lib: &TypeLib,
|
||||
lib: &TsTypeLib,
|
||||
) -> bool {
|
||||
roots.iter().all(|(r, _)| {
|
||||
let found = self.follow_redirect(r);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue