Skip to content

Commit

Permalink
fix(core): disallow edges to the root project (#13359)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz authored Nov 23, 2022
1 parent dc16468 commit 2d74f4c
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export function buildExplicitTypeScriptDependencies(
graph: ProjectGraph,
filesToProcess: ProjectFileMap
) {
function isRoot(projectName: string) {
return graph.nodes[projectName]?.data?.root === '.';
}

const importLocator = new TypeScriptImportLocator();
const targetProjectLocator = new TargetProjectLocator(
graph.nodes as any,
Expand All @@ -28,6 +32,11 @@ export function buildExplicitTypeScriptDependencies(
f.file
);
if (target) {
if (!isRoot(source) && isRoot(target)) {
// TODO: These edges technically should be allowed but we need to figure out how to separate config files out from root
return;
}

res.push({
sourceProjectName: source,
targetProjectName: target,
Expand Down

1 comment on commit 2d74f4c

@vercel
Copy link

@vercel vercel bot commented on 2d74f4c Nov 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx.dev

Please sign in to comment.