UNPKG

workspace-tools

Version:

A collection of utilities that are useful in a git-controlled monorepo managed by one of these tools:

26 lines 980 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWorkspaceUtilities = void 0; const getWorkspaceManagerAndRoot_1 = require("./getWorkspaceManagerAndRoot"); /** * Get utility implementations for the workspace manager of `cwd`. * It will search up from `cwd` to find a manager file and workspace root, with caching. * Returns undefined if the manager can't be determined. */ function getWorkspaceUtilities(cwd) { const manager = (0, getWorkspaceManagerAndRoot_1.getWorkspaceManagerAndRoot)(cwd)?.manager; switch (manager) { case "yarn": return require("./yarn"); case "pnpm": return require("./pnpm"); case "rush": return require("./rush"); case "npm": return require("./npm"); case "lerna": return require("./lerna"); } } exports.getWorkspaceUtilities = getWorkspaceUtilities; //# sourceMappingURL=getWorkspaceUtilities.js.map