refactor: load bytes in deno_graph (#22212)

Upgrades deno_graph to 0.64 where deno_graph is now responsible for
turning bytes into a string. This is in preparation for Wasm modules.
This commit is contained in:
David Sherret 2024-01-31 22:15:22 -05:00 committed by GitHub
parent 830d096b66
commit 4b7c6049ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 325 additions and 637 deletions

View file

@ -169,8 +169,8 @@ pub fn graph_valid(
pub fn graph_lock_or_exit(graph: &ModuleGraph, lockfile: &mut Lockfile) {
for module in graph.modules() {
let source = match module {
Module::Esm(module) if module.media_type.is_declaration() => continue, // skip declaration files
Module::Esm(module) => &module.source,
Module::Js(module) if module.media_type.is_declaration() => continue, // skip declaration files
Module::Js(module) => &module.source,
Module::Json(module) => &module.source,
Module::Node(_) | Module::Npm(_) | Module::External(_) => continue,
};
@ -558,7 +558,7 @@ pub fn error_for_any_npm_specifier(
Module::Node(module) => {
bail!("Node specifiers have not yet been implemented for this subcommand (https://github.com/denoland/deno/issues/15960). Found: node:{}", module.module_name)
}
Module::Esm(_) | Module::Json(_) | Module::External(_) => {}
Module::Js(_) | Module::Json(_) | Module::External(_) => {}
}
}
Ok(())