vnxt 1.8.0 → 1.9.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 +53 -2
  2. package/package.json +1 -1
  3. package/vnxt.js +31 -3
package/README.md CHANGED
@@ -10,7 +10,7 @@ A lightweight CLI tool for automated version bumping with changelog generation a
10
10
 
11
11
  - šŸš€ Automatic semantic version detection from commit messages
12
12
  - šŸ“ Automatic CHANGELOG.md generation
13
- - šŸ·ļø Git tag annotation
13
+ - šŸ·ļø Git tag annotation with configurable prefix
14
14
  - šŸ” Pre-flight checks for clean working directory
15
15
  - šŸ”¬ Dry-run mode to preview changes
16
16
  - šŸ“‹ Release notes generation
@@ -18,6 +18,7 @@ A lightweight CLI tool for automated version bumping with changelog generation a
18
18
  - šŸ’¬ Interactive mode when no arguments provided
19
19
  - šŸŽØ Colored terminal output for better readability
20
20
  - 🤫 Quiet mode for CI/CD environments
21
+ - šŸ“¦ Automated npm publishing via GitHub Actions Trusted Publishing
21
22
 
22
23
  ## <img src="./docs/logos/caret-38x38.png" width="24" align="center"> Installation
23
24
 
@@ -92,6 +93,7 @@ All options work with both `vnxt` and `vx`:
92
93
  -V, --version Show vnxt version
93
94
  -p, --push Push to remote with tags
94
95
  -dnp, --no-push Prevent auto-push (overrides config)
96
+ --publish Push and trigger npm publish via GitHub Actions
95
97
  -c, --changelog Update CHANGELOG.md
96
98
  -d, --dry-run Show what would happen without making changes
97
99
  -a, --all [mode] Stage files before versioning (prompts if no mode)
@@ -242,9 +244,48 @@ vnxt --version
242
244
 
243
245
  Output:
244
246
  ```
245
- vnxt v1.7.0
247
+ vnxt v1.8.0
246
248
  ```
247
249
 
250
+ ### npm Publish
251
+
252
+ Trigger an automated npm publish via GitHub Actions using Trusted Publishing (OIDC):
253
+
254
+ **Bash/PowerShell:**
255
+ ```bash
256
+ vx -m "feat: new feature" --publish
257
+ ```
258
+
259
+ 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
264
+
265
+ This means you can batch up multiple changes without publishing to npm each time:
266
+ ```bash
267
+ vx -m "feat: add something" # bump only
268
+ vx -m "fix: fix something" # bump only
269
+ vx -m "feat: final thing" --publish # bump + publish everything
270
+ ```
271
+
272
+ **Note:** `--publish` implies `--push`, so `-p` is not required.
273
+
274
+ ### Custom Tag Prefix
275
+
276
+ Control the prefix used for git tags via `.vnxtrc.json`:
277
+
278
+ ```json
279
+ {
280
+ "tagPrefix": "v"
281
+ }
282
+ ```
283
+
284
+ **Options:**
285
+ - `"v"` → `v1.8.0` (default)
286
+ - `""` → `1.8.0` (no prefix)
287
+ - `"release-"` → `release-1.8.0` (useful in monorepos)
288
+
248
289
  ### Complete Workflow Example
249
290
 
250
291
  **Bash/PowerShell:**
@@ -362,6 +403,16 @@ vx -m "chore: refactor code" -a
362
403
  vx -m "chore: automated update" -q
363
404
  ```
364
405
 
406
+ ### Publish to npm
407
+
408
+ **Bash/PowerShell:**
409
+ ```bash
410
+ # Batch changes then publish when ready
411
+ vx -m "feat: add feature one"
412
+ vx -m "fix: fix something"
413
+ vx -m "feat: final feature" --publish
414
+ ```
415
+
365
416
  ### Check Installed Version
366
417
 
367
418
  **Bash/PowerShell:**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vnxt",
3
- "version": "1.8.0",
3
+ "version": "1.9.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
@@ -97,8 +97,8 @@ let type = getFlag('--type', '-t') || config.defaultType;
97
97
  let customVersion = getFlag('--version', '-v');
98
98
  let dryRun = hasFlag('--dry-run', '-d');
99
99
  let noPush = hasFlag('--no-push', '-dnp');
100
- let push = noPush ? false : (hasFlag('--push', '-p') || config.autoPush);
101
100
  let publishToNpm = hasFlag('--publish');
101
+ let push = noPush ? false : (hasFlag('--push', '-p') || publishToNpm || config.autoPush);
102
102
  let generateChangelog = hasFlag('--changelog', '-c') || config.autoChangelog;
103
103
  const addAllFlag = getFlag('--all', '-a');
104
104
  let addMode = null;
@@ -197,6 +197,22 @@ async function main() {
197
197
  process.exit(1);
198
198
  }
199
199
 
200
+ // AUTO-REQUIRE RELEASE NOTES for --publish
201
+ let releaseNotesContext = '';
202
+ const requireReleaseNotes = !generateReleaseNotes && publishToNpm;
203
+ if (requireReleaseNotes) {
204
+ generateReleaseNotes = true;
205
+ if (!quietMode) {
206
+ log(`\nšŸ“‹ Release notes required for --publish.`, 'yellow');
207
+ releaseNotesContext = await prompt(' Add context (press Enter to skip): ');
208
+ if (releaseNotesContext) log('');
209
+ }
210
+ } else if (generateReleaseNotes && !quietMode) {
211
+ // -r flag was passed explicitly - still offer context prompt
212
+ releaseNotesContext = await prompt('\nšŸ“‹ Add context to release notes (press Enter to skip): ');
213
+ if (releaseNotesContext) log('');
214
+ }
215
+
200
216
  // PRE-FLIGHT CHECKS
201
217
  log('\nšŸ” Running pre-flight checks...\n', 'cyan');
202
218
 
@@ -365,12 +381,24 @@ async function main() {
365
381
  // GENERATE RELEASE NOTES
366
382
  if (generateReleaseNotes) {
367
383
  log('šŸ“‹ Generating release notes...', 'cyan');
384
+
385
+ const date = new Date();
386
+ const timestamp = date.toISOString().replace('T', ' ').split('.')[0] + ' UTC';
387
+ const dateShort = date.toISOString().split('T')[0];
388
+
389
+ let author = '';
390
+ try {
391
+ author = execSync('git config user.name', {stdio: 'pipe'}).toString().trim();
392
+ } catch {
393
+ author = '';
394
+ }
395
+
368
396
  const releaseNotes = `# Release ${config.tagPrefix}${newVersion}
369
397
 
370
- Released: ${new Date().toISOString().split('T')[0]}
398
+ Released: ${dateShort} at ${timestamp.split(' ')[1]}${author ? `\nAuthor: ${author}` : ''}
371
399
 
372
400
  ## Changes
373
- ${message}
401
+ ${message}${releaseNotesContext ? `\n\n## Release Notes\n${releaseNotesContext}` : ''}
374
402
 
375
403
  ## Installation
376
404
  \`\`\`bash