Tools for Dart package maintainers

Overview

logo

Cider (CI for Dart. Efficient Release)

A command-line utility to automate package maintenance. Manipulates the changelog and pubspec.yaml.

This tool assumes that the changelog:

  • is called CHANGELOG.md
  • is sitting in the project root folder
  • strictly follows the Keep a Changelog v1.0.0 format
  • uses basic markdown (no HTML and complex formatting supported)

It also assumes that your project follows Semantic Versioning v2.0.0.

Install

pub global activate cider

Configure

Cider configuration is stored in pubspec.yaml under the key cider:

cider:
  link_template:
    tag: https://github.com/example/project/releases/tag/%tag% # initial release link template
    diff: https://github.com/example/project/compare/%from%...%to% # subsequent releases link template

The %from%, %to%, and %tag% placeholders will be replaced with the corresponding version tags.

Changelog

These commands manipulate CHANGELOG.md.

Adding changes

Adds a new line to the Unreleased section of the changelog

cider log <type> <description>
  • type is one of: added, changed, deprecated, removed, fixed, security
  • description is a markdown text line

Examples:

cider log changed 'New turbo V6 engine installed'
cider log added 'Support for rocket fuel and kerosene'
cider log fixed 'Wheels falling off sporadically'

Releasing the unreleased changes

Takes all changes from the Unreleased section on the changelog and creates a new release under the current version in pubspec.yaml

cider release [options]

Options:

  • --date to provide the release date (the default is today).

Cider will automatically generate the diff links in the changelog if the diff link template is found in the config.

Printing the list of changes in the given version

Prints the corresponding section from CHANGELOG.md in markdown format. This command is read-only.

cider describe [<version>]
  • version is an existing version from the changelog. If not specified, the Unreleased section will be used.

Version

These commands affect the version line in pubspec.yaml. If applied successfully, Cider will print the resulting version.

Printing the current project version

Prints the current version from pubspec.yaml. This command is read-only.

cider version

Setting version to an arbitrary value

Sets the version in pubspec.yaml to the one provided. The new version must be semver-compatible.

cider version <new_version>
  • new_version new value, must be semver-compatible

Examples:

Version before Command Version after
1.2.3+1 cider version 3.2.1 3.2.1
0.2.1-dev cider version 0.0.1-alpha+42 0.0.1-alpha+42

Bumping the project version

Bumps the corresponding part of the project version according to semver.

cider bump <part> [options]
  • part can be any of the following:
    • breaking (means y for 0.y.z and x for x.y.z)
    • major
    • minor
    • patch
    • build
    • pre (pre-release)

Options:

  • --keep-build will retain the existing build part.
  • --bump-build will increment the build part (see below).
  • --build=<value> will set the build part to the given value. This is useful when build is a not a simple numeric value, e.g. a timestamp.
  • --pre=<prefix> sets the prerelease prefix.

When bumping the prerelease or build parts, Cider will look for the rightmost dot-separated identifier. If the identifier is an integer, it will be incremented stripping the leading zeroes. Otherwise, Cider will append .1 to the corresponding part.

Remember that according to semver v2, build is considered metadata and is ignored when determining version precedence.

Version before Command Version after
1.2.1-alpha+42 cider bump breaking 2.0.0
0.2.1-alpha+42 cider bump breaking 0.3.0
0.2.1-alpha+42 cider bump major 1.0.0
0.2.1-alpha+42 cider bump minor 0.3.0
0.2.1-alpha+42 cider bump patch 0.2.1
0.2.1 cider bump patch 0.2.2
0.2.1-alpha+42 cider bump pre 0.2.1-alpha.1
1.2.1-alpha+42 cider bump breaking --keep-build 2.0.0+42
0.2.1-alpha+42 cider bump breaking --bump-build 0.3.0+43
0.2.1-alpha+42 cider bump major --build=2020-02-02 1.0.0+2020-02-02
0.2.1-alpha+42 cider bump minor --pre=aplha --bump-build 0.3.0-alpha+43
Comments
  • Pretty please can we keep comments in pubspec.yaml

    Pretty please can we keep comments in pubspec.yaml

    I desperately need a tool like this. Looks clean and neat and seems to do the job well. I don't mind the reformatting, that's a result of rewriting, but pretty please can it keep comments. I've got a flutter project and there are some really good links to documentation in the pubspec.yaml file that I don't want to lose.

    help wanted 
    opened by rubenvereecken 7
  • Managing prereleases (like with npm version)

    Managing prereleases (like with npm version)

    Problem

    I want manage my prereleases (beta & alpha). Simply said I would like to do the same as in this question:

    There is a very handy npm version command. Besides arguments like major, minor and patch it accepts arguments like prerelease, prepatch, etc. It says in the docs that the commands work in accordance with the semver.inc function.

    These pre commands I have a question about.

    Say I'm currently at version v1.0.0. If I run npm version prerelease it will bump version to v1.0.1-0.

    Is it possible to provide an extra agrument for a prerelease identifier according to https://github.com/npm/node-semver#prerelease-identifiers?

    I wish something like npm version prerelease alpha would bump version to v1.0.1-alpha.0 but that doesn't work.

    Source: https://stackoverflow.com/q/44567010/8358501

    The Answer to this question:

    $ npm version prerelease --preid=alpha v0.1.1-alpha.0 $ npm version prerelease --preid=alpha v0.1.1-alpha.1 $ npm version prerelease --preid=alpha v0.1.1-alpha.2

    Source: https://stackoverflow.com/a/51888437/8358501

    Goal

    My goal is to do the same thing but with cider for Dart. I miss this feature in cider. Like:

    $ cider version
    v0.1.1
    $ cider bump prerelease --preid=alpha
    v0.1.1-alpha.0
    $ cider bump prerelease --preid=alpha
    v0.1.1-alpha.1
    $ cider bump prerelease --preid=alpha
    v0.1.1-alpha.2
    $ cider bump prerelease --preid=beta
    v0.1.1-beta.0
    $ cider bump prerelease --preid=beta
    v0.1.1-beta.1
    
    opened by nilsreichardt 5
  • Is it possible to add square brackets while setting version number in CHANGELOG.md for releases

    Is it possible to add square brackets while setting version number in CHANGELOG.md for releases

    Currently adds the version number without the square brackets Github actions that read changes from change log supports version to be in brackets as shown in the image below I know this is not an issue, but it would be great if it supports it.

    image

    opened by Oran 4
  • String manipulation

    String manipulation

    There are currently two set methods and I've modified one of them.

    Set has remained as it was before, it changes the version of everything that is specified.

    Version however extracts the numbers and the points from the given string.

    This is especially useful if you run the plugin from a Github workflow and want to use the branch name as the version. Say the branchname is: release / 0.1.8 then the version is only 0.1.8

    opened by M123-dev 4
  • [Feature request] Handle pre-release strings

    [Feature request] Handle pre-release strings

    pub_semver actually defines some special pre-release strings, eg alpha (1.2.0-alpha). This is about any sort of string that I'd like to tag my release with.

    You already have support for strings, eg 0.2.1+foo or 0.2.1+foo.bar.1.2. However, I'm working on a Flutter project where the build (after +) needs to be strictly integer as it is used for versioning for both Android and iOS where it is called the "version code". My usual cider invocation goes

    cider bump patch -b && cider bump build
    

    This way the version string and the version code are always correlated. It does mean I need any pre-release strings to be in the first part, eg 1.2.0-alpha+42. The problem is that bumping the patch on this will remove the -alpha bit, whereas I'd like to keep it. Not sure if that's common/good practice actually.

    My feature request is for cider to accomodate this somehow. I'm not sure what the best way would be. Either by allowing to patch on a version string so I can undo the cider bump patch removing it, or by considering them a special entity.

    What do you think?

    enhancement 
    opened by rubenvereecken 3
  • Incompatible with Flutter Stable (1.17.5)

    Incompatible with Flutter Stable (1.17.5)

    Due to path dependency:

    Because every version of flutter_test from sdk depends on path 1.6.4 and every version of cider depends on path ^1.7.0, flutter_test from sdk is incompatible with cider.
    

    Should work if downgraded to 1.6.4

    enhancement 
    opened by saschpe 3
  • Provide a way to

    Provide a way to "promote" the pre version

    Currently I have a pre version that is 1.2.3-alpha+123, but this is "patch" version is already bumped, for release I simply want it to become 1.2.3+123.

    cider could have an option to promote the current version to a "non-pre" version.

    Ideas:

    cider promote: new top level command cider bump --no-pre: removes pre, can use --bump/keep-build cider bump promote: same as --no-pre

    opened by JCQuintas 2
  • Null check operator used on a null value since Flutter 2.2.0

    Null check operator used on a null value since Flutter 2.2.0

    Since Flutter 2.2.0 I get the following error when I run cider bump patch -b or cider bump minor -b. cider bump build works without problems.

    1.1.5+103
    Null check operator used on a null value
    #0      CommandRunner.parse (package:args/command_runner.dart:127:51)
    #1      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:36)
    #2      new Future.sync (dart:async/future.dart:218:31)
    #3      CommandRunner.run (package:args/command_runner.dart:112:14)
    #4      Cider.run (package:cider/src/cider.dart:67:33)
    #5      main (file:///Users/michaguenther/.pub-cache/hosted/pub.dartlang.org/cider-0.1.0/bin/cider.dart:6:13)
    #6      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:281:32)
    #7      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
    
    bug 
    opened by guenth39 2
  • Allow setting version explicitly

    Allow setting version explicitly

    I have some pipelines to analyze commit messages and generate a new automatic version number. I would like to be able to use cider bump 0.1.0 or cider version 0.1.0 or something similar, instead of relying on bumping the version by change type

    opened by danilofuchs 2
  • Extra spaces on the fonts

    Extra spaces on the fonts

    I noticed that there are additional spaces added on the fonts:

    Before:

      fonts:
        - family: Riffic
          fonts:
            - asset: assets/fonts/RifficFree-Bold.ttf
    

    After:

      fonts:
        -
              family: Riffic
              fonts:
                -
                      asset: "assets/fonts/RifficFree-Bold.ttf"
    
    opened by digitaljoni 2
  • Omit build number from version in changelog

    Omit build number from version in changelog

    In flutter projects, it is usual to increase the build number when increasing the version. This is necessary because the google playstore will only recognize build number versioning and regards everything else as flavour. Build numbers are therefore basically a count of how many versions have been released, but arent very useful to include with the actual version number.

    My pubspec therefore does have a build number, but it is completely irrelevant to the changelog and its readers. When I use

    cider release
    

    my build number is also included in the Changelog, which I see as undesirable.

    I am not sure what the best course of action would be to acommodate for this usecase in the package. But I would be delighted if it would be possible to resolve this in some way.

    Maybe the command could provide an option for not including the build number when transfering the version.

    Perhaps it would be useful in general to be able to specify the behaviour for how build numbers are treated by default in the config file, as right now I will always have to use --bump-build together with cider bump.

    opened by clragon 1
  • Support for changes without quotes

    Support for changes without quotes

    As of right now, it seems that Cider requires quotes around the text for changes. Omitting quotes, results in weird output. For example:

    cider log added this is a test
    

    gives us:

    ### Added
    this
    

    where as

    cider log added 'this is a text'
    

    works as intended.

    I would advocate for cider to simply take all arguments after the type of the change as description, if no quotes are found. This might be a bit complicated to implement, but it would certainly be intuitive to use and convenient (because its easier to type).

    opened by clragon 0
  • Support for YANKED releases

    Support for YANKED releases

    As of right now, it seems that Cider fails to parse releases which have been YANKED. The section about YANKED releases on keep a changelog states the following:

    image

    When running Cider, the following exception is thrown:

    > cider log added 'some changes'
    Unhandled exception:
    FormatException: Invalid date format
    2021-11-25 [YANKED]
    #0      DateTime.parse (dart:core/date_time.dart:347:7)
    #1      _release (package:change/src/parser.dart:53:26)
    #2      parseChangelog (package:change/src/parser.dart:28:23)
    #3      ChangelogService.read (package:cider/src/service/changelog_service.dart:84:36)
    #4      ChangelogService.addUnreleased (package:cider/src/service/changelog_service.dart:57:17)
    #5      ChangelogService.install.<anonymous closure> (package:cider/src/service/changelog_service.dart:21:31)
    #6      Cider.run (package:cider/src/cider.dart:70:35)
    <asynchronous suspension>
    
    opened by clragon 3
  • Flaky test

    Flaky test

    This test and the iteration needs to be made async https://github.com/f3ath/cider/blob/e8332f1c32ce16ce6297aaee3acc22392ea00bde/test/functional_test.dart#L131

    bug 
    opened by f3ath 0
  • Flutter 2.8.1 breaks the package

    Flutter 2.8.1 breaks the package

    I get a warning: Warning: Executable "cider" runs "bin/cider.dart", which was not found in cider. And then whenever I run "cider" i get No active package cider.

    opened by mrRedSun 2
  • Lower required Dart sdk version

    Lower required Dart sdk version

    The current Dart SDK version is 2.14.4.

    Because [REDACTED] depends on cider >=0.1.1 which requires SDK version >=2.15.1 <3.0.0, version solving failed. pub get failed (1; Because [REDACTED] depends on cider >=0.1.1 which requires SDK version >=2.15.1 <3.0.0, version solving failed.)

    I don't see a reason why version couldn't be lower

    opened by mrRedSun 1
  • Trying to work with prerelease

    Trying to work with prerelease

    I have

    1.0.55+132
    

    I want

    1.0.55+132-alpha
    or
    1.0.55+132-alpha.1 
    

    I expected to be able to use

    cider bump pre --pre=alpha
    

    except that doesn't seem supported. Also note how I'm increment build because this is an internal build, where the build number doesn't need incrementing.


    For our beta channel I wanted to do something similar, except that's on public channels (Google Play, TestFlight), so it does need the build number incremented.

    > cider bump build --pre=beta
    
    Unhandled exception:
    The next version must be higher than current
    

    I suppose you're right if you want to enforce that.. Though for us it makes a lot of sense to only bump the prerelease version while also bumping the build number, even though that might not match some invariant that seems to be enforced here. Probably inspired by semver.

    While I'm at it, this might be a bug

    > cider bump patch -b --pre=alpha 
    
    Null check operator used on a null value
    #0      CommandRunner.parse (package:args/command_runner.dart:134:51)
    #1      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:119:36)
    #2      new Future.sync (dart:async/future.dart:218:31)
    #3      CommandRunner.run (package:args/command_runner.dart:119:14)
    #4      Cider.run (package:cider/src/cider.dart:67:33)
    #5      main (file:///home/ruben/.pub-cache/hosted/pub.dartlang.org/cider-0.1.0/bin/cider.dart:6:13)
    #6      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:281:32)
    #7      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
    

    Can we talk about how to achieve some of these very practical use cases?

    opened by rubenvereecken 0
Releases(0.1.3)
Owner
Alexey
Open sourcing just for fun. Dart packages mostly.
Alexey
A starter project guide to learn Flutter and its tools.

flutter_catalog A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

null 2 Sep 21, 2021
DoneIt is a sample note app 📝 Flutter application 📱 built to demonstrate use of Clean Architecture tools. Dedicated to all Flutter Developers with ❤️.

DoneIt ?? DoneIt is a sample note app ?? Flutter application ?? built to demonstrate use of Clean Architecture tools. Dedicated to all Flutter Develop

Shubham Chhimpa 175 Dec 24, 2022
A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully & easily modifiable.

A package that lets you include a cool, nice looking and validated Password TextFormField in your app to enhance user experience. The package is fully

Muhammad Hamza 21 Jan 1, 2023
A Dart/Flutter package to register/query/remove URI Schemes without hassle.

protocol_registry Register/query/remove URI Schemes without hassle. Available for Windows and Linux. Installation flutter pub add protocol_registry Us

ZYROUGE 10 Oct 25, 2022
A Dart FFI package to send 💬 toasts on Windows. Written in C++, based on WinToast.

desktoasts A Dart package to send native ?? toasts on Windows. Installation For Flutter dependencies: ... desktoasts: ^0.0.2 For Dart CLI here Sup

Hitesh Kumar Saini 37 Mar 7, 2022
Dart package to rank proposals according to Majority Judgment, using a score-based algorithm for performance and scalability

Majority Judgment for Dart This Dart package helps to resolve polls using Majority Judgment. Features Efficient Majority Judgment algorithm, scales we

Mieux Voter 1 Oct 18, 2021
Actor model implementation in Dart. This package makes it easier to work with isolates, create clusters of isolates.

Actor model implementation in Dart Languages: Introduction About Theater Installing What is Actor Notes about the actors Actor system Actor tree Using

Gleb Batykov 39 Nov 14, 2022
Dynamic Text Highlighting (DTH) package for Dart & Flutter.

Dynamic Text Highlighting (DTH) This package is used to highlight, in a completely dynamic way, keywords, or phrases, wherever they are present in a s

null 34 Oct 3, 2022
This Dart package will utilize the plugin, google_mobile_ads, so to quickly and easily implement ads into a Flutter app.

Ads to your App in a Snap! This Dart package will utilize the plugin, google_mobile_ads, so to quickly and easily implement ads into a Flutter app

Andrious Solutions Ltd. 58 Sep 11, 2022
Test telegram bot written in dart using teledart package

Dart-Tg-Bot Test telegram bot written in dart using teledart package. Run on local machine First install dart Clone the bot's source and install depen

I'm Not A Bot #Left_TG 8 Oct 31, 2022
Dart/Flutter package for using Elastic App Search through a simple API returning easy to handle objects

Dart/Flutter package for using Elastic App Search through a simple API returning easy to handle objects This package is a ready-to-use API for Elastic

Julien Le Bren 5 Nov 16, 2022
Flutter/dart package for payment gateway bKash (Bangladesh)

bKash(BD) Mobile Finance Payment Gateway Flutter Package This is a Flutter package for bKash BD Payment Gateway. This package can be used in flutter p

Codeboxr CodeHub 6 Nov 11, 2022
A Dart library for creating a Dart object to represent directory trees.

Directory Tree A Dart library for creating a Dart object to represent directory trees. Getting Started Import and initialize package import 'package:d

Chiziaruhoma Ogbonda 5 Dec 1, 2021
A collection of Dart code samples by Dart DevRel

Dart samples A collection of Dart programs that illustrate features and best practices. For a list of community-maintained projects, see Awesome Dart.

Dart 458 Dec 30, 2022
A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

A discord bot, made with Dart, which lets you run your own pure Dart code snippets directly via a discord ping, and get the output in an instant.

Anikate De 3 Oct 21, 2022
Firebase Cloud Messaging (FCM) Flutter package.

Firebase Messaging Plugin for Flutter A Flutter plugin to use the Firebase Cloud Messaging API. To learn more about Firebase Cloud Messaging, please v

Wael Alhalabi 12 Dec 10, 2022
A Flutter project that implemented getx package and firebase services.

Get X Firebase A Flutter Package that implemented firebase services with getx package. It's free, open source, complete, rapid development package for

Faisal Ramdan 19 Nov 26, 2022
A Flutter package for getting app feedback from users.

App Feedback A Flutter package for getting app feedback from users. Other Flutter packages Name Stars Pub Filter List Empty widget Add Thumbnail Count

Sonu Sharma 11 Nov 13, 2022
A Flutter package for show custom in-app notification.

?? in_app_notification A Flutter package to show custom in-app notification with any Widgets. ✍️ Usage Import it. dependencies: in_app_notificatio

CBcloud 18 Oct 27, 2022