Skip to content

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 4, 2026 2:37pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 4, 2026 2:37pm
npmx-lunaria Ignored Ignored Feb 4, 2026 2:37pm

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

The change normalises package license data and adjusts packument typing. In app/composables/npm/usePackage.ts and app/composables/usePackageComparison.ts license values that are objects with a type property are replaced by that string when constructing package metadata. In shared/types/npm-registry.ts the module stops re-exporting Packument from @npm/types and defines a local Packument type that omits the original license and replaces it with a corrected union allowing string or { type: string; url?: string }. No function signatures were changed.

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description effectively demonstrates the fix through before/after screenshots showing license field normalization from 'object Object' to 'MIT'.

✏️ 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

*/

import type { PackumentVersion } from '@npm/types'
import type { Packument as PackumentWithLicenceBug, PackumentVersion } from '@npm/types'
Copy link
Collaborator

@43081j 43081j Feb 4, 2026

Choose a reason for hiding this comment

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

Suggested change
import type { Packument as PackumentWithLicenceBug, PackumentVersion } from '@npm/types'
import type { Packument as BasePackument, PackumentVersion } from '@npm/types'

it feels less workaround-ish then. i know it is a workaround but its going to be here a long time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That stops it from being self documenting. :(

Copy link
Collaborator

Choose a reason for hiding this comment

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

pinged you on discord but imo we should achieve this via a comment on the type rather than making people infer it from the symbol name

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