Skip to content

refactor: replace find-up dependency with internal implementation#4248

Open
MarshallOfSound wants to merge 1 commit intonextfrom
claude/remove-find-up-dependency-vOClk
Open

refactor: replace find-up dependency with internal implementation#4248
MarshallOfSound wants to merge 1 commit intonextfrom
claude/remove-find-up-dependency-vOClk

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

This PR removes the external find-up dependency and replaces it with an internal implementation in core-utils. The new findUp function provides the same core functionality—walking up the directory tree to find files—while being simpler and more tailored to the project's needs.

Changes:

  • Added src/find-up.ts with an async findUp function that searches for files by walking up the directory tree from a given starting directory
  • Added comprehensive test coverage in spec/find-up.spec.ts covering:
    • Finding files in the starting directory
    • Finding files in ancestor directories
    • Returning the closest match when multiple ancestors contain a candidate
    • Respecting the order of candidate names within a single directory
    • Ignoring directories that share a candidate name
    • Returning undefined when no candidate exists
  • Updated src/package-manager.ts and src/electron-version.ts to use the new internal implementation
  • Updated test mocks in spec/package-manager.spec.ts to mock the internal function
  • Removed find-up from package.json dependencies

The new implementation is simpler than the external dependency, removes an external dependency, and provides the exact functionality needed by the codebase.

https://preview.claude.ai/code/session_01VxunirAtie59oe2RTm1DGr

@MarshallOfSound MarshallOfSound requested a review from a team as a code owner May 7, 2026 18:29
@github-actions github-actions Bot added the next label May 7, 2026
@erickzhao erickzhao changed the title Replace find-up dependency with internal implementation refactor: replace find-up dependency with internal implementation May 7, 2026
@MarshallOfSound MarshallOfSound enabled auto-merge (squash) May 7, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants