Skip to content

feat: add docs field and version helpers#4

Merged
oritwoen merged 2 commits intomainfrom
feat/documentation-and-helpers
Mar 5, 2026
Merged

feat: add docs field and version helpers#4
oritwoen merged 2 commits intomainfrom
feat/documentation-and-helpers

Conversation

@aeitwoen
Copy link
Collaborator

@aeitwoen aeitwoen commented Mar 5, 2026

Closes #3

Adds a documentation field to Package - populated from Cargo, PyPI, and RubyGems (npm and Packagist don't expose one). Also adds selectVersion() for picking the best version and resolveDocsUrl() for the docs URL fallback chain.


Summary by cubic

Adds a first-class Package.documentation field and helpers to pick a usable version and resolve docs URLs across ecosystems. Implements #3 and improves version fallback and RubyGems docs extraction.

  • New Features
    • Added Package.documentation; populated for Cargo, PyPI, and RubyGems (reads documentation_uri); empty for npm/Packagist.
    • Added selectVersion(versions, { requested, latest }) to choose a clean version; fallback picks newest by publishedAt.
    • Added resolveDocsUrl(pkg, urls, version) with fallback chain: documentation → homepage → registry default via URLBuilder.
    • Exported helpers from index and added unit tests.

Written for commit 76b8f6a. Summary will update on new commits.

Surface documentation URLs from all ecosystems as a first-class Package
field. Add selectVersion() for best-version resolution and resolveDocsUrl()
for fallback-chain docs URL lookup — both needed for ecosystem-agnostic
consumers like skilld.
@aeitwoen aeitwoen added this to the v0.2.0 milestone Mar 5, 2026
@aeitwoen aeitwoen added the enhancement New feature or request label Mar 5, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6c265982-4c46-4e21-beef-9092381817f6

📥 Commits

Reviewing files that changed from the base of the PR and between 15e48c9 and 76b8f6a.

📒 Files selected for processing (3)
  • src/helpers.ts
  • src/registries/rubygems.ts
  • test/unit/helpers.test.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (9)
test/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

Tests must use Vitest globals with test/unit for unit tests and test/e2e for integration/smoke tests

Test files must use *.test.ts naming convention

Files:

  • test/unit/helpers.test.ts
test/unit/**/*.test.ts

📄 CodeRabbit inference engine (test/AGENTS.md)

Unit tests must be placed in test/unit/ directory and use mocks/spies rather than real HTTP

Files:

  • test/unit/helpers.test.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Keep TypeScript imports with .ts extension style in ESM-only source files

src/**/*.ts: Use .ts import suffixes consistently throughout the codebase
Do not implement fetch/retry behavior outside src/core/client.ts; all fetch logic must be centralized

Files:

  • src/helpers.ts
  • src/registries/rubygems.ts
src/**/!(purl).ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not parse PURLs outside src/core/purl.ts; call createFromPURL or parsePURL instead

Files:

  • src/helpers.ts
  • src/registries/rubygems.ts
src/**/!(client).ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not duplicate retry and backoff constants outside src/core/client.ts; centralize retry configuration in the Client class

Files:

  • src/helpers.ts
  • src/registries/rubygems.ts
src/helpers.ts

📄 CodeRabbit inference engine (src/AGENTS.md)

Add convenience API to src/helpers.ts and wrap createFromPURL; preserve normalization path

Files:

  • src/helpers.ts
src/registries/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/registries/**/*.ts: Do not bypass Client for direct fetch logic in registries; use the Client class from src/core/client.ts
Registries are plugin-like via registration factories; do not use hardcoded switch logic
Side-effect ecosystem registration is intentional; import registries via side-effect imports like import 'unpux/registries'

Files:

  • src/registries/rubygems.ts
src/{cache,registries}/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not hardcode cache TTL in random modules; use DEFAULT_TTL from src/cache/lockfile.ts

Files:

  • src/registries/rubygems.ts
src/registries/*.ts

📄 CodeRabbit inference engine (src/AGENTS.md)

Implement ecosystem adapters in src/registries/*.ts and register through factory with side-effect import hub

src/registries/*.ts: Each registry adapter must expose ecosystem, fetchPackage, fetchVersions, fetchDependencies, fetchMaintainers, and urls exports
Convert source-specific fields from upstream APIs into core Package, Version, Dependency, and Maintainer shapes
Map remote API failures to core error classes rather than passing through raw upstream errors
Use Client for HTTP requests instead of calling fetch directly
Do not return raw upstream API payloads through public methods; always normalize to core types before exposing
Keep adapter internals self-contained with no cross-adapter imports
Isolate per-registry quirks and API-specific logic to individual adapter files; normalize before returning shared types

Files:

  • src/registries/rubygems.ts
🔇 Additional comments (8)
src/registries/rubygems.ts (1)

22-22: LGTM!

The documentation_uri field is correctly added to the response interface and properly mapped to the Package.documentation field with an empty string fallback. This ensures type safety with the required documentation: string field and allows the truthiness-based fallback chain in resolveDocsUrl to work correctly.

Also applies to: 87-87

src/helpers.ts (3)

1-1: LGTM!

The import correctly adds URLBuilder type needed for the new resolveDocsUrl helper.


70-96: LGTM! Previous review finding addressed.

The fallback logic now correctly sorts usable versions by publishedAt descending (newest first) before selecting, which addresses the earlier concern about potentially returning stale versions.

One minor note: versions with null publishedAt are treated as epoch time (via ?? 0), pushing them to the end of the sorted list. This is reasonable behavior—preferring versions with known publication dates over those without.


98-108: LGTM!

The resolveDocsUrl helper implements a clean fallback chain that properly leverages the new documentation field on Package. The function signature correctly accepts optional version which is passed through to urls.documentation().

test/unit/helpers.test.ts (4)

1-2: LGTM! Previous review finding addressed.

The file correctly imports only types from core and the functions under test. Vitest globals (describe, it, expect) are used without explicit imports, aligning with the globals: true configuration.


4-36: LGTM!

Well-designed test fixtures:

  • version() factory correctly implements the Version interface with sensible defaults
  • pkg() factory provides a complete Package shape with override capability
  • stubUrls mock provides predictable URLs for verifying the fallback chain

38-105: LGTM!

Comprehensive test coverage for selectVersion:

  • Exact requested/latest matching
  • All status types (yanked, deprecated, retracted) correctly skipped
  • Fallback to newest clean version by publishedAt (lines 84-88 and 96-104 verify the sorting)
  • Edge cases: empty list, all unusable, missing requested version

107-137: LGTM!

Good coverage for resolveDocsUrl fallback chain:

  • Documentation field takes precedence (line 108-111)
  • Falls back to homepage when documentation is empty (line 113-116)
  • Falls back to URLBuilder when both are empty (line 118-121)
  • Version parameter is correctly passed through (line 123-126)
  • Confirms documentation takes priority even when homepage exists (line 133-136)

📝 Walkthrough

Walkthrough

Adds a required documentation: string field to the public Package shape, implements two exported helpers (selectVersion, resolveDocsUrl), and updates all registry implementations and unit tests to populate/use the new field and extended version/package metadata.

Changes

Cohort / File(s) Summary
Types & README
README.md, src/core/types.ts
Added documentation: string to the Package interface/public docs.
Helper Utilities
src/helpers.ts
Added selectVersion(versions, options?) (selects best non-yanked/deprecated/retracted version with fallbacks) and resolveDocsUrl(pkg, urls, version?) (fallback chain: package.documentationpackage.homepageurls.documentation(...)). Also imports URLBuilder type.
Public Exports
src/index.ts
Exported selectVersion and resolveDocsUrl from ./helpers.ts.
Registries — Cargo
src/registries/cargo.ts
fetchPackage now sets documentation from upstream and populates additional package metadata (downloads, recentDownloads, categories, newestVersion, defaultVersion, updatedAt, createdAt). fetchVersions now includes crateSize, features, and downloads in version metadata.
Registries — NPM & Packagist
src/registries/npm.ts, src/registries/packagist.ts
fetchPackage now includes documentation: '' (default empty string) in returned Package.
Registries — PyPI
src/registries/pypi.ts
fetchPackage now sets documentation from info.project_urls?.['Documentation'].
Registries — RubyGems
src/registries/rubygems.ts
Added documentation_uri?: string to response typing and map `documentation: data.documentation_uri
Tests
test/unit/helpers.test.ts, test/unit/registries.test.ts
Added comprehensive unit tests for selectVersion and resolveDocsUrl; updated registry tests/fixtures to include documentation and extended metadata/version fields.

Sequence Diagram(s)

sequenceDiagram
  participant Consumer as Consumer
  participant Registry as Registry.fetchPackage
  participant Helpers as Helpers.selectVersion / resolveDocsUrl
  participant URLBuilder as URLBuilder

  Consumer->>Registry: request package + versions
  Registry-->>Consumer: returns Package (includes documentation) + Versions
  Consumer->>Helpers: selectVersion(versions, {requested?, latest?})
  Helpers-->>Consumer: Version | null
  Consumer->>Helpers: resolveDocsUrl(package, URLBuilder, version?)
  Helpers->>URLBuilder: documentation url request (if needed)
  URLBuilder-->>Helpers: documentation URL
  Helpers-->>Consumer: docs URL (package.documentation or homepage or URLBuilder)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐇 I hopped through types and registry lands,
I added docs links with gentle hands.
I pick the right version, skip the bad,
And find the docs so callers stay glad. 📚✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: adding a documentation field and two helper functions (selectVersion and resolveDocsUrl) across registries.
Description check ✅ Passed The description clearly relates to the changeset, explaining the new documentation field, helper functions, and their implementation across registries.
Linked Issues check ✅ Passed The PR fully addresses issue #3 by adding the Package.documentation field, surfacing it from all registries, and providing selectVersion() and resolveDocsUrl() helpers for ecosystem-agnostic version and docs URL resolution.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #3: adding documentation field, surfacing it from registries, and exposing helper functions. No unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/documentation-and-helpers

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 and usage tips.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 11 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/unit/helpers.test.ts">

<violation number="1" location="test/unit/helpers.test.ts:91">
P3: Test description is incorrect: it claims null is returned, but the assertion expects fallback to the latest version.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/registries/rubygems.ts (1)

17-25: ⚠️ Potential issue | 🟠 Major

Add documentation_uri to RubyGemsGemResponse interface and read from the top-level field.

Line 86 reads documentation from data.metadata?.documentation_uri with an unsafe cast, but according to the official RubyGems API, documentation_uri is a top-level field. The current implementation reads from the wrong location and will always produce empty documentation URLs.

Update the interface to include documentation_uri?: string and use type-safe narrowing:

Proposed fix
 interface RubyGemsGemResponse {
   name: string
   version?: string
   description: string
   homepage_uri?: string
+  documentation_uri?: string
   source_code_uri?: string
   licenses?: string[]
   metadata?: Record<string, unknown>
@@
       return {
         name: data.name,
         description: data.description || '',
         homepage: data.homepage_uri || '',
-        documentation: (data.metadata?.documentation_uri as string) || '',
+        documentation: typeof data.documentation_uri === 'string'
+          ? data.documentation_uri
+          : typeof data.metadata?.['documentation_uri'] === 'string'
+            ? data.metadata['documentation_uri']
+            : '',
         repository,
         licenses,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/registries/rubygems.ts` around lines 17 - 25, The RubyGems response
interface is missing documentation_uri and the code currently reads
documentation from data.metadata?.documentation_uri (unsafe cast); update the
RubyGemsGemResponse interface to include documentation_uri?: string and change
the mapping logic that builds the package documentation URL to read from
data.documentation_uri (use type-safe checks, e.g., typeof
data.documentation_uri === "string" or truthiness) instead of data.metadata,
ensuring you remove the unsafe cast and fall back to other top-level fields like
homepage_uri/source_code_uri only if documentation_uri is absent; reference the
RubyGemsGemResponse interface and the code that accesses
data.metadata?.documentation_uri to locate the change.
🧹 Nitpick comments (1)
test/unit/helpers.test.ts (1)

91-95: Rename this test title to match actual behavior.

The case currently states "returns null" but asserts fallback to latest. The assertion looks right; the title is misleading.

Suggested title-only fix
-  it('returns null when requested version does not exist', () => {
+  it('falls back to latest when requested version does not exist', () => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/unit/helpers.test.ts` around lines 91 - 95, The test title is
misleading: update the it() description for the test that calls
selectVersion(versions, { requested: '9.9.9', latest: '2.0.0' }) so it reflects
that the function falls back to the latest version rather than returning null
(e.g., change "returns null when requested version does not exist" to "returns
latest when requested version does not exist"); keep the existing assertion that
expects result?.number toBe '2.0.0' and only change the test description string
in the unit test surrounding selectVersion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/helpers.ts`:
- Around line 70-87: The fallback in selectVersion currently returns the first
Version with status === '' which can be stale; update selectVersion so that when
neither requested nor latest matches it chooses the newest clean version from
the versions array (e.g., filter by v.status === '' then pick the max by
semantic version order), preserving the existing requested/latest checks; refer
to selectVersion, versions, requested, latest and ensure the comparison uses a
proper semver-aware comparison rather than input order.

In `@test/unit/helpers.test.ts`:
- Line 1: Remove the unnecessary direct imports of Vitest globals by deleting
the import statement that lists describe, it, expect (and any occurrences of vi,
beforeEach, afterEach) at the top of the test files and rely on the configured
globals instead; update tests such as the one referencing describe/it/expect in
helpers.test.ts (and the other unit tests mentioned) so they use the global
functions without importing them.

---

Outside diff comments:
In `@src/registries/rubygems.ts`:
- Around line 17-25: The RubyGems response interface is missing
documentation_uri and the code currently reads documentation from
data.metadata?.documentation_uri (unsafe cast); update the RubyGemsGemResponse
interface to include documentation_uri?: string and change the mapping logic
that builds the package documentation URL to read from data.documentation_uri
(use type-safe checks, e.g., typeof data.documentation_uri === "string" or
truthiness) instead of data.metadata, ensuring you remove the unsafe cast and
fall back to other top-level fields like homepage_uri/source_code_uri only if
documentation_uri is absent; reference the RubyGemsGemResponse interface and the
code that accesses data.metadata?.documentation_uri to locate the change.

---

Nitpick comments:
In `@test/unit/helpers.test.ts`:
- Around line 91-95: The test title is misleading: update the it() description
for the test that calls selectVersion(versions, { requested: '9.9.9', latest:
'2.0.0' }) so it reflects that the function falls back to the latest version
rather than returning null (e.g., change "returns null when requested version
does not exist" to "returns latest when requested version does not exist"); keep
the existing assertion that expects result?.number toBe '2.0.0' and only change
the test description string in the unit test surrounding selectVersion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7d4cc3b4-4282-43d7-abc4-5884a7b4c2e9

📥 Commits

Reviewing files that changed from the base of the PR and between ac10dc5 and 15e48c9.

📒 Files selected for processing (11)
  • README.md
  • src/core/types.ts
  • src/helpers.ts
  • src/index.ts
  • src/registries/cargo.ts
  • src/registries/npm.ts
  • src/registries/packagist.ts
  • src/registries/pypi.ts
  • src/registries/rubygems.ts
  • test/unit/helpers.test.ts
  • test/unit/registries.test.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (13)
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Keep TypeScript imports with .ts extension style in ESM-only source files

src/**/*.ts: Use .ts import suffixes consistently throughout the codebase
Do not implement fetch/retry behavior outside src/core/client.ts; all fetch logic must be centralized

Files:

  • src/index.ts
  • src/core/types.ts
  • src/registries/pypi.ts
  • src/registries/rubygems.ts
  • src/helpers.ts
  • src/registries/packagist.ts
  • src/registries/npm.ts
  • src/registries/cargo.ts
src/**/!(purl).ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not parse PURLs outside src/core/purl.ts; call createFromPURL or parsePURL instead

Files:

  • src/index.ts
  • src/core/types.ts
  • src/registries/pypi.ts
  • src/registries/rubygems.ts
  • src/helpers.ts
  • src/registries/packagist.ts
  • src/registries/npm.ts
  • src/registries/cargo.ts
src/**/!(client).ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not duplicate retry and backoff constants outside src/core/client.ts; centralize retry configuration in the Client class

Files:

  • src/index.ts
  • src/core/types.ts
  • src/registries/pypi.ts
  • src/registries/rubygems.ts
  • src/helpers.ts
  • src/registries/packagist.ts
  • src/registries/npm.ts
  • src/registries/cargo.ts
src/index.ts

📄 CodeRabbit inference engine (AGENTS.md)

Public API is export-barrel-driven; avoid hidden side-channel exports and export through src/index.ts

Extend public exports through src/index.ts and keep grouping order stable (Core, Errors, Helpers, Types, Cache)

Files:

  • src/index.ts
src/**/index.ts

📄 CodeRabbit inference engine (src/AGENTS.md)

Keep barrels (src/index.ts, src/core/index.ts, src/cache/index.ts) as canonical export surfaces

Files:

  • src/index.ts
src/core/types.ts

📄 CodeRabbit inference engine (src/AGENTS.md)

Changes to shared models in src/core/types.ts impact all registries and helpers and should be carefully considered

Files:

  • src/core/types.ts
src/core/**/*.ts

📄 CodeRabbit inference engine (src/core/AGENTS.md)

src/core/**/*.ts: Throw typed errors (InvalidPURLError, NotFoundError, RateLimitError) instead of plain Error in core flows
VersionStatus and Scope are closed unions; keep adapter outputs inside allowed values
No duplicate PURL parsing utilities outside purl.ts - use src/core/purl.ts as the single source of truth for PURL validation and normalization

Files:

  • src/core/types.ts
test/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

Tests must use Vitest globals with test/unit for unit tests and test/e2e for integration/smoke tests

Test files must use *.test.ts naming convention

Files:

  • test/unit/helpers.test.ts
  • test/unit/registries.test.ts
test/unit/**/*.test.ts

📄 CodeRabbit inference engine (test/AGENTS.md)

Unit tests must be placed in test/unit/ directory and use mocks/spies rather than real HTTP

Files:

  • test/unit/helpers.test.ts
  • test/unit/registries.test.ts
src/registries/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/registries/**/*.ts: Do not bypass Client for direct fetch logic in registries; use the Client class from src/core/client.ts
Registries are plugin-like via registration factories; do not use hardcoded switch logic
Side-effect ecosystem registration is intentional; import registries via side-effect imports like import 'unpux/registries'

Files:

  • src/registries/pypi.ts
  • src/registries/rubygems.ts
  • src/registries/packagist.ts
  • src/registries/npm.ts
  • src/registries/cargo.ts
src/{cache,registries}/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not hardcode cache TTL in random modules; use DEFAULT_TTL from src/cache/lockfile.ts

Files:

  • src/registries/pypi.ts
  • src/registries/rubygems.ts
  • src/registries/packagist.ts
  • src/registries/npm.ts
  • src/registries/cargo.ts
src/registries/*.ts

📄 CodeRabbit inference engine (src/AGENTS.md)

Implement ecosystem adapters in src/registries/*.ts and register through factory with side-effect import hub

src/registries/*.ts: Each registry adapter must expose ecosystem, fetchPackage, fetchVersions, fetchDependencies, fetchMaintainers, and urls exports
Convert source-specific fields from upstream APIs into core Package, Version, Dependency, and Maintainer shapes
Map remote API failures to core error classes rather than passing through raw upstream errors
Use Client for HTTP requests instead of calling fetch directly
Do not return raw upstream API payloads through public methods; always normalize to core types before exposing
Keep adapter internals self-contained with no cross-adapter imports
Isolate per-registry quirks and API-specific logic to individual adapter files; normalize before returning shared types

Files:

  • src/registries/pypi.ts
  • src/registries/rubygems.ts
  • src/registries/packagist.ts
  • src/registries/npm.ts
  • src/registries/cargo.ts
src/helpers.ts

📄 CodeRabbit inference engine (src/AGENTS.md)

Add convenience API to src/helpers.ts and wrap createFromPURL; preserve normalization path

Files:

  • src/helpers.ts
🔇 Additional comments (10)
src/core/types.ts (1)

8-8: Package model extension is consistent.

Line 8 cleanly extends the normalized package contract with documentation, and it aligns with the helper-level docs fallback behavior.

README.md (1)

218-218: README type snippet stays in sync with the code model.

Line 218 correctly documents the new documentation: string field in Package.

src/registries/packagist.ts (1)

92-92: Adapter contract alignment looks good.

Line 92 ensures the Packagist adapter emits the required documentation field in the normalized Package shape.

src/registries/npm.ts (1)

106-106: NPM package normalization remains consistent.

Line 106 updates the adapter output to satisfy the required Package.documentation contract.

src/registries/pypi.ts (1)

89-89: Good source-to-model mapping for docs URL.

Line 89 correctly exposes PyPI project_urls['Documentation'] through normalized Package.documentation.

src/registries/cargo.ts (1)

133-147: Cargo adapter enrichment looks solid.

The added documentation field and metadata payloads are well-contained and keep the normalized Package/Version contracts intact.

Also applies to: 175-179

src/helpers.ts (1)

97-99: Docs URL fallback chain is clean and practical.

resolveDocsUrl at Lines 97-99 applies the intended precedence without duplicating registry-specific logic.

src/index.ts (1)

25-26: Public helper exports are correctly surfaced through the barrel.

This keeps the API discoverable and consistent with the existing export structure.

test/unit/helpers.test.ts (1)

39-128: Helper test coverage is thorough and well-targeted.

The scenarios around status filtering, fallback order, and docs URL precedence are solid for regression protection.

test/unit/registries.test.ts (1)

182-187: These added assertions correctly lock in the new normalization contract.

Good additions for guarding documentation mapping and cargo metadata extraction at both package and version levels.

Also applies to: 285-288, 354-354

Sort selectVersion fallback by publishedAt newest-first instead of input
order. Read RubyGems documentation_uri from top-level field. Remove
redundant Vitest imports. Fix misleading test description.
@oritwoen oritwoen merged commit ba6325d into main Mar 5, 2026
3 checks passed
@oritwoen oritwoen deleted the feat/documentation-and-helpers branch March 5, 2026 16:31
@aeitwoen aeitwoen changed the title feat(registries): add documentation field and version/docs helpers feat: add docs field and version helpers Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing docs URL and version helpers

2 participants