Skip to content

Commit 208b434

Browse files
xerialclaude
andauthored
docs: Introduce the sbt 2.x plugins in README to make them discoverable (#658)
## Why The sbt 2.x plugins (`sbt-uni`, `sbt-uni-crossproject`, `sbt-uni-playwright`) fill real gaps for **any** sbt 2.x project — portable-scala's crossproject and a maintained Playwright JSEnv are not otherwise available on sbt 2.x — but the top-level README never mentioned them, so external users had no way to discover them. ## What Adds an **sbt 2.x Plugins** section to README.md with: - a table describing each plugin, linked to its reference docs page - `project/plugins.sbt` snippets for adding each plugin - a minimal `crossProject` example showing the Pure layout All snippets follow the verified usage from `docs/build/*.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01X28nzmwNHfxNC8c1GnHqBM Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent a0e6810 commit 208b434

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,46 @@
2323

2424
Cross-platform: JVM, Scala.js, and Scala Native.
2525

26+
## sbt 2.x Plugins
27+
28+
Uni also ships sbt plugins for **sbt 2.x**, usable in any sbt 2.x project
29+
(with or without the uni library):
30+
31+
| Plugin | Description |
32+
|--------|-------------|
33+
| [`sbt-uni`](https://wvlet.org/uni/build/sbt-uni) | Type-safe HTTP/RPC client generation from service traits, plus `~uniRestart` — background fork-run on every code change (an sbt 2.x port of sbt-revolver's `reStart`) |
34+
| [`sbt-uni-crossproject`](https://wvlet.org/uni/build/sbt-uni-crossproject) | `crossProject(...)` for building one source tree for JVM, Scala.js, and Scala Native — a single-plugin replacement for portable-scala's `sbt-crossproject`, which is not available for sbt 2.x |
35+
| [`sbt-uni-playwright`](https://wvlet.org/uni/build/sbt-uni-playwright) | Run Scala.js tests in a real headless browser (Chromium, Firefox, or WebKit) via Playwright — ES module support and a faithful DOM, with no Node.js installation required |
36+
37+
Add the ones you need to `project/plugins.sbt`:
38+
39+
```scala
40+
// HTTP/RPC client generation + background fork-run (~uniRestart)
41+
addSbtPlugin("org.wvlet.uni" % "sbt-uni" % "<version>")
42+
43+
// Cross-build one source tree for JVM, Scala.js, and Scala Native
44+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.22.0")
45+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.12")
46+
addSbtPlugin("org.wvlet.uni" % "sbt-uni-crossproject" % "<version>")
47+
48+
// Run Scala.js tests in a real browser
49+
addSbtPlugin("org.wvlet.uni" % "sbt-uni-playwright" % "<version>")
50+
```
51+
52+
For example, `sbt-uni-crossproject` defines cross-platform projects with
53+
shared sources in `src/` and platform-specific code in `.jvm/`, `.js/`,
54+
and `.native/` folders:
55+
56+
```scala
57+
lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
58+
.crossType(CrossType.Pure)
59+
.in(file("core"))
60+
.settings(/* shared settings */)
61+
```
62+
63+
See the [build plugin docs](https://wvlet.org/uni/build/sbt-uni) for
64+
details.
65+
2666
## Using `uni`
2767

2868
Add the dependency to your `build.sbt` (replace `<version>` with the

0 commit comments

Comments
 (0)