fix: correctly parse package name for scoped packages#2135
fix: correctly parse package name for scoped packages#2135gameroman wants to merge 2 commits intonpmx-dev:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
📝 WalkthroughWalkthroughThis pull request adds URI decoding to two API route handlers for package registry endpoints (analysis and install-size) by applying Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
server/api/registry/analysis/[...pkg].get.ts (1)
38-46: Consider extracting route package-param parsing into a shared helper.This block is now duplicated across endpoints; centralising it would lower future drift risk when parsing/decoding rules change.
test/unit/server/utils/parse-package-params.spec.ts (1)
4-53: Useful parser coverage; add one regression test for encoded route input.These tests validate segment parsing well, but the bug fix is in handler decoding. Please add a handler-level test with
%40scope%2Fnameso the original regression is fully guarded.As per coding guidelines
**/*.{test,spec}.{ts,tsx}: Write unit tests for core functionality using vitest.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a276c004-28ce-491f-b50c-2f60a4d5f279
📒 Files selected for processing (3)
server/api/registry/analysis/[...pkg].get.tsserver/api/registry/install-size/[...pkg].get.tstest/unit/server/utils/parse-package-params.spec.ts
|
@gameroman, could you provide a more detailed description of what this PR aims to fix? The issue you mentioned links to a ticket on your fork, and there are only two links. It's a bit cryptic, even for future reference, and it would be better documented/tracked in this repository. |
Updated |
|
Here is what it's like for me
Before: https://main.npmx.dev/compare?packages=@angular/core,vue After: https://npmx-qljid94b8-npmx.vercel.app/compare?packages=@angular/core,vue |


🔗 Linked issue
Fixes #2141
📚 Description
Fixes fetching data on compare page with scoped packages
Before
After