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%
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.
Provides monorepo version management capabilities.
Create a command-line tool that can initialize a new monorepo configured for independent versioning. The tool should:
Implement functionality to bump the version of individual packages:
Implement functionality to list all packages in the workspace with their current versions:
# 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.
# 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 versionExpected output: pkg-a should be at version 1.0.1, pkg-b should remain at 2.0.0.
# 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 listExpected output: Should display both packages with their names and versions (alpha@1.5.0 and beta@3.2.1).
Create a Node.js command-line tool (cli.js) that implements the required commands:
init - Initialize monorepo with independent versioningversion <package-name> <bump-type> - Bump a specific package's versionlist - List all packages with their versionsThe tool should use Lerna's programmatic API where appropriate.
Create cli.test.js with test cases that verify:
packages/ directory