From 4f1c14cb7514cf4f5b271d314aeed6745f143e85 Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Mon, 18 Apr 2022 13:40:11 -0400 Subject: [PATCH] chore(nxdev): reorganize nx plugin content (#9758) --- docs/map.json | 17 +++++++++++------ .../{ => extending-nx}/devkit-and-nx-plugins.md | 2 +- .../project-graph-plugins.md | 0 docs/shared/generators/workspace-generators.md | 2 ++ docs/shared/nx-plugin.md | 2 +- nx-dev/nx-dev/redirect-rules.config.js | 2 ++ 6 files changed, 17 insertions(+), 8 deletions(-) rename docs/shared/{ => extending-nx}/devkit-and-nx-plugins.md (97%) rename docs/shared/{workspace => extending-nx}/project-graph-plugins.md (100%) diff --git a/docs/map.json b/docs/map.json index 7e4abc1fdc991..f3e65c1bf7392 100644 --- a/docs/map.json +++ b/docs/map.json @@ -89,11 +89,6 @@ "id": "affected", "file": "shared/using-nx/affected" }, - { - "name": "Nx Plugins and Devkit", - "id": "nx-devkit", - "file": "shared/devkit-and-nx-plugins" - }, { "name": "CI Setup", "id": "ci-overview", @@ -110,10 +105,20 @@ "name": "Extending Nx", "id": "extending-nx", "itemList": [ + { + "name": "Nx Plugins and Devkit", + "id": "nx-devkit", + "file": "shared/extending-nx/devkit-and-nx-plugins" + }, { "name": "Project Inference Plugins", "id": "project-inference-plugins", "file": "shared/extending-nx/project-inference-plugins" + }, + { + "name": "Project Graph Plugins", + "id": "project-graph-plugins", + "file": "shared/extending-nx/project-graph-plugins" } ] }, @@ -1355,7 +1360,7 @@ { "name": "Extending the Project Graph", "id": "project-graph-plugins", - "file": "shared/workspace/project-graph-plugins" + "file": "shared/extending-nx/project-graph-plugins" } ] }, diff --git a/docs/shared/devkit-and-nx-plugins.md b/docs/shared/extending-nx/devkit-and-nx-plugins.md similarity index 97% rename from docs/shared/devkit-and-nx-plugins.md rename to docs/shared/extending-nx/devkit-and-nx-plugins.md index 05ae31c471100..b783a4e70f15e 100644 --- a/docs/shared/devkit-and-nx-plugins.md +++ b/docs/shared/extending-nx/devkit-and-nx-plugins.md @@ -1,6 +1,6 @@ # Nx Plugins and Devkit -Nx is a VSCode of build tools. The core of Nx enables project and task graph creation and analysis, orchestration and +Nx is like the VSCode of build tools. The core of Nx enables project and task graph creation and analysis, orchestration and execution of tasks, computation caching, and code generation. [Nx plugins](#nx-plugins) extend this functionality and are built on top of the underlying [Nx Devkit](#nx-devkit). > Many organizations use Nx without any plugins. If you are mainly interested in making your workspace faster or enabling distributed task execution, then plugins aren't necessary. diff --git a/docs/shared/workspace/project-graph-plugins.md b/docs/shared/extending-nx/project-graph-plugins.md similarity index 100% rename from docs/shared/workspace/project-graph-plugins.md rename to docs/shared/extending-nx/project-graph-plugins.md diff --git a/docs/shared/generators/workspace-generators.md b/docs/shared/generators/workspace-generators.md index d20da47d72545..3d8d31b38ee95 100644 --- a/docs/shared/generators/workspace-generators.md +++ b/docs/shared/generators/workspace-generators.md @@ -1,3 +1,5 @@ +> In Nx 13.10, we introduced the ability to run generators from Nx plugins in the workspace they were created in. By using a "local" plugin, you can set the plugin as your workspace's default collection and get several other affordances that are not provided to workspace generators. This is the preferred method for "workspace generators", and existing generators will eventually be transitioned to use a local plugin. Check the [nx-plugin guide](/nx-plugin/overview) for information on creating a new plugin. + # Workspace Generators Workspace generators provide a way to automate many tasks you regularly perform as part of your development workflow. Whether it is scaffolding out components, features, or ensuring libraries are generated and structured in a certain way, generators help you standardize these tasks in a consistent, and predictable manner. Nx provides tooling around creating, and running custom generators from within your workspace. This guide shows you how to create, run, and customize workspace generators within your Nx workspace. diff --git a/docs/shared/nx-plugin.md b/docs/shared/nx-plugin.md index bd67b6f1e0927..73ca143e5e9f6 100644 --- a/docs/shared/nx-plugin.md +++ b/docs/shared/nx-plugin.md @@ -254,7 +254,7 @@ export default async function (tree: Tree, options: PresetGeneratorSchema) { To get an in-depth guide on customizing/running or debugging your generator see [workspace generators](https://nx.dev/generators/workspace-generators#running-a-workspace-generator). -### Usage +#### Usage Before you are able to use your newly created preset you must package and publish it to a registry. diff --git a/nx-dev/nx-dev/redirect-rules.config.js b/nx-dev/nx-dev/redirect-rules.config.js index 6a9169cca7ab1..4356ac67d4cd4 100644 --- a/nx-dev/nx-dev/redirect-rules.config.js +++ b/nx-dev/nx-dev/redirect-rules.config.js @@ -151,6 +151,8 @@ const guideUrls = { '/core-extended/affected': '/using-nx/affected', '/core-extended/computation-caching': '/using-nx/caching', '/guides/nextjs': '/next/overview', + '/using-nx/nx-devkit': '/extending-nx/nx-devkit', + '/structure/project-graph-plugins': '/extending-nx/project-graph-plugins', }; /**