Skip to content

Commit

Permalink
Merge branch 'master' into feat/added-verdaccio-listen-address-config…
Browse files Browse the repository at this point in the history
…uration
  • Loading branch information
Vegtory authored Jul 25, 2024
2 parents 9f84df3 + 3890edc commit 8e187db
Show file tree
Hide file tree
Showing 46 changed files with 678 additions and 330 deletions.
6 changes: 6 additions & 0 deletions docs/generated/cli/reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ Type: `boolean`

Clears the Nx cache directory. This will remove all local cache entries for tasks, but will not affect the remote cache.

### onlyCloud

Type: `boolean`

Resets the Nx Cloud client. NOTE: Does not clear the remote cache.

### onlyDaemon

Type: `boolean`
Expand Down
5 changes: 5 additions & 0 deletions docs/generated/packages/js/executors/verdaccio.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"type": "boolean",
"description": "Clear local registry storage before starting Verdaccio",
"default": true
},
"scopes": {
"type": "array",
"description": "Scopes to be added to the Verdaccio config",
"items": { "type": "string" }
}
},
"required": ["port"],
Expand Down
6 changes: 6 additions & 0 deletions docs/generated/packages/nx/documents/reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ Type: `boolean`

Clears the Nx cache directory. This will remove all local cache entries for tasks, but will not affect the remote cache.

### onlyCloud

Type: `boolean`

Resets the Nx Cloud client. NOTE: Does not clear the remote cache.

### onlyDaemon

Type: `boolean`
Expand Down
14 changes: 8 additions & 6 deletions docs/shared/migration/adding-to-existing-project.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Adding Nx to your Existing Project

Nx can be added to any type of project, not just monorepos. The main benefit is to get caching abilities for the package
Nx can be added to any type of project, not just monorepos. A large benefit of Nx is its caching feature for package
scripts. Each project usually has a set of scripts in the `package.json`:

```json {% fileName="package.json" %}
Expand All @@ -14,12 +14,14 @@ scripts. Each project usually has a set of scripts in the `package.json`:
}
```

You can make these scripts faster by leveraging Nx's caching capabilities. For example:
You can make these scripts faster by leveraging Nx's [caching capabilities](/features/cache-task-results). For example:

- You change some spec files: in that case the `build` task can be cached and doesn't have to re-run.
- You update your docs, changing a couple of markdown files: then there's no need to re-run builds, tests, linting on
your CI. All you might want to do is trigger the Docusaurus build.

Additionally, Nx also [speeds up your CI ⚡](#fast-ci) with [remote caching](/ci/features/remote-cache) and [distributed task execution](/ci/features/distribute-task-execution).

## Install Nx on a Non-Monorepo Project

Run the following command:
Expand Down Expand Up @@ -284,7 +286,7 @@ Now if you run `npm run test` or `nx test` twice, the results will be retrieved
this example are as cautious as possible, so you can significantly improve the value of the cache
by [customizing Nx Inputs](/recipes/running-tasks/configure-inputs) for each task.

## Set Up CI for Your Workspace
## Fast CI ⚡ {% highlightColor="green" %}

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.

Expand All @@ -293,7 +295,7 @@ This tutorial walked you through how Nx can improve the local development experi
- Nx Agents [efficiently distribute tasks across machines](/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.
- Nx Atomizer [automatically splits](/ci/features/split-e2e-tasks) large e2e tests to distribute them across machines. Nx can also automatically [identify and rerun flaky e2e tests](/ci/features/flaky-tasks).

### Connect to Nx Cloud
### Connect to Nx Cloud {% highlightColor="green" %}

Nx Cloud is a companion app for your CI system that provides remote caching, task distribution, e2e tests deflaking, better DX and more.

Expand Down Expand Up @@ -325,7 +327,7 @@ git pull

You should now have an `nxCloudAccessToken` property specified in the `nx.json` file.

### Create a CI Workflow
### Create a CI Workflow {% highlightColor="green" %}

Use the following command to generate a CI workflow file.

Expand Down Expand Up @@ -362,7 +364,7 @@ jobs:
- run: npx nx affected -t lint test build
```
### Open a Pull Request
### Open a Pull Request {% highlightColor="green" %}
Commit the changes and open a new PR on GitHub.
Expand Down
16 changes: 7 additions & 9 deletions docs/shared/migration/adding-to-monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ powering Nx underneath. As a result, Lerna gets all the modern features such as
on [https://lerna.js.org/upgrade](https://lerna.js.org/upgrade).
{% /callout %}

Nx has first-class support for [monorepos](/getting-started/tutorials/npm-workspaces-tutorial). As a result, if you have
Nx has first-class support for [monorepos](/getting-started/tutorials/npm-workspaces-tutorial). If you have
an existing NPM/Yarn or PNPM-based monorepo setup, you can easily add Nx to get

- fast [task scheduling](/features/run-tasks)
- support for [task pipelines](/concepts/task-pipeline-configuration)
- [caching](/features/cache-task-results)
- [remote caching with Nx Cloud](/ci/features/remote-cache)
- [distributed task execution with Nx Cloud](/ci/features/distribute-task-execution)
- high-performance task [caching](/features/cache-task-results)
- [fast CI ⚡](#fast-ci) with [remote caching](/ci/features/remote-cache) and [distributed task execution](/ci/features/distribute-task-execution)

This is a low-impact operation because all that needs to be done is to install the `nx` package at the root level and
add an `nx.json` for configuring caching and task pipelines.
Expand Down Expand Up @@ -307,7 +305,7 @@ pnpm run -r test

This allows for incrementally adopting Nx in your existing workspace.

## Set Up CI for Your Workspace
## Fast CI ⚡ {% highlightColor="green" %}

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.

Expand All @@ -316,7 +314,7 @@ This tutorial walked you through how Nx can improve the local development experi
- Nx Agents [efficiently distribute tasks across machines](/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.
- Nx Atomizer [automatically splits](/ci/features/split-e2e-tasks) large e2e tests to distribute them across machines. Nx can also automatically [identify and rerun flaky e2e tests](/ci/features/flaky-tasks).

### Connect to Nx Cloud
### Connect to Nx Cloud {% highlightColor="green" %}

Nx Cloud is a companion app for your CI system that provides remote caching, task distribution, e2e tests deflaking, better DX and more.

Expand Down Expand Up @@ -348,7 +346,7 @@ git pull

You should now have an `nxCloudAccessToken` property specified in the `nx.json` file.

### Create a CI Workflow
### Create a CI Workflow {% highlightColor="green" %}

Use the following command to generate a CI workflow file.

Expand Down Expand Up @@ -385,7 +383,7 @@ jobs:
- run: npx nx affected -t lint test build
```
### Open a Pull Request
### Open a Pull Request {% highlightColor="green" %}
Commit the changes and open a new PR on GitHub.
Expand Down
15 changes: 10 additions & 5 deletions docs/shared/tutorials/angular-monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ description: In this tutorial you'll create a frontend-focused workspace with Nx

In this tutorial you'll learn how to use Angular with Nx in a [monorepo (integrated) setup](/concepts/integrated-vs-package-based#integrated-repos).

What are you going to learn?
What will you learn?

- how to create a new Angular application
- how to run a single task (i.e. serve your app) or run multiple tasks in parallel
- how to leverage code generators to scaffold components
- how to modularize your codebase and impose architectural constraints for better maintainability
- [how to speed up CI with Nx Cloud ⚡](#fast-ci)

{% callout type="info" title="Looking for an Angular standalone app?" %}
Note, this tutorial sets up a repo with applications and libraries in their own subfolders. If you are looking for an Angular standalone app setup then check out our [Angular standalone app tutorial](/getting-started/tutorials/angular-standalone-tutorial).
Expand Down Expand Up @@ -1238,7 +1239,11 @@ If you have the ESLint plugin installed in your IDE you should immediately see a

Learn more about how to [enforce module boundaries](/features/enforce-module-boundaries).

## Set Up CI for Your Angular Monorepo
## Fast CI ⚡ {% highlightColor="green" %}

{% callout type="check" title="Repository with Nx" %}
Make sure you have completed the previous sections of this tutorial before starting this one. If you want a clean starting point, you can check out the [reference code](https://github.com/nrwl/nx-recipes/tree/main/angular-monorepo) as a starting point.
{% /callout %}

{% video-link link="https://youtu.be/ZzTP4bVJEnI?t=791" /%}

Expand All @@ -1249,7 +1254,7 @@ This tutorial walked you through how Nx can improve the local development experi
- Nx Agents [efficiently distribute tasks across machines](/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.
- Nx Atomizer [automatically splits](/ci/features/split-e2e-tasks) large e2e tests to distribute them across machines. Nx can also automatically [identify and rerun flaky e2e tests](/ci/features/flaky-tasks).

### Connect to Nx Cloud
### Connect to Nx Cloud {% highlightColor="green" %}

Nx Cloud is a companion app for your CI system that provides remote caching, task distribution, e2e tests deflaking, better DX and more.

Expand All @@ -1267,7 +1272,7 @@ npx nx connect

Once you click the link, follow the steps provided and make sure Nx Cloud is enabled on the main branch of your repository.

### Configure Your CI Workflow
### Configure Your CI Workflow {% highlightColor="green" %}

When you chose GitHub Actions as your CI provider at the beginning of the tutorial, `create-nx-workspace` created 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.

Expand Down Expand Up @@ -1304,7 +1309,7 @@ jobs:
- run: npx nx affected -t lint test build
```
### Open a Pull Request
### Open a Pull Request {% highlightColor="green" %}
Commit the changes and open a new PR on GitHub.
Expand Down
15 changes: 10 additions & 5 deletions docs/shared/tutorials/angular-standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

In this tutorial you'll learn how to use Angular with Nx in a ["standalone" (non-monorepo) setup](/concepts/integrated-vs-package-based#standalone-applications). Not to be confused with the "Angular Standalone API", a standalone project in Nx is a non-monorepo setup where you have a single application at the root level. This setup is very similar to what the Angular CLI gives you.

What are you going to learn?
What will you learn?

- how to create a new standalone (single-project) Nx workspace setup for Angular
- how to run a single task (i.e. serve your app) or run multiple tasks in parallel
- how to leverage code generators to scaffold components
- how to modularize your codebase and impose architectural constraints for better maintainability
- [how to speed up CI with Nx Cloud ⚡](#fast-ci)

{% callout type="info" title="Looking for Angular monorepos?" %}
Note, this tutorial sets up a repo with a single application at the root level that breaks out its code into libraries to add structure. If you are looking for an Angular monorepo setup then check out our [Angular monorepo tutorial](/getting-started/tutorials/angular-monorepo-tutorial).
Expand Down Expand Up @@ -1041,7 +1042,11 @@ When you are ready to add another application to the repo, you'll probably want

You can also go through the full [Angular monorepo tutorial](/getting-started/tutorials/angular-monorepo-tutorial)

## Set Up CI for the Angular App
## Fast CI ⚡ {% highlightColor="green" %}

{% callout type="check" title="Repository with Nx" %}
Make sure you have completed the previous sections of this tutorial before starting this one. If you want a clean starting point, you can check out the [reference code](https://github.com/nrwl/nx-recipes/tree/main/angular-standalone) as a starting point.
{% /callout %}

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.

Expand All @@ -1050,7 +1055,7 @@ This tutorial walked you through how Nx can improve the local development experi
- Nx Agents [efficiently distribute tasks across machines](/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.
- Nx Atomizer [automatically splits](/ci/features/split-e2e-tasks) large e2e tests to distribute them across machines. Nx can also automatically [identify and rerun flaky e2e tests](/ci/features/flaky-tasks).

### Connect to Nx Cloud
### Connect to Nx Cloud {% highlightColor="green" %}

Nx Cloud is a companion app for your CI system that provides remote caching, task distribution, e2e tests deflaking, better DX and more.

Expand All @@ -1068,7 +1073,7 @@ npx nx connect

Once you click the link, follow the steps provided and make sure Nx Cloud is enabled on the main branch of your repository.

### Configure Your CI Workflow
### Configure Your CI Workflow {% highlightColor="green" %}

When you chose GitHub Actions as your CI provider at the beginning of the tutorial, `create-nx-workspace` created 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.

Expand Down Expand Up @@ -1105,7 +1110,7 @@ jobs:
- run: npx nx affected -t lint test build
```
### Open a Pull Request
### Open a Pull Request {% highlightColor="green" %}
Commit the changes and open a new PR on GitHub.
Expand Down
Loading

0 comments on commit 8e187db

Please sign in to comment.