@zio.dev/zio-sbt 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.md +74 -6
- package/package.json +1 -1
package/index.md
CHANGED
|
@@ -9,12 +9,12 @@ _ZIO SBT_ contains multiple sbt plugins that are useful for ZIO projects. It pro
|
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
12
|
-
Add the following lines to your `
|
|
12
|
+
Add the following lines to your `project/plugins.sbt` file:
|
|
13
13
|
|
|
14
14
|
```scala
|
|
15
|
-
addSbtPlugin("dev.zio" % "zio-sbt-ecosystem" % "0.5.
|
|
16
|
-
addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.5.
|
|
17
|
-
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.5.
|
|
15
|
+
addSbtPlugin("dev.zio" % "zio-sbt-ecosystem" % "0.5.3")
|
|
16
|
+
addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.5.3")
|
|
17
|
+
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.5.3")
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Then you can enable them by using the following code in your `build.sbt` file:
|
|
@@ -101,7 +101,7 @@ ZIO SBT CI plugin generates a default GitHub workflow that includes common CI ta
|
|
|
101
101
|
To use ZIO SBT CI plugin, add the following lines to your `plugins.sbt` file:
|
|
102
102
|
|
|
103
103
|
```scala
|
|
104
|
-
addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.5.
|
|
104
|
+
addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.5.3")
|
|
105
105
|
|
|
106
106
|
resolvers ++= Resolver.sonatypeOssRepos("public")
|
|
107
107
|
```
|
|
@@ -138,7 +138,7 @@ ZIO SBT GitHub Query is an sbt plugin for fetching GitHub issues/PRs and buildin
|
|
|
138
138
|
Add to `plugins.sbt`:
|
|
139
139
|
|
|
140
140
|
```scala
|
|
141
|
-
addSbtPlugin("dev.zio" % "zio-sbt-gh-query" % "0.5.
|
|
141
|
+
addSbtPlugin("dev.zio" % "zio-sbt-gh-query" % "0.5.3")
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
The plugin is auto-enabled. Configure in `build.sbt`:
|
|
@@ -210,6 +210,74 @@ The plugin creates a SQLite database with:
|
|
|
210
210
|
- `comments` table - stores issue and PR comments
|
|
211
211
|
- `search_index` - FTS5 full-text search index (requires SQLite built with FTS5 enabled)
|
|
212
212
|
|
|
213
|
+
## ZIO SBT Source
|
|
214
|
+
|
|
215
|
+
ZIO SBT Source is a Scala 2.13 + Scala 3 cross-compiled library that provides utilities for self-documenting example code. It includes the `ExprEval` macro, which captures the source text of expressions at compile time and prints them alongside their evaluated results at runtime.
|
|
216
|
+
|
|
217
|
+
### Installation
|
|
218
|
+
|
|
219
|
+
Add the following line to your `libraryDependencies` in `build.sbt`:
|
|
220
|
+
|
|
221
|
+
```scala
|
|
222
|
+
libraryDependencies += "dev.zio" %% "zio-sbt-source" % "0.5.3"
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Features
|
|
226
|
+
|
|
227
|
+
The `ExprEval.show` macro provides an intuitive way to write self-documenting example code:
|
|
228
|
+
|
|
229
|
+
```scala
|
|
230
|
+
import zio.sbt.ExprEval.show
|
|
231
|
+
|
|
232
|
+
// Print expression source and result
|
|
233
|
+
show(
|
|
234
|
+
42 + 8,
|
|
235
|
+
"Hello, " + "World!"
|
|
236
|
+
)
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Output:
|
|
240
|
+
```
|
|
241
|
+
42 + 8
|
|
242
|
+
// 50
|
|
243
|
+
"Hello, " + "World!"
|
|
244
|
+
// Hello, World!
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Comment Labels
|
|
248
|
+
|
|
249
|
+
Add `//` comments above your `show` call to add context labels to the output:
|
|
250
|
+
|
|
251
|
+
```scala
|
|
252
|
+
// Calculate the answer to life, the universe, and everything
|
|
253
|
+
show(6 * 7)
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Output:
|
|
257
|
+
```
|
|
258
|
+
// Calculate the answer to life, the universe, and everything
|
|
259
|
+
6 * 7
|
|
260
|
+
// 42
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Block Form
|
|
264
|
+
|
|
265
|
+
For multiple expressions, use the block form:
|
|
266
|
+
|
|
267
|
+
```scala
|
|
268
|
+
show {
|
|
269
|
+
1 + 2
|
|
270
|
+
3 * 4
|
|
271
|
+
"hello"
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Implementation Details
|
|
276
|
+
|
|
277
|
+
- **Scala 3**: Uses `scala.quoted.*` with `inline def` for compile-time source capture
|
|
278
|
+
- **Scala 2.13**: Uses `scala.reflect.macros.whitebox` to achieve the same behavior
|
|
279
|
+
- **Runtime Helper**: `SourceReader` utility reads comment lines from source files
|
|
280
|
+
|
|
213
281
|
## Testing Strategies
|
|
214
282
|
|
|
215
283
|
### Default Testing Strategy
|