Follow-up from #35938 review.
Native deno check runs sync_types_command as an internal step and wraps it
in log::set_max_level(LevelFilter::Error) to keep its progress/summary output
from preceding the type-check diagnostics:
let prev_level = log::max_level();
log::set_max_level(log::LevelFilter::Error);
let sync_result = sync_types_command(..., RootTsConfigMode::CheckMode).await;
log::set_max_level(prev_level);
sync_result?;
Mutating the global log level is a bad pattern (process-global, not scoped to
this call). It's also load-bearing in a subtle way: sync_types_command builds
its own module graph, so for an unresolvable/404 module it re-attempts the fetch
and emits a duplicate Download line; the clobber is currently what hides
that from deno check output (removing it breaks module_not_found,
missing_remote_root, import_non_existent_in_remote, etc.).
Proper fix, either:
- thread a "quiet" flag through
sync_types_command so it suppresses its own
progress at the source instead of via the global logger, or
- have
native_check hand its already-built graph to sync_types_command so it
doesn't rebuild/re-fetch at all (removes the duplicate-Download problem and
the need to suppress anything).
Internal cleanup; we'll do it ourselves.
Follow-up from #35938 review.
Native
deno checkrunssync_types_commandas an internal step and wraps itin
log::set_max_level(LevelFilter::Error)to keep its progress/summary outputfrom preceding the type-check diagnostics:
Mutating the global log level is a bad pattern (process-global, not scoped to
this call). It's also load-bearing in a subtle way:
sync_types_commandbuildsits own module graph, so for an unresolvable/404 module it re-attempts the fetch
and emits a duplicate
Downloadline; the clobber is currently what hidesthat from
deno checkoutput (removing it breaksmodule_not_found,missing_remote_root,import_non_existent_in_remote, etc.).Proper fix, either:
sync_types_commandso it suppresses its ownprogress at the source instead of via the global logger, or
native_checkhand its already-built graph tosync_types_commandso itdoesn't rebuild/re-fetch at all (removes the duplicate-
Downloadproblem andthe need to suppress anything).
Internal cleanup; we'll do it ourselves.