Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kacperfkorban/guinep
Automatic UI forms for Scala 3 functions
https://github.com/kacperfkorban/guinep
code-generation frontend gui scala scala3
Last synced: 10 days ago
JSON representation
Automatic UI forms for Scala 3 functions
- Host: GitHub
- URL: https://github.com/kacperfkorban/guinep
- Owner: KacperFKorban
- License: apache-2.0
- Created: 2024-01-26T00:01:07.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-14T07:24:06.000Z (7 months ago)
- Last Synced: 2024-04-14T10:57:59.748Z (7 months ago)
- Topics: code-generation, frontend, gui, scala, scala3
- Language: Scala
- Homepage: https://kacperfkorban.github.io/GUInep/
- Size: 129 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![guinep Scala version support](https://index.scala-lang.org/kacperfkorban/guinep/guinep/latest.svg)](https://index.scala-lang.org/kacperfkorban/guinep/guinep)
# GUInep
> Guinep are small tropical fruits from the Caribbean and Central/Southern America. They are described to taste like a cross between Lime and Lychee.
Automatic UI forms for Scala 3 functions
## Example
```scala
def upperCaseText(text: String): String =
text.toUpperCase@main
def run =
guinep.web(upperCaseText)
```This will start a local web server with auto generated endpoints for running all listed functions. And an auto generated front-end with a form for each function.
## Usage (with build tools)
### sbt
```scala
libraryDependencies ++= Seq(
"io.github.kacperfkorban" %% "guinep-web" % "version_from_releases"
)
```### scala-cli
```scala
//> using lib "io.github.kacperfkorban::guinep-web:version_from_releases"
```## Usage (in code)
`GUInep` only exposes one function `guinep.web` which takes some number of functions as arguments.
```scala
def upperCaseText(text: String): String =
text.toUpperCasedef rollDice(sides: Int): Int =
scala.util.Random.nextInt(sides) + 1@main
def run =
guinep.web(
upperCaseText,
rollDice
)
```## Demo
## Current limitations
Currently GUInep doesn't support:
- Functions with multiple parameter lists (and by extension - extension methods) - https://github.com/KacperFKorban/GUInep/issues/33
- Fancier GADTs with unobvious inheritance, type bounds and variance - https://github.com/KacperFKorban/GUInep/issues/30
- Union and intersection types - https://github.com/KacperFKorban/GUInep/issues/44
- Opaque types - https://github.com/KacperFKorban/GUInep/issues/49## Contributing
If you have any ideas on how to improve GUInep, feel free to open an issue.
All bug reports and feature requests are highly appreciated.