Skip to content

Commit

Permalink
chore(core): change retrieveProjectConfigurationPaths to async (#18717)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz authored Aug 18, 2023
1 parent 97c5ecf commit 7d4e2fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { retrieveProjectConfigurationPaths } from '../../project-graph/utils/ret

export default async function (tree: Tree) {
const nxJson = readNxJson(tree);
const projectFiles = retrieveProjectConfigurationPaths(tree.root, nxJson);
const projectFiles = await retrieveProjectConfigurationPaths(
tree.root,
nxJson
);
const projectJsons = projectFiles.filter((f) => f.endsWith('project.json'));

for (let f of projectJsons) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ describe('retrieveProjectConfigurationPaths', () => {
name: 'project-1',
})
);
expect(retrieveProjectConfigurationPaths(fs.tempDir, {})).not.toContain(
'not-projects/project.json'
);
expect(retrieveProjectConfigurationPaths(fs.tempDir, {})).toContain(
expect(
await retrieveProjectConfigurationPaths(fs.tempDir, {})
).not.toContain('not-projects/project.json');
expect(await retrieveProjectConfigurationPaths(fs.tempDir, {})).toContain(
'projects/project.json'
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ function _retrieveProjectConfigurations(
};
}

export function retrieveProjectConfigurationPaths(
export async function retrieveProjectConfigurationPaths(
root: string,
nxJson: NxJsonConfiguration
): string[] {
): Promise<string[]> {
const projectGlobPatterns = configurationGlobs(
root,
loadNxPluginsSync(nxJson?.plugins ?? [], getNxRequirePaths(root), root)
await loadNxPlugins(nxJson?.plugins ?? [], getNxRequirePaths(root), root)
);
const { getProjectConfigurationFiles } =
require('../../native') as typeof import('../../native');
Expand Down

1 comment on commit 7d4e2fe

@vercel
Copy link

@vercel vercel bot commented on 7d4e2fe Aug 18, 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.