@pc360/chlog 0.1.8 โ†’ 0.1.10

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.
package/CHANGELOG.md CHANGED
@@ -8,14 +8,28 @@ The format is based on Keep a Changelog, and this project follows Semantic Versi
8
8
 
9
9
  ### Changed
10
10
 
11
+ - No changes yet.
12
+
13
+ ## [0.1.10] - 2026-02-15
14
+
15
+ ### Changed
16
+
11
17
  - Removed Ink card border lines so help and status output no longer render inside a box.
12
18
  - Added blank lines before and after help and error output to improve readability.
19
+ - Reorganized README onboarding flow into: installation, first-time dry-run usage, and troubleshooting.
20
+ - Added explicit `command not found: chlog` guidance, including PATH updates for `~/.zshrc` / `~/.bashrc` (with `~/.zhsrc` note).
21
+
22
+ ## [0.1.9] - 2026-02-14
23
+
24
+ ### Changed
25
+
26
+ - Update docs with a global installation and add --version option
13
27
 
14
28
  ## [0.1.8] - 2026-02-14
15
29
 
16
30
  ### Changed
17
31
 
18
- - Update docs
32
+ - Update docs.
19
33
 
20
34
  ## [0.1.7] - 2026-02-14
21
35
 
package/README.md CHANGED
@@ -2,101 +2,140 @@
2
2
 
3
3
  Internal CLI tool for creating structured changelog entries under:
4
4
 
5
- ```
5
+ ```text
6
6
  changelog/unreleased/{added|changed|fixed|removed}
7
7
  ```
8
8
 
9
- The CLI now renders polished terminal cards using `ink` in interactive terminals, with plain-text fallback for scripts/CI.
10
-
11
- Each entry file is automatically:
9
+ Each entry is automatically:
12
10
 
13
- - Named using Asia/Manila timestamp (`YYYYMMDDHHmmss`)
11
+ - Named with Asia/Manila timestamp (`YYYYMMDDHHmmss`)
14
12
  - Placed in the correct type directory
15
- - Written as a single clean line
13
+ - Written as one clean line
16
14
  - Prefixed with scope and layer (`Back-End` or `Front-End`)
17
15
 
18
- ---
16
+ ## 1. Installation
19
17
 
20
- ## ๐Ÿš€ Usage
18
+ Requirements:
21
19
 
22
- ```
23
- npx @pc360/chlog --type <added|changed|fixed|removed> \
24
- --scope <scope> \
25
- --message "<description>" \
26
- [--frontend]
20
+ - Node.js `>= 18`
21
+
22
+ Install globally:
27
23
 
28
- # Short form
29
- npx @pc360/chlog -t <added|changed|fixed|removed> -s <scope> -m "<description>" [-f]
24
+ ```bash
25
+ npm i -g @pc360/chlog
30
26
  ```
31
27
 
32
- ---
28
+ Alternative (without global install):
33
29
 
34
- ## ๐Ÿงฉ Parameters
30
+ ```bash
31
+ npx @pc360/chlog --type <added|changed|fixed|removed> --scope <scope> --message "<description>"
32
+ ```
35
33
 
36
- | Flag | Required | Description |
37
- | ---------------- | -------- | --------------------------------------------------- |
38
- | `-t, --type` | โœ… | Change type: `added`, `changed`, `fixed`, `removed` |
39
- | `-s, --scope` | โœ… | Jira ticket or module name |
40
- | `-m, --message` | โœ… | Description of the change |
41
- | `-f, --frontend` | โŒ | Uses `[Front-End]` instead of `[Back-End]` |
42
- | `-d, --dry-run` | โŒ | Preview file creation without writing |
43
- | `-h, --help` | โŒ | Show help |
34
+ ## 2. First-Time Usage (Dry Run First)
44
35
 
45
- ---
36
+ For first use, always run a dry run to preview output without creating a file:
46
37
 
47
- ## ๐Ÿ“ Examples
38
+ ```bash
39
+ chlog --type added --scope JES-99 --message "Test entry" --dry-run
40
+ ```
48
41
 
49
- ### Back-End Change (Default)
42
+ Short form:
50
43
 
51
- ```
52
- npx @pc360/chlog --type added --scope JES-33 --message "Add daily consolidated JE job"
44
+ ```bash
45
+ chlog -t added -s JES-99 -m "Test entry" -d
53
46
  ```
54
47
 
55
- Creates:
48
+ If the preview is correct, run the actual command:
56
49
 
57
- ```
58
- changelog/unreleased/added/20260213124530
50
+ ```bash
51
+ chlog --type added --scope JES-99 --message "Test entry"
59
52
  ```
60
53
 
61
- File content:
54
+ ## 3. If `chlog` Is Not Found
62
55
 
56
+ If you see `command not found: chlog` after installation, add npm global `bin` to your `PATH`.
57
+
58
+ 1. Get npm prefix:
59
+
60
+ ```bash
61
+ npm get prefix
63
62
  ```
64
- [JES-33] [Back-End] Add daily consolidated JE job
63
+
64
+ 2. Add this line to your shell config (replace `<prefix>` with output above):
65
+
66
+ ```bash
67
+ export PATH="$PATH:<prefix>/bin"
65
68
  ```
66
69
 
67
- ---
70
+ 3. Save to the right file:
71
+
72
+ - `zsh`: `~/.zshrc` (or `~/.zhsrc` if your environment uses that filename)
73
+ - `bash`: `~/.bashrc`
68
74
 
69
- ### Front-End Change
75
+ 4. Reload shell:
70
76
 
77
+ ```bash
78
+ source ~/.zshrc
79
+ # or
80
+ source ~/.bashrc
71
81
  ```
72
- npx @pc360/chlog --type fixed --scope JES-45 --frontend --message "Fix table pagination issue"
82
+
83
+ 5. Verify:
84
+
85
+ ```bash
86
+ chlog --version
73
87
  ```
74
88
 
75
- File content:
89
+ ## Usage
76
90
 
91
+ ```bash
92
+ chlog --type <added|changed|fixed|removed> \
93
+ --scope <scope> \
94
+ --message "<description>" \
95
+ [--frontend]
77
96
  ```
78
- [JES-45] [Front-End] Fix table pagination issue
97
+
98
+ Short form:
99
+
100
+ ```bash
101
+ chlog -t <added|changed|fixed|removed> -s <scope> -m "<description>" [-f]
79
102
  ```
80
103
 
81
- ---
104
+ ## Parameters
82
105
 
83
- ### Module-Based Scope
106
+ | Flag | Required | Description |
107
+ | ---------------- | -------- | --------------------------------------------------- |
108
+ | `-t, --type` | Yes | Change type: `added`, `changed`, `fixed`, `removed` |
109
+ | `-s, --scope` | Yes | Jira ticket or module name |
110
+ | `-m, --message` | Yes | Description of the change |
111
+ | `-f, --frontend` | No | Uses `[Front-End]` instead of `[Back-End]` |
112
+ | `-d, --dry-run` | No | Preview file creation without writing |
113
+ | `-h, --help` | No | Show help |
114
+ | `-v, --version` | No | Show CLI version |
84
115
 
85
- ```
86
- npx @pc360/chlog --type changed --scope "Credit Validation" --message "Improve credit limit computation"
87
- ```
116
+ ## Examples
88
117
 
89
- File content:
118
+ Back-End (default):
90
119
 
91
- ```
92
- [Credit Validation] [Back-End] Improve credit limit computation
120
+ ```bash
121
+ chlog --type added --scope JES-33 --message "Add daily consolidated JE job"
93
122
  ```
94
123
 
95
- ---
124
+ Front-End:
96
125
 
97
- ## ๐Ÿ“‚ Directory Structure
126
+ ```bash
127
+ chlog --type fixed --scope JES-45 --frontend --message "Fix table pagination issue"
128
+ ```
129
+
130
+ Module scope:
98
131
 
132
+ ```bash
133
+ chlog --type changed --scope "Credit Validation" --message "Improve credit limit computation"
99
134
  ```
135
+
136
+ ## Output Structure
137
+
138
+ ```text
100
139
  changelog/
101
140
  โ””โ”€โ”€ unreleased/
102
141
  โ”œโ”€โ”€ added/
@@ -105,71 +144,21 @@ changelog/
105
144
  โ””โ”€โ”€ removed/
106
145
  ```
107
146
 
108
- Each entry is stored as a timestamp-named file:
147
+ Entry filename format:
109
148
 
110
- ```
149
+ ```text
111
150
  YYYYMMDDHHmmss
112
151
  ```
113
152
 
114
- Timezone used: **Asia/Manila**
115
-
116
- ---
153
+ Timezone used: `Asia/Manila`
117
154
 
118
- ## ๐Ÿ” Rules Enforced by CLI
155
+ ## CLI Rules
119
156
 
120
157
  - `--type` is required
121
158
  - `--scope` is required
122
159
  - `--message` is required
123
- - Prevents overwriting existing files
124
- - Automatically inserts `[Back-End]` or `[Front-End]`
125
- - Generates timestamp using Asia/Manila timezone
126
-
127
- ---
128
-
129
- ## ๐Ÿง  Recommended Conventions
130
-
131
- Preferred scope format:
132
-
133
- - Jira ticket: `JES-45`
134
- - Module name: `"Credit Validation"`
135
-
136
- Recommended message style:
137
-
138
- - Use imperative mood
139
- - Start with capital letter
140
- - Do not end with period
141
-
142
- Example:
143
-
144
- ```
145
- Add dealer credit validation logic
146
- Fix FR status blocking issue
147
- ```
148
-
149
- ---
150
-
151
- ## ๐Ÿงช Dry Run Mode
152
-
153
- Preview without creating file:
154
-
155
- ```
156
- npx @pc360/chlog --type added --scope JES-99 --message "Test entry" --dry-run
157
- ```
158
-
159
- ---
160
-
161
- ## ๐Ÿ›  Node Version
162
-
163
- Requires:
164
-
165
- ```
166
- Node.js >= 18
167
- ```
168
-
169
- Runtime dependencies:
170
-
171
- - `ink`
172
- - `react`
160
+ - Existing files are not overwritten
161
+ - Layer tag is auto-added (`[Back-End]` or `[Front-End]`)
173
162
 
174
163
  ---
175
164
 
@@ -200,9 +189,3 @@ node --test
200
189
  - Output line formatting
201
190
  - Front-End vs Back-End label handling
202
191
  - Prevention of double label prefixing
203
-
204
- ---
205
-
206
- ## ๐Ÿ‘จโ€๐Ÿ’ป Maintainer
207
-
208
- - almerleoalmazan@gmail.com
package/bin/chlog.js CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  const fs = require("fs/promises");
5
5
  const path = require("path");
6
+ const { version } = require("../package.json");
6
7
 
7
8
  const {
8
9
  parseArgs,
@@ -39,6 +40,7 @@ Options:
39
40
  --tz "<iana>" Timezone (default: Asia/Manila)
40
41
  -d, --dry-run Preview only
41
42
  -h, --help Show help
43
+ -v, --version Show version
42
44
  `.trim();
43
45
  }
44
46
 
@@ -51,6 +53,11 @@ async function main() {
51
53
  process.exit(0);
52
54
  }
53
55
 
56
+ if (args.version) {
57
+ process.stdout.write(`${version}\n`);
58
+ process.exit(0);
59
+ }
60
+
54
61
  validateArgs(args);
55
62
 
56
63
  const timestamp = generateTimestamp(new Date(), args.tz);
package/lib/chlog-lib.js CHANGED
@@ -11,6 +11,7 @@ function parseArgs(argv) {
11
11
  frontend: false,
12
12
  dryRun: false,
13
13
  help: false,
14
+ version: false,
14
15
  };
15
16
 
16
17
  for (let i = 2; i < argv.length; i++) {
@@ -21,6 +22,11 @@ function parseArgs(argv) {
21
22
  break;
22
23
  }
23
24
 
25
+ if (arg === "-v" || arg === "--version") {
26
+ args.version = true;
27
+ break;
28
+ }
29
+
24
30
  if (arg === "--dry-run" || arg === "-d") {
25
31
  args.dryRun = true;
26
32
  continue;
package/lib/chlog-ui.js CHANGED
@@ -136,7 +136,7 @@ async function renderHelp(helpText) {
136
136
 
137
137
  const rendered = await renderInkCard(
138
138
  {
139
- title: "PC360 Changelog CLI - v0.1.8",
139
+ title: "PC360 Changelog CLI",
140
140
  subtitle: "Usage & options",
141
141
  lines: styledLines,
142
142
  tone: "info",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pc360/chlog",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "PC360 Changelog CLI Tool",
5
5
  "author": "aalmazan@pcdsi.ph",
6
6
  "bin": {