@metalagman/semverctl-linux-arm64 0.0.6 โ 0.0.7
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 +162 -0
- package/bin/semverctl +0 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# semverctl
|
|
2
|
+
|
|
3
|
+
[](https://goreportcard.com/report/github.com/metalagman/semverctl)
|
|
4
|
+
[](https://github.com/metalagman/semverctl/actions/workflows/lint.yml)
|
|
5
|
+
[](https://github.com/metalagman/semverctl/actions/workflows/test.yml)
|
|
6
|
+
[](https://codecov.io/github/metalagman/semverctl)
|
|
7
|
+
[](https://github.com/metalagman/semverctl/releases)
|
|
8
|
+
[](https://www.npmjs.com/package/@metalagman/semverctl)
|
|
9
|
+
[](https://pypi.org/project/semverctl/)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
|
|
12
|
+
CLI for bumping and setting SemVer values in JSON/YAML files
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- โจ **Semantic Versioning** - Strict SemVer 2.0.0 compliance with prerelease and build metadata support
|
|
17
|
+
- ๐ **Multiple Formats** - JSON and YAML file support
|
|
18
|
+
- ๐ฏ **Path Navigation** - Dot-notation paths for nested version fields (e.g., `.app.version`)
|
|
19
|
+
- ๐ข **Numeric Bumping** - Bump individual numeric fields for object-style versions
|
|
20
|
+
- ๐งช **Dry-Run Mode** - Preview changes with unified diff output
|
|
21
|
+
- ๐ **Cross-Platform** - Linux, macOS, and Windows support (CGO-free)
|
|
22
|
+
- โก **Zero Dependencies** - Pure Go implementation with no runtime dependencies
|
|
23
|
+
- ๐ฆ **Multiple Distribution Channels** - Go install, npm, uv/PyPI, and GitHub Releases
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
### Go
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
go install github.com/metalagman/semverctl/cmd/semverctl@latest
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### npm (Node.js)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx @metalagman/semverctl version
|
|
37
|
+
|
|
38
|
+
# Or install globally
|
|
39
|
+
npm install -g @metalagman/semverctl
|
|
40
|
+
semverctl version
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### uv/Pip (Python)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
uvx semverctl version
|
|
47
|
+
|
|
48
|
+
# Or install
|
|
49
|
+
uv pip install semverctl
|
|
50
|
+
semverctl version
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Pre-built Binaries
|
|
54
|
+
|
|
55
|
+
Download pre-built binaries from [GitHub Releases](https://github.com/metalagman/semverctl/releases):
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Linux/macOS
|
|
59
|
+
curl -L https://github.com/metalagman/semverctl/releases/latest/download/semverctl-linux-amd64 -o semverctl
|
|
60
|
+
chmod +x semverctl
|
|
61
|
+
sudo mv semverctl /usr/local/bin/
|
|
62
|
+
|
|
63
|
+
# Verify checksum (recommended)
|
|
64
|
+
curl -L https://github.com/metalagman/semverctl/releases/latest/download/checksums.txt -o checksums.txt
|
|
65
|
+
sha256sum -c checksums.txt
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
### Bump Version
|
|
71
|
+
|
|
72
|
+
Bump the semantic version at the specified path in JSON or YAML files:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Bump patch version (default)
|
|
76
|
+
semverctl bump package.json
|
|
77
|
+
|
|
78
|
+
# Bump specific version component
|
|
79
|
+
semverctl bump --minor package.json
|
|
80
|
+
semverctl bump --major package.json
|
|
81
|
+
semverctl bump --patch package.json
|
|
82
|
+
|
|
83
|
+
# Bump version at a custom path
|
|
84
|
+
semverctl bump --path .app.version config.yaml
|
|
85
|
+
|
|
86
|
+
# Bump all JSON files in a directory
|
|
87
|
+
semverctl bump --glob "**/*.json" .
|
|
88
|
+
|
|
89
|
+
# Preview changes without modifying files
|
|
90
|
+
semverctl bump --dry-run package.json
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Set Version
|
|
94
|
+
|
|
95
|
+
Set an explicit version value:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Set version to 1.2.3
|
|
99
|
+
semverctl set 1.2.3 package.json
|
|
100
|
+
|
|
101
|
+
# Set version at a custom path
|
|
102
|
+
semverctl set 2.0.0 --path .app.version config.yaml
|
|
103
|
+
|
|
104
|
+
# Preview changes
|
|
105
|
+
semverctl set 1.0.0 --dry-run package.json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Numeric Bump
|
|
109
|
+
|
|
110
|
+
For object-style version fields (e.g., `{ "Major": 1, "Minor": 2, "Patch": 3 }`),
|
|
111
|
+
you can bump numeric scalar values:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
semverctl bump --numeric --path .version.Patch config.json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
This increments the numeric value at the specified path by 1.
|
|
118
|
+
|
|
119
|
+
## Path Syntax
|
|
120
|
+
|
|
121
|
+
Paths use dot notation to navigate nested structures:
|
|
122
|
+
|
|
123
|
+
- `.version` - Top-level version field
|
|
124
|
+
- `.app.version` - Nested version field
|
|
125
|
+
- `.package.version` - Deeply nested field
|
|
126
|
+
|
|
127
|
+
The leading dot is optional: `version` and `.version` are equivalent.
|
|
128
|
+
|
|
129
|
+
## File Formats
|
|
130
|
+
|
|
131
|
+
Supported formats:
|
|
132
|
+
|
|
133
|
+
- **JSON** (`.json`)
|
|
134
|
+
- **YAML** (`.yaml`, `.yml`)
|
|
135
|
+
|
|
136
|
+
## Strict SemVer
|
|
137
|
+
|
|
138
|
+
semverctl follows the [Semantic Versioning 2.0.0](https://semver.org/) specification:
|
|
139
|
+
|
|
140
|
+
- Versions must be in format `MAJOR.MINOR.PATCH`
|
|
141
|
+
- Prerelease and build metadata are supported: `1.0.0-alpha+build.123`
|
|
142
|
+
- Leading zeros are not allowed in numeric components
|
|
143
|
+
- When bumping, prerelease and build metadata are cleared
|
|
144
|
+
|
|
145
|
+
## Dry-Run Mode
|
|
146
|
+
|
|
147
|
+
Use `--dry-run` to preview changes without modifying files:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
semverctl bump --dry-run package.json
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
This outputs a unified diff showing what would change.
|
|
154
|
+
|
|
155
|
+
## Exit Codes
|
|
156
|
+
|
|
157
|
+
- `0` - Success
|
|
158
|
+
- `1` - Error (invalid arguments, file not found, parse error, etc.)
|
|
159
|
+
|
|
160
|
+
## License
|
|
161
|
+
|
|
162
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
package/bin/semverctl
CHANGED
|
Binary file
|
package/package.json
CHANGED