package-versioner 0.0.1

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/LICENCE.md ADDED
@@ -0,0 +1,7 @@
1
+ MIT License
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of the Turbo-version and Turbo-release software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # package-versioner
2
+
3
+ A powerful CLI tool for automated semantic versioning based on Git history and conventional commits. Simplifies version management in JavaScript/TypeScript projects.
4
+
5
+ ## Features
6
+
7
+ - Automatically determines version bumps based on commit history (using conventional commits)
8
+ - Primarily designed for single package projects, but configurable
9
+ - Flexible versioning strategies (e.g., based on commit types, branch patterns)
10
+ - Integrates with conventional commits presets
11
+ - Customizable through a `version.config.json` file or CLI options
12
+ - Automatically updates `package.json` version
13
+ - Creates and pushes appropriate Git tags for releases
14
+
15
+ ## Usage
16
+
17
+ `package-versioner` is designed to be run directly using your preferred package manager's execution command, without needing global installation.
18
+
19
+ ```bash
20
+ # Determine bump based on conventional commits since last tag
21
+ npx package-versioner
22
+
23
+ # Using pnpm
24
+ pnpm dlx package-versioner
25
+
26
+ # Using yarn
27
+ yarn dlx package-versioner
28
+
29
+ # Specify a bump type explicitly
30
+ npx package-versioner --bump minor
31
+
32
+ # Create a prerelease (e.g., alpha)
33
+ npx package-versioner --bump patch --prerelease alpha
34
+
35
+ # Perform a dry run: calculates version, logs actions, but makes no file changes or Git commits/tags
36
+ npx package-versioner --dry-run
37
+ ```
38
+
39
+
40
+
41
+ ## Configuration
42
+
43
+ Customize behavior by creating a `version.config.json` file in your project root:
44
+
45
+ ```json
46
+ {
47
+ "preset": "conventional-commits", // Preset for conventional-commits analysis
48
+ "tagPrefix": "v", // Prefix for Git tags (e.g., v1.0.0)
49
+ "commitMessage": "chore(release): v${version}", // Template for the release commit (defaults to this if omitted)
50
+ "versionStrategy": "commitMessage", // Use conventional commit messages (default) or "branchPattern"
51
+ "baseBranch": "main", // Base branch for calculations
52
+ "branchPattern": [ // Used if versionStrategy is branchPattern
53
+ "feature:minor",
54
+ "fix:patch"
55
+ ],
56
+ "prereleaseIdentifier": null, // Default prerelease identifier (e.g., "beta")
57
+ "skipHooks": false, // Skip git commit hooks (--no-verify)
58
+ "synced": true, // (Monorepo-specific) Treat as a single synchronized unit
59
+ "packages": [], // (Monorepo-specific) Specify packages (not typical for single repo)
60
+ "updateInternalDependencies": "no-internal-update" // (Monorepo-specific) How to handle workspace deps
61
+ }
62
+ ```
63
+
64
+ **Note:** Options like `synced`, `packages`, and `updateInternalDependencies` enable monorepo-specific behaviours.
65
+
66
+ ## How Versioning Works
67
+
68
+ `package-versioner` determines the next version based on your configuration (`version.config.json`). The two main approaches are:
69
+
70
+ 1. **Conventional Commits:** Analyzes commit messages (like `feat:`, `fix:`, `BREAKING CHANGE:`) since the last tag.
71
+ 2. **Branch Pattern:** Determines the bump based on the current or recently merged branch name matching predefined patterns.
72
+
73
+ For a detailed explanation of these concepts and monorepo modes (Synced vs. Async), see [Versioning Strategies and Concepts](./docs/VERSIONING_STRATEGIES.md).
74
+
75
+ ## Documentation
76
+
77
+ For more details on available CLI options, run:
78
+
79
+ ```bash
80
+ npx package-versioner --help
81
+ ```
82
+
83
+ ## Acknowledgements
84
+
85
+ This project was originally forked from and inspired by `jucian0/turbo-version` ([https://github.com/jucian0/turbo-version](https://github.com/jucian0/turbo-version)). We appreciate the foundational work done by the original authors.
86
+
87
+ ## License
88
+
89
+ MIT