docs(docs): update nx plugin docs with info on how to submit plugin

This also includes a `submit-plugin` utility that will automatically open the browser with the
correct PR template
This commit is contained in:
Jonathan Cammisuli 2020-03-06 15:05:46 -05:00 committed by Victor Savkin
parent dbf6fd525d
commit 0a25cfd58f
3 changed files with 27 additions and 2 deletions

View File

@ -253,4 +253,10 @@ After that, you can then install your plugin like any other npm package,
### Listing your Nx Plugin
If you would like your plugin to be included with the `nx list` command, open up an issue on the [Nrwl/nx repo](https://github.com/nrwl/nx/issues/new) and let's discuss!
Nx provides a utility (`nx list`) that lists all approved plugins.
To add your plugin modify the `community/approved-plugins.json` file in the [Nrwl/nx](https://github.com/nrwl/nx/blob/master/community/approved-plugins.json) repo and create a pull request with `yarn submit-plugin`.
The `yarn submit-plugin` command automatically opens the Github pull request process with the correct template.
We will then verify the plugin, offer suggestions or merge the pull request!

View File

@ -28,7 +28,8 @@
"checkimports": "node ./scripts/check-imports.js",
"checkversions": "ts-node ./scripts/check-versions.ts",
"local-registry": "./scripts/local-registry.sh",
"documentation": "./scripts/documentation/documentation.sh && ./scripts/documentation/check-documentation.sh"
"documentation": "./scripts/documentation/documentation.sh && ./scripts/documentation/check-documentation.sh",
"submit-plugin": "node ./scripts/submit-plugin.js"
},
"devDependencies": {
"@angular-devkit/architect": "~0.900.1",

18
scripts/submit-plugin.js Normal file
View File

@ -0,0 +1,18 @@
const open = require('open');
const childProcess = require('child_process');
function createPullRequest() {
const remoteUrl = childProcess
.execSync(`git ls-remote --get-url origin`)
.toString('utf-8')
.trim();
const remoteName = remoteUrl.match(/[\/|:](\w+?)\//)[1];
const branchName = childProcess
.execSync('git rev-parse --abbrev-ref HEAD')
.toString('utf-8')
.trim();
const prUrl = `https://github.com/nrwl/nx/compare/master...${remoteName}:${branchName}?expand=1&template=COMMUNITY_PLUGIN.md`;
open(prUrl);
}
createPullRequest();