Skip to content

fix: normalise package licence field#944

Merged
danielroe merged 3 commits intonpmx-dev:mainfrom
wojtekmaj:object-object
Feb 5, 2026
Merged

fix: normalise package licence field#944
danielroe merged 3 commits intonpmx-dev:mainfrom
wojtekmaj:object-object

Conversation

@wojtekmaj
Copy link
Contributor

Copilot AI review requested due to automatic review settings February 4, 2026 14:29
@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 5, 2026 0:32am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 5, 2026 0:32am
npmx-lunaria Ignored Ignored Feb 5, 2026 0:32am

Request Review

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good spot!

@danielroe danielroe changed the title Fix "object Object" shown in Licence field and on OG image fix: normalise package licence field Feb 4, 2026
@danielroe danielroe enabled auto-merge February 4, 2026 14:30
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Normalises package license values and adjusts packument typing. app/composables/npm/usePackage.ts and app/composables/usePackageComparison.ts now extract license.type when license is an object, otherwise preserve the original value. shared/types/npm-registry.ts stops re-exporting Packument from @npm/types, defines a local Packument with a corrected license?: string | { type: string; url?: string }, and re-exports other types. No function signatures were changed.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description uses images showing the before/after state of a package page, demonstrating that the license field now displays 'MIT' instead of 'object Object', directly illustrating the fix being implemented.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/composables/npm/usePackage.ts 0.00% 2 Missing and 1 partial ⚠️
app/composables/usePackageComparison.ts 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

auto-merge was automatically disabled February 4, 2026 14:32

Head branch was pushed to by a user without write access

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes the display of "[object Object]" in the License field and OG image by normalizing the license field when it's an object with a type property.

Changes:

  • Added license field normalization in the transformPackument function to extract the type property when the license is an object

@danielroe danielroe enabled auto-merge February 5, 2026 00:34
@danielroe danielroe added this pull request to the merge queue Feb 5, 2026
Merged via the queue into npmx-dev:main with commit 77f8f81 Feb 5, 2026
15 of 16 checks passed
@wojtekmaj wojtekmaj deleted the object-object branch February 5, 2026 06:47
@wojtekmaj
Copy link
Contributor Author

See also: npm/types#27

@wojtekmaj
Copy link
Contributor Author

Upstream fix: npm/types#185

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.

3 participants