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-3/

Independent Package Version Manager

Summary { .summary }

Build a CLI tool that manages multiple npm packages in a monorepo workspace where each package maintains its own independent version number. The tool should support initializing a monorepo with independent versioning and bumping versions of individual packages.

Dependencies { .dependencies }

lerna { .dependency }

Provides monorepo version management capabilities.

Requirements { .requirements }

Monorepo Initialization { .requirement }

Create a command-line tool that can initialize a new monorepo configured for independent versioning. The tool should:

  • Initialize a Lerna-managed monorepo structure
  • Configure the monorepo to use independent versioning mode (not fixed/locked versioning)
  • Create the necessary configuration files

Independent Version Bumping { .requirement }

Implement functionality to bump the version of individual packages:

  • Accept a package name and a version bump type (major, minor, or patch) as input
  • Update only the specified package's version
  • Use semantic versioning principles (semver)
  • Skip prompting for version confirmation (non-interactive mode)

Package Listing { .requirement }

Implement functionality to list all packages in the workspace with their current versions:

  • Display each package name
  • Display each package's current version number
  • Output should be easy to parse

Test Cases { .tests }

Test: Initialize independent monorepo @test { .test }

# In an empty directory
node cli.js init

# Verify configuration was created for independent versioning
cat lerna.json | grep "independent"

Expected output: The configuration file should indicate independent versioning mode.

Test: Bump package version independently @test { .test }

# Setup: Create test packages
mkdir -p packages/pkg-a packages/pkg-b
echo '{"name":"pkg-a","version":"1.0.0"}' > packages/pkg-a/package.json
echo '{"name":"pkg-b","version":"2.0.0"}' > packages/pkg-b/package.json

# Bump only pkg-a's version
node cli.js version pkg-a patch

# Verify pkg-a was bumped but pkg-b was not
cat packages/pkg-a/package.json | grep version
cat packages/pkg-b/package.json | grep version

Expected output: pkg-a should be at version 1.0.1, pkg-b should remain at 2.0.0.

Test: List all packages @test { .test }

# Setup: Create test packages with different versions
mkdir -p packages/alpha packages/beta
echo '{"name":"alpha","version":"1.5.0"}' > packages/alpha/package.json
echo '{"name":"beta","version":"3.2.1"}' > packages/beta/package.json

# List packages
node cli.js list

Expected output: Should display both packages with their names and versions (alpha@1.5.0 and beta@3.2.1).

Deliverables { .deliverables }

CLI Implementation { .deliverable }

Create a Node.js command-line tool (cli.js) that implements the required commands:

  • init - Initialize monorepo with independent versioning
  • version <package-name> <bump-type> - Bump a specific package's version
  • list - List all packages with their versions

The tool should use Lerna's programmatic API where appropriate.

Test File { .deliverable }

Create cli.test.js with test cases that verify:

  • Monorepo initialization creates proper configuration
  • Version bumping affects only the specified package
  • Package listing shows correct version information

Technical Notes { .technical-notes }

  • Use Lerna's native commands and configuration
  • The monorepo should follow standard workspace structure with packages in a packages/ directory
  • Ensure the tool works in a non-interactive mode (no user prompts)
  • Version bumps should follow semantic versioning (major.minor.patch)

Version

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