Skip to content

refactor: share encodePackageName utility function#1066

Open
bluwy wants to merge 1 commit intonpmx-dev:mainfrom
bluwy:share-encodePackageName
Open

refactor: share encodePackageName utility function#1066
bluwy wants to merge 1 commit intonpmx-dev:mainfrom
bluwy:share-encodePackageName

Conversation

@bluwy
Copy link
Contributor

@bluwy bluwy commented Feb 6, 2026

Use the encodePackageName utility in #shared/utils/npm everywhere instead of duplicating them. I think it's safe (?) since #shared/utils/* can work anywhere.

PS I used explicit imports as I prefer them 😄 The codebase currently has a mix of explicit and auto/hidden imports and I'm not sure which is preferred.

@vercel
Copy link

vercel bot commented Feb 6, 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 6, 2026 3:03am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 6, 2026 3:03am
npmx-lunaria Ignored Ignored Feb 6, 2026 3:03am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

The pull request consolidates package name encoding logic across multiple files by introducing and using a centralised encodePackageName utility function. Previously, package name encoding was performed manually or defined locally in multiple locations. This change imports the shared utility and replaces all local encoding implementations with calls to encodePackageName when constructing NPM registry URLs. No public API signatures are modified; only internal encoding usage is refactored.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description accurately describes the changeset: consolidating duplicated encodePackageName implementations into a shared utility across multiple files.

✏️ 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 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

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.

1 participant