这是indexloc提供的服务,不要输入任何密码
Skip to content

peerDependencies are ignored while creating dependency graph #1601

@mkermani144

Description

@mkermani144

What version of Turborepo are you using?

1.4.0

What package manager are you using / does the bug impact?

Yarn v1

What operating system are you using?

Mac

Describe the Bug

The peer dependencies are not considered part of the dependency graph. This issue has roots in #813 where they are ignored while creating the graph because of some dependency cycle issues mentioned in the PR.

Expected Behavior

Construct dependency graph including peer dependencies. Peer dependencies are one of the complementary tools which are used in monorepos, and simply ignoring them doesn't seem a good solution.

To Reproduce

  1. Suppose the following monorepo structure:
/app
  /some-app
/packages
  /dependent-a
  /dependent-b
  /c
  1. Suppose that dependent-a and dependent-b has c as peer dependency, and some-app has all packages (dependent-a, dependent-b and c) as dependency.

  2. Suppose turbo.json looks like this:

{
  "$schema": "https://turborepo.org/schema.json",
  "pipeline": {
    "build": {
      "dependsOn": ["^build"]
    }
  }
}
  1. When you run turbo run build on some-app (using --filter=some-app), it triggers build for all of the packages concurrently, completely unable to build c first and clearly causing issues.

I think this is a common scenario for plugin based apps, as the plugins may include other plugins as peer dependency (and not a regular dependency).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions