豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit d5693db

Browse files
committed
feat(ng-dev): release info should print exceptional minors
Since there can be an exceptional minor release train, the info command should also print this information.
1 parent b7beaeb commit d5693db

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

ng-dev/release/versioning/print-active-trains.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {blue, bold, Log} from '../../utils/logging.js';
9+
import {blue, bold, underline, Log} from '../../utils/logging.js';
1010
import {ReleaseConfig} from '../config/index.js';
1111

1212
import {ActiveReleaseTrains} from './active-release-trains.js';
@@ -22,14 +22,33 @@ export async function printActiveReleaseTrains(
2222
active: ActiveReleaseTrains,
2323
config: ReleaseConfig,
2424
): Promise<void> {
25-
const {releaseCandidate, next, latest} = active;
25+
const {releaseCandidate, next, latest, exceptionalMinor} = active;
2626
const isNextPublishedToNpm = await isVersionPublishedToNpm(next.version, config);
2727
const nextTrainType = next.isMajor ? 'major' : 'minor';
2828
const ltsBranches = await fetchLongTermSupportBranchesFromNpm(config);
2929

3030
Log.info();
3131
Log.info(blue('Current version branches in the project:'));
3232

33+
if (exceptionalMinor !== null) {
34+
const version = exceptionalMinor.version;
35+
const exceptionalMinorPublished = await isVersionPublishedToNpm(version, config);
36+
const trainPhase = version.prerelease[0] === 'next' ? 'next' : 'release-candidate';
37+
const minorLabel = underline('exceptional minor');
38+
39+
Log.info(
40+
` • ${bold(exceptionalMinor.branchName)} contains changes for an ${minorLabel} ` +
41+
`that is currently in ${bold(trainPhase)} phase.`,
42+
);
43+
// An exceptional minor may not be published yet. e.g. when we branch off there
44+
// will not be a release immediately.
45+
if (exceptionalMinorPublished) {
46+
Log.info(` Most recent pre-release for this branch is "${bold(`v${version}`)}".`);
47+
} else {
48+
Log.info(` Version is set to "${bold(`v${version}`)}", but has not been published yet.`);
49+
}
50+
}
51+
3352
// Print information for release trains in the feature-freeze/release-candidate phase.
3453
if (releaseCandidate !== null) {
3554
const rcVersion = releaseCandidate.version;

ng-dev/utils/logging.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const green = chalk.green;
3535
export const yellow = chalk.yellow;
3636
export const bold = chalk.bold;
3737
export const blue = chalk.blue;
38+
export const underline = chalk.underline;
3839

3940
/** Class used for logging to the console and to a ng-dev log file. */
4041
export abstract class Log {

0 commit comments

Comments
 (0)