* 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
19 lines
561 B
TypeScript
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;
|