feat(dev-infra): add release command for setting NPM dist tag (#38656)

Introduces a new command for `ng-dev release`, so that the NPM
dist tag can be set for all configured NPM packages. This command
can be useful in case a manual tag needs to be set, but it is
primarily used by the release tooling when a new stable version
is cut, and when the previous patch branch needs to be set as LTS
version through a `v{major}-lts` dist tag.

It is necessary to have this as a command so that the release tool
can execute it for old branches where other packages might have been
configured. This is similar to the separate `ng-dev build` command
that we created.

Note that we also added logic for spawning a process conveniently
with different "console output" modes. This will be useful for
other command invocations in the release tool and it's generally
better than directly using native `child_process` as that one doesn't
log to the dev-infra debug log file.

PR Close #38656
This commit is contained in:
Paul Gschwendtner
2020-09-09 14:56:58 +02:00
committed by Alex Rickabaugh
parent b9dce19b3d
commit 372a6cf8d7
7 changed files with 304 additions and 0 deletions

View File

@ -8,6 +8,7 @@
import * as yargs from 'yargs';
import {ReleaseBuildCommandModule} from './build/cli';
import {ReleaseSetDistTagCommand} from './set-dist-tag/cli';
import {buildEnvStamp} from './stamping/env-stamp';
/** Build the parser for the release commands. */
@ -16,6 +17,7 @@ export function buildReleaseParser(localYargs: yargs.Argv) {
.strict()
.demandCommand()
.command(ReleaseBuildCommandModule)
.command(ReleaseSetDistTagCommand)
.command(
'build-env-stamp', 'Build the environment stamping information', {},
() => buildEnvStamp());