Skip to content

refactor: read git provider data through forges - #3332

Draft
serhalp wants to merge 7 commits into
mainfrom
serhalp/refactor/forges
Draft

serhalp wants to merge 7 commits into
mainfrom
serhalp/refactor/forges

Conversation

@serhalp

@serhalp serhalp commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

N/A

🧭 Context

npmx hand-writes a lot of per-provider git host glue code: repo metadata, changelog releases, markdown link resolution, repo links, etc. Each has its own switch-case with specific logic for each of GitHub, GitLab, Bitbucket, Codeberg, Gitea, Forgejo, Gitee, Tangled, and Pushin. That is a lot of surface to keep correct, and it duplicates what the forges package has just been built to solve!

📚 Description

  • Repo metadata: GitLab, Bitbucket, Codeberg, Gitee, Gitea, Forgejo, Pushin and Tangled read through forges. GitHub stays on ungh (TBD whether/how to solve for that).
  • Changelog: release list, release-by-tag and detection use forges for every provider it covers.
  • Markdown: per-provider URL builders become one createRepoInfo() built from forges.
  • Repo links (issues, stars, forks, watchers, etc.) come from urlFor({ repo, section }).
  • GitHub-only endpoints (issues count, repo-stats, contributors, and contributors-evolution): now read through forges.
  • Readme images: now use parseUrl() + urlFor({ raw }).
  • Entirely removes the now unused tangled-stats endpoint.

Net ~900 lines removed 🎉

What's left

  • Sourcehut and Radicle stay bespoke for now, as forges does not yet support them.
  • Some GitHub operations are proxied through the ungh.cc caching proxy. There may be a way to make this go through forges eventually, but punting on that for now.
  • Forge host origins, for generating CSPs and such (TBD)
  • Forge logos (makes sense to keep here)
  • Forge display names, localized (makes sense to keep here)

@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
npmx.dev Ready Ready Preview Oct 21, 2026 12:38am UTC
2 Skipped Deployments
Project Deployment Actions Updated
docs.npmx.dev Ignored Ignored Preview Oct 21, 2026 12:38am UTC
npmx-lunaria Ignored Ignored Oct 21, 2026 12:38am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

📊 Dependency Size Changes

Warning

This PR adds 1.9 MB of new dependencies, which exceeds the threshold of 200 kB.

📦 Package 📏 Size
forges@0.2.0 1.9 MB
vue-component-type-helpers@3.3.13 5.6 kB

Total size change: 1.9 MB

What's left that's still in this codebase:
- Radicle (not yet in `forges`)
- Sourcehut (not yet in `forges`)
- uses of `ungh.cc` instead of regular GitHub API (TBD)
- forge host origins, for generating CSPs and such (TBD)
- forge logos (makes sense to keep here)
- forge display names, localized (makes sense to keep here)
@serhalp
serhalp force-pushed the serhalp/refactor/forges branch from 1af0b7d to 7f3168a Compare October 21, 2026 00:36
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedforges@​0.2.0811009391100

View full report

This branch was successfully deployed

2 active (1 outdated) deployments
Preview – npmx.dev — 7f3168ac Deployed Oct 21, 2026 by vercel[bot]
Preview – docs.npmx.dev — 1af0b7d6 Deployed Oct 20, 2026 by vercel[bot]
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.

1 participant