UNPKG

@nx/devkit

Version:

The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more. Learn more about [extending Nx by

21 lines (20 loc) 751 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCatalogManager = getCatalogManager; const devkit_exports_1 = require("nx/src/devkit-exports"); const pnpm_manager_1 = require("./pnpm-manager"); const yarn_manager_1 = require("./yarn-manager"); /** * Factory function to get the appropriate catalog manager based on the package manager */ function getCatalogManager(workspaceRoot) { const packageManager = (0, devkit_exports_1.detectPackageManager)(workspaceRoot); switch (packageManager) { case 'pnpm': return new pnpm_manager_1.PnpmCatalogManager(); case 'yarn': return new yarn_manager_1.YarnCatalogManager(); default: return null; } }