Skip to content

Commit 57f0e74

Browse files
authored
Update minor info (#19)
1 parent 73ae228 commit 57f0e74

File tree

2 files changed

+48
-23
lines changed

2 files changed

+48
-23
lines changed

README.md

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<p>
1414
<strong>Static linked CLI wrapper for <a href="https://packagist.org/packages/composer/semver"><code>composer/semver</code></a>.</strong>
1515
<br>
16-
Parsing and validating versions exactly like <a href="https://getcomposer.org/"><code>Composer</code></a> does <strong>without installing PHP</strong>.
16+
Parsing and validating versions exactly like Composer does <strong>without installing PHP</strong>.
1717
<br>
1818
<br>
1919
Built with ♥ by <a href="https://typist.tech/">Typist Tech</a>
@@ -28,7 +28,9 @@
2828
### Normalize Versions
2929

3030
Normalizes a version string to be able to perform comparisons on it.
31-
This is a wrapper of the [`Composer\Semver\VersionParser::normalize()`](https://github.com/composer/semver/blob/b52829022cb18210bb84e44e457bd4e890f8d2a7/src/VersionParser.php#L98-L108) method.
31+
This is a wrapper of the [
32+
`Composer\Semver\VersionParser::normalize()`](https://github.com/composer/semver/blob/b52829022cb18210bb84e44e457bd4e890f8d2a7/src/VersionParser.php#L98-L108)
33+
method.
3234

3335
```console
3436
$ composer-semver normalize '1.2-p.5+foo'
@@ -73,7 +75,9 @@ Help:
7375
### Parse Constraints
7476

7577
Parses a constraint string and strip its ignorable parts.
76-
This is a wrapper of the [`Composer\Semver\VersionParser::parseConstraints()`](github.com/composer/semver/blob/b52829022cb18210bb84e44e457bd4e890f8d2a7/src/VersionParser.php#L251-L258) method.
78+
This is a wrapper of the [
79+
`Composer\Semver\VersionParser::parseConstraints()`](github.com/composer/semver/blob/b52829022cb18210bb84e44e457bd4e890f8d2a7/src/VersionParser.php#L251-L258)
80+
method.
7781

7882
```console
7983
$ composer-semver parse '>=1.2 <2.0 || ~3.4.5 || ^6.7'
@@ -121,6 +125,17 @@ Help:
121125
$ composer-semver --version
122126
```
123127

128+
### Dump Shell Completion Scripts
129+
130+
For shell completions, follow the instructions from:
131+
132+
```console
133+
$ composer-semver completion --help
134+
```
135+
136+
If you installed `Composer SemVer` [via Homebrew](#homebrew-macos--linux-recommended), completion scripts are managed by
137+
Homebrew. Read more at https://docs.brew.sh/Shell-Completion
138+
124139
---
125140

126141
> [!TIP]
@@ -136,12 +151,21 @@ $ composer-semver --version
136151

137152
## Why
138153

139-
Under the hood, [Composer](https://getcomposer.org/) uses [
140-
`composer/semver`](https://packagist.org/packages/composer/semver) package to parse and validate versions.
141-
Despite the name `composer/semver` and
142-
the [incompleted documentation](https://getcomposer.org/doc/articles/versions.md), Composer implements only a subset
143-
of [Semantic Versioning](https://semver.org/) specification while supports some uncommon versioning schemes.
144-
Working with Composer packages versions without `composer/semver` is a bit tricky.
154+
> Which version numbering system does Composer itself use?
155+
>
156+
> Composer uses Semantic Versioning (aka SemVer) 2.0.0.
157+
>
158+
> -- [Composer FAQ](https://getcomposer.org/doc/faqs/which-version-numbering-system-does-composer-itself-use.md)
159+
160+
Under the hood, Composer uses [`composer/semver`](https://packagist.org/packages/composer/semver) to parse and validate
161+
versions.
162+
163+
Despite the lie
164+
on [Composer FAQ](https://getcomposer.org/doc/faqs/which-version-numbering-system-does-composer-itself-use.md),
165+
the [fragmentary documentation](https://getcomposer.org/doc/articles/versions.md), and the deceitful package name
166+
`composer/semver`, Composer implements only a subset of [Semantic Versioning](https://semver.org/) specification while
167+
supports some uncommon versioning schemes. Working with Composer packages versions without `composer/semver` is a bit
168+
tricky.
145169

146170
*"A bit tricky"* is an understatement.
147171

@@ -196,64 +220,64 @@ curl -1sLf 'https://dl.cloudsmith.io/public/typisttech/oss/setup.deb.sh' | sudo
196220
sudo apt-get install composer-version
197221
```
198222

199-
Instead of the automatic setup script, you can manually configure the repository with the instructsions on [Cloudsmith](https://cloudsmith.io/~typisttech/repos/oss/setup/#formats-deb).
223+
Instead of the automatic setup script, you can manually configure the repository with the instructsions
224+
on [Cloudsmith](https://cloudsmith.io/~typisttech/repos/oss/setup/#formats-deb).
200225

201226
### Manual `.deb` (Debian based distributions, for example: Ubuntu)
202227

203228
> [!WARNING]
204229
> If you install the `.deb` file manually, you have to take care of updating it by yourself.
205230
206-
Download the latest `.deb` file from [GitHub Releases](https://github.com/typisttech/composer-semver/releases/latest), or via [`gh`](https://cli.github.com/):
231+
Download the latest `.deb` file from [GitHub Releases](https://github.com/typisttech/composer-semver/releases/latest),
232+
or via [`gh`](https://cli.github.com/):
233+
207234
```sh
208235
# Both arm64 (aarch64) and amd64 (x86_64) architectures are available.
209236
gh release download --repo 'typisttech/composer-semver' --pattern 'composer-semver_Linux_arm64.deb'
210237
```
211238

212239
**Optionally**, verify the `.deb` file:
240+
213241
```sh
214242
gh attestation verify --repo 'typisttech/composer-semver' 'composer-semver_Linux_arm64.deb'
215243
```
216244

217245
Finally, install the package:
218-
```sh
219-
sudo dpkg -i composer-semver_Linux_arm64.deb
220-
```
221246

222-
For shell completions, follow the instructions from:
223247
```sh
224-
composer-semver completion --help
248+
sudo dpkg -i composer-semver_Linux_arm64.deb
225249
```
226250

227251
## Manual Binary
228252

229253
> [!WARNING]
230254
> If you install the binary manually, you have to take care of updating it by yourself.
231255
232-
Download the latest `.tar.gz` file from [GitHub Releases](https://github.com/typisttech/composer-semver/releases/latest), or via [`gh`](https://cli.github.com/):
256+
Download the latest `.tar.gz` file
257+
from [GitHub Releases](https://github.com/typisttech/composer-semver/releases/latest), or via [
258+
`gh`](https://cli.github.com/):
259+
233260
```sh
234261
# Both Darwin (macOS) and Linux operating systems are available.
235262
# Both arm64 (aarch64) and amd64 (x86_64) architectures are available.
236263
gh release download --repo 'typisttech/composer-semver' --pattern 'composer-semver_Darwin_arm64.tar.gz'
237264
```
238265

239266
**Optionally**, verify the `.tar.gz` file:
267+
240268
```sh
241269
gh attestation verify --repo 'typisttech/composer-semver' 'composer-semver_Darwin_arm64.tar.gz'
242270
```
243271

244272
Finally, unarchive and move the binary into `$PATH`:
273+
245274
```sh
246275
tar -xvf 'composer-semver_Darwin_arm64.tar.gz'
247276

248277
# Or, move it to any directory under `$PATH`
249278
mv composer-semver /usr/local/bin
250279
```
251280

252-
For shell completions, follow the instructions from:
253-
```sh
254-
composer-semver completion --help
255-
```
256-
257281
## Alternatives
258282

259283
- [ComVer](https://github.com/typisttech/comver)

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"homepage": "https://github.com/typisttech/composer-semver",
2727
"support": {
2828
"issues": "https://github.com/typisttech/composer-semver/issues",
29-
"source": "https://github.com/typisttech/composer-semver"
29+
"source": "https://github.com/typisttech/composer-semver",
30+
"security": "https://github.com/typisttech/composer-semver/security"
3031
},
3132
"require": {
3233
"php": "~8.4.13",

0 commit comments

Comments
 (0)