Skip to content

Commit

Permalink
docs(nx-plugin): fixup docs for project name and root changes (#27139)
Browse files Browse the repository at this point in the history
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Some plugin docs don't make sense after project name and root changes

## Expected Behavior
They've been touched up

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #25191
  • Loading branch information
AgentEnder authored and jaysoo committed Jul 26, 2024
1 parent 748360e commit b7fb1da
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docs/shared/deprecated/workspace-executors.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ In Nx 13.10+, local nx plugins can contain executors that are used in the worksp

```shell
npm add -D @nx/plugin
nx g @nx/plugin:plugin my-plugin
nx g @nx/plugin:plugin my-plugin --directory=tools/my-plugin
```

- Use the Nx CLI to generate the initial files needed for your executor. Replace `my-executor` with the name of your workspace executor.

```shell
nx generate @nx/plugin:executor my-executor --project=my-plugin
nx generate @nx/plugin:executor my-executor --directory=tools/my-plugin/src/executors/my-executor
```

- Copy the code for your workspace executor into the newly created executor's folder. e.g. `libs/my-plugin/src/executors/my-executor/`
Expand Down
4 changes: 2 additions & 2 deletions docs/shared/deprecated/workspace-generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ When migrating to Nx 16, a new workspace plugin is automatically generated in th

```shell
npm add -D @nx/plugin
nx g @nx/plugin:plugin my-plugin
nx g @nx/plugin:plugin my-plugin --directory=tools/my-plugin
```

- Use the Nx CLI to generate the initial files needed for your generator. Replace `my-generator` with the name of your workspace generator.

```shell
nx generate @nx/plugin:generator my-generator --project=my-plugin
nx generate @nx/plugin:generator my-generator --directory=tools/my-plugin/src/generators/my-generator
```

- Copy the code for your workspace generator into the newly created generator's folder. e.g. `libs/my-plugin/src/generators/my-generator/`
Expand Down
4 changes: 2 additions & 2 deletions docs/shared/plugins/create-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
To get started with building a local Nx Plugin, install the `@nx/plugin` package and generate a plugin:

```shell
nx g @nx/plugin:plugin my-plugin
nx g @nx/plugin:plugin my-plugin --directory=tools/my-plugin
```

This will create a `my-plugin` project that contains all your plugin code and `my-plugin-e2e` for e2e tests.
Expand All @@ -15,7 +15,7 @@ This will create a `my-plugin` project that contains all your plugin code and `m
To create a new generator run:

```shell
nx generate @nx/plugin:generator my-generator --project=my-plugin
nx generate @nx/plugin:generator my-generator --directory="tools/my-plugin/src/generators/my-generator"
```

The new generator is located in `/src/generators/my-generator`. The `my-generator.ts` file contains the code that runs the generator. This generator creates a new project using a folder of template files.
Expand Down
6 changes: 3 additions & 3 deletions docs/shared/recipes/generators/local-generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ If you don't already have a local plugin, use Nx to generate one:

```shell {% skipRescope=true %}
nx add @nx/plugin
nx g @nx/plugin:plugin my-plugin
nx g @nx/plugin:plugin my-plugin --directory=tools/my-plugin
```

Note that `latest` should match the version of the `nx` plugins installed in your workspace.

Use the Nx CLI to generate the initial files needed for your generator.

```shell
nx generate @nx/plugin:generator my-generator --project=my-plugin
nx generate @nx/plugin:generator my-generator --directory=tools/my-plugin/src/generators/my-generator
```

After the command is finished, the generator is created in the plugin `generators` folder.

```text
happynrwl/
├── apps/
├── libs/
├── tools/
│ ├── my-plugin
│ │ ├── src
│ │ │ ├── generators
Expand Down
6 changes: 3 additions & 3 deletions docs/shared/recipes/plugins/local-executors.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ If you don't already have a local plugin, use Nx to generate one:

```shell {% skipRescope=true %}
nx add @nx/plugin
nx g @nx/plugin:plugin libs/my-plugin
nx g @nx/plugin:plugin my-plugin --directory tools/my-plugin
```

Use the Nx CLI to generate the initial files needed for your executor.

```shell
nx generate @nx/plugin:executor echo --directory=libs/my-plugin/src/executors/echo
nx generate @nx/plugin:executor echo --directory=tools/my-plugin/src/executors/echo
```

After the command is finished, the executor is created in the plugin `executors` folder.

```text
happynrwl/
├── apps/
├── libs/
├── tools/
│ ├── my-plugin
│ │ ├── src
│ │ │ ├── executors
Expand Down

0 comments on commit b7fb1da

Please sign in to comment.