actions / actions/toolkit

Enable Lerna computation caching, given the repo uses v5 of Lerna

Open
#1,156 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.