evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A utility library that provides package manager detection and dependency management functionality for monorepo workspaces. The library should automatically detect which package manager is being used in a workspace and provide methods to manage dependencies appropriately.
import { Tree } from '@nx/devkit';
/**
* Detects the package manager used in the workspace.
*
* @param workspaceRoot - The root directory of the workspace
* @returns The detected package manager ('npm', 'yarn', 'pnpm', or 'bun')
*/
export function detectWorkspacePackageManager(workspaceRoot: string): string;
/**
* Adds dependencies to the workspace's package.json.
*
* @param tree - The file system tree
* @param dependencies - Object mapping package names to version strings
* @param devDependencies - Object mapping dev package names to version strings
* @returns A callback function to install the added packages
*/
export function addDependencies(
tree: Tree,
dependencies: Record<string, string>,
devDependencies?: Record<string, string>
): () => void;
/**
* Creates a task that installs packages using the workspace's package manager.
*
* @param workspaceRoot - The root directory of the workspace
* @returns A callback function that executes the install command
*/
export function createInstallTask(workspaceRoot: string): () => void;Provides workspace utilities and file system operations.