Skip to content

Commit

Permalink
fix(misc): handle standalone repos when removing nested projects (#15609
Browse files Browse the repository at this point in the history
)
  • Loading branch information
FrozenPandaz committed Mar 14, 2023
1 parent 5add52b commit 636a74b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,25 @@ describe('checkProjectIsSafeToRemove', () => {
);
}).toThrow();
});

it('should be able to remove e2e project in standalone', () => {
addProjectConfiguration(tree, 'e2e', {
root: 'e2e',
});
addProjectConfiguration(tree, 'root', {
root: '.',
});

expect(() => {
checkProjectIsSafeToRemove(
tree,
{
projectName: 'e2e',
forceRemove: false,
skipFormat: false,
},
readProjectConfiguration(tree, 'e2e')
);
}).not.toThrow();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function checkProjectIsSafeToRemove(
for (const [_, p] of getProjects(tree)) {
if (
project.name !== p.name &&
!normalizePath(relative(project.root, p.root)).startsWith('../')
!normalizePath(relative(project.root, p.root)).startsWith('..')
) {
containedProjects.push(p.name);
}
Expand Down

1 comment on commit 636a74b

@vercel
Copy link

@vercel vercel bot commented on 636a74b Mar 14, 2023

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-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.