@zio.dev/zio-sbt 0.5.2 → 0.6.0

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.
Files changed (2) hide show
  1. package/index.md +48 -86
  2. package/package.json +1 -1
package/index.md CHANGED
@@ -12,9 +12,9 @@ _ZIO SBT_ contains multiple sbt plugins that are useful for ZIO projects. It pro
12
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.2")
16
- addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.5.2")
17
- addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.5.2")
15
+ addSbtPlugin("dev.zio" % "zio-sbt-ecosystem" % "0.6.0")
16
+ addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.6.0")
17
+ addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.6.0")
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.2")
104
+ addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.6.0")
105
105
 
106
106
  resolvers ++= Resolver.sonatypeOssRepos("public")
107
107
  ```
@@ -129,87 +129,6 @@ This will generate a GitHub workflow file inside the `.github/workflows` directo
129
129
  >
130
130
  > To use this plugin, we also need to install [ZIO Assistant](https://github.com/apps/zio-assistant) bot.
131
131
 
132
- ## ZIO SBT GitHub Query Plugin
133
-
134
- ZIO SBT GitHub Query is an sbt plugin for fetching GitHub issues/PRs and building a searchable SQLite database with full-text search.
135
-
136
- ### Installation
137
-
138
- Add to `plugins.sbt`:
139
-
140
- ```scala
141
- addSbtPlugin("dev.zio" % "zio-sbt-gh-query" % "0.5.2")
142
- ```
143
-
144
- The plugin is auto-enabled. Configure in `build.sbt`:
145
-
146
- ```scala
147
- // Required: specify your GitHub repository
148
- ghRepo := "your-org/your-repo"
149
-
150
- // Optional: override the default data directory (defaults to .zio-sbt)
151
- ghDir := file(".zio-sbt")
152
- ```
153
-
154
- ### Commands
155
-
156
- | Command | Description |
157
- |---------|-------------|
158
- | `gh-sync` | Fetch data from GitHub and build/update the search database. On first run (or with `--force`), does a full fetch and rebuild. On subsequent runs, fetches only new/updated items incrementally. |
159
- | `gh-query <query>` | Full-text search across issues and PRs. Supports `--verbose` flag to include body text. |
160
- | `gh-status` | Show database statistics (issue/PR/comment counts, last fetch time). |
161
-
162
- ### Usage
163
-
164
- ```bash
165
- # Fetch all issues/PRs and build the database
166
- sbt gh-sync
167
-
168
- # Incrementally fetch new/updated items
169
- sbt gh-sync
170
-
171
- # Re-fetch everything and rebuild from scratch
172
- sbt "gh-sync --force"
173
-
174
- # Basic search query
175
- sbt "gh-query codec"
176
-
177
- # Search with full body content
178
- sbt "gh-query --verbose codec"
179
-
180
- # Check database statistics
181
- sbt gh-status
182
- ```
183
-
184
- ### Dependencies
185
-
186
- The plugin checks for all required dependencies before running any command and reports clear
187
- error messages with install instructions if anything is missing.
188
-
189
- | Dependency | Required by | Install |
190
- |---|---|---|
191
- | `bash` | `gh-sync` | https://www.gnu.org/software/bash/ |
192
- | `gh` (GitHub CLI) | `gh-sync` | https://cli.github.com |
193
- | `jq` | `gh-sync` | https://jqlang.github.io/jq/download/ |
194
- | `python3` | all commands | https://www.python.org/downloads/ |
195
- | `sqlite3` with [FTS5](https://www.sqlite.org/fts5.html) | `gh-sync`, `gh-query` | Ensure your Python's sqlite3 is built with FTS5 support |
196
-
197
- Before running `gh-sync` for the first time, authenticate the GitHub CLI:
198
-
199
- ```bash
200
- gh auth login
201
- ```
202
-
203
- The authenticated account must have read access to the target repository.
204
-
205
- ### Database Schema
206
-
207
- The plugin creates a SQLite database with:
208
-
209
- - `issues` table - stores issues and PRs
210
- - `comments` table - stores issue and PR comments
211
- - `search_index` - FTS5 full-text search index (requires SQLite built with FTS5 enabled)
212
-
213
132
  ## ZIO SBT Source
214
133
 
215
134
  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.
@@ -219,7 +138,7 @@ ZIO SBT Source is a Scala 2.13 + Scala 3 cross-compiled library that provides ut
219
138
  Add the following line to your `libraryDependencies` in `build.sbt`:
220
139
 
221
140
  ```scala
222
- libraryDependencies += "dev.zio" %% "zio-sbt-source" % "0.5.2"
141
+ libraryDependencies += "dev.zio" %% "zio-sbt-source" % "0.6.0"
223
142
  ```
224
143
 
225
144
  ### Features
@@ -272,6 +191,49 @@ show {
272
191
  }
273
192
  ```
274
193
 
194
+ ### SourceFile: Embedding Source Code in Documentation
195
+
196
+ The `SourceFile` utility provides methods for embedding source files into mdoc documentation with support for syntax highlighting and line numbers:
197
+
198
+ ```scala
199
+ import zio.sbt.SourceFile
200
+
201
+ // Embed a source file in mdoc
202
+ SourceFile.printSource("path/to/Example.scala")
203
+ ```
204
+
205
+ This generates a fenced code block with the file's language tag detected from its extension.
206
+
207
+ ### EmbedSourceModifier: mdoc Plugin for Source Embedding
208
+
209
+ The `EmbedSourceModifier` extends mdoc with an `embed` directive for embedding source files directly from markdown.
210
+ Use the modifier name `embed` followed by the file path:
211
+
212
+ ```
213
+ \`\`\`scala mdoc:embed:path/to/Example.scala
214
+ \`\`\`
215
+ ```
216
+
217
+ Renders as a fenced code block with syntax highlighting based on file extension.
218
+
219
+ #### Docusaurus Line Numbers
220
+
221
+ To enable line numbers in [Docusaurus](https://docusaurus.io) code blocks, add the `:showLineNumbers` flag (or kebab-case `:show-line-numbers` alias):
222
+
223
+ ```
224
+ \`\`\`scala mdoc:embed:path/to/Example.scala:showLineNumbers
225
+ \`\`\`
226
+ ```
227
+
228
+ or
229
+
230
+ ```
231
+ \`\`\`scala mdoc:embed:path/to/Example.scala:show-line-numbers
232
+ \`\`\`
233
+ ```
234
+
235
+ Both forms emit `showLineNumbers` in the code fence header, enabling line numbering in the rendered documentation.
236
+
275
237
  ### Implementation Details
276
238
 
277
239
  - **Scala 3**: Uses `scala.quoted.*` with `inline def` for compile-time source capture
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@zio.dev/zio-sbt",
3
3
  "description": "ZIO SBT Documentation",
4
4
  "license": "Apache-2.0",
5
- "version": "0.5.2",
5
+ "version": "0.6.0",
6
6
  "repository": {
7
7
  "url": "https://github.com/zio/zio-sbt"
8
8
  }