Skip to content

Commit cdd6699

Browse files
committed
fixup! build: switch to release tool from dev-infra
Address feedback
1 parent 2c69ce4 commit cdd6699

File tree

6 files changed

+21
-13
lines changed

6 files changed

+21
-13
lines changed

scripts/build-packages-dist.ts

100644100755
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ export function performDefaultSnapshotBuild(): BuiltPackage[] {
6060
* Builds the release packages with the given compile mode and copies
6161
* the package output into the given directory.
6262
*/
63-
function buildReleasePackages(useIvy, distPath, isSnapshotBuild): BuiltPackage[] {
63+
function buildReleasePackages(useIvy: boolean, distPath: string,
64+
isSnapshotBuild: boolean): BuiltPackage[] {
65+
6466
console.log('######################################');
6567
console.log(' Building release packages...');
6668
console.log(` Compiling with Ivy: ${useIvy}`);
@@ -133,7 +135,7 @@ function getPackageNamesOfTargets(targets: string[]): string[] {
133135
function exec(command: string): void;
134136
/** Executes the given command in the project directory and returns its stdout. */
135137
function exec(command: string, captureStdout: true): string;
136-
function exec(command: string, captureStdout?: boolean) {
138+
function exec(command: string, captureStdout?: true) {
137139
const stdout = execSync(command, {
138140
cwd: projectDir,
139141
stdio: ['inherit', captureStdout ? 'pipe' : 'inherit', 'inherit'],

tools/legacy-release/changelog.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const orderedChangelogPackages = [
3232
'google-maps',
3333
'youtube-player',
3434
'material-moment-adapter',
35+
'material-luxon-adapter',
36+
'material-date-fns-adapter',
3537
'cdk-experimental',
3638
'material-experimental',
3739
];

tools/release-checks/check-framework-peer-dependency.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {FatalReleaseActionError} from '@angular/dev-infra-private/release/publish/actions-error';
2+
import {error} from '@angular/dev-infra-private/utils/console';
23
import {SemVer} from 'semver';
34
import {join} from 'path';
45
import {existsSync, readFileSync} from 'fs';
@@ -22,10 +23,10 @@ export async function assertValidFrameworkPeerDependency(newVersion: SemVer) {
2223
`^${newVersion.major}.0.0 || ^${newVersion.major + 1}.0.0-0`;
2324

2425
if (requiredRange !== currentVersionRange) {
25-
console.error(chalk.red(
26+
error(chalk.red(
2627
` ✘ Cannot stage release. The required Angular version range ` +
2728
`is invalid. The version range should be: ${requiredRange}`));
28-
console.error(chalk.red(
29+
error(chalk.red(
2930
` Please manually update the version range ` +
3031
`in: ${bzlConfigPath}`));
3132
throw new FatalReleaseActionError();
@@ -38,7 +39,7 @@ export async function assertValidFrameworkPeerDependency(newVersion: SemVer) {
3839
*/
3940
function _extractAngularVersionPlaceholderOrThrow(): string {
4041
if (!existsSync(bzlConfigPath)) {
41-
console.error(chalk.red(
42+
error(chalk.red(
4243
` ✘ Cannot stage release. Could not find the file which sets ` +
4344
`the Angular peerDependency placeholder value. Looked for: ${bzlConfigPath}`));
4445
throw new FatalReleaseActionError();
@@ -47,7 +48,7 @@ function _extractAngularVersionPlaceholderOrThrow(): string {
4748
const configFileContent = readFileSync(bzlConfigPath, 'utf8');
4849
const matches = configFileContent.match(/ANGULAR_PACKAGE_VERSION = ["']([^"']+)/);
4950
if (!matches || !matches[1]) {
50-
console.error(chalk.red(
51+
error(chalk.red(
5152
` ✘ Cannot stage release. Could not find the ` +
5253
`"ANGULAR_PACKAGE_VERSION" variable. Please ensure this variable exists. ` +
5354
`Looked in: ${bzlConfigPath}`));

tools/release-checks/check-migration-collections.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {error} from '@angular/dev-infra-private/utils/console';
12
import {dirname, join} from 'path';
23
import * as chalk from 'chalk';
34
import {releasePackages} from '../../.ng-dev/release';
@@ -16,8 +17,8 @@ export async function assertValidUpdateMigrationCollections(newVersion: semver.S
1617
.map(f => chalk.yellow(` ⮑ ${chalk.bold(packageName)}: ${f}`)));
1718
});
1819
if (failures.length) {
19-
console.error(chalk.red(` ✘ Failures in ng-update migration collection detected:`));
20-
failures.forEach(f => console.error(f));
20+
error(chalk.red(` ✘ Failures in ng-update migration collection detected:`));
21+
failures.forEach(f => error(f));
2122
process.exit(1);
2223
}
2324
}

tools/release-checks/npm-package-output/check-package.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {error} from '@angular/dev-infra-private/utils/console';
12
import * as chalk from 'chalk';
23
import {existsSync} from 'fs';
34
import {sync as glob} from 'glob';
@@ -95,17 +96,17 @@ export function checkReleasePackage(
9596

9697
/** Prints the grouped failures for a specified package. */
9798
function printGroupedFailures(packageName: string, failures: PackageFailures) {
98-
console.error(chalk.red(chalk.bold(` ⚠ Package: "${packageName}" has failures:`)));
99+
error(chalk.red(chalk.bold(` ⚠ Package: "${packageName}" has failures:`)));
99100
failures.forEach((affectedFiles, failureMessage) => {
100-
console.error(chalk.yellow(` ⮑ ${failureMessage}`));
101+
error(chalk.yellow(` ⮑ ${failureMessage}`));
101102

102103
if (affectedFiles.length) {
103104
affectedFiles.forEach(affectedFile => {
104-
console.error(chalk.yellow(` ${affectedFile}`));
105+
error(chalk.yellow(` ${affectedFile}`));
105106
});
106107
}
107108

108109
// Add an extra line so that subsequent failure message groups are clearly separated.
109-
console.error();
110+
error();
110111
});
111112
}

tools/release-checks/npm-package-output/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {SemVer} from 'semver';
22
import {checkReleasePackage} from './check-package';
33
import {BuiltPackage} from '@angular/dev-infra-private/release/config';
4+
import {error} from '@angular/dev-infra-private/utils/console';
45
import * as chalk from 'chalk';
56

67
/** Asserts that the given built packages are valid for public consumption. */
@@ -13,7 +14,7 @@ export async function assertValidNpmPackageOutput(
1314
}
1415

1516
if (!passing) {
16-
console.error(chalk.red(` ✘ NPM package output does not pass all release validations.`));
17+
error(chalk.red(` ✘ NPM package output does not pass all release validations.`));
1718
process.exit(1);
1819
}
1920
}

0 commit comments

Comments
 (0)