Skip to content

Commit

Permalink
docs(core): add section to point to building generators/executors (#1…
Browse files Browse the repository at this point in the history
…9215)

Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
  • Loading branch information
juristr and AgentEnder committed Sep 18, 2023
1 parent e11d538 commit 64c410d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/shared/plugin-features/use-code-generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ nx generate @nx/react:component mycmp --project=myapp

It is important to have a clean git working directory before invoking a generator so that you can easily revert changes and re-invoke the generator with different inputs.

## Build your own Generator

Nx comes with a Devkit that allows you to build your own generator for your Nx workspace. Learn more about it on [our docs page](/extending-nx/recipes/local-generators) or have a look at the video below:

{% youtube
src="https://www.youtube.com/embed/myqfGDWC2go"
title="Scaffold new Pkgs in a PNPM Workspaces Monorepo"
caption="Demoes how to use Nx generators in a PNPM workspace to automate the creation of libraries"
/%}

## See Also

- [nx.json generator defaults](/reference/nx-json#generators)
4 changes: 4 additions & 0 deletions docs/shared/plugin-features/use-task-executors.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,7 @@ For example, running e2e tests for multiple environments. By default it would ma

When running `nx e2e my-app-e2e`, the _dev_ configuration will be used. In this case using the local dev server for `my-app`.
You can always run the other configurations by explicitly providing the configuration i.e. `nx e2e my-app-e2e --configuration=qa` or `nx run my-app-e2e:e2e:qa`

## Build your own Executor

Nx comes with a Devkit that allows you to build your own executor to automate your Nx workspace. Learn more about it in the [docs page about creating a local executor](/extending-nx/recipes/local-executors).
3 changes: 2 additions & 1 deletion docs/shared/recipes/generators/local-generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ caption="Demoes how to use Nx generators in a PNPM workspace to automate the cre
If you don't already have a local plugin, use Nx to generate one:

```shell
# replace `latest` with the version that matches your Nx version
npm install @nx/plugin@latest
nx g @nx/plugin:plugin 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
Expand Down

0 comments on commit 64c410d

Please sign in to comment.