Skip to content

Commit d3eda55

Browse files
authored
build: update to angular v9.0.6 (#18785)
* build: update to angular v9.0.6 Updates to Angular v9.0.6. This version contains a fix for `@angular/bazel` that should fix the release output to not leak any Bazel runfile manifest paths. angular/angular@9581658 * build: downgrade to @octokit/rest v16 to avoid broken types We recently updated `@octokit/rest`, but the most recent version currently has broken TypeScript definitions. To workaroun this until the upstream issue is resolved, we downgrade to our last working version. https://github.com/octokit/rest.js/issues/1624 * build: add release output validation for manifest paths Ensures that angular/angular@9581658 fixed all instances, and ensures that we don't regress on the components side.
1 parent 330c327 commit d3eda55

File tree

5 files changed

+147
-111
lines changed

5 files changed

+147
-111
lines changed

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
},
4545
"version": "9.1.2",
4646
"dependencies": {
47-
"@angular/animations": "^9.0.5",
48-
"@angular/common": "^9.0.5",
49-
"@angular/compiler": "^9.0.5",
50-
"@angular/core": "^9.0.5",
51-
"@angular/elements": "^9.0.5",
52-
"@angular/forms": "^9.0.5",
53-
"@angular/platform-browser": "^9.0.5",
47+
"@angular/animations": "^9.0.6",
48+
"@angular/common": "^9.0.6",
49+
"@angular/compiler": "^9.0.6",
50+
"@angular/core": "^9.0.6",
51+
"@angular/elements": "^9.0.6",
52+
"@angular/forms": "^9.0.6",
53+
"@angular/platform-browser": "^9.0.6",
5454
"@types/googlemaps": "^3.37.0",
5555
"@types/youtube": "^0.0.38",
5656
"@webcomponents/custom-elements": "^1.1.0",
@@ -62,13 +62,13 @@
6262
"zone.js": "~0.10.2"
6363
},
6464
"devDependencies": {
65-
"@angular-devkit/core": "^9.0.4",
66-
"@angular-devkit/schematics": "^9.0.4",
67-
"@angular/bazel": "^9.0.5",
68-
"@angular/compiler-cli": "^9.0.5",
69-
"@angular/platform-browser-dynamic": "^9.0.5",
70-
"@angular/platform-server": "^9.0.5",
71-
"@angular/router": "^9.0.5",
65+
"@angular-devkit/core": "^9.0.5",
66+
"@angular-devkit/schematics": "^9.0.5",
67+
"@angular/bazel": "^9.0.6",
68+
"@angular/compiler-cli": "^9.0.6",
69+
"@angular/platform-browser-dynamic": "^9.0.6",
70+
"@angular/platform-server": "^9.0.6",
71+
"@angular/router": "^9.0.6",
7272
"@bazel/bazelisk": "^1.3.0",
7373
"@bazel/buildifier": "^0.29.0",
7474
"@bazel/ibazel": "0.12.0",
@@ -77,8 +77,8 @@
7777
"@bazel/protractor": "^1.4.0",
7878
"@bazel/typescript": "^1.4.0",
7979
"@firebase/app-types": "^0.3.2",
80-
"@octokit/rest": "^16.28.7",
81-
"@schematics/angular": "^9.0.4",
80+
"@octokit/rest": "16.28.7",
81+
"@schematics/angular": "^9.0.5",
8282
"@types/browser-sync": "^2.26.1",
8383
"@types/fs-extra": "^4.0.3",
8484
"@types/glob": "^5.0.33",

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import {
99
checkMaterialPackage,
1010
checkPackageJsonFile,
1111
checkPackageJsonMigrations,
12-
checkReleaseBundle,
12+
checkJavaScriptOutput,
1313
checkTypeDefinitionFile
1414
} from './output-validations';
1515

16-
/** Glob that matches all JavaScript bundle files within a release package. */
17-
const releaseBundlesGlob = '+(fesm5|fesm2015|esm5|esm2015|bundles)/*.js';
16+
/** Glob that matches all JavaScript files within a release package. */
17+
const releaseJsFilesGlob = '+(fesm5|fesm2015|esm5|esm2015|bundles)/**/*.js';
1818

1919
/** Glob that matches all TypeScript definition files within a release package. */
2020
const releaseTypeDefinitionsGlob = '**/*.d.ts';
@@ -46,14 +46,14 @@ export function checkReleasePackage(
4646
failures.set(message, filePaths);
4747
};
4848

49-
const bundlePaths = glob(releaseBundlesGlob, {cwd: packagePath, absolute: true});
49+
const jsFiles = glob(releaseJsFilesGlob, {cwd: packagePath, absolute: true});
5050
const typeDefinitions = glob(releaseTypeDefinitionsGlob, {cwd: packagePath, absolute: true});
5151
const packageJsonFiles = glob(packageJsonFilesGlob, {cwd: packagePath, absolute: true});
5252

5353
// We want to walk through each bundle within the current package and run
5454
// release validations that ensure that the bundles are not invalid.
55-
bundlePaths.forEach(bundlePath => {
56-
checkReleaseBundle(bundlePath).forEach(message => addFailure(message, bundlePath));
55+
jsFiles.forEach(bundlePath => {
56+
checkJavaScriptOutput(bundlePath).forEach(message => addFailure(message, bundlePath));
5757
});
5858

5959
// Run output validations for all TypeScript definition files within the release output.

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ const inlineStylesSourcemapRegex = /styles: ?\[["'].*sourceMappingURL=.*["']/;
1111
/** RegExp that matches Angular component metadata properties that refer to external resources. */
1212
const externalReferencesRegex = /(templateUrl|styleUrls): *["'[]/;
1313

14+
/** RegExp that matches common Bazel manifest paths in this workspace */
15+
const bazelManifestPath = /(angular_material|external)\//;
16+
1417
/**
1518
* List of fields which are mandatory in entry-point "package.json" files and refer
1619
* to files in the release output.
@@ -19,21 +22,25 @@ const packageJsonPathFields =
1922
['main', 'module', 'typings', 'es2015', 'fesm5', 'fesm2015', 'esm5', 'esm2015'];
2023

2124
/**
22-
* Checks the specified release bundle and ensures that it does not contain
23-
* any external resource URLs.
25+
* Checks the specified JavaScript file and ensures that it does not
26+
* contain any external resource URLs, or Bazel manifest paths.
2427
*/
25-
export function checkReleaseBundle(bundlePath: string): string[] {
26-
const bundleContent = readFileSync(bundlePath, 'utf8');
28+
export function checkJavaScriptOutput(filePath: string): string[] {
29+
const fileContent = readFileSync(filePath, 'utf8');
2730
const failures: string[] = [];
2831

29-
if (inlineStylesSourcemapRegex.exec(bundleContent) !== null) {
32+
if (inlineStylesSourcemapRegex.exec(fileContent) !== null) {
3033
failures.push('Found sourcemap references in component styles.');
3134
}
3235

33-
if (externalReferencesRegex.exec(bundleContent) !== null) {
36+
if (externalReferencesRegex.exec(fileContent) !== null) {
3437
failures.push('Found external component resource references');
3538
}
3639

40+
if (bazelManifestPath.exec(fileContent) !== null) {
41+
failures.push('Found Bazel manifest path in output.');
42+
}
43+
3744
return failures;
3845
}
3946

tools/release/stage-release.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as OctokitApi from '@octokit/rest';
1+
import * as Octokit from '@octokit/rest';
22
import chalk from 'chalk';
33
import {existsSync, readFileSync, writeFileSync} from 'fs';
44
import {join} from 'path';
@@ -50,7 +50,7 @@ class StageReleaseTask extends BaseReleaseTask {
5050
git: GitClient;
5151

5252
/** Octokit API instance that can be used to make Github API calls. */
53-
githubApi: OctokitApi;
53+
githubApi: Octokit;
5454

5555
constructor(
5656
public projectDir: string, public packagesDir: string, public repositoryOwner: string,
@@ -68,7 +68,7 @@ class StageReleaseTask extends BaseReleaseTask {
6868
process.exit(1);
6969
}
7070

71-
this.githubApi = new OctokitApi();
71+
this.githubApi = new Octokit();
7272
}
7373

7474
async run() {

0 commit comments

Comments
 (0)