Skip to content

Commit

Permalink
fix(angular): improve angular cli migration when using --preserve-ang…
Browse files Browse the repository at this point in the history
…ular-cli-layout (#9064)
  • Loading branch information
leosvelperez committed Feb 21, 2022
1 parent 01dba86 commit ebaf8f6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/workspace/src/generators/init/init.ts
Expand Up @@ -540,12 +540,12 @@ function createNxJson(host: Tree) {
writeJson<NxJsonConfiguration>(host, 'nx.json', {
npmScope: name,
implicitDependencies: {
'angular.json': '*',
'package.json': '*',
'package.json': {
dependencies: '*',
devDependencies: '*',
},
[tsConfigPath]: '*',
'tslint.json': '*',
'.eslintrc.json': '*',
'nx.json': '*',
},
tasksRunnerOptions: {
default: {
Expand Down Expand Up @@ -630,6 +630,12 @@ function renameDirSyncInTree(tree: Tree, from: string, to: string) {

export async function initGenerator(tree: Tree, schema: Schema) {
if (schema.preserveAngularCliLayout) {
updateJson(tree, 'package.json', (json) => {
if (json.dependencies?.['@nrwl/workspace']) {
delete json.dependencies['@nrwl/workspace'];
}
return json;
});
addDependenciesToPackageJson(tree, {}, { '@nrwl/workspace': nxVersion });
createNxJson(tree);
decorateAngularClI(tree);
Expand Down

0 comments on commit ebaf8f6

Please sign in to comment.