Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update to angular v9.0.6 #18785

Merged
merged 3 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
},
"version": "9.1.2",
"dependencies": {
"@angular/animations": "^9.0.5",
"@angular/common": "^9.0.5",
"@angular/compiler": "^9.0.5",
"@angular/core": "^9.0.5",
"@angular/elements": "^9.0.5",
"@angular/forms": "^9.0.5",
"@angular/platform-browser": "^9.0.5",
"@angular/animations": "^9.0.6",
"@angular/common": "^9.0.6",
"@angular/compiler": "^9.0.6",
"@angular/core": "^9.0.6",
"@angular/elements": "^9.0.6",
"@angular/forms": "^9.0.6",
"@angular/platform-browser": "^9.0.6",
"@types/googlemaps": "^3.37.0",
"@types/youtube": "^0.0.38",
"@webcomponents/custom-elements": "^1.1.0",
Expand All @@ -62,13 +62,13 @@
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/core": "^9.0.4",
"@angular-devkit/schematics": "^9.0.4",
"@angular/bazel": "^9.0.5",
"@angular/compiler-cli": "^9.0.5",
"@angular/platform-browser-dynamic": "^9.0.5",
"@angular/platform-server": "^9.0.5",
"@angular/router": "^9.0.5",
"@angular-devkit/core": "^9.0.5",
"@angular-devkit/schematics": "^9.0.5",
"@angular/bazel": "^9.0.6",
"@angular/compiler-cli": "^9.0.6",
"@angular/platform-browser-dynamic": "^9.0.6",
"@angular/platform-server": "^9.0.6",
"@angular/router": "^9.0.6",
"@bazel/bazelisk": "^1.3.0",
"@bazel/buildifier": "^0.29.0",
"@bazel/ibazel": "0.12.0",
Expand All @@ -77,8 +77,8 @@
"@bazel/protractor": "^1.4.0",
"@bazel/typescript": "^1.4.0",
"@firebase/app-types": "^0.3.2",
"@octokit/rest": "^16.28.7",
"@schematics/angular": "^9.0.4",
"@octokit/rest": "16.28.7",
"@schematics/angular": "^9.0.5",
"@types/browser-sync": "^2.26.1",
"@types/fs-extra": "^4.0.3",
"@types/glob": "^5.0.33",
Expand Down
12 changes: 6 additions & 6 deletions tools/release/release-output/check-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
checkMaterialPackage,
checkPackageJsonFile,
checkPackageJsonMigrations,
checkReleaseBundle,
checkJavaScriptOutput,
checkTypeDefinitionFile
} from './output-validations';

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

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

const bundlePaths = glob(releaseBundlesGlob, {cwd: packagePath, absolute: true});
const jsFiles = glob(releaseJsFilesGlob, {cwd: packagePath, absolute: true});
const typeDefinitions = glob(releaseTypeDefinitionsGlob, {cwd: packagePath, absolute: true});
const packageJsonFiles = glob(packageJsonFilesGlob, {cwd: packagePath, absolute: true});

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

// Run output validations for all TypeScript definition files within the release output.
Expand Down
19 changes: 13 additions & 6 deletions tools/release/release-output/output-validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const inlineStylesSourcemapRegex = /styles: ?\[["'].*sourceMappingURL=.*["']/;
/** RegExp that matches Angular component metadata properties that refer to external resources. */
const externalReferencesRegex = /(templateUrl|styleUrls): *["'[]/;

/** RegExp that matches common Bazel manifest paths in this workspace */
const bazelManifestPath = /(angular_material|external)\//;

/**
* List of fields which are mandatory in entry-point "package.json" files and refer
* to files in the release output.
Expand All @@ -19,21 +22,25 @@ const packageJsonPathFields =
['main', 'module', 'typings', 'es2015', 'fesm5', 'fesm2015', 'esm5', 'esm2015'];

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

if (inlineStylesSourcemapRegex.exec(bundleContent) !== null) {
if (inlineStylesSourcemapRegex.exec(fileContent) !== null) {
failures.push('Found sourcemap references in component styles.');
}

if (externalReferencesRegex.exec(bundleContent) !== null) {
if (externalReferencesRegex.exec(fileContent) !== null) {
failures.push('Found external component resource references');
}

if (bazelManifestPath.exec(fileContent) !== null) {
failures.push('Found Bazel manifest path in output.');
}

return failures;
}

Expand Down
6 changes: 3 additions & 3 deletions tools/release/stage-release.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as OctokitApi from '@octokit/rest';
import * as Octokit from '@octokit/rest';
import chalk from 'chalk';
import {existsSync, readFileSync, writeFileSync} from 'fs';
import {join} from 'path';
Expand Down Expand Up @@ -50,7 +50,7 @@ class StageReleaseTask extends BaseReleaseTask {
git: GitClient;

/** Octokit API instance that can be used to make Github API calls. */
githubApi: OctokitApi;
githubApi: Octokit;

constructor(
public projectDir: string, public packagesDir: string, public repositoryOwner: string,
Expand All @@ -68,7 +68,7 @@ class StageReleaseTask extends BaseReleaseTask {
process.exit(1);
}

this.githubApi = new OctokitApi();
this.githubApi = new Octokit();
}

async run() {
Expand Down
Loading