fix(dev-infra): build with stamping for release builds (#42354)

`ng-dev release build` should always build with version stamping rather than
snapshot stamping.

PR Close #42354
This commit is contained in:
Joey Perrott 2021-05-26 10:01:44 -07:00 committed by Zach Arend
parent 6a970167de
commit acfa0647b7
2 changed files with 8 additions and 21 deletions

View File

@ -5180,23 +5180,17 @@ function buildReleaseOutput(stampForRelease = false) {
*/ */
/** Yargs command builder for configuring the `ng-dev release build` command. */ /** Yargs command builder for configuring the `ng-dev release build` command. */
function builder$7(argv) { function builder$7(argv) {
return argv return argv.option('json', {
.option('json', {
type: 'boolean', type: 'boolean',
description: 'Whether the built packages should be printed to stdout as JSON.', description: 'Whether the built packages should be printed to stdout as JSON.',
default: false, default: false,
})
.option('stampForRelease', {
type: 'boolean',
description: 'Whether the built packages should be stamped for release.',
default: false,
}); });
} }
/** Yargs command handler for building a release. */ /** Yargs command handler for building a release. */
function handler$7(args) { function handler$7(args) {
return tslib.__awaiter(this, void 0, void 0, function* () { return tslib.__awaiter(this, void 0, void 0, function* () {
const { npmPackages } = getReleaseConfig(); const { npmPackages } = getReleaseConfig();
let builtPackages = yield buildReleaseOutput(args.stampForRelease); let builtPackages = yield buildReleaseOutput(true);
// If package building failed, print an error and exit with an error code. // If package building failed, print an error and exit with an error code.
if (builtPackages === null) { if (builtPackages === null) {
error(red(` ✘ Could not build release output. Please check output above.`)); error(red(` ✘ Could not build release output. Please check output above.`));

View File

@ -17,28 +17,21 @@ import {buildReleaseOutput} from './index';
/** Command line options for building a release. */ /** Command line options for building a release. */
export interface ReleaseBuildOptions { export interface ReleaseBuildOptions {
json: boolean; json: boolean;
stampForRelease: boolean;
} }
/** Yargs command builder for configuring the `ng-dev release build` command. */ /** Yargs command builder for configuring the `ng-dev release build` command. */
function builder(argv: Argv): Argv<ReleaseBuildOptions> { function builder(argv: Argv): Argv<ReleaseBuildOptions> {
return argv return argv.option('json', {
.option('json', {
type: 'boolean', type: 'boolean',
description: 'Whether the built packages should be printed to stdout as JSON.', description: 'Whether the built packages should be printed to stdout as JSON.',
default: false, default: false,
})
.option('stampForRelease', {
type: 'boolean',
description: 'Whether the built packages should be stamped for release.',
default: false,
}); });
} }
/** Yargs command handler for building a release. */ /** Yargs command handler for building a release. */
async function handler(args: Arguments<ReleaseBuildOptions>) { async function handler(args: Arguments<ReleaseBuildOptions>) {
const {npmPackages} = getReleaseConfig(); const {npmPackages} = getReleaseConfig();
let builtPackages = await buildReleaseOutput(args.stampForRelease); let builtPackages = await buildReleaseOutput(true);
// If package building failed, print an error and exit with an error code. // If package building failed, print an error and exit with an error code.
if (builtPackages === null) { if (builtPackages === null) {