Skip to content

Commit

Permalink
Sonatype central (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-vovk authored Jul 3, 2024
1 parent 0d3f833 commit c3ddc8f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Cats-Effect-Simple-DI

A tiny library that allows you to make simple dependency injection with Cats Effect.
A tiny library that makes dependency injection with [cats-effect](https://github.com/typelevel/cats-effect) simple.
This is a follow-up of
the [article](https://medium.com/@ivovk/dependency-injection-with-cats-effect-resource-monad-ad7cd47b977) I wrote about
the topic.

Traditional approach to Dependency Injection with Cats Effect is to build a single for-comprehension that wires all the
Traditional approach to dependency enjection with cats-effect is to build a single for-comprehension that wires all the
dependencies together. This approach is not very scalable and can become quite messy as the number of dependencies
grows.

The suggested approach would be:
The suggested approach with this library would be:

```scala
import io.github.cats_effect_simple_di.Allocator
Expand Down Expand Up @@ -70,6 +70,7 @@ You can have multiple dependencies objects and combine them together. In this ca
in `allocator.allocate{}` so that they are shut down in the right order:

Example reusing the same `Allocator` object:

```scala
// AWS - specific dependencies
class AwsDependencies(allocator: Allocator) {
Expand Down
4 changes: 4 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import xerial.sbt.Sonatype.sonatypeCentralHost

name := "cats-effect-simple-di"

scalaVersion := "3.3.3"
Expand All @@ -17,6 +19,8 @@ inThisBuild(List(
)
))

ThisBuild / sonatypeCredentialHost := sonatypeCentralHost

lazy val Versions = new {
val catsEffect = "3.5.4"
val scalatest = "3.2.18"
Expand Down
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.11.0")

0 comments on commit c3ddc8f

Please sign in to comment.