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.
- package/README.md +53 -2
- package/package.json +1 -1
- 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.
|
|
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
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: ${
|
|
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
|