Skip to content

Conversation

@huntercaron
Copy link
Collaborator

@huntercaron huntercaron commented Dec 17, 2025

Description

Adds a Code Link Plugin and framer-code-link CLI tool for a 2-way link between code files in framer and local filesystem.

Stack@2x

Todo

  • Prep Icon and Assets
  • Ship backgroundMessage API to stable

Testing

  • Verify the initial handshake and setup
    • Open the Plugin in a Project with Code Files
    • Copy the command
    • Paste & run in your terminal
    • Verify a directory is created with the name of your project
    • Verify within the directory/files is a 1:1 with the project code files
  • Verify Code syncing
    • Run the CLI and Plugin
    • Make changes to the files locally
    • Verify the changes are applied in Framer
    • Make changes to the files in Framer
    • Verify the changes are applied Locally
  • Verify conflict resolution (auto)
    • Close the Plugin
    • Make changes to a file in Framer
    • Re-open the Plugin
    • Verify the changes auto-apply to local files
    • Close the Plugin
    • Make changes to a file Locally
    • Re-open the Plugin
    • Verify the changes auto-apply to Framer files
  • Verify conflict resolution (manual)
    • Close the Plugin
    • Make different changes to the same file both in Framer and locally
    • Re-open the Plugin
    • Verify you are prompted to resolve conflicts
    • Click "Keep Framer"
    • Verify the changes from Framer synced to local files
    • Repeat, but select "Keep Local"
    • Verify the local changes synced into Framer
  • Verify running CLI development locally
    • Open the Plugin
    • In terminal go to packages/code-link-cli
    • Run 'yarn dev'
    • Verify a connection is made and files are synced as normal

@huntercaron huntercaron marked this pull request as ready for review December 18, 2025 14:05
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Comment @cursor review or bugbot run to trigger another review on this PR


let name = sanitizedVariableName(inputName) ?? "MyComponent"
if (
(!hasValidExtension(extension) || extension === tsxExtension) &&
Copy link

Choose a reason for hiding this comment

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

Bug: Extension comparison always fails due to dot mismatch

The comparison extension === tsxExtension will always be false. The splitExtension function returns the extension without the leading dot (e.g., "tsx"), but tsxExtension is defined as ".tsx" with a dot. This means "tsx" === ".tsx" is never true. Additionally, hasValidExtension(extension) is called with just the extension string rather than a full filename, causing it to always return false since its regex expects a dot before the extension. These two bugs compound but accidentally produce correct behavior for the CLI because it always passes capitalizeReactComponent=false. However, if the shared library is used with the default parameter, all file types would be capitalized instead of just .tsx files.

Additional Locations (1)

Fix in Cursor Fix in Web

debug(` Local unchanged, remote changed -> REMOTE`)
autoResolvedRemote.push(conflict)
} else if (remoteUnchanged && localClean) {
debug(` Both unchanged, skipping`)
Copy link

Choose a reason for hiding this comment

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

Bug: Conflicts silently dropped when both sides appear unchanged

When autoResolveConflicts encounters a conflict where both remoteUnchanged and localClean are true, the conflict is logged as "skipping" but not added to any of the three result arrays (autoResolvedLocal, autoResolvedRemote, or remainingConflicts). This means the conflict is silently dropped. Since conflicts only exist when content differs, this edge case represents a logical inconsistency that gets ignored rather than resolved. The sync completes successfully and transitions to watching mode, but the files remain out of sync with no user notification. This could happen due to timestamp drift or other timing issues, leading to persistent data inconsistency between local and remote files.

Fix in Cursor Fix in Web

@github-actions
Copy link

This PR has been automatically marked as stale because it has not had any activity in the last 7 days. It will be closed if no further activity occurs in the next 7 days.

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.

2 participants