Skip to content

Conversation

@mikouaji
Copy link
Contributor

@mikouaji mikouaji commented Feb 1, 2026

This PR introduces new canonical routes for:

  • package page ( /{name} -> /package/{name} )
  • package code preview page ( /code/{name} -> /package-code/{name} )
  • package generated docs page ( /docs/{name} -> /package-docs/{name} )

Route names were not changed so most of the existing links didn't require an update.

Following the discussion we had a couple days ago in discord we agreed that from now on we will follow these rules:

npmx.dev/package/{name}
npmx.dev/package-docs/{name}
npmx.dev/package-code/{name}
npmx.dev/package-?/{name}
npmx.dev/sponsor/{name}
npmx.dev/collective/{name}
npmx.dev/event/{name}
npmx.dev/conference/{name}
npmx.dev/tool/{name} <-- e18e like experiences that doesn't fit in the UI
npmx.dev/stats/{name} <-- global stats for the ecosystem
npmx.dev/licence/{name} <-- license info
npmx.dev/report/{name}

Keep in mind some of the pages are not added yet.

Old redirect logic was updated so that existing URLs will point to the new pages on client side.

Solves #392 and other routing related issues like searching for search etc.

@vercel
Copy link

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

Request Review

@mikouaji mikouaji changed the title New routing schema feat: new routing schema Feb 1, 2026
Copy link
Contributor

@garthdw garthdw left a comment

Choose a reason for hiding this comment

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

Just a couple potential issues. Otherwise looks good


// /package/code/* → /code/*
// /package/code/* → /package-code/*
if (path.startsWith('/package/code/')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! will update

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

if (path.startsWith('/package/')) {
return navigateTo(path.replace('/package/', '/'), { replace: true })
// /package/docs/* → /package-docs/*
if (path.startsWith('/package/docs/')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this not break https://www.npmjs.com/package/doc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/package/doc is working fine but /package/docs it not, will fix it, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@garthdw
Copy link
Contributor

garthdw commented Feb 1, 2026

Did we decide on anything for orgs/scopes? https://npmx-bc2otz4gu-poetry.vercel.app/@nuxt and users https://npmx-bc2otz4gu-poetry.vercel.app/~atinux

@mikouaji
Copy link
Contributor Author

mikouaji commented Feb 1, 2026

Did we decide on anything for orgs/scopes? https://npmx-bc2otz4gu-poetry.vercel.app/@nuxt and users https://npmx-bc2otz4gu-poetry.vercel.app/~atinux

Nothing for those were discussed as part of this change, this is purely for packages, docs and code pages.
There was a conversation about having a /profile/{username} page for atmosphere accounts today, but I don't know what finally came from it.

@danielroe danielroe added this pull request to the merge queue Feb 2, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 2, 2026
@danielroe danielroe added this pull request to the merge queue Feb 2, 2026
Merged via the queue into npmx-dev:main with commit 4bf7317 Feb 2, 2026
13 checks passed
@mikouaji mikouaji deleted the feat/new-routing-schema branch February 2, 2026 06:12
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.

4 participants