Skip to content

Broken GitHub source links for monorepo packages when repository.url includes .git #2233

@cochinescu

Description

@cochinescu

Describe the bug

npmx is generating a broken GitHub source link for @agentmarkup/vite.

On the package page, the source link goes to:

https://github.com/agentmarkup/agentmarkup.git/tree/HEAD/packages/vite

That URL returns 404.

The correct GitHub URL is:

https://github.com/agentmarkup/agentmarkup/tree/HEAD/packages/vite

It looks like npmx is using npm registry repository.url + repository.directory, but not normalizing the repo URL before building the GitHub web link.

Additional context

Repro:

The same problem appears to affect:

  • @agentmarkup/core
  • @agentmarkup/astro

Important detail:

  • the repo manifest is already https://github.com/agentmarkup/agentmarkup
  • the published npm tarballs also contain the clean URL
  • npm registry metadata exposes git+https://github.com/agentmarkup/agentmarkup.git

So the bug seems to be in link construction from registry metadata, not in the package itself.

Logs

curl -sSI https://github.com/agentmarkup/agentmarkup.git/tree/HEAD/packages/vite
# HTTP/2 404

curl -sSI https://github.com/agentmarkup/agentmarkup/tree/HEAD/packages/vite
# HTTP/2 200

Metadata

Metadata

Assignees

No one assigned

    Labels

    backServer, Data

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions