Skip to content

Commit

Permalink
fix(core): project inference plugins should be ran when reading proje…
Browse files Browse the repository at this point in the history
…ct configuration (#18630)
  • Loading branch information
AgentEnder authored Aug 15, 2023
1 parent 11249e9 commit 2760026
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions packages/nx/src/config/workspaces.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { dirname, join } from 'path';
import { workspaceRoot } from '../utils/workspace-root';
import { readJsonFile } from '../utils/fileutils';
import { getNxRequirePaths } from '../utils/installation-directory';
import { loadNxPlugins, loadNxPluginsSync } from '../utils/nx-plugin';

import type { NxJsonConfiguration } from './nx-json';
Expand Down Expand Up @@ -43,7 +44,11 @@ export class Workspaces {
buildProjectsConfigurationsFromProjectPathsAndPlugins(
nxJson,
projectPaths,
loadNxPluginsSync(),
loadNxPluginsSync(
nxJson.plugins,
getNxRequirePaths(this.root),
this.root
),
this.root
).projects;
if (
Expand All @@ -59,10 +64,7 @@ export class Workspaces {
}
this.cachedProjectsConfig = {
version: 2,
projects: this.mergeTargetDefaultsIntoProjectDescriptions(
projectsConfigurations,
nxJson
),
projects: projectsConfigurations,
};
return this.cachedProjectsConfig;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/nx/src/utils/nx-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function loadNxPluginSync(moduleName: string, paths: string[], root: string) {
* @deprecated Use loadNxPlugins instead.
*/
export function loadNxPluginsSync(
plugins?: string[],
plugins: string[],
paths = getNxRequirePaths(),
root = workspaceRoot
): (NxPluginV2 & Pick<NxPluginV1, 'processProjectGraph'>)[] {
Expand Down Expand Up @@ -240,7 +240,7 @@ export function loadNxPluginsSync(
}

export async function loadNxPlugins(
plugins?: string[],
plugins: string[],
paths = getNxRequirePaths(),
root = workspaceRoot
): Promise<(NxPluginV2 & Pick<NxPluginV1, 'processProjectGraph'>)[]> {
Expand Down

1 comment on commit 2760026

@vercel
Copy link

@vercel vercel bot commented on 2760026 Aug 15, 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.dev
nx-five.vercel.app

Please sign in to comment.