-
-
Notifications
You must be signed in to change notification settings - Fork 194
fix: normalise package licence field #944
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
danielroe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good spot!
📝 WalkthroughWalkthroughThe 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 Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Head branch was pushed to by a user without write access
f27000f to
d5bfb5b
Compare
There was a problem hiding this 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
transformPackumentfunction to extract thetypeproperty when the license is an object
d5bfb5b to
442e7ca
Compare
| */ | ||
|
|
||
| import type { PackumentVersion } from '@npm/types' | ||
| import type { Packument as PackumentWithLicenceBug, PackumentVersion } from '@npm/types' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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
There was a problem hiding this comment.
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. :(
There was a problem hiding this comment.
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
Before:
https://npmx.dev/package/g
After: