workspace (monorepo) utils
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 300
- Forks
- 30
- Avg merge
- 20h 45m
- Merged PRs (30d)
- 3
Description
Supporting monorepo and workspace detection
Common sources:
workspacesfield inpackage.json(yarn, npm and lerna, turbo supported)pnpm-workspace.yaml(pnpm, our odd friend with it's odd requirements)
Common workspace managers:
- pnpm: https://pnpm.io/workspaces
- npm: https://docs.npmjs.com/cli/v9/using-npm/workspaces?v=true
- yarn 1: https://classic.yarnpkg.com/lang/en/docs/cli/workspace/
- yarn 2+: https://yarnpkg.com/features/workspaces
- lerna: https://lerna.js.org/docs/getting-started
- turbo: https://turbo.build/repo/docs/handbook/workspaces (not a manger itself!)
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 🙏🏼 )
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing findworkspaceDir utility and the workspace manager documentation linked in the issue. Compare explicit workspaces fields in package.json with pnpm-workspace.yaml, then define the scope of workspace resolution, package discovery, and dependency graph ordering. Done should include agreed behavior for the proposed utilities and coverage for supported workspace configurations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100