Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
keynmol committed Apr 22, 2023
1 parent 3b2e918 commit 74e544a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 36 deletions.
51 changes: 27 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
## Scala Library template
## Yank

This is a template repository with some of the learnings from OSS Scala ecosystem applied.
Very simple JVM micro-library for downloading self-contained tools from other
ecosystems.

<!--toc:start-->
- [Yank](#yank)
- [Tailwind CSS](#tailwind-css)
- [D2](#d2)
<!--toc:end-->

| | JVM | Scala.js (1.x) | Scala Native (0.4.0) |
| -------------- | --- | -------------- | --------------------- |
| Scala 2.12.13 ||||
| Scala 2.13.5 ||||
| Scala 3.1.x ||||

### Tailwind CSS

* Github Actions is used for CI and Releases
https://tailwindcss.com/docs/installation

* On pushes and pull requests, `sbt ci` command is ran (more about it later)
* On tags, `sbt ci-release` command is ran, from [sbt-ci-release](https://github.com/olafurpg/sbt-ci-release)
* Version is determined using [sbt-dynver](https://github.com/dwijnand/sbt-dynver)
```scala mdoc
import com.indoorvivants.yank._

* Syntax formatting is verified using [sbt-scalafmt](https://github.com/scalameta/sbt-scalafmt)
val downloadedPath: java.nio.file.Path =
Tool.bootstrap(new tools.TailwindCSS)(tools.TailwindCSS.Config(version = "3.2.7"))
```

* Imports are organised and checked using [organize-imports](https://github.com/liancheng/scalafix-organize-imports) Scalafix rule
### D2

* Several other Scalafix rules are enabled by default, see [.scalafix.conf](.scalafix.conf)
https://d2lang.com/

* Compilation flags are set using [sbt-tpolecat](https://github.com/DavidGregory084/sbt-tpolecat)
```scala mdoc:nest
import com.indoorvivants.yank._

* Explicit dependencies are checked using [sbt-explicit-dependencies](https://github.com/cb372/sbt-explicit-dependencies)
val downloadedPath: java.nio.file.Path =
Tool.bootstrap(new tools.D2)(tools.D2.Config(version = "0.4.1"))
```

* Presence of Licence header is checked using [sbt-header](https://github.com/sbt/sbt-header/)

* Binary incompatibilities among dependencies are checked using [sbt-missinglink](https://github.com/scalacenter/sbt-missinglink)

* Build matrix is managed using [sbt-projectmatrix](https://github.com/sbt/sbt-projectmatrix)

### `sbt preCI`
| | JVM |
| -------------- | --- |
| Scala 2.12 ||
| Scala 2.13 ||
| Scala 3 ||

A `preCI` command is added - which will reformat, apply scalafix rules, create licence headers, run missinglink, etc.

This command is designed to be run before pushing, **not on CI**.

`sbt ci` command only runs checks, it never changes sources.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inThisBuild(
organization := "com.indoorvivants",
organizationName := "Anton Sviridov",
homepage := Some(
url("https://github.com/indoorvivants/mdoc-d2")
url("https://github.com/indoorvivants/yank")
),
startYear := Some(2023),
licenses := List(
Expand Down Expand Up @@ -88,7 +88,7 @@ val CICommands = Seq(
"clean",
"compile",
"test",
"docs/mdoc",
"docs/mdoc --in README.md",
"scalafmtCheckAll",
"scalafmtSbtCheck",
s"scalafix --check $scalafixRules",
Expand Down
9 changes: 0 additions & 9 deletions docs/example.md

This file was deleted.

2 changes: 1 addition & 1 deletion modules/core/src/main/scala/tools/D2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import java.nio.file.Path
import com.indoorvivants.yank._

class D2 extends Tool {
type Config = TailwindCSS.Config
type Config = D2.Config

override def cacheKey(c: Config) = s"d2-${c.version}"
override def url(c: Config, t: Platform.Target): String =
Expand Down

0 comments on commit 74e544a

Please sign in to comment.