prsmith 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +86 -24
  2. package/bin/cli.js +25 -19
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,28 +1,38 @@
1
- # PRSmith
1
+ <div align="center">
2
+ <h1>PRSmith</h1>
3
+
4
+ [![npm version](https://img.shields.io/npm/v/prsmith.svg?style=flat-square)](https://www.npmjs.com/package/prsmith)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
6
+ [![CI](https://img.shields.io/github/actions/workflow/status/TarunyaProgrammer/PRSmith_NPMPackage/ci.yml?branch=main&style=flat-square)](https://github.com/TarunyaProgrammer/PRSmith_NPMPackage/actions)
2
7
 
3
- [![npm version](https://img.shields.io/npm/v/prsmith.svg?style=flat-square)](https://www.npmjs.com/package/prsmith)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
5
- [![CI](https://img.shields.io/github/actions/workflow/status/TarunyaProgrammer/PRSmith_NPMPackage/ci.yml?branch=main&style=flat-square)](https://github.com/TarunyaProgrammer/PRSmith_NPMPackage/actions)
8
+ <p><b>Forge professional pull request review comments directly from the terminal.</b></p>
9
+ </div>
6
10
 
7
- Forge professional pull request review comments directly from the terminal.
11
+ ---
8
12
 
9
13
  PRSmith streamlines the process of writing code reviews by providing an interactive prompt that generates consistently formatted, polite, and actionable Markdown comments.
10
14
 
11
- ---
12
-
13
15
  ## Architecture Flow
14
16
 
15
17
  The tool operates via a straightforward interactive flow, generating structured markdown from your inputs.
16
18
 
17
- ```mermaid
18
- graph TD
19
- A[User runs 'prsmith'] --> B{Interactive Prompts}
20
- B -->|Severity| C[Select Critical, Major, Minor, Suggestion]
21
- B -->|Title| D[Enter Title]
22
- B -->|Issue| E[Describe Problem]
23
- B -->|Fix| F[Suggest Fix]
24
- C & D & E & F --> G[Markdown Generator]
25
- G --> H[Print Formatted PR Comment]
19
+ ```text
20
+ ┌──────────────────────────┐
21
+ │ Run `prsmith` Command │
22
+ └────────────┬─────────────┘
23
+
24
+ ┌──────────────────────────┐
25
+ │ Interactive Prompts │
26
+ (Severity, Title, Issue)
27
+ └────────────┬─────────────┘
28
+
29
+ ┌──────────────────────────┐
30
+ │ Markdown Generation │
31
+ └────────────┬─────────────┘
32
+
33
+ ┌──────────────────────────┐
34
+ │ Print Formatted Comment │
35
+ └──────────────────────────┘
26
36
  ```
27
37
 
28
38
  ---
@@ -35,23 +45,46 @@ Install globally to use it anywhere on your machine.
35
45
  npm install -g prsmith
36
46
  ```
37
47
 
48
+ ## Features
49
+
50
+ - **Interactive Prompts:** No need to memorize complex flags. Just run the tool and answer the prompts.
51
+ - **Smart Formatting:** Automatically generates perfectly structured Markdown.
52
+ - **Graceful Exits:** Hit `Ctrl+C` anytime to exit safely without stack traces.
53
+ - **Built-in Help:** Run `prsmith --help` to view documentation directly in your terminal.
54
+
38
55
  ## Usage
39
56
 
40
- Simply run the command in your terminal:
57
+ ### Standard Mode
58
+ The primary way to use PRSmith is via its interactive mode. Simply run:
41
59
 
42
60
  ```bash
43
61
  prsmith
44
62
  ```
63
+ This will launch the interactive prompt asking for Severity, Title, Issue, and Fix.
64
+
65
+ ### Commands & Flags
66
+
67
+ | Command | Description |
68
+ | :--- | :--- |
69
+ | `prsmith` | Launch the interactive generator |
70
+ | `prsmith -h`, `--help` | Display the help menu and commands |
71
+ | `prsmith -v`, `--version` | Print the current installed version |
72
+
73
+ <details>
74
+ <summary><b>Click to view an Example Interaction</b></summary>
75
+
76
+ <br/>
45
77
 
46
- ## Example Interaction
78
+ **Input Data:**
47
79
 
48
- **Input:**
49
- - Severity: `Critical`
50
- - Title: `Scope Issue`
51
- - Issue: `Utility functions are nested incorrectly.`
52
- - Suggested Fix: `Move them to module scope.`
80
+ | Field | Input |
81
+ | :--- | :--- |
82
+ | **Severity** | `<kbd>Critical</kbd>` |
83
+ | **Title** | `Scope Issue` |
84
+ | **Issue** | `Utility functions are nested incorrectly.` |
85
+ | **Suggested Fix** | `Move them to module scope.` |
53
86
 
54
- **Output:**
87
+ **Output Markdown:**
55
88
 
56
89
  ```md
57
90
  ### Critical: Scope Issue
@@ -67,8 +100,17 @@ Utility functions are nested incorrectly.
67
100
  Move them to module scope.
68
101
  ```
69
102
 
103
+ </details>
104
+
105
+ ---
106
+
70
107
  ## Development & Contribution
71
108
 
109
+ <details>
110
+ <summary><b>Local Setup Guide</b></summary>
111
+
112
+ <br/>
113
+
72
114
  To set up the project locally:
73
115
 
74
116
  ```bash
@@ -87,7 +129,27 @@ npm run lint
87
129
  # Format the code
88
130
  npm run format
89
131
  ```
132
+ </details>
90
133
 
91
134
  ## License
92
135
 
93
136
  This project is licensed under the MIT License.
137
+
138
+ ---
139
+
140
+ <div align="center">
141
+ <h3>Built with 💻 by Tarunya Kesharwani</h3>
142
+
143
+ <p>
144
+ <i>"I build things. Usually web apps, sometimes automation scripts that save me from doing something tedious twice."</i>
145
+ </p>
146
+
147
+ <p>
148
+ I'm a Full-Stack Engineer and Open Source fanatic (GSoC'26 @ C2SI, Mentor @ GSSoC & SSoC). I obsess over frontend architecture that doesn't collapse under its own weight, seamless developer experiences, and building UI that feels intentional. When I'm not writing TypeScript, I'm probably deep in a rabbit hole about AI, startup strategy, or restructuring a folder hierarchy for the third time.
149
+ </p>
150
+
151
+ <p>
152
+ <a href="https://www.github.com/tarunyaprogrammer"><b>GitHub</b></a> &nbsp;&bull;&nbsp;
153
+ <a href="https://www.linkedin.com/in/tarunyakesharwani/"><b>LinkedIn</b></a>
154
+ </p>
155
+ </div>
package/bin/cli.js CHANGED
@@ -1,30 +1,36 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import chalk from "chalk";
4
+ import { program } from "commander";
4
5
  import { getReviewData } from "../src/prompts.js";
5
6
  import { generateMarkdown } from "../src/formatter.js";
6
7
 
7
- async function main() {
8
- try {
9
- console.log(
10
- chalk.cyan("\nPRSmith - Professional PR Review Comment Generator\n")
11
- );
8
+ program
9
+ .name("prsmith")
10
+ .description("Forge professional pull request review comments directly from the terminal.")
11
+ .version("1.0.1", "-v, --version", "Output the current version")
12
+ .helpOption("-h, --help", "Display help for command")
13
+ .action(async () => {
14
+ try {
15
+ console.log(
16
+ chalk.cyan("\nPRSmith - Professional PR Review Comment Generator\n")
17
+ );
12
18
 
13
- const data = await getReviewData();
19
+ const data = await getReviewData();
14
20
 
15
- const markdown = generateMarkdown(data);
21
+ const markdown = generateMarkdown(data);
16
22
 
17
- console.log(chalk.green("\nGenerated Comment:\n"));
18
- console.log(markdown);
19
- } catch (error) {
20
- if (error.name === "ExitPromptError") {
21
- console.log(chalk.yellow("\nYou have quit in b/w :) \n"));
22
- process.exit(0);
23
+ console.log(chalk.green("\nGenerated Comment:\n"));
24
+ console.log(markdown);
25
+ } catch (error) {
26
+ if (error.name === "ExitPromptError") {
27
+ console.log(chalk.yellow("\nYou have quit in b/w :) \n"));
28
+ process.exit(0);
29
+ }
30
+ console.error(chalk.red("\nSomething went wrong.\n"));
31
+ console.error(error);
32
+ process.exit(1);
23
33
  }
24
- console.error(chalk.red("\nSomething went wrong.\n"));
25
- console.error(error);
26
- process.exit(1);
27
- }
28
- }
34
+ });
29
35
 
30
- main();
36
+ program.parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prsmith",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Forge professional pull request review comments from simple prompts.",
5
5
  "keywords": [
6
6
  "pull-request",