Skip to content

Commit 92b7919

Browse files
feat(devex): add Cursor worktree setup configuration (MetaMask#26986)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> 1. **Reason**: When using Cursor's worktree feature to run agents in separate checkouts, each worktree needs the same env files and plan files as the main repo so that install/build and agent context work correctly. 2. **Solution**: - Add `.cursor/worktrees.json` so that when Cursor creates a worktree - Add setup commands that copy `.js.env`, `.ios.env`, `.android.env`, `.e2e.env`, and `.cursor/plans` (recursively as it's a folder) from the root repos into the new worktree. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: N/A ## **Manual testing steps** ```gherkin Feature: Cursor worktree setup Scenario: worktree is created with env and plans copied Given the repo has .cursor/worktrees.json configured When dev creates a new agent tab using "worktree" agent location And Cursor creates a new worktree Then .js.env, .ios.env, .android.env, .e2e.env and .cursor/plans (and content) exist in the worktree ``` ## **Screenshots/Recordings** The worktree menu available when creating a new local chat agent: <img width="266" height="274" alt="image" src="https://github.com/user-attachments/assets/67e7c406-b6f4-4220-aaf3-4f00ec1ba98b" /> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk developer-experience change that only adds a Cursor configuration file and does not affect runtime app behavior. Main risk is overwriting local env/plan files in worktrees if users have customized them. > > **Overview** > Adds `.cursor/worktrees.json` to configure Cursor’s *worktree* setup so new worktrees automatically copy `.js.env`, `.ios.env`, `.android.env`, `.e2e.env`, and `.cursor/plans` from the root worktree into the new checkout. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 85347a6. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent b140347 commit 92b7919

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.cursor/worktrees.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"setup-worktree": [
3+
"cp $ROOT_WORKTREE_PATH/.js.env .js.env",
4+
"cp $ROOT_WORKTREE_PATH/.ios.env .ios.env",
5+
"cp $ROOT_WORKTREE_PATH/.android.env .android.env",
6+
"cp $ROOT_WORKTREE_PATH/.e2e.env .e2e.env",
7+
"cp -r $ROOT_WORKTREE_PATH/.cursor/plans .cursor/plans"
8+
]
9+
}

0 commit comments

Comments
 (0)