Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kt3k/bmp
⤴️ Version up. No hassle.
https://github.com/kt3k/bmp
Last synced: 11 days ago
JSON representation
⤴️ Version up. No hassle.
- Host: GitHub
- URL: https://github.com/kt3k/bmp
- Owner: kt3k
- License: mit
- Created: 2021-05-25T15:50:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-21T04:18:42.000Z (3 months ago)
- Last Synced: 2024-10-04T16:16:58.397Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://deno.land/x/bmp
- Size: 86.9 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bmp v0.3.2
> Version up. No hassles.
`bmp` is a command line tool for updating the version number in source files.
# Motivation
It's common to have the version number of the library written in multiple places
in a repository, e.g. metadata files, documetation, source code, etc.If the version number of the library written more than 1 place, updating these
numbers in every release is boring, error prone chore. `bmp` helps that
situation with simple config file `.bmp.yml` which can track every occurence of
the version number in a repository and updates every occurence consistently.# Install
```sh
deno install --global --allow-env --allow-read=. --allow-write=. --allow-run=git -qf jsr:@kt3k/[email protected]
```This installs `bmp` command.
# Usage
Hit the below command to initialize the config file:
```sh
bmp -i # or bump --init
```This creates a config file like the below:
`.bmp.yml`
```yaml
version: 0.0.0
commit: "chore: bump version to %.%.%"
files:
README.md: v%.%.%
```- `version` is the current version of your repository. You need to set this to
the actuall current version number.
- `commit` is the commit message which is used when you perform the command
`bmp -c`, which commits the change, and cut the tag. This field is optional,
and you can delete this if you don't want to use committing feature.
- `files` contains the version number patterns in files. For example, if your
README.md file contains `my-library v1.2.3`, then you need to set this
property to `README.md: my-library v%.%.%`. (As you can see `%.%.%` part
represents the version number) `bmp` doesn't parse your files. So you can list
any files with any syntax.Then you need to modify this file to fit the existing state of your repository.
It might look something like the below, for example:```yaml
version: 0.4.3
commit: "chore: bump version to v%.%.%"
files:
README.md:
- v%.%.%
- my-lib@%.%.%
main.ts: 'const version = "%.%.%";'
```Then hit the command `bmp` (no options). This validates the occurencies of the
patterns in each file. If the config has any error, the command shows it. If the
config finds every pattern in every file, you'll see the output like the below:```
Current version: 0.4.3
Commit message: chore: bump to 0.4.3
Version patterns:
README.md: v0.0.2
README.md: [email protected]
main.ts: const version = "0.4.3";
```Now you are all set. You can bump the versoin by the commands `bmp -j` (major),
`bmp -m` (minor), `bmp -p` (patch). The tool also supports `preid` (like
`alpha.1` or `beta.2`). See `bmp -h` output for more details.# Example commands
## `bmp -i`
Creates .bmp.yml file with placeholders.
## `bmp`
Checks and validates the config file.
## `bmp -p`
Bump the patch version and updates every version occurrences based on .bmp.yml
config.`bmp -m` for minor version bump, `bmp -j` for major version bump.
## `bmp -c`
Commits the current change in the git repository with the commit message
specified in .bmp.yml config and cut the tag.## `bmp -pc`
Patch version up, commits the change, and cut the tag.
Also `bmp -mc` for minor, `bmp -jc` for major.
# LICENSE
MIT
# History
- 2023-02-08 v0.2.0 Allow glob as files key
[#2](https://github.com/kt3k/bmp/pull/2)This tool was ported from the ruby version: https://github.com/kt3k/ruby-bmp