Skip to content

Commit 182cc10

Browse files
crisbetojelbourn
authored andcommitted
build: add validation for prebuilt cdk css (#15588)
Adds another check to the release validation script that ensures that the prebuilt CDK CSS has been created.
1 parent 5e7cf22 commit 182cc10

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import {bold, red, yellow} from 'chalk';
22
import {existsSync} from 'fs';
33
import {sync as glob} from 'glob';
44
import {join} from 'path';
5+
56
import {
7+
checkCdkPackage,
68
checkMaterialPackage,
79
checkReleaseBundle,
810
checkTypeDefinitionFile
@@ -51,8 +53,9 @@ export function checkReleasePackage(releasesPath: string, packageName: string):
5153

5254
// Special release validation checks for the "material" release package.
5355
if (packageName === 'material') {
54-
checkMaterialPackage(join(releasesPath, packageName))
55-
.forEach(message => addFailure(message));
56+
checkMaterialPackage(join(releasesPath, packageName)).forEach(message => addFailure(message));
57+
} else if (packageName === 'cdk') {
58+
checkCdkPackage(join(releasesPath, packageName)).forEach(message => addFailure(message));
5659
}
5760

5861
if (!existsSync(join(packagePath, 'LICENSE'))) {

tools/release/release-output/output-validations.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {existsSync, readFileSync} from 'fs';
22
import {sync as glob} from 'glob';
3-
import {dirname, isAbsolute, join} from 'path';
3+
import {dirname, isAbsolute, join, basename} from 'path';
44
import * as ts from 'typescript';
55

66
/** RegExp that matches Angular component inline styles that contain a sourcemap reference. */
@@ -87,3 +87,14 @@ export function checkMaterialPackage(packagePath: string): string[] {
8787

8888
return failures;
8989
}
90+
91+
/**
92+
* Checks whether the prebuilt CDK files are part of the release output.
93+
*/
94+
export function checkCdkPackage(packagePath: string): string[] {
95+
const prebuiltFiles = glob('*-prebuilt.css', {cwd: packagePath}).map(path => basename(path));
96+
97+
return ['overlay', 'a11y', 'text-field']
98+
.filter(name => !prebuiltFiles.includes(`${name}-prebuilt.css`))
99+
.map(name => `Could not find the prebuilt ${name} styles.`);
100+
}

0 commit comments

Comments
 (0)