Skip to content

Commit

Permalink
Fix panic in deno_package_json invalid exports
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Oct 5, 2024
1 parent 3593ec7 commit 20723f3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ deno_path_util = "0.2.0"
[dev-dependencies]
tempfile = "3.4.0"
pretty_assertions = "1.4.0"

[patch.crates-io]
deno_package_json = { git = "https://github.com/littledivy/deno_package_json", branch = "exports_main_error" }
7 changes: 4 additions & 3 deletions src/workspace/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use anyhow::Error as AnyError;
use deno_package_json::PackageJsonDepValue;
use deno_package_json::PackageJsonDepValueParseError;
use deno_package_json::PackageJsonDeps;
use deno_package_json::PackageJsonLoadError;
use deno_package_json::PackageJsonRc;
use deno_path_util::url_from_directory_path;
use deno_path_util::url_to_file_path;
Expand Down Expand Up @@ -462,10 +463,10 @@ impl WorkspaceResolver {
url_to_file_path(&root_dir_url.join(&relative_path).unwrap())
.unwrap();
let pkg_json =
deno_package_json::PackageJson::load_from_value(path, json);
PackageJsonRc::new(pkg_json)
deno_package_json::PackageJson::load_from_value(path, json)?;
Ok::<_, PackageJsonLoadError>(PackageJsonRc::new(pkg_json))
})
.collect();
.collect::<Result<_, _>>()?;
let jsr_packages = serializable_workspace_resolver
.jsr_pkgs
.into_iter()
Expand Down

0 comments on commit 20723f3

Please sign in to comment.