Skip to content

Commit c866fd4

Browse files
josephperrottKeen Yee Liau
authored andcommitted
build: set up ng-dev toolset for the repo (#1244)
Set up the ng-dev toolset for the repo to allow it to be used for merging PRs.
1 parent b8710fb commit c866fd4

File tree

6 files changed

+2248
-137
lines changed

6 files changed

+2248
-137
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@ dist/
99
.vscode/settings.json
1010
.vimrc
1111
.nvimrc
12+
13+
14+
# Ignore files log and local only files related to ng-dev
15+
*.log
16+
.ng-dev.user*
17+
.husky/_

.ng-dev/config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {github} from './github';
2+
import {merge} from './merge';
3+
4+
export {
5+
github,
6+
merge,
7+
}

.ng-dev/github.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {GithubConfig} from '@angular/dev-infra-private/utils/config';
2+
3+
/**
4+
* Github configuration for the `ng-dev` toolset.
5+
*/
6+
export const github: GithubConfig = {
7+
name: 'vscode-ng-language-service',
8+
owner: 'angular',
9+
};

.ng-dev/merge.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import {DevInfraMergeConfig} from '@angular/dev-infra-private/pr/merge/config'
2+
import {getDefaultTargetLabelConfiguration} from '@angular/dev-infra-private/pr/merge/defaults';
3+
import {ReleaseConfig} from '@angular/dev-infra-private/release/config';
4+
5+
import {github} from './github'
6+
7+
/** Configuration for the `ng-dev release` command, defined here for use by the merge config. */
8+
export const release: ReleaseConfig = {
9+
npmPackages: ['@angular/language-server'],
10+
buildPackages: async () => [],
11+
generateReleaseNotesForHead: async () => {},
12+
};
13+
14+
15+
/**
16+
* Configuration for the merge tool in `ng-dev`. This sets up the labels which
17+
* are respected by the merge script (e.g. the target labels).
18+
*/
19+
export const merge: DevInfraMergeConfig['merge'] = async api => {
20+
return {
21+
// By default, the merge script merges locally with `git cherry-pick` and autosquash.
22+
// This has the downside of pull requests showing up as `Closed` instead of `Merged`.
23+
// In the components repository, since we don't use fixup or squash commits, we can
24+
// use the Github API merge strategy. That way we ensure that PRs show up as `Merged`.
25+
githubApiMerge: {
26+
default: 'squash',
27+
labels: [
28+
{pattern: 'preserve commits', method: 'rebase'},
29+
],
30+
},
31+
claSignedLabel: 'cla: yes',
32+
mergeReadyLabel: 'action: merge',
33+
commitMessageFixupLabel: 'commit message fixup',
34+
labels: await getDefaultTargetLabelConfiguration(api, github, release),
35+
};
36+
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
"vscode-uri": "3.0.2"
161161
},
162162
"devDependencies": {
163+
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#aeb8676ab6275272829e9d68388ec2e6c73b4eaa",
163164
"@types/jasmine": "3.6.3",
164165
"@types/node": "12.19.16",
165166
"clang-format": "1.5.0",

0 commit comments

Comments
 (0)