summaryrefslogtreecommitdiff
path: root/cli/tools/registry/publish_order.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/registry/publish_order.rs')
-rw-r--r--cli/tools/registry/publish_order.rs21
1 files changed, 13 insertions, 8 deletions
diff --git a/cli/tools/registry/publish_order.rs b/cli/tools/registry/publish_order.rs
index ad0f72272..ad77a56bb 100644
--- a/cli/tools/registry/publish_order.rs
+++ b/cli/tools/registry/publish_order.rs
@@ -5,7 +5,7 @@ use std::collections::HashSet;
use std::collections::VecDeque;
use deno_ast::ModuleSpecifier;
-use deno_config::WorkspaceMemberConfig;
+use deno_config::workspace::JsrPackageConfig;
use deno_core::anyhow::bail;
use deno_core::error::AnyError;
use deno_graph::ModuleGraph;
@@ -114,7 +114,7 @@ impl PublishOrderGraph {
pub fn build_publish_order_graph(
graph: &ModuleGraph,
- roots: &[WorkspaceMemberConfig],
+ roots: &[JsrPackageConfig],
) -> Result<PublishOrderGraph, AnyError> {
let packages = build_pkg_deps(graph, roots)?;
Ok(build_publish_order_graph_from_pkgs_deps(packages))
@@ -122,18 +122,23 @@ pub fn build_publish_order_graph(
fn build_pkg_deps(
graph: &deno_graph::ModuleGraph,
- roots: &[WorkspaceMemberConfig],
+ roots: &[JsrPackageConfig],
) -> Result<HashMap<String, HashSet<String>>, AnyError> {
let mut members = HashMap::with_capacity(roots.len());
let mut seen_modules = HashSet::with_capacity(graph.modules().count());
let roots = roots
.iter()
- .map(|r| (ModuleSpecifier::from_file_path(&r.dir_path).unwrap(), r))
+ .map(|r| {
+ (
+ ModuleSpecifier::from_directory_path(r.config_file.dir_path()).unwrap(),
+ r,
+ )
+ })
.collect::<Vec<_>>();
- for (root_dir_url, root) in &roots {
+ for (root_dir_url, pkg_config) in &roots {
let mut deps = HashSet::new();
let mut pending = VecDeque::new();
- pending.extend(root.config_file.resolve_export_value_urls()?);
+ pending.extend(pkg_config.config_file.resolve_export_value_urls()?);
while let Some(specifier) = pending.pop_front() {
let Some(module) = graph.get(&specifier).and_then(|m| m.js()) else {
continue;
@@ -168,12 +173,12 @@ fn build_pkg_deps(
specifier.as_str().starts_with(dir_url.as_str())
});
if let Some(root) = found_root {
- deps.insert(root.1.package_name.clone());
+ deps.insert(root.1.name.clone());
}
}
}
}
- members.insert(root.package_name.clone(), deps);
+ members.insert(pkg_config.name.clone(), deps);
}
Ok(members)
}