Skip to content

Support flow-typed directories in yarn workspaces #5183

Open
@k15a

Description

@k15a

This is related to an issue in flow-typed: flow-typed/flow-typed#1391

Yarn has a feature called workspaces which is quite good for monorepos.

The problem is that they are not working good with flow and flow-typed. There are two options to use flow in a monorepo:

Use a single flow in the root

The problem is that flow will only use the flow-typed folder in the root so all typings installed in the individual package folders are ignored.

Flow-typed could install all typings into the root and check for the workspaces key in the package.json for individual packages. (This will probably be an issue when package A depends on a
different version of an npm package than package B)

Use one flow per package

The problem here is that yarn will hoist some packages into the root of the project and flow can't find them there. This is a problem with flow because it seems that they use a different module resolution algorithm then node does. #5107

For the first approach (one flow in the root) it would be great if you could search for typings (flow-typed directory) in the specific workspace directory and then in the root.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions