Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(angular): improve angular cli migration when using --preserve-angular-cli-layout #9064

Merged
merged 1 commit into from Feb 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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