fix(core): make --verbose consistent with NX_VERBOSE_LOGGING=true

This commit is contained in:
Victor Savkin 2022-08-19 09:12:07 -04:00
parent 6948ffdcff
commit c0dd2f5832
22 changed files with 186 additions and 137 deletions

View File

@ -159,7 +159,6 @@ jobs:
executor: linux executor: linux
environment: environment:
NX_CLOUD_DISTRIBUTED_EXECUTION: 'true' NX_CLOUD_DISTRIBUTED_EXECUTION: 'true'
NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 8
NX_E2E_CI_CACHE_KEY: e2e-circleci-linux NX_E2E_CI_CACHE_KEY: e2e-circleci-linux
NX_VERBOSE_LOGGING: 'false' NX_VERBOSE_LOGGING: 'false'
steps: steps:
@ -171,6 +170,7 @@ jobs:
os: linux os: linux
- nx/set-shas: - nx/set-shas:
main-branch-name: 'master' main-branch-name: 'master'
- run: npx nx-cloud start-ci-run --command-count=5 --agent-count=8
- run: npx nx-cloud record yarn check-imports - run: npx nx-cloud record yarn check-imports
- run: npx nx-cloud record yarn nx format:check --base=$NX_BASE --head=$NX_HEAD - run: npx nx-cloud record yarn nx format:check --base=$NX_BASE --head=$NX_HEAD
- run: npx nx-cloud record yarn check-commit - run: npx nx-cloud record yarn check-commit
@ -180,7 +180,6 @@ jobs:
name: Check Documentation name: Check Documentation
command: npx nx-cloud record yarn documentation command: npx nx-cloud record yarn documentation
no_output_timeout: 20m no_output_timeout: 20m
- run: npx nx-cloud start-ci-run --command-count=4
- run: - run:
name: Run Lint/Test/Build name: Run Lint/Test/Build
command: | command: |

View File

@ -143,7 +143,9 @@ Untracked changes
Type: boolean Type: boolean
Print additional error stack trace on failure Default: false
Prints additional information about the commands (e.g., stack traces)
### version ### version

View File

@ -193,7 +193,9 @@ Untracked changes
Type: boolean Type: boolean
Print additional error stack trace on failure Default: false
Prints additional information about the commands (e.g., stack traces)
### version ### version

View File

@ -143,7 +143,9 @@ Untracked changes
Type: boolean Type: boolean
Print additional error stack trace on failure Default: false
Prints additional information about the commands (e.g., stack traces)
### version ### version

View File

@ -175,7 +175,9 @@ Untracked changes
Type: boolean Type: boolean
Print additional error stack trace on failure Default: false
Prints additional information about the commands (e.g., stack traces)
### version ### version

View File

@ -129,7 +129,9 @@ Untracked changes
Type: boolean Type: boolean
Print additional error stack trace on failure Default: false
Prints additional information about the commands (e.g., stack traces)
### version ### version

View File

@ -129,7 +129,9 @@ Untracked changes
Type: boolean Type: boolean
Print additional error stack trace on failure Default: false
Prints additional information about the commands (e.g., stack traces)
### version ### version

View File

@ -163,7 +163,9 @@ Untracked changes
Type: boolean Type: boolean
Print additional error stack trace on failure Default: false
Prints additional information about the commands (e.g., stack traces)
### version ### version

View File

@ -27,7 +27,7 @@ Show help
Type: boolean Type: boolean
Print additional error stack trace on failure Prints additional information about the commands (e.g., stack traces)
### version ### version

View File

@ -135,7 +135,9 @@ Task to run for affected projects
Type: boolean Type: boolean
Print additional error stack trace on failure Default: false
Prints additional information about the commands (e.g., stack traces)
### version ### version

View File

@ -46,49 +46,49 @@
"name": "run-many", "name": "run-many",
"id": "run-many", "id": "run-many",
"file": "generated/cli/run-many", "file": "generated/cli/run-many",
"content": "---\ntitle: 'run-many - CLI command'\ndescription: 'Run target for multiple listed projects'\n---\n\n# run-many\n\nRun target for multiple listed projects\n\n## Usage\n\n```bash\nnx run-many\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nTest all projects:\n\n```bash\nnx run-many --target=test\n```\n\nTest proj1 and proj2:\n\n```bash\nnx run-many --target=test --projects=proj1,proj2\n```\n\nTest proj1 and proj2 in parallel:\n\n```bash\nnx run-many --target=test --projects=proj1,proj2 --parallel=2\n```\n\n## Options\n\n### all\n\nType: boolean\n\nDefault: true\n\n[deprecated] Run the target on all projects in the workspace\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### help\n\nType: boolean\n\nShow help\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nOnly run the target on projects which previously failed\n\n### output-style\n\nType: string\n\nChoices: [dynamic, static, stream, stream-without-prefixes]\n\nDefines how Nx emits outputs tasks logs\n\n### parallel\n\nType: string\n\nMax number of parallel processes [default is 3]\n\n### projects\n\nType: string\n\nProjects to run (comma delimited)\n\n### runner\n\nType: string\n\nOverride the tasks runner in `nx.json`\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### target\n\nType: string\n\nTask to run for affected projects\n\n### verbose\n\nType: boolean\n\nPrint additional error stack trace on failure\n\n### version\n\nType: boolean\n\nShow version number\n" "content": "---\ntitle: 'run-many - CLI command'\ndescription: 'Run target for multiple listed projects'\n---\n\n# run-many\n\nRun target for multiple listed projects\n\n## Usage\n\n```bash\nnx run-many\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nTest all projects:\n\n```bash\nnx run-many --target=test\n```\n\nTest proj1 and proj2:\n\n```bash\nnx run-many --target=test --projects=proj1,proj2\n```\n\nTest proj1 and proj2 in parallel:\n\n```bash\nnx run-many --target=test --projects=proj1,proj2 --parallel=2\n```\n\n## Options\n\n### all\n\nType: boolean\n\nDefault: true\n\n[deprecated] Run the target on all projects in the workspace\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### help\n\nType: boolean\n\nShow help\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nOnly run the target on projects which previously failed\n\n### output-style\n\nType: string\n\nChoices: [dynamic, static, stream, stream-without-prefixes]\n\nDefines how Nx emits outputs tasks logs\n\n### parallel\n\nType: string\n\nMax number of parallel processes [default is 3]\n\n### projects\n\nType: string\n\nProjects to run (comma delimited)\n\n### runner\n\nType: string\n\nOverride the tasks runner in `nx.json`\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### target\n\nType: string\n\nTask to run for affected projects\n\n### verbose\n\nType: boolean\n\nDefault: false\n\nPrints additional information about the commands (e.g., stack traces)\n\n### version\n\nType: boolean\n\nShow version number\n"
}, },
{ {
"name": "affected", "name": "affected",
"id": "affected", "id": "affected",
"file": "generated/cli/affected", "file": "generated/cli/affected",
"content": "---\ntitle: 'affected - CLI command'\ndescription: 'Run target for affected projects'\n---\n\n# affected\n\nRun target for affected projects\n\n## Usage\n\n```bash\nnx affected\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nRun custom target for all affected projects:\n\n```bash\nnx affected --target=custom-target\n```\n\nRun tests in parallel:\n\n```bash\nnx affected --target=test --parallel=5\n```\n\nRun the test target for all projects:\n\n```bash\nnx affected --target=test --all\n```\n\nRun tests for all the projects affected by changing the index.ts file:\n\n```bash\nnx affected --target=test --files=libs/mylib/src/index.ts\n```\n\nRun tests for all the projects affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected --target=test --base=main --head=HEAD\n```\n\nRun tests for all the projects affected by the last commit on main:\n\n```bash\nnx affected --target=test --base=main~1 --head=main\n```\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### output-style\n\nType: string\n\nChoices: [dynamic, static, stream, stream-without-prefixes]\n\nDefines how Nx emits outputs tasks logs\n\n### parallel\n\nType: string\n\nMax number of parallel processes [default is 3]\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### target\n\nType: string\n\nTask to run for affected projects\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nPrint additional error stack trace on failure\n\n### version\n\nType: boolean\n\nShow version number\n" "content": "---\ntitle: 'affected - CLI command'\ndescription: 'Run target for affected projects'\n---\n\n# affected\n\nRun target for affected projects\n\n## Usage\n\n```bash\nnx affected\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nRun custom target for all affected projects:\n\n```bash\nnx affected --target=custom-target\n```\n\nRun tests in parallel:\n\n```bash\nnx affected --target=test --parallel=5\n```\n\nRun the test target for all projects:\n\n```bash\nnx affected --target=test --all\n```\n\nRun tests for all the projects affected by changing the index.ts file:\n\n```bash\nnx affected --target=test --files=libs/mylib/src/index.ts\n```\n\nRun tests for all the projects affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected --target=test --base=main --head=HEAD\n```\n\nRun tests for all the projects affected by the last commit on main:\n\n```bash\nnx affected --target=test --base=main~1 --head=main\n```\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### output-style\n\nType: string\n\nChoices: [dynamic, static, stream, stream-without-prefixes]\n\nDefines how Nx emits outputs tasks logs\n\n### parallel\n\nType: string\n\nMax number of parallel processes [default is 3]\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### target\n\nType: string\n\nTask to run for affected projects\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nDefault: false\n\nPrints additional information about the commands (e.g., stack traces)\n\n### version\n\nType: boolean\n\nShow version number\n"
}, },
{ {
"name": "affected:graph", "name": "affected:graph",
"id": "affected-dep-graph", "id": "affected-dep-graph",
"file": "generated/cli/affected-graph", "file": "generated/cli/affected-graph",
"content": "---\ntitle: 'affected:graph - CLI command'\ndescription: 'Graph dependencies affected by changes'\n---\n\n# affected:graph\n\nGraph dependencies affected by changes\n\n## Usage\n\n```bash\nnx affected:graph\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nOpen the project graph of the workspace in the browser, and highlight the projects affected by changing the index.ts file:\n\n```bash\nnx affected:graph --files=libs/mylib/src/index.ts\n```\n\nOpen the project graph of the workspace in the browser, and highlight the projects affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected:graph --base=main --head=HEAD\n```\n\nSave the project graph of the workspace in a json file, and highlight the projects affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected:graph --base=main --head=HEAD --file=output.json\n```\n\nGenerate a static website with project graph data in an html file, highlighting the projects affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected:graph --base=main --head=HEAD --file=output.html\n```\n\nOpen the project graph of the workspace in the browser, and highlight the projects affected by the last commit on main:\n\n```bash\nnx affected:graph --base=main~1 --head=main\n```\n\nOpen the project graph of the workspace in the browser, highlight the projects affected, but exclude project-one and project-two:\n\n```bash\nnx affected:graph --exclude=project-one,project-two\n```\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### file\n\nType: string\n\nOutput file (e.g. --file=output.json or --file=dep-graph.html)\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### focus\n\nType: string\n\nUse to show the project graph for a particular project and every node that is either an ancestor or a descendant.\n\n### groupByFolder\n\nType: boolean\n\nGroup projects by folder in the project graph\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### host\n\nType: string\n\nBind the project graph server to a specific ip address.\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### open\n\nType: boolean\n\nDefault: true\n\nOpen the project graph in the browser.\n\n### port\n\nType: number\n\nBind the project graph server to a specific port.\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nPrint additional error stack trace on failure\n\n### version\n\nType: boolean\n\nShow version number\n\n### watch\n\nType: boolean\n\nDefault: false\n\nWatch for changes to project graph and update in-browser\n" "content": "---\ntitle: 'affected:graph - CLI command'\ndescription: 'Graph dependencies affected by changes'\n---\n\n# affected:graph\n\nGraph dependencies affected by changes\n\n## Usage\n\n```bash\nnx affected:graph\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nOpen the project graph of the workspace in the browser, and highlight the projects affected by changing the index.ts file:\n\n```bash\nnx affected:graph --files=libs/mylib/src/index.ts\n```\n\nOpen the project graph of the workspace in the browser, and highlight the projects affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected:graph --base=main --head=HEAD\n```\n\nSave the project graph of the workspace in a json file, and highlight the projects affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected:graph --base=main --head=HEAD --file=output.json\n```\n\nGenerate a static website with project graph data in an html file, highlighting the projects affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected:graph --base=main --head=HEAD --file=output.html\n```\n\nOpen the project graph of the workspace in the browser, and highlight the projects affected by the last commit on main:\n\n```bash\nnx affected:graph --base=main~1 --head=main\n```\n\nOpen the project graph of the workspace in the browser, highlight the projects affected, but exclude project-one and project-two:\n\n```bash\nnx affected:graph --exclude=project-one,project-two\n```\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### file\n\nType: string\n\nOutput file (e.g. --file=output.json or --file=dep-graph.html)\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### focus\n\nType: string\n\nUse to show the project graph for a particular project and every node that is either an ancestor or a descendant.\n\n### groupByFolder\n\nType: boolean\n\nGroup projects by folder in the project graph\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### host\n\nType: string\n\nBind the project graph server to a specific ip address.\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### open\n\nType: boolean\n\nDefault: true\n\nOpen the project graph in the browser.\n\n### port\n\nType: number\n\nBind the project graph server to a specific port.\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nDefault: false\n\nPrints additional information about the commands (e.g., stack traces)\n\n### version\n\nType: boolean\n\nShow version number\n\n### watch\n\nType: boolean\n\nDefault: false\n\nWatch for changes to project graph and update in-browser\n"
}, },
{ {
"name": "affected:apps", "name": "affected:apps",
"id": "affected-apps", "id": "affected-apps",
"file": "generated/cli/affected-apps", "file": "generated/cli/affected-apps",
"content": "---\ntitle: 'affected:apps - CLI command'\ndescription: 'Print applications affected by changes'\n---\n\n# affected:apps\n\n**Deprecated:** Use `nx print-affected --type=app ...` instead. This command will be removed in v15.\n\nPrint applications affected by changes\n\n## Usage\n\n```bash\nnx affected:apps\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nPrint the names of all the apps affected by changing the index.ts file:\n\n```bash\nnx affected:apps --files=libs/mylib/src/index.ts\n```\n\nPrint the names of all the apps affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected:apps --base=main --head=HEAD\n```\n\nPrint the names of all the apps affected by the last commit on main:\n\n```bash\nnx affected:apps --base=main~1 --head=main\n```\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### plain\n\nProduces a plain output for affected:apps and affected:libs\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nPrint additional error stack trace on failure\n\n### version\n\nType: boolean\n\nShow version number\n" "content": "---\ntitle: 'affected:apps - CLI command'\ndescription: 'Print applications affected by changes'\n---\n\n# affected:apps\n\n**Deprecated:** Use `nx print-affected --type=app ...` instead. This command will be removed in v15.\n\nPrint applications affected by changes\n\n## Usage\n\n```bash\nnx affected:apps\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nPrint the names of all the apps affected by changing the index.ts file:\n\n```bash\nnx affected:apps --files=libs/mylib/src/index.ts\n```\n\nPrint the names of all the apps affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected:apps --base=main --head=HEAD\n```\n\nPrint the names of all the apps affected by the last commit on main:\n\n```bash\nnx affected:apps --base=main~1 --head=main\n```\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### plain\n\nProduces a plain output for affected:apps and affected:libs\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nDefault: false\n\nPrints additional information about the commands (e.g., stack traces)\n\n### version\n\nType: boolean\n\nShow version number\n"
}, },
{ {
"name": "affected:libs", "name": "affected:libs",
"id": "affected-libs", "id": "affected-libs",
"file": "generated/cli/affected-libs", "file": "generated/cli/affected-libs",
"content": "---\ntitle: 'affected:libs - CLI command'\ndescription: 'Print libraries affected by changes'\n---\n\n# affected:libs\n\n**Deprecated:** Use `nx print-affected --type=lib ...` instead. This command will be removed in v15.\n\nPrint libraries affected by changes\n\n## Usage\n\n```bash\nnx affected:libs\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nPrint the names of all the libs affected by changing the index.ts file:\n\n```bash\nnx affected:libs --files=libs/mylib/src/index.ts\n```\n\nPrint the names of all the libs affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected:libs --base=main --head=HEAD\n```\n\nPrint the names of all the libs affected by the last commit on main:\n\n```bash\nnx affected:libs --base=main~1 --head=main\n```\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### plain\n\nProduces a plain output for affected:apps and affected:libs\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nPrint additional error stack trace on failure\n\n### version\n\nType: boolean\n\nShow version number\n" "content": "---\ntitle: 'affected:libs - CLI command'\ndescription: 'Print libraries affected by changes'\n---\n\n# affected:libs\n\n**Deprecated:** Use `nx print-affected --type=lib ...` instead. This command will be removed in v15.\n\nPrint libraries affected by changes\n\n## Usage\n\n```bash\nnx affected:libs\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nPrint the names of all the libs affected by changing the index.ts file:\n\n```bash\nnx affected:libs --files=libs/mylib/src/index.ts\n```\n\nPrint the names of all the libs affected by the changes between main and HEAD (e.g., PR):\n\n```bash\nnx affected:libs --base=main --head=HEAD\n```\n\nPrint the names of all the libs affected by the last commit on main:\n\n```bash\nnx affected:libs --base=main~1 --head=main\n```\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### plain\n\nProduces a plain output for affected:apps and affected:libs\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nDefault: false\n\nPrints additional information about the commands (e.g., stack traces)\n\n### version\n\nType: boolean\n\nShow version number\n"
}, },
{ {
"name": "print-affected", "name": "print-affected",
"id": "print-affected", "id": "print-affected",
"file": "generated/cli/print-affected", "file": "generated/cli/print-affected",
"content": "---\ntitle: 'print-affected - CLI command'\ndescription: 'Prints information about the projects and targets affected by changes'\n---\n\n# print-affected\n\nPrints information about the projects and targets affected by changes\n\n## Usage\n\n```bash\nnx print-affected\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nPrint information about affected projects and the project graph:\n\n```bash\nnx print-affected\n```\n\nPrint information about the projects affected by the changes between main and HEAD (e.g,. PR):\n\n```bash\nnx print-affected --base=main --head=HEAD\n```\n\nPrints information about the affected projects and a list of tasks to test them:\n\n```bash\nnx print-affected --target=test\n```\n\nPrints the projects property from the print-affected output:\n\n```bash\nnx print-affected --target=build --select=projects\n```\n\nPrints the tasks.target.project property from the print-affected output:\n\n```bash\nnx print-affected --target=build --select=tasks.target.project\n```\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### select\n\nType: string\n\nSelect the subset of the returned json document (e.g., --selected=projects)\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### type\n\nType: string\n\nChoices: [app, lib]\n\nSelect the type of projects to be returned (e.g., --type=app)\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nPrint additional error stack trace on failure\n\n### version\n\nType: boolean\n\nShow version number\n" "content": "---\ntitle: 'print-affected - CLI command'\ndescription: 'Prints information about the projects and targets affected by changes'\n---\n\n# print-affected\n\nPrints information about the projects and targets affected by changes\n\n## Usage\n\n```bash\nnx print-affected\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n### Examples\n\nPrint information about affected projects and the project graph:\n\n```bash\nnx print-affected\n```\n\nPrint information about the projects affected by the changes between main and HEAD (e.g,. PR):\n\n```bash\nnx print-affected --base=main --head=HEAD\n```\n\nPrints information about the affected projects and a list of tasks to test them:\n\n```bash\nnx print-affected --target=test\n```\n\nPrints the projects property from the print-affected output:\n\n```bash\nnx print-affected --target=build --select=projects\n```\n\nPrints the tasks.target.project property from the print-affected output:\n\n```bash\nnx print-affected --target=build --select=tasks.target.project\n```\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### select\n\nType: string\n\nSelect the subset of the returned json document (e.g., --selected=projects)\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### type\n\nType: string\n\nChoices: [app, lib]\n\nSelect the type of projects to be returned (e.g., --type=app)\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nDefault: false\n\nPrints additional information about the commands (e.g., stack traces)\n\n### version\n\nType: boolean\n\nShow version number\n"
}, },
{ {
"name": "format:check", "name": "format:check",
"id": "format-check", "id": "format-check",
"file": "generated/cli/format-check", "file": "generated/cli/format-check",
"content": "---\ntitle: 'format:check - CLI command'\ndescription: 'Check for un-formatted files'\n---\n\n# format:check\n\nCheck for un-formatted files\n\n## Usage\n\n```bash\nnx format:check\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### libs-and-apps\n\nType: boolean\n\nFormat only libraries and applications files.\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### projects\n\nType: array\n\nProjects to format (comma delimited)\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nPrint additional error stack trace on failure\n\n### version\n\nType: boolean\n\nShow version number\n" "content": "---\ntitle: 'format:check - CLI command'\ndescription: 'Check for un-formatted files'\n---\n\n# format:check\n\nCheck for un-formatted files\n\n## Usage\n\n```bash\nnx format:check\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### libs-and-apps\n\nType: boolean\n\nFormat only libraries and applications files.\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### projects\n\nType: array\n\nProjects to format (comma delimited)\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nDefault: false\n\nPrints additional information about the commands (e.g., stack traces)\n\n### version\n\nType: boolean\n\nShow version number\n"
}, },
{ {
"name": "format:write", "name": "format:write",
"id": "format-write", "id": "format-write",
"file": "generated/cli/format-write", "file": "generated/cli/format-write",
"content": "---\ntitle: 'format:write - CLI command'\ndescription: 'Overwrite un-formatted files'\n---\n\n# format:write\n\nOverwrite un-formatted files\n\n## Usage\n\n```bash\nnx format:write\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### libs-and-apps\n\nType: boolean\n\nFormat only libraries and applications files.\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### projects\n\nType: array\n\nProjects to format (comma delimited)\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nPrint additional error stack trace on failure\n\n### version\n\nType: boolean\n\nShow version number\n" "content": "---\ntitle: 'format:write - CLI command'\ndescription: 'Overwrite un-formatted files'\n---\n\n# format:write\n\nOverwrite un-formatted files\n\n## Usage\n\n```bash\nnx format:write\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n## Options\n\n### all\n\nType: boolean\n\nAll projects\n\n### base\n\nType: string\n\nBase of the current branch (usually main)\n\n### configuration\n\nType: string\n\nThis is the configuration to use when performing tasks on projects\n\n### exclude\n\nType: array\n\nDefault: []\n\nExclude certain projects from being processed\n\n### files\n\nType: array\n\nChange the way Nx is calculating the affected command by providing directly changed files, list of files delimited by commas\n\n### head\n\nType: string\n\nLatest commit of the current branch (usually HEAD)\n\n### help\n\nType: boolean\n\nShow help\n\n### libs-and-apps\n\nType: boolean\n\nFormat only libraries and applications files.\n\n### nx-bail\n\nType: boolean\n\nDefault: false\n\nStop command execution after the first failed task\n\n### nx-ignore-cycles\n\nType: boolean\n\nDefault: false\n\nIgnore cycles in the task graph\n\n### ~~only-failed~~\n\nType: boolean\n\nDefault: false\n\n**Deprecated:** The command to rerun failed projects will appear if projects fail. This now does nothing and will be removed in v15.\n\nIsolate projects which previously failed\n\n### projects\n\nType: array\n\nProjects to format (comma delimited)\n\n### runner\n\nType: string\n\nThis is the name of the tasks runner configured in nx.json\n\n### skip-nx-cache\n\nType: boolean\n\nDefault: false\n\nRerun the tasks even when the results are available in the cache\n\n### uncommitted\n\nType: boolean\n\nUncommitted changes\n\n### untracked\n\nType: boolean\n\nUntracked changes\n\n### verbose\n\nType: boolean\n\nDefault: false\n\nPrints additional information about the commands (e.g., stack traces)\n\n### version\n\nType: boolean\n\nShow version number\n"
}, },
{ {
"name": "migrate", "name": "migrate",
@ -136,7 +136,7 @@
"name": "repair", "name": "repair",
"id": "repair", "id": "repair",
"file": "generated/cli/repair", "file": "generated/cli/repair",
"content": "---\ntitle: 'repair - CLI command'\ndescription: 'Repair any configuration that is no longer supported by Nx.'\n---\n\n# repair\n\nRepair any configuration that is no longer supported by Nx.\n\n## Usage\n\n```bash\nnx repair\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n## Options\n\n### help\n\nType: boolean\n\nShow help\n\n### verbose\n\nType: boolean\n\nPrint additional error stack trace on failure\n\n### version\n\nType: boolean\n\nShow version number\n" "content": "---\ntitle: 'repair - CLI command'\ndescription: 'Repair any configuration that is no longer supported by Nx.'\n---\n\n# repair\n\nRepair any configuration that is no longer supported by Nx.\n\n## Usage\n\n```bash\nnx repair\n```\n\n[Install `nx` globally](/getting-started/nx-setup#install-nx) to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpx nx`.\n\n## Options\n\n### help\n\nType: boolean\n\nShow help\n\n### verbose\n\nType: boolean\n\nPrints additional information about the commands (e.g., stack traces)\n\n### version\n\nType: boolean\n\nShow version number\n"
} }
], ],
"generators": [], "generators": [],

View File

@ -36,6 +36,10 @@ export async function affected(
nxJson nxJson
); );
if (nxArgs.verbose) {
process.env.NX_VERBOSE_LOGGING = 'true';
}
await connectToNxCloudUsingScan(nxArgs.scan); await connectToNxCloudUsingScan(nxArgs.scan);
const projectGraph = await createProjectGraphAsync(); const projectGraph = await createProjectGraphAsync();

View File

@ -268,9 +268,8 @@ export function printGenHelp(
export async function newWorkspace(cwd: string, args: { [k: string]: any }) { export async function newWorkspace(cwd: string, args: { [k: string]: any }) {
const ws = new Workspaces(null); const ws = new Workspaces(null);
const isVerbose = args['verbose'];
return handleErrors(isVerbose, async () => { return handleErrors(false, async () => {
const opts = await convertToGenerateOptions(args, ws, null, 'new'); const opts = await convertToGenerateOptions(args, ws, null, 'new');
const { normalizedGeneratorName, schema, implementationFactory } = const { normalizedGeneratorName, schema, implementationFactory } =
ws.readGenerator(opts.collectionName, opts.generatorName); ws.readGenerator(opts.collectionName, opts.generatorName);
@ -288,11 +287,11 @@ export async function newWorkspace(cwd: string, args: { [k: string]: any }) {
opts.interactive, opts.interactive,
null, null,
null, null,
isVerbose false
); );
if (ws.isNxGenerator(opts.collectionName, normalizedGeneratorName)) { if (ws.isNxGenerator(opts.collectionName, normalizedGeneratorName)) {
const host = new FsTree(cwd, isVerbose); const host = new FsTree(cwd, false);
const implementation = implementationFactory(); const implementation = implementationFactory();
const task = await implementation(host, combinedOpts); const task = await implementation(host, combinedOpts);
const changes = host.listChanges(); const changes = host.listChanges();
@ -313,25 +312,29 @@ export async function newWorkspace(cwd: string, args: { [k: string]: any }) {
...opts, ...opts,
generatorOptions: combinedOpts, generatorOptions: combinedOpts,
}, },
isVerbose false
); );
} }
}); });
} }
export async function generate(cwd: string, args: { [k: string]: any }) { export async function generate(cwd: string, args: { [k: string]: any }) {
if (args['verbose']) {
process.env.NX_VERBOSE_LOGGING = 'true';
}
const verbose = process.env.NX_VERBOSE_LOGGING === 'true';
const ws = new Workspaces(workspaceRoot); const ws = new Workspaces(workspaceRoot);
const nxJson = readNxJson(); const nxJson = readNxJson();
const projectGraph = await createProjectGraphAsync(); const projectGraph = await createProjectGraphAsync();
const projectsConfiguration = const projectsConfiguration =
readProjectsConfigurationFromProjectGraph(projectGraph); readProjectsConfigurationFromProjectGraph(projectGraph);
const workspaceConfiguration = { const workspaceConfiguration = {
...nxJson, ...nxJson,
...projectsConfiguration, ...projectsConfiguration,
}; };
const isVerbose = args['verbose']; return handleErrors(verbose, async () => {
return handleErrors(isVerbose, async () => {
const opts = await convertToGenerateOptions( const opts = await convertToGenerateOptions(
args, args,
ws, ws,
@ -360,11 +363,11 @@ export async function generate(cwd: string, args: { [k: string]: any }) {
opts.interactive, opts.interactive,
ws.calculateDefaultProjectName(cwd, workspaceConfiguration), ws.calculateDefaultProjectName(cwd, workspaceConfiguration),
ws.relativeCwd(cwd), ws.relativeCwd(cwd),
isVerbose verbose
); );
if (ws.isNxGenerator(opts.collectionName, normalizedGeneratorName)) { if (ws.isNxGenerator(opts.collectionName, normalizedGeneratorName)) {
const host = new FsTree(workspaceRoot, isVerbose); const host = new FsTree(workspaceRoot, verbose);
const implementation = implementationFactory(); const implementation = implementationFactory();
const task = await implementation(host, combinedOpts); const task = await implementation(host, combinedOpts);
const changes = host.listChanges(); const changes = host.listChanges();
@ -386,7 +389,7 @@ export async function generate(cwd: string, args: { [k: string]: any }) {
...opts, ...opts,
generatorOptions: combinedOpts, generatorOptions: combinedOpts,
}, },
isVerbose verbose
); );
} }
}); });

View File

@ -1104,7 +1104,11 @@ async function runNxMigration(root: string, packageName: string, name: string) {
} }
export async function migrate(root: string, args: { [k: string]: any }) { export async function migrate(root: string, args: { [k: string]: any }) {
return handleErrors(args['verbose'], async () => { if (args['verbose']) {
process.env.NX_VERBOSE_LOGGING = 'true';
}
return handleErrors(process.env.NX_VERBOSE_LOGGING === 'true', async () => {
const opts = parseMigrationsOptions(args); const opts = parseMigrationsOptions(args);
if (opts.type === 'generateMigrations') { if (opts.type === 'generateMigrations') {
await generateMigrationsJsonAndUpdatePackageJson(root, opts); await generateMigrationsJsonAndUpdatePackageJson(root, opts);

View File

@ -315,7 +315,8 @@ export const commandsObject = yargs
(yargs) => (yargs) =>
linkToNxDevAndExamples(yargs, 'repair').option('verbose', { linkToNxDevAndExamples(yargs, 'repair').option('verbose', {
type: 'boolean', type: 'boolean',
describe: 'Print additional error stack trace on failure', describe:
'Prints additional information about the commands (e.g., stack traces)',
}), }),
async (args) => process.exit(await (await import('./repair')).repair(args)) async (args) => process.exit(await (await import('./repair')).repair(args))
) )
@ -449,7 +450,9 @@ function withAffectedOptions(yargs: yargs.Argv): yargs.Argv {
}) })
.option('verbose', { .option('verbose', {
type: 'boolean', type: 'boolean',
describe: 'Print additional error stack trace on failure', describe:
'Prints additional information about the commands (e.g., stack traces)',
default: false,
}) })
.option('nx-bail', { .option('nx-bail', {
describe: 'Stop command execution after the first failed task', describe: 'Stop command execution after the first failed task',
@ -515,7 +518,9 @@ function withRunManyOptions(yargs: yargs.Argv): yargs.Argv {
}) })
.option('verbose', { .option('verbose', {
type: 'boolean', type: 'boolean',
describe: 'Print additional error stack trace on failure', describe:
'Prints additional information about the commands (e.g., stack traces)',
default: false,
}) })
.option('nx-bail', { .option('nx-bail', {
describe: 'Stop command execution after the first failed task', describe: 'Stop command execution after the first failed task',
@ -643,6 +648,12 @@ function withGenerateOptions(yargs: yargs.Argv) {
describe: 'When false disables interactive input prompts for options', describe: 'When false disables interactive input prompts for options',
type: 'boolean', type: 'boolean',
default: true, default: true,
})
.option('verbose', {
describe:
'Prints additional information about the commands (e.g., stack traces)',
type: 'boolean',
default: false,
}); });
if (generatorWillShowHelp) { if (generatorWillShowHelp) {
@ -698,6 +709,12 @@ function withRunOneOptions(yargs: yargs.Argv) {
describe: 'Ignore cycles in the task graph', describe: 'Ignore cycles in the task graph',
type: 'boolean', type: 'boolean',
default: false, default: false,
})
.option('verbose', {
type: 'boolean',
describe:
'Prints additional information about the commands (e.g., stack traces)',
default: false,
}); });
if (executorShouldShowHelp) { if (executorShouldShowHelp) {

View File

@ -7,7 +7,11 @@ export async function repair(
args: { verbose: boolean }, args: { verbose: boolean },
extraMigrations = [] as any[] extraMigrations = [] as any[]
) { ) {
return handleErrors(args['verbose'], async () => { if (args['verbose']) {
process.env.NX_VERBOSE_LOGGING = 'true';
}
const verbose = process.env.NX_VERBOSE_LOGGING === 'true';
return handleErrors(verbose, async () => {
const nxMigrations = Object.entries(migrationsJson.generators).map( const nxMigrations = Object.entries(migrationsJson.generators).map(
([name, migration]) => { ([name, migration]) => {
return { return {
@ -24,7 +28,7 @@ export async function repair(
const migrationsThatMadeNoChanges = await executeMigrations( const migrationsThatMadeNoChanges = await executeMigrations(
process.cwd(), process.cwd(),
migrations, migrations,
args['verbose'], verbose,
false, false,
'' ''
); );

View File

@ -26,6 +26,9 @@ export async function runMany(
{ printWarnings: true }, { printWarnings: true },
nxJson nxJson
); );
if (nxArgs.verbose) {
process.env.NX_VERBOSE_LOGGING = 'true';
}
await connectToNxCloudUsingScan(nxArgs.scan); await connectToNxCloudUsingScan(nxArgs.scan);

View File

@ -46,7 +46,9 @@ export async function runOne(
{ printWarnings: true }, { printWarnings: true },
nxJson nxJson
); );
if (nxArgs.verbose) {
process.env.NX_VERBOSE_LOGGING = 'true';
}
if (nxArgs.help) { if (nxArgs.help) {
await ( await (
await import('./run') await import('./run')

View File

@ -26,6 +26,7 @@ export class ForkedProcessTaskRunner {
workspaceRoot = workspaceRoot; workspaceRoot = workspaceRoot;
cliPath = getCliPath(); cliPath = getCliPath();
private readonly verbose = process.env.NX_VERBOSE_LOGGING === 'true';
private processes = new Set<ChildProcess>(); private processes = new Set<ChildProcess>();
constructor(private readonly options: DefaultTasksRunnerOptions) { constructor(private readonly options: DefaultTasksRunnerOptions) {
@ -107,10 +108,7 @@ export class ForkedProcessTaskRunner {
return new Promise<{ code: number; terminalOutput: string }>((res, rej) => { return new Promise<{ code: number; terminalOutput: string }>((res, rej) => {
try { try {
const args = getPrintableCommandArgsForTask(task); const args = getPrintableCommandArgsForTask(task);
const serializedArgs = getSerializedArgsForTask( const serializedArgs = getSerializedArgsForTask(task, this.verbose);
task,
task.overrides['verbose'] === true
);
if (streamOutput) { if (streamOutput) {
output.logCommand(args.join(' ')); output.logCommand(args.join(' '));
output.addNewline(); output.addNewline();
@ -186,10 +184,7 @@ export class ForkedProcessTaskRunner {
return new Promise<{ code: number; terminalOutput: string }>((res, rej) => { return new Promise<{ code: number; terminalOutput: string }>((res, rej) => {
try { try {
const args = getPrintableCommandArgsForTask(task); const args = getPrintableCommandArgsForTask(task);
const serializedArgs = getSerializedArgsForTask( const serializedArgs = getSerializedArgsForTask(task, this.verbose);
task,
task.overrides['verbose'] === true
);
if (streamOutput) { if (streamOutput) {
output.logCommand(args.join(' ')); output.logCommand(args.join(' '));
output.addNewline(); output.addNewline();

View File

@ -112,100 +112,103 @@ export async function runCommand(
initiatingProject: string | null, initiatingProject: string | null,
extraTargetDependencies: Record<string, (TargetDependencyConfig | string)[]> extraTargetDependencies: Record<string, (TargetDependencyConfig | string)[]>
) { ) {
const status = await handleErrors(overrides['verbose'] === true, async () => { const status = await handleErrors(
const { tasksRunner, runnerOptions } = getRunner(nxArgs, nxJson); process.env.NX_VERBOSE_LOGGING === 'true',
async () => {
const { tasksRunner, runnerOptions } = getRunner(nxArgs, nxJson);
const defaultDependencyConfigs = mergeTargetDependencies( const defaultDependencyConfigs = mergeTargetDependencies(
nxJson.targetDefaults, nxJson.targetDefaults,
extraTargetDependencies extraTargetDependencies
); );
const projectNames = projectsToRun.map((t) => t.name); const projectNames = projectsToRun.map((t) => t.name);
const taskGraph = createTaskGraph( const taskGraph = createTaskGraph(
projectGraph,
defaultDependencyConfigs,
projectNames,
[nxArgs.target],
nxArgs.configuration,
overrides
);
const hasher = new Hasher(projectGraph, nxJson, runnerOptions);
await hashTasksThatDontDependOnOtherTasks(
new Workspaces(workspaceRoot),
hasher,
projectGraph,
taskGraph
);
const cycle = findCycle(taskGraph);
if (cycle) {
if (nxArgs.nxIgnoreCycles) {
output.warn({
title: `The task graph has a circular dependency`,
bodyLines: [`${cycle.join(' --> ')}`],
});
makeAcyclic(taskGraph);
} else {
output.error({
title: `Could not execute command because the task graph has a circular dependency`,
bodyLines: [`${cycle.join(' --> ')}`],
});
process.exit(1);
}
}
const tasks = Object.values(taskGraph.tasks);
if (nxArgs.outputStyle == 'stream') {
process.env.NX_STREAM_OUTPUT = 'true';
process.env.NX_PREFIX_OUTPUT = 'true';
}
if (nxArgs.outputStyle == 'stream-without-prefixes') {
process.env.NX_STREAM_OUTPUT = 'true';
}
const { lifeCycle, renderIsDone } = await getTerminalOutputLifeCycle(
initiatingProject,
projectNames,
tasks,
nxArgs,
overrides,
runnerOptions
);
const lifeCycles = [lifeCycle] as LifeCycle[];
if (process.env.NX_PERF_LOGGING) {
lifeCycles.push(new TaskTimingsLifeCycle());
}
if (process.env.NX_PROFILE) {
lifeCycles.push(new TaskProfilingLifeCycle(process.env.NX_PROFILE));
}
const promiseOrObservable = tasksRunner(
tasks,
{ ...runnerOptions, lifeCycle: new CompositeLifeCycle(lifeCycles) },
{
initiatingProject:
nxArgs.outputStyle === 'compact' ? null : initiatingProject,
target: nxArgs.target,
projectGraph, projectGraph,
nxJson, defaultDependencyConfigs,
nxArgs, projectNames,
taskGraph, [nxArgs.target],
nxArgs.configuration,
overrides
);
const hasher = new Hasher(projectGraph, nxJson, runnerOptions);
await hashTasksThatDontDependOnOtherTasks(
new Workspaces(workspaceRoot),
hasher, hasher,
daemon: new DaemonClient(nxJson), projectGraph,
taskGraph
);
const cycle = findCycle(taskGraph);
if (cycle) {
if (nxArgs.nxIgnoreCycles) {
output.warn({
title: `The task graph has a circular dependency`,
bodyLines: [`${cycle.join(' --> ')}`],
});
makeAcyclic(taskGraph);
} else {
output.error({
title: `Could not execute command because the task graph has a circular dependency`,
bodyLines: [`${cycle.join(' --> ')}`],
});
process.exit(1);
}
} }
);
let anyFailures; const tasks = Object.values(taskGraph.tasks);
if ((promiseOrObservable as any).subscribe) { if (nxArgs.outputStyle == 'stream') {
anyFailures = await anyFailuresInObservable(promiseOrObservable); process.env.NX_STREAM_OUTPUT = 'true';
} else { process.env.NX_PREFIX_OUTPUT = 'true';
// simply await the promise }
anyFailures = await anyFailuresInPromise(promiseOrObservable as any); if (nxArgs.outputStyle == 'stream-without-prefixes') {
process.env.NX_STREAM_OUTPUT = 'true';
}
const { lifeCycle, renderIsDone } = await getTerminalOutputLifeCycle(
initiatingProject,
projectNames,
tasks,
nxArgs,
overrides,
runnerOptions
);
const lifeCycles = [lifeCycle] as LifeCycle[];
if (process.env.NX_PERF_LOGGING) {
lifeCycles.push(new TaskTimingsLifeCycle());
}
if (process.env.NX_PROFILE) {
lifeCycles.push(new TaskProfilingLifeCycle(process.env.NX_PROFILE));
}
const promiseOrObservable = tasksRunner(
tasks,
{ ...runnerOptions, lifeCycle: new CompositeLifeCycle(lifeCycles) },
{
initiatingProject:
nxArgs.outputStyle === 'compact' ? null : initiatingProject,
target: nxArgs.target,
projectGraph,
nxJson,
nxArgs,
taskGraph,
hasher,
daemon: new DaemonClient(nxJson),
}
);
let anyFailures;
if ((promiseOrObservable as any).subscribe) {
anyFailures = await anyFailuresInObservable(promiseOrObservable);
} else {
// simply await the promise
anyFailures = await anyFailuresInPromise(promiseOrObservable as any);
}
await renderIsDone;
return anyFailures ? 1 : 0;
} }
await renderIsDone; );
return anyFailures ? 1 : 0;
});
// fix for https://github.com/nrwl/nx/issues/1666 // fix for https://github.com/nrwl/nx/issues/1666
if (process.stdin['unref']) (process.stdin as any).unref(); if (process.stdin['unref']) (process.stdin as any).unref();
process.exit(status); process.exit(status);

View File

@ -254,12 +254,10 @@ export function getPrintableCommandArgsForTask(task: Task) {
} }
export function getSerializedArgsForTask(task: Task, isVerbose: boolean) { export function getSerializedArgsForTask(task: Task, isVerbose: boolean) {
const overrides = { ...task.overrides };
delete overrides['verbose'];
return [ return [
JSON.stringify({ JSON.stringify({
targetDescription: task.target, targetDescription: task.target,
overrides: overrides, overrides: task.overrides,
isVerbose: isVerbose, isVerbose: isVerbose,
}), }),
]; ];

View File

@ -81,6 +81,7 @@ const runOne: string[] = [
'outputStyle', 'outputStyle',
'nxBail', 'nxBail',
'nxIgnoreCycles', 'nxIgnoreCycles',
'verbose',
]; ];
const runMany: string[] = [...runOne, 'projects', 'all']; const runMany: string[] = [...runOne, 'projects', 'all'];