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

[turborepo]: Enable topological DSL operator to be used alone. #2855

@rubber-duck-software

Description

@rubber-duck-software

Describe the Feature Request

Turborepo should differentiate between task dependencies and code dependencies.

The dependsOn option is The list of tasks this task depends on. It seems natural that this option would be used to define task dependencies. However, this option is also used to define code level dependencies in a way which is both confusing and prevents even some simple use cases.

For example, lets say my monorepo looks like

> multiply
> subtract
> add

where multiply and subtract both depend on add.

As a responsible developer, I add tests to all three of these workspaces.

add is not compiled. In fact, none of these workspaces require a build step before testing.

Now, I want all these tests to run in parallel. So, for each of these tasks I set dependsOn: []. After all, multiply tests do not depend on add tests. So these things are safe to run in parallel.

Secondly, I want a change in add to force multiply tests to rerun. After all, a change in add might break the multiply.

I don't think this is possible with the current configuration options! With dependsOn: [], code changes in add don't change the computed hash for multiply. With dependsOn: ["^test"], my tests will no longer execute in parallel.

To summarize, my requirements are

  1. All tests run in parallel
  2. A change in a workspace dependency results in a new hash for its dependents

Expected Behavior

I expect two workspaces to be able to depend on each other from a code perspective (a change in one workspace affects the behavior of the other) without having the workspace tasks depend on each other (workspace A must finish this task before workspace B begins)

To Reproduce

Follow the steps in the readme for https://github.com/rubber-duck-software/turborepo-caching-demo

Reproduction Repo

https://github.com/rubber-duck-software/turborepo-caching-demo

WEB-922

TURBO-1140

Metadata

Metadata

Assignees

No one assigned

    Labels

    linear: turboIssues to sync to Linear for Turborepo team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions