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

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions