diff --git a/docs/generated/packages/plugin/generators/create-package.json b/docs/generated/packages/plugin/generators/create-package.json index 31d0171dbd..81a8d5f1d6 100644 --- a/docs/generated/packages/plugin/generators/create-package.json +++ b/docs/generated/packages/plugin/generators/create-package.json @@ -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": { diff --git a/docs/generated/packages/plugin/generators/e2e-project.json b/docs/generated/packages/plugin/generators/e2e-project.json index 67f305138c..3f6aff6b7f 100644 --- a/docs/generated/packages/plugin/generators/e2e-project.json +++ b/docs/generated/packages/plugin/generators/e2e-project.json @@ -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 `/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", diff --git a/docs/generated/packages/plugin/generators/executor.json b/docs/generated/packages/plugin/generators/executor.json index 2c3d9d5836..c051d667f6 100644 --- a/docs/generated/packages/plugin/generators/executor.json +++ b/docs/generated/packages/plugin/generators/executor.json @@ -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": [ { diff --git a/docs/generated/packages/plugin/generators/migration.json b/docs/generated/packages/plugin/generators/migration.json index 86b39acba2..10ba13c23b 100644 --- a/docs/generated/packages/plugin/generators/migration.json +++ b/docs/generated/packages/plugin/generators/migration.json @@ -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": { diff --git a/docs/generated/packages/plugin/generators/plugin-lint-checks.json b/docs/generated/packages/plugin/generators/plugin-lint-checks.json index 3139aae60e..bdf4a50fe7 100644 --- a/docs/generated/packages/plugin/generators/plugin-lint-checks.json +++ b/docs/generated/packages/plugin/generators/plugin-lint-checks.json @@ -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", diff --git a/docs/generated/packages/plugin/generators/plugin.json b/docs/generated/packages/plugin/generators/plugin.json index d0fa0cbfbb..08671955a5 100644 --- a/docs/generated/packages/plugin/generators/plugin.json +++ b/docs/generated/packages/plugin/generators/plugin.json @@ -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": { diff --git a/docs/generated/packages/plugin/generators/preset.json b/docs/generated/packages/plugin/generators/preset.json index ba1a0769f0..4a0ba2b843 100644 --- a/docs/generated/packages/plugin/generators/preset.json +++ b/docs/generated/packages/plugin/generators/preset.json @@ -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": { diff --git a/packages/plugin/docs/generators/create-package-examples.md b/packages/plugin/docs/generators/create-package-examples.md new file mode 100644 index 0000000000..0cd418a9cd --- /dev/null +++ b/packages/plugin/docs/generators/create-package-examples.md @@ -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 %} diff --git a/packages/plugin/docs/generators/e2e-project-examples.md b/packages/plugin/docs/generators/e2e-project-examples.md new file mode 100644 index 0000000000..8c914224ab --- /dev/null +++ b/packages/plugin/docs/generators/e2e-project-examples.md @@ -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 %} diff --git a/packages/plugin/docs/generators/executor-examples.md b/packages/plugin/docs/generators/executor-examples.md new file mode 100644 index 0000000000..1e29f13353 --- /dev/null +++ b/packages/plugin/docs/generators/executor-examples.md @@ -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 %} diff --git a/packages/plugin/src/generators/create-package/schema.json b/packages/plugin/src/generators/create-package/schema.json index 73a7bc0e24..fc85ba9b3f 100644 --- a/packages/plugin/src/generators/create-package/schema.json +++ b/packages/plugin/src/generators/create-package/schema.json @@ -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": { diff --git a/packages/plugin/src/generators/e2e-project/schema.json b/packages/plugin/src/generators/e2e-project/schema.json index ae5729dfaf..d9b7dca818 100644 --- a/packages/plugin/src/generators/e2e-project/schema.json +++ b/packages/plugin/src/generators/e2e-project/schema.json @@ -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 `/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", diff --git a/packages/plugin/src/generators/executor/schema.json b/packages/plugin/src/generators/executor/schema.json index 4337938fa6..211c25b01a 100644 --- a/packages/plugin/src/generators/executor/schema.json +++ b/packages/plugin/src/generators/executor/schema.json @@ -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": [ { diff --git a/packages/plugin/src/generators/lint-checks/schema.json b/packages/plugin/src/generators/lint-checks/schema.json index a82390b6a3..81142fed83 100644 --- a/packages/plugin/src/generators/lint-checks/schema.json +++ b/packages/plugin/src/generators/lint-checks/schema.json @@ -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", diff --git a/packages/plugin/src/generators/migration/schema.json b/packages/plugin/src/generators/migration/schema.json index 73c4282cc4..e1d0903faa 100644 --- a/packages/plugin/src/generators/migration/schema.json +++ b/packages/plugin/src/generators/migration/schema.json @@ -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": { diff --git a/packages/plugin/src/generators/plugin/schema.json b/packages/plugin/src/generators/plugin/schema.json index d3fde1578f..99b089c8c0 100644 --- a/packages/plugin/src/generators/plugin/schema.json +++ b/packages/plugin/src/generators/plugin/schema.json @@ -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": { diff --git a/packages/plugin/src/generators/preset/schema.json b/packages/plugin/src/generators/preset/schema.json index 3d5f5f0b1a..24676350cf 100644 --- a/packages/plugin/src/generators/preset/schema.json +++ b/packages/plugin/src/generators/preset/schema.json @@ -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": {