Function findProjectRoot

  • Starting from cwd, searches up the directory hierarchy for the project root (workspace/monorepo manager root), falling back to the git root if no manager root is detected. Results are cached by cwd, and an error is thrown if no project root is found and it's not a git repo.

    To skip the git root fallback, use getWorkspaceManagerRoot. Usually the monorepo manager root is the same as the git root, but this may not be the case with multiple "monorepos" in a single git repo, or in project structures with multiple languages where the JS is not at the root.

    Parameters

    • cwd: string

    Returns string