Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): do not hardcode checks for npm #14827

Merged
merged 2 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/nx/src/utils/project-graph-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ describe('project graph utils', () => {
data: {},
},
},
externalNodes: {
'npm:chalk': {},
},
dependencies: {
'demo-app': [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/nx/src/utils/project-graph-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ function collectDependentProjectNodesNames(
for (const dependency of dependencies) {
const dependencyName = dependency.target;

// we're only intersted in project dependencies, not npm
if (dependencyName.startsWith('npm:')) {
// we're only interested in internal nodes, not external
if (nxDeps.externalNodes?.[dependencyName]) {
Copy link
Member

Choose a reason for hiding this comment

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

We should rename nxDeps -> projectGraph or similar, I thought it was a different data structure at a glance. Either way, thats existing. Feel free to correct now or leave it, it can always be cleaned up a bit later.

continue;
}

Expand Down