Skip to content

Commit 744a039

Browse files
respencer-nclclaude
andcommitted
Update CLAUDE.md and NOTEBOOK.md for npm publishing completion
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e36b7a3 commit 744a039

2 files changed

Lines changed: 54 additions & 42 deletions

File tree

CLAUDE.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ RIDDL (Reactive Interface to Domain Definition Language) is a specification lang
3434

3535
### sbt-ossuminc Plugin
3636

37-
**Current version: 1.0.0** (updated Jan 2026)
37+
**Current version: 1.3.0** (updated Feb 2026)
3838

3939
#### API Changes from 0.x to 1.0.0:
4040
- `With.Javascript(...)``With.ScalaJS(...)` or `With.scalajs` (lowercase for default)
@@ -112,23 +112,25 @@ The `riddlLib` module exports a TypeScript-friendly API via `RiddlAPI` object.
112112
- Case classes → Plain objects
113113
- `Either``{ succeeded, value, errors }`
114114

115-
**Building npm packages** (via sbt-ossuminc helpers):
115+
**Building npm packages** (via sbt-ossuminc 1.3.0 helpers):
116116
```bash
117-
sbt riddlLibJS/npmPrepare # Assemble package (pure sbt)
118-
sbt riddlLibJS/npmPack # Create .tgz tarball
117+
sbt riddlLibJS/npmPrepare # Assemble package (pure sbt)
118+
sbt riddlLibJS/npmPack # Create .tgz tarball
119119
sbt riddlLibJS/npmPublishGithub # Publish to GH Packages
120+
sbt riddlLibJS/npmPublishNpmjs # Publish to npmjs.com
120121
```
121122

122-
**Legacy script** (still works):
123-
```bash
124-
./scripts/pack-npm-modules.sh riddlLib
125-
```
123+
**CI Workflow**: `.github/workflows/npm-publish.yml` triggers on
124+
release or manual dispatch, uses sbt tasks directly.
125+
126+
**Module format**: ESModule (`"type": "module"` in package.json).
127+
Consumers use `import { RiddlAPI } from '@ossuminc/riddl-lib'`.
126128

127129
**Documentation**:
128130
- `NPM_PACKAGING.md` - npm build and installation guide
129131
- `TYPESCRIPT_API.md` - Complete TypeScript API reference
130132

131-
**Current version**: 1.0.1-11-47d36023 (as of Jan 2026)
133+
**Published**: `@ossuminc/riddl-lib` on GitHub Packages npm registry
132134

133135
## Import vs Include
134136

@@ -659,7 +661,7 @@ Then add to root aggregation: `.aggregate(..., mymodule, mymoduleJS, mymoduleNat
659661
19. **Scala 3.7.4 default param limitation** - Case class defaults can't resolve givens from a subsequent using clause in generated apply; remove defaults or provide explicit givens
660662
20. **@JSExportTopLevel incompatible with using clauses** - Don't use on case classes that have `(using PlatformContext)` in a second parameter list
661663
21. **npm packaging uses sbt-ossuminc helpers** - `With.Packaging.npm()` assembles package, `With.Publishing.npm()` publishes. Tasks: `npmPrepare`, `npmPack`, `npmPublishGithub`
662-
22. **JS variant baseDirectory is `module/js/`** - The `npmTypesDir` convention looks for `baseDir/js/types/` which doubles to `module/js/js/types/`. Override with `.jsSettings(NpmPackaging.Keys.npmTypesDir := baseDirectory.value / "types")`
664+
22. **npmTypesDir fixed in sbt-ossuminc 1.3.0** - Earlier versions had a convention mismatch (JS variant `baseDir/js/types/` doubled to `module/js/js/types/`). No override needed with 1.3.0+
663665
23. **npm requires --tag for prerelease versions** - sbt-dynver versions like `1.2.3-1-hash` are prerelease per npm semver. Must pass `--tag dev` when publishing
664666
24. **riddlLib JS is ESModule** - Changed from CommonJS (`withCommonJSModule = true` removed). Package.json has `"type": "module"`. Consumers use `import { RiddlAPI } from '@ossuminc/riddl-lib'`
665667
25. **gh auth needs write:packages for npm** - Run `gh auth refresh -s write:packages` if publishing to GH Packages npm registry

NOTEBOOK.md

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the central engineering notebook for the RIDDL project. It tracks curren
66

77
## Current Status
88

9-
**Last Updated**: February 3, 2026 (evening)
9+
**Last Updated**: February 4, 2026
1010

1111
**Scala Version**: 3.7.4 (overrides sbt-ossuminc's 3.3.7 LTS default due to
1212
compiler infinite loop bug with opaque types/intersection types in 3.3.x).
@@ -18,9 +18,11 @@ Scala.js. Added `(using PlatformContext)` to `FileBuilder` trait and
1818
propagated through entire hierarchy. All tests pass. Published to
1919
GitHub Packages. Merged to main.
2020

21-
**npm Package Published**: `@ossuminc/riddl-lib@1.2.3-1-aef48695-20260203-2217`
22-
published to GitHub Packages npm registry. ESModule format with TypeScript
23-
declarations. Consumable via `npm install @ossuminc/riddl-lib@dev` with
21+
**npm Package Published**: `@ossuminc/riddl-lib` published to GitHub
22+
Packages npm registry via CI and locally. ESModule format with TypeScript
23+
declarations. CI workflow (`npm-publish.yml`) uses sbt-ossuminc 1.3.0
24+
tasks (`npmPublishGithub`/`npmPublishNpmjs`). Consumable via
25+
`npm install @ossuminc/riddl-lib` with
2426
`@ossuminc:registry=https://npm.pkg.github.com` in `.npmrc`.
2527

2628
**Packaging Infrastructure**: Docker, npm, and TypeScript support added:
@@ -161,53 +163,61 @@ The `pseudoCodeBlock` parser now allows comments before and/or after `???`:
161163

162164
## Session Log
163165

164-
### February 3, 2026 (npm Package Publishing to GitHub Packages)
166+
### February 3-4, 2026 (npm Package Publishing to GitHub Packages)
165167

166168
**Focus**: Publish `@ossuminc/riddl-lib` as npm package to GH Packages
167169
for consumption by Synapify and ossum.ai
168170

169171
**Key Finding**: Most infrastructure already existed (TypeScript
170172
declarations, package.json template, npm-publish.yml workflow). The
171-
sbt-ossuminc plugin (1.2.5-4) already had `With.Packaging.npm()` and
173+
sbt-ossuminc plugin already had `With.Packaging.npm()` and
172174
`With.Publishing.npm()` helpers ready to use.
173175

174176
**Work Completed**:
175-
1. Updated sbt-ossuminc to 1.2.5-4-4a8a48fb-20260203-2208
176-
(locally published version with npm packaging helpers)
177-
2. Fixed Scala.js module kind: changed from CommonJS to ESModule
177+
1. Fixed Scala.js module kind: changed from CommonJS to ESModule
178178
(`withCommonJSModule = true` removed). Package.json already
179179
declared `"type": "module"` so this resolved the mismatch.
180-
3. Wired up `With.Packaging.npm()` for riddlLibJS with scope
180+
2. Wired up `With.Packaging.npm()` for riddlLibJS with scope
181181
`@ossuminc`, keywords, and ESModule flag
182-
4. Wired up `With.Publishing.npm(registries = Seq("github"))`
183-
5. Fixed `npmTypesDir` convention mismatch: JS variant's
184-
`baseDirectory` is `riddlLib/js/`, so convention looked at
185-
`riddlLib/js/js/types/` (wrong). Overrode to
186-
`baseDirectory / "types"`.
187-
6. Removed `export default RiddlAPI` from index.d.ts (ESModule
182+
3. Wired up `With.Publishing.npm(registries = Seq("github"))`
183+
4. Removed `export default RiddlAPI` from index.d.ts (ESModule
188184
uses named exports only)
189-
7. Published `@ossuminc/riddl-lib@1.2.3-1-aef48695-20260203-2217`
190-
to GitHub Packages npm registry with `--tag dev`
191-
192-
**Issues Encountered**:
185+
5. Published `@ossuminc/riddl-lib` locally to GitHub Packages
186+
npm registry with `--tag dev`
187+
6. Simplified `.github/workflows/npm-publish.yml` — replaced
188+
~150 lines of custom shell scripting with sbt task calls
189+
(`riddlLibJS/npmPublishGithub`, `riddlLibJS/npmPublishNpmjs`)
190+
7. Upgraded sbt-ossuminc to 1.3.0 (published to GH Packages,
191+
fixes npmTypesDir convention, CI-compatible)
192+
8. CI workflow verified green — "Publish to GitHub Packages"
193+
step passes end-to-end from development branch
194+
195+
**Issues Encountered & Resolved**:
193196
- npm requires `--tag` for prerelease versions (sbt-dynver format
194-
`1.2.3-1-hash-date` is a prerelease). The `NpmPublishing` helper
195-
in sbt-ossuminc needs updating to handle this automatically.
196-
- `gh auth` needed `write:packages` scope refresh for npm publishing
197-
(`gh auth refresh -s write:packages`)
197+
`1.2.3-1-hash-date` is a prerelease)
198+
- `gh auth` needed `write:packages` scope refresh for npm
199+
publishing (`gh auth refresh -s write:packages`)
200+
- CI couldn't resolve locally-published sbt-ossuminc 1.2.5-4;
201+
upgraded to published 1.3.0
202+
- sbt-ossuminc 1.3.0 also fixed the npmTypesDir convention
203+
mismatch, removing need for manual override
204+
205+
**Commits** (on development):
206+
- `c5361e87` — Add npm packaging via sbt-ossuminc and publish
207+
to GitHub Packages
208+
- `e36b7a3e` — Upgrade sbt-ossuminc to 1.3.0 for CI-compatible
209+
npm packaging
198210

199211
**Files Modified**:
200-
- `project/plugins.sbt` — sbt-ossuminc version bump
201-
- `build.sbt` — ESModule, npm packaging/publishing config, import
212+
- `project/plugins.sbt` — sbt-ossuminc 1.3.0
213+
- `build.sbt` — ESModule, npm packaging/publishing config
202214
- `riddlLib/js/types/index.d.ts` — removed default export
215+
- `.github/workflows/npm-publish.yml` — simplified to sbt tasks
203216

204-
**Next Steps**:
205-
- Simplify `.github/workflows/npm-publish.yml` to use sbt tasks
206-
- Fix sbt-ossuminc `NpmPublishing` to pass `--tag dev` for
207-
prerelease versions
217+
**Remaining**:
208218
- Test consumption from Synapify and ossum.ai
209-
- When ready for release, tag a clean version (e.g., `1.2.4`) to
210-
get a proper semver npm version
219+
- When ready for release, tag a clean version (e.g., `1.2.4`)
220+
to get a proper semver npm version
211221

212222
---
213223

0 commit comments

Comments
 (0)