Skip to content

Commit

Permalink
fix(core): optional dependencies should be tracked by project graph (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder authored Apr 20, 2023
1 parent b44dbf9 commit 61451a1
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { getImportPath, joinPathFragments } from '../../../../utils/path';
import { ProjectsConfigurations } from '../../../../config/workspace-json-project-json';
import { NxJsonConfiguration } from '../../../../config/nx-json';
import { ExplicitDependency } from './explicit-project-dependencies';
import { PackageJson } from '../../../../utils/package-json';

class ProjectGraphNodeRecords {}

Expand Down Expand Up @@ -110,10 +111,11 @@ function processPackageJson(
}
}

function readDeps(packageJsonDeps: any) {
function readDeps(packageJson: PackageJson) {
return [
...Object.keys(packageJsonDeps?.dependencies ?? {}),
...Object.keys(packageJsonDeps?.devDependencies ?? {}),
...Object.keys(packageJsonDeps?.peerDependencies ?? {}),
...Object.keys(packageJson?.dependencies ?? {}),
...Object.keys(packageJson?.devDependencies ?? {}),
...Object.keys(packageJson?.peerDependencies ?? {}),
...Object.keys(packageJson?.optionalDependencies ?? {}),
];
}

0 comments on commit 61451a1

Please sign in to comment.