Function getWorkspaceManagerRoot

  • Get the root directory of a monorepo, defined as the directory where the workspace/monorepo manager config file is located. (Does not rely in any way on git, and the result is cached by cwd.)

    Parameters

    • cwd: string

      Start searching from here

    • Optional managerOverride: WorkspaceManager

      Search for only this manager's config file

    Returns string | undefined

    Workspace manager root directory. Returns undefined (and verbose logs) on error or if not found, unless throwOnError is set.

  • Parameters

    • cwd: string
    • managerOverride: undefined | WorkspaceManager
    • Optional options: {
          throwOnError: true;
      }
      • throwOnError: true

        Throw if there's an error or if the root is not found

    Returns string