Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(nx-plugin): document local plugin functionality #9564

Merged
merged 1 commit into from
Mar 29, 2022

Conversation

AgentEnder
Copy link
Member

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

@nx-cloud
Copy link

nx-cloud bot commented Mar 28, 2022

@vercel
Copy link

vercel bot commented Mar 28, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/8GRFaJGGKM1abxxJ9Zdwegxrsrp2
✅ Preview: https://nx-dev-git-fork-agentender-docs-nx-pluginlocal-plugin-fx-nrwl.vercel.app

@isaacplmann
Copy link
Collaborator

The documentation so far looks good, but you don't describe how to use the executors in your plugin

@@ -42,6 +42,10 @@ executors.

The Nx team maintains a core set of plugins for many application and tooling frameworks. You can write [custom generators](/generators/workspace-generators) and [executors](/executors/creating-custom-builders) for your own workspace. You can also write your own plugin and share it with the community. The [Nx Plugin](/nx-plugin/overview) plugin provides guidance on how you can build your own custom plugins.

### Local workspace plugins

Nx plugins can also be used in the workspace they are generated inside of. For example, if you generate a plugin with `nx g @nrwl/nx-plugin workspace --importPath workspace`, you will be able to immediately make use of generators and executors within it. This would look like `nx g workspace:lib` for generators or `"executor": "workspace:build"` for executors. If you are only planning on making use of generators, Nx provides workspace generators which can be used rather than whole plugins. Generating a full plugin allows you to take advantage of all of the capabilities above, including project inference and graph extension, which is not possible when solely using workspace generators. Additionally, your local plugin could be set as the default collection in `nx.json`, such that running `nx g lib` would call your workspace plugin's lib generator.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have the example be

nx g @nrwl/nx-plugin myPlugin --importPath @my-org/myPlugin

At first I thought that workspace was a key word of some kind.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that makes sense. I'll update it.

@AgentEnder AgentEnder merged commit e3251d2 into nrwl:master Mar 29, 2022
@AgentEnder AgentEnder deleted the docs/nx-plugin/local-plugin-fx branch March 29, 2022 13:56
sidmonta pushed a commit to sidmonta/nx that referenced this pull request Apr 2, 2022
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants