Enable Lerna computation caching, given the repo uses v5 of Lerna
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the enhancement
I've seen you upgraded Lerna to the latest version (#1149). This also comes with performance improvements when running tasks (e.g. improved task scheduling + caching). See the docs for more info: https://lerna.js.org/docs/features/cache-tasks
This is done by delegating the task execution to Nx underneath, rather than using the p-queue package.
Code Snippet
What would be required is first to enable Nx by changing the lerna.json as follows:
{
"packages": [
"packages/*"
],
+ "useNx": true,
"version": "independent"
}
And then run npx nx init to create a new nx.json where one can specify the cacheable operations for this workspace. Usually build, test, lint etc.
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
+ "cacheableOperations": ["build", "test"]
}
}
}
}
The Lerna docs have all the details for that :)
Additional information
Happy to help with more info if needed.
Contributor guide
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 with lerna.json and the repository's Lerna v5 configuration, then run npx nx init as described in the issue to create nx.json. Configure the cacheable build and test operations using the referenced Lerna caching documentation. Done means Nx-backed task execution and caching are enabled for the workspace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100