UNPKG

@rxap/plugin-utilities

Version:

Provides utility functions for Nx plugins, such as retrieving project dependencies, determining output paths, and interacting with package.json files. It simplifies common tasks within Nx executors and generators. This package helps streamline plugin deve

18 lines 656 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetWorkspaceName = GetWorkspaceName; const devkit_1 = require("@nx/devkit"); const path_1 = require("path"); function GetWorkspaceName(context) { const rootPackageJson = (0, devkit_1.readJsonFile)((0, path_1.join)(context.root, 'package.json')); const name = rootPackageJson.name; const match = name === null || name === void 0 ? void 0 : name.match(/@([^/]+)\/(.+)$/); if (match) { if (match[2] === 'source') { return match[1]; } return match[2]; } return name; } //# sourceMappingURL=get-workspace-name.js.map