Paul Gschwendtner 372a6cf8d7 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
2020-09-28 16:11:42 -04:00

29 lines
866 B
TypeScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
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. */
export function buildReleaseParser(localYargs: yargs.Argv) {
return localYargs.help()
.strict()
.demandCommand()
.command(ReleaseBuildCommandModule)
.command(ReleaseSetDistTagCommand)
.command(
'build-env-stamp', 'Build the environment stamping information', {},
() => buildEnvStamp());
}
if (require.main === module) {
buildReleaseParser(yargs).parse();
}