Skip to content

Commit

Permalink
fix(core): ignore angular.json projects if @nrwl/angular is not insta… (
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Dec 14, 2022
1 parent 437a3eb commit 92d33f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/nx/src/config/workspaces.ts
Expand Up @@ -33,7 +33,8 @@ import { joinPathFragments } from '../utils/path';
export function workspaceConfigName(
root: string
): 'angular.json' | 'workspace.json' | null {
if (existsSync(path.join(root, 'angular.json'))) {
// If a workspace doesn't have `@nrwl/angular` it's likely they do not want projects from `angular.json` to be considered by Nx.
if (existsSync(path.join(root, 'angular.json')) && isNrwlAngularInstalled()) {
return 'angular.json';
} else if (existsSync(path.join(root, 'workspace.json'))) {
return 'workspace.json';
Expand Down Expand Up @@ -431,6 +432,15 @@ function assertValidWorkspaceConfiguration(
}
}

function isNrwlAngularInstalled() {
try {
require.resolve('@nrwl/angular');
return true;
} catch {
return false;
}
}

function findFullGeneratorName(
name: string,
generators: {
Expand Down
1 change: 1 addition & 0 deletions scripts/depcheck/missing.ts
Expand Up @@ -124,6 +124,7 @@ const IGNORE_MATCHES_IN_PACKAGE = {
'@angular-devkit/core',
'@angular-devkit/architect',
'@angular/cli',
'@nrwl/angular',
'ts-node', // We *may* fall back on ts-node, but we want to encourage the use of @swc-node instead so we don't explicitly list ts-node as an optional dep
],
web: [
Expand Down

1 comment on commit 92d33f9

@vercel
Copy link

@vercel vercel bot commented on 92d33f9 Dec 14, 2022

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-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx.dev
nx-five.vercel.app

Please sign in to comment.