Skip to content

Commit

Permalink
chore(core): move hasNxJson out of Workspaces (#18222)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi authored Jul 21, 2023
1 parent 9199444 commit 21d3c5e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions packages/nx/src/config/nx-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,8 @@ export function readNxJson(root: string = workspaceRoot): NxJsonConfiguration {
}
}
}

export function hasNxJson(root: string): boolean {
const nxJson = join(root, 'nx.json');
return existsSync(nxJson);
}
5 changes: 0 additions & 5 deletions packages/nx/src/config/workspaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,6 @@ export class Workspaces {
}
return projects;
}

hasNxJson(): boolean {
const nxJson = path.join(this.root, 'nx.json');
return existsSync(nxJson);
}
}

function findMatchingProjectInCwd(
Expand Down
4 changes: 2 additions & 2 deletions packages/nx/src/daemon/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { isCI } from '../../utils/is-ci';
import { NxJsonConfiguration } from '../../config/nx-json';
import { readNxJson } from '../../config/configuration';
import { PromisedBasedQueue } from '../../utils/promised-based-queue';
import { Workspaces } from '../../config/workspaces';
import { hasNxJson } from '../../config/nx-json';
import { Message, SocketMessenger } from './socket-messenger';
import { safelyCleanUpExistingProcess } from '../cache';
import { Hash } from '../../hasher/task-hasher';
Expand Down Expand Up @@ -438,7 +438,7 @@ function isDocker() {
}

function nxJsonIsNotPresent() {
return !new Workspaces(workspaceRoot).hasNxJson();
return !hasNxJson(workspaceRoot);
}

function daemonProcessException(message: string) {
Expand Down

1 comment on commit 21d3c5e

@vercel
Copy link

@vercel vercel bot commented on 21d3c5e Jul 21, 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-five.vercel.app
nx.dev
nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app

Please sign in to comment.