docs(core): plugin section (#16314)
This commit is contained in:
parent
f0a1c33fb2
commit
258b6df8b6
@ -872,14 +872,6 @@
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Create Your Own Plugin",
|
||||
"path": "/plugin-features/create-your-own-plugin",
|
||||
"id": "create-your-own-plugin",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
@ -900,14 +892,6 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Create Your Own Plugin",
|
||||
"path": "/plugin-features/create-your-own-plugin",
|
||||
"id": "create-your-own-plugin",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Concepts",
|
||||
"path": "/concepts",
|
||||
@ -2450,22 +2434,6 @@
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Local Executors",
|
||||
"path": "/recipes/executors/creating-custom-executors",
|
||||
"id": "creating-custom-executors",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Compose Executors",
|
||||
"path": "/recipes/executors/compose-executors",
|
||||
"id": "compose-executors",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
@ -2486,200 +2454,6 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Local Executors",
|
||||
"path": "/recipes/executors/creating-custom-executors",
|
||||
"id": "creating-custom-executors",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Compose Executors",
|
||||
"path": "/recipes/executors/compose-executors",
|
||||
"id": "compose-executors",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Generators",
|
||||
"path": "/recipes/generators",
|
||||
"id": "generators",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Local Generators",
|
||||
"path": "/recipes/generators/local-generators",
|
||||
"id": "local-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Composing Generators",
|
||||
"path": "/recipes/generators/composing-generators",
|
||||
"id": "composing-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Generator Options",
|
||||
"path": "/recipes/generators/generator-options",
|
||||
"id": "generator-options",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Creating Files",
|
||||
"path": "/recipes/generators/creating-files",
|
||||
"id": "creating-files",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Modifying Files",
|
||||
"path": "/recipes/generators/modifying-files",
|
||||
"id": "modifying-files",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Local Generators",
|
||||
"path": "/recipes/generators/local-generators",
|
||||
"id": "local-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Composing Generators",
|
||||
"path": "/recipes/generators/composing-generators",
|
||||
"id": "composing-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Generator Options",
|
||||
"path": "/recipes/generators/generator-options",
|
||||
"id": "generator-options",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Creating Files",
|
||||
"path": "/recipes/generators/creating-files",
|
||||
"id": "creating-files",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Modifying Files",
|
||||
"path": "/recipes/generators/modifying-files",
|
||||
"id": "modifying-files",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Advanced Plugins",
|
||||
"path": "/recipes/advanced-plugins",
|
||||
"id": "advanced-plugins",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Share Your Plugin",
|
||||
"path": "/recipes/advanced-plugins/share-your-plugin",
|
||||
"id": "share-your-plugin",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Create a Preset",
|
||||
"path": "/recipes/advanced-plugins/create-preset",
|
||||
"id": "create-preset",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Migration Generators",
|
||||
"path": "/recipes/advanced-plugins/migration-generators",
|
||||
"id": "migration-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Project Graph Plugins",
|
||||
"path": "/recipes/advanced-plugins/project-graph-plugins",
|
||||
"id": "project-graph-plugins",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Project Inference Plugins",
|
||||
"path": "/recipes/advanced-plugins/project-inference-plugins",
|
||||
"id": "project-inference-plugins",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Share Your Plugin",
|
||||
"path": "/recipes/advanced-plugins/share-your-plugin",
|
||||
"id": "share-your-plugin",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Create a Preset",
|
||||
"path": "/recipes/advanced-plugins/create-preset",
|
||||
"id": "create-preset",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Migration Generators",
|
||||
"path": "/recipes/advanced-plugins/migration-generators",
|
||||
"id": "migration-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Project Graph Plugins",
|
||||
"path": "/recipes/advanced-plugins/project-graph-plugins",
|
||||
"id": "project-graph-plugins",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Project Inference Plugins",
|
||||
"path": "/recipes/advanced-plugins/project-inference-plugins",
|
||||
"id": "project-inference-plugins",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Environment Variables",
|
||||
"path": "/recipes/environment-variables",
|
||||
@ -3202,6 +2976,14 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Include Assets in Build",
|
||||
"path": "/recipes/other/include-assets-in-build",
|
||||
"id": "include-assets-in-build",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Identify Dependencies Between Folders",
|
||||
"path": "/recipes/other/identify-dependencies-between-folders",
|
||||
@ -3469,6 +3251,14 @@
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Include Assets in Build",
|
||||
"path": "/recipes/other/include-assets-in-build",
|
||||
"id": "include-assets-in-build",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Identify Dependencies Between Folders",
|
||||
"path": "/recipes/other/identify-dependencies-between-folders",
|
||||
@ -3495,6 +3285,278 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "plugins",
|
||||
"menu": [
|
||||
{
|
||||
"name": "Intro",
|
||||
"path": "/plugins/intro",
|
||||
"id": "intro",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Getting Started with Plugins",
|
||||
"path": "/plugins/intro/getting-started",
|
||||
"id": "getting-started",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Plugin Registry",
|
||||
"path": "/plugins/registry",
|
||||
"id": "registry",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Getting Started with Plugins",
|
||||
"path": "/plugins/intro/getting-started",
|
||||
"id": "getting-started",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Plugin Registry",
|
||||
"path": "/plugins/registry",
|
||||
"id": "registry",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "5 Min Tutorials",
|
||||
"path": "/plugins/tutorials",
|
||||
"id": "tutorials",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Create a Local Plugin",
|
||||
"path": "/plugins/tutorials/create-plugin",
|
||||
"id": "create-plugin",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Maintain a Published Plugin",
|
||||
"path": "/plugins/tutorials/publish-plugin",
|
||||
"id": "publish-plugin",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Create a Local Plugin",
|
||||
"path": "/plugins/tutorials/create-plugin",
|
||||
"id": "create-plugin",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Maintain a Published Plugin",
|
||||
"path": "/plugins/tutorials/publish-plugin",
|
||||
"id": "publish-plugin",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Recipes",
|
||||
"path": "/plugins/recipes",
|
||||
"id": "recipes",
|
||||
"isExternal": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "Write a Simple Executor",
|
||||
"path": "/plugins/recipes/local-executors",
|
||||
"id": "local-executors",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Compose Executors",
|
||||
"path": "/plugins/recipes/compose-executors",
|
||||
"id": "compose-executors",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Write a Simple Generator",
|
||||
"path": "/plugins/recipes/local-generators",
|
||||
"id": "local-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Compose Generators",
|
||||
"path": "/plugins/recipes/composing-generators",
|
||||
"id": "composing-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Provide Options for Generators",
|
||||
"path": "/plugins/recipes/generator-options",
|
||||
"id": "generator-options",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Create Files",
|
||||
"path": "/plugins/recipes/creating-files",
|
||||
"id": "creating-files",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Modify Files",
|
||||
"path": "/plugins/recipes/modifying-files",
|
||||
"id": "modifying-files",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Write a Migration",
|
||||
"path": "/plugins/recipes/migration-generators",
|
||||
"id": "migration-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Create a Preset",
|
||||
"path": "/plugins/recipes/create-preset",
|
||||
"id": "create-preset",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Modify the Project Graph",
|
||||
"path": "/plugins/recipes/project-graph-plugins",
|
||||
"id": "project-graph-plugins",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Identify Custom Projects",
|
||||
"path": "/plugins/recipes/project-inference-plugins",
|
||||
"id": "project-inference-plugins",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Write a Simple Executor",
|
||||
"path": "/plugins/recipes/local-executors",
|
||||
"id": "local-executors",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Compose Executors",
|
||||
"path": "/plugins/recipes/compose-executors",
|
||||
"id": "compose-executors",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Write a Simple Generator",
|
||||
"path": "/plugins/recipes/local-generators",
|
||||
"id": "local-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Compose Generators",
|
||||
"path": "/plugins/recipes/composing-generators",
|
||||
"id": "composing-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Provide Options for Generators",
|
||||
"path": "/plugins/recipes/generator-options",
|
||||
"id": "generator-options",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Create Files",
|
||||
"path": "/plugins/recipes/creating-files",
|
||||
"id": "creating-files",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Modify Files",
|
||||
"path": "/plugins/recipes/modifying-files",
|
||||
"id": "modifying-files",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Write a Migration",
|
||||
"path": "/plugins/recipes/migration-generators",
|
||||
"id": "migration-generators",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Create a Preset",
|
||||
"path": "/plugins/recipes/create-preset",
|
||||
"id": "create-preset",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Modify the Project Graph",
|
||||
"path": "/plugins/recipes/project-graph-plugins",
|
||||
"id": "project-graph-plugins",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"name": "Identify Custom Projects",
|
||||
"path": "/plugins/recipes/project-inference-plugins",
|
||||
"id": "project-inference-plugins",
|
||||
"isExternal": false,
|
||||
"children": [],
|
||||
"disableCollapsible": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "cloud",
|
||||
"menu": [
|
||||
|
||||
@ -1083,16 +1083,6 @@
|
||||
"isExternal": false,
|
||||
"path": "/plugin-features/use-code-generators",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
{
|
||||
"id": "create-your-own-plugin",
|
||||
"name": "Create Your Own Plugin",
|
||||
"description": "",
|
||||
"file": "shared/plugin-features/create-your-own-plugin",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugin-features/create-your-own-plugin",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
@ -1119,16 +1109,6 @@
|
||||
"path": "/plugin-features/use-code-generators",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
"/plugin-features/create-your-own-plugin": {
|
||||
"id": "create-your-own-plugin",
|
||||
"name": "Create Your Own Plugin",
|
||||
"description": "",
|
||||
"file": "shared/plugin-features/create-your-own-plugin",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugin-features/create-your-own-plugin",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
"/concepts": {
|
||||
"id": "concepts",
|
||||
"name": "Concepts",
|
||||
|
||||
335
docs/generated/manifests/plugins.json
Normal file
335
docs/generated/manifests/plugins.json
Normal file
@ -0,0 +1,335 @@
|
||||
{
|
||||
"/plugins/intro": {
|
||||
"id": "intro",
|
||||
"name": "Intro",
|
||||
"description": "Learn about plugins.",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "getting-started",
|
||||
"name": "Getting Started with Plugins",
|
||||
"description": "Learn how to extend Nx by creating and releasing your own Nx plugin.",
|
||||
"file": "shared/plugins/intro",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/intro/getting-started",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "registry",
|
||||
"name": "Plugin Registry",
|
||||
"description": "Browse official and community plugins",
|
||||
"file": "",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/registry",
|
||||
"tags": []
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/intro",
|
||||
"tags": []
|
||||
},
|
||||
"/plugins/intro/getting-started": {
|
||||
"id": "getting-started",
|
||||
"name": "Getting Started with Plugins",
|
||||
"description": "Learn how to extend Nx by creating and releasing your own Nx plugin.",
|
||||
"file": "shared/plugins/intro",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/intro/getting-started",
|
||||
"tags": []
|
||||
},
|
||||
"/plugins/registry": {
|
||||
"id": "registry",
|
||||
"name": "Plugin Registry",
|
||||
"description": "Browse official and community plugins",
|
||||
"file": "",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/registry",
|
||||
"tags": []
|
||||
},
|
||||
"/plugins/tutorials": {
|
||||
"id": "tutorials",
|
||||
"name": "5 Min Tutorials",
|
||||
"description": "Get started with plugins",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "create-plugin",
|
||||
"name": "Create a Local Plugin",
|
||||
"description": "",
|
||||
"file": "shared/plugins/create-plugin",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/tutorials/create-plugin",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "publish-plugin",
|
||||
"name": "Maintain a Published Plugin",
|
||||
"description": "",
|
||||
"file": "shared/plugins/maintain-published-plugin",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/tutorials/publish-plugin",
|
||||
"tags": []
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/tutorials",
|
||||
"tags": []
|
||||
},
|
||||
"/plugins/tutorials/create-plugin": {
|
||||
"id": "create-plugin",
|
||||
"name": "Create a Local Plugin",
|
||||
"description": "",
|
||||
"file": "shared/plugins/create-plugin",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/tutorials/create-plugin",
|
||||
"tags": []
|
||||
},
|
||||
"/plugins/tutorials/publish-plugin": {
|
||||
"id": "publish-plugin",
|
||||
"name": "Maintain a Published Plugin",
|
||||
"description": "",
|
||||
"file": "shared/plugins/maintain-published-plugin",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/tutorials/publish-plugin",
|
||||
"tags": []
|
||||
},
|
||||
"/plugins/recipes": {
|
||||
"id": "recipes",
|
||||
"name": "Recipes",
|
||||
"description": "Focused instructions to complete a specific task",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "local-executors",
|
||||
"name": "Write a Simple Executor",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/local-executors",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/local-executors",
|
||||
"tags": ["use-task-executors"]
|
||||
},
|
||||
{
|
||||
"id": "compose-executors",
|
||||
"name": "Compose Executors",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/compose-executors",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/compose-executors",
|
||||
"tags": ["use-task-executors"]
|
||||
},
|
||||
{
|
||||
"id": "local-generators",
|
||||
"name": "Write a Simple Generator",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/local-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/local-generators",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
{
|
||||
"id": "composing-generators",
|
||||
"name": "Compose Generators",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/composing-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/composing-generators",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
{
|
||||
"id": "generator-options",
|
||||
"name": "Provide Options for Generators",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/generator-options",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/generator-options",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
{
|
||||
"id": "creating-files",
|
||||
"name": "Create Files",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/creating-files",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/creating-files",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
{
|
||||
"id": "modifying-files",
|
||||
"name": "Modify Files",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/modifying-files",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/modifying-files",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
{
|
||||
"id": "migration-generators",
|
||||
"name": "Write a Migration",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/migration-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/migration-generators",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
{
|
||||
"id": "create-preset",
|
||||
"name": "Create a Preset",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/create-preset",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/create-preset",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
{
|
||||
"id": "project-graph-plugins",
|
||||
"name": "Modify the Project Graph",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-graph-plugins",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/project-graph-plugins",
|
||||
"tags": ["create-your-own-plugin", "explore-graph"]
|
||||
},
|
||||
{
|
||||
"id": "project-inference-plugins",
|
||||
"name": "Identify Custom Projects",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-inference-plugins",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/project-inference-plugins",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes",
|
||||
"tags": []
|
||||
},
|
||||
"/plugins/recipes/local-executors": {
|
||||
"id": "local-executors",
|
||||
"name": "Write a Simple Executor",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/local-executors",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/local-executors",
|
||||
"tags": ["use-task-executors"]
|
||||
},
|
||||
"/plugins/recipes/compose-executors": {
|
||||
"id": "compose-executors",
|
||||
"name": "Compose Executors",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/compose-executors",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/compose-executors",
|
||||
"tags": ["use-task-executors"]
|
||||
},
|
||||
"/plugins/recipes/local-generators": {
|
||||
"id": "local-generators",
|
||||
"name": "Write a Simple Generator",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/local-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/local-generators",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
"/plugins/recipes/composing-generators": {
|
||||
"id": "composing-generators",
|
||||
"name": "Compose Generators",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/composing-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/composing-generators",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
"/plugins/recipes/generator-options": {
|
||||
"id": "generator-options",
|
||||
"name": "Provide Options for Generators",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/generator-options",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/generator-options",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
"/plugins/recipes/creating-files": {
|
||||
"id": "creating-files",
|
||||
"name": "Create Files",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/creating-files",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/creating-files",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
"/plugins/recipes/modifying-files": {
|
||||
"id": "modifying-files",
|
||||
"name": "Modify Files",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/modifying-files",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/modifying-files",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
"/plugins/recipes/migration-generators": {
|
||||
"id": "migration-generators",
|
||||
"name": "Write a Migration",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/migration-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/migration-generators",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
"/plugins/recipes/create-preset": {
|
||||
"id": "create-preset",
|
||||
"name": "Create a Preset",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/create-preset",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/create-preset",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
"/plugins/recipes/project-graph-plugins": {
|
||||
"id": "project-graph-plugins",
|
||||
"name": "Modify the Project Graph",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-graph-plugins",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/project-graph-plugins",
|
||||
"tags": ["create-your-own-plugin", "explore-graph"]
|
||||
},
|
||||
"/plugins/recipes/project-inference-plugins": {
|
||||
"id": "project-inference-plugins",
|
||||
"name": "Identify Custom Projects",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-inference-plugins",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/plugins/recipes/project-inference-plugins",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
}
|
||||
}
|
||||
@ -639,26 +639,6 @@
|
||||
"isExternal": false,
|
||||
"path": "/recipes/executors/run-commands-executor",
|
||||
"tags": ["use-task-executors"]
|
||||
},
|
||||
{
|
||||
"id": "creating-custom-executors",
|
||||
"name": "Local Executors",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/local-executors",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/executors/creating-custom-executors",
|
||||
"tags": ["use-task-executors", "create-your-own-plugin"]
|
||||
},
|
||||
{
|
||||
"id": "compose-executors",
|
||||
"name": "Compose Executors",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/compose-executors",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/executors/compose-executors",
|
||||
"tags": ["use-task-executors"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
@ -685,248 +665,6 @@
|
||||
"path": "/recipes/executors/run-commands-executor",
|
||||
"tags": ["use-task-executors"]
|
||||
},
|
||||
"/recipes/executors/creating-custom-executors": {
|
||||
"id": "creating-custom-executors",
|
||||
"name": "Local Executors",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/local-executors",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/executors/creating-custom-executors",
|
||||
"tags": ["use-task-executors", "create-your-own-plugin"]
|
||||
},
|
||||
"/recipes/executors/compose-executors": {
|
||||
"id": "compose-executors",
|
||||
"name": "Compose Executors",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/compose-executors",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/executors/compose-executors",
|
||||
"tags": ["use-task-executors"]
|
||||
},
|
||||
"/recipes/generators": {
|
||||
"id": "generators",
|
||||
"name": "Generators",
|
||||
"description": "Use, extend and compose generators.",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "local-generators",
|
||||
"name": "Local Generators",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/local-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators/local-generators",
|
||||
"tags": ["use-code-generators", "create-your-own-plugin"]
|
||||
},
|
||||
{
|
||||
"id": "composing-generators",
|
||||
"name": "Composing Generators",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/composing-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators/composing-generators",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
{
|
||||
"id": "generator-options",
|
||||
"name": "Generator Options",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/generator-options",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators/generator-options",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
{
|
||||
"id": "creating-files",
|
||||
"name": "Creating Files",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/creating-files",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators/creating-files",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
{
|
||||
"id": "modifying-files",
|
||||
"name": "Modifying Files",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/modifying-files",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators/modifying-files",
|
||||
"tags": ["use-code-generators"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators",
|
||||
"tags": []
|
||||
},
|
||||
"/recipes/generators/local-generators": {
|
||||
"id": "local-generators",
|
||||
"name": "Local Generators",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/local-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators/local-generators",
|
||||
"tags": ["use-code-generators", "create-your-own-plugin"]
|
||||
},
|
||||
"/recipes/generators/composing-generators": {
|
||||
"id": "composing-generators",
|
||||
"name": "Composing Generators",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/composing-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators/composing-generators",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
"/recipes/generators/generator-options": {
|
||||
"id": "generator-options",
|
||||
"name": "Generator Options",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/generator-options",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators/generator-options",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
"/recipes/generators/creating-files": {
|
||||
"id": "creating-files",
|
||||
"name": "Creating Files",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/creating-files",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators/creating-files",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
"/recipes/generators/modifying-files": {
|
||||
"id": "modifying-files",
|
||||
"name": "Modifying Files",
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/modifying-files",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/generators/modifying-files",
|
||||
"tags": ["use-code-generators"]
|
||||
},
|
||||
"/recipes/advanced-plugins": {
|
||||
"id": "advanced-plugins",
|
||||
"name": "Advanced Plugins",
|
||||
"description": "Learn more about creating your own plugin, extending Nx.",
|
||||
"file": "",
|
||||
"itemList": [
|
||||
{
|
||||
"id": "share-your-plugin",
|
||||
"name": "Share Your Plugin",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/share-your-plugin",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins/share-your-plugin",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
{
|
||||
"id": "create-preset",
|
||||
"name": "Create a Preset",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/create-preset",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins/create-preset",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
{
|
||||
"id": "migration-generators",
|
||||
"name": "Migration Generators",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/migration-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins/migration-generators",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
{
|
||||
"id": "project-graph-plugins",
|
||||
"name": "Project Graph Plugins",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-graph-plugins",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins/project-graph-plugins",
|
||||
"tags": ["create-your-own-plugin", "explore-graph"]
|
||||
},
|
||||
{
|
||||
"id": "project-inference-plugins",
|
||||
"name": "Project Inference Plugins",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-inference-plugins",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins/project-inference-plugins",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins",
|
||||
"tags": []
|
||||
},
|
||||
"/recipes/advanced-plugins/share-your-plugin": {
|
||||
"id": "share-your-plugin",
|
||||
"name": "Share Your Plugin",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/share-your-plugin",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins/share-your-plugin",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
"/recipes/advanced-plugins/create-preset": {
|
||||
"id": "create-preset",
|
||||
"name": "Create a Preset",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/create-preset",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins/create-preset",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
"/recipes/advanced-plugins/migration-generators": {
|
||||
"id": "migration-generators",
|
||||
"name": "Migration Generators",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/migration-generators",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins/migration-generators",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
"/recipes/advanced-plugins/project-graph-plugins": {
|
||||
"id": "project-graph-plugins",
|
||||
"name": "Project Graph Plugins",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-graph-plugins",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins/project-graph-plugins",
|
||||
"tags": ["create-your-own-plugin", "explore-graph"]
|
||||
},
|
||||
"/recipes/advanced-plugins/project-inference-plugins": {
|
||||
"id": "project-inference-plugins",
|
||||
"name": "Project Inference Plugins",
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-inference-plugins",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/advanced-plugins/project-inference-plugins",
|
||||
"tags": ["create-your-own-plugin"]
|
||||
},
|
||||
"/recipes/environment-variables": {
|
||||
"id": "environment-variables",
|
||||
"name": "Environment Variables",
|
||||
@ -1577,6 +1315,16 @@
|
||||
"path": "/recipes/other/include-all-packagejson",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "include-assets-in-build",
|
||||
"name": "Include Assets in Build",
|
||||
"description": "",
|
||||
"file": "shared/recipes/include-assets-in-build",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/other/include-assets-in-build",
|
||||
"tags": []
|
||||
},
|
||||
{
|
||||
"id": "identify-dependencies-between-folders",
|
||||
"name": "Identify Dependencies Between Folders",
|
||||
@ -1912,6 +1660,16 @@
|
||||
"path": "/recipes/other/include-all-packagejson",
|
||||
"tags": []
|
||||
},
|
||||
"/recipes/other/include-assets-in-build": {
|
||||
"id": "include-assets-in-build",
|
||||
"name": "Include Assets in Build",
|
||||
"description": "",
|
||||
"file": "shared/recipes/include-assets-in-build",
|
||||
"itemList": [],
|
||||
"isExternal": false,
|
||||
"path": "/recipes/other/include-assets-in-build",
|
||||
"tags": []
|
||||
},
|
||||
"/recipes/other/identify-dependencies-between-folders": {
|
||||
"id": "identify-dependencies-between-folders",
|
||||
"name": "Identify Dependencies Between Folders",
|
||||
|
||||
@ -160,13 +160,6 @@
|
||||
"name": "How the Project Graph is Built",
|
||||
"path": "/more-concepts/how-project-graph-is-built"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-graph-plugins",
|
||||
"id": "project-graph-plugins",
|
||||
"name": "Project Graph Plugins",
|
||||
"path": "/recipes/advanced-plugins/project-graph-plugins"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/analyze-source-files",
|
||||
@ -188,6 +181,13 @@
|
||||
"name": "Resolve Circular Dependencies",
|
||||
"path": "/recipes/other/resolve-circular-dependencies"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-graph-plugins",
|
||||
"id": "project-graph-plugins",
|
||||
"name": "Modify the Project Graph",
|
||||
"path": "/plugins/recipes/project-graph-plugins"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/generated/packages/nx/documents/dep-graph",
|
||||
@ -471,20 +471,6 @@
|
||||
"name": "Running Custom Commands",
|
||||
"path": "/recipes/executors/run-commands-executor"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/local-executors",
|
||||
"id": "creating-custom-executors",
|
||||
"name": "Local Executors",
|
||||
"path": "/recipes/executors/creating-custom-executors"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/compose-executors",
|
||||
"id": "compose-executors",
|
||||
"name": "Compose Executors",
|
||||
"path": "/recipes/executors/compose-executors"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/guides/module-federation/faster-builds",
|
||||
@ -513,6 +499,20 @@
|
||||
"name": "Profiling Build Performance",
|
||||
"path": "/recipes/other/performance-profiling"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/local-executors",
|
||||
"id": "local-executors",
|
||||
"name": "Write a Simple Executor",
|
||||
"path": "/plugins/recipes/local-executors"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/compose-executors",
|
||||
"id": "compose-executors",
|
||||
"name": "Compose Executors",
|
||||
"path": "/plugins/recipes/compose-executors"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
"file": "generated/packages/generated/packages/nx/documents/run",
|
||||
@ -561,36 +561,36 @@
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/local-generators",
|
||||
"id": "local-generators",
|
||||
"name": "Local Generators",
|
||||
"path": "/recipes/generators/local-generators"
|
||||
"name": "Write a Simple Generator",
|
||||
"path": "/plugins/recipes/local-generators"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/composing-generators",
|
||||
"id": "composing-generators",
|
||||
"name": "Composing Generators",
|
||||
"path": "/recipes/generators/composing-generators"
|
||||
"name": "Compose Generators",
|
||||
"path": "/plugins/recipes/composing-generators"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/generator-options",
|
||||
"id": "generator-options",
|
||||
"name": "Generator Options",
|
||||
"path": "/recipes/generators/generator-options"
|
||||
"name": "Provide Options for Generators",
|
||||
"path": "/plugins/recipes/generator-options"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/creating-files",
|
||||
"id": "creating-files",
|
||||
"name": "Creating Files",
|
||||
"path": "/recipes/generators/creating-files"
|
||||
"name": "Create Files",
|
||||
"path": "/plugins/recipes/creating-files"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/modifying-files",
|
||||
"id": "modifying-files",
|
||||
"name": "Modifying Files",
|
||||
"path": "/recipes/generators/modifying-files"
|
||||
"name": "Modify Files",
|
||||
"path": "/plugins/recipes/modifying-files"
|
||||
},
|
||||
{
|
||||
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
||||
@ -600,78 +600,6 @@
|
||||
"path": "/packages/nx/documents/generate"
|
||||
}
|
||||
],
|
||||
"create-your-own-plugin": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/plugin-features/create-your-own-plugin",
|
||||
"id": "create-your-own-plugin",
|
||||
"name": "Create Your Own Plugin",
|
||||
"path": "/plugin-features/create-your-own-plugin"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/guides/nx-devkit-angular-devkit",
|
||||
"id": "nx-devkit-angular-devkit",
|
||||
"name": "Nx Devkit and Angular Devkit",
|
||||
"path": "/more-concepts/nx-devkit-angular-devkit"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "",
|
||||
"id": "packages-devkit",
|
||||
"name": "Nx Devkit",
|
||||
"path": "/packages/devkit/documents/nx_devkit"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/local-executors",
|
||||
"id": "creating-custom-executors",
|
||||
"name": "Local Executors",
|
||||
"path": "/recipes/executors/creating-custom-executors"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/generators/local-generators",
|
||||
"id": "local-generators",
|
||||
"name": "Local Generators",
|
||||
"path": "/recipes/generators/local-generators"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/share-your-plugin",
|
||||
"id": "share-your-plugin",
|
||||
"name": "Share Your Plugin",
|
||||
"path": "/recipes/advanced-plugins/share-your-plugin"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/create-preset",
|
||||
"id": "create-preset",
|
||||
"name": "Create a Preset",
|
||||
"path": "/recipes/advanced-plugins/create-preset"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/migration-generators",
|
||||
"id": "migration-generators",
|
||||
"name": "Migration Generators",
|
||||
"path": "/recipes/advanced-plugins/migration-generators"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-graph-plugins",
|
||||
"id": "project-graph-plugins",
|
||||
"name": "Project Graph Plugins",
|
||||
"path": "/recipes/advanced-plugins/project-graph-plugins"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-inference-plugins",
|
||||
"id": "project-inference-plugins",
|
||||
"name": "Project Inference Plugins",
|
||||
"path": "/recipes/advanced-plugins/project-inference-plugins"
|
||||
}
|
||||
],
|
||||
"intro": [
|
||||
{
|
||||
"description": "",
|
||||
@ -688,6 +616,50 @@
|
||||
"path": "/concepts/mental-model"
|
||||
}
|
||||
],
|
||||
"create-your-own-plugin": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/guides/nx-devkit-angular-devkit",
|
||||
"id": "nx-devkit-angular-devkit",
|
||||
"name": "Nx Devkit and Angular Devkit",
|
||||
"path": "/more-concepts/nx-devkit-angular-devkit"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "",
|
||||
"id": "packages-devkit",
|
||||
"name": "Nx Devkit",
|
||||
"path": "/packages/devkit/documents/nx_devkit"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/migration-generators",
|
||||
"id": "migration-generators",
|
||||
"name": "Write a Migration",
|
||||
"path": "/plugins/recipes/migration-generators"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/create-preset",
|
||||
"id": "create-preset",
|
||||
"name": "Create a Preset",
|
||||
"path": "/plugins/recipes/create-preset"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-graph-plugins",
|
||||
"id": "project-graph-plugins",
|
||||
"name": "Modify the Project Graph",
|
||||
"path": "/plugins/recipes/project-graph-plugins"
|
||||
},
|
||||
{
|
||||
"description": "",
|
||||
"file": "shared/recipes/plugins/project-inference-plugins",
|
||||
"id": "project-inference-plugins",
|
||||
"name": "Identify Custom Projects",
|
||||
"path": "/plugins/recipes/project-inference-plugins"
|
||||
}
|
||||
],
|
||||
"environment-variables": [
|
||||
{
|
||||
"description": "",
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
}
|
||||
},
|
||||
"required": ["project"],
|
||||
"examplesFile": "{% callout type=\"caution\" title=\"Can I use component testing?\" %}\nNext component testing with Nx requires **Cypress version 10.7.0** and up.\n\nYou can migrate with to v10 via the [migrate-to-cypress-11 generator](/packages/cypress/generators/migrate-to-cypress-11).\n\nThis generator is for Cypress based component testing.\n\nIf you want to test components via Storybook with Cypress, then check out the [storybook-configuration generator docs](/packages/react/generators/storybook-configuration)\n{% /callout %}\n\nThis generator is designed to get your Next project up and running with Cypress Component Testing.\n\n```shell\nnx g @nrwl/next:cypress-component-configuration --project=my-cool-next-project\n```\n\nRunning this generator, adds the required files to the specified project with a preconfigured `cypress.config.ts` designed for Nx workspaces.\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nrwl/next/plugins/component-testing';\n\nexport default defineConfig({\n component: nxComponentTestingPreset(__filename),\n});\n```\n\nHere is an example on how to add custom options to the configuration\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nrwl/next/plugins/component-testing';\n\nexport default defineConfig({\n component: {\n ...nxComponentTestingPreset(__filename),\n // extra options here\n },\n});\n```\n\n```shell\nnx g @nrwl/next:cypress-component-project --project=my-cool-next-project\n```\n\n## Auto Generating Tests\n\nYou can optionally use the `--generate-tests` flag to generate a test file for each component in your project.\n\n```shell\nnx g @nrwl/next:cypress-component-configuration --project=my-cool-next-project --generate-tests\n```\n\n## Running Component Tests\n\nA new `component-test` target will be added to the specified project to run your component tests.\n\n```shell\nnx g component-test my-cool-next-project\n```\n\nHere is an example of the project configuration that is generated.\n\n```json {% fileName=\"project.json\" %}\n{\n \"targets\" {\n \"component-test\": {\n \"executor\": \"@nrwl/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"<path-to-project-root>/cypress.config.ts\",\n \"testingType\": \"component\",\n \"skipServe\": true\n }\n }\n }\n}\n```\n\nNx also supports [Angular component testing](/packages/angular/generators/cypress-component-configuration).\n",
|
||||
"examplesFile": "{% callout type=\"caution\" title=\"Can I use component testing?\" %}\nNext component testing with Nx requires **Cypress version 10.7.0** and up.\n\nYou can migrate with to v10 via the [migrate-to-cypress-11 generator](/packages/cypress/generators/migrate-to-cypress-11).\n\nThis generator is for Cypress based component testing.\n\nIf you want to test components via Storybook with Cypress, then check out the [storybook-configuration generator docs](/packages/react/generators/storybook-configuration)\n{% /callout %}\n\nThis generator is designed to get your Next project up and running with Cypress Component Testing.\n\n```shell\nnx g @nx/next:cypress-component-configuration --project=my-cool-next-project\n```\n\nRunning this generator, adds the required files to the specified project with a preconfigured `cypress.config.ts` designed for Nx workspaces.\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nx/next/plugins/component-testing';\n\nexport default defineConfig({\n component: nxComponentTestingPreset(__filename),\n});\n```\n\nHere is an example on how to add custom options to the configuration\n\n```ts {% fileName=\"cypress.config.ts\" %}\nimport { defineConfig } from 'cypress';\nimport { nxComponentTestingPreset } from '@nx/next/plugins/component-testing';\n\nexport default defineConfig({\n component: {\n ...nxComponentTestingPreset(__filename),\n // extra options here\n },\n});\n```\n\n```shell\nnx g @nx/next:cypress-component-project --project=my-cool-next-project\n```\n\n## Auto Generating Tests\n\nYou can optionally use the `--generate-tests` flag to generate a test file for each component in your project.\n\n```shell\nnx g @nx/next:cypress-component-configuration --project=my-cool-next-project --generate-tests\n```\n\n## Running Component Tests\n\nA new `component-test` target will be added to the specified project to run your component tests.\n\n```shell\nnx g component-test my-cool-next-project\n```\n\nHere is an example of the project configuration that is generated.\n\n```json {% fileName=\"project.json\" %}\n{\n \"targets\" {\n \"component-test\": {\n \"executor\": \"@nx/cypress:cypress\",\n \"options\": {\n \"cypressConfig\": \"<path-to-project-root>/cypress.config.ts\",\n \"testingType\": \"component\",\n \"skipServe\": true\n }\n }\n }\n}\n```\n\nNx also supports [Angular component testing](/packages/angular/generators/cypress-component-configuration).\n",
|
||||
"presets": []
|
||||
},
|
||||
"description": "cypress-component-configuration generator",
|
||||
|
||||
@ -1,163 +1,5 @@
|
||||
Nx plugins are npm packages that contain [generators](/plugin-features/use-code-generators) and [executors](/plugin-features/use-task-executors) to extend a Nx workspace.
|
||||
|
||||
At its core, a generator is a function that creates or modifies code and an executor is a function that processes code. Nx makes it easier to call those functions from the terminal or through the [Nx Console UI](/core-features/integrate-with-editors). And you can use helper utils in the [Nx Devkit](/packages/devkit) to help build your generator or executor.
|
||||
This package contains tooling to help plugin authors create and maintain plugins.
|
||||
|
||||
> A list of plugins that is maintained by Nrwl is found in the [Nrwl/nx repo](https://github.com/nrwl/nx/tree/master/packages). \
|
||||
> A list of custom plugins created by the community is found in the [Community](/community) section.
|
||||
> Plugins are written using Nx Devkit. **Read [Nx Devkit](/packages/devkit/documents/nx_devkit) for more information.**
|
||||
|
||||
{% youtube
|
||||
src="https://www.youtube.com/embed/fC1-4fAZDP4"
|
||||
title="Nx Tutorial: Building Custom Plugins for Nx"
|
||||
width="100%" /%}
|
||||
|
||||
> For a detailed video explaining the things covered here and more, check out [Creating and Publishing Your Own Nx Plugin](https://www.youtube.com/watch?v=vVT7Al01VZc).
|
||||
|
||||
## Generating a Plugin
|
||||
|
||||
To get started with building a Nx Plugin, run the following command:
|
||||
|
||||
```shell
|
||||
npx create-nx-plugin my-org --pluginName my-plugin
|
||||
```
|
||||
|
||||
This command creates a brand-new workspace, and sets up a pre-configured plugin with the specified name.
|
||||
|
||||
> Note, the command above will create a plugin with the package name set to `@my-org/my-plugin`. You can pass `--importPath` to provide a different package name.
|
||||
|
||||
> If you do not want to create a new workspace, install the `@nx/plugin` dependency in an already existing workspace with npm or yarn. Then run `nx g @nx/plugin:plugin [pluginName]`.
|
||||
|
||||
A new plugin is created with a default generator, executor, and e2e app.
|
||||
|
||||
## Generator
|
||||
|
||||
The created generator contains boilerplate that will do the following:
|
||||
|
||||
- Normalize a schema (the options that the generator accepts)
|
||||
- Update the `project.json`
|
||||
- Add the plugin's project to the `nx.json` file
|
||||
- Add files to the disk using templates
|
||||
|
||||
There will be an exported default function that will be the main entry for the generator.
|
||||
|
||||
### Generator options
|
||||
|
||||
The `schema.d.ts` file contains all the options that the generator supports. By default, it includes `directory`, `tags`, and `name` as the options. If more options need to be added, please update this file and the `schema.json` file.
|
||||
|
||||
{% callout type="note" title="More details" %}
|
||||
The `schema.d.ts` file is used for type checking inside the implementation file. It should match the properties in `schema.json`.
|
||||
{% /callout %}
|
||||
|
||||
### Adding more generators
|
||||
|
||||
To add more generators to the plugin, run the following command:
|
||||
`nx generate @nx/plugin:generator [generatorName] --project=[pluginName]`.
|
||||
|
||||
This will scaffold out a new generator and update the necessary files to support it.
|
||||
|
||||
### Generator Testing
|
||||
|
||||
The generator spec file includes boilerplate to help get started with testing. This includes setting up an empty workspace.
|
||||
|
||||
These tests should ensure that files within the tree (created with `createTreeWithEmptyWorkspace`) are in the correct place, and contain the right content.
|
||||
|
||||
Full E2Es are supported (and recommended) and will run everything on the file system like a user would.
|
||||
|
||||
## Executor
|
||||
|
||||
The default executor is set up to just emit a console log. Some examples of what an executor can do are:
|
||||
|
||||
- Support different languages, (Java, Go, Python, C#)
|
||||
- Compile new UI framework components
|
||||
- Deploy an app on a CDN
|
||||
- Publish to NPM
|
||||
- and many more!
|
||||
|
||||
### Adding more executors
|
||||
|
||||
To add more executors to the plugin, run the following command:
|
||||
`nx generate @nx/plugin:executor [executor] --project=[pluginName]`.
|
||||
|
||||
This will scaffold out a new generator and update the necessary files to support it.
|
||||
|
||||
### Executor testing
|
||||
|
||||
The executor spec file contains boilerplate to run the default exported function from the executor.
|
||||
|
||||
These tests should make sure that the executor is executing and calling the functions that it relies on.
|
||||
|
||||
Full E2Es are supported (and recommended) and will run everything on the file system like a user would.
|
||||
|
||||
## Testing your plugin
|
||||
|
||||
One of the biggest benefits that the Nx Plugin package provides is support for E2E and unit testing.
|
||||
|
||||
When the E2E app runs, a temporary E2E directory is created in the root of the workspace. This directory is a blank Nx workspace, and will have the plugin's built package installed locally.
|
||||
|
||||
### E2E Testing file
|
||||
|
||||
When the plugin is generated, a test file is created in the `my-plugin-e2e` app. Inside this test file, there are already tests for making sure that the executor ran, checking if directories are created with the `--directory` option, and checking if tags are added to the project configuration.
|
||||
|
||||
We'll go over a few parts of a test file below:
|
||||
|
||||
```typescript
|
||||
it('should create my-plugin', async (done) => {
|
||||
const plugin = uniq('my-plugin');
|
||||
ensureNxProject('@my-org/my-plugin', 'dist/packages/my-plugin');
|
||||
await runNxCommandAsync(`generate @my-org/my-plugin:myPlugin ${plugin}`);
|
||||
|
||||
const result = await runNxCommandAsync(`build ${plugin}`);
|
||||
expect(result.stdout).toContain('Executor ran');
|
||||
|
||||
done();
|
||||
});
|
||||
```
|
||||
|
||||
- The `uniq` function creates a random name with the prefix and a random number.
|
||||
- The `ensureNxProject` is the function that will create the temporary directory. It takes two arguments, the plugin package name and the dist directory of when it's built.
|
||||
- The `runNxCommandAsync` will execute a `nx` command in the E2E directory.
|
||||
|
||||
There are additional functions that the `@nx/plugin/testing` package exports. Most of them are file utilities to manipulate and read files in the E2E directory.
|
||||
|
||||
## Including Assets
|
||||
|
||||
Sometimes you might want to include some assets with the plugin. This might be a image or some additional binaries.
|
||||
|
||||
To make sure that assets are copied to the dist folder, open the plugin's `project.json` file. Inside the `build` property, add additional assets. By default, all `.md` files in the root, all non-ts files in folders, and the `generators.json` and `executors.json` files are included.
|
||||
|
||||
```jsonc {% fileName="project.json" %}
|
||||
"build": {
|
||||
"executor": "@nx/node:package",
|
||||
"options": {
|
||||
// shortened...
|
||||
"assets": [
|
||||
"packages/my-plugin/*.md",
|
||||
{
|
||||
"input": "./packages/my-plugin/src",
|
||||
"glob": "**/*.!(ts)",
|
||||
"output": "./src"
|
||||
},
|
||||
{
|
||||
"input": "./packages/my-plugin",
|
||||
"glob": "generators.json",
|
||||
"output": "."
|
||||
},
|
||||
{
|
||||
"input": "./packages/my-plugin",
|
||||
"glob": "executors.json",
|
||||
"output": "."
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Using your Nx Plugin
|
||||
|
||||
To use your plugin, simply list it in `nx.json` or use its generators and executors as you would for any other plugin. This could look like `nx g @my-org/my-plugin:lib` for generators or `"executor": "@my-org/my-plugin:build"` for executors. It should be usable in all of the same ways as published plugins in your local workspace immediately after generating it. This includes setting it up as the default collection in `nx.json`, which would allow you to run `nx g lib` and hit your plugin's generator.
|
||||
|
||||
{% callout type="warning" title="string" %}
|
||||
|
||||
Nx uses the paths from tsconfig.base.json when running plugins locally, but uses the recommended tsconfig for node 16 for other compiler options. See https://github.com/tsconfig/bases/blob/main/bases/node16.json
|
||||
|
||||
{% /callout %}
|
||||
For more information, see the [plugins](/plugins/intro/getting-started) section of docs.
|
||||
|
||||
@ -71,7 +71,7 @@ Choosing one of these frameworks will have the following effects on your workspa
|
||||
|
||||
4. Nx will generate a new Cypress e2e app for your project (if there isn't one already) to run against the Storybook instance.
|
||||
|
||||
Make sure to **use the framework-specific generators** if your project is using Angular, React, Next.js or React Native: [`@nrwl/angular:storybook-configuration`](/packages/angular/generators/storybook-configuration), [`@nrwl/react:storybook-configuration`](/packages/react/generators/storybook-configuration), [`@nrwl/react-native:storybook-configuration`](/packages/react-native/generators/storybook-configuration):
|
||||
Make sure to **use the framework-specific generators** if your project is using Angular, React, Next.js or React Native: [`@nx/angular:storybook-configuration`](/packages/angular/generators/storybook-configuration), [`@nx/react:storybook-configuration`](/packages/react/generators/storybook-configuration), [`@nx/react-native:storybook-configuration`](/packages/react-native/generators/storybook-configuration):
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="Angular" %}
|
||||
|
||||
@ -4,7 +4,7 @@ The workspace plugin contains executors and generators that are useful for any N
|
||||
|
||||
Codifying your organization's best practices into local generators is a great way to ensure that the best practices are easy to follow and implement. Running `nx g @nx/plugin:plugin feature` will create a local plugin with a generator which is written the same way generators are written for Nx plugins.
|
||||
|
||||
> See more about [local generators](/recipes/generators/local-generators)
|
||||
> See more about [local generators](/plugins/recipes/local-generators)
|
||||
|
||||
## Reorganizing Projects
|
||||
|
||||
|
||||
216
docs/map.json
216
docs/map.json
@ -335,12 +335,6 @@
|
||||
"id": "use-code-generators",
|
||||
"tags": ["use-code-generators"],
|
||||
"file": "shared/plugin-features/use-code-generators"
|
||||
},
|
||||
{
|
||||
"name": "Create Your Own Plugin",
|
||||
"id": "create-your-own-plugin",
|
||||
"tags": ["create-your-own-plugin"],
|
||||
"file": "shared/plugin-features/create-your-own-plugin"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -745,6 +739,124 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Plugins",
|
||||
"id": "plugins",
|
||||
"description": "Learn more about creating your own plugin, extending Nx.",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Intro",
|
||||
"id": "intro",
|
||||
"description": "Learn about plugins.",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Getting Started with Plugins",
|
||||
"id": "getting-started",
|
||||
"description": "Learn how to extend Nx by creating and releasing your own Nx plugin.",
|
||||
"file": "shared/plugins/intro"
|
||||
},
|
||||
{
|
||||
"name": "Plugin Registry",
|
||||
"description": "Browse official and community plugins",
|
||||
"id": "registry",
|
||||
"file": "",
|
||||
"path": "/plugins/registry",
|
||||
"isExternal": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "5 Min Tutorials",
|
||||
"id": "tutorials",
|
||||
"description": "Get started with plugins",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Create a Local Plugin",
|
||||
"id": "create-plugin",
|
||||
"file": "shared/plugins/create-plugin"
|
||||
},
|
||||
{
|
||||
"name": "Maintain a Published Plugin",
|
||||
"id": "publish-plugin",
|
||||
"file": "shared/plugins/maintain-published-plugin"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Recipes",
|
||||
"id": "recipes",
|
||||
"description": "Focused instructions to complete a specific task",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Write a Simple Executor",
|
||||
"id": "local-executors",
|
||||
"tags": ["use-task-executors"],
|
||||
"file": "shared/recipes/plugins/local-executors"
|
||||
},
|
||||
{
|
||||
"name": "Compose Executors",
|
||||
"id": "compose-executors",
|
||||
"tags": ["use-task-executors"],
|
||||
"file": "shared/recipes/plugins/compose-executors"
|
||||
},
|
||||
{
|
||||
"name": "Write a Simple Generator",
|
||||
"id": "local-generators",
|
||||
"tags": ["use-code-generators"],
|
||||
"file": "shared/recipes/generators/local-generators"
|
||||
},
|
||||
{
|
||||
"name": "Compose Generators",
|
||||
"id": "composing-generators",
|
||||
"tags": ["use-code-generators"],
|
||||
"file": "shared/recipes/generators/composing-generators"
|
||||
},
|
||||
{
|
||||
"name": "Provide Options for Generators",
|
||||
"id": "generator-options",
|
||||
"tags": ["use-code-generators"],
|
||||
"file": "shared/recipes/generators/generator-options"
|
||||
},
|
||||
{
|
||||
"name": "Create Files",
|
||||
"id": "creating-files",
|
||||
"tags": ["use-code-generators"],
|
||||
"file": "shared/recipes/generators/creating-files"
|
||||
},
|
||||
{
|
||||
"name": "Modify Files",
|
||||
"id": "modifying-files",
|
||||
"tags": ["use-code-generators"],
|
||||
"file": "shared/recipes/generators/modifying-files"
|
||||
},
|
||||
{
|
||||
"name": "Write a Migration",
|
||||
"id": "migration-generators",
|
||||
"tags": ["create-your-own-plugin"],
|
||||
"file": "shared/recipes/plugins/migration-generators"
|
||||
},
|
||||
{
|
||||
"name": "Create a Preset",
|
||||
"id": "create-preset",
|
||||
"tags": ["create-your-own-plugin"],
|
||||
"file": "shared/recipes/plugins/create-preset"
|
||||
},
|
||||
{
|
||||
"name": "Modify the Project Graph",
|
||||
"id": "project-graph-plugins",
|
||||
"tags": ["create-your-own-plugin", "explore-graph"],
|
||||
"file": "shared/recipes/plugins/project-graph-plugins"
|
||||
},
|
||||
{
|
||||
"name": "Identify Custom Projects",
|
||||
"id": "project-inference-plugins",
|
||||
"tags": ["create-your-own-plugin"],
|
||||
"file": "shared/recipes/plugins/project-inference-plugins"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Nx Recipes",
|
||||
"id": "nx-recipes",
|
||||
@ -950,92 +1062,6 @@
|
||||
"id": "run-commands-executor",
|
||||
"tags": ["use-task-executors"],
|
||||
"file": "shared/running-custom-commands"
|
||||
},
|
||||
{
|
||||
"name": "Local Executors",
|
||||
"id": "creating-custom-executors",
|
||||
"tags": ["use-task-executors", "create-your-own-plugin"],
|
||||
"file": "shared/recipes/plugins/local-executors"
|
||||
},
|
||||
{
|
||||
"name": "Compose Executors",
|
||||
"id": "compose-executors",
|
||||
"tags": ["use-task-executors"],
|
||||
"file": "shared/recipes/plugins/compose-executors"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Generators",
|
||||
"id": "generators",
|
||||
"description": "Use, extend and compose generators.",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Local Generators",
|
||||
"id": "local-generators",
|
||||
"tags": ["use-code-generators", "create-your-own-plugin"],
|
||||
"file": "shared/recipes/generators/local-generators"
|
||||
},
|
||||
{
|
||||
"name": "Composing Generators",
|
||||
"id": "composing-generators",
|
||||
"tags": ["use-code-generators"],
|
||||
"file": "shared/recipes/generators/composing-generators"
|
||||
},
|
||||
{
|
||||
"name": "Generator Options",
|
||||
"id": "generator-options",
|
||||
"tags": ["use-code-generators"],
|
||||
"file": "shared/recipes/generators/generator-options"
|
||||
},
|
||||
{
|
||||
"name": "Creating Files",
|
||||
"id": "creating-files",
|
||||
"tags": ["use-code-generators"],
|
||||
"file": "shared/recipes/generators/creating-files"
|
||||
},
|
||||
{
|
||||
"name": "Modifying Files",
|
||||
"id": "modifying-files",
|
||||
"tags": ["use-code-generators"],
|
||||
"file": "shared/recipes/generators/modifying-files"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Advanced Plugins",
|
||||
"id": "advanced-plugins",
|
||||
"description": "Learn more about creating your own plugin, extending Nx.",
|
||||
"itemList": [
|
||||
{
|
||||
"name": "Share Your Plugin",
|
||||
"id": "share-your-plugin",
|
||||
"tags": ["create-your-own-plugin"],
|
||||
"file": "shared/recipes/plugins/share-your-plugin"
|
||||
},
|
||||
{
|
||||
"name": "Create a Preset",
|
||||
"id": "create-preset",
|
||||
"tags": ["create-your-own-plugin"],
|
||||
"file": "shared/recipes/plugins/create-preset"
|
||||
},
|
||||
{
|
||||
"name": "Migration Generators",
|
||||
"id": "migration-generators",
|
||||
"tags": ["create-your-own-plugin"],
|
||||
"file": "shared/recipes/plugins/migration-generators"
|
||||
},
|
||||
{
|
||||
"name": "Project Graph Plugins",
|
||||
"id": "project-graph-plugins",
|
||||
"tags": ["create-your-own-plugin", "explore-graph"],
|
||||
"file": "shared/recipes/plugins/project-graph-plugins"
|
||||
},
|
||||
{
|
||||
"name": "Project Inference Plugins",
|
||||
"id": "project-inference-plugins",
|
||||
"tags": ["create-your-own-plugin"],
|
||||
"file": "shared/recipes/plugins/project-inference-plugins"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -1336,6 +1362,12 @@
|
||||
"tags": [],
|
||||
"file": "shared/recipes/include-all-packagejson"
|
||||
},
|
||||
{
|
||||
"name": "Include Assets in Build",
|
||||
"id": "include-assets-in-build",
|
||||
"tags": [],
|
||||
"file": "shared/recipes/include-assets-in-build"
|
||||
},
|
||||
{
|
||||
"name": "Identify Dependencies Between Folders",
|
||||
"id": "identify-dependencies-between-folders",
|
||||
|
||||
@ -262,7 +262,7 @@ npx nx affected -t test
|
||||
|
||||
This can be particularly helpful in CI pipelines for larger repos, where most commits only affect a small subset of the entire workspace.
|
||||
|
||||
{% card title="Affected Documentation" description="Checkout Affected documentation for more details" url="/nx/affected" /%}
|
||||
{% card title="Affected Documentation" description="Checkout Affected documentation for more details" url="/packages/nx/documents/affected" /%}
|
||||
|
||||
## What's Next
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ npx nx affected -t test
|
||||
|
||||
This can be particularly helpful in CI pipelines for larger repos, where most commits only affect a small subset of the entire workspace.
|
||||
|
||||
{% card title="Affected Documentation" description="Checkout Affected documentation for more details" url="/nx/affected" /%}
|
||||
{% card title="Affected Documentation" description="Checkout Affected documentation for more details" url="/packages/nx/documents/affected" /%}
|
||||
|
||||
{% callout type="warning" title="Not too fast!" %}
|
||||
Running this at this stage may result in some runtime errors being logged to the terminal.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Workspace Executors
|
||||
|
||||
In Nx 13.10+, local nx plugins can contain executors that are used in the workspace. When creating a custom executor for your workspace, look into the [nx-plugin guide](/packages/plugin) to simplify the build process.
|
||||
In Nx 13.10+, local nx plugins can contain executors that are used in the workspace. When creating a custom executor for your workspace, look into the [local executor guide](/plugins/recipes/local-executors) to simplify the build process.
|
||||
|
||||
## Converting workspace executors to local executors
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ In Nx 13.10, we introduced the ability to run generators from Nx plugins in the
|
||||
|
||||
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](/packages/plugin) for information on creating a new plugin.
|
||||
Check the [local generator guide](/plugins/recipes/local-generators) for information on creating a new plugin.
|
||||
|
||||
## Converting workspace generators to local generators
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ Nx used to have a `workspace.json` file at the root of the repo that at various
|
||||
1. Identified the locations of all project in the repo
|
||||
2. Contained the target configuration for all projects
|
||||
|
||||
Identifying the locations of projects is now done automatically through project inference. You can even customize how projects are inferred with a [project inference plugin](/recipes/advanced-plugins/project-inference-plugins).
|
||||
Identifying the locations of projects is now done automatically through project inference. You can even customize how projects are inferred with a [project inference plugin](/plugins/recipes/project-inference-plugins).
|
||||
|
||||
The target configuration for each project is now stored in individual `project.json` files or `package.json` files.
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ Nx is built in a modular fashion to let you only use the features you need.
|
||||

|
||||
|
||||
- The **Nx** package provides fundamental technology-agnostic capabilities such as: [workspace analysis](/core-features/explore-graph), [task running](/core-features/run-tasks), [caching](/core-features/cache-task-results), [distribution](/core-features/distribute-task-execution), [code generation](/plugin-features/use-code-generators) and [automated code migrations](/core-features/automate-updating-dependencies).
|
||||
- **Plugins** are NPM packages that built on top of the fundamental capabilities provided by the Nx package. Nx plugins contain [code generators](/plugin-features/use-code-generators), [executors](/plugin-features/use-task-executors) (to abstract lower-level build tooling) and automated code migrations for keeping your tools up to date. Contrary to the Nx package, which works the same way with any JS or non-JS project, plugins are usually technology specific. For instance, `@nx/react` adds support for building React apps and libs, `@nx/cypress` adds e2e testing capabilities with Cypress. Plugins make developers more productive by removing any friction of integrating different tools with each other and by providing utilities to keep them up to date. The Nx team maintains plugins for React, Next, Remix, Angular, Jest, Cypress, Storybook and more. You can use the `@nx/plugin` package to easily [scaffold a new plugin](/plugin-features/create-your-own-plugin) or even just [automate your local workspace](/recipes/generators/local-generators). There are also more than 80 [community plugins](/community).
|
||||
- **Devkit** is a set of utilities for [building Nx plugins](/plugin-features/create-your-own-plugin).
|
||||
- **Plugins** are NPM packages that built on top of the fundamental capabilities provided by the Nx package. Nx plugins contain [code generators](/plugin-features/use-code-generators), [executors](/plugin-features/use-task-executors) (to abstract lower-level build tooling) and automated code migrations for keeping your tools up to date. Contrary to the Nx package, which works the same way with any JS or non-JS project, plugins are usually technology specific. For instance, `@nx/react` adds support for building React apps and libs, `@nx/cypress` adds e2e testing capabilities with Cypress. Plugins make developers more productive by removing any friction of integrating different tools with each other and by providing utilities to keep them up to date. The Nx team maintains plugins for React, Next, Remix, Angular, Jest, Cypress, Storybook and more. You can use the `@nx/plugin` package to easily [scaffold a new plugin](/plugins/intro/getting-started) or even just [automate your local workspace](/plugins/recipes/local-generators). There are also more than 80 [community plugins](/plugins/registry).
|
||||
- **Devkit** is a set of utilities for [building Nx plugins](/plugins/intro/getting-started).
|
||||
- **Nx Cloud** helps scale your project on CI by [adding remote caching](/concepts/how-caching-works) and [distributed task execution](/more-concepts/illustrated-dte). It also improves developer ergonomics by integrating with GitHub, GitLab and BitBucket and providing searchable structured logs. Learn more at [nx.app](https://nx.app).
|
||||
- **Nx Console** is an extension for **VSCode, IntelliJ and VIM**. It provides code autocompletion, interactive generators, workspace visualizations, powerful refactorings and more. You can [install it here](/core-features/integrate-with-editors).
|
||||
|
||||
@ -16,7 +16,7 @@ myorg/
|
||||
|
||||
`/libs/` contains the library projects. There are many kinds of libraries, and each library defines its own external API so that boundaries between libraries remain clear.
|
||||
|
||||
`/tools/` contains scripts that act on your code base. This could be database scripts, [local executors](/recipes/executors/creating-custom-executors), or [local generators](/recipes/generators/local-generators).
|
||||
`/tools/` contains scripts that act on your code base. This could be database scripts, [local executors](/plugins/recipes/local-executors), or [local generators](/plugins/recipes/local-generators).
|
||||
|
||||
`/nx.json` configures the Nx CLI itself. It tells Nx what needs to be cached, how to run tasks etc.
|
||||
|
||||
|
||||
@ -180,7 +180,7 @@ below. This example shows how you could use it to add the `LicenseWebpackPlugin`
|
||||
any webpack plugins you need.
|
||||
|
||||
```js
|
||||
const { withModuleFederation } = require('@nrwl/angular/module-federation');
|
||||
const { withModuleFederation } = require('@nx/angular/module-federation');
|
||||
const config = require('./module-federation.config');
|
||||
const LicenseWebpackPlugin =
|
||||
require('license-webpack-plugin').LicenseWebpackPlugin;
|
||||
|
||||
@ -217,7 +217,7 @@ npx nx affected -t lint
|
||||
|
||||
This can be particularly helpful in CI pipelines for larger repos, where most commits only affect a small subset of the entire workspace.
|
||||
|
||||
{% card title="Affected Documentation" description="Checkout Affected documentation for more details" url="/nx/affected" /%}
|
||||
{% card title="Affected Documentation" description="Checkout Affected documentation for more details" url="/packages/nx/documents/affected" /%}
|
||||
|
||||
## What's Next
|
||||
|
||||
|
||||
@ -1,163 +1,5 @@
|
||||
Nx plugins are npm packages that contain [generators](/plugin-features/use-code-generators) and [executors](/plugin-features/use-task-executors) to extend a Nx workspace.
|
||||
|
||||
At its core, a generator is a function that creates or modifies code and an executor is a function that processes code. Nx makes it easier to call those functions from the terminal or through the [Nx Console UI](/core-features/integrate-with-editors). And you can use helper utils in the [Nx Devkit](/packages/devkit) to help build your generator or executor.
|
||||
This package contains tooling to help plugin authors create and maintain plugins.
|
||||
|
||||
> A list of plugins that is maintained by Nrwl is found in the [Nrwl/nx repo](https://github.com/nrwl/nx/tree/master/packages). \
|
||||
> A list of custom plugins created by the community is found in the [Community](/community) section.
|
||||
> Plugins are written using Nx Devkit. **Read [Nx Devkit](/packages/devkit/documents/nx_devkit) for more information.**
|
||||
|
||||
{% youtube
|
||||
src="https://www.youtube.com/embed/fC1-4fAZDP4"
|
||||
title="Nx Tutorial: Building Custom Plugins for Nx"
|
||||
width="100%" /%}
|
||||
|
||||
> For a detailed video explaining the things covered here and more, check out [Creating and Publishing Your Own Nx Plugin](https://www.youtube.com/watch?v=vVT7Al01VZc).
|
||||
|
||||
## Generating a Plugin
|
||||
|
||||
To get started with building a Nx Plugin, run the following command:
|
||||
|
||||
```shell
|
||||
npx create-nx-plugin my-org --pluginName my-plugin
|
||||
```
|
||||
|
||||
This command creates a brand-new workspace, and sets up a pre-configured plugin with the specified name.
|
||||
|
||||
> Note, the command above will create a plugin with the package name set to `@my-org/my-plugin`. You can pass `--importPath` to provide a different package name.
|
||||
|
||||
> If you do not want to create a new workspace, install the `@nx/plugin` dependency in an already existing workspace with npm or yarn. Then run `nx g @nx/plugin:plugin [pluginName]`.
|
||||
|
||||
A new plugin is created with a default generator, executor, and e2e app.
|
||||
|
||||
## Generator
|
||||
|
||||
The created generator contains boilerplate that will do the following:
|
||||
|
||||
- Normalize a schema (the options that the generator accepts)
|
||||
- Update the `project.json`
|
||||
- Add the plugin's project to the `nx.json` file
|
||||
- Add files to the disk using templates
|
||||
|
||||
There will be an exported default function that will be the main entry for the generator.
|
||||
|
||||
### Generator options
|
||||
|
||||
The `schema.d.ts` file contains all the options that the generator supports. By default, it includes `directory`, `tags`, and `name` as the options. If more options need to be added, please update this file and the `schema.json` file.
|
||||
|
||||
{% callout type="note" title="More details" %}
|
||||
The `schema.d.ts` file is used for type checking inside the implementation file. It should match the properties in `schema.json`.
|
||||
{% /callout %}
|
||||
|
||||
### Adding more generators
|
||||
|
||||
To add more generators to the plugin, run the following command:
|
||||
`nx generate @nx/plugin:generator [generatorName] --project=[pluginName]`.
|
||||
|
||||
This will scaffold out a new generator and update the necessary files to support it.
|
||||
|
||||
### Generator Testing
|
||||
|
||||
The generator spec file includes boilerplate to help get started with testing. This includes setting up an empty workspace.
|
||||
|
||||
These tests should ensure that files within the tree (created with `createTreeWithEmptyWorkspace`) are in the correct place, and contain the right content.
|
||||
|
||||
Full E2Es are supported (and recommended) and will run everything on the file system like a user would.
|
||||
|
||||
## Executor
|
||||
|
||||
The default executor is set up to just emit a console log. Some examples of what an executor can do are:
|
||||
|
||||
- Support different languages, (Java, Go, Python, C#)
|
||||
- Compile new UI framework components
|
||||
- Deploy an app on a CDN
|
||||
- Publish to NPM
|
||||
- and many more!
|
||||
|
||||
### Adding more executors
|
||||
|
||||
To add more executors to the plugin, run the following command:
|
||||
`nx generate @nx/plugin:executor [executor] --project=[pluginName]`.
|
||||
|
||||
This will scaffold out a new generator and update the necessary files to support it.
|
||||
|
||||
### Executor testing
|
||||
|
||||
The executor spec file contains boilerplate to run the default exported function from the executor.
|
||||
|
||||
These tests should make sure that the executor is executing and calling the functions that it relies on.
|
||||
|
||||
Full E2Es are supported (and recommended) and will run everything on the file system like a user would.
|
||||
|
||||
## Testing your plugin
|
||||
|
||||
One of the biggest benefits that the Nx Plugin package provides is support for E2E and unit testing.
|
||||
|
||||
When the E2E app runs, a temporary E2E directory is created in the root of the workspace. This directory is a blank Nx workspace, and will have the plugin's built package installed locally.
|
||||
|
||||
### E2E Testing file
|
||||
|
||||
When the plugin is generated, a test file is created in the `my-plugin-e2e` app. Inside this test file, there are already tests for making sure that the executor ran, checking if directories are created with the `--directory` option, and checking if tags are added to the project configuration.
|
||||
|
||||
We'll go over a few parts of a test file below:
|
||||
|
||||
```typescript
|
||||
it('should create my-plugin', async (done) => {
|
||||
const plugin = uniq('my-plugin');
|
||||
ensureNxProject('@my-org/my-plugin', 'dist/packages/my-plugin');
|
||||
await runNxCommandAsync(`generate @my-org/my-plugin:myPlugin ${plugin}`);
|
||||
|
||||
const result = await runNxCommandAsync(`build ${plugin}`);
|
||||
expect(result.stdout).toContain('Executor ran');
|
||||
|
||||
done();
|
||||
});
|
||||
```
|
||||
|
||||
- The `uniq` function creates a random name with the prefix and a random number.
|
||||
- The `ensureNxProject` is the function that will create the temporary directory. It takes two arguments, the plugin package name and the dist directory of when it's built.
|
||||
- The `runNxCommandAsync` will execute a `nx` command in the E2E directory.
|
||||
|
||||
There are additional functions that the `@nx/plugin/testing` package exports. Most of them are file utilities to manipulate and read files in the E2E directory.
|
||||
|
||||
## Including Assets
|
||||
|
||||
Sometimes you might want to include some assets with the plugin. This might be a image or some additional binaries.
|
||||
|
||||
To make sure that assets are copied to the dist folder, open the plugin's `project.json` file. Inside the `build` property, add additional assets. By default, all `.md` files in the root, all non-ts files in folders, and the `generators.json` and `executors.json` files are included.
|
||||
|
||||
```jsonc {% fileName="project.json" %}
|
||||
"build": {
|
||||
"executor": "@nx/node:package",
|
||||
"options": {
|
||||
// shortened...
|
||||
"assets": [
|
||||
"packages/my-plugin/*.md",
|
||||
{
|
||||
"input": "./packages/my-plugin/src",
|
||||
"glob": "**/*.!(ts)",
|
||||
"output": "./src"
|
||||
},
|
||||
{
|
||||
"input": "./packages/my-plugin",
|
||||
"glob": "generators.json",
|
||||
"output": "."
|
||||
},
|
||||
{
|
||||
"input": "./packages/my-plugin",
|
||||
"glob": "executors.json",
|
||||
"output": "."
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Using your Nx Plugin
|
||||
|
||||
To use your plugin, simply list it in `nx.json` or use its generators and executors as you would for any other plugin. This could look like `nx g @my-org/my-plugin:lib` for generators or `"executor": "@my-org/my-plugin:build"` for executors. It should be usable in all of the same ways as published plugins in your local workspace immediately after generating it. This includes setting it up as the default collection in `nx.json`, which would allow you to run `nx g lib` and hit your plugin's generator.
|
||||
|
||||
{% callout type="warning" title="string" %}
|
||||
|
||||
Nx uses the paths from tsconfig.base.json when running plugins locally, but uses the recommended tsconfig for node 16 for other compiler options. See https://github.com/tsconfig/bases/blob/main/bases/node16.json
|
||||
|
||||
{% /callout %}
|
||||
For more information, see the [plugins](/plugins/intro/getting-started) section of docs.
|
||||
|
||||
@ -71,7 +71,7 @@ Choosing one of these frameworks will have the following effects on your workspa
|
||||
|
||||
4. Nx will generate a new Cypress e2e app for your project (if there isn't one already) to run against the Storybook instance.
|
||||
|
||||
Make sure to **use the framework-specific generators** if your project is using Angular, React, Next.js or React Native: [`@nrwl/angular:storybook-configuration`](/packages/angular/generators/storybook-configuration), [`@nrwl/react:storybook-configuration`](/packages/react/generators/storybook-configuration), [`@nrwl/react-native:storybook-configuration`](/packages/react-native/generators/storybook-configuration):
|
||||
Make sure to **use the framework-specific generators** if your project is using Angular, React, Next.js or React Native: [`@nx/angular:storybook-configuration`](/packages/angular/generators/storybook-configuration), [`@nx/react:storybook-configuration`](/packages/react/generators/storybook-configuration), [`@nx/react-native:storybook-configuration`](/packages/react-native/generators/storybook-configuration):
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="Angular" %}
|
||||
|
||||
@ -4,7 +4,7 @@ The workspace plugin contains executors and generators that are useful for any N
|
||||
|
||||
Codifying your organization's best practices into local generators is a great way to ensure that the best practices are easy to follow and implement. Running `nx g @nx/plugin:plugin feature` will create a local plugin with a generator which is written the same way generators are written for Nx plugins.
|
||||
|
||||
> See more about [local generators](/recipes/generators/local-generators)
|
||||
> See more about [local generators](/plugins/recipes/local-generators)
|
||||
|
||||
## Reorganizing Projects
|
||||
|
||||
|
||||
@ -1,77 +0,0 @@
|
||||
# Create Your Own Plugin
|
||||
|
||||
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).
|
||||
|
||||
{% callout type="note" title="Plugins are optional" %}
|
||||
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.
|
||||
{% /callout %}
|
||||
|
||||
{% cards %}
|
||||
{% card title="Create a Nx Generator in 100 seconds" description="Learn how to setup a new local generator in less than 2 minutes" type="video" url="https://www.youtube.com/watch?v=ubgroK5T6cA" /%}
|
||||
{% card title="Creating and Publishing Your Own Nx Plugin" description="Learn how to build your own Playwright" type="video" url="https://youtu.be/vVT7Al01VZc" /%}
|
||||
{% /cards %}
|
||||
|
||||
## Nx plugins
|
||||
|
||||
Nx plugins contain [executors](/plugin-features/use-task-executors) and [generators](/plugin-features/use-code-generators) to extend the capabilities of an Nx workspace. They can be shared as npm packages or referenced directly within a single repo.
|
||||
|
||||
{% personas %}
|
||||
|
||||
{% persona type="browse" title="Browse Existing Plugins" url="/community#plugin-directory" %}
|
||||
|
||||
Browse through plugins built by Nx and the community.
|
||||
|
||||
- [Plugin Directory](/community#plugin-directory)
|
||||
|
||||
{% /persona %}
|
||||
|
||||
{% persona type="create" title="Build a Plugin" url="/packages/plugin" %}
|
||||
|
||||
Build a plugin for use in your own repo or to share with others.
|
||||
|
||||
- [Build a plugin](/packages/plugin)
|
||||
|
||||
{% /persona %}
|
||||
|
||||
{% persona type="share" title="Share Your Plugin" url="/recipes/advanced-plugins/share-your-plugin" %}
|
||||
|
||||
Publish your plugin to npm and keep your plugin users up to date with migration generators.
|
||||
|
||||
- [Share your plugin](/recipes/advanced-plugins/share-your-plugin)
|
||||
|
||||
{% /persona %}
|
||||
|
||||
{% persona type="extend" title="Extend Core Nx Functionality" url="/recipes/advanced-plugins/project-graph-plugins" %}
|
||||
|
||||
Extend the Nx graph logic to understand other languages and custom setups.
|
||||
|
||||
- [Extend Core Nx Functionality](/recipes/advanced-plugins/project-graph-plugins)
|
||||
|
||||
{% /persona %}
|
||||
|
||||
{% /personas %}
|
||||
|
||||
All the core plugins are written using [Nx Devkit](/packages/devkit), and you can use the same utilities to write your own generators and
|
||||
executors.
|
||||
|
||||
{% callout type="check" title="Plugins!" %}
|
||||
The Nx team maintains a core set of plugins for many application and tooling frameworks. You can write [generators](/recipes/generators/local-generators) and [executors](/recipes/executors/creating-custom-executors) in a plugin to use in your own repo or share it with the community. The [Nx Plugin](/packages/plugin) plugin provides guidance on how you can build your own custom plugins.
|
||||
{% /callout %}
|
||||
|
||||
### Pay as you go
|
||||
|
||||
As with most things in Nx, the core of Nx Devkit is very simple. It only uses language primitives and immutable
|
||||
objects (the tree being the only exception). See [Simplest Generator](/recipes/generators/creating-files)
|
||||
and [Simplest Executor](/plugin-features/use-task-executors#simplest-executor) for examples on creating generators
|
||||
and executors. The [Using Executors](/plugin-features/use-task-executors)
|
||||
and [Using Generators](/plugin-features/use-code-generators) guides also have additional information on executors
|
||||
and generators.
|
||||
|
||||
## Learn more
|
||||
|
||||
- [Creating and Publishing Your Own Nx Plugin - Youtube](https://www.youtube.com/watch?v=vVT7Al01VZc)
|
||||
- [Walkthrough Creating an Nx Plugin for tRPC](https://blog.nrwl.io/create-your-own-trpc-stack-de42209f83a3)
|
||||
- [Local generators](/recipes/generators/local-generators)
|
||||
- [Local executors](/recipes/executors/creating-custom-executors)
|
||||
- [Nx Community Plugins](/community)
|
||||
@ -7,7 +7,7 @@ Generators provide a way to automate many tasks you regularly perform as part of
|
||||
There are three main types of generators:
|
||||
|
||||
1. **Plugin Generators** are available when an Nx plugin has been installed in your workspace.
|
||||
2. **Local Generators** are generators that you can create for your own workspace. [Local generators](/recipes/generators/local-generators) allow you to codify the processes that are unique to your own organization.
|
||||
2. **Local Generators** are generators that you can create for your own workspace. [Local generators](/plugins/recipes/local-generators) allow you to codify the processes that are unique to your own organization.
|
||||
3. **Update Generators** are invoked by Nx plugins when you [update Nx](/recipes/adopting-nx) to keep your config files in sync with the latest versions of third party tools.
|
||||
|
||||
## Invoking Plugin Generators
|
||||
|
||||
92
docs/shared/plugins/create-plugin.md
Normal file
92
docs/shared/plugins/create-plugin.md
Normal file
@ -0,0 +1,92 @@
|
||||
# Create a Local Plugin
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
This will create a `my-plugin` project that contains all your plugin code and `my-plugin-e2e` for e2e tests.
|
||||
|
||||
> If you want to create a new workspace for your plugin, run `npx create-nx-plugin my-plugin`. This command will create a new workspace with `my-plugin` and `e2e` projects set up for you.
|
||||
|
||||
## Generator
|
||||
|
||||
To create a new generator run:
|
||||
|
||||
```shell
|
||||
nx generate @nx/plugin:generator my-generator --project=my-plugin
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
For more information about this sample generator, read the [simple generator recipe](/plugins/recipes/local-generators).
|
||||
|
||||
### Generator options
|
||||
|
||||
The `schema.d.ts` file contains all the options that the generator supports. By default, it includes `directory`, `tags`, and `name` as the options. If more options need to be added, please update this file and the `schema.json` file.
|
||||
|
||||
{% callout type="note" title="More details" %}
|
||||
The `schema.d.ts` file is used for type checking inside the implementation file. It should match the properties in `schema.json`.
|
||||
{% /callout %}
|
||||
|
||||
### Generator Testing
|
||||
|
||||
The generator spec file includes boilerplate to help get started with testing. This includes setting up an empty workspace.
|
||||
|
||||
These tests should ensure that files within the tree (created with `createTreeWithEmptyWorkspace`) are in the correct place, and contain the right content.
|
||||
|
||||
Full E2Es are supported and will run everything on the file system like a user would.
|
||||
|
||||
## Executor
|
||||
|
||||
To create a new executor run:
|
||||
|
||||
```shell
|
||||
nx generate @nx/plugin:executor my-executor --project=my-plugin
|
||||
```
|
||||
|
||||
The new executor is located in `/src/executors/my-executor`. The `my-executor.ts` file contains the code that runs the executor. This executor emits a console log, but executors can compile code, deploy an app, publish to NPM and much more.
|
||||
|
||||
For more information about this sample executor, read the [simple executor recipe](/plugins/recipes/local-executors).
|
||||
|
||||
### Executor testing
|
||||
|
||||
The executor spec file contains boilerplate to run the default exported function from the executor.
|
||||
|
||||
These tests should make sure that the executor is executing and calling the functions that it relies on. Typically, unit tests are more useful for generators and e2e tests are more useful for executors.
|
||||
|
||||
## Testing your plugin
|
||||
|
||||
One of the biggest benefits that the Nx Plugin package provides is support for E2E and unit testing.
|
||||
|
||||
When the E2E app runs, a temporary E2E directory is created in the root of the workspace. This directory is a blank Nx workspace, and will have the plugin's built package installed locally.
|
||||
|
||||
### E2E Testing file
|
||||
|
||||
When the plugin is generated, a test file is created in the `my-plugin-e2e` app. Inside this test file, there is a disabled test that gives you a starting point for writing your own tests. To enable the test, change `xit` to `it`.
|
||||
|
||||
We'll go over a few parts of a test file below:
|
||||
|
||||
```typescript
|
||||
beforeAll(() => {
|
||||
ensureNxProject('my-plugin', 'dist/./.');
|
||||
});
|
||||
|
||||
xit('should be able to build generated projects', async () => {
|
||||
const name = 'proj';
|
||||
const generator = 'PLACEHOLDER';
|
||||
await runNxCommandAsync(`generate my-plugin:${generator} --name ${name}`);
|
||||
expect(() => runNxCommand('build ${proj}')).not.toThrow();
|
||||
expect(() => checkFilesExist(`dist/${name}/index.js`)).not.toThrow();
|
||||
});
|
||||
```
|
||||
|
||||
- The `ensureNxProject` is the function that will create the temporary directory. It takes two arguments, the plugin package name and the dist directory of when it's built.
|
||||
- The `runNxCommandAsync` function will execute a `nx` command in the E2E directory.
|
||||
|
||||
There are additional functions that the `@nx/plugin/testing` package exports. Most of them are file utilities to manipulate and read files in the E2E directory.
|
||||
|
||||
## Using your Nx Plugin Locally
|
||||
|
||||
To use your plugin, simply list it in `nx.json` or use its generators and executors as you would for any other plugin. This could look like `nx g @my-org/my-plugin:lib` for generators or `"executor": "@my-org/my-plugin:build"` for executors. It should be usable in all of the same ways as published plugins in your local workspace immediately after generating it.
|
||||
60
docs/shared/plugins/intro.md
Normal file
60
docs/shared/plugins/intro.md
Normal file
@ -0,0 +1,60 @@
|
||||
# Getting Started with Plugins
|
||||
|
||||
Nx plugins contain [generators](/plugin-features/use-code-generators) and [executors](/plugin-features/use-task-executors) that extend the capabilities of an Nx workspace. They can be shared as npm packages or referenced locally within the same repo.
|
||||
|
||||
{% cards cols="2" %}
|
||||
|
||||
{% title-card title="Use a Plugin" url="#use-a-plugin" /%}
|
||||
{% title-card title="Create a Local Plugin" url="#create-a-local-plugin" /%}
|
||||
{% title-card title="Maintain a Published Plugin" url="#maintain-a-published-plugin" /%}
|
||||
{% title-card title="Advanced Plugins" url="#advanced-plugins" /%}
|
||||
|
||||
{% /cards %}
|
||||
|
||||
## Use a Plugin
|
||||
|
||||
Nx plugins help you scaffold new projects, pre-configure tooling, follow best practices, and modularize your codebase.
|
||||
|
||||
{% cards cols="2" %}
|
||||
|
||||
{% card title="Browse Existing Plugins" description="Find a plugin to use" url="/plugins/registry" /%}
|
||||
{% card title="Use Task Executors" description="Run operations on your code" url="/plugin-features/use-task-executors" /%}
|
||||
{% card title="Use Code Generators" description="Create or modify code" url="/plugin-features/use-code-generators" /%}
|
||||
{% card title="Automate Updating Dependencies" description="Keep code up to date with package breaking changes" url="/core-features/automate-updating-dependencies" /%}
|
||||
|
||||
{% /cards %}
|
||||
|
||||
## Create a Local Plugin
|
||||
|
||||
Local plugins allow you to automate repository specific tasks and enforce best practices (e.g., generating projects or components, running third-party tools).
|
||||
|
||||
{% cards cols="3" %}
|
||||
|
||||
{% card title="Create a Plugin" description="Set up a new plugin" url="/plugins/tutorials/create-plugin" /%}
|
||||
{% card title="Local Generators" description="Add a generator to your plugin" url="/plugins/recipes/local-generators" /%}
|
||||
{% card title="Local Executors" description="Add an executor to your plugin" url="/plugins/recipes/local-executors" /%}
|
||||
|
||||
{% /cards %}
|
||||
|
||||
## Maintain a Published Plugin
|
||||
|
||||
If your plugin has functionality that would be useful in more than just your repo, you can publish it to npm and register it on the nx.dev site for others to find.
|
||||
|
||||
{% cards cols="2" %}
|
||||
|
||||
{% card title="Share Your Plugin" description="Submit your plugin to the Nx plugin registry" url="/plugins/tutorials/publish-plugin" /%}
|
||||
{% card title="Migration Generators" description="Update repos when you introduce breaking changes" url="/plugins/recipes/migration-generators" /%}
|
||||
|
||||
{% /cards %}
|
||||
|
||||
## Advanced Plugins
|
||||
|
||||
You can also hook into the way Nx works and modify it to suit your needs
|
||||
|
||||
{% cards cols="3" %}
|
||||
|
||||
{% card title="Scaffold a New Workspace" description="Set up a new repo" url="/plugins/recipes/create-preset" /%}
|
||||
{% card title="Project Inference Plugins" description="Modify how Nx identifies projects" url="/plugins/recipes/project-inference-plugins" /%}
|
||||
{% card title="Project Graph Plugins" description="Modify the Nx graph" url="/plugins/recipes/project-graph-plugins" /%}
|
||||
|
||||
{% /cards %}
|
||||
@ -1,10 +1,14 @@
|
||||
# Share your Nx Plugin
|
||||
# Maintain a Published Plugins
|
||||
|
||||
To create a plugin, see the [create a local plugin tutorial](/plugins/tutorials/create-plugin).
|
||||
|
||||
## Publish your Nx Plugin
|
||||
|
||||
In order to use your plugin in other workspaces or share it with the community, you will need to publish it to an npm registry. To publish your plugin follow these steps:
|
||||
|
||||
1. Build your plugin with the command `nx run my-plugin:build`
|
||||
1. `npm publish ./dist/package/my-plugin` and follow the prompts from npm.
|
||||
1. That's it!
|
||||
1. `nx publish my-plugin --ver=1.0.0` which automatically builds `my-plugin`
|
||||
2. Follow the prompts from npm.
|
||||
3. That's it!
|
||||
|
||||
{% callout type="warning" title="Version bump" %}
|
||||
Currently you will have to modify the `package.json` version by yourself or with a tool.
|
||||
@ -13,7 +17,7 @@ Currently you will have to modify the `package.json` version by yourself or with
|
||||
After that, you can then install your plugin like any other npm package,
|
||||
`npm i -D @my-org/my-plugin` or `yarn add -D @my-org/my-plugin`.
|
||||
|
||||
## Listing your Nx Plugin
|
||||
## List your Nx Plugin
|
||||
|
||||
Nx provides a utility (`nx list`) that lists both core and community plugins. To submit your plugin, please follow the steps below:
|
||||
|
||||
@ -28,4 +32,4 @@ We will then verify the plugin, offer suggestions or merge the pull request!
|
||||
|
||||
## Write Migrations
|
||||
|
||||
Once other repos are using your plugin, it would help them if you write migrations to automatically update their configuration files whenever you make breaking changes. Read the [migration generators guide](/recipes/advanced-plugins/migration-generators) to find out how.
|
||||
Once other repos are using your plugin, it would help them if you write migrations to automatically update their configuration files whenever you make breaking changes. Read the [migration generators guide](/plugins/recipes/migration-generators) to find out how.
|
||||
@ -234,7 +234,7 @@ npx nx affected -t test
|
||||
|
||||
This can be particularly helpful in CI pipelines for larger repos, where most commits only affect a small subset of the entire workspace.
|
||||
|
||||
{% card title="Affected Documentation" description="Checkout Affected documentation for more details" url="/nx/affected" /%}
|
||||
{% card title="Affected Documentation" description="Checkout Affected documentation for more details" url="/packages/nx/documents/affected" /%}
|
||||
|
||||
## What's Next
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ npx nx affected -t test
|
||||
|
||||
This can be particularly helpful in CI pipelines for larger repos, where most commits only affect a small subset of the entire workspace.
|
||||
|
||||
{% card title="Affected Documentation" description="Checkout Affected documentation for more details" url="/nx/affected" /%}
|
||||
{% card title="Affected Documentation" description="Checkout Affected documentation for more details" url="/packages/nx/documents/affected" /%}
|
||||
|
||||
## Task Caching
|
||||
|
||||
|
||||
@ -10,13 +10,14 @@ First, you define a folder to store your static or dynamic templates used to gen
|
||||
happynrwl/
|
||||
├── apps/
|
||||
├── libs/
|
||||
├── tools/
|
||||
│ ├── generators
|
||||
│ | └── my-generator/
|
||||
│ | | └── files
|
||||
│ | | └── NOTES.md
|
||||
│ | | ├── index.ts
|
||||
│ | | └── schema.json
|
||||
│ └── my-plugin
|
||||
│ └── src
|
||||
│ └── generators
|
||||
│ └── my-generator/
|
||||
│ ├── files
|
||||
│ │ └── NOTES.md
|
||||
│ ├── index.ts
|
||||
│ └── schema.json
|
||||
├── nx.json
|
||||
├── package.json
|
||||
└── tsconfig.base.json
|
||||
|
||||
@ -4,7 +4,7 @@ Modifying existing files is an order of magnitude harder than creating new files
|
||||
|
||||
## Compose Existing Generators
|
||||
|
||||
If you can compose together existing generators to modify the files you need, you should take that approach. See [Composing Generators](/recipes/generators/composing-generators) for more information.
|
||||
If you can compose together existing generators to modify the files you need, you should take that approach. See [Composing Generators](/plugins/recipes/composing-generators) for more information.
|
||||
|
||||
## Modify JSON Files
|
||||
|
||||
|
||||
31
docs/shared/recipes/include-assets-in-build.md
Normal file
31
docs/shared/recipes/include-assets-in-build.md
Normal file
@ -0,0 +1,31 @@
|
||||
# Including Assets in Your Build
|
||||
|
||||
All the official Nx executors with an `assets` option have the same syntax.
|
||||
|
||||
There are two ways to identify assets to be copied into the output bundle:
|
||||
|
||||
1. Specify assets with a regex string. This will copy files over in the same folder structure as the source files.
|
||||
2. Use the object format to redirect files into different locations in the output bundle.
|
||||
|
||||
```jsonc {% fileName="project.json" %}
|
||||
"build": {
|
||||
"executor": "@nx/node:package",
|
||||
"options": {
|
||||
// shortened...
|
||||
"assets": [
|
||||
// Copies all the markdown files at the root of the project to the root of the output bundle
|
||||
"path-to-my-project/*.md",
|
||||
{
|
||||
"input": "./path-to-my-project/src", // look in the src folder
|
||||
"glob": "**/*.!(ts)", // for any file (in any folder) that is not a typescript file
|
||||
"output": "./src" // put those files in the src folder of the output bundle
|
||||
},
|
||||
{
|
||||
"input": "./path-to-my-project", // look in the project folder
|
||||
"glob": "executors.json", // for the executors.json file
|
||||
"output": "." // put the file in the root of the output bundle
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -13,7 +13,7 @@ width="100%" /%}
|
||||
|
||||
At its core a preset is a generator, which we can create inside of a plugin.
|
||||
|
||||
All first-party Nx presets are built into nx itself, but you can [create your own plugin](/plugin-features/create-your-own-plugin) and create a generator with the magic name: `preset`. Once you've [published your plugin](/recipes/advanced-plugins/share-your-plugin) on npm, you can now run. the create-nx-workspace command with the preset option set to the name of your published package.
|
||||
All first-party Nx presets are built into nx itself, but you can [create your own plugin](/plugins/intro/getting-started) and create a generator with the magic name: `preset`. Once you've [published your plugin](/plugins/tutorials/publish-plugin) on npm, you can now run. the create-nx-workspace command with the preset option set to the name of your published package.
|
||||
|
||||
For example, take
|
||||
|
||||
@ -88,7 +88,7 @@ export default async function (tree: Tree, options: PresetGeneratorSchema) {
|
||||
}
|
||||
```
|
||||
|
||||
To get an in-depth guide on customizing/running or debugging your generator see [local generators](/recipes/generators/local-generators).
|
||||
To get an in-depth guide on customizing/running or debugging your generator see [local generators](/plugins/recipes/local-generators).
|
||||
|
||||
#### Usage
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ A repository using Nx without [plugins](#plugin) that prioritizes the independen
|
||||
|
||||
A set of [executors](#executor), [generators](#generator) and other code that extends the functionality of Nx. May be installed from a package manager like NPM or developed directly in the repository.
|
||||
|
||||
> See: [Create Your Own Plugin](/plugin-features/create-your-own-plugin)
|
||||
> See: [Create Your Own Plugin](/plugins/intro/getting-started)
|
||||
|
||||
### Polyrepo
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Running Custom Commands
|
||||
|
||||
You can easily run any command with the Nx toolchain. The main benefit is to make the [operation cacheable](/concepts/how-caching-works), [distributeable](/core-features/distribute-task-execution) as well as being able to use it [with Nx's affected commands](/concepts/affected).
|
||||
You can easily run any command with the Nx toolchain. The main benefit is to make the [operation cacheable](/concepts/how-caching-works), [distributable](/core-features/distribute-task-execution) as well as being able to use it [with Nx's affected commands](/concepts/affected).
|
||||
|
||||
## 1. Define the terminal command to be run
|
||||
|
||||
|
||||
@ -41,6 +41,22 @@ export function getBasicRecipesSection(items: MenuItem[]): MenuSection {
|
||||
};
|
||||
}
|
||||
|
||||
export function getBasicPluginsSection(items: MenuItem[]): MenuSection {
|
||||
return {
|
||||
id: 'basic',
|
||||
name: 'Basic',
|
||||
hideSectionHeader: true,
|
||||
itemList: items
|
||||
// .filter((m) => m.id === 'getting-started')
|
||||
.map((m) => {
|
||||
return {
|
||||
...m,
|
||||
disableCollapsible: true,
|
||||
};
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
export function getPackagesSections(items: MenuItem[]): MenuSection[] {
|
||||
return items
|
||||
.filter(
|
||||
|
||||
11
nx-dev/nx-dev/lib/plugins.api.ts
Normal file
11
nx-dev/nx-dev/lib/plugins.api.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { DocumentsApi } from '@nx/nx-dev/data-access-documents/node-only';
|
||||
import documents from '../public/documentation/generated/manifests/plugins.json';
|
||||
import { tagsApi } from './tags.api';
|
||||
|
||||
export const nxPluginsApi = new DocumentsApi({
|
||||
id: 'plugins',
|
||||
manifest: documents,
|
||||
prefix: '',
|
||||
publicDocsRoot: 'nx-dev/nx-dev/public/documentation',
|
||||
tagsApi,
|
||||
});
|
||||
@ -1,14 +1,5 @@
|
||||
import {
|
||||
BeakerIcon,
|
||||
ChatBubbleLeftEllipsisIcon,
|
||||
ClipboardIcon,
|
||||
} from '@heroicons/react/24/solid';
|
||||
import { Footer, Header, SectionHeading } from '@nx/nx-dev/ui-common';
|
||||
import {
|
||||
ConnectWithUs,
|
||||
CreateNxPlugin,
|
||||
PluginDirectory,
|
||||
} from '@nx/nx-dev/ui-community';
|
||||
import { Footer, Header } from '@nx/nx-dev/ui-common';
|
||||
import { ConnectWithUs } from '@nx/nx-dev/ui-community';
|
||||
import { NextSeo } from 'next-seo';
|
||||
import { useRouter } from 'next/router';
|
||||
import { nxPackagesApi } from '../lib/packages.api';
|
||||
@ -62,11 +53,11 @@ export default function Community(props: CommunityProps): JSX.Element {
|
||||
return (
|
||||
<>
|
||||
<NextSeo
|
||||
title="Nx Community and Plugin Listing"
|
||||
title="Nx Community"
|
||||
description="There are many ways you can connect with the open-source Nx community. The community is rich and dynamic offering Nx plugins and help on multiple platforms like GitHub, Slack and Twitter"
|
||||
openGraph={{
|
||||
url: 'https://nx.dev' + router.asPath,
|
||||
title: 'Nx Community and Plugin Listing',
|
||||
title: 'Nx Community',
|
||||
description:
|
||||
'There are many ways you can connect with the open-source Nx community. The community is rich and dynamic offering Nx plugins and help on multiple platforms like GitHub, Slack and Twitter',
|
||||
images: [
|
||||
@ -85,83 +76,9 @@ export default function Community(props: CommunityProps): JSX.Element {
|
||||
<Header />
|
||||
<main id="main" role="main">
|
||||
<div className="w-full">
|
||||
<article
|
||||
id="getting-started"
|
||||
className="relative pt-28 pt-16 sm:pt-24 lg:pt-32"
|
||||
>
|
||||
<header className="mx-auto max-w-prose px-4 text-center sm:max-w-3xl sm:px-6 lg:px-8">
|
||||
<div>
|
||||
<SectionHeading as="h1" variant="title" id="community">
|
||||
<span className="sr-only">Nx has </span> A strong and dynamic
|
||||
community
|
||||
</SectionHeading>
|
||||
<SectionHeading as="p" variant="display" className="mt-4">
|
||||
It's always better when we're together.
|
||||
</SectionHeading>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className="mx-auto px-4 py-16 lg:px-8 lg:py-32 xl:max-w-7xl">
|
||||
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<div className="relative rounded-lg border border-slate-200 bg-white/60 p-5 shadow-sm transition hover:border-green-500 hover:bg-white dark:border-slate-800/40 dark:bg-slate-800/60 dark:hover:border-green-500 dark:hover:bg-slate-800">
|
||||
<ChatBubbleLeftEllipsisIcon className="mb-5 inline-block h-10 w-10 text-green-500" />
|
||||
<h4 className="mb-2 text-lg font-bold dark:text-slate-300">
|
||||
Community
|
||||
</h4>
|
||||
<a className="focus:outline-none" href="#community">
|
||||
<span className="absolute inset-0" aria-hidden="true" />
|
||||
<p className="leading-relaxed">
|
||||
There are many ways you can connect with the open-source
|
||||
Nx community: Slack, Youtube, Twitter and email newsletter
|
||||
are available to keep you on top of all the Nx things!
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
<div className="relative rounded-lg border border-slate-200 bg-white/60 p-5 shadow-sm transition hover:border-blue-500 hover:bg-white dark:border-slate-800/40 dark:bg-slate-800/60 dark:hover:border-sky-500 dark:hover:bg-slate-800">
|
||||
<BeakerIcon className="mb-5 inline-block h-10 w-10 text-blue-500 dark:text-sky-500" />
|
||||
<h4 className="mb-2 text-lg font-bold">
|
||||
Create and Share your own{' '}
|
||||
<span className="sr-only">Nx plugin</span>
|
||||
</h4>
|
||||
<a className="focus:outline-none" href="#create-nx-plugin">
|
||||
<span className="absolute inset-0" aria-hidden="true" />
|
||||
<p className="leading-relaxed">
|
||||
Official Nx plugins are created and maintained by the Nx
|
||||
team but you can easily create your own! Follow our
|
||||
documentation on how to create your own plugin.
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
<div className="relative rounded-lg border border-slate-200 bg-white/60 p-5 shadow-sm transition hover:border-pink-500 hover:bg-white dark:border-slate-800/40 dark:bg-slate-800/60 dark:hover:border-pink-500 dark:hover:bg-slate-800">
|
||||
<ClipboardIcon className="mb-5 inline-block h-10 w-10 text-pink-500" />
|
||||
<h4 className="mb-2 text-lg font-bold">
|
||||
Browse the community plugin directory
|
||||
</h4>
|
||||
<a className="focus:outline-none" href="#plugin-directory">
|
||||
<span className="absolute inset-0" aria-hidden="true" />
|
||||
<p className="leading-relaxed">
|
||||
Check all the community plugins available for Nx! These
|
||||
plugins have been approved by the Nx core team, are well
|
||||
maintained and regularly updated to make sure they work
|
||||
with the latest versions.
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<div id="connect-with-us" className="py-28">
|
||||
<ConnectWithUs />
|
||||
</div>
|
||||
|
||||
<div id="create-nx-plugin" className="py-28">
|
||||
<CreateNxPlugin />
|
||||
</div>
|
||||
|
||||
<div id="plugin-directory" className="py-28">
|
||||
<PluginDirectory pluginList={props.pluginList} />
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<Footer />
|
||||
|
||||
@ -14,7 +14,7 @@ import { menusApi } from '../../lib/menus.api';
|
||||
import { useNavToggle } from '../../lib/navigation-toggle.effect';
|
||||
import { tagsApi } from '../../lib/tags.api';
|
||||
|
||||
export default function Recipes({
|
||||
export default function Pages({
|
||||
document,
|
||||
menu,
|
||||
relatedDocuments,
|
||||
|
||||
115
nx-dev/nx-dev/pages/plugins/[...segments].tsx
Normal file
115
nx-dev/nx-dev/pages/plugins/[...segments].tsx
Normal file
@ -0,0 +1,115 @@
|
||||
import { getBasicPluginsSection } from '@nx/nx-dev/data-access-menu';
|
||||
import { DocViewer } from '@nx/nx-dev/feature-doc-viewer';
|
||||
import { ProcessedDocument, RelatedDocument } from '@nx/nx-dev/models-document';
|
||||
import { Menu, MenuItem } from '@nx/nx-dev/models-menu';
|
||||
import { DocumentationHeader, SidebarContainer } from '@nx/nx-dev/ui-common';
|
||||
import { GetStaticPaths, GetStaticProps } from 'next';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { menusApi } from '../../lib/menus.api';
|
||||
import { useNavToggle } from '../../lib/navigation-toggle.effect';
|
||||
import { nxPluginsApi } from '../../lib/plugins.api';
|
||||
import { tagsApi } from '../../lib/tags.api';
|
||||
|
||||
export default function Pages({
|
||||
document,
|
||||
menu,
|
||||
relatedDocuments,
|
||||
}: {
|
||||
document: ProcessedDocument;
|
||||
menu: MenuItem[];
|
||||
relatedDocuments: RelatedDocument[];
|
||||
}): JSX.Element {
|
||||
const router = useRouter();
|
||||
const { toggleNav, navIsOpen } = useNavToggle();
|
||||
const wrapperElement = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
const handleRouteChange = (url: string) => {
|
||||
if (url.includes('#')) return;
|
||||
if (!wrapperElement) return;
|
||||
|
||||
(wrapperElement as any).current.scrollTo({
|
||||
top: 0,
|
||||
left: 0,
|
||||
behavior: 'smooth',
|
||||
});
|
||||
};
|
||||
|
||||
router.events.on('routeChangeComplete', handleRouteChange);
|
||||
return () => router.events.off('routeChangeComplete', handleRouteChange);
|
||||
}, [router, wrapperElement]);
|
||||
|
||||
const vm: {
|
||||
document: ProcessedDocument;
|
||||
menu: Menu;
|
||||
relatedDocuments: RelatedDocument[];
|
||||
} = {
|
||||
document,
|
||||
menu: {
|
||||
sections: [getBasicPluginsSection(menu)],
|
||||
},
|
||||
relatedDocuments,
|
||||
};
|
||||
|
||||
return (
|
||||
<div id="shell" className="flex h-full flex-col">
|
||||
<div className="w-full flex-shrink-0">
|
||||
<DocumentationHeader isNavOpen={navIsOpen} toggleNav={toggleNav} />
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
role="main"
|
||||
className="flex h-full flex-1 overflow-y-hidden"
|
||||
>
|
||||
<SidebarContainer menu={vm.menu} navIsOpen={navIsOpen} />
|
||||
<div
|
||||
ref={wrapperElement}
|
||||
id="wrapper"
|
||||
data-testid="wrapper"
|
||||
className="relative flex flex-grow flex-col items-stretch justify-start overflow-y-scroll"
|
||||
>
|
||||
<DocViewer
|
||||
document={vm.document}
|
||||
relatedDocuments={vm.relatedDocuments}
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export const getStaticPaths: GetStaticPaths = () => {
|
||||
return {
|
||||
paths: nxPluginsApi
|
||||
.getSlugsStaticDocumentPaths()
|
||||
.filter((v) => v !== '/plugins/registry'),
|
||||
fallback: 'blocking',
|
||||
};
|
||||
};
|
||||
export const getStaticProps: GetStaticProps = async ({
|
||||
params,
|
||||
}: {
|
||||
params: { segments: string[] };
|
||||
}) => {
|
||||
try {
|
||||
const segments = ['plugins', ...params.segments];
|
||||
const document = nxPluginsApi.getDocument(segments);
|
||||
return {
|
||||
props: {
|
||||
document,
|
||||
relatedDocuments: tagsApi
|
||||
.getAssociatedItemsFromTags(document.tags)
|
||||
.filter((item) => item.path !== '/' + segments.join('/')), // Remove currently displayed item
|
||||
menu: menusApi.getMenu('plugins', ''),
|
||||
},
|
||||
};
|
||||
} catch (e) {
|
||||
return {
|
||||
notFound: true,
|
||||
props: {
|
||||
statusCode: 404,
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
96
nx-dev/nx-dev/pages/plugins/index.tsx
Normal file
96
nx-dev/nx-dev/pages/plugins/index.tsx
Normal file
@ -0,0 +1,96 @@
|
||||
import { getBasicPluginsSection } from '@nx/nx-dev/data-access-menu';
|
||||
import { DocViewer } from '@nx/nx-dev/feature-doc-viewer';
|
||||
import { ProcessedDocument, RelatedDocument } from '@nx/nx-dev/models-document';
|
||||
import { Menu, MenuItem } from '@nx/nx-dev/models-menu';
|
||||
import { DocumentationHeader, SidebarContainer } from '@nx/nx-dev/ui-common';
|
||||
import { GetStaticProps } from 'next';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { menusApi } from '../../lib/menus.api';
|
||||
import { useNavToggle } from '../../lib/navigation-toggle.effect';
|
||||
import { nxPluginsApi } from '../../lib/plugins.api';
|
||||
import { tagsApi } from '../../lib/tags.api';
|
||||
|
||||
export default function PluginsRoot({
|
||||
document,
|
||||
menu,
|
||||
relatedDocuments,
|
||||
}: {
|
||||
document: ProcessedDocument;
|
||||
menu: MenuItem[];
|
||||
relatedDocuments: RelatedDocument[];
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const { toggleNav, navIsOpen } = useNavToggle();
|
||||
const wrapperElement = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
const handleRouteChange = (url: string) => {
|
||||
if (url.includes('#')) return;
|
||||
if (!wrapperElement) return;
|
||||
|
||||
(wrapperElement as any).current.scrollTo({
|
||||
top: 0,
|
||||
left: 0,
|
||||
behavior: 'smooth',
|
||||
});
|
||||
};
|
||||
|
||||
router.events.on('routeChangeComplete', handleRouteChange);
|
||||
return () => router.events.off('routeChangeComplete', handleRouteChange);
|
||||
}, [router, wrapperElement]);
|
||||
|
||||
const vm: {
|
||||
document: ProcessedDocument;
|
||||
menu: Menu;
|
||||
relatedDocuments: RelatedDocument[];
|
||||
} = {
|
||||
document,
|
||||
menu: {
|
||||
sections: [getBasicPluginsSection(menu)],
|
||||
},
|
||||
relatedDocuments,
|
||||
};
|
||||
|
||||
return (
|
||||
<div id="shell" className="flex h-full flex-col">
|
||||
<div className="w-full flex-shrink-0">
|
||||
<DocumentationHeader isNavOpen={navIsOpen} toggleNav={toggleNav} />
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
role="main"
|
||||
className="flex h-full flex-1 overflow-y-hidden"
|
||||
>
|
||||
<SidebarContainer menu={vm.menu} navIsOpen={navIsOpen} />
|
||||
<div
|
||||
ref={wrapperElement}
|
||||
id="wrapper"
|
||||
data-testid="wrapper"
|
||||
className="relative flex flex-grow flex-col items-stretch justify-start overflow-y-scroll"
|
||||
>
|
||||
<DocViewer
|
||||
document={document}
|
||||
relatedDocuments={vm.relatedDocuments}
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export const getStaticProps: GetStaticProps = async () => {
|
||||
const document = nxPluginsApi.generateRootDocumentIndex({
|
||||
name: 'Plugins',
|
||||
description: 'Learn quickly how to do things with Nx.',
|
||||
});
|
||||
return {
|
||||
props: {
|
||||
document,
|
||||
menu: menusApi.getMenu('plugins', ''),
|
||||
relatedDocuments: document.tags
|
||||
.map((t) => tagsApi.getAssociatedItems(t))
|
||||
.flat(),
|
||||
},
|
||||
};
|
||||
};
|
||||
134
nx-dev/nx-dev/pages/plugins/registry.tsx
Normal file
134
nx-dev/nx-dev/pages/plugins/registry.tsx
Normal file
@ -0,0 +1,134 @@
|
||||
import { getBasicPluginsSection } from '@nx/nx-dev/data-access-menu';
|
||||
import { Menu } from '@nx/nx-dev/models-menu';
|
||||
import {
|
||||
Breadcrumbs,
|
||||
DocumentationHeader,
|
||||
Footer,
|
||||
SidebarContainer,
|
||||
} from '@nx/nx-dev/ui-common';
|
||||
import { PluginDirectory } from '@nx/nx-dev/ui-community';
|
||||
import { NextSeo } from 'next-seo';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useRef } from 'react';
|
||||
import { menusApi } from '../../lib/menus.api';
|
||||
import { useNavToggle } from '../../lib/navigation-toggle.effect';
|
||||
import { nxPackagesApi } from '../../lib/packages.api';
|
||||
|
||||
declare const fetch: any;
|
||||
|
||||
interface PluginInfo {
|
||||
description: string;
|
||||
name: string;
|
||||
url: string;
|
||||
isOfficial: boolean;
|
||||
}
|
||||
interface BrowseProps {
|
||||
pluginList: PluginInfo[];
|
||||
// segments: string[];
|
||||
}
|
||||
|
||||
export async function getStaticProps({}): Promise<{ props: BrowseProps }> {
|
||||
const res = await fetch(
|
||||
'https://raw.githubusercontent.com/nrwl/nx/master/community/approved-plugins.json'
|
||||
);
|
||||
const pluginList = await res.json();
|
||||
|
||||
const officialPluginList = (nxPackagesApi.getRootPackageIndex() ?? []).filter(
|
||||
(m) =>
|
||||
m.name !== 'add-nx-to-monorepo' &&
|
||||
m.name !== 'cra-to-nx' &&
|
||||
m.name !== 'create-nx-plugin' &&
|
||||
m.name !== 'create-nx-workspace' &&
|
||||
m.name !== 'make-angular-cli-faster' &&
|
||||
m.name !== 'tao'
|
||||
);
|
||||
|
||||
return {
|
||||
props: {
|
||||
pluginList: [
|
||||
...officialPluginList.map((plugin) => ({
|
||||
name: plugin.packageName,
|
||||
description: plugin.description ?? '',
|
||||
url: plugin.path,
|
||||
isOfficial: true,
|
||||
})),
|
||||
...pluginList.map((plugin) => ({
|
||||
...plugin,
|
||||
isOfficial: false,
|
||||
})),
|
||||
],
|
||||
// segments,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default function Browse(props: BrowseProps): JSX.Element {
|
||||
const router = useRouter();
|
||||
const { toggleNav, navIsOpen } = useNavToggle();
|
||||
const wrapperElement = useRef(null);
|
||||
|
||||
const vm: {
|
||||
menu: Menu;
|
||||
} = {
|
||||
menu: {
|
||||
sections: [getBasicPluginsSection(menusApi.getMenu('plugins', ''))],
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<NextSeo
|
||||
title="Nx Plugin Listing"
|
||||
description="Nx Plugins enhance the developer experience in you workspace to make your life simpler. Browse the list of available Nx Plugins."
|
||||
openGraph={{
|
||||
url: 'https://nx.dev' + router.asPath,
|
||||
title: 'Nx Plugin Listing',
|
||||
description:
|
||||
'Nx Plugins enhance the developer experience in you workspace to make your life simpler. Browse the list of available Nx Plugins.',
|
||||
images: [
|
||||
{
|
||||
url: 'https://nx.dev/images/nx-media.jpg',
|
||||
width: 800,
|
||||
height: 421,
|
||||
alt: 'Nx: Smart, Fast and Extensible Build System',
|
||||
type: 'image/jpeg',
|
||||
},
|
||||
],
|
||||
siteName: 'NxDev',
|
||||
type: 'website',
|
||||
}}
|
||||
/>
|
||||
<div id="shell" className="flex h-full flex-col">
|
||||
<div className="w-full flex-shrink-0">
|
||||
<DocumentationHeader isNavOpen={navIsOpen} toggleNav={toggleNav} />
|
||||
</div>
|
||||
<main
|
||||
id="main"
|
||||
role="main"
|
||||
className="flex h-full flex-1 overflow-y-hidden"
|
||||
>
|
||||
<SidebarContainer menu={vm.menu} navIsOpen={navIsOpen} />
|
||||
<div
|
||||
ref={wrapperElement}
|
||||
id="wrapper"
|
||||
data-testid="wrapper"
|
||||
className="relative flex flex-grow flex-col items-stretch justify-start overflow-y-scroll"
|
||||
>
|
||||
<div className="mx-auto w-full grow items-stretch px-4 sm:px-6 lg:px-8 2xl:max-w-6xl">
|
||||
<div id="content-wrapper" className="w-full flex-auto flex-col">
|
||||
<div className="mb-6 pt-8">
|
||||
<Breadcrumbs path={router.asPath} />
|
||||
</div>
|
||||
<div className="min-w-0 flex-auto pb-24 lg:pb-16">
|
||||
<PluginDirectory pluginList={props.pluginList} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Footer />
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@ -201,7 +201,7 @@ const diataxis = {
|
||||
'/using-nx/updating-nx': '/core-features/automate-updating-dependencies',
|
||||
'/using-nx/nx-nodejs-typescript-version-matrix':
|
||||
'/workspace/nx-nodejs-typescript-version-matrix',
|
||||
'/extending-nx/nx-devkit': '/plugin-features/create-your-own-plugin',
|
||||
'/extending-nx/nx-devkit': '/plugins/intro/getting-started',
|
||||
'/extending-nx/project-inference-plugins':
|
||||
'/recipes/advanced-plugins/project-inference-plugins',
|
||||
'/extending-nx/project-graph-plugins':
|
||||
@ -568,6 +568,30 @@ const conceptUrls = {
|
||||
'/tutorials/angular-standalone-tutorial',
|
||||
};
|
||||
|
||||
const pluginUrls = {
|
||||
'/plugin-features/create-your-own-plugin': '/plugins/tutorials/create-plugin',
|
||||
'/recipes/advanced-plugins': '/plugins/recipes',
|
||||
'/recipes/advanced-plugins/create-preset': '/plugins/recipes/create-preset',
|
||||
'/recipes/advanced-plugins/migration-generators':
|
||||
'/plugins/recipes/migration-generators',
|
||||
'/recipes/advanced-plugins/project-graph-plugins':
|
||||
'/plugins/recipes/project-graph-plugins',
|
||||
'/recipes/advanced-plugins/project-inference-plugins':
|
||||
'/plugins/recipes/project-inference-plugins',
|
||||
'/recipes/advanced-plugins/share-your-plugin':
|
||||
'/plugins/tutorials/maintain-published-plugin',
|
||||
'/recipes/executors/compose-executors': '/plugins/recipes/compose-executors',
|
||||
'/recipes/executors/creating-custom-executors':
|
||||
'/plugins/recipes/local-executors',
|
||||
'/recipes/generators': '/plugins/recipes',
|
||||
'/recipes/generators/composing-generators':
|
||||
'/plugins/recipes/composing-generators',
|
||||
'/recipes/generators/creating-files': '/plugins/recipes/creating-files',
|
||||
'/recipes/generators/generator-options': '/plugins/recipes/generator-options',
|
||||
'/recipes/generators/local-generators': '/plugins/recipes/local-generators',
|
||||
'/recipes/generators/modifying-files': '/plugins/recipes/modifying-files',
|
||||
};
|
||||
|
||||
/**
|
||||
* Public export API
|
||||
*/
|
||||
@ -583,4 +607,5 @@ module.exports = {
|
||||
packagesIndexes,
|
||||
packagesDocuments,
|
||||
conceptUrls,
|
||||
pluginUrls,
|
||||
};
|
||||
|
||||
@ -58,7 +58,7 @@ export function DocumentationHeader({
|
||||
},
|
||||
{
|
||||
name: 'Plugins',
|
||||
href: '/community#plugin-directory',
|
||||
href: '/plugins/intro/getting-started',
|
||||
current: isPlugins,
|
||||
},
|
||||
{
|
||||
|
||||
@ -65,12 +65,12 @@ export function Header(): JSX.Element {
|
||||
{
|
||||
name: 'Community',
|
||||
description: "Check how to reach out and be part of Nx' community.",
|
||||
href: '/getting-started/intro',
|
||||
href: '/community',
|
||||
},
|
||||
{
|
||||
name: 'Plugins registry',
|
||||
name: 'Plugins',
|
||||
description: 'Add capabilities to your workspace with plugins.',
|
||||
href: '/community#plugin-directory',
|
||||
href: '/plugins/intro/getting-started',
|
||||
},
|
||||
{
|
||||
name: 'Nx Conf',
|
||||
@ -186,7 +186,7 @@ export function Header(): JSX.Element {
|
||||
Community
|
||||
</Link>
|
||||
<Link
|
||||
href="/community#plugin-directory"
|
||||
href="/plugins/registry"
|
||||
title="Check Nx available plugins"
|
||||
className="hidden px-3 py-2 font-medium leading-tight hover:text-blue-500 dark:text-slate-200 dark:hover:text-sky-500 md:inline-flex"
|
||||
>
|
||||
|
||||
@ -194,7 +194,7 @@ export function SidebarMobile({
|
||||
},
|
||||
{
|
||||
name: 'Plugins',
|
||||
href: '/community#plugin-directory',
|
||||
href: '/plugins/intro/getting-started',
|
||||
current: isPlugins,
|
||||
},
|
||||
{
|
||||
|
||||
@ -16,6 +16,13 @@ export function ConnectWithUs(): JSX.Element {
|
||||
There are many ways you can connect with the open-source Nx
|
||||
community. Let's connect together!
|
||||
</p>
|
||||
<p className="py-4">
|
||||
Looking for community plugins? Find them listed in the{' '}
|
||||
<a href="/plugins/registry" className="underline font-semibold">
|
||||
plugin registry
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
@ -16,10 +16,7 @@ export function PluginDirectory({
|
||||
}): JSX.Element {
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
return (
|
||||
<div
|
||||
id="plugin-directory"
|
||||
className="max-w-screen mx-auto p-4 lg:max-w-7xl lg:px-8"
|
||||
>
|
||||
<div id="plugin-directory">
|
||||
<div className="flex w-full flex-col justify-between gap-8 md:flex-row ">
|
||||
<SectionHeading as="h2" variant="display" id="plugins-registry">
|
||||
Nx Plugins Registry
|
||||
|
||||
@ -38,7 +38,7 @@ export function MonorepoStyles(): JSX.Element {
|
||||
<span className="font-medium">let Nx do the heavy lifting</span>{' '}
|
||||
with its set of{' '}
|
||||
<Link
|
||||
href="/community#plugin-directory"
|
||||
href="/plugins"
|
||||
title="Install VSCode's native extension for Nx"
|
||||
className="font-medium text-blue-500 dark:text-sky-500"
|
||||
>
|
||||
|
||||
@ -11,14 +11,14 @@ If you want to test components via Storybook with Cypress, then check out the [s
|
||||
This generator is designed to get your Next project up and running with Cypress Component Testing.
|
||||
|
||||
```shell
|
||||
nx g @nrwl/next:cypress-component-configuration --project=my-cool-next-project
|
||||
nx g @nx/next:cypress-component-configuration --project=my-cool-next-project
|
||||
```
|
||||
|
||||
Running this generator, adds the required files to the specified project with a preconfigured `cypress.config.ts` designed for Nx workspaces.
|
||||
|
||||
```ts {% fileName="cypress.config.ts" %}
|
||||
import { defineConfig } from 'cypress';
|
||||
import { nxComponentTestingPreset } from '@nrwl/next/plugins/component-testing';
|
||||
import { nxComponentTestingPreset } from '@nx/next/plugins/component-testing';
|
||||
|
||||
export default defineConfig({
|
||||
component: nxComponentTestingPreset(__filename),
|
||||
@ -29,7 +29,7 @@ Here is an example on how to add custom options to the configuration
|
||||
|
||||
```ts {% fileName="cypress.config.ts" %}
|
||||
import { defineConfig } from 'cypress';
|
||||
import { nxComponentTestingPreset } from '@nrwl/next/plugins/component-testing';
|
||||
import { nxComponentTestingPreset } from '@nx/next/plugins/component-testing';
|
||||
|
||||
export default defineConfig({
|
||||
component: {
|
||||
@ -40,7 +40,7 @@ export default defineConfig({
|
||||
```
|
||||
|
||||
```shell
|
||||
nx g @nrwl/next:cypress-component-project --project=my-cool-next-project
|
||||
nx g @nx/next:cypress-component-project --project=my-cool-next-project
|
||||
```
|
||||
|
||||
## Auto Generating Tests
|
||||
@ -48,7 +48,7 @@ nx g @nrwl/next:cypress-component-project --project=my-cool-next-project
|
||||
You can optionally use the `--generate-tests` flag to generate a test file for each component in your project.
|
||||
|
||||
```shell
|
||||
nx g @nrwl/next:cypress-component-configuration --project=my-cool-next-project --generate-tests
|
||||
nx g @nx/next:cypress-component-configuration --project=my-cool-next-project --generate-tests
|
||||
```
|
||||
|
||||
## Running Component Tests
|
||||
@ -65,7 +65,7 @@ Here is an example of the project configuration that is generated.
|
||||
{
|
||||
"targets" {
|
||||
"component-test": {
|
||||
"executor": "@nrwl/cypress:cypress",
|
||||
"executor": "@nx/cypress:cypress",
|
||||
"options": {
|
||||
"cypressConfig": "<path-to-project-root>/cypress.config.ts",
|
||||
"testingType": "component",
|
||||
|
||||
@ -357,6 +357,12 @@ function createDocumentSections(
|
||||
.itemList as Partial<DocumentMetadata>[],
|
||||
prefix: 'recipes',
|
||||
},
|
||||
{
|
||||
name: 'plugins',
|
||||
content: documents.find((x) => x.id === 'plugins')!
|
||||
.itemList as Partial<DocumentMetadata>[],
|
||||
prefix: 'plugins',
|
||||
},
|
||||
{
|
||||
name: 'cloud',
|
||||
content: documents.find((x) => x.id === 'nx-cloud-documentation')!
|
||||
|
||||
@ -34,8 +34,11 @@ function removeAnchors(linkPath: string): string {
|
||||
function extractAllLinks(basePath: string): Record<string, string[]> {
|
||||
return glob.sync(`${basePath}/**/*.md`).reduce((acc, path) => {
|
||||
const fileContents = readFileContents(path);
|
||||
|
||||
const cardLinks = (fileContents.match(/url="(.*)"/g) || []).map((v) =>
|
||||
v.slice(5, -1)
|
||||
);
|
||||
const links = parseLinks(fileContents)
|
||||
.concat(cardLinks)
|
||||
.filter(isLinkInternal)
|
||||
.filter(isNotAsset)
|
||||
.filter(isNotImage)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user