Skip to content

feat: add support for package.json5 and package.yaml formats #234

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

outslept
Copy link
Contributor

closes #227 :)

Copy link

codecov bot commented Jun 30, 2025

Codecov Report

Attention: Patch coverage is 90.74074% with 5 lines in your changes missing coverage. Please review.

Project coverage is 91.08%. Comparing base (afdf7cb) to head (2ceb232).
Report is 81 commits behind head on main.

Files with missing lines Patch % Lines
src/packagejson/utils.ts 90.74% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #234      +/-   ##
==========================================
+ Coverage   89.40%   91.08%   +1.68%     
==========================================
  Files           5       10       +5     
  Lines         434      314     -120     
  Branches       37       72      +35     
==========================================
- Hits          388      286     -102     
+ Misses         46       28      -18     

☔ 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.

@danielroe danielroe requested a review from pi0 June 30, 2025 20:19
@pi0
Copy link
Member

pi0 commented Jun 30, 2025

Thanks for PR!

It would be nice if we could merge them also into one simple util like findPackage(), readPackage(), .. this way users can simply use one standard util to support all possible formats (bun for instance allows jsonc for package.json)

@outslept
Copy link
Contributor Author

outslept commented Jul 1, 2025

If I understand correctly, merging the existing functions (readPackageJSON, writePackageJSON, resolvePackageJSON + the new JSON5/YAML variants) into unified ones would be a breaking change. What concerns me is that we'd either need to maintain both APIs or break existing users who rely on format-specific functions. The unified approach is so clean but requires a major version bump (?). What's do you think?

@pi0
Copy link
Member

pi0 commented Jul 1, 2025

thats why i suggested to use new readPackage (vs current readPackageJSON) — also for new formats we could merge them directly to it to reduce confusion with many exported utils.

@outslept
Copy link
Contributor Author

outslept commented Jul 1, 2025

I misunderstood you at first, feel free to review now

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.

support package.json5 + package.yaml for pnpm
2 participants