Skip to content

Commit 4200e14

Browse files
reid-spencerclaude
andcommitted
Update CLAUDE.md and NOTEBOOK.md for 1.13.x releases
Document sbt-riddl rewrite, ANSI version parsing fix, direct command invocation, and related learnings from 1.13.0/1.13.1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f691859 commit 4200e14

2 files changed

Lines changed: 87 additions & 8 deletions

File tree

CLAUDE.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,8 @@ Then add to root aggregation: `.aggregate(..., mymodule, mymoduleJS, mymoduleNat
829829
ARM64. Removing `inline` fixes it; the compiler optimizes
830830
trivial delegations anyway. Filed as
831831
https://github.com/scala/scala3/issues/25306
832-
66. **Current release is 1.12.1**Patch release fixing
833-
prettify formatting regressions. Supersedes 1.12.0
832+
66. **Current release is 1.13.1**sbt-riddl bugfix release.
833+
Supersedes 1.13.0 (sbt-riddl rewrite)
834834
67. **PrettifyPass multi-file mode**`PrettifyPass.Options`
835835
now carries `topFile`, `outputDir`, and `flatten`. When
836836
`flatten=false` (the new default), prettify preserves
@@ -852,11 +852,8 @@ Then add to root aggregation: `.aggregate(..., mymodule, mymoduleJS, mymoduleNat
852852
(hugo-theme-learn, redislabs-docs, hugo-theme-docdock)
853853
were causing warnings on `git pull`. No submodule paths
854854
were tracked in the tree; only `.gitmodules` remained
855-
71. **Current release is 1.12.1** — Patch release fixing three
856-
prettify formatting regressions from 1.12.0: removed
857-
commas between aggregate fields, kept `} with {` on same
858-
line for types with metadata, preserved relative include
859-
paths. Supersedes 1.12.0
855+
71. **Current release is 1.13.1** — sbt-riddl ANSI fix and
856+
direct command invocation. Supersedes 1.13.0
860857
72. **RiddlFileEmitter.trimTrailingNewline()** — Removes a
861858
trailing newline from the StringBuilder. Used in
862859
`closeType` to join `}` from `emitFields` with ` with {`
@@ -867,3 +864,30 @@ Then add to root aggregation: `.aggregate(..., mymodule, mymoduleJS, mymoduleNat
867864
instead of `url.toExternalForm` (absolute `file:///`
868865
URL). This preserves the original include path as written
869866
in the source model
867+
74. **sbt-riddl rewritten with auto-download** — Plugin at
868+
`sbt-riddl/src/.../RiddlSbtPlugin.scala` now auto-downloads
869+
riddlc from GitHub releases, caches in
870+
`~/.cache/riddlc/<version>/`. Three-tier resolution:
871+
explicit path > download > PATH. Full command set:
872+
validate, parse, bastify, prettify, info, version. Batch
873+
.conf scanning with `riddlcSourceDir`/`riddlcConfExclusions`.
874+
Pre-compile hook via `riddlcValidateOnCompile`. Curried
875+
`riddlc()` helper for one-line project config
876+
75. **sbt plugin visibility: private[plugin]** — In sbt
877+
plugins (Scala 2.12), `private def` methods appear unused
878+
to the compiler because sbt macro-generated task bodies
879+
(`:=`) reference them indirectly. Use `private[plugin] def`
880+
to avoid "private method never used" errors
881+
76. **riddlc commands don't need `from <conf>`** — Individual
882+
commands like `riddlc validate file.riddl` work directly.
883+
The `from` command is only needed to load a full HOCON
884+
config. The sbt-riddl plugin extracts `input-file` from
885+
.conf files and invokes commands directly
886+
77. **riddlc version emits ANSI codes** — Output includes
887+
`\u001b[34m\u001b[1m[info] 1.13.0\u001b[0m`. Use
888+
`--no-ansi-messages` flag and strip residual ANSI/`[info]`
889+
with regex before version parsing
890+
78. **Scripted tests need pinned riddlcVersion** — Between
891+
releases, sbt-dynver produces snapshot versions like
892+
`1.13.0-2-hash-date` which don't exist on GitHub. Pin
893+
`riddlcVersion := "1.13.1"` in scripted test build.sbt

NOTEBOOK.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,47 @@ to the task file and note completion in this notebook.
1515

1616
## Current Status
1717

18-
**Last Updated**: February 19, 2026
18+
**Last Updated**: February 21, 2026
19+
20+
### Release 1.13.1 Published (Feb 21, 2026)
21+
22+
Bugfix patch for sbt-riddl plugin:
23+
- Fixed `checkVersion()` ANSI parsing — `riddlc version`
24+
emits ANSI color codes causing `NumberFormatException`.
25+
Added `--no-ansi-messages` flag and ANSI/`[info]` stripping
26+
- Changed all tasks (validate, parse, bastify, prettify) to
27+
use direct riddlc commands instead of `from <conf>` wrapper.
28+
Only the `from` command needs a `.conf` file; individual
29+
commands like `riddlc validate file.riddl` work directly
30+
31+
### Release 1.13.0 Published (Feb 21, 2026)
32+
33+
Complete rewrite of `sbt-riddl` plugin (`RiddlSbtPlugin.scala`)
34+
from a minimal 4-command wrapper (~219 lines) to a full-featured
35+
plugin (~620 lines) with:
36+
- **Auto-download**: Downloads riddlc from GitHub releases,
37+
cached in `~/.cache/riddlc/<version>/`. Platform detection
38+
for macOS ARM64, Linux x86_64, JVM universal fallback
39+
- **Three-tier binary resolution**: explicit path > download >
40+
PATH fallback
41+
- **Full command set**: validate, parse, bastify, prettify,
42+
info, version (removed stale `hugo` command)
43+
- **Batch operations**: Scans `riddlcSourceDir` for `.conf`
44+
files, runs operation on each, reports pass/fail per model
45+
- **Pre-compile validation**: `riddlcValidateOnCompile` setting
46+
(default true) hooks into `Compile / compile`
47+
- **`riddlc()` curried helper**: One-line project configuration
48+
via `.configure(riddlc(version = "1.13.1"))`
49+
- **Version checking**: Validates riddlc version meets minimum
50+
51+
Key learnings:
52+
- `private def` in sbt plugins must be `private[plugin]`
53+
because Scala 2.12 can't see usage through sbt macro-
54+
generated task bodies (`:=`)
55+
- `java.nio.file.Path` shadows sbt's `Path` — avoid importing
56+
both
57+
- Scripted tests between releases must pin `riddlcVersion` to
58+
a real release tag, not the dynver snapshot
1959

2060
### Release 1.12.1 Published (Feb 19, 2026)
2161

@@ -189,6 +229,21 @@ go there, not this repo.
189229

190230
## Session Log
191231

232+
### February 21, 2026 — sbt-riddl Rewrite + Ship 1.13.0/1.13.1
233+
234+
Complete rewrite of `RiddlSbtPlugin.scala` with auto-download
235+
from GitHub releases, batch conf operations, pre-compile
236+
validation hook, and full riddlc command set. Shipped as 1.13.0.
237+
238+
Then fixed two bugs found during scripted testing:
239+
1. `checkVersion()` fails on ANSI output from `riddlc version`
240+
2. Tasks used `from <conf> <command>` which requires command
241+
blocks in the conf — switched to direct `riddlc <command>
242+
<file>` invocations
243+
244+
Shipped bugfix as 1.13.1. Upgrade task files dropped in all 8
245+
consumer projects.
246+
192247
### February 18, 2026 — Prettify Multi-File Fix + Release
193248

194249
Fixed `riddlc prettify` to retain multi-file include/import

0 commit comments

Comments
 (0)