Skip to content

Commit

Permalink
Revamps this plugin's build
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrohdezma committed Mar 20, 2024
1 parent a04dd98 commit 0859150
Show file tree
Hide file tree
Showing 22 changed files with 788 additions and 571 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @permutive-engineering/developer-experience
2 changes: 1 addition & 1 deletion LICENSE → .github/docs/LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright (C) @YEAR_RANGE@ @COPYRIGHT_OWNER@

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
59 changes: 59 additions & 0 deletions .github/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@DESCRIPTION@

```scala mdoc:toc
```

## Installation

Add the following line to your `build.sbt` file:

```sbt
libraryDependencies += "@ORGANIZATION@" %% "@NAME@" % "@VERSION@"
```

The library is published for Scala versions: @SUPPORTED_SCALA_VERSIONS@.

## Usage

# Refreshable

`Refreshable` lives in the [Typelevel](https://typelevel.org/) Scala ecosystem
and offers a `Refreshable` type that operates like a cache of size 1 with a
background fiber that periodically refreshes the stored value. Use it when you
have criticial data that needs to be cached and you would rather read stale data
in the event that refreshing the data fails.

```scala
trait Refreshable[F[_], A] {

/** Get the unwrapped value of `A`
*/
def value: F[A] = get.map(_.value)

/** Get the value of `A` wrapped in a status
*/
def get: F[CachedValue[A]]

/** Cancel refreshing
*/
def cancel: F[Boolean]

/** Restart refreshing
*/
def restart: F[Boolean]
}

sealed trait CachedValue[A] {
def value: A
}

object CachedValue {
case class Success[A](value: A) extends CachedValue[A]
case class Error[A](value: A, error: Throwable) extends CachedValue[A]
case class Cancelled[A](value: A) extends CachedValue[A]
}
```

## Contributors to this project

@CONTRIBUTORS_TABLE@
28 changes: 28 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Don't edit this file!
# It is automatically updated after every release of https://github.com/alejandrohdezma/sbt-ci
# If you want to suggest a change, please open a PR or issue in that repository

# This file contains the template for the "auto-generated release notes"

changelog:
exclude:
labels:
- ":chart_with_upwards_trend: dependency-update"
authors:
- dependabot
categories:
- title: "⚠️ Breaking changes"
labels:
- ":warning: breaking"
- title: "🚀 New features"
labels:
- ":rocket: feature"
- title: "📘 Documentation updates"
labels:
- ":blue_book: documentation"
- title: "🐛 Bug fixes"
labels:
- ":beetle: bug"
- title: Other Changes
labels:
- "*"
Loading

0 comments on commit 0859150

Please sign in to comment.