Skip to content

fix: normalise package licence field - #944

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

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

Conversation

@wojtekmaj

Copy link
Copy Markdown
Contributor

CopilotAI review requested due to automatic review settings February 4, 2026 14:29
@vercel

vercelBot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentFeb 5, 2026 0:32am
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewFeb 5, 2026 0:32am
npmx-lunariaIgnoredIgnoredFeb 5, 2026 0:32am

Request Review

@danielroedanielroe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good spot!

@danielroedanielroe changed the title Fix "object Object" shown in Licence field and on OG imagefix: normalise package licence fieldFeb 4, 2026
@coderabbitai

coderabbitaiBot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor
📝 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 nameStatusExplanation
Description check✅ PassedThe 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

codecovBot commented Feb 4, 2026

Copy link
Copy Markdown

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 linesPatch %Lines
app/composables/npm/usePackage.ts0.00%2 Missing and 1 partial ⚠️
app/composables/usePackageComparison.ts66.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

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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

Comment threadapp/composables/npm/usePackage.ts
Comment threadapp/composables/npm/usePackage.ts
Comment threadshared/types/npm-registry.ts Outdated
@danielroe
danielroe added this pull request to the merge queueFeb 5, 2026
Merged via the queue into npmx-dev:main with commit 77f8f81Feb 5, 2026
15 of 16 checks passed
@wojtekmaj
wojtekmaj deleted the object-object branch February 5, 2026 06:47
@wojtekmaj

Copy link
Copy Markdown
ContributorAuthor

See also: npm/types#27

@wojtekmaj

Copy link
Copy Markdown
ContributorAuthor

Upstream fix: npm/types#185

Sign up for freeto 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.

4 participants

@wojtekmaj@43081j@danielroe