feat(dev-infra): integrate merge script into ng-dev cli (#37138)

Integrates the merge script into the `ng-dev` CLI. The goal is that
caretakers can run the same command across repositories to merge a pull
request. The command is as followed: `yarn ng-dev pr merge <number>`.

PR Close #37138
This commit is contained in:
Paul Gschwendtner
2020-05-15 17:21:01 +02:00
committed by Kara Erickson
parent 318e9372c9
commit 8a3493af47
16 changed files with 237 additions and 97 deletions
+1
View File
@@ -7,6 +7,7 @@ ts_library(
visibility = ["//dev-infra:__subpackages__"],
deps = [
"@npm//@octokit/graphql",
"@npm//@types/inquirer",
"@npm//@types/node",
"@npm//@types/shelljs",
"@npm//shelljs",
+12 -5
View File
@@ -9,13 +9,20 @@
import {join} from 'path';
import {exec} from 'shelljs';
/**
* Describes the Github configuration for dev-infra. This configuration is
* used for API requests, determining the upstream remote, etc.
*/
export interface GithubConfig {
/** Owner name of the repository. */
owner: string;
/** Name of the repository. */
name: string;
}
/** The common configuration for ng-dev. */
type CommonConfig = {
/* Github repository configuration used for API Requests, determining upstream remote, etc. */
github: {
owner: string,
name: string,
}
github: GithubConfig
};
/**
+20
View File
@@ -0,0 +1,20 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {prompt} from 'inquirer';
/** Prompts the user with a confirmation question and a specified message. */
export async function promptConfirm(message: string, defaultValue = false): Promise<boolean> {
return (await prompt<{result: boolean}>({
type: 'confirm',
name: 'result',
message: message,
default: defaultValue,
}))
.result;
}