-
Notifications
You must be signed in to change notification settings - Fork 0
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
Florian Pichler
committed
Sep 4, 2018
1 parent
1442f4b
commit d1ae7c2
Showing
33 changed files
with
3,201 additions
and
0 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,23 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[{package.json,*.{yaml,yml},bower.json}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.hbs] | ||
insert_final_newline = false | ||
|
||
[*.{diff,md}] | ||
trim_trailing_whitespace = false |
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,33 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
# Disabled because eslint-plugin-prettier chokes on this, | ||
# because ember-cli-eslint is naive | ||
# root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[{package.json,config/*.json}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.hbs] | ||
insert_final_newline = false | ||
|
||
[*.{diff,md}] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yaml,yml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[.prettierrc] | ||
indent_style = space | ||
indent_size = 2 |
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 @@ | ||
module.exports = { | ||
extends: 'anfema/node', | ||
}; |
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,2 @@ | ||
node_modules | ||
.workrc |
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,16 @@ | ||
*.hbs | ||
*.yaml | ||
*.yml | ||
.editorconfig | ||
.eslintignore | ||
.git | ||
.gitignore | ||
.ignore | ||
.stylelintignore | ||
dist | ||
node_modules | ||
package.json | ||
public | ||
tmp | ||
vendor | ||
yarn.lock |
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,19 @@ | ||
bracketSpacing: true | ||
jsxBracketSameLine: false | ||
printWidth: 100 | ||
semi: true | ||
singleQuote: true | ||
tabWidth: 4 | ||
trailingComma: es5 | ||
useTabs: true | ||
overrides: | ||
- | ||
files: '{.watchmanconfig,.ember-cli,config/*.json}' | ||
options: | ||
parser: json | ||
- | ||
files: '*.yaml' | ||
options: | ||
parser: yaml | ||
useTabs: false | ||
tabWidth: 2 |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env node | ||
|
||
require('../index.js'); |
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,107 @@ | ||
// const listPullRequests = require('./src/list-pull-requests.js'); | ||
// const renderChangeLog = require('./src/render-change-log.js'); | ||
|
||
// const { last: lastTag, all: allTags } = require('./lib/repository-tags.js'); | ||
const repoPath = require('./lib/repository-path.js'); | ||
|
||
const { commits } = require('./lib/commits.js'); | ||
|
||
// const inquirer = require('inquirer'); | ||
|
||
// const config = require('./src/config.js'); | ||
|
||
(async () => { | ||
// const pullRequests = await listPullRequests(); | ||
// const lastRelease = await lastTag({ cwd: repoPath }); | ||
// | ||
// const tags = await allTags({ cwd: repoPath }); | ||
// | ||
|
||
console.log(repoPath); | ||
|
||
// const changeLog = renderChangeLog(pullRequests); | ||
// | ||
// console.log(lastRelease); | ||
// gitCommits(repoPath, {}).on('data', commit => { | ||
// console.log(commit.hash, commit.hash === lastRelease.hash); | ||
// }); | ||
// | ||
|
||
const all = await commits({ | ||
cwd: repoPath, | ||
}); | ||
|
||
console.log( | ||
all.map( | ||
commit => | ||
`${commit.hash.substr(0, 6)} ${commit.title.trim()} ${commit.description | ||
.split('\n') | ||
.join('') | ||
.trim()}` | ||
) | ||
); | ||
|
||
// console.log( | ||
// pullRequests.map(pr => pr.data.merge_commit_sha) | ||
// // .map(sha => `${sha}: ${sha === lastRelease.hash}`) | ||
// ); | ||
// | ||
// let answers = await inquirer.prompt([ | ||
// { | ||
// type: 'list', | ||
// name: 'run', | ||
// message: 'What do you want to do today?', | ||
// default: 'list', | ||
// choices: [ | ||
// { | ||
// name: 'List available releases', | ||
// value: 'list', | ||
// short: 'List releases', | ||
// }, | ||
// { | ||
// name: 'Create new release', | ||
// value: 'new', | ||
// short: 'New release', | ||
// }, | ||
// new inquirer.Separator(), | ||
// { | ||
// name: "Quit", | ||
// value: 'quit', | ||
// }, | ||
// ], | ||
// when(answers) { | ||
// if (answers.continue || answers.list) { | ||
// return true; | ||
// } | ||
// } | ||
// }, | ||
// ]); | ||
// if (answers.run === 'list') { | ||
// const tagsStream = repositoryTags({ cwd: repoPath }); | ||
// const tags = await getStream.array(tagsStream); | ||
// console.log(tags.map(({ tag, hash }) => `${tag} (${hash})`).join('\n'), '\n'); | ||
// answers = await promtStart(); | ||
// } | ||
// if (answers.run === 'new') { | ||
// answers = await inquirer.prompt([ | ||
// { | ||
// type: 'list', | ||
// name: 'release', | ||
// message: 'What kind of ?', | ||
// default: 'list', | ||
// choices: [ | ||
// { | ||
// name: 'Major', | ||
// value: 'major', | ||
// short: 'List releases', | ||
// }, | ||
// new inquirer.Separator(), | ||
// { | ||
// name: "Quit", | ||
// value: 'quit', | ||
// }, | ||
// ], | ||
// }, | ||
// ]); | ||
// } | ||
})(); |
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,49 @@ | ||
const chalk = require('chalk'); | ||
|
||
const gitCreateBranch = require('./lib/git/create-branch.js'); | ||
const githubInfo = require('./lib/git/github-info.js'); | ||
const program = require('./src/program.js'); | ||
const questions = require('./src/questions.js'); | ||
const config = require('./src/config.js'); | ||
const settings = require('./src/settings.js'); | ||
const createLabels = require('./lib/github/create-labels.js'); | ||
const deleteLabels = require('./lib/github/delete-labels.js'); | ||
|
||
(async () => { | ||
try { | ||
const answers = await questions(githubInfo, program); | ||
const results = Object.assign({}, config.store, settings, githubInfo, answers); | ||
|
||
switch (results.task) { | ||
case 'branch': | ||
await gitCreateBranch(results); | ||
|
||
break; | ||
|
||
case 'pr': | ||
console.log(chalk.blue(`Pull Requests are not implemented yet`)); | ||
|
||
break; | ||
|
||
case 'changelog': | ||
console.log(chalk.blue(`Changelogs are not implemented yet`)); | ||
|
||
break; | ||
|
||
case 'gh-remove-default-labels': | ||
await deleteLabels(results); | ||
|
||
break; | ||
|
||
case 'gh-sync-custom-labels': | ||
await createLabels(results); | ||
|
||
break; | ||
|
||
default: | ||
break; | ||
} | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
})(); |
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,30 @@ | ||
const execa = require('execa'); | ||
const { trim } = require('lodash'); | ||
|
||
module.exports = async () => { | ||
const { stdout } = await execa('git', ['branch', '-a', '--no-color']); | ||
|
||
const branches = stdout.split('\n').reduce( | ||
(acc, branch) => { | ||
branch = trim(branch); | ||
|
||
if (branch.substring(0, 2) === '* ') { | ||
acc.current = branch.substring(2); | ||
acc.local.push(acc.current); | ||
} else if (branch.match(/^remotes\//)) { | ||
acc.remote.push(branch.substring(8)); | ||
} else { | ||
acc.local.push(branch); | ||
} | ||
|
||
return acc; | ||
}, | ||
{ | ||
current: undefined, | ||
local: [], | ||
remote: [], | ||
} | ||
); | ||
|
||
return branches; | ||
}; |
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,12 @@ | ||
const gitCommits = require('git-commits'); | ||
const getStream = require('get-stream'); | ||
|
||
const commits = async (options = { cwd: '.' }) => { | ||
const commitStream = gitCommits(options.cwd, {}); | ||
|
||
return getStream.array(commitStream); | ||
}; | ||
|
||
module.exports = { | ||
commits, | ||
}; |
Oops, something went wrong.