Leosvel Pérez Espinosa 88a7ad7654
cleanup(angular): move the angular cli migration generator from @nrwl/workspace to @nrwl/angular (#9244)
* cleanup(angular): move the angular cli migration generator from @nrwl/workspace to @nrwl/angular

* cleanup(angular): support merged packages (cli, tao, nx)

* cleanup(angular): update make-angular-cli-faster to support packages consolidation
2022-03-18 17:18:10 -04:00

19 lines
561 B
TypeScript

import { Tree } from '@nrwl/devkit';
import { migrateFromAngularCli } from './migrate-from-angular-cli';
import { angularInitGenerator } from '../init/init';
import { Schema } from './schema';
function getWorkspaceType(tree: Tree): 'angular' | 'nx' {
return tree.exists('nx.json') ? 'nx' : 'angular';
}
export async function ngAddGenerator(tree: Tree, options: Schema) {
if (getWorkspaceType(tree) === 'angular') {
return await migrateFromAngularCli(tree, options);
}
return angularInitGenerator(tree, options);
}
export default ngAddGenerator;