Skip to content

feat: add a warning when the package license changes#2188

Open
aisiklar wants to merge 7 commits intonpmx-dev:mainfrom
aisiklar:feature/1826_license_changes
Open

feat: add a warning when the package license changes#2188
aisiklar wants to merge 7 commits intonpmx-dev:mainfrom
aisiklar:feature/1826_license_changes

Conversation

@aisiklar
Copy link

🔗 Linked issue

fixes #1826

🧭 Context

added info/warning beneath the license info, "changed!" if there is a change in the license with additional tooltip which shows info about the change, similar to "from x to y at version a.b".
Also modified the Turkish language support too.

📚 Description

as mentioned in the issue, sometimes license changes and it is important to notify the potential user of the package. This pull request is done to make sure that if there is a change in the license the user will be able to see it and also will get info about the details of the change (like from x license to y license and at version a.b.c)

The following changes are done to the codebase:
modified the [name].vue file: added a new props to LicenseDisplay component.
new composable, useLicenseChanges is written.
In the LicenseDisplay component, changes were made to use this composable and add new element for displaying info about the changed license.
Additionally, en.json and tr-TR.json and schema.json files are modified, to add i18n infrastructure and add Turkish language support (for other languages, additional changes are required)

before:
image

after:
image

image

@vercel
Copy link

vercel bot commented Mar 21, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 24, 2026 7:52am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 24, 2026 7:52am
npmx-lunaria Ignored Ignored Mar 24, 2026 7:52am

Request Review

@github-actions
Copy link

github-actions bot commented Mar 21, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
i18n/locales/en.json Source changed, localizations will be marked as outdated.
i18n/locales/tr-TR.json Localization changed, will be marked as complete. 🔄️
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f18c01ec-cf06-47c2-8752-556bb36b322d

📥 Commits

Reviewing files that changed from the base of the PR and between ecbb660 and b91aab5.

📒 Files selected for processing (1)
  • app/components/LicenseDisplay.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/components/LicenseDisplay.vue

📝 Walkthrough

Walkthrough

Adds detection and UI for license changes across package versions. Introduces a new composable useLicenseChanges that fetches npm registry metadata, orders versions by timestamp, and emits a list of license change records (from, to, version). LicenseDisplay.vue gains an optional packageName prop, invokes the composable, builds localized change text, and conditionally renders a warning badge with a tooltip when changes exist. The package detail page passes pkg.name into LicenseDisplay. New i18n keys were added for English and Turkish and i18n/schema.json updated accordingly.

Suggested reviewers

  • danielroe
  • alexdln
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description clearly explains the implementation of license change detection and warning UI, aligning with the changeset that adds composables, components, and i18n updates.
Linked Issues check ✅ Passed The PR successfully implements all core objectives from issue #1826: detecting license changes across versions, surfacing a visible indicator near license metadata, and providing contextual details (old/new license and version).
Out of Scope Changes check ✅ Passed All changes are directly scoped to the license change detection feature: new composable, component enhancements, page template updates, and i18n additions. No extraneous modifications detected.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@aisiklar aisiklar mentioned this pull request Mar 21, 2026
3 tasks
@ghostdevv ghostdevv changed the title 1826-add a warning and info for license changes. Added support for TR language too. feat: add a warning when the package license changes Mar 21, 2026
Copy link
Contributor

@ghostdevv ghostdevv left a comment

Choose a reason for hiding this comment

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

Could you do the style similar to the package size increase warning that we have? #1673 Let me know if you have any questions or need any help!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f7c1c88e-8b86-4447-9fdb-bfbc10c1ff70

📥 Commits

Reviewing files that changed from the base of the PR and between 4294ada and bfd9550.

📒 Files selected for processing (6)
  • app/components/LicenseDisplay.vue
  • app/composables/useLicenseChanges.ts
  • app/pages/package/[[org]]/[name].vue
  • i18n/locales/en.json
  • i18n/locales/tr-TR.json
  • i18n/schema.json

@aisiklar
Copy link
Author

Could you do the style similar to the package size increase warning that we have? #1673 Let me know if you have any questions or need any help!

hi @ghostdevv
thanks for your comment. I will check the link you mentioned and also the comments made by coderabbitai and change accordingly. I will return you in case i have additional questions. Thanks.

@ghostdevv
Copy link
Contributor

Awesome! I'll mark this as draft for now, and you can mark it as ready when you want me to take another look!

@ghostdevv ghostdevv marked this pull request as draft March 23, 2026 04:31
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

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

Files with missing lines Patch % Lines
app/composables/useLicenseChanges.ts 34.78% 13 Missing and 2 partials ⚠️
app/components/LicenseDisplay.vue 54.54% 5 Missing ⚠️
app/pages/package/[[org]]/[name].vue 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@aisiklar
Copy link
Author

aisiklar commented Mar 24, 2026

Hi @ghostdevv
Can you please check again?
I made the style change and also fixed the other issues pointed by bot.
I did NOT rebase on the current state of main, if you want, i can do it and make a new commit. This is my first PR so please advice if I am missing some other things.
Thanks

@aisiklar aisiklar marked this pull request as ready for review March 24, 2026 07:13
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 274b5e5e-8053-43ca-946d-f111b04b96f3

📥 Commits

Reviewing files that changed from the base of the PR and between bfd9550 and ecbb660.

📒 Files selected for processing (5)
  • app/components/LicenseDisplay.vue
  • app/composables/useLicenseChanges.ts
  • i18n/locales/en.json
  • i18n/locales/tr-TR.json
  • i18n/schema.json
✅ Files skipped from review due to trivial changes (2)
  • i18n/locales/en.json
  • i18n/schema.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • i18n/locales/tr-TR.json
  • app/composables/useLicenseChanges.ts

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.

highlight license changes

2 participants