|
1 | | -import { runCommand } from '../../tasks-runner/run-command'; |
| 1 | +import { calculateDefaultProjectName } from '../../config/calculate-default-project-name'; |
| 2 | +import { readNxJson } from '../../config/configuration'; |
| 3 | +import { NxJsonConfiguration } from '../../config/nx-json'; |
2 | 4 | import { |
3 | | - readGraphFileFromGraphArg, |
4 | | - splitArgsIntoNxArgsAndOverrides, |
5 | | -} from '../../utils/command-line-utils'; |
6 | | -import { connectToNxCloudIfExplicitlyAsked } from '../nx-cloud/connect/connect-to-nx-cloud'; |
| 5 | + ProjectGraph, |
| 6 | + ProjectGraphProjectNode, |
| 7 | +} from '../../config/project-graph'; |
| 8 | +import { TargetDependencyConfig } from '../../config/workspace-json-project-json'; |
7 | 9 | import { |
8 | 10 | createProjectGraphAsync, |
9 | 11 | readProjectsConfigurationFromProjectGraph, |
10 | 12 | } from '../../project-graph/project-graph'; |
| 13 | +import { runCommand } from '../../tasks-runner/run-command'; |
11 | 14 | import { |
12 | | - ProjectGraph, |
13 | | - ProjectGraphProjectNode, |
14 | | -} from '../../config/project-graph'; |
15 | | -import { NxJsonConfiguration } from '../../config/nx-json'; |
16 | | -import { workspaceRoot } from '../../utils/workspace-root'; |
17 | | -import { splitTarget } from '../../utils/split-target'; |
| 15 | + readGraphFileFromGraphArg, |
| 16 | + splitArgsIntoNxArgsAndOverrides, |
| 17 | +} from '../../utils/command-line-utils'; |
| 18 | +import { findMatchingProjects } from '../../utils/find-matching-projects'; |
18 | 19 | import { output } from '../../utils/output'; |
19 | | -import { TargetDependencyConfig } from '../../config/workspace-json-project-json'; |
20 | | -import { readNxJson } from '../../config/configuration'; |
21 | | -import { calculateDefaultProjectName } from '../../config/calculate-default-project-name'; |
| 20 | +import { splitTarget } from '../../utils/split-target'; |
| 21 | +import { workspaceRoot } from '../../utils/workspace-root'; |
22 | 22 | import { generateGraph } from '../graph/graph'; |
23 | | -import { findMatchingProjects } from '../../utils/find-matching-projects'; |
| 23 | +import { connectToNxCloudIfExplicitlyAsked } from '../nx-cloud/connect/connect-to-nx-cloud'; |
24 | 24 |
|
25 | 25 | export async function runOne( |
26 | 26 | cwd: string, |
@@ -56,15 +56,23 @@ export async function runOne( |
56 | 56 | nxJson |
57 | 57 | ); |
58 | 58 |
|
| 59 | + const { projects, projectName } = getProjects(projectGraph, opts.project); |
| 60 | + |
59 | 61 | if (nxArgs.help) { |
60 | | - await (await import('./run')).printTargetRunHelp(opts, workspaceRoot); |
| 62 | + await ( |
| 63 | + await import('./run') |
| 64 | + ).printTargetRunHelp( |
| 65 | + { |
| 66 | + ...opts, |
| 67 | + project: projectName, |
| 68 | + }, |
| 69 | + workspaceRoot |
| 70 | + ); |
61 | 71 | process.exit(0); |
62 | 72 | } |
63 | 73 |
|
64 | 74 | await connectToNxCloudIfExplicitlyAsked(nxArgs); |
65 | 75 |
|
66 | | - const { projects, projectName } = getProjects(projectGraph, opts.project); |
67 | | - |
68 | 76 | if (nxArgs.graph) { |
69 | 77 | const projectNames = projects.map((t) => t.name); |
70 | 78 | const file = readGraphFileFromGraphArg(nxArgs); |
|
0 commit comments