vnxt 1.9.5 → 1.14.0

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 +73 -36
  2. package/package.json +1 -1
  3. package/vnxt.js +25 -4
package/README.md CHANGED
@@ -22,42 +22,56 @@ A lightweight CLI tool for automated version bumping with changelog generation a
22
22
 
23
23
  ## <img src="./docs/logos/caret-38x38.png" width="24" align="center"> Installation
24
24
 
25
- ### Global Installation
25
+ ### npm (all platforms)
26
26
 
27
- **Bash/PowerShell:**
28
27
  ```bash
29
28
  npm install -g vnxt
30
29
  ```
31
30
 
32
- After installation, you can use either `vnxt` or the shorter alias `vx`:
31
+ ### Scoop (Windows)
32
+
33
+ ```powershell
34
+ scoop bucket add vnxt https://github.com/n-orrow/scoop-vnxt
35
+ scoop install vnxt
36
+ ```
37
+
38
+ ### Chocolatey (Windows)
39
+
40
+ > ⏳ Pending moderation — will be available on the Chocolatey community repository shortly.
41
+
42
+ ```powershell
43
+ choco install vnxt
44
+ ```
45
+
46
+ ### Homebrew (macOS/Linux)
47
+
33
48
  ```bash
34
- vnxt --help
35
- vx --help # Same thing, shorter!
49
+ brew tap n-orrow/vnxt
50
+ brew install vnxt
36
51
  ```
37
52
 
38
- ### Local Installation (from source)
53
+ ### From Source
39
54
 
40
55
  **Bash/macOS/Linux:**
41
56
  ```bash
42
- # Clone the repository
43
57
  git clone https://github.com/n-orrow/vnxt.git
44
58
  cd vnxt
45
-
46
- # Install globally via npm link
47
59
  chmod +x vnxt.js
48
60
  npm link
49
61
  ```
50
62
 
51
63
  **PowerShell/Windows:**
52
64
  ```powershell
53
- # Clone the repository
54
65
  git clone https://github.com/n-orrow/vnxt.git
55
66
  cd vnxt
56
-
57
- # Install globally via npm link
58
67
  npm link
59
68
  ```
60
69
 
70
+ After installation, you can use either `vnxt` or the shorter alias `vx`:
71
+ ```bash
72
+ vx --help
73
+ ```
74
+
61
75
  ## <img src="./docs/logos/caret-38x38.png" width="24" align="center"> Usage
62
76
 
63
77
  ### Basic Examples
@@ -89,18 +103,19 @@ All options work with both `vnxt` and `vx`:
89
103
  ```
90
104
  -m, --message <msg> Commit message (required unless using interactive mode)
91
105
  -t, --type <type> Version type: patch, minor, major (auto-detected from message)
92
- -v, --version <ver> Set specific version (e.g., 2.0.0-beta.1)
93
- -V, --version Show vnxt version
94
- -p, --push Push to remote with tags
106
+ -sv, --set-version <v> Set a specific version (e.g., 2.0.0-beta.1)
107
+ -vv, --vnxt-version Show the installed vnxt version
108
+ -gv, --get-version Show the current project's version
109
+ -p, --push Push to remote with tags
95
110
  -dnp, --no-push Prevent auto-push (overrides config)
96
- --publish Push and trigger npm publish via GitHub Actions
97
- -c, --changelog Update CHANGELOG.md
98
- -d, --dry-run Show what would happen without making changes
99
- -a, --all [mode] Stage files before versioning (prompts if no mode)
100
- Modes: tracked, all, interactive (i), patch (p)
101
- -r, --release Generate release notes file
102
- -q, --quiet Minimal output (errors only)
103
- -h, --help Show help message
111
+ --publish Push and trigger npm publish via GitHub Actions (implies --push)
112
+ -c, --changelog Update CHANGELOG.md
113
+ -d, --dry-run Show what would happen without making changes
114
+ -a, --all [mode] Stage files before versioning (prompts if no mode)
115
+ Modes: tracked, all, interactive (i), patch (p)
116
+ -r, --release Generate release notes file (saved to release-notes/)
117
+ -q, --quiet Minimal output (errors only)
118
+ -h, --help Show help message
104
119
  ```
105
120
 
106
121
  ### Automatic Version Detection
@@ -112,7 +127,7 @@ vnxt automatically detects the version bump type from your commit message:
112
127
  - `patch:` → **patch** version bump
113
128
  - `feat:` or `feature:` → **minor** version bump
114
129
  - `fix:` → **patch** version bump
115
- - `BREAKING:` or contains `BREAKING` → **major** version bump
130
+ - `BREAKING` (anywhere in message) or `breaking:` → **major** version bump
116
131
 
117
132
  You can override this with the `-t` flag.
118
133
 
@@ -144,8 +159,8 @@ Set a specific version number (useful for pre-releases):
144
159
 
145
160
  **Bash/PowerShell:**
146
161
  ```bash
147
- vx -v 2.0.0-beta.1 -m "beta: initial release candidate"
148
- vx -v 1.5.0-rc.2 -m "release candidate 2"
162
+ vx -sv 2.0.0-beta.1 -m "beta: initial release candidate"
163
+ vx -sv 1.5.0-rc.2 -m "release candidate 2"
149
164
  ```
150
165
 
151
166
  ### Changelog Generation
@@ -177,19 +192,25 @@ Generate a formatted release notes file:
177
192
  vx -m "feat: major feature release" -r
178
193
  ```
179
194
 
180
- Creates `release-notes-v1.2.0.md`:
195
+ You'll be prompted to add optional context before the file is created. Release notes are saved to `release-notes/v1.2.0.md` (respects your `tagPrefix` config):
181
196
  ```markdown
182
197
  # Release v1.2.0
183
198
 
184
- Released: 2024-02-10
199
+ Released: 2024-02-10 at 14:32:00 UTC
200
+ Author: Your Name
185
201
 
186
202
  ## Changes
187
203
  feat: major feature release
188
204
 
189
205
  ## Installation
190
206
  npm install your-package@1.2.0
207
+
208
+ ## Full Changelog
209
+ See CHANGELOG.md for complete version history.
191
210
  ```
192
211
 
212
+ **Note:** `--publish` automatically generates release notes too, so `-r` is only needed for standalone bumps where you want the file without publishing.
213
+
193
214
  ### File Staging Options
194
215
 
195
216
  vnxt offers flexible file staging with the `-a` flag:
@@ -237,14 +258,28 @@ Display the installed vnxt version:
237
258
 
238
259
  **Bash/PowerShell:**
239
260
  ```bash
240
- vx -V
261
+ vx -vv
262
+ # or
263
+ vnxt --vnxt-version
264
+ ```
265
+
266
+ Output:
267
+ ```
268
+ vnxt v1.9.3
269
+ ```
270
+
271
+ Display the current project's version:
272
+
273
+ **Bash/PowerShell:**
274
+ ```bash
275
+ vx -gv
241
276
  # or
242
- vnxt --version
277
+ vnxt --get-version
243
278
  ```
244
279
 
245
280
  Output:
246
281
  ```
247
- vnxt v1.8.0
282
+ my-package v2.4.1
248
283
  ```
249
284
 
250
285
  ### npm Publish
@@ -257,10 +292,12 @@ vx -m "feat: new feature" --publish
257
292
  ```
258
293
 
259
294
  This will:
260
- 1. Bump the version and commit
261
- 2. Push with a standard `v*` tag
262
- 3. Push an additional `publish/v*` tag
263
- 4. GitHub Actions detects the `publish/v*` tag and publishes to npm automatically
295
+ 1. Prompt for optional release notes context
296
+ 2. Bump the version and commit
297
+ 3. Auto-generate a release notes file in `release-notes/`
298
+ 4. Push with a standard `v*` tag
299
+ 5. Push an additional `publish/v*` tag
300
+ 6. GitHub Actions detects the `publish/v*` tag and publishes to npm automatically
264
301
 
265
302
  This means you can batch up multiple changes without publishing to npm each time:
266
303
  ```bash
@@ -417,7 +454,7 @@ vx -m "feat: final feature" --publish
417
454
 
418
455
  **Bash/PowerShell:**
419
456
  ```bash
420
- vx -V
457
+ vx -vv
421
458
  ```
422
459
 
423
460
  ## <img src="./docs/logos/caret-38x38.png" width="24" align="center"> Troubleshooting
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vnxt",
3
- "version": "1.9.5",
3
+ "version": "1.14.0",
4
4
  "description": "Version incrementation CLI tool with built in git commit, push and changelog generation",
5
5
  "main": "vnxt.js",
6
6
  "bin": {
package/vnxt.js CHANGED
@@ -402,7 +402,7 @@ function generateChangelog(newVersion, message) {
402
402
  // Generate Release Notes
403
403
  // =============================================================================
404
404
 
405
- function generateReleaseNotes(newVersion, message, context, packageJson) {
405
+ function generateReleaseNotes(newVersion, message, context, packageJson, isPublish = false) {
406
406
  log('📋 Generating release notes...', 'cyan');
407
407
 
408
408
  const date = new Date();
@@ -412,12 +412,33 @@ function generateReleaseNotes(newVersion, message, context, packageJson) {
412
412
  let author = '';
413
413
  try { author = execSync('git config user.name', {stdio: 'pipe'}).toString().trim(); } catch {}
414
414
 
415
+ // If publishing, gather all commits since the last publish/v* tag
416
+ let changes = message;
417
+ if (isPublish) {
418
+ try {
419
+ const lastPublishTag = execSync(
420
+ 'git tag --list "publish/v*" --sort=-version:refname',
421
+ {stdio: 'pipe'}
422
+ ).toString().trim().split('\n').filter(Boolean)[0];
423
+
424
+ if (lastPublishTag) {
425
+ const commits = execSync(
426
+ `git log ${lastPublishTag}..HEAD --pretty=format:"- %s"`,
427
+ {stdio: 'pipe'}
428
+ ).toString().trim();
429
+ if (commits) changes = commits;
430
+ }
431
+ } catch {
432
+ // Fall back to current message if git log fails
433
+ }
434
+ }
435
+
415
436
  const notes = `# Release ${config.tagPrefix}${newVersion}
416
437
 
417
438
  Released: ${dateShort} at ${timestamp.split(' ')[1]}${author ? `\nAuthor: ${author}` : ''}
418
439
 
419
440
  ## Changes
420
- ${message}${context ? `\n\n## Release Notes\n${context}` : ''}
441
+ ${changes}${context ? `\n\n## Release Notes\n${context}` : ''}
421
442
 
422
443
  ## Installation
423
444
  \`\`\`bash
@@ -618,7 +639,7 @@ async function main() {
618
639
  const { oldVersion, newVersion, packageJson } = bumpVersion(opts);
619
640
 
620
641
  if (opts.generateChangelog) generateChangelog(newVersion, opts.message);
621
- if (opts.generateReleaseNotes) generateReleaseNotes(newVersion, opts.message, releaseNotesContext, packageJson);
642
+ if (opts.generateReleaseNotes) generateReleaseNotes(newVersion, opts.message, releaseNotesContext, packageJson, opts.publishToNpm);
622
643
  if (opts.push) pushToRemote(opts, newVersion);
623
644
 
624
645
  printSummary(opts, oldVersion, newVersion, branch);
@@ -629,4 +650,4 @@ async function main() {
629
650
  }
630
651
  }
631
652
 
632
- main();
653
+ main();