purecommit 1.0.0 โ†’ 1.0.1

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 (2) hide show
  1. package/README.md +112 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,112 @@
1
+ <div align="center">
2
+ <h1>๐Ÿš€ PureCommit</h1>
3
+ <p><b>Purify your commits without losing your local debug flow.</b></p>
4
+
5
+ <p>
6
+ <img src="https://img.shields.io/npm/v/purecommit?style=for-the-badge&color=blue" alt="NPM Version" />
7
+ <img src="https://img.shields.io/npm/l/purecommit?style=for-the-badge&color=green" alt="License" />
8
+ <img src="https://img.shields.io/npm/dt/purecommit?style=for-the-badge&color=orange" alt="Downloads" />
9
+ </p>
10
+ <hr />
11
+ </div>
12
+
13
+ <p align="center">
14
+ PureCommit is a <b>"Non-Destructive"</b> CLI tool that automatically strips <code>console.log</code> statements and <code>// debug</code> comments from your <b>git commits</b>, while keeping them intact in your local files.
15
+ </p>
16
+
17
+ <div align="center">
18
+ <p><i>Keep your production code clean without sacrificing your local debugging experience.</i></p>
19
+ </div>
20
+
21
+ ---
22
+
23
+ ### โœจ Features
24
+
25
+ <table width="100%">
26
+ <tr>
27
+ <td>๐Ÿ›ก๏ธ <b>Safe-Purification</b></td>
28
+ <td>Only cleans the "Staged" version of your files. Your local workspace remains untouched.</td>
29
+ </tr>
30
+ <tr>
31
+ <td>๐Ÿงน <b>Zero-Tolerance</b></td>
32
+ <td>Automatically detects and removes all <code>console.log(...)</code> and lines containing <code>// debug</code>.</td>
33
+ </tr>
34
+ <tr>
35
+ <td>๐Ÿท๏ธ <b>The "Keep" Tag</b></td>
36
+ <td>Add <code>// keep</code> to the end of any line to bypass the filter and keep it in production.</td>
37
+ </tr>
38
+ <tr>
39
+ <td>๐Ÿถ <b>Husky Ready</b></td>
40
+ <td>Built-in setup to run automatically on every <code>git commit</code>.</td>
41
+ </tr>
42
+ </table>
43
+
44
+ ---
45
+
46
+ ### ๐Ÿ›  How It Works & Edge Cases
47
+
48
+ PureCommit is designed to be highly flexible. It uses smart regex to ensure it doesn't accidentally delete code you actually need.
49
+
50
+ #### **1. Case Insensitivity**
51
+ The tool doesn't care about your casing.
52
+ - `// DEBUG`, `// Debug`, and `// debug` are all treated the same and removed.
53
+ - `// KEEP`, `// Keep`, and `// keep` all successfully preserve your logs.
54
+
55
+ #### **2. Flexible Spacing**
56
+ Whether you write `//debug` or `// debug`, PureCommit will find it and clean it.
57
+
58
+ #### **3. The Rules in Action:**
59
+
60
+ | Code Example | Action | Result in Commit |
61
+ | :--- | :--- | :--- |
62
+ | `console.log("Check this");` | โŒ **Remove** | *Deleted* |
63
+ | `const x = 5; // DEBUG This is just a number` | โŒ **Remove** | `const x = 5;` |
64
+ | `console.info("Vital Info"); // keep` | โœ… **Keep** | `console.info("Vital Info");` |
65
+ | `// TODO: fix this debug log` | ๐Ÿ›ก๏ธ **Ignore** | *Stays exactly as is* |
66
+
67
+ ---
68
+
69
+ <section id="installation">
70
+ <hr />
71
+ <h3 align="center">๐Ÿ“ฆ Installation & Setup</h3>
72
+ <p align="center">Choose the method that best fits your workflow:</p>
73
+
74
+ <div style="background-color: #f6f8fa; padding: 16px; border-radius: 6px; margin-bottom: 16px; border: 1px solid #d0d7de;">
75
+ <h4 style="margin-top: 0;">1๏ธโƒฃ Run Instantly (No Install)</h4>
76
+ <p>Test PureCommit on any repository immediately without adding it to your <code>package.json</code>:</p>
77
+ <pre style="background-color: #0d1117; color: #e6edf3; padding: 12px; border-radius: 6px; overflow: auto;"><code>npx purecommit</code></pre>
78
+ </div>
79
+
80
+ <div style="background-color: #f6f8fa; padding: 16px; border-radius: 6px; margin-bottom: 16px; border: 1px solid #d0d7de;">
81
+ <h4 style="margin-top: 0;">2๏ธโƒฃ Global Installation</h4>
82
+ <p>Install it globally to use the <code>purecommit</code> command anywhere:</p>
83
+ <pre style="background-color: #0d1117; color: #e6edf3; padding: 12px; border-radius: 6px; overflow: auto;"><code>npm install -g purecommit</code></pre>
84
+ <p>Once installed globally, you can simply run:</p>
85
+ <pre style="background-color: #0d1117; color: #e6edf3; padding: 12px; border-radius: 6px; overflow: auto;"><code>purecommit</code></pre>
86
+ </div>
87
+
88
+ <div style="background-color: #f6f8fa; padding: 16px; border-radius: 6px; margin-bottom: 16px; border: 1px solid #d0d7de;">
89
+ <h4 style="margin-top: 0;">3๏ธโƒฃ Automatic Mode (Recommended)</h4>
90
+ <p>Automate your workflow by setting up a <b>Pre-commit Hook</b>. Run the tool in your project folder:</p>
91
+ <pre style="background-color: #0d1117; color: #e6edf3; padding: 12px; border-radius: 6px; overflow: auto;"><code>npx purecommit</code></pre>
92
+ <p>When prompted with:</p>
93
+ <blockquote style="border-left: 4px solid #afb8c1; padding-left: 16px; color: #656d76; background: #fff; padding: 10px; margin: 10px 0;">
94
+ <i>"Husky hook not found. Do you want to set PureCommit as a pre-commit hook? (y/n)"</i>
95
+ </blockquote>
96
+ <table width="100%" style="border-collapse: collapse; margin-top: 10px;">
97
+ <tr>
98
+ <td style="padding: 10px; border: 1px solid #d0d7de;"><b>If you choose <kbd>y</kbd></b></td>
99
+ <td style="padding: 10px; border: 1px solid #d0d7de;"><b>Automation:</b> PureCommit will run quietly every time you <code>git commit</code>. No manual steps required.</td>
100
+ </tr>
101
+ <tr>
102
+ <td style="padding: 10px; border: 1px solid #d0d7de;"><b>If you choose <kbd>n</kbd></b></td>
103
+ <td style="padding: 10px; border: 1px solid #d0d7de;"><b>Manual:</b> You must run <code>npx purecommit</code> (or just <code>purecommit</code> if installed globally) whenever you want to purify your staged changes.</td>
104
+ </tr>
105
+ </table>
106
+ <p align="center" style="font-size: 0.85em; color: #cf222e; margin-top: 15px;">
107
+ โš ๏ธ <b>Important:</b> Automatic setup requires an initialized Git repository. Run <code>git init</code> first if testing in a new folder.
108
+ </p>
109
+ </div>
110
+ </section>
111
+
112
+ ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "purecommit",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Purify your commits by automatically removing console.logs and debug comments.",
5
5
  "main": "src/purifier.js",
6
6
  "bin": {
@@ -33,4 +33,4 @@
33
33
  "url": "https://github.com/Prof2807/CleanCommit/issues"
34
34
  },
35
35
  "homepage": "https://github.com/Prof2807/CleanCommit#readme"
36
- }
36
+ }