From a379009bfdddc56d6400740ad7be86f8930952ab Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Wed, 29 May 2024 17:45:22 -0700 Subject: fix(cli): Prefer npm bin entries provided by packages closer to the root (#24024) Fixes #24012. In the case of multiple packages providing a binary with a same name, we were basically leaving the results undefined (since we set up things in parallel, and whichever got set up first won). In addition, we were warning about these cases, even though it's a situation that's expected to occur. Instead, in the case of a collision in the binary names, we prefer the binary provided by the package with the least depth in the dependency tree. While I was at it, I also took moved more code to `bin_entries.rs` since it was starting to get a bit cluttered. --- tests/registry/npm/@denotest/bin/0.7.0/cli.mjs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/registry/npm/@denotest/bin/0.7.0/cli.mjs (limited to 'tests/registry/npm/@denotest/bin/0.7.0/cli.mjs') diff --git a/tests/registry/npm/@denotest/bin/0.7.0/cli.mjs b/tests/registry/npm/@denotest/bin/0.7.0/cli.mjs new file mode 100644 index 000000000..1cad127ca --- /dev/null +++ b/tests/registry/npm/@denotest/bin/0.7.0/cli.mjs @@ -0,0 +1,3 @@ +#!/usr/bin/env -S node + +console.log("@denotest/bin 0.7.0"); -- cgit v1.2.3