refactor(core): rename resolveUrl to getDesign - #56
Merged
Conversation
resolveUrl implied plain URL parsing; the method actually authenticates, fetches, retries on session expiry, and builds the node/page tree. It's also implementation-agnostic by design (the underlying FigmaNodeSource could be Playwright today, the Figma REST API or a Figma plugin tomorrow), so the name shouldn't name a mechanism (scrape, fetch) either. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Merging main (PR #55) brought in a test added after this branch was cut, still calling the pre-rename resolveUrl. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
PR #55 (security fix) merged to main without a changeset, so its patch bump was never queued. Adding it here alongside this PR's own changeset since this branch already has main merged in. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
resolveUrlonFigmaScraperCorenamed plain URL parsing, but the method authenticates, fetches (with a retry on session expiry), and builds the resulting node/page tree — parsing the URL is just the first step, already handled internally byparseFigmaUrl.scrapeUrlandfetchDesignfirst, but both name a specific transport mechanism (web scraping, HTTP fetch).FigmaScraperCoreis a port precisely so the underlyingFigmaNodeSourcecan swap implementations later (Playwright today, Figma REST API or a Figma plugin bridge tomorrow) without a contract that presupposes one of them.getDesigndescribes the outcome without committing to how it's obtained.Test plan
pnpm --filter @figtools/core test— 50/50 passpnpm --filter @figtools/cli test— 78/78 passpnpm --filter @figtools/core buildandpnpm --filter @figtools/cli build— both compileresolveUrlreferences in the codebase🤖 Generated with Claude Code