tessl install tessl/npm-lerna--init@6.6.0Create a new Lerna repo or upgrade an existing repo to the current version of Lerna
Agent Success
Agent success rate when using this tile
75%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.36x
Baseline
Agent success rate without this tile
55%
A utility script that executes commands across all packages in a monorepo and generates a build report.
You need to create a Node.js script that uses Lerna to execute shell commands across multiple packages in a monorepo. The script should gather information about each package (specifically the package name and line count), then generate a JSON report summarizing the results.
The script must execute a shell command in each package directory to count the number of lines in JavaScript files. The command should:
find and wc) to count linesAfter executing commands across all packages, generate a JSON report file named build-report.json in the project root containing:
packageName: The name of the packagelineCount: The total number of lines counted (as a number)The report should be sorted alphabetically by package name.
If the command execution fails or produces no output, the script should handle the error gracefully and exit with a non-zero exit code.
When run in a monorepo with packages @myapp/pkg-a, @myapp/pkg-b, and @myapp/pkg-c, the generated build-report.json should look like:
{
"packages": [
{
"packageName": "@myapp/pkg-a",
"lineCount": 150
},
{
"packageName": "@myapp/pkg-b",
"lineCount": 200
},
{
"packageName": "@myapp/pkg-c",
"lineCount": 75
}
]
}@generates
/**
* Executes commands across all packages and generates a build report.
* The function uses Lerna to run shell commands in each package directory.
*
* @returns {Promise<void>} Resolves when the report is successfully generated
* @throws {Error} If command execution fails or produces invalid output
*/
async function generateBuildReport() {
// IMPLEMENTATION HERE
}
module.exports = { generateBuildReport };build-report.json file with an array of 3 package results @testpackageName and lineCount properties @testlineCount values are numbers, not strings @testProvides monorepo management and command execution across packages.
@satisfied-by