Skip to content

Extract matchByName() utility and refactor resolve logic#79

Closed
titouanmathis wants to merge 2 commits intofeature/70-resolve-actionfrom
feature/74-extract-matchbyname
Closed

Extract matchByName() utility and refactor resolve logic#79
titouanmathis wants to merge 2 commits intofeature/70-resolve-actionfrom
feature/74-extract-matchbyname

Conversation

@titouanmathis
Copy link
Contributor

Implements #74 — extracts shared name matching into a reusable utility.

Changes

Core

  • New matchByName<T>() utility in packages/core/src/utils/name-matcher.ts
  • Returns { exact: T[], partial: T[] } for flexible consumption
  • Exported from @studiometa/forge-core public API
  • Refactored resolveServers() and resolveSites() executors to use it

CLI

  • Refactored resolveServerId() and resolveSiteId() to use matchByName() from core
  • Same behavior, shared implementation
  • CLI-specific error handling (ValidationError) preserved

Tests

  • New comprehensive tests for matchByName()
  • All existing resolve tests pass unchanged (behavior is identical)

Closes #74

titouanmathis and others added 2 commits February 27, 2026 15:39
Add a resolve action to servers and sites that accepts a name/query
and returns matching resources via partial case-insensitive search.
Exact match returns single result, partial returns all candidates.

Extracted matching logic into forge-core executors so both CLI and
MCP can share the resolution logic.

Closes #70

Co-authored-by: Claude <claude@anthropic.com>
Extract shared case-insensitive name matching into a reusable
matchByName() utility in forge-core. Refactor both core resolve
executors and CLI resolve functions to use it, eliminating
duplicated matching logic.

Closes #74

Co-authored-by: Claude <claude@anthropic.com>
@titouanmathis titouanmathis force-pushed the feature/70-resolve-action branch from 8cbae95 to 9455eab Compare February 27, 2026 16:11
@titouanmathis titouanmathis deleted the branch feature/70-resolve-action February 27, 2026 16:13
@titouanmathis
Copy link
Contributor Author

Retargeted to main after #72 merged. Rebased cleanly.

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