Skip to content

refactor(packages): drop no-op export, dedupe helpers - #1404

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-10530-packages-xs
Oct 12, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-10530-packages-xs

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Drops the no-op connectListProviders export (it returned FIRST_CLASS_PROVIDERS unchanged) and its test; no host re-exports it.
  • buildGoCatalogEntry builds its protocol map from the shared PROTOCOL_BY_ID instead of re-iterating the model array.
  • formatGoUsage formats via named helpers (formatUsagePercent, usageWindowLabel) instead of nested ternaries.
  • Go and Zen identity share one hostMatchesOpencodeDotAi helper (homed in opencode-go, imported by zen) with the same boolean outcome at each site.

Verification

  • Item 1: connectListProviders referenced only by providers.test.ts; not re-exported in index.ts — deleted export and test.
  • Item 2: PROTOCOL_BY_ID derives from the same OPENCODE_GO_MODELS ids/protocols as the replaced loop; Object.fromEntries(PROTOCOL_BY_ID) yields an identical map.
  • Item 3: extracted helpers preserve the exact formatting branches (pct percent / dollars / "ok"; window 5h / week / month).
  • Item 4: isOpenCodeGoURL and isZenURL keep identical host-match outcomes — Go inverts the shared helper.
  • bun test packages/opencode-go/src packages/zen/src packages/first-class-providers/src — 57 pass, 0 fail.
  • bun run typecheck — passes.
  • oxlint and oxfmt --check on changed files — clean.

Fixes CL-10530

@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

CL-10530

@corbits-triage

Copy link
Copy Markdown
Contributor

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios
TheGreatAxios merged commit 47ae11f into main Oct 12, 2026
13 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-10530-packages-xs branch October 12, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant