|
2 | 2 |
|
3 | 3 | ## Current Status |
4 | 4 |
|
5 | | -**Version 1.2.5 released.** Fixed CI scripted tests and AKKA_REPO_TOKEN |
6 | | -propagation. All 16 scripted tests now pass in CI. |
7 | | - |
8 | | -**Active branch: feature/docker-dual** - Adding dual Docker image support |
9 | | -(dev/prod) for RIDDL services deployment to GKE. |
| 5 | +**Version 1.3.0 released** (Feb 2026). Packaging infrastructure complete. |
| 6 | + |
| 7 | +Previous release: v1.2.5 (Jan 2026). |
| 8 | + |
| 9 | +### Resolved Design Questions |
| 10 | + |
| 11 | +1. **Scala.js optimization task**: Use `fullOptJS` (applies Google Closure |
| 12 | + Compiler optimization). NOT `fullLinkJS` — the plan's original |
| 13 | + recommendation was incorrect; `fullOptJS` is not deprecated and produces |
| 14 | + the optimized output needed for npm packaging. |
| 15 | + |
| 16 | +2. **Homebrew formula variants**: Support both JVM universal and Native |
| 17 | + binary variants via a `variant` parameter (`"universal"` or `"native"`). |
| 18 | + |
| 19 | +3. **Linux tar.gz architecture**: Auto-detect host OS and architecture as |
| 20 | + default (since Scala Native can only compile for the host platform), |
| 21 | + with optional `arch` and `os` parameter overrides. Multi-arch |
| 22 | + distribution requires CI matrix runners for each target platform. |
| 23 | + |
| 24 | +### Implementation Phases |
| 25 | + |
| 26 | +| Phase | Feature | Status | |
| 27 | +|-------|---------|--------| |
| 28 | +| 1 | NpmPackaging (`npmPrepare`, `npmPack`) | ✅ DONE | |
| 29 | +| 2 | NpmPublishing (`npmPublish*` tasks) | ✅ DONE | |
| 30 | +| 3 | Linux tar.gz packaging | ✅ DONE | |
| 31 | +| 4 | Homebrew formula generation | ✅ DONE | |
| 32 | +| 5 | Windows MSI placeholder | ✅ DONE | |
| 33 | +| 6 | Documentation & Release (tag 1.3.0) | ✅ DONE | |
| 34 | + |
| 35 | +### Session Feb 3, 2026 — v1.3.0 Released |
| 36 | + |
| 37 | +All 6 phases of the packaging plan implemented and released. |
| 38 | +Integration-tested in riddl project (npm packaging/publishing to |
| 39 | +npmjs.com for ossum.ai site consumption). |
| 40 | + |
| 41 | +**New files created:** |
| 42 | +- `NpmPackaging.scala` — Keys, `npm()` method, `npmPrepare`/`npmPack` |
| 43 | + tasks, template mode with `VERSION_PLACEHOLDER`, TypeScript defs |
| 44 | + convention (`js/types/index.d.ts`), JSON generation via string builder |
| 45 | +- `NpmPublishing.scala` — `npmPublish`, `npmPublishNpmjs`, |
| 46 | + `npmPublishGithub` tasks, auth via env vars (`NPM_TOKEN`, |
| 47 | + `GITHUB_TOKEN`), extracted helper methods to avoid sbt `.value` macro |
| 48 | + restrictions inside lambdas |
| 49 | +- `HomebrewPackaging.scala` — `homebrewGenerate` task, supports |
| 50 | + `"universal"` (JVM with openjdk dep) and `"native"` (Scala Native) |
| 51 | + variants, SHA256 from local artifact, Ruby class name generation, |
| 52 | + uses `Def.task` variant selection at build-definition time to avoid |
| 53 | + sbt macro restrictions |
| 54 | + |
| 55 | +**Modified files:** |
| 56 | +- `Packaging.scala` — Added delegation methods `npm()`, `homebrew()`, |
| 57 | + `linux()`, `windowsMsi()` (placeholder); added `linuxPackage`, |
| 58 | + `linuxPackageArch`, `linuxPackageOs` keys; added `detectArch`, |
| 59 | + `detectOs` private helpers; imported Scala Native `nativeLink` |
| 60 | +- `Publishing.scala` — Added `npm()` delegation method |
| 61 | + |
| 62 | +**New scripted tests (20 total now):** |
| 63 | +- `npm-packaging` — Verifies `npmPrepare` produces `package.json`, |
| 64 | + `main.js`, `README.md` with correct content assertions |
| 65 | +- `linux-packaging` — Verifies config settings (doesn't link; consistent |
| 66 | + with existing `native` test pattern) |
| 67 | +- `homebrew` — Runs `homebrewGenerate` on a `Program`, verifies formula |
| 68 | + contains class name, description, homepage, JDK dep, license, SHA256 |
| 69 | + |
| 70 | +**Technical lessons learned:** |
| 71 | +- sbt `.value` is a macro — ALL `.value` calls in a task body are |
| 72 | + resolved regardless of runtime control flow (match/if/foreach). Must |
| 73 | + either extract to helper methods (NpmPublishing) or use `Def.task` |
| 74 | + variant selection at build-definition time (HomebrewPackaging). |
| 75 | +- `fullOptJS` is NOT deprecated; it applies Google Closure Compiler |
| 76 | + optimization needed for production npm packages. |
10 | 77 |
|
11 | 78 | ## Work Completed (Recent) |
12 | 79 |
|
@@ -268,28 +335,32 @@ Run scripted tests on every PR. Skip Akka test in CI (requires credentials). |
268 | 335 |
|
269 | 336 | ## Test Coverage Status |
270 | 337 |
|
271 | | -### Current Test Results (Jan 29, 2026) |
272 | | - |
273 | | -| Test Scenario | Purpose | Status | |
274 | | -|----------------|-------------------------------|---------------------------| |
275 | | -| akka | Akka dependencies | ✅ PASS | |
276 | | -| asciidoc | AsciiDoc document generation | ✅ PASS | |
277 | | -| basic | Basic module configuration | ✅ PASS | |
278 | | -| cross | Cross-platform (JVM/JS/Native)| ✅ PASS | |
279 | | -| everything | Full feature set | ✅ PASS | |
280 | | -| idea-plugin | IntelliJ plugin development | ✅ PASS | |
281 | | -| laminar | Laminar UI dependencies | ✅ PASS | |
282 | | -| mima | Binary compatibility checking | ✅ PASS | |
283 | | -| multi | Multi-module projects | ✅ PASS | |
284 | | -| native | Scala Native compilation | ✅ PASS | |
285 | | -| packaging | Universal packaging | ✅ PASS | |
286 | | -| program | Executable programs | ✅ PASS | |
287 | | -| publishing | Publishing helper (new) | ✅ PASS | |
288 | | -| scalably-typed | TypeScript facades | ✅ PASS | |
289 | | -| scalajs | Scala.js compilation | ✅ PASS | |
290 | | -| scalatest | Scalatest helper (new) | ✅ PASS | |
291 | | - |
292 | | -**Pass rate:** 16/16 (100%) |
| 338 | +### Current Test Results (Feb 3, 2026) |
| 339 | + |
| 340 | +| Test Scenario | Purpose | Status | |
| 341 | +|------------------|--------------------------------|----------| |
| 342 | +| akka | Akka dependencies | ✅ PASS | |
| 343 | +| asciidoc | AsciiDoc document generation | ✅ PASS | |
| 344 | +| basic | Basic module configuration | ✅ PASS | |
| 345 | +| cross | Cross-platform (JVM/JS/Native) | ✅ PASS | |
| 346 | +| docker-dual | Dev/prod Docker images | ✅ PASS | |
| 347 | +| everything | Full feature set | ✅ PASS | |
| 348 | +| homebrew | Homebrew formula generation | ✅ PASS | |
| 349 | +| idea-plugin | IntelliJ plugin development | ✅ PASS | |
| 350 | +| laminar | Laminar UI dependencies | ✅ PASS | |
| 351 | +| linux-packaging | Native binary tar.gz archive | ✅ PASS | |
| 352 | +| mima | Binary compatibility checking | ✅ PASS | |
| 353 | +| multi | Multi-module projects | ✅ PASS | |
| 354 | +| native | Scala Native compilation | ✅ PASS | |
| 355 | +| npm-packaging | npm package assembly | ✅ PASS | |
| 356 | +| packaging | Universal packaging | ✅ PASS | |
| 357 | +| program | Executable programs | ✅ PASS | |
| 358 | +| publishing | Publishing helper | ✅ PASS | |
| 359 | +| scalably-typed | TypeScript facades | ✅ PASS | |
| 360 | +| scalajs | Scala.js compilation | ✅ PASS | |
| 361 | +| scalatest | Scalatest helper | ✅ PASS | |
| 362 | + |
| 363 | +**Pass rate:** 20/20 (100%) |
293 | 364 |
|
294 | 365 | ### Missing Test Coverage |
295 | 366 |
|
@@ -351,6 +422,11 @@ Create `examples/` with working `build.sbt` files: |
351 | 422 |
|
352 | 423 | | Decision | Rationale | Date | |
353 | 424 | |----------|-----------|------| |
| 425 | +| Delegation pattern for new helpers | Keeps API at `With.Packaging.npm()` not `With.NpmPackaging` | 2026-02-03 | |
| 426 | +| `fullOptJS` for npm packaging | Closure Compiler optimization needed; not deprecated | 2026-02-03 | |
| 427 | +| `Def.task` for variant selection | sbt `.value` macro resolves all refs in task body | 2026-02-03 | |
| 428 | +| Auto-detect OS/arch for linux() | Scala Native compiles for host only; CI matrix for multi-arch | 2026-02-03 | |
| 429 | +| No JSON library for package.json | Avoids dependency; string builder sufficient for Scala 2.12 | 2026-02-03 | |
354 | 430 | | Switch Sonatype → GitHub Packages | Simpler auth for ossuminc org | 2026-01-15 | |
355 | 431 | | Use symlink approach | Consistent with project/ pattern | 2026-01-15 | |
356 | 432 | | Rename With.Javascript → With.ScalaJS | Clearer naming | 2026-01-15 | |
|
0 commit comments