You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sbt riddlLibJS/npmPublishGithub # Publish to GH Packages
120
+
sbt riddlLibJS/npmPublishNpmjs # Publish to npmjs.com
120
121
```
121
122
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'`.
126
128
127
129
**Documentation**:
128
130
-`NPM_PACKAGING.md` - npm build and installation guide
129
131
-`TYPESCRIPT_API.md` - Complete TypeScript API reference
130
132
131
-
**Current version**: 1.0.1-11-47d36023 (as of Jan 2026)
133
+
**Published**: `@ossuminc/riddl-lib` on GitHub Packages npm registry
132
134
133
135
## Import vs Include
134
136
@@ -659,7 +661,7 @@ Then add to root aggregation: `.aggregate(..., mymodule, mymoduleJS, mymoduleNat
659
661
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
660
662
20.**@JSExportTopLevel incompatible with using clauses** - Don't use on case classes that have `(using PlatformContext)` in a second parameter list
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+
663
665
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
664
666
24.**riddlLib JS is ESModule** - Changed from CommonJS (`withCommonJSModule = true` removed). Package.json has `"type": "module"`. Consumers use `import { RiddlAPI } from '@ossuminc/riddl-lib'`
665
667
25.**gh auth needs write:packages for npm** - Run `gh auth refresh -s write:packages` if publishing to GH Packages npm registry
0 commit comments