chore(nx-plugin): add examples for generators (#17346)
This commit is contained in:
parent
7d1a44bc57
commit
901b70a4fe
@ -7,6 +7,7 @@
|
||||
"$id": "NxPluginCreatePackage",
|
||||
"title": "Create a framework package",
|
||||
"description": "Create a framework package that uses Nx CLI.",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Basic executable\" %}\n\nCreate an executable that initializes an Nx workspace with {my-plugin}'s preset:\n\n```bash\nnx g @nx/plugin:create-package create-my-plugin --project my-plugin\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
"$id": "NxPluginE2E",
|
||||
"title": "Create an E2E app for a Nx Plugin",
|
||||
"description": "Create an E2E app for a Nx Plugin.",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"E2E Project\" %}\n\nScaffolds an E2E project for the plugin `my-plugin`.\n\n```bash\nnx g @nx/plugin:e2e-project --pluginName my-plugin --npmPackageName my-plugin --pluginOutputPath dist/my-plugin\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pluginName": {
|
||||
@ -29,12 +30,6 @@
|
||||
"x-priority": "important"
|
||||
},
|
||||
"jestConfig": { "type": "string", "description": "Jest config file." },
|
||||
"standaloneConfig": {
|
||||
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"x-deprecated": "Nx only supports standaloneConfig"
|
||||
},
|
||||
"linter": {
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
"$id": "NxPluginExecutor",
|
||||
"title": "Create an Executor for an Nx Plugin",
|
||||
"description": "Create an Executor for an Nx Plugin.",
|
||||
"examplesFile": "## Examples\n\n{% tabs %}\n{% tab label=\"Basic executor\" %}\n\nCreate a new executor called `build` inside the plugin `my-plugin`:\n\n```bash\nnx g @nx/plugin:executor build --project my-plugin\n```\n\n{% /tab %}\n{% tab label=\"With custom hashing\" %}\n\nCreate a new executor called `build` inside the plugin `my-plugin`, that uses a custom hashing function:\n\n```bash\nnx g @nx/plugin:executor build --project my-plugin --includeHasher\n```\n\n{% /tab %}\n{% /tabs %}\n",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g migration my-migration --project=my-plugin --version=1.0.0",
|
||||
"description": "Generate `libs/my-plugin/src/migrations/my-migration`"
|
||||
"description": "Adds a new migration to the project `my-plugin`, which will be triggered when migrating to version 1.0.0 or above from a previous version."
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
|
||||
@ -8,6 +8,12 @@
|
||||
"title": "",
|
||||
"type": "object",
|
||||
"description": "Adds linting configuration to validate common json files for nx plugins.",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nx/plugin:lint-checks",
|
||||
"description": "Sets up linting configuration to validate common json files for an nx plugin project."
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"projectName": {
|
||||
"type": "string",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g plugin my-plugin --directory=plugins --importPath=@myorg/my-plugin",
|
||||
"description": "Generate `libs/plugins/my-plugin`"
|
||||
"description": "Generates an Nx plugin project called `plugins-my-plugin` at `libs/plugins/my-plugin`. The project will have an npm package name and import path of `@myorg/my-plugin`."
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
|
||||
@ -7,6 +7,16 @@
|
||||
"$id": "NxPluginPreset",
|
||||
"title": "Generator ran by create-nx-plugin",
|
||||
"description": "Initializes a workspace with an nx-plugin inside of it. Use as: `create-nx-plugin` or `create-nx-workspace --preset @nx/nx-plugin`.",
|
||||
"examples": [
|
||||
{
|
||||
"command": "npx create-nx-plugin",
|
||||
"description": "Creates a new Nx workspace containing an Nx plugin."
|
||||
},
|
||||
{
|
||||
"command": "npx create-nx-workspace --preset @nx/plugin",
|
||||
"description": "Creates a new Nx workspace containing an Nx plugin."
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pluginName": {
|
||||
|
||||
13
packages/plugin/docs/generators/create-package-examples.md
Normal file
13
packages/plugin/docs/generators/create-package-examples.md
Normal file
@ -0,0 +1,13 @@
|
||||
## Examples
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="Basic executable" %}
|
||||
|
||||
Create an executable that initializes an Nx workspace with {my-plugin}'s preset:
|
||||
|
||||
```bash
|
||||
nx g @nx/plugin:create-package create-my-plugin --project my-plugin
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
13
packages/plugin/docs/generators/e2e-project-examples.md
Normal file
13
packages/plugin/docs/generators/e2e-project-examples.md
Normal file
@ -0,0 +1,13 @@
|
||||
## Examples
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="E2E Project" %}
|
||||
|
||||
Scaffolds an E2E project for the plugin `my-plugin`.
|
||||
|
||||
```bash
|
||||
nx g @nx/plugin:e2e-project --pluginName my-plugin --npmPackageName my-plugin --pluginOutputPath dist/my-plugin
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
22
packages/plugin/docs/generators/executor-examples.md
Normal file
22
packages/plugin/docs/generators/executor-examples.md
Normal file
@ -0,0 +1,22 @@
|
||||
## Examples
|
||||
|
||||
{% tabs %}
|
||||
{% tab label="Basic executor" %}
|
||||
|
||||
Create a new executor called `build` inside the plugin `my-plugin`:
|
||||
|
||||
```bash
|
||||
nx g @nx/plugin:executor build --project my-plugin
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% tab label="With custom hashing" %}
|
||||
|
||||
Create a new executor called `build` inside the plugin `my-plugin`, that uses a custom hashing function:
|
||||
|
||||
```bash
|
||||
nx g @nx/plugin:executor build --project my-plugin --includeHasher
|
||||
```
|
||||
|
||||
{% /tab %}
|
||||
{% /tabs %}
|
||||
@ -4,6 +4,7 @@
|
||||
"$id": "NxPluginCreatePackage",
|
||||
"title": "Create a framework package",
|
||||
"description": "Create a framework package that uses Nx CLI.",
|
||||
"examplesFile": "../../../docs/generators/create-package-examples.md",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
"$id": "NxPluginE2E",
|
||||
"title": "Create an E2E app for a Nx Plugin",
|
||||
"description": "Create an E2E app for a Nx Plugin.",
|
||||
"examplesFile": "../../../docs/generators/e2e-project-examples.md",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pluginName": {
|
||||
@ -29,12 +30,6 @@
|
||||
"type": "string",
|
||||
"description": "Jest config file."
|
||||
},
|
||||
"standaloneConfig": {
|
||||
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"x-deprecated": "Nx only supports standaloneConfig"
|
||||
},
|
||||
"linter": {
|
||||
"description": "The tool to use for running lint checks.",
|
||||
"type": "string",
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
"$id": "NxPluginExecutor",
|
||||
"title": "Create an Executor for an Nx Plugin",
|
||||
"description": "Create an Executor for an Nx Plugin.",
|
||||
"examplesFile": "../../../docs/generators/executor-examples.md",
|
||||
"type": "object",
|
||||
"examples": [
|
||||
{
|
||||
|
||||
@ -5,6 +5,12 @@
|
||||
"title": "",
|
||||
"type": "object",
|
||||
"description": "Adds linting configuration to validate common json files for nx plugins.",
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g @nx/plugin:lint-checks",
|
||||
"description": "Sets up linting configuration to validate common json files for an nx plugin project."
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"projectName": {
|
||||
"type": "string",
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g migration my-migration --project=my-plugin --version=1.0.0",
|
||||
"description": "Generate `libs/my-plugin/src/migrations/my-migration`"
|
||||
"description": "Adds a new migration to the project `my-plugin`, which will be triggered when migrating to version 1.0.0 or above from a previous version."
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
"examples": [
|
||||
{
|
||||
"command": "nx g plugin my-plugin --directory=plugins --importPath=@myorg/my-plugin",
|
||||
"description": "Generate `libs/plugins/my-plugin`"
|
||||
"description": "Generates an Nx plugin project called `plugins-my-plugin` at `libs/plugins/my-plugin`. The project will have an npm package name and import path of `@myorg/my-plugin`."
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
|
||||
@ -4,6 +4,16 @@
|
||||
"$id": "NxPluginPreset",
|
||||
"title": "Generator ran by create-nx-plugin",
|
||||
"description": "Initializes a workspace with an nx-plugin inside of it. Use as: `create-nx-plugin` or `create-nx-workspace --preset @nx/nx-plugin`.",
|
||||
"examples": [
|
||||
{
|
||||
"command": "npx create-nx-plugin",
|
||||
"description": "Creates a new Nx workspace containing an Nx plugin."
|
||||
},
|
||||
{
|
||||
"command": "npx create-nx-workspace --preset @nx/plugin",
|
||||
"description": "Creates a new Nx workspace containing an Nx plugin."
|
||||
}
|
||||
],
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"pluginName": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user