mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 13:44:08 +00:00
refactor: upgrade to deno_ast 0.31 and deno_graph 0.59 (#20965)
This commit is contained in:
parent
a7bd0cf7a8
commit
59a5fe530f
11 changed files with 79 additions and 68 deletions
|
@ -92,15 +92,23 @@ pub fn graph_valid(
|
|||
.errors()
|
||||
.flat_map(|error| {
|
||||
let is_root = match &error {
|
||||
ModuleGraphError::ResolutionError(_) => false,
|
||||
ModuleGraphError::ResolutionError(_)
|
||||
| ModuleGraphError::TypesResolutionError(_) => false,
|
||||
ModuleGraphError::ModuleError(error) => {
|
||||
roots.contains(error.specifier())
|
||||
}
|
||||
};
|
||||
let mut message = if let ModuleGraphError::ResolutionError(err) = &error {
|
||||
enhanced_resolution_error_message(err)
|
||||
} else {
|
||||
format!("{error}")
|
||||
let mut message = match &error {
|
||||
ModuleGraphError::ResolutionError(resolution_error) => {
|
||||
enhanced_resolution_error_message(resolution_error)
|
||||
}
|
||||
ModuleGraphError::TypesResolutionError(resolution_error) => {
|
||||
format!(
|
||||
"Failed resolving types. {}",
|
||||
enhanced_resolution_error_message(resolution_error,)
|
||||
)
|
||||
}
|
||||
ModuleGraphError::ModuleError(_) => format!("{error}"),
|
||||
};
|
||||
|
||||
if let Some(range) = error.maybe_range() {
|
||||
|
@ -125,14 +133,18 @@ pub fn graph_valid(
|
|||
}
|
||||
|
||||
// ignore invalid downgrades and invalid local imports when vendoring
|
||||
if let ModuleGraphError::ResolutionError(err) = &error {
|
||||
if matches!(
|
||||
err,
|
||||
ResolutionError::InvalidDowngrade { .. }
|
||||
| ResolutionError::InvalidLocalImport { .. }
|
||||
) {
|
||||
return None;
|
||||
match &error {
|
||||
ModuleGraphError::ResolutionError(err)
|
||||
| ModuleGraphError::TypesResolutionError(err) => {
|
||||
if matches!(
|
||||
err,
|
||||
ResolutionError::InvalidDowngrade { .. }
|
||||
| ResolutionError::InvalidLocalImport { .. }
|
||||
) {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
ModuleGraphError::ModuleError(_) => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue