Repository navigation
Add Maintainers and FundingLinks to core.Package - #110
Merged
andrew merged 1 commit intoOct 19, 2026
Merged
Conversation
andrew
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #34
Problem
enrichmentexposesPackageInfo.MaintainersandPackageInfo.FundingLinks, but only the ecosyste.ms backend fills them in. The direct-registry backend can't, becausecore.Packagehas neither field. Maintainers were only available through a separateFetchMaintainerscall per package. That means N extra requests forBulkFetchPackagescallers. Funding links weren't normalized at all: npm and RubyGems left them in registry-specificMetadata.Change
core.Packagegets two new fields:Both are filled only from data the package endpoint already returns, so
FetchPackagemakes no extra requests.MaintainersFundingLinkssourcemaintainersfunding(string, object or array)ownersmeta.linksentries labelled Sponsor, Funding, Donate, etc.owners.json)funding_uriproject_urlsentries labelled Funding, Sponsor, Donate, etc.Every other registry leaves both fields nil.
Details
internal/core/funding.go:IsFundingLabelmatches labels containing "fund", "sponsor" or "donat", ignoring case.FundingLinksFromLabelsreturns matching URLs sorted and deduplicated, so results don't depend on map iteration order.AppendFundingLinktrims whitespace, skips empty values and drops duplicates.fundingcan be a URL string, an object with aurlor an array of either. Links keep their declared order, since npm treats the first entry as primary.FetchPackageandFetchMaintainersbuildcore.Maintainerthe same way.FetchMaintainersreturns exactly what it did before.Metadata["funding"](npm) andMetadata["funding_uri"](rubygems) entries are kept for compatibility.Packagesection documents the new fields and which registries fill them.Follow-up
Once this is released,
enrichment.RegistriesClient.BulkLookupcan copy both fields straight intoPackageInfo(git-pkgs/enrichment#83). That gives the hybrid client parity with ecosyste.ms for packages routed to direct registries.Tests
internal/core/funding_test.go: label matching, sorting, deduplication, whitespace and empty handling.fundingform (string, object, object withouturl, array with duplicates and empties, null, unexpected type).gofmt -l .is clean.go vet ./...,go test -race ./...andgolangci-lint run ./...pass, as do thejsandwasip1wasm builds and thetinygo-tagged tests.