Skip to content

Commit 9e8f71e

Browse files
authored
Prepare release (#89)
* Prepare release * cleanup
1 parent 993d475 commit 9e8f71e

15 files changed

Lines changed: 166 additions & 194 deletions

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.2.10] - 2026-02-12
8+
### Added
9+
- Version tag template configuration
10+
711
## [0.2.9] - 2025-11-30
812
### Fixed
913
- Added missing export: cli/channel.dart
@@ -128,6 +132,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
128132
### Added
129133
- Initial version
130134

135+
[0.2.10]: https://github.com/f3ath/cider/compare/0.2.9...0.2.10
131136
[0.2.9]: https://github.com/f3ath/cider/compare/0.2.8...0.2.9
132137
[0.2.8]: https://github.com/f3ath/cider/compare/0.2.7...0.2.8
133138
[0.2.7]: https://github.com/f3ath/cider/compare/0.2.6...0.2.7

README.md

Lines changed: 108 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,221 +1,198 @@
11
![logo]
22

3-
# Cider (CI for Dart. Efficient Release)
3+
# Cider (CI for Dart: Efficient Release)
44

5-
A command-line utility to automate package maintenance. Manipulates the changelog and pubspec.yaml.
5+
Cider is a CLI tool for Dart package maintenance. It updates `CHANGELOG.md` and `pubspec.yaml` to help automate releases.
66

7-
This tool assumes that the changelog:
7+
## Assumptions
88

9-
- is called `CHANGELOG.md`
10-
- is sitting in the project root folder
11-
- strictly follows the [Changelog] format
12-
- uses basic markdown (no HTML and complex formatting supported)
9+
Cider expects:
1310

14-
It also assumes that your project follows [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).
11+
- a `CHANGELOG.md` file in the project root
12+
- changelog format compatible with [Keep a Changelog][Changelog]
13+
- simple Markdown in changelog entries (no HTML or complex formatting)
14+
- project versions that follow [Semantic Versioning 2.0.0][semver]
1515

16-
## Install
16+
## Installation
1717

18-
```
19-
pub global activate cider
18+
```bash
19+
dart pub global activate cider
2020
```
2121

22-
## Configure
22+
## Configuration
2323

24-
Cider configuration is stored in `pubspec.yaml` under the key `cider`:
24+
Configure Cider in `pubspec.yaml` under `cider`:
2525

2626
```yaml
2727
cider:
2828
link_template:
29-
tag: https://github.com/example/project/releases/tag/%tag% # initial release link template
30-
diff: https://github.com/example/project/compare/%from%...%to% # subsequent releases link template
29+
tag: https://github.com/example/project/releases/tag/%tag%
30+
diff: https://github.com/example/project/compare/%from%...%to%
31+
version: v%version% # default: %version%
3132
```
3233
33-
The `%from%`, `%to%`, and `%tag%` placeholders will be replaced with the corresponding version tags.
34+
Placeholders:
3435
35-
### Project root
36+
- `%from%` - previous version tag
37+
- `%to%` - current version tag
38+
- `%tag%` - release tag
3639

37-
Cider may be run from the project root or from any directory within.
38-
In the latter case, it will try to detect the project root automatically
39-
by going up the filesystem tree until it finds a directory containing `pubspec.yaml`.
40+
## Project root detection
4041

41-
You can override this behavior by passing the `--project-root` argument:
42+
You can run Cider from any subdirectory. It searches upward for `pubspec.yaml`.
4243

43-
```
44-
cider --project-root=/path/to/my/project version
45-
```
44+
To override auto-detection:
4645

47-
## Changelog
46+
```bash
47+
cider --project-root=/path/to/project version
48+
```
4849

49-
These commands manipulate `CHANGELOG.md`.
50+
## Changelog commands
5051

51-
### Adding changes
52+
These commands modify `CHANGELOG.md` unless stated otherwise.
5253

53-
Adds a new line to the `Unreleased` section of the changelog
54+
### Add an entry
5455

55-
```
56+
```bash
5657
cider log <type> <description>
5758
```
5859

59-
- **type** is one of: `added`, `changed`, `deprecated`, `removed`, `fixed`, `security`
60-
- **description** is a markdown text line
60+
- `<type>`: `added`, `changed`, `deprecated`, `removed`, `fixed`, `security`
61+
- `<description>`: one Markdown line
6162

6263
Examples:
6364

64-
```
65-
cider log changed 'New turbo V6 engine installed'
66-
cider log added 'Support for rocket fuel and kerosene'
67-
cider log fixed 'Wheels falling off sporadically'
65+
```bash
66+
cider log changed 'Improve parser performance'
67+
cider log added 'Support workspace mode'
68+
cider log fixed 'Null pointer in changelog parser'
6869
```
6970

70-
### Releasing the unreleased changes
71+
### Release `Unreleased` entries
7172

72-
Takes all changes from the `Unreleased` section on the changelog and creates a new release under the current version in
73-
pubspec.yaml
74-
75-
```
73+
```bash
7674
cider release [options]
7775
```
7876

7977
Options:
8078

81-
- `--date` to provide the release date (the default is today).
79+
- `--date` - release date (default: today)
8280

83-
Cider will automatically generate the diff links in the changelog if the diff link template is found in the config.
81+
If `link_template.diff` is configured, Cider generates changelog diff links automatically.
8482

85-
### Printing the list of changes in the given version
83+
### Print changes for a version (read-only)
8684

87-
Prints the corresponding section from `CHANGELOG.md` in markdown format. This command is read-only.
88-
89-
```
85+
```bash
9086
cider describe [<version>] [options]
9187
```
9288

93-
- **version** is an existing version from the changelog. If not specified, the `Unreleased` section will
94-
be used.
89+
- `<version>` defaults to `Unreleased` if omitted
9590

9691
Options:
9792

98-
- `--only-body` will skip the header and the link part of the changelog section.
93+
- `--only-body` - omit section header and link footer
9994

100-
### Listing all versions in the changelog
95+
### List versions
10196

102-
Prints all versions from the changelog, highest to lowest.
103-
104-
```
97+
```bash
10598
cider list [options]
10699
```
107100

108101
Options:
109102

110-
- `--include-yanked` or `-y` - includes yanked versions.
111-
- `--include-unreleased` or `-u` - prints "Unreleased" in the top of the version list if there are unreleased changes.
103+
- `--include-yanked`, `-y`
104+
- `--include-unreleased`, `-u`
112105

113-
## Version
106+
## Version commands
114107

115-
These commands affect the `version` line in `pubspec.yaml`. If applied successfully, Cider will print the resulting
116-
version.
108+
These commands operate on `version` in `pubspec.yaml`.
117109

118-
### Printing the current project version
110+
### Print current version (read-only)
119111

120-
Prints the current version from `pubspec.yaml`. This command is read-only.
121-
122-
```
112+
```bash
123113
cider version
124114
```
125115

126-
### Setting version to an arbitrary value
116+
### Set version
127117

128-
Sets the version in `pubspec.yaml` to the one provided. The new version must be [semver]-compatible.
129-
130-
```
118+
```bash
131119
cider version <new_version>
132120
```
133121

134-
- **new_version** new value, must be [semver]-compatible
122+
`<new_version>` must be [SemVer][semver]-compatible.
135123

136124
Examples:
137125

138-
| Version before | Command | Version after |
139-
|----------------|--------------------------------|----------------|
140-
| 1.2.3+1 | `cider version 3.2.1` | 3.2.1 |
141-
| 0.2.1-dev | `cider version 0.0.1-alpha+42` | 0.0.1-alpha+42 |
126+
| Before | Command | After |
127+
|----------|-----------------------------------|----------------|
128+
| 1.2.3+1 | `cider version 3.2.1` | 3.2.1 |
129+
| 0.2.1-dev| `cider version 0.0.1-alpha+42` | 0.0.1-alpha+42 |
142130

143-
### Yanking/unyanking a version
131+
### Yank / unyank a release in changelog
144132

145-
The [Changelog] defines yanked releases as version that are pulled (withdrawn) due to a serious bug or security issue.
146-
According to the [Changelog], a yanked release should be marked with a `[YANKED]` tag in the changelog file.
147-
148-
To mark a version as yanked, run the following command:
149-
150-
```
133+
```bash
151134
cider yank <version>
152-
```
153-
154-
To unyank a version, run the following command:
155-
156-
```
157135
cider unyank <version>
158136
```
159137

160-
### Bumping the project version
138+
Yanked versions are marked as `[YANKED]` in `CHANGELOG.md`.
161139

162-
Bumps the corresponding part of the project version according to [semver].
140+
### Bump version
163141

164-
```
142+
```bash
165143
cider bump <part> [options]
166144
```
167145

168-
- **part** can be any of the following:
169-
- `breaking` (means `y` for `0.y.z` and `x` for `x.y.z`)
170-
- `major`
171-
- `minor`
172-
- `patch`
173-
- `build`
174-
- `pre` (pre-release)
175-
- `release` (promotes the version to a release, removing the pre-release part)
146+
`<part>` can be:
147+
148+
- `breaking` (`y` for `0.y.z`, otherwise `x` for `x.y.z`)
149+
- `major`
150+
- `minor`
151+
- `patch`
152+
- `build`
153+
- `pre` (pre-release)
154+
- `release` (remove pre-release suffix)
176155

177156
Options:
178157

179-
- `--keep-build` will retain the existing build part.
180-
- `--bump-build` will increment the build part (see below).
181-
- `--build=<value>` will set the build part to the given value. This is useful when build is a not a simple numeric
182-
value, e.g. a timestamp.
183-
- `--pre=<prefix>` sets the prerelease prefix.
184-
185-
When bumping the `prerelease` or `build` parts, Cider will look for the rightmost dot-separated identifier. If the
186-
identifier is an integer, it will be incremented stripping the leading zeroes. Otherwise, Cider will append `.1` to the
187-
corresponding part.
188-
189-
Remember that according to [semver] v2, `build` is considered metadata and is ignored when determining version
190-
precedence.
191-
192-
| Version before | Command | Version after |
193-
|----------------|---------------------------------------------|------------------|
194-
| 1.2.1-alpha+42 | `cider bump breaking` | 2.0.0 |
195-
| 0.2.1-alpha+42 | `cider bump breaking` | 0.3.0 |
196-
| 0.2.1-alpha+42 | `cider bump major` | 1.0.0 |
197-
| 0.2.1-alpha+42 | `cider bump minor` | 0.3.0 |
198-
| 0.2.1-alpha+42 | `cider bump patch` | 0.2.1 |
199-
| 0.2.1 | `cider bump patch` | 0.2.2 |
200-
| 0.2.1-alpha+42 | `cider bump pre` | 0.2.1-alpha.1 |
201-
| 1.2.1-alpha+42 | `cider bump breaking --keep-build` | 2.0.0+42 |
202-
| 0.2.1-alpha+42 | `cider bump breaking --bump-build` | 0.3.0+43 |
203-
| 0.2.1-alpha+42 | `cider bump major --build=2020-02-02` | 1.0.0+2020-02-02 |
204-
| 0.2.1-alpha+42 | `cider bump minor --pre=alpha --bump-build` | 0.3.0-alpha+43 |
205-
| 0.2.1-alpha+42 | `cider bump release` | 0.2.1 |
206-
| 0.2.1-alpha+42 | `cider bump release --keep-build` | 0.2.1+42 |
158+
- `--keep-build` - keep existing build metadata
159+
- `--bump-build` - increment build metadata
160+
- `--build=<value>` - set build metadata explicitly
161+
- `--pre=<prefix>` - set pre-release prefix
162+
163+
Notes:
164+
165+
- For `pre` and `build`, Cider increments the rightmost dot-separated numeric identifier.
166+
- If no numeric identifier exists, Cider appends `.1`.
167+
- Per SemVer, build metadata does not affect version precedence.
168+
169+
Examples:
170+
171+
| Before | Command | After |
172+
|------------------|---------------------------------------------|------------------|
173+
| 1.2.1-alpha+42 | `cider bump breaking` | 2.0.0 |
174+
| 0.2.1-alpha+42 | `cider bump breaking` | 0.3.0 |
175+
| 0.2.1-alpha+42 | `cider bump major` | 1.0.0 |
176+
| 0.2.1-alpha+42 | `cider bump minor` | 0.3.0 |
177+
| 0.2.1-alpha+42 | `cider bump patch` | 0.2.1 |
178+
| 0.2.1 | `cider bump patch` | 0.2.2 |
179+
| 0.2.1-alpha+42 | `cider bump pre` | 0.2.1-alpha.1 |
180+
| 1.2.1-alpha+42 | `cider bump breaking --keep-build` | 2.0.0+42 |
181+
| 0.2.1-alpha+42 | `cider bump breaking --bump-build` | 0.3.0+43 |
182+
| 0.2.1-alpha+42 | `cider bump major --build=2020-02-02` | 1.0.0+2020-02-02 |
183+
| 0.2.1-alpha+42 | `cider bump minor --pre=alpha --bump-build` | 0.3.0-alpha+43 |
184+
| 0.2.1-alpha+42 | `cider bump release` | 0.2.1 |
185+
| 0.2.1-alpha+42 | `cider bump release --keep-build` | 0.2.1+42 |
207186

208187
## Exit codes
209188

210-
| Code | Meaning |
211-
|------|-------------------------------------------------------------------|
212-
| 0 | Successful exit. |
213-
| 64 | Usage error, e.g. invalid arguments. |
214-
| 65 | Data error, e.g. missing or invalid project files. |
215-
| 70 | Software error. If you see this, you might want to open an issue. |
189+
| Code | Meaning |
190+
|------|---------|
191+
| 0 | Success |
192+
| 64 | Usage error (invalid arguments) |
193+
| 65 | Data error (missing/invalid project files) |
194+
| 70 | Internal software error (consider opening an issue) |
216195

217196
[logo]: https://raw.githubusercontent.com/f3ath/cider/master/cider.png
218-
219197
[semver]: https://semver.org
220-
221-
[Changelog]: https://keepachangelog.com/en/1.1.0/
198+
[Changelog]: https://keepachangelog.com/en/1.1.0/

lib/cider.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
library;
22

3-
export 'package:cider/src/project.dart';
43
export 'package:cider/src/cli/channel.dart';
54
export 'package:cider/src/cli/cider_cli.dart';
65
export 'package:cider/src/cli/console.dart';
6+
export 'package:cider/src/project.dart';

lib/src/cli/command/bump_command.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:args/command_runner.dart';
2-
import 'package:cider/src/project.dart';
32
import 'package:cider/src/cli/command/bump_sub_command.dart';
43
import 'package:cider/src/cli/command/cider_command.dart';
4+
import 'package:cider/src/project.dart';
55
import 'package:version_manipulation/mutations.dart';
66

77
class BumpCommand extends CiderCommand {

lib/src/cli/command/bump_sub_command.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import 'package:cider/src/cli/command/cider_command.dart';
12
import 'package:cider/src/cli/console.dart';
23
import 'package:cider/src/project.dart';
3-
import 'package:cider/src/cli/command/cider_command.dart';
44
import 'package:version_manipulation/mutations.dart';
55

66
class BumpSubCommand extends CiderCommand {

0 commit comments

Comments
 (0)