Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support package.json bin objects #2040

Merged
merged 2 commits into from
Mar 27, 2025
Merged

Conversation

JoshuaKGoldberg
Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg commented Mar 27, 2025

PR Checklist

Overview

Updates the PartialPackageData type to note that bin could be a Record<string, string>, not just a string. blockPackageJson will collect its values if it is an object.

Also updates other references to options.bin to use a new getPrimaryBin function for determining what the main runner is. Per https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin using the same name as the repo is equivalent to using a string.

🎁

Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.81%. Comparing base (66f38d8) to head (fc2e6a2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2040   +/-   ##
=======================================
  Coverage   99.81%   99.81%           
=======================================
  Files         117      118    +1     
  Lines        4893     4910   +17     
  Branches      299      303    +4     
=======================================
+ Hits         4884     4901   +17     
  Misses          9        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JoshuaKGoldberg JoshuaKGoldberg merged commit 2396960 into main Mar 27, 2025
13 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the package-json-bin-object branch March 27, 2025 14:12
Copy link

🎉 This is included in version v2.15.3 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug: "options.bin?.replace is not a function" when package.json bin is an object
1 participant