docs(devkit): callout to disable the daemon when developing plugins

This commit is contained in:
Juri 2025-06-17 22:08:43 +02:00 committed by Juri Strumpflohner
parent 1ef43d0b95
commit 5c2fdc9e31
2 changed files with 8 additions and 2 deletions

View File

@ -7,6 +7,10 @@ description: Learn how to create and register sync generators in Nx to ensure yo
Sync generators are generators that are used to ensure that your file system is in the correct state before a task is run or the CI process is started. From a technical perspective, a sync generator is no different from any other generator, but it has some additional performance considerations and needs to be registered in a particular way. Sync generators are generators that are used to ensure that your file system is in the correct state before a task is run or the CI process is started. From a technical perspective, a sync generator is no different from any other generator, but it has some additional performance considerations and needs to be registered in a particular way.
{% callout type="warning" title="Disable the Nx Daemon during development" %}
When developing the Nx sync generator, disable the [Nx Daemon](/concepts/nx-daemon) by setting `NX_DAEMON=false`. The daemon caches your plugin code, so changes to your plugin won't be reflected until the daemon restarts.
{% /callout %}
## Create a new Sync Generator ## Create a new Sync Generator
You can create a new sync generator by hand or use the built-in generator that Nx provides via the `@nx/plugin` package. You can create a new sync generator by hand or use the built-in generator that Nx provides via the `@nx/plugin` package.

View File

@ -14,6 +14,10 @@ Project graph plugins are able to add new nodes or dependencies to the project g
- [createNodesV2](#adding-new-nodes-to-the-project-graph): This tuple allows a plugin to tell Nx information about projects that are identified by a given file. - [createNodesV2](#adding-new-nodes-to-the-project-graph): This tuple allows a plugin to tell Nx information about projects that are identified by a given file.
- [createDependencies](#adding-new-dependencies-to-the-project-graph): This function allows a plugin to tell Nx about dependencies between projects. - [createDependencies](#adding-new-dependencies-to-the-project-graph): This function allows a plugin to tell Nx about dependencies between projects.
{% callout type="warning" title="Disable the Nx Daemon during development" %}
When developing project graph plugins, disable the [Nx Daemon](/concepts/nx-daemon) by setting `NX_DAEMON=false`. The daemon caches your plugin code, so changes to your plugin won't be reflected until the daemon restarts.
{% /callout %}
## Adding Plugins to Workspace ## Adding Plugins to Workspace
You can register a plugin by adding it to the plugins array in `nx.json`: You can register a plugin by adding it to the plugins array in `nx.json`:
@ -357,8 +361,6 @@ This functionality is available in Nx 17 or higher.
You can then visualize the project graph as described [here](/features/explore-graph). However, there is a cache that Nx uses to avoid recalculating the project graph as much as possible. As you develop your project graph plugin, it might be a good idea to set the following environment variable to disable the project graph cache: `NX_CACHE_PROJECT_GRAPH=false`. You can then visualize the project graph as described [here](/features/explore-graph). However, there is a cache that Nx uses to avoid recalculating the project graph as much as possible. As you develop your project graph plugin, it might be a good idea to set the following environment variable to disable the project graph cache: `NX_CACHE_PROJECT_GRAPH=false`.
It might also be a good idea to ensure that the dep graph is not running on the nx daemon by setting `NX_DAEMON=false`, as this will ensure you will be able to see any `console.log` statements you add as you're developing.
<!-- TODO (@AgentEnder): update the nx-go-project-graph-plugin to v2 API and re-add this section --> <!-- TODO (@AgentEnder): update the nx-go-project-graph-plugin to v2 API and re-add this section -->
<!-- ## Example Project Graph Plugin <!-- ## Example Project Graph Plugin