Skip to content

Commit

Permalink
docs(core): add cli overview page and a section documenting how to ke…
Browse files Browse the repository at this point in the history
…ep configuration in sync
  • Loading branch information
leosvelperez authored and FrozenPandaz committed Aug 24, 2021
1 parent 0772cb3 commit 4b5ba5f
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/angular/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
32 changes: 32 additions & 0 deletions docs/node/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
32 changes: 32 additions & 0 deletions docs/react/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 4b5ba5f

Please sign in to comment.