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 for local generators and executors #9403
Comments
Hey! Thanks for taking the time to create the issue! Some docs changes are certainly planned before this change is live, so look forward to them. Until then, the process isn't changed. |
Hey @AgentEnder, thanks for the fast reply! Any idea when this change will be live? |
Not particularly, it should be in 13.10, should be early betas soonish to test. |
Awesome! Waiting for this before starting my first Nx plugins. Neo4J and Passport generators for NestJS. |
BTW, where can I find documentation for From https://nx.dev/generators/workspace-generators
https://nx.dev/guides/nx-devkit-angular-devkit At the top it says
However the link the the Nx Devkit guide no longer exists. |
What I could find in the code getWorkspaceLayout(tree: Tree) invokeNxGenerator<T = any>(
generator: Generator<T>,
options: T,
skipWritingConfigInOldFormat?: boolean moveFilesToNewDirectory(
tree: Tree,
oldDir: string,
newDir: string
) names(name: string): {
name: string;
className: string;
propertyName: string;
constantName: string;
fileName: string;
} offsetFromRoot(fullPathToDir: string): string applyChangesToString(
text: string,
changes: StringChange[]
): string Applies a list of changes to a string's original value. This is useful when working with ASTs. For Example, to rename a property in a method's options: const code = bootstrap({
target: document.querySelector('#app')
})
const indexOfPropertyName = 13; // Usually determined by analyzing an AST.
const updatedCode = applyChangesToString(code, [
{
type: ChangeType.Insert,
index: indexOfPropertyName,
text: 'element'
},
{
type: ChangeType.Delete,
start: indexOfPropertyName,
length: 6
},
]);
bootstrap({
element: document.querySelector('#app')
}); Please someone improve the docs for writing generators and the utility functions available. Also please help improve the toolkit for this, especially for working with ASTs such as demonstrated in this video https://www.youtube.com/watch?v=9CsHV4umWR8 and https://www.youtube.com/watch?v=1eHlaVoeDfU&t=633s The generator using AST mods is available here: https://github.com/nxtend-team/nxtend/tree/main/packages/ionic-angular/src/generators/page The AST mod part is here: https://github.com/nxtend-team/nxtend/blob/main/packages/ionic-angular/src/generators/page/lib/update-routing-file.ts PS: This comment should likely be turned into a documentation feature request |
I'm going to close this, some docs were added as part of #9564
https://nx.dev/using-nx/nx-devkit
Yeah, that'd be my recommendation. Do you care to pull the meat out of the requests and post it separately? Thanks! |
This link (https://nx.dev/using-nx/nx-devkit) points me to the getting started intro page. Is this intended? I can not find the documentation from the pull request on the website. Please point me to the correct URL, in case I missed it. :) |
#9730 will fix it, definitely unintended. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Documentation issue
Is there a specific documentation page you are reporting?
Additional context or description
Hey @AgentEnder, thanks for completing #9116. This change is going to make local plugins much more usable.
I feel some doc changes may be required to clarify the process of creating and using local generators and executors now that they don't need to be manually compiled:
nx workspace-generator
command been deprecated? (also, does Nx Console need to be updated?)/tools
directory, including the requiredpackage.json
file(s)./tools/executors/executors.json
. Is this the recommended approach?The text was updated successfully, but these errors were encountered: