Skip to content

fix: support shorthand git provider URLs - #3068

Merged
gameroman merged 3 commits into
npmx-dev:mainfrom
gameroman:fix-repo-url-parse
Jul 22, 2026
Merged

fix: support shorthand git provider URLs#3068
gameroman merged 3 commits into
npmx-dev:mainfrom
gameroman:fix-repo-url-parse

Conversation

@gameroman

@gameromangameroman commented Jul 22, 2026

Copy link
Copy Markdown
Member

🔗 Linked issue

None

🧭 Context

Previously shorthand git provider URLs were not supported,
which was breaking https://main.npmx.dev/package/smol-toml/v/1.7.0 for example

📚 Description

Adds support for shorthand git provider URLs

Now https://npmx-7wjuoush4-npmx.vercel.app/package/smol-toml/v/1.7.0 works

@vercel

vercelBot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentJul 22, 2026 8:22pm
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewJul 22, 2026 8:22pm
npmx-lunariaIgnoredIgnoredJul 22, 2026 8:22pm

Request Review

@coderabbitai

coderabbitaiBot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 60290550-3284-4fb1-abca-bb3bda22ab89

📥 Commits

Reviewing files that changed from the base of the PR and between 5e5e65b and 5cc5f72.

📒 Files selected for processing (2)
  • shared/utils/git-providers.ts
  • test/unit/shared/utils/git-providers.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • shared/utils/git-providers.ts
  • test/unit/shared/utils/git-providers.spec.ts

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added support for shorthand Git repository addresses, such as github:owner/repo.
    • Shorthand addresses now work across multiple Git providers, including GitHub, Gitea, Tangled and Forgejo.
    • Repository details and source links are correctly generated from shorthand addresses, including .git suffixes and URL fragments.

Walkthrough

normalizeGitUrl expands supported <provider>:owner/repo inputs into canonical HTTPS URLs. Tests cover multiple providers, URL suffixes and fragments, plus shorthand parsing for string and object repository inputs.

Changes

Shorthand repository URL support

Layer / File(s)Summary
Provider shorthand normalisation
shared/utils/git-providers.ts
Adds provider-to-host mappings and expands matching shorthand prefixes before existing Git URL normalisation.
Repository parsing validation
test/unit/shared/utils/git-providers.spec.ts
Tests shorthand URLs across supported providers and verifies parsed provider, owner, repo, rawBaseUrl, and blobBaseUrl values for string and object inputs.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly matches the main change: adding support for shorthand git provider URLs.
Description check✅ PassedThe description is directly related to the changes and explains the shorthand URL support clearly.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@trueberrylesstrueberryless left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall looks go to me, just left a small thought.

Comment threadshared/utils/git-providers.ts

@trueberrylesstrueberryless left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Amazing, thanks for the quick update 🚀

@gameroman
gameroman added this pull request to the merge queueJul 22, 2026
Merged via the queue into npmx-dev:main with commit bde3efcJul 22, 2026
23 checks passed
@gameroman
gameroman deleted the fix-repo-url-parse branch July 22, 2026 20:37
@github-actionsgithub-actionsBot mentioned this pull request Jul 22, 2026
@codecov

codecovBot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing linesPatch %Lines
shared/utils/git-providers.ts90.00%0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

ayo-run pushed a commit to ayo-run/npmx.dev that referenced this pull request Aug 5, 2026
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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.

2 participants

@gameroman@trueberryless