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

Monorepo Environment Reporter

Build a command-line utility for JavaScript/TypeScript monorepo projects that collects and reports environment diagnostic information to help with issue reporting and troubleshooting.

Requirements

Create a Node.js script that reports comprehensive environment information for monorepo projects. The tool should:

  1. Collect environment diagnostics by gathering:

    • Monorepo tool version and configuration
    • Node.js runtime information
    • Package manager details
    • Operating system information
  2. Format and display information appropriately:

    • Present data in a clear, readable format
    • Support JSON output for programmatic access
    • Handle missing or unavailable information gracefully
  3. Integrate with monorepo tooling:

    • Detect and report the monorepo management tool being used
    • Display relevant configuration settings
    • Work correctly in both monorepo and standalone contexts

Implementation Details

Create a script at src/env-reporter.js that can be executed with node src/env-reporter.js.

The script should leverage monorepo tooling capabilities to gather environment information useful for debugging. At minimum, capture:

  • Monorepo tool name and version
  • Node.js and npm ecosystem details
  • Operating system and platform information
  • Key configuration settings

Test Cases

  • The environment reporter successfully retrieves and displays Lerna version and configuration when run in a Lerna monorepo. @test

  • The reporter outputs environment data in valid JSON format when requested. @test

  • Running the reporter in a directory without monorepo tooling handles the situation gracefully without crashing. @test

Implementation

@generates

API

/**
 * Collects environment and configuration information from the monorepo.
 * This includes tool versions, Node.js details, and OS information.
 *
 * @returns {Promise<Object>} Environment diagnostic data
 */
async function gatherEnvironmentInfo() {
  // Implementation
}

/**
 * Formats environment data for display.
 *
 * @param {Object} envData - Environment information object
 * @param {boolean} jsonFormat - Whether to output as JSON
 * @returns {string} Formatted output string
 */
function formatEnvironmentInfo(envData, jsonFormat = false) {
  // Implementation
}

module.exports = { gatherEnvironmentInfo, formatEnvironmentInfo };

Dependencies { .dependencies }

lerna { .dependency }

Provides monorepo management and diagnostic capabilities for JavaScript/TypeScript projects.

Version

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