Skip to content

robinweser/flow-semantic-versioning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

yarn add --dev lorren

Alternatively use npm i --save-dev lorren.

Usage

Not usable yet, coming soon.

API