Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workspace (monorepo) utils #117

Open
pi0 opened this issue Mar 24, 2023 · 1 comment
Open

workspace (monorepo) utils #117

pi0 opened this issue Mar 24, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@pi0
Copy link
Member

pi0 commented Mar 24, 2023

Supporting monorepo and workspace detection

Common sources:

  • workspaces field in package.json (yarn, npm and lerna, turbo supported)
  • pnpm-workspace.yaml (pnpm, our odd friend with it's odd requirements)

Common workspace managers:

Reolve workspace

We already have findworkspaceDir but it is not strict enough to make distinguish between a monorepo and just the closest root dir of a project.

We could introduce a new resolveWorkspace utility that only detects an explicit monorepo workspace with the detected field in package.json or pnpm workspaces lock returning a workspaces config object (array of objects for forward compatibility.

Resolve workspace packages

Another utility like resolveWorkspacePkgs can be introduced to accepd resolved workspace config (from resolveWorkspace or a string to do this) and read all of its packages.

Resolve workspace packages graph

Get array of workspace packages, returning an (ordered and sorted) graph of devDependency and dependency between monorepo packages.

(PR more than welcome 🙏🏼 )

@pi0 pi0 added the enhancement New feature or request label Mar 24, 2023
@aa900031
Copy link

@pi0
I don't think it's necessary to include Turbo, because Turbo isn't an independent workspace manager.The document mentions that you need to configure npm, yarn, or pnpm workspaces yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants