Skip to content

Commit

Permalink
Merge pull request #559 from danger/update_deps1
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
orta committed Apr 12, 2018
2 parents 0b8bc86 + bd6f6b4 commit 3eb635c
Show file tree
Hide file tree
Showing 8 changed files with 874 additions and 485 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

## Master

* Update dependencies [@orta][]

## 3.4.6

* Fixed Babel 7 breaking due to invalid sourceFileName configuration [@kesne][]
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"devDependencies": {
"@types/debug": "0.0.30",
"@types/get-stdin": "^5.0.1",
"@types/jest": "^22.0.1",
"@types/jest": "^22.2.3",
"@types/json5": "^0.0.29",
"@types/lodash.includes": "^4.3.3",
"@types/node-fetch": "^1.6.6",
Expand All @@ -93,23 +93,23 @@
"danger-plugin-jest": "^1.0.1",
"danger-plugin-yarn": "^1.2.1",
"date-fns": "^1.29.0",
"flow-bin": "^0.68.0",
"flow-bin": "^0.69.0",
"husky": "^0.14.0",
"jest": "22.1.4",
"jest": "22.4.3",
"jest-json-reporter": "^1.2.2",
"lint-staged": "^7.0.0",
"madge": "^3.0.0",
"prettier": "^1.10.2",
"shx": "^0.2.1",
"ts-jest": "^22.0.1",
"ts-node": "^4.1.0",
"ts-jest": "^22.4.2",
"ts-node": "^5.0.1",
"tslint": "^5.9.1",
"tslint-config-prettier": "^1.8.0",
"typedoc": "0.9.0",
"typescript": "^2.6.2"
},
"dependencies": {
"@octokit/rest": "^14.0.4",
"@octokit/rest": "^15.2.6",
"babel-polyfill": "^6.23.0",
"chalk": "^2.3.0",
"commander": "^2.13.0",
Expand All @@ -124,9 +124,9 @@
"lodash.isobject": "^3.0.2",
"lodash.keys": "^4.0.8",
"node-cleanup": "^2.1.2",
"node-fetch": "^1.7.3",
"parse-diff": "^0.4.0",
"parse-git-config": "^1.1.1",
"node-fetch": "^2.1.2",
"parse-diff": "^0.4.2",
"parse-git-config": "^2.0.2",
"parse-github-url": "^1.0.2",
"parse-link-header": "^1.0.1",
"pinpoint": "^1.1.0",
Expand Down
9 changes: 0 additions & 9 deletions source/commands/danger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,4 @@ program
console.log(" http://danger.systems/js/reference.html")
})

// Commander mutates process.argv
const originalProcessArgV = process.argv
program.parse(process.argv)

const showUpgradeNotice =
process.env.CI && ["init", "ci", "process", "pr", "local", "--help"].some(cmd => originalProcessArgV.includes(cmd))

if (showUpgradeNotice) {
console.error("You may have updated from Danger 2.x -> 3.x without updating from `danger` to `danger ci`.")
}
5 changes: 2 additions & 3 deletions source/platforms/github/GitHubAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class GitHubAPI {
getExternalAPI = (): GitHubNodeAPI => {
const baseUrl = process.env["DANGER_GITHUB_API_BASE_URL"] || undefined
const api = new GitHubNodeAPI({
host: baseUrl,
baseUrl,
headers: {
...this.additionalHeaders,
},
Expand Down Expand Up @@ -385,8 +385,7 @@ export class GitHubAPI {
)
}

get = (path: string, headers: any = {}, body: any = {}): Promise<node_fetch.Response> =>
this.api(path, headers, body, "GET")
get = (path: string, headers: any = {}): Promise<node_fetch.Response> => this.api(path, headers, null, "GET")

post = (path: string, headers: any = {}, body: any = {}, suppressErrors?: boolean): Promise<node_fetch.Response> =>
this.api(path, headers, JSON.stringify(body), "POST", suppressErrors)
Expand Down
4 changes: 2 additions & 2 deletions source/platforms/github/_tests/_github_api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ describe("Peril", () => {
expect(api.fetch).toHaveBeenCalledWith(
"https://api.github.com/user",
{
body: {},
body: null,
headers: {
Authorization: "token ABCDE",
CUSTOM: "HEADER",
Expand All @@ -186,7 +186,7 @@ describe("Peril", () => {
expect(api.fetch).toHaveBeenCalledWith(
"https://api.github.com/user",
{
body: {},
body: null,
headers: {
Accept: "application/vnd.github.machine-man-preview+json, application/vnd.github.v3.diff",
Authorization: "token ABCDE",
Expand Down
13 changes: 9 additions & 4 deletions source/runner/Executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,25 @@ export class Executor {
console.log(row.messages.join(chalk.bold("\n-\n")))
})

const tick = chalk.bold.greenBright("✓")
const cross = chalk.bold.redBright("ⅹ")

if (fails.length > 0) {
const s = fails.length === 1 ? "" : "s"
const are = fails.length === 1 ? "is" : "are"
const message = chalk.underline.red("Failing the build")
console.log(`Danger: ${message}, there ${are} ${fails.length} fail${s}.`)
console.log(`Danger: ${cross} ${message}, there ${are} ${fails.length} fail${s}.`)
process.exitCode = 1
} else if (warnings.length > 0) {
const message = chalk.underline("not failing the build")
console.log(`Danger: Found only warnings, ${message}`)
console.log(`Danger: ${tick} found only warnings, ${message}`)
} else if (messages.length > 0) {
console.log("Danger: Passed, found only messages.")
console.log(`Danger: ${tick} passed, found only messages.`)
} else if (!messages.length && !fails.length && !messages.length && !warnings.length) {
console.log("Danger: Passed review, received no feedback.")
console.log(`Danger: ${tick} passed review, received no feedback.`)
}
// An empty blank line for visual spacing
console.log("")
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/runner/jsonToDSL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const apiForDSL = (dsl: DangerDSLJSONType): GitHubNodeAPI | BitBucketServerAPI =
}

const api = new GitHubNodeAPI({
host: dsl.settings.github.baseURL,
baseUrl: dsl.settings.github.baseURL,
headers: {
...dsl.settings.github.additionalHeaders,
},
Expand Down

0 comments on commit 3eb635c

Please sign in to comment.