From 52ed6da8194d792b890df71500bcc18adabb1249 Mon Sep 17 00:00:00 2001 From: Yash Khare Date: Thu, 26 Nov 2020 21:47:14 +0530 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=A8=20cli:=20Add=20a=20command=20to?= =?UTF-8?q?=20give=20summary=20of=20all=20instructions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitgo | 24 +++++++++--------------- README.md | 2 +- bin/index.js | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 16 deletions(-) diff --git a/.gitgo b/.gitgo index 2673d96..4933d3a 100644 --- a/.gitgo +++ b/.gitgo @@ -1,19 +1,18 @@ { "current_issue": { - "number": "20", + "number": "51", "labels": [ "cli", + "command", "enhancement" ], - "title": "Add branch name & commit message suggestions " + "title": "Add a command to give summary of all instructions" }, "commit_guidelines": [ - "fix:", - " feat:", - " chore:" + "cli:" ], - "custom_guidelines": false, - "selected_commit_type": "🐎 Improving performance", + "custom_guidelines": true, + "selected_commit_type": "✨ Adding a new user-facing feature", "emojis": { "initial_commit": "tada", "feature": "sparkles", @@ -32,16 +31,11 @@ "wip": "construction" }, "existing_branches": [ - "issuetype-rec", - "main", - "notice", - "readme" + "main" ], "current_branch": [ - "branch-name", - "branch-name", - "message-suggestions" + "command-summary-instructions" ], - "current_commit_message": "🐎 chore: Add branch name & commit message suggestions ", + "current_commit_message": "✨ cli: Add a command to give summary of all instructions", "use_emojis": true } \ No newline at end of file diff --git a/README.md b/README.md index 124286f..5e635d4 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ npm i gitg0 Currently, we have the following 6 commands which will make you **Good To Go**, `gtg`: -### `gtg help` +### `gtg whoami` As the name suggests this command will help you know what the tool does and how to use the commands right from your terminal. diff --git a/bin/index.js b/bin/index.js index 77470f8..a9d1caa 100755 --- a/bin/index.js +++ b/bin/index.js @@ -9,6 +9,8 @@ const { getQuestions, getConfigQuestions, displaySuggestions } = require('../lib const simpleGit = require('simple-git'); const git = simpleGit(); const { jsonReader } = require('../lib/funcs/jsonReader.js'); +const version = require('../package.json') +const chalk = require('chalk'); clear(); @@ -140,4 +142,38 @@ program } }); +program +.command('version') +.alias('v') +.action(function () { + // displays Gitg0 on start + console.log(figlet.textSync('Gitg0', { + horizontalLayout: 'default', + verticalLayout: 'default', + }), '\n'); + console.log("v" + version.version + "-stable"); +}); + +program +.command('whoami') +.alias('w') +.action(function () { + // displays Gitg0 on start + console.log(figlet.textSync('Gitg0', { + horizontalLayout: 'default', + verticalLayout: 'default', + }), '\n'); + console.log("There's just 5 simple commands you need to know, and then you're " + chalk.bold.cyan("gtg") + ", " + chalk.magenta("Good to Go")); + console.log(chalk.green("\ngtg config:\n")); + console.log("This commands should be used on for the first time, while setting up the gitgo configuration. You will be asked a small set of questions regarding your commit and emoji preferences. If you would like to change these preferences sometime in future, you can run this command again to make the changes.\n"); + console.log(chalk.green("\ngtg start:\n")); + console.log("Everytime you start working on a new issue, just run this command in order for the tool to know which issue you're working on. After this, the tool will suggest the branch names and commit messages automatically.\n"); + console.log(chalk.green("\ngtg display:\n")); + console.log("This command can be used to display the branch name and commit that the tool will be suggesting for a particular issue once gtg start has been run.\n"); + console.log(chalk.green("\ngtg checkout:\n")); + console.log("This is a replacement for git checkout and will simply checkout with the suggested branch name.\n"); + console.log(chalk.green("\ngtg checkout:\n")); + console.log("This is a replacement for git commit and will commit your files once added with the suggested commit message.\n"); +}); + program.parse(process.argv); From 8c75eb59ae32476ee12d41dff526d470251bceff Mon Sep 17 00:00:00 2001 From: yashk2000 Date: Thu, 26 Nov 2020 21:46:22 +0000 Subject: [PATCH 2/3] :wrench: general: Fix linting with prettier --- bin/index.js | 83 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 31 deletions(-) diff --git a/bin/index.js b/bin/index.js index 2a7f520..67d8a1e 100755 --- a/bin/index.js +++ b/bin/index.js @@ -12,9 +12,9 @@ const { } = require("../lib/inquirer.js"); const simpleGit = require("simple-git"); const git = simpleGit(); -const { jsonReader } = require('../lib/funcs/jsonReader.js'); -const version = require('../package.json') -const chalk = require('chalk'); +const { jsonReader } = require("../lib/funcs/jsonReader.js"); +const version = require("../package.json"); +const chalk = require("chalk"); clear(); @@ -167,37 +167,58 @@ program }); program -.command('version') -.alias('v') -.action(function () { + .command("version") + .alias("v") + .action(function () { // displays Gitg0 on start - console.log(figlet.textSync('Gitg0', { - horizontalLayout: 'default', - verticalLayout: 'default', - }), '\n'); - console.log("v" + version.version + "-stable"); -}); + console.log( + figlet.textSync("Gitg0", { + horizontalLayout: "default", + verticalLayout: "default", + }), + "\n" + ); + console.log("v" + version.version + "-stable"); + }); program -.command('whoami') -.alias('w') -.action(function () { + .command("whoami") + .alias("w") + .action(function () { // displays Gitg0 on start - console.log(figlet.textSync('Gitg0', { - horizontalLayout: 'default', - verticalLayout: 'default', - }), '\n'); - console.log("There's just 5 simple commands you need to know, and then you're " + chalk.bold.cyan("gtg") + ", " + chalk.magenta("Good to Go")); - console.log(chalk.green("\ngtg config:\n")); - console.log("This commands should be used on for the first time, while setting up the gitgo configuration. You will be asked a small set of questions regarding your commit and emoji preferences. If you would like to change these preferences sometime in future, you can run this command again to make the changes.\n"); - console.log(chalk.green("\ngtg start:\n")); - console.log("Everytime you start working on a new issue, just run this command in order for the tool to know which issue you're working on. After this, the tool will suggest the branch names and commit messages automatically.\n"); - console.log(chalk.green("\ngtg display:\n")); - console.log("This command can be used to display the branch name and commit that the tool will be suggesting for a particular issue once gtg start has been run.\n"); - console.log(chalk.green("\ngtg checkout:\n")); - console.log("This is a replacement for git checkout and will simply checkout with the suggested branch name.\n"); - console.log(chalk.green("\ngtg checkout:\n")); - console.log("This is a replacement for git commit and will commit your files once added with the suggested commit message.\n"); -}); + console.log( + figlet.textSync("Gitg0", { + horizontalLayout: "default", + verticalLayout: "default", + }), + "\n" + ); + console.log( + "There's just 5 simple commands you need to know, and then you're " + + chalk.bold.cyan("gtg") + + ", " + + chalk.magenta("Good to Go") + ); + console.log(chalk.green("\ngtg config:\n")); + console.log( + "This commands should be used on for the first time, while setting up the gitgo configuration. You will be asked a small set of questions regarding your commit and emoji preferences. If you would like to change these preferences sometime in future, you can run this command again to make the changes.\n" + ); + console.log(chalk.green("\ngtg start:\n")); + console.log( + "Everytime you start working on a new issue, just run this command in order for the tool to know which issue you're working on. After this, the tool will suggest the branch names and commit messages automatically.\n" + ); + console.log(chalk.green("\ngtg display:\n")); + console.log( + "This command can be used to display the branch name and commit that the tool will be suggesting for a particular issue once gtg start has been run.\n" + ); + console.log(chalk.green("\ngtg checkout:\n")); + console.log( + "This is a replacement for git checkout and will simply checkout with the suggested branch name.\n" + ); + console.log(chalk.green("\ngtg checkout:\n")); + console.log( + "This is a replacement for git commit and will commit your files once added with the suggested commit message.\n" + ); + }); program.parse(process.argv); From 382e6457096fbbbc6f0d80bbc5dc9b7a21c74183 Mon Sep 17 00:00:00 2001 From: Yash Khare Date: Fri, 27 Nov 2020 12:15:46 +0530 Subject: [PATCH 3/3] :wrench: cli: Improve descriptions of git whoami Co-authored-by: Rachit Gupta --- bin/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/index.js b/bin/index.js index 67d8a1e..d863c7f 100755 --- a/bin/index.js +++ b/bin/index.js @@ -194,14 +194,14 @@ program "\n" ); console.log( - "There's just 5 simple commands you need to know, and then you're " + + "You just need to know 5 simple commands you and then you're " + chalk.bold.cyan("gtg") + - ", " + + ": " + chalk.magenta("Good to Go") ); console.log(chalk.green("\ngtg config:\n")); console.log( - "This commands should be used on for the first time, while setting up the gitgo configuration. You will be asked a small set of questions regarding your commit and emoji preferences. If you would like to change these preferences sometime in future, you can run this command again to make the changes.\n" + "This command should be used to personalise your gitgo configuration. You can add your repository's commit and emoticon guidelines.\n" ); console.log(chalk.green("\ngtg start:\n")); console.log(