You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Current Behavior
The "Migrating Multiple Angular CLI Workspaces" page is a 26-line stub
with only a YouTube video. It doesn't mention `nx import` and contains
outdated guidance. The single-workspace migration guide (`angular.mdoc`)
also has outdated sections: a list of supported builders, a full CI
setup walkthrough, an irrelevant "From Nx Console" section, and a
reference to `karma.conf.js`.
## Expected Behavior
- The `angular-multiple.mdoc` page is removed with a redirect to the
main Angular migration guide.
- The main migration guide mentions `nx import` for consolidating
multiple Angular CLI projects.
- Outdated sections (Modified folder structure, Set up CI, From Nx
Console) are removed and replaced with concise links.
- The `nx-and-angular.mdoc` guide links to `nx import` docs instead of
the deleted page.
Preview:
https://deploy-preview-34913--nx-docs.netlify.app/docs/technologies/angular/migration/angular-multiple
(redirects to the updated page)
## Related Issue(s)
Closes DOC-419
Copy file name to clipboardExpand all lines: astro-docs/src/content/docs/technologies/angular/Guides/nx-and-angular.mdoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -412,7 +412,7 @@ npx nx@latest init
412
412
413
413
or alternatively using the `--integrated` flag if you want to create an Nx monorepo right away. Learn more about all the details on the [dedicated docs page](/docs/technologies/angular/migration/angular).
414
414
415
-
There is also a guide describing how to [consolidate multiple Angular CLI projects into a single Nx monorepo](/docs/technologies/angular/migration/angular-multiple).
415
+
You can also use [`nx import`](/docs/guides/adopting-nx/import-project) to bring multiple Angular CLI projects into a single Nx monorepo while preserving git history.
416
416
417
417
You can learn more about Angular & Nx by following our dedicated tutorials:
Copy file name to clipboardExpand all lines: astro-docs/src/content/docs/technologies/angular/Migration/angular.mdoc
+5-140Lines changed: 5 additions & 140 deletions
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,10 @@ The command applies the following changes to your workspace:
43
43
- Updates your `package.json` scripts to use `nx` instead of `ng`.
44
44
- Splits your `angular.json` into `project.json` files for each project with updated paths.
45
45
46
+
### Importing additional Angular CLI projects
47
+
48
+
If you have multiple Angular CLI workspaces that you want to consolidate into a single Nx monorepo, you can use [`nx import`](/docs/guides/adopting-nx/import-project) to bring additional projects into an existing Nx workspace while preserving their git history.
49
+
46
50
After the changes are applied, your workspace file structure should look similar to the one below:
47
51
48
52
{% filetree %}
@@ -75,36 +79,13 @@ After the changes are applied, your workspace file structure should look similar
75
79
- .gitignore
76
80
- .prettierignore
77
81
- .prettierrc
78
-
- karma.conf.js
79
82
- nx.json
80
83
- package.json
81
84
- README.md
82
85
- tsconfig.base.json
83
86
84
87
{% /filetree %}
85
88
86
-
### Modified folder structure
87
-
88
-
The automated migration supports Angular CLI workspaces with a standard structure, configurations and features. It supports workspaces using the following executors (builders):
89
-
90
-
- `@angular-devkit/build-angular:application`
91
-
- `@angular-devkit/build-angular:browser`
92
-
- `@angular-devkit/build-angular:browser-esbuild`
93
-
- `@angular-devkit/build-angular:dev-server`
94
-
- `@angular-devkit/build-angular:extract-i18n`
95
-
- `@angular-devkit/build-angular:karma`
96
-
- `@angular-devkit/build-angular:ng-packagr`
97
-
- `@angular-devkit/build-angular:prerender`
98
-
- `@angular-devkit/build-angular:protractor`
99
-
- `@angular-devkit/build-angular:server`
100
-
- `@angular-devkit/build-angular:ssr-dev-server`
101
-
- `@angular-eslint/builder:lint`
102
-
- `@cypress/schematic:cypress`
103
-
- `@nguniversal/builders:prerender`
104
-
- `@nguniversal/builders:ssr-dev-server`
105
-
106
-
Support for other executors may be added in the future.
107
-
108
89
## After migration
109
90
110
91
Your workspace is now powered by Nx! You can verify that your application still runs as intended:
@@ -116,106 +97,7 @@ Your workspace is now powered by Nx! You can verify that your application still
116
97
117
98
> Your project graph will grow as you add and use more applications and libraries. You can add the `--watch` flag to `nx graph` to see the changes in-browser as you add them.
118
99
119
-
## Set up CI for your Angular workspace
120
-
121
-
This tutorial walked you through how Nx can improve the local development experience, but the biggest difference Nx makes is in CI. As repositories get bigger, making sure that the CI is fast, reliable and maintainable can get very challenging. Nx provides a solution.
122
-
123
-
- Nx reduces wasted time in CI with the [`affected` command](/docs/features/ci-features/affected).
124
-
- Nx Replay's [remote caching](/docs/features/ci-features/remote-cache) will reuse task artifacts from different CI executions making sure you will never run the same computation twice.
125
-
- Nx Agents [efficiently distribute tasks across machines](/docs/concepts/ci-concepts/parallelization-distribution) ensuring constant CI time regardless of the repository size. The right number of machines is allocated for each PR to ensure good performance without wasting compute.
126
-
- Nx Atomizer [automatically splits](/docs/features/ci-features/split-e2e-tasks) large e2e tests to distribute them across machines. Nx can also automatically [identify and rerun flaky e2e tests](/docs/features/ci-features/flaky-tasks).
127
-
128
-
### Connect to Nx Cloud
129
-
130
-
Nx Cloud is a companion app for your CI system that provides remote caching, task distribution, e2e tests deflaking, better DX and more.
131
-
132
-
Now that we're working on the CI pipeline, it is important for your changes to be pushed to a GitHub repository.
133
-
134
-
1. Commit your existing changes with `git add . && git commit -am "updates"`
135
-
2. [Create a new GitHub repository](https://github.com/new)
136
-
3. Follow GitHub instructions to push your existing code to the repository
137
-
138
-
Now connect your repository to Nx Cloud with the following command:
139
-
140
-
```shell
141
-
npx nx@latest connect
142
-
```
143
-
144
-
A browser window will open to register your repository in your [Nx Cloud](https://cloud.nx.app) account. The link is also printed to the terminal if the windows does not open, or you closed it before finishing the steps. The app will guide you to create a PR to enable Nx Cloud on your repository.
And make sure you pull the latest changes locally:
153
-
154
-
```shell
155
-
git pull
156
-
```
157
-
158
-
You should now have an `nxCloudId` property specified in the `nx.json` file.
159
-
160
-
### Create a CI workflow
161
-
162
-
Use the following command to generate a CI workflow file.
163
-
164
-
```shell
165
-
npx nx generate ci-workflow --ci=github
166
-
```
167
-
168
-
This generator creates a `.github/workflows/ci.yml` file that contains a CI pipeline that will run the `lint`, `test`, `build` and `e2e` tasks for projects that are affected by any given PR. Since we are using Nx Cloud, the pipeline will also distribute tasks across multiple machines to ensure fast and reliable CI runs.
169
-
170
-
The key lines in the CI pipeline are:
171
-
172
-
```yml {% meta="{13-17,23-26}" %}
173
-
// .github/workflows/ci.yml
174
-
name: CI
175
-
# ...
176
-
jobs:
177
-
main:
178
-
runs-on: ubuntu-latest
179
-
steps:
180
-
- uses: actions/checkout@v4
181
-
with:
182
-
fetch-depth: 0
183
-
filter: tree:0
184
-
185
-
# This enables task distribution via Nx Cloud
186
-
# Run this command as early as possible, before dependencies are installed
187
-
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
188
-
# Connect your workspace by running "nx connect" and uncomment this
For more information about how Nx can improve your CI pipeline, [check out our details CI guides](/docs/guides/nx-cloud/setup-ci).
100
+
For guidance on setting up CI, see the [CI setup guide](/docs/guides/nx-cloud/setup-ci).
219
101
220
102
## Learn more
221
103
@@ -228,21 +110,4 @@ Learn more about the advantages of Nx in the following guides:
228
110
- [Integrate with Editors](/docs/getting-started/editor-setup)
229
111
- [Advanced Angular Micro Frontends with Dynamic Module Federation](/docs/technologies/angular/guides/dynamic-module-federation-with-angular)
230
112
231
-
## From Nx Console
232
-
233
-
Nx Console no longer supports the Angular CLI. Angular CLI users will receive a notice, asking if they want to switch to Nx. When you click this button, we'll run the `nx init` command to set up the Nx CLI, allowing for cached builds, and for you to share this cache with your teammates via Nx Cloud.
234
-
235
-
If you're not ready to make the change yet, you can come back to this later:
236
-
237
-
- If you're using Nx Console: open the Vs Code command palette and start typing "Convert Angular CLI to Nx Workspace".
238
-
- Regardless of using Nx Console (or your IDE): run `npx nx@latest init` from the root of your project.
239
-
240
-
Once the script has run, commit the changes. Reverting this commit will effectively undo the changes made.
241
-
242
-
{% cardgrid %}
243
-
244
113
{% linkcard title="Nx and the Angular CLI" description="Differences between Nx and the Angular CLI" href="/docs/technologies/angular/guides/nx-and-angular" /%}
245
-
246
-
{% linkcard title="Multiple Angular Repositories to one Nx Workspace" description="Combine multiple Angular CLI workspaces into one Nx workspace" href="/docs/technologies/angular/migration/angular-multiple" /%}
0 commit comments