@nx-dotnet/core
Version:
- Have an existing nx workspace. For creating this, see [nrwl's documentation](https://nx.dev/latest/angular/getting-started/nx-setup). - .NET SDK is installed, and `dotnet` is available on the path. For help on this, see [Microsoft's documentation](https
33 lines • 936 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWorkspaceScope = getWorkspaceScope;
function getWorkspaceScope(nxJson, rootPackageJson) {
const { workspaceLayout } = (nxJson ?? {});
// Prior to Nx 17 npm scope was included here.
const { npmScope } = workspaceLayout ?? {};
if (npmScope) {
return npmScope;
}
const fromPackageJson = getScopeFromPackageJson(rootPackageJson);
if (fromPackageJson) {
return fromPackageJson;
}
return null;
}
/**
* Get the org scope from the package.json file
*/
function getScopeFromPackageJson(packageJson) {
try {
const { name } = packageJson ?? {};
const parts = name?.split('/');
if (!name || !parts || parts.length < 2) {
return null;
}
return parts[0].substring(1);
}
catch {
return null;
}
}
//# sourceMappingURL=get-scope.js.map