diff --git a/docs/generated/packages/workspace/executors/run-commands.json b/docs/generated/packages/workspace/executors/run-commands.json index 04368de7ba..a4b9172630 100644 --- a/docs/generated/packages/workspace/executors/run-commands.json +++ b/docs/generated/packages/workspace/executors/run-commands.json @@ -123,6 +123,7 @@ "examplesFile": "`workspace.json`:\n\n```json\n//...\n\"frontend\": {\n \"targets\": {\n //...\n \"ls-project-root\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"command\": \"ls apps/frontend/src\"\n }\n }\n }\n}\n```\n\n```bash\nnx run frontend:ls-project-root\n```\n\n##### Chaining commands, interpolating args and setting the cwd\n\nLet's say each of our workspace projects has some custom bash scripts in a `scripts` folder.\nWe want a simple way to create empty bash script files for a given project, that have the execute permissions already set.\n\nGiven that Nx knows our workspace structure, we should be able to give it a project and the name of our script, and it should take care of the rest.\n\nThe `commands` option accepts as many commands as you want. By default, they all run in parallel.\nYou can run them sequentially by setting `parallel: false`:\n\n```json\n\"create-script\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"commands\": [\n \"mkdir -p scripts\",\n \"touch scripts/{args.name}.sh\",\n \"chmod +x scripts/{args.name}.sh\"\n ],\n \"cwd\": \"apps/frontend\",\n \"parallel\": false\n }\n}\n```\n\nBy setting the `cwd` option, each command will run in the `apps/frontend` folder.\n\nWe run the above with:\n\n```bash\nnx run frontend:create-script --args=\"--name=example\"\n```\n\nor simply with:\n\n```bash\nnx run frontend:create-script --name=example\n```\n\n##### Arguments forwarding\n\nWhen interpolation is not present in the command, all arguments are forwarded to the command by default.\n\nThis is useful when you need to pass raw argument strings to your command.\n\nFor example, when you run:\n\nnx run frontend:webpack --args=\"--config=example.config.js\"\n\n```json\n\"webpack\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"command\": \"webpack\"\n }\n}\n```\n\nThe above command will execute: `webpack --config=example.config.js`\n\nThis functionality can be disabled by using `commands` and expanding each `command` into an object\nthat sets the `forwardAllArgs` option to `false` as shown below:\n\n```json\n\"webpack\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"commands\": [\n {\n \"command\": \"webpack\",\n \"forwardAllArgs\": false\n }\n ]\n }\n}\n```\n\n##### Custom **done** conditions\n\nNormally, `run-commands` considers the commands done when all of them have finished running. If you don't need to wait until they're all done, you can set a special string that considers the commands finished the moment the string appears in `stdout` or `stderr`:\n\n```json\n\"finish-when-ready\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"commands\": [\n \"sleep 5 && echo 'FINISHED'\",\n \"echo 'READY'\"\n ],\n \"readyWhen\": \"READY\",\n \"parallel\": true\n }\n}\n```\n\n```bash\nnx run frontend:finish-when-ready\n```\n\nThe above commands will finish immediately, instead of waiting for 5 seconds.\n\n##### Nx Affected\n\nThe true power of `run-commands` comes from the fact that it runs through `nx`, which knows about your project graph. So you can run **custom commands** only for the projects that have been affected by a change.\n\nWe can create some configurations to generate docs, and if run using `nx affected`, it will only generate documentation for the projects that have been changed:\n\n```bash\nnx affected --target=generate-docs\n```\n\n```json\n//...\n\"frontend\": {\n \"targets\": {\n //...\n \"generate-docs\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"command\": \"npx compodoc -p apps/frontend/tsconfig.app.json\"\n }\n }\n }\n},\n\"api\": {\n \"targets\": {\n //...\n \"generate-docs\": {\n \"executor\": \"nx:run-commands\",\n \"options\": {\n \"command\": \"npx compodoc -p apps/api/tsconfig.app.json\"\n }\n }\n }\n}\n```\n" }, "description": "Run any custom commands with Nx.", + "x-deprecated": "Use nx:run-commands instead. This will be removed in v16.", "aliases": [], "hidden": false, "path": "/packages/workspace/src/executors/run-commands/schema.json", diff --git a/docs/generated/packages/workspace/executors/run-script.json b/docs/generated/packages/workspace/executors/run-script.json index 5cd0c35e6b..9bc1d4da6d 100644 --- a/docs/generated/packages/workspace/executors/run-script.json +++ b/docs/generated/packages/workspace/executors/run-script.json @@ -26,6 +26,7 @@ "presets": [] }, "description": "Run an NPM script using Nx.", + "x-deprecated": "Use nx:run-script instead. This will be removed in v16.", "aliases": [], "hidden": false, "path": "/packages/workspace/src/executors/run-script/schema.json", diff --git a/docs/generated/packages/workspace/generators/convert-to-nx-project.json b/docs/generated/packages/workspace/generators/convert-to-nx-project.json index 09b7fedb60..1f1d99641a 100644 --- a/docs/generated/packages/workspace/generators/convert-to-nx-project.json +++ b/docs/generated/packages/workspace/generators/convert-to-nx-project.json @@ -27,7 +27,8 @@ "skipFormat": { "description": "Skip formatting files.", "type": "boolean", - "default": false + "default": false, + "x-priority": "internal" } }, "presets": [] diff --git a/docs/generated/packages/workspace/generators/library.json b/docs/generated/packages/workspace/generators/library.json index f6f09be571..ecd48b835b 100644 --- a/docs/generated/packages/workspace/generators/library.json +++ b/docs/generated/packages/workspace/generators/library.json @@ -24,7 +24,8 @@ }, "directory": { "type": "string", - "description": "A directory where the lib is placed." + "description": "A directory where the lib is placed.", + "x-priority": "important" }, "linter": { "description": "The tool to use for running lint checks.", @@ -45,7 +46,8 @@ "skipFormat": { "description": "Skip formatting files.", "type": "boolean", - "default": false + "default": false, + "x-priority": "internal" }, "skipTsConfig": { "type": "boolean", @@ -60,7 +62,8 @@ }, "importPath": { "type": "string", - "description": "The library name used to import it, like `@myorg/my-awesome-lib`." + "description": "The library name used to import it, like `@myorg/my-awesome-lib`.", + "x-priority": "important" }, "babelJest": { "type": "boolean", @@ -100,7 +103,8 @@ }, "standaloneConfig": { "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", - "type": "boolean" + "type": "boolean", + "x-priority": "internal" } }, "required": ["name"], diff --git a/docs/generated/packages/workspace/generators/move.json b/docs/generated/packages/workspace/generators/move.json index 09bc7f5aab..65cacacee3 100644 --- a/docs/generated/packages/workspace/generators/move.json +++ b/docs/generated/packages/workspace/generators/move.json @@ -39,7 +39,8 @@ "type": "boolean", "aliases": ["skip-format"], "description": "Skip formatting files.", - "default": false + "default": false, + "x-priority": "internal" } }, "required": ["projectName", "destination"], diff --git a/docs/generated/packages/workspace/generators/remove.json b/docs/generated/packages/workspace/generators/remove.json index 1626e0e04c..f5f4a4e51d 100644 --- a/docs/generated/packages/workspace/generators/remove.json +++ b/docs/generated/packages/workspace/generators/remove.json @@ -35,7 +35,8 @@ "type": "boolean", "aliases": ["skip-format"], "description": "Skip formatting files.", - "default": false + "default": false, + "x-priority": "internal" }, "importPath": { "type": "string", diff --git a/docs/generated/packages/workspace/generators/run-commands.json b/docs/generated/packages/workspace/generators/run-commands.json index 7b9a667bea..c78cde9c2b 100644 --- a/docs/generated/packages/workspace/generators/run-commands.json +++ b/docs/generated/packages/workspace/generators/run-commands.json @@ -24,7 +24,8 @@ "project": { "description": "Project name.", "type": "string", - "x-prompt": "What project does the target belong to?" + "x-prompt": "What project does the target belong to?", + "x-dropdown": "projects" }, "command": { "description": "Command to run.", diff --git a/docs/generated/packages/workspace/generators/workspace-generator.json b/docs/generated/packages/workspace/generators/workspace-generator.json index 95d408898b..a3d7031251 100644 --- a/docs/generated/packages/workspace/generators/workspace-generator.json +++ b/docs/generated/packages/workspace/generators/workspace-generator.json @@ -17,10 +17,11 @@ "skipFormat": { "description": "Skip formatting files.", "type": "boolean", - "default": false + "default": false, + "x-priority": "internal" } }, - "required": [], + "required": ["name"], "presets": [] }, "aliases": ["workspace-schematic"], diff --git a/nx-dev/feature-package-schema-viewer/src/lib/content.tsx b/nx-dev/feature-package-schema-viewer/src/lib/content.tsx index 1e8e2030d8..ca4a568291 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/content.tsx +++ b/nx-dev/feature-package-schema-viewer/src/lib/content.tsx @@ -104,6 +104,15 @@ export function Content({ > {schemaViewModel.type} + {schemaViewModel.deprecated && ( + + )} {schemaViewModel.hidden && ( + {schemaViewModel.deprecated && ( +
+
+
+
+
+
+ Deprecated +
+

+ {schemaViewModel.deprecated} +

+
+
+
+ )} + {!schemaViewModel.subReference && schemaViewModel.hidden && (
diff --git a/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts b/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts index 1e72b1b43f..9414a3cff9 100644 --- a/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts +++ b/nx-dev/feature-package-schema-viewer/src/lib/get-schema-view-model.ts @@ -19,6 +19,7 @@ function getReferenceFromQuery(query: string): string { export interface SchemaViewModel { currentSchema: NxSchema | null; currentSchemaExamples: Example | Errors; + deprecated: string; hidden: boolean; lookup: Lookup; packageName: string; @@ -63,6 +64,7 @@ export function getSchemaViewModel( ); }, hidden: schema.hidden, + deprecated: schema['x-deprecated'], type: schema.type, }; } diff --git a/nx-dev/models-package/src/lib/package.models.ts b/nx-dev/models-package/src/lib/package.models.ts index d4021c0746..c9d47096e3 100644 --- a/nx-dev/models-package/src/lib/package.models.ts +++ b/nx-dev/models-package/src/lib/package.models.ts @@ -76,6 +76,8 @@ export interface SchemaMetadata { path: string; schema: NxSchema | null; type: 'executor' | 'generator'; + + 'x-deprecated'?: string; } export interface NxSchema extends JsonSchema1 { diff --git a/packages/workspace/executors.json b/packages/workspace/executors.json index 96bab75974..1286353cc4 100644 --- a/packages/workspace/executors.json +++ b/packages/workspace/executors.json @@ -15,7 +15,8 @@ "run-commands": { "implementation": "./src/executors/run-commands/run-commands.impl", "schema": "./src/executors/run-commands/schema.json", - "description": "Run any custom commands with Nx." + "description": "Run any custom commands with Nx.", + "x-deprecated": "Use nx:run-commands instead. This will be removed in v16." }, "counter": { "implementation": "./src/executors/counter/counter.impl", @@ -27,7 +28,8 @@ "run-script": { "implementation": "./src/executors/run-script/run-script.impl", "schema": "./src/executors/run-script/schema.json", - "description": "Run an NPM script using Nx." + "description": "Run an NPM script using Nx.", + "x-deprecated": "Use nx:run-script instead. This will be removed in v16." } } } diff --git a/packages/workspace/src/generators/convert-to-nx-project/schema.json b/packages/workspace/src/generators/convert-to-nx-project/schema.json index 7177667132..6d57c61cb5 100644 --- a/packages/workspace/src/generators/convert-to-nx-project/schema.json +++ b/packages/workspace/src/generators/convert-to-nx-project/schema.json @@ -27,7 +27,8 @@ "skipFormat": { "description": "Skip formatting files.", "type": "boolean", - "default": false + "default": false, + "x-priority": "internal" } } } diff --git a/packages/workspace/src/generators/library/schema.json b/packages/workspace/src/generators/library/schema.json index fc671e80db..4e7dc94afc 100644 --- a/packages/workspace/src/generators/library/schema.json +++ b/packages/workspace/src/generators/library/schema.json @@ -24,7 +24,8 @@ }, "directory": { "type": "string", - "description": "A directory where the lib is placed." + "description": "A directory where the lib is placed.", + "x-priority": "important" }, "linter": { "description": "The tool to use for running lint checks.", @@ -45,7 +46,8 @@ "skipFormat": { "description": "Skip formatting files.", "type": "boolean", - "default": false + "default": false, + "x-priority": "internal" }, "skipTsConfig": { "type": "boolean", @@ -60,7 +62,8 @@ }, "importPath": { "type": "string", - "description": "The library name used to import it, like `@myorg/my-awesome-lib`." + "description": "The library name used to import it, like `@myorg/my-awesome-lib`.", + "x-priority": "important" }, "babelJest": { "type": "boolean", @@ -100,7 +103,8 @@ }, "standaloneConfig": { "description": "Split the project configuration into `/project.json` rather than including it inside `workspace.json`.", - "type": "boolean" + "type": "boolean", + "x-priority": "internal" } }, "required": ["name"] diff --git a/packages/workspace/src/generators/move/schema.json b/packages/workspace/src/generators/move/schema.json index 350e90f90a..ab9355b33f 100644 --- a/packages/workspace/src/generators/move/schema.json +++ b/packages/workspace/src/generators/move/schema.json @@ -39,7 +39,8 @@ "type": "boolean", "aliases": ["skip-format"], "description": "Skip formatting files.", - "default": false + "default": false, + "x-priority": "internal" } }, "required": ["projectName", "destination"] diff --git a/packages/workspace/src/generators/remove/schema.json b/packages/workspace/src/generators/remove/schema.json index ab27686b60..72544c423a 100644 --- a/packages/workspace/src/generators/remove/schema.json +++ b/packages/workspace/src/generators/remove/schema.json @@ -35,7 +35,8 @@ "type": "boolean", "aliases": ["skip-format"], "description": "Skip formatting files.", - "default": false + "default": false, + "x-priority": "internal" }, "importPath": { "type": "string", diff --git a/packages/workspace/src/generators/run-commands/schema.json b/packages/workspace/src/generators/run-commands/schema.json index 69b2039113..39efdf3494 100644 --- a/packages/workspace/src/generators/run-commands/schema.json +++ b/packages/workspace/src/generators/run-commands/schema.json @@ -24,7 +24,8 @@ "project": { "description": "Project name.", "type": "string", - "x-prompt": "What project does the target belong to?" + "x-prompt": "What project does the target belong to?", + "x-dropdown": "projects" }, "command": { "description": "Command to run.", diff --git a/packages/workspace/src/generators/workspace-generator/schema.json b/packages/workspace/src/generators/workspace-generator/schema.json index 775975ee8d..e62495f816 100644 --- a/packages/workspace/src/generators/workspace-generator/schema.json +++ b/packages/workspace/src/generators/workspace-generator/schema.json @@ -17,8 +17,9 @@ "skipFormat": { "description": "Skip formatting files.", "type": "boolean", - "default": false + "default": false, + "x-priority": "internal" } }, - "required": [] + "required": ["name"] }