From 95c0fad6bfd7e786158767ce3e820d95704ac0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Thu, 27 Apr 2023 23:49:04 +0100 Subject: [PATCH] docs(angular): replace ng add usage with nx init --integrated for integrated migration (#16248) --- .../packages/angular/generators/ng-add.json | 2 +- docs/shared/migration/angular-integrated.md | 16 ++++------------ docs/shared/migration/angular-manual.md | 2 +- packages/angular/docs/ng-add-examples.md | 4 ++-- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/docs/generated/packages/angular/generators/ng-add.json b/docs/generated/packages/angular/generators/ng-add.json index 1a9af69b95dc7..4d1e77fedc261 100644 --- a/docs/generated/packages/angular/generators/ng-add.json +++ b/docs/generated/packages/angular/generators/ng-add.json @@ -69,7 +69,7 @@ } }, "additionalProperties": false, - "examplesFile": "## Information\n\nThis generator is usually used as part of the process of migrating from an Angular CLI Workspace to Nx Workspaces using `ng add @nx/angular`.\n\nYou can read more about [migrating from Angular CLI to Nx here](https://nx.dev/recipes/adopting-nx/migration-angular).\n", + "examplesFile": "## Information\n\nThis generator is usually used as part of the process of migrating from an Angular CLI Workspace to an [Nx Integrated Workspace](/concepts/integrated-vs-package-based#integrated-repos) using `npx nx@latest init --integrated`.\n\nYou can read more about [migrating from Angular CLI to Nx here](/recipes/adopting-nx-angular).\n", "presets": [] }, "description": "Migrates an Angular CLI workspace to Nx or adds the Angular plugin to an Nx workspace.", diff --git a/docs/shared/migration/angular-integrated.md b/docs/shared/migration/angular-integrated.md index 0f9ee80a8e964..1abdbc117b67f 100644 --- a/docs/shared/migration/angular-integrated.md +++ b/docs/shared/migration/angular-integrated.md @@ -1,14 +1,14 @@ # Migrating an Angular CLI workspace to an Integrated Nx Monorepo -To take advantage of Nx's monorepo features provided by Nx and the Nx Angular plugin, you can also perform a migration from an Angular CLI to an Integrated Nx Monorepo with the command: +If you want to migrate your Angular CLI project to an [Integrated Nx Monorepo](/concepts/integrated-vs-package-based#integrated-repos), run the following command: ```shell -ng add @nx/angular@ +npx nx@latest init --integrated ``` -This installs the `@nx/angular` (or `@nx/workspace`) package into your workspace and runs a generator (or schematic) to transform your workspace. The generator applies the following changes to your workspace: +The command applies the following changes to your workspace: -- Installs the `nx` and `@nx/workspace` packages. +- Installs the `nx`, `@nx/angular` and `@nx/workspace` packages. - Moves your applications into the `apps` folder, and updates the relevant file paths in your configuration files. - Moves your e2e suites into the `apps/-e2e` folder, and updates the relevant file paths in your configuration files. - Moves your libraries into the `libs` folder, and updates the relevant file paths in your configuration files. @@ -64,14 +64,6 @@ Your workspace is now powered by Nx! You can verify that your application still ## Older Versions of Angular -To migrate to legacy versions of Nx prior to Nx 13.10, run the command: - -```shell -ng add @nx/workspace@ -``` - -Refer to the [Nx and Angular Version Compatibility Matrix](/packages/angular/documents/angular-nx-version-matrix) for matching Angular and Nx versions. - Support for workspaces with multiple applications and libraries was added in Nx v14.1.0. If you are migrating using an older version of Nx, your workspace can only contain one application and no libraries in order to use the automated migration, otherwise, you can still [migrate manually](/recipes/adopting-nx-angular/angular-manual). ## Modified Folder Structure diff --git a/docs/shared/migration/angular-manual.md b/docs/shared/migration/angular-manual.md index ca56ef5c98ce0..0eb3a72a78652 100644 --- a/docs/shared/migration/angular-manual.md +++ b/docs/shared/migration/angular-manual.md @@ -4,7 +4,7 @@ If you are using older versions of Angular (version 13 or lower), make sure to use the appropriate version of Nx that matches your version of Angular. See the [Nx and Angular Version Compatibility Matrix](/packages/angular/documents/angular-nx-version-matrix) to find the correct version. The generated files will also be slightly different. {% /callout %} -If you are unable to automatically transform your Angular CLI workspace to an Nx workspace using the [ng add](#transforming-an-angular-cli-workspace-to-an-nx-workspace) method, there are some manual steps you can take to move your project(s) into an Nx workspace. +If you are unable to automatically transform your Angular CLI workspace to an [Nx Integrated workspace](/recipes/adopting-nx-angular/angular-integrated), there are some manual steps you can take to move your project(s) into an Nx workspace. ### Generating a new workspace diff --git a/packages/angular/docs/ng-add-examples.md b/packages/angular/docs/ng-add-examples.md index 56a54fd5511a7..d1eb3a2fd0d25 100644 --- a/packages/angular/docs/ng-add-examples.md +++ b/packages/angular/docs/ng-add-examples.md @@ -1,5 +1,5 @@ ## Information -This generator is usually used as part of the process of migrating from an Angular CLI Workspace to Nx Workspaces using `ng add @nx/angular`. +This generator is usually used as part of the process of migrating from an Angular CLI Workspace to an [Nx Integrated Workspace](/concepts/integrated-vs-package-based#integrated-repos) using `npx nx@latest init --integrated`. -You can read more about [migrating from Angular CLI to Nx here](https://nx.dev/recipes/adopting-nx/migration-angular). +You can read more about [migrating from Angular CLI to Nx here](/recipes/adopting-nx-angular).