Skip to content

yarn workspaces is not compatible with bazel-managed deps #12736

Closed

Description

@alexeagle

yarn workspaces lays out node_modules in several directories, nested with your source code. It relies on node module resolution semantics of looking for a node_modules in parent directories when a dependency isnt' resolved

Bazel-managed dependencies are in a single node_modules directory that's outside the source code.

We could have multiple bazel-managed node_modules, but would still need each of these to be a complete copy of deps needed for a given binary to run.

Activity

  1. added
    needs: discussion
    on Oct 24, 2018
  2. clydin commented on Oct 24, 2018

    @clydin
    Member

    Another viable dependency management method for monorepos is to run npm/yarn/pnpm individually for each package and the root of the monorepo. This would also cause issues with Bazel.

  3. alexeagle commented on Oct 25, 2018

    @alexeagle
    ContributorAuthor

    Plan: advertise that yarn workspaces doesn't work.
    The same use case can be achieved by having multiple independent package.json files.
    Maybe we need some tooling to convert from one to the other.

  4. alexeagle commented on Oct 25, 2018

    @alexeagle
    ContributorAuthor

    Actually, having Bazel lay out its managed dependencies into multiple node_modules directories that live in your sources could work.

  5. alexeagle commented on Nov 1, 2018

    @alexeagle
    ContributorAuthor

    @kyliau could you update the developer doc to explain a bit how contributors and people on the team should treat the package.json file now that we are in a mixed mode?

    @clydin I think we could discuss not using yarn workspaces. Given our current setup, a third-party dep has to go in two places, so we already broke the one thing we know of that yarn workspaces was helping with.

    @irengrig this is where we really need Bazel to lay out dependencies inside the project folder, FYI

  6. added and removed
    needs: discussion
    on Dec 20, 2018
  7. clydin commented on May 27, 2020

    @clydin
    Member

    workspace support is being tracked/discussed here: bazel-contrib/rules_nodejs#266

  8. angular-automatic-lock-bot commented on Jun 27, 2020

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  9. locked and limited conversation to collaborators on Jun 27, 2020
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions