Skip to content

fix: set org to empty string to make sure its route param is omitted - #1126

Merged
danielroe merged 2 commits into
npmx-dev:mainfrom
KazariEX:fix/issue-1121
Feb 7, 2026
Merged

fix: set org to empty string to make sure its route param is omitted#1126
danielroe merged 2 commits into
npmx-dev:mainfrom
KazariEX:fix/issue-1121

Conversation

@KazariEX

Copy link
Copy Markdown
Contributor

@vercel

vercelBot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentFeb 7, 2026 5:40am
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewFeb 7, 2026 5:40am
npmx-lunariaIgnoredIgnoredFeb 7, 2026 5:40am

Request Review

@coderabbitai

coderabbitaiBot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

An explicit import type { RouteLocationRaw } was added and packageRoute now returns RouteLocationRaw. Unscoped package handling was changed so the tuple default is ['', packageName] and the org param defaults to '' in that branch. Scoped package handling keeps its split logic with the name default set to '' in destructuring. Route name literals no longer use as const and are plain strings ('package-version' and 'package').

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check nameStatusExplanation
Description check✅ PassedThe PR description 'fix #1121' is minimal but directly references the linked issue #1121, relating to fixing package links without scope on org pages.
Linked Issues check✅ PassedThe code changes set org to empty string for unscoped packages, ensuring the org route parameter is omitted and package links resolve to /package/[name] instead of /package/[org]/[name], directly addressing issue #1121.
Out of Scope Changes check✅ PassedAll changes in app/utils/router.ts are scoped to fixing the packageRoute function to handle unscoped packages correctly, which is directly required by issue #1121.

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

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/utils/router.ts (1)

8-24: ⚠️ Potential issue | 🔴 Critical

Remove empty org parameter to avoid Vue Router warnings.

Vue Router does not omit empty string params—it treats them as invalid and produces warnings like "missing param… but received ''". The current code passes org: '' for non-scoped packages, which will cause this error. Conditionally omit org from params when it is empty:

Suggested fix
 if (version) {
return {
name: 'package-version',
params: {
- org,+ ...(org ? { org } : {}),
name,
version,
},
}
}
return {
name: 'package',
params: {
- org,+ ...(org ? { org } : {}),
name,
},
}

Comment threadapp/utils/router.ts Outdated
@codecov

codecovBot commented Feb 7, 2026

Copy link
Copy Markdown

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!

@danielroe
danielroe added this pull request to the merge queueFeb 7, 2026
Merged via the queue into npmx-dev:main with commit 29d1ac0Feb 7, 2026
17 checks passed
Sign up for freeto 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.

bug: links to packages without scope on org pages are broken

2 participants

@KazariEX@danielroe