Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/robinweser/flow-semantic-versioning

Enforced Semantic Versioning for Flow
https://github.com/robinweser/flow-semantic-versioning

flow flowtype semantic-versioning semver versioning versioning-semantics

Last synced: about 1 month ago
JSON representation

Enforced Semantic Versioning for Flow

Awesome Lists containing this project

README

        

> **Caution**: Highly experimental WIP!

# lorren

Lorren is a tool that aims to enforce semantic versioning.

It generates a `.types-lock.json` based on your Flow types which is later used to compare versions and propose the next version.

## Why?
I am maintaining Fela, a CSS in JS solution with a huge ecosystem. It is a monorepo with more than 25 packages which have inner dependencies. Manually keeping up with all the changes and correct version updates is nearly impossible without proper tooling.

The result is breaking changes within patch-releases which can destroy your whole project.

## How it works

Interally we use webpack to walk through your code starting at a given entry point. It uses a babel plugin to extract parameter and return types from your APIs starting at the top-level public APIs.

It then generates a JSON-based lock-file containing all types grouped by filename.

This lock-file can then be used to compare your API changes. Depending on what and how your APIs change, we can then propose the correct version following semantic versioning.

## Caveats
* only works with 100% Flow coverage
- at least for public API
* might not catch all edge cases
* doesn't (yet) support TypeScript

## Installation
```sh
yarn add --dev lorren
```
Alternatively use `npm i --save-dev lorren`.

## Usage
Not usable yet, coming soon.

## API