Skip to content

Commit

Permalink
docs(angular): replace ng add usage with nx init --integrated for int…
Browse files Browse the repository at this point in the history
…egrated migration (#16248)
  • Loading branch information
leosvelperez authored Apr 27, 2023
1 parent 13a35bf commit 95c0fad
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/generated/packages/angular/generators/ng-add.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
16 changes: 4 additions & 12 deletions docs/shared/migration/angular-integrated.md
Original file line number Diff line number Diff line change
@@ -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@<version_number>
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/<app name>-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.
Expand Down Expand Up @@ -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@<version_number>
```

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
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/migration/angular-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions packages/angular/docs/ng-add-examples.md
Original file line number Diff line number Diff line change
@@ -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).

1 comment on commit 95c0fad

@vercel
Copy link

@vercel vercel bot commented on 95c0fad Apr 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx.dev

Please sign in to comment.