CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-lerna--init

tessl install tessl/npm-lerna--init@6.6.0

Create 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%

task.mdevals/scenario-10/

Monorepo Release Script with Build Metadata

Build a Node.js script that performs version releases for a monorepo and attaches build metadata to the released versions.

Overview

Your task is to create a release automation script for a monorepo that can bump package versions and add custom build metadata (such as CI build numbers or git commit SHAs) to the version numbers in a semver-compatible format.

Requirements

The script should:

  • Accept a version bump type: patch, minor, or major
  • Optionally accept build metadata via a --build-metadata flag
  • Perform the version bump for packages in the monorepo
  • When build metadata is provided, append it to the version with a + prefix (e.g., 1.2.3+build.456)
  • Log the resulting version numbers to the console

Example Usage

# Basic patch release
node release.js patch

# Minor release with build number
node release.js minor --build-metadata build.123

# Major release with git commit SHA
node release.js major --build-metadata sha.abc1234

Test Cases

  • Executing a patch bump without build metadata successfully increments the patch version @test
  • Executing a minor bump with --build-metadata build.123 produces a version ending in +build.123 @test
  • Executing a major bump with --build-metadata ci.456.abc789 produces a version ending in +ci.456.abc789 @test

@generates

Dependencies { .dependencies }

lerna { .dependency }

Provides monorepo management and versioning capabilities including support for semver-compatible build metadata.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@lerna/init@6.6.x
tile.json