Skip to content

Conversation

paul-soporan
Copy link
Member

What's the problem this PR addresses?

Configuration.findProjectCwd is written to support both a lockfile lookup (which is kind of a mixed lookup anyways) and a manifest lookup. Configuration.find supports both these lookups and also ProjectLookup.NONE, which only looks inside the current folder.

ProjectLookup.MANIFEST isn't used anywhere, and ProjectLookup.NONE is only used inside @yarnpkg/doctor, but it should never get to run because findLockfileWorkspace runs first and it does a regular mixed lookup which already succeeds even if there's no lockfile but there's a manifest.

How did you fix it?

I simplified all of this and got rid of the lookups. Now everything does a mixed ("lockfile") lookup by default.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@arcanis arcanis merged commit dc72cba into master Sep 21, 2023
@arcanis arcanis deleted the paul/refactor/simplify-findProjectCwd branch September 21, 2023 14:25
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