Skip to content

Commit d23be3d

Browse files
committed
Remove all package.scala
1 parent 9ddb063 commit d23be3d

File tree

21 files changed

+63
-28
lines changed

21 files changed

+63
-28
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Changelog
22

3+
## 0.12.0 (20/02/2017)
4+
5+
- **Breaking changes** I liked having all implicits directly inside the package object but it started to create problems. When generating the documentation, which depends on all projects, we had runtime errors while all tests were green, but they are ran on project at a time. Also, it means all implicits where always present on the scope which might not be the best option. So the idea is to move them from the package object to the `JwtXXX` object. For example, for Play Json:
6+
7+
```scala
8+
// Before
9+
// JwtJson.scala.
10+
package pdi.jwt
11+
12+
object JwtJson extends JwtJsonCommon[JsObject] {
13+
// stuff...
14+
}
15+
16+
// package.scala
17+
package pdi
18+
19+
package object jwt extends JwtJsonImplicits {}
20+
21+
// --------------------------------------------------------
22+
// After
23+
// JwtJson.scala.
24+
package pdi.jwt
25+
26+
object JwtJson extends JwtJsonCommon[JsObject] with JwtJsonImplicits {
27+
// stuff...
28+
}
29+
```
30+
331
## 0.11.0 (19/02/2017)
432

533
- Drop Scala 2.10

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import play.sbt.Play.autoImport._
55
import PlayKeys._
66
import Dependencies._
77

8-
val previousVersion = "0.10.0"
9-
val buildVersion = "0.11.0"
8+
val previousVersion = "0.11.0"
9+
val buildVersion = "0.12.0"
1010

1111
val projects = Seq("coreCommon", "playJson", "json4sNative", "json4sJackson", "circe", "upickle", "play")
1212
val crossProjects = projects.map(p => Seq(p + "Legacy", p + "Edge")).flatten

docs/src/main/tut/_includes/tut/jwt-play-json-jwt-json.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The project provides implicit reader and writer for both `JwtHeader` and `JwtCla
4646

4747
```tut
4848
import pdi.jwt._
49+
import pdi.jwt.JwtJson._
4950
5051
// Reads
5152
Json.fromJson[JwtHeader](header)

docs/src/main/tut/_includes/tut/jwt-play-jwt-session.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ session2.getAs[User]("user")
6565
You can extract a `JwtSession` from a `RequestHeader`.
6666

6767
```tut
68-
import pdi.jwt._, play.api.test.{FakeRequest, FakeHeaders}
68+
import pdi.jwt._
69+
import pdi.jwt.JwtSession._
70+
import play.api.test.{FakeRequest, FakeHeaders}
6971
7072
// Default JwtSession
7173
FakeRequest().jwtSession

docs/src/main/tut/_includes/tut/jwt-upickle-jwt-upickle.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
## JwtUpickle Object
22

3-
**Compilation problem** Right now, even if all tests are green, there is a problem for compiling this documentation file.
4-
53
### Basic usage
64

7-
```
5+
```tut
86
import java.time.Instant
97
import upickle.json
108
import upickle.default._
@@ -25,7 +23,7 @@ JwtUpickle.decode(token, key, Seq(JwtAlgorithm.HS256))
2523

2624
### Encoding
2725

28-
```
26+
```tut
2927
val key = "secretKey"
3028
val algo = JwtAlgorithm.HS256
3129
@@ -39,7 +37,7 @@ JwtUpickle.encode(header, claimJson, key)
3937

4038
### Decoding
4139

42-
```
40+
```tut
4341
val claim = JwtClaim(
4442
expiration = Some(Instant.now.plusSeconds(157784760).getEpochSecond),
4543
issuedAt = Some(Instant.now.getEpochSecond)

json/json4s-jackson/src/main/scala/JwtJson4sJackson.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import org.json4s.jackson.Serialization.{read, write}
1212
*
1313
* To see a full list of samples, check the [[http://pauldijou.fr/jwt-scala/samples/jwt-json4s/ online documentation]].
1414
*/
15-
object JwtJson4s extends JwtJson4sCommon {
15+
object JwtJson4s extends JwtJson4sCommon with JwtJson4sImplicits {
1616
protected def parse(value: String): JObject = jparse(value) match {
1717
case res: JObject => res
1818
case _ => throw new RuntimeException(s"Couldn't parse [$value] to a JObject")

json/json4s-jackson/src/main/scala/package.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

json/json4s-jackson/src/test/scala/Json4sJacksonSpec.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import org.json4s.JsonDSL._
55
import org.json4s.jackson.JsonMethods._
66

77
class JwtJson4sJacksonSpec extends JwtJsonCommonSpec[JObject] with Json4sJacksonFixture {
8+
import pdi.jwt.JwtJson4s._
9+
810
val jwtJsonCommon = JwtJson4s
911

1012
describe("JwtJson") {

json/json4s-native/src/main/scala/JwtJson4sNative.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import org.json4s.native.Serialization.{read, write}
1212
*
1313
* To see a full list of samples, check the [[http://pauldijou.fr/jwt-scala/samples/jwt-json4s/ online documentation]].
1414
*/
15-
object JwtJson4s extends JwtJson4sCommon {
15+
object JwtJson4s extends JwtJson4sCommon with JwtJson4sImplicits {
1616
protected def parse(value: String): JObject = jparse(value) match {
1717
case res: JObject => res
1818
case _ => throw new RuntimeException(s"Couldn't parse [$value] to a JObject")

json/json4s-native/src/main/scala/package.scala

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)