package-versioner 0.2.0 → 0.3.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 CHANGED
@@ -6,17 +6,18 @@
6
6
  <a href="https://www.npmjs.com/package/package-versioner" alt="NPM Downloads">
7
7
  <img src="https://img.shields.io/npm/dw/package-versioner" /></a>
8
8
 
9
- A powerful CLI tool for automated semantic versioning based on Git history and conventional commits. Simplifies version management in JavaScript/TypeScript projects.
9
+ A lightweight yet powerful CLI tool for automated semantic versioning based on Git history and conventional commits. Supports both single package projects and monorepos with flexible versioning strategies.
10
10
 
11
11
  ## Features
12
12
 
13
13
  - Automatically determines version bumps based on commit history (using conventional commits)
14
- - Primarily designed for single package projects, but configurable
14
+ - Supports both single package projects and monorepos with minimal configuration
15
15
  - Flexible versioning strategies (e.g., based on commit types, branch patterns)
16
16
  - Integrates with conventional commits presets
17
17
  - Customizable through a `version.config.json` file or CLI options
18
18
  - Automatically updates `package.json` version
19
- - Creates and pushes appropriate Git tags for releases
19
+ - Creates appropriate Git tags for releases
20
+ - CI/CD friendly with JSON output support
20
21
 
21
22
  ## Usage
22
23
 
@@ -43,10 +44,39 @@ npx package-versioner -t @scope/package-a,@scope/package-b
43
44
 
44
45
  # Perform a dry run: calculates version, logs actions, but makes no file changes or Git commits/tags
45
46
  npx package-versioner --dry-run
47
+
48
+ # Output results as JSON (useful for CI/CD scripts)
49
+ npx package-versioner --json
50
+
51
+ # Combine with dry-run for CI planning
52
+ npx package-versioner --dry-run --json
46
53
  ```
47
54
 
48
55
  **Note on Targeting:** Using the `-t` flag creates package-specific tags (e.g., `@scope/package-a@1.2.0`) but *not* a global tag (like `v1.2.0`). If needed, create the global tag manually in your CI/CD script after this command.
49
56
 
57
+ ## JSON Output
58
+
59
+ When using the `--json` flag, normal console output is suppressed and the tool outputs a structured JSON object that includes information about the versioning operation.
60
+
61
+ ```json
62
+ {
63
+ "dryRun": true,
64
+ "updates": [
65
+ {
66
+ "packageName": "@scope/package-a",
67
+ "newVersion": "1.2.3",
68
+ "filePath": "/path/to/package.json"
69
+ }
70
+ ],
71
+ "commitMessage": "chore(release): v1.2.3",
72
+ "tags": [
73
+ "@scope/package-a@v1.2.3"
74
+ ]
75
+ }
76
+ ```
77
+
78
+ For detailed examples of how to use this in CI/CD pipelines, see [CI/CD Integration](./docs/CI_CD_INTEGRATION.md).
79
+
50
80
  ## Configuration
51
81
 
52
82
  Customize behavior by creating a `version.config.json` file in your project root:
@@ -83,6 +113,9 @@ For a detailed explanation of these concepts and monorepo modes (Synced vs. Asyn
83
113
 
84
114
  ## Documentation
85
115
 
116
+ - [Versioning Strategies and Concepts](./docs/VERSIONING_STRATEGIES.md) - Detailed explanation of versioning approaches
117
+ - [CI/CD Integration](./docs/CI_CD_INTEGRATION.md) - Guide for integrating with CI/CD pipelines
118
+
86
119
  For more details on available CLI options, run:
87
120
 
88
121
  ```bash