Skip to main content

README.md

# Kludge 🩹
kludge lets app developers make [kludges](https://en.wikipedia.org/wiki/Kludge) to fix broken packages in a pinch. 
Basically Gleam's [patch-package](https://www.npmjs.com/package/patch-package).

[![Package Version](https://img.shields.io/hexpm/v/kludge)](https://hex.pm/packages/kludge)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/kludge/)

# Installation
Add kludge as a dev dependency
```bash
gleam add kludge
```
*You can try to make this dev only if you can get away with it.*

⚠️Kludge requires `git` to function and apply patches.

# Usage
How to make your first patches
```bash
# Edit a file in the gleep_glorp package
vim build/packages/gleep_glorp/src/gleep_glorp.gleam

# Tell kludge to save the changes that you made in gleep_glorp
gleam run -m kludge gleep_glorp

# Save and commit the changes you made to gleep_glorp in git
git add patches/gleep_glorp+1.16.0.patch
git commit
```
And then your friend can...
```bash
# Apply all the patches
gleam run -m kludge
```
Using a command runner like `make` or `just` with `kludge` is **strongly recommended**. Gleam does not have a post install scripts and using a command runner will hopefully prevent you from forgetting to apply patches.

## Development

```sh
gleam run   # Run the project
gleam test  # Run the tests
```