docs(core): add cli overview page and a section documenting how to keep configuration in sync (#6832)

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
This commit is contained in:
Jason Jean 2021-08-23 22:13:25 -04:00 committed by GitHub
parent da7bbc908e
commit fa3dcabe8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 96 additions and 0 deletions

View File

@ -489,3 +489,35 @@ The syntax is the same as a [`.gitignore` file](https://git-scm.com/book/en/v2/G
1. Changes to that file are not taken into account in the `affected` calculations.
2. Even if the file is outside an app or library, `nx workspace-lint` won't warn about it.
## Keeping the configuration in sync
When creating projects, the Nx generators make sure these configuration files are updated accordingly for the new projects. While development continues and the workspace grows, you might need to refactor projects by renaming them, moving them to a different folder, removing them, etc. When this is done manually, you need to ensure your configuration files are kept in sync and that's a cumbersome task. Fortunately, Nx provides some generators and executors to help you with these tasks.
### Moving projects
Projects can be moved or renamed using the [@nrwl/angular:move](/{{framework}}/angular/move) generator.
For instance, if a library under the booking folder is now being shared by multiple apps, you can move it to the shared folder like this:
```bash
nx g @nrwl/angular:move --project booking-some-library shared/some-library
```
### Removing projects
Projects can be removed using the [@nrwl/workspace:remove](/{{framework}}/workspace/remove) generator.
```bash
nx g @nrwl/workspace:remove booking-some-library
```
### Validating the configuration
If at any point in time you want to check if your configuration is in sync, you can use the [workspace-lint]({{framework}}/cli/workspace-lint) executor:
```bash
nx workspace-lint
```
This will identify any projects with no files in the configured project root folder, as well as any file that's not part of any project configured in the workspace.

View File

@ -500,3 +500,35 @@ The syntax is the same as a [`.gitignore` file](https://git-scm.com/book/en/v2/G
1. Changes to that file are not taken into account in the `affected` calculations.
2. Even if the file is outside an app or library, `nx workspace-lint` won't warn about it.
## Keeping the configuration in sync
When creating projects, the Nx generators make sure these configuration files are updated accordingly for the new projects. While development continues and the workspace grows, you might need to refactor projects by renaming them, moving them to a different folder, removing them, etc. When this is done manually, you need to ensure your configuration files are kept in sync and that's a cumbersome task. Fortunately, Nx provides some generators and executors to help you with these tasks.
### Moving projects
Projects can be moved or renamed using the [@nrwl/workspace:move](/{{framework}}/workspace/move) generator.
For instance, if a library under the booking folder is now being shared by multiple apps, you can move it to the shared folder like this:
```bash
nx g @nrwl/workspace:move --project booking-some-library shared/some-library
```
### Removing projects
Projects can be removed using the [@nrwl/workspace:remove](/{{framework}}/workspace/remove) generator.
```bash
nx g @nrwl/workspace:remove booking-some-library
```
### Validating the configuration
If at any point in time you want to check if your configuration is in sync, you can use the [workspace-lint]({{framework}}/cli/workspace-lint) executor:
```bash
nx workspace-lint
```
This will identify any projects with no files in the configured project root folder, as well as any file that's not part of any project configured in the workspace.

View File

@ -496,3 +496,35 @@ The syntax is the same as a [`.gitignore` file](https://git-scm.com/book/en/v2/G
1. Changes to that file are not taken into account in the `affected` calculations.
2. Even if the file is outside an app or library, `nx workspace-lint` won't warn about it.
## Keeping the configuration in sync
When creating projects, the Nx generators make sure these configuration files are updated accordingly for the new projects. While development continues and the workspace grows, you might need to refactor projects by renaming them, moving them to a different folder, removing them, etc. When this is done manually, you need to ensure your configuration files are kept in sync and that's a cumbersome task. Fortunately, Nx provides some generators and executors to help you with these tasks.
### Moving projects
Projects can be moved or renamed using the [@nrwl/workspace:move](/{{framework}}/workspace/move) generator.
For instance, if a library under the booking folder is now being shared by multiple apps, you can move it to the shared folder like this:
```bash
nx g @nrwl/workspace:move --project booking-some-library shared/some-library
```
### Removing projects
Projects can be removed using the [@nrwl/workspace:remove](/{{framework}}/workspace/remove) generator.
```bash
nx g @nrwl/workspace:remove booking-some-library
```
### Validating the configuration
If at any point in time you want to check if your configuration is in sync, you can use the [workspace-lint]({{framework}}/cli/workspace-lint) executor:
```bash
nx workspace-lint
```
This will identify any projects with no files in the configured project root folder, as well as any file that's not part of any project configured in the workspace.