Skip to content

Commit

Permalink
refactor(prompt): reorganize sources
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Jul 10, 2017
1 parent 3092ce5 commit 089a7ad
Show file tree
Hide file tree
Showing 19 changed files with 766 additions and 548 deletions.
38 changes: 30 additions & 8 deletions @commitlint/prompt/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
{
"name": "@commitlint/prompt",
"version": "3.0.0",
"description": "commit prompt using .commitlintrc",
"bin": {
"commit-prompt": "./lib/index.js"
},
"description": "commitizen prompt using .commitlintrc",
"main": "./lib/index.js",
"scripts": {
"build": "cross-env NODE_ENV=production babel src --out-dir lib",
"clean": "rimraf lib",
"commit": "git-cz",
"pretest": "dep-check",
"test": "exit 0",
"test": "ava",
"prepublish": "npm run build"
},
"ava": {
"babel": "inherit",
"require": [
"babel-register"
],
"files": [
"src/**/*.test.js"
],
"sources": [
"src/**/*.js"
]
},
"babel": {
"env": {
"development": {
"sourceMaps": "inline",
"plugins": [
"add-module-exports",
"istanbul",
[
"transform-runtime",
{
Expand Down Expand Up @@ -56,6 +66,11 @@
]
]
},
"config": {
"commitizen": {
"path": "./@commitlint/prompt"
}
},
"xo": false,
"repository": {
"type": "git",
Expand All @@ -76,19 +91,26 @@
"homepage": "https://github.com/marionebl/commitlint#readme",
"devDependencies": {
"@commitlint/utils": "^3.0.0",
"ava": "^0.20.0",
"babel-cli": "^6.24.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "1.6.0",
"babel-preset-stage-0": "^6.24.1",
"cross-env": "5.0.1"
"babel-register": "^6.24.1",
"commitizen": "^2.9.6",
"cross-env": "5.0.1",
"throat": "^4.1.0"
},
"dependencies": {
"@commitlint/core": "^3.0.0",
"babel-polyfill": "^6.23.0",
"babel-runtime": "^6.23.0",
"chalk": "1.1.1",
"lodash": "4.5.1",
"execa": "^0.7.0",
"lodash": "^4.17.4",
"meow": "^3.7.0",
"throat": "^4.1.0",
"vorpal": "1.10.0"
}
}
26 changes: 26 additions & 0 deletions @commitlint/prompt/src/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import execa from 'execa';
import meow from 'meow';
import vorpal from 'vorpal';
import input from './input';

const HELP = `
Usage
$ commit
`;

async function main() {
const message = await input(vorpal);
const commit = execa('git', ['commit', '-m', message]);

commit.stdout.pipe(process.stdout);
commit.stderr.pipe(process.stderr);

return commit;
}

main(meow(HELP))
.catch(err => {
setTimeout(() => {
throw err;
});
});
Loading

0 comments on commit 089a7ad

Please sign in to comment.