Skip to content

Commit 18707a6

Browse files
committed
chore: adjust project graph creation
1 parent 7d2fbb3 commit 18707a6

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

packages/plugin-coverage/src/lib/nx/coverage-paths.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/// <reference types="vitest" />
2-
import type {
3-
ProjectConfiguration,
4-
ProjectGraphProjectNode,
5-
Tree,
2+
import {
3+
type ProjectConfiguration,
4+
type ProjectGraphProjectNode,
5+
type Tree,
66
} from '@nx/devkit';
77
import type { JestExecutorOptions } from '@nx/jest/src/executors/jest/schema';
88
import type { VitestExecutorOptions } from '@nx/vite/executors';
@@ -25,8 +25,8 @@ export async function getNxCoveragePaths(
2525
);
2626
}
2727

28-
const { createProjectGraphAsync } = await import('@nx/devkit');
29-
const { nodes } = await createProjectGraphAsync({ exitOnError: false });
28+
const { readCachedProjectGraph } = await import('@nx/devkit');
29+
const { nodes } = readCachedProjectGraph();
3030

3131
const coverageResults = await Promise.all(
3232
targets.map(async target => {

packages/plugin-eslint/src/lib/nx/find-all-projects.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import { nxProjectsToConfig } from './projects-to-config.js';
3131
export async function eslintConfigFromAllNxProjects(
3232
options: { exclude?: string[] } = {},
3333
): Promise<ESLintTarget[]> {
34-
const { createProjectGraphAsync } = await import('@nx/devkit');
35-
const projectGraph = await createProjectGraphAsync({ exitOnError: false });
34+
const { readCachedProjectGraph } = await import('@nx/devkit');
35+
const projectGraph = readCachedProjectGraph();
3636
const filteredProjectGraph = filterProjectGraph(
3737
projectGraph,
3838
options.exclude,

0 commit comments

Comments
 (0)