@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 +15 -1
- package/README.md +95 -112
- package/bin/chlog.js +7 -0
- package/lib/chlog-lib.js +6 -0
- package/lib/chlog-ui.js +1 -1
- package/package.json +1 -1
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
|
-
|
|
10
|
-
|
|
11
|
-
Each entry file is automatically:
|
|
9
|
+
Each entry is automatically:
|
|
12
10
|
|
|
13
|
-
- Named
|
|
11
|
+
- Named with Asia/Manila timestamp (`YYYYMMDDHHmmss`)
|
|
14
12
|
- Placed in the correct type directory
|
|
15
|
-
- Written as
|
|
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
|
-
|
|
18
|
+
Requirements:
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
--message "<description>" \
|
|
26
|
-
[--frontend]
|
|
20
|
+
- Node.js `>= 18`
|
|
21
|
+
|
|
22
|
+
Install globally:
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
```bash
|
|
25
|
+
npm i -g @pc360/chlog
|
|
30
26
|
```
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
Alternative (without global install):
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
```bash
|
|
31
|
+
npx @pc360/chlog --type <added|changed|fixed|removed> --scope <scope> --message "<description>"
|
|
32
|
+
```
|
|
35
33
|
|
|
36
|
-
|
|
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
|
-
|
|
38
|
+
```bash
|
|
39
|
+
chlog --type added --scope JES-99 --message "Test entry" --dry-run
|
|
40
|
+
```
|
|
48
41
|
|
|
49
|
-
|
|
42
|
+
Short form:
|
|
50
43
|
|
|
51
|
-
```
|
|
52
|
-
|
|
44
|
+
```bash
|
|
45
|
+
chlog -t added -s JES-99 -m "Test entry" -d
|
|
53
46
|
```
|
|
54
47
|
|
|
55
|
-
|
|
48
|
+
If the preview is correct, run the actual command:
|
|
56
49
|
|
|
57
|
-
```
|
|
58
|
-
|
|
50
|
+
```bash
|
|
51
|
+
chlog --type added --scope JES-99 --message "Test entry"
|
|
59
52
|
```
|
|
60
53
|
|
|
61
|
-
|
|
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
|
-
|
|
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
|
-
|
|
75
|
+
4. Reload shell:
|
|
70
76
|
|
|
77
|
+
```bash
|
|
78
|
+
source ~/.zshrc
|
|
79
|
+
# or
|
|
80
|
+
source ~/.bashrc
|
|
71
81
|
```
|
|
72
|
-
|
|
82
|
+
|
|
83
|
+
5. Verify:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
chlog --version
|
|
73
87
|
```
|
|
74
88
|
|
|
75
|
-
|
|
89
|
+
## Usage
|
|
76
90
|
|
|
91
|
+
```bash
|
|
92
|
+
chlog --type <added|changed|fixed|removed> \
|
|
93
|
+
--scope <scope> \
|
|
94
|
+
--message "<description>" \
|
|
95
|
+
[--frontend]
|
|
77
96
|
```
|
|
78
|
-
|
|
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
|
-
|
|
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
|
-
|
|
118
|
+
Back-End (default):
|
|
90
119
|
|
|
91
|
-
```
|
|
92
|
-
|
|
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
|
-
|
|
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
|
-
|
|
147
|
+
Entry filename format:
|
|
109
148
|
|
|
110
|
-
```
|
|
149
|
+
```text
|
|
111
150
|
YYYYMMDDHHmmss
|
|
112
151
|
```
|
|
113
152
|
|
|
114
|
-
Timezone used:
|
|
115
|
-
|
|
116
|
-
---
|
|
153
|
+
Timezone used: `Asia/Manila`
|
|
117
154
|
|
|
118
|
-
##
|
|
155
|
+
## CLI Rules
|
|
119
156
|
|
|
120
157
|
- `--type` is required
|
|
121
158
|
- `--scope` is required
|
|
122
159
|
- `--message` is required
|
|
123
|
-
-
|
|
124
|
-
-
|
|
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