* Invokes the `ng-dev release build` command in order to build the release * packages for the currently checked out branch.
(projectDir: string)
| 104 | * packages for the currently checked out branch. |
| 105 | */ |
| 106 | static async invokeReleaseBuild(projectDir: string): Promise<ReleaseBuildJsonStdout> { |
| 107 | // Note: We explicitly mention that this can take a few minutes, so that it's obvious |
| 108 | // to caretakers that it can take longer than just a few seconds. |
| 109 | const spinner = new Spinner('Building release output. This can take a few minutes.'); |
| 110 | |
| 111 | try { |
| 112 | const {stdout} = await this._spawnNpmScript( |
| 113 | ['ng-dev', 'release', 'build', '--json'], |
| 114 | projectDir, |
| 115 | { |
| 116 | mode: 'silent', |
| 117 | }, |
| 118 | ); |
| 119 | |
| 120 | spinner.complete(); |
| 121 | Log.info(green(' ✓ Built release output for all packages.')); |
| 122 | // The `ng-dev release build` command prints a JSON array to stdout |
| 123 | // that represents the built release packages and their output paths. |
| 124 | return JSON.parse(stdout.trim()) as ReleaseBuildJsonStdout; |
| 125 | } catch (e) { |
| 126 | spinner.complete(); |
| 127 | Log.error(e); |
| 128 | Log.error(' ✘ An error occurred while building the release packages.'); |
| 129 | throw new FatalReleaseActionError(); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * Invokes the `ng-dev release info` command in order to retrieve information |