Skip to content

Commit 8dbee4e

Browse files
authored
build: remove ng-dev typescript configuration workaround (#19415)
We recently added a workaround to support having a `ng-dev` configuration written in TypeScript. The `ng-dev` tool now automatically sets up `ts-node` when needed, so we can remove the workaround. Additionally, we can replace the merge branch determining logic as the script has been moved upstream. It has been also improved to no longer rely on Git but rather on the NPM registry.
1 parent d952a22 commit 8dbee4e

File tree

4 files changed

+10
-72
lines changed

4 files changed

+10
-72
lines changed

.ng-dev-config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {MergeConfig} from '@angular/dev-infra-private/pr/merge/config';
2+
import {determineMergeBranches} from '@angular/dev-infra-private/pr/merge/determine-merge-branches';
23
import {GithubConfig} from '@angular/dev-infra-private/utils/config';
3-
import {determineMergeBranches} from './scripts/determine-merge-branches';
44

55
/**
66
* Github configuration for the ng-dev command. This repository is
@@ -16,7 +16,11 @@ const github: GithubConfig = {
1616
* are respected by the merge script (e.g. the target labels).
1717
*/
1818
const merge = (): MergeConfig => {
19-
const {minor, patch} = determineMergeBranches(github.owner, github.name);
19+
const currentVersion = require('./package.json').version;
20+
// We use the `@angular/cdk` as source of truth for the latest published version in NPM.
21+
// Any package from the monorepo could technically work and result in the same version.
22+
const {minor, patch} = determineMergeBranches(currentVersion, '@angular/cdk');
23+
2024
return {
2125
// By default, the merge script merges locally with `git cherry-pick` and autosquash.
2226
// This has the downside of pull requests showing up as `Closed` instead of `Merged`.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"resync-caretaker-app": "ts-node --project scripts/tsconfig.json scripts/caretaking/resync-caretaker-app-prs.ts",
4444
"ts-circular-deps:check": "yarn -s ts-circular-deps check --config ./src/circular-deps-test.conf.js",
4545
"ts-circular-deps:approve": "yarn -s ts-circular-deps approve --config ./src/circular-deps-test.conf.js",
46-
"ng-dev": "ts-node -O {\\\"module\\\":\\\"commonjs\\\"} ./node_modules/@angular/dev-infra-private/cli.js",
4746
"merge": "ng-dev pr merge",
4847
"approve-api": "node ./scripts/approve-api-golden.js"
4948
},
@@ -71,7 +70,7 @@
7170
"@angular-devkit/schematics": "^10.0.0-next.6",
7271
"@angular/bazel": "^10.0.0-rc.0",
7372
"@angular/compiler-cli": "^10.0.0-rc.0",
74-
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#7f3e1227d199a55943152aac6119d40e1bbb028f",
73+
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#2ac83eb462cb25c46a761d34dec030e360055016",
7574
"@angular/platform-browser-dynamic": "^10.0.0-rc.0",
7675
"@angular/platform-server": "^10.0.0-rc.0",
7776
"@angular/router": "^10.0.0-rc.0",

scripts/determine-merge-branches.ts

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

yarn.lock

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@
9292
dependencies:
9393
tslib "^1.9.0"
9494

95-
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#7f3e1227d199a55943152aac6119d40e1bbb028f":
95+
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#2ac83eb462cb25c46a761d34dec030e360055016":
9696
version "0.0.0"
97-
resolved "https://github.com/angular/dev-infra-private-builds.git#7f3e1227d199a55943152aac6119d40e1bbb028f"
97+
resolved "https://github.com/angular/dev-infra-private-builds.git#2ac83eb462cb25c46a761d34dec030e360055016"
9898
dependencies:
9999
"@octokit/graphql" "^4.3.1"
100100
chalk "^2.3.1"
@@ -103,6 +103,7 @@
103103
inquirer "^7.1.0"
104104
minimatch "^3.0.4"
105105
multimatch "^4.0.0"
106+
semver "^6.3.0"
106107
shelljs "^0.8.3"
107108
typed-graphqlify "^2.3.0"
108109
yaml "^1.7.2"

0 commit comments

Comments
 (0)