-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Schmidt
committed
Mar 13, 2016
1 parent
325ed1c
commit a5a9df6
Showing
23 changed files
with
295 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": [ "es2015" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea/** | ||
build/** | ||
dist/** | ||
node_modules/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"extends": "holidaycheck", | ||
"extends": "holidaycheck/es2015", | ||
|
||
"env": { | ||
"node": true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*.iml | ||
.idea | ||
build | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,7 @@ | |
.gitignore | ||
.idea/ | ||
.travis.yml | ||
bin/ | ||
build/ | ||
lib/ | ||
test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
'use strict'; | ||
import moment from 'moment'; | ||
import R from 'ramda'; | ||
import validLabels from './validLabels'; | ||
|
||
var validLabels = require('./validLabels'), | ||
R = require('ramda'), | ||
util = require('util'), | ||
moment = require('moment'); | ||
function createChangelog(newVersionNumber, mergedPullRequests) { | ||
const groupedPullRequests = R.groupBy(R.prop('label'), mergedPullRequests); | ||
const date = moment().locale('en').format('MMMM D, YYYY'); | ||
const title = `## ${newVersionNumber} (${date})`; | ||
|
||
module.exports = function createChangelog(newVersionNumber, mergedPullRequests) { | ||
var changelog, | ||
groupedPullRequests = R.groupBy(R.prop('label'), mergedPullRequests), | ||
date = moment().locale('en').format('MMMM D, YYYY'), | ||
title = util.format('## %s (%s)', newVersionNumber, date); | ||
|
||
changelog = title + '\n\n'; | ||
let changelog = `${title}\n\n`; | ||
|
||
Object.keys(groupedPullRequests).forEach(function (label) { | ||
var pullRequests = groupedPullRequests[label]; | ||
const pullRequests = groupedPullRequests[label]; | ||
|
||
changelog += '### ' + validLabels[label] + '\n\n'; | ||
changelog += `### ${validLabels[label]}\n\n`; | ||
|
||
pullRequests.forEach(function (pullRequest) { | ||
changelog += '* ' + pullRequest.title + ' (#' + pullRequest.id + ')\n'; | ||
changelog += `* ${pullRequest.title} (#${pullRequest.id})\n`; | ||
}); | ||
|
||
changelog += '\n'; | ||
}); | ||
|
||
return changelog; | ||
}; | ||
} | ||
|
||
export default createChangelog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,46 @@ | ||
'use strict'; | ||
|
||
var git = require('git-promise'), | ||
parseGitUrl = require('git-url-parse'), | ||
R = require('ramda'); | ||
import git from 'git-promise'; | ||
import parseGitUrl from 'git-url-parse'; | ||
import R from 'ramda'; | ||
|
||
function isSameGitUrl(gitUrlA, gitUrlB) { | ||
var parsedUrlA = parseGitUrl(gitUrlA), | ||
parsedUrlB = parseGitUrl(gitUrlB), | ||
pathA = parsedUrlA.pathname.replace(/\.git$/, ''), | ||
pathB = parsedUrlB.pathname.replace(/\.git$/, ''); | ||
const parsedUrlA = parseGitUrl(gitUrlA); | ||
const parsedUrlB = parseGitUrl(gitUrlB); | ||
const pathA = parsedUrlA.pathname.replace(/\.git$/, ''); | ||
const pathB = parsedUrlB.pathname.replace(/\.git$/, ''); | ||
|
||
return parsedUrlA.resource === parsedUrlB.resource && pathA === pathB; | ||
} | ||
|
||
function getGitUrl(githubRepo) { | ||
return 'git://github.com/' + githubRepo + '.git'; | ||
return `git://github.com/${githubRepo}.git`; | ||
} | ||
|
||
module.exports = function findRemoteAlias(githubRepo) { | ||
var gitRemote = getGitUrl(githubRepo); | ||
function findRemoteAlias(githubRepo) { | ||
const gitRemote = getGitUrl(githubRepo); | ||
|
||
return git('remote -v') | ||
.then(function (output) { | ||
var remotes = output | ||
.then((output) => { | ||
const remotes = output | ||
.split('\n') | ||
.map(function (remote) { | ||
var tokens = remote.split(/\s/); | ||
.map((remote) => { | ||
const tokens = remote.split(/\s/); | ||
|
||
return { | ||
alias: tokens[0], | ||
url: tokens[1] | ||
}; | ||
}), | ||
matchedRemote; | ||
}); | ||
|
||
matchedRemote = R.find(function (remote) { | ||
const matchedRemote = R.find((remote) => { | ||
return remote.url && isSameGitUrl(gitRemote, remote.url); | ||
}, remotes); | ||
|
||
if (!matchedRemote) { | ||
throw new Error('This local git repository doesn’t have a remote pointing to ' + gitRemote); | ||
throw new Error(`This local git repository doesn’t have a remote pointing to ${gitRemote}`); | ||
} | ||
|
||
return matchedRemote.alias; | ||
}); | ||
}; | ||
} | ||
|
||
export default findRemoteAlias; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
'use strict'; | ||
import parseGithubUrl from 'parse-github-repo-url'; | ||
|
||
var parseGithubUrl = require('parse-github-repo-url'); | ||
|
||
module.exports = function getGithubRepo(githubUrl) { | ||
var result = parseGithubUrl(githubUrl); | ||
function getGithubRepo(githubUrl) { | ||
const result = parseGithubUrl(githubUrl); | ||
|
||
if (!result) { | ||
throw new Error('Invalid GitHub URI ' + githubUrl); | ||
throw new Error(`Invalid GitHub URI ${githubUrl}`); | ||
} | ||
|
||
return result[0] + '/' + result[1]; | ||
}; | ||
return `${result[0]}/${result[1]}`; | ||
} | ||
|
||
export default getGithubRepo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.