Skip to content

Commit ca2693b

Browse files
authored
Patch port of various build changes (#23440)
* build: update shared dev-infra package Updates the shared dev-infra package to take advanatge of recent improvements for the release tool. This also fixes the issue where the merge tooling requires the `breaking change` label, while there also is the `state: breaking change` label. The ng-dev tool no longer accepts custom configuration of that label. Also the merge configuration no longer accepts custom labels, in order to achieve consistent labeling as specified in the Angular versioning/branching/labeling spec. * build: check .ng-dev tool configuration in CI Checks the `.ng-dev` tool configuration in CI, compared to doing it locally when the caretaker intends to perform a merge and then realizes the config is broken. * build: remove legacy release tooling (#23428) Removes the legacy release tooling from the repository. We had two successful releases with the new tool, and the tool has been used for quite a while in the framework repository. We will fix issues in the new release tool going forward. * build: no longer install snapshot build of `@angular/bazel` No longer uses a snapshot build for `@angular/bazel`. We previously used a snapshot build in order to update to v4 of `rules_nodejs`. * build: add missing dependency for jsonc-parser Sets up the jsonc-parser dependency in the BUILD bazel file.
1 parent 8103d9b commit ca2693b

30 files changed

+292
-1781
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ jobs:
387387
- *setup_bazel_binary
388388

389389
- run: yarn build-and-check-release-output
390-
- run: yarn check-tools
390+
- run: yarn check-tooling-setup
391391

392392
# TODO(devversion): replace this with bazel tests that run Madge. This is
393393
# cumbersome and doesn't guarantee no circular deps for other entry-points.

.ng-dev/merge.ts

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
1-
import {DevInfraMergeConfig} from '@angular/dev-infra-private/ng-dev/pr/merge/config';
2-
import {getDefaultTargetLabelConfiguration} from '@angular/dev-infra-private/ng-dev/pr/merge/defaults';
3-
import {github} from './github';
4-
import {release} from './release';
1+
import {MergeConfig} from '@angular/dev-infra-private/ng-dev/pr/merge/config';
52

63
/**
74
* Configuration for the merge tool in `ng-dev`. This sets up the labels which
85
* are respected by the merge script (e.g. the target labels).
96
*/
10-
export const merge: DevInfraMergeConfig['merge'] = async api => {
11-
return {
12-
// By default, the merge script merges locally with `git cherry-pick` and autosquash.
13-
// This has the downside of pull requests showing up as `Closed` instead of `Merged`.
14-
// In the components repository, since we don't use fixup or squash commits, we can
15-
// use the Github API merge strategy. That way we ensure that PRs show up as `Merged`.
16-
githubApiMerge: {
17-
default: 'squash',
18-
labels: [
19-
{pattern: 'preserve commits', method: 'rebase'}
20-
]
21-
},
22-
claSignedLabel: 'cla: yes',
23-
mergeReadyLabel: 'merge ready',
24-
commitMessageFixupLabel: 'commit message fixup',
25-
caretakerNoteLabel: 'caretaker note',
26-
labels: await getDefaultTargetLabelConfiguration(api, github, release),
27-
};
7+
export const merge: MergeConfig = {
8+
// By default, the merge script merges locally with `git cherry-pick` and autosquash.
9+
// This has the downside of pull requests showing up as `Closed` instead of `Merged`.
10+
// In the components repository, since we don't use fixup or squash commits, we can
11+
// use the Github API merge strategy. That way we ensure that PRs show up as `Merged`.
12+
githubApiMerge: {
13+
default: 'squash',
14+
labels: [
15+
{pattern: 'preserve commits', method: 'rebase'}
16+
]
17+
},
18+
claSignedLabel: 'cla: yes',
19+
mergeReadyLabel: 'merge ready',
20+
commitMessageFixupLabel: 'commit message fixup',
21+
caretakerNoteLabel: 'caretaker note',
2822
};

.ng-dev/tsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"strict": true,
4+
"target": "es2015",
5+
"module": "commonjs",
6+
"noEmit": true,
7+
"skipLibCheck": true,
8+
"types": []
9+
},
10+
}

package.json

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
"deploy-dev-app": "node ./scripts/deploy-dev-app.js",
2828
"breaking-changes": "ts-node --project scripts/tsconfig.json scripts/breaking-changes.ts",
2929
"gulp": "gulp",
30-
"~~stage-release": "ts-node --project tools/legacy-release/tsconfig.json tools/legacy-release/stage-release.ts",
31-
"~~publish-release": "ts-node --project tools/legacy-release/tsconfig.json tools/legacy-release/publish-release.ts",
3230
"check-entry-point-setup": "node ./scripts/check-entry-point-setup.js",
3331
"check-rollup-globals": "ts-node --project scripts/tsconfig.json scripts/check-rollup-globals.ts",
3432
"changelog": "ts-node --project tools/release/tsconfig.json tools/release/changelog.ts",
@@ -49,18 +47,18 @@
4947
"integration-tests:size-test": "bazel test //integration/size-test/...",
5048
"check-mdc-tests": "ts-node --project scripts/tsconfig.json scripts/check-mdc-tests.ts",
5149
"check-mdc-exports": "ts-node --project scripts/tsconfig.json scripts/check-mdc-exports.ts",
52-
"check-tools": "yarn tsc --project tools/tsconfig-ci.json",
50+
"check-tooling-setup": "yarn tsc --project tools/tsconfig-ci.json && yarn tsc --project .ng-dev/tsconfig.json",
5351
"tsc": "node ./node_modules/typescript/bin/tsc",
5452
"prepare": "husky install"
5553
},
5654
"version": "12.2.2",
5755
"dependencies": {
58-
"@angular/animations": "12.1.2",
59-
"@angular/common": "12.1.2",
60-
"@angular/compiler": "12.1.2",
61-
"@angular/core": "12.1.2",
62-
"@angular/forms": "12.1.2",
63-
"@angular/platform-browser": "12.1.2",
56+
"@angular/animations": "12.2.2",
57+
"@angular/common": "12.2.2",
58+
"@angular/compiler": "12.2.2",
59+
"@angular/core": "12.2.2",
60+
"@angular/forms": "12.2.2",
61+
"@angular/platform-browser": "12.2.2",
6462
"@types/googlemaps": "^3.43.1",
6563
"@types/youtube": "^0.0.42",
6664
"core-js-bundle": "^3.8.2",
@@ -72,16 +70,16 @@
7270
"zone.js": "~0.11.3"
7371
},
7472
"devDependencies": {
75-
"@angular-devkit/build-optimizer": "0.1201.0",
76-
"@angular-devkit/core": "12.1.2",
77-
"@angular-devkit/schematics": "12.1.2",
78-
"@angular/bazel": "https://github.com/angular/bazel-builds.git#2566cc859235399edc72749a957f1cdcba2dc121",
79-
"@angular/compiler-cli": "12.1.2",
80-
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#6254699cc7ccff62be948dc5edcdea87a936ff24",
81-
"@angular/localize": "12.1.2",
82-
"@angular/platform-browser-dynamic": "12.1.2",
83-
"@angular/platform-server": "12.1.2",
84-
"@angular/router": "12.1.2",
73+
"@angular-devkit/build-optimizer": "0.1202.2",
74+
"@angular-devkit/core": "12.2.2",
75+
"@angular-devkit/schematics": "12.2.2",
76+
"@angular/bazel": "12.2.2",
77+
"@angular/compiler-cli": "12.2.2",
78+
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#56655ed6ccf24b7f3ad6b9ccdd1ef2896c7fa9f4",
79+
"@angular/localize": "12.2.2",
80+
"@angular/platform-browser-dynamic": "12.2.2",
81+
"@angular/platform-server": "12.2.2",
82+
"@angular/router": "12.2.2",
8583
"@axe-core/webdriverjs": "^4.1.0",
8684
"@babel/core": "^7.13.10",
8785
"@babel/traverse": "^7.13.0",
@@ -146,7 +144,7 @@
146144
"@octokit/rest": "18.3.5",
147145
"@rollup/plugin-babel": "^5.3.0",
148146
"@rollup/plugin-commonjs": "^18.0.0",
149-
"@schematics/angular": "12.1.2",
147+
"@schematics/angular": "12.2.2",
150148
"@types/browser-sync": "^2.26.1",
151149
"@types/fs-extra": "^9.0.5",
152150
"@types/glob": "^7.1.3",
@@ -185,6 +183,7 @@
185183
"inquirer": "^8.0.0",
186184
"jasmine": "^3.6.0",
187185
"jasmine-core": "^3.6.0",
186+
"jsonc-parser": "^3.0.0",
188187
"kagekiri": "^1.4.1",
189188
"karma": "^4.4.1",
190189
"karma-browserstack-launcher": "^1.6.0",

scripts/build-packages-dist.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function buildReleasePackages(useIvy: boolean, distPath: string,
7272
const targets = exec(queryPackagesCmd, true).split(/\r?\n/);
7373
const packageNames = getPackageNamesOfTargets(targets);
7474
const bazelBinPath = exec(`${bazelCmd} info bazel-bin`, true);
75-
const getOutputPath = pkgName => join(bazelBinPath, 'src', pkgName, 'npm_package');
75+
const getOutputPath = (pkgName: string) => join(bazelBinPath, 'src', pkgName, 'npm_package');
7676

7777
// Build with "--config=release" or `--config=snapshot-build` so that Bazel
7878
// runs the workspace stamping script. The stamping script ensures that the

scripts/caretaking/resync-caretaker-app-prs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as Octokit from '@octokit/rest';
1+
import {Octokit} from '@octokit/rest';
22
import * as fetch from 'node-fetch';
33

44
const apiBaseUrl = 'https://test-jperrott.firebaseio.com/pulls';

scripts/check-mdc-exports-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ export const config = {
2121
// Irrelevant for the MDC implementation, because the slider doesn't dispatch any events.
2222
'MatSliderChange'
2323
]
24-
}
24+
} as {[entryPointName: string]: string[]}
2525
};

scripts/tsconfig.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
"lib": ["es2016"],
66
"moduleResolution": "node",
77
"types": ["node"],
8-
"strictNullChecks": true,
8+
"strict": true,
9+
"noEmit": true,
10+
"skipLibCheck": true,
911
"downlevelIteration": true
10-
}
12+
},
13+
// The `firebase-functions` folder has its own `package.json` and does
14+
// not pass type-checking. This excludes it from being checked.
15+
"exclude": ["caretaking/firebase-functions/**"]
1116
}

src/cdk/schematics/testing/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ts_library(
2121
"@npm//@types/jasmine",
2222
"@npm//@types/node",
2323
"@npm//fs-extra",
24+
"@npm//jsonc-parser",
2425
"@npm//rxjs",
2526
],
2627
)

src/cdk/schematics/testing/test-case-setup.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import {getSystemPath, JsonParseMode, parseJson, Path} from '@angular-devkit/core';
8+
9+
import {parse} from 'jsonc-parser';
10+
import {getSystemPath, Path} from '@angular-devkit/core';
911
import {HostTree, Tree} from '@angular-devkit/schematics';
1012
import {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing';
1113
import {readFileSync} from 'fs-extra';
@@ -82,10 +84,10 @@ export async function createTestCaseSetup(migrationName: string, collectionPath:
8284
});
8385

8486
const testAppTsconfigPath = 'projects/cdk-testing/tsconfig.app.json';
85-
// Parse TypeScript configuration files with JSON5 as they could contain comments or
86-
// unquoted properties.
87-
const testAppTsconfig =
88-
parseJson(appTree.readContent(testAppTsconfigPath), JsonParseMode.Json5) as any;
87+
// Parse TypeScript configuration files with JSONC (like the CLI does) as the
88+
// config files could contain comments or trailing commas
89+
const testAppTsconfig = parse(appTree.readContent(testAppTsconfigPath), [],
90+
{allowTrailingComma: true});
8991

9092
// include all TypeScript files in the project. Otherwise all test input
9193
// files won't be part of the program and cannot be migrated.

tools/legacy-release/base-release-task.ts

Lines changed: 0 additions & 78 deletions
This file was deleted.

tools/legacy-release/changelog-commit-template.hbs

Lines changed: 0 additions & 60 deletions
This file was deleted.

tools/legacy-release/changelog-root-template.hbs

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)