Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nx-dotnet/utils

Package Overview
Dependencies
Maintainers
1
Versions
189
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nx-dotnet/utils - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

5

package.json

@@ -7,5 +7,6 @@ {

"glob": "^7.1.6",
"rimraf": "^3.0.2"
"rimraf": "^3.0.2",
"xmldoc": "^1.1.2"
},
"version": "0.1.2"
"version": "0.1.3"
}

35

src/lib/workspace.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getProjectFileForNxProjectSync = exports.getProjectFileForNxProject = void 0;
exports.getDependantProjectsForNxProject = exports.getProjectFileForNxProjectSync = exports.getProjectFileForNxProject = void 0;
const tslib_1 = require("tslib");
const glob_1 = require("./glob");
const fs_1 = require("fs");
const xmldoc_1 = require("xmldoc");
const path_1 = require("path");
function getProjectFileForNxProject(project) {

@@ -18,2 +21,32 @@ return tslib_1.__awaiter(this, void 0, void 0, function* () {

exports.getProjectFileForNxProjectSync = getProjectFileForNxProjectSync;
function getDependantProjectsForNxProject(targetProject, workspaceConfiguration, forEachCallback) {
const projectRoots = {};
const dependantProjects = {};
Object.entries(workspaceConfiguration.projects).forEach(([name, project]) => {
projectRoots[name] = path_1.resolve(project.root);
});
const netProjectFilePath = getProjectFileForNxProjectSync(workspaceConfiguration.projects[targetProject]);
const xml = new xmldoc_1.XmlDocument(fs_1.readFileSync(netProjectFilePath).toString());
xml.childrenNamed('ItemGroup').forEach((itemGroup) => itemGroup.childrenNamed('ProjectReference').forEach((x) => {
const includeFilePath = x.attr['Include'];
let absoluteFilePath;
if (path_1.isAbsolute(includeFilePath)) {
absoluteFilePath = includeFilePath;
}
else {
absoluteFilePath = path_1.resolve(netProjectFilePath.split('/').slice(0, -1).join('/'), includeFilePath);
}
Object.entries(projectRoots).forEach(([dependency, path]) => {
if (absoluteFilePath.startsWith(path)) {
if (forEachCallback) {
forEachCallback(workspaceConfiguration.projects[dependency], dependency);
}
dependantProjects[dependency] =
workspaceConfiguration.projects[dependency];
}
});
}));
return dependantProjects;
}
exports.getDependantProjectsForNxProject = getDependantProjectsForNxProject;
//# sourceMappingURL=workspace.js.map

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc