chore: publish cwmsjs for production releases - #1900
Conversation
Signed-off-by: Charles Graham, SWT <charles.r.graham@usace.army.mil>
Signed-off-by: Charles Graham, SWT <charles.r.graham@usace.army.mil>
MikeNeilson
left a comment
There was a problem hiding this comment.
Looks good, but then the readme confused me.
| `[cwmsjs generator SemVer]-[CDA version/calver suffix]` | ||
|
|
||
| The Gradle build passes the CDA project version into the client package step. When running the package update script directly, set `CDA_CLIENT_VERSION_SUFFIX` or pass `--version-suffix=<version>`. | ||
| Zero-padded numeric CalVer identifiers are normalized for npm SemVer compatibility, so CDA release `2026.08.25` produces cwmsjs version `2.4.0-2026.8.25`. |
There was a problem hiding this comment.
what's the 2.4.0- for/from in this example?
There was a problem hiding this comment.
2.4.0- is the current release of the cwmsjs generator side. Not the CDA instance.
You can read about the generator version choice here:
https://github.com/USACE/cwms-data-api/blob/develop/clients/typescript/README.md#versioning
https://hydrologicengineeringcenter.github.io/cwms-data-api-client-javascript/ - listed at the top of the last release.
Here's smore more background on this choice to have this:
A while back BK and I had decided we need a version for what we decide on the generator side vs what target of CDA that version was built against.
Here are some examples on why you might want to prefix with a semVar:
-
CDA swagger spec is written such that every method would requre you to write CWMS in the function name. Version, I believe, 1 to 2 changed this so instead of
cwmsjs.getCWMSTimeSeriesyou would typecwmsjs.getTimeSeries -
The generator lets you specify what sort of writing style/naming convention you wish to have for methods/classes.
If you try to query CDA without cwmsjs you will be forced to do things like tsGroupVar["assigned-time-series"].
However, the generator we have specified to use camelCase and in turn you can then use tsGroupVar.assignedTimeSeries. The distinction here is that they both could be a dot operator if it was tsGroupVar.value == tsGroupVar["value"].
But with dashes you are forced to use the brackets/quotes to access the value in javascript.
- The backend / underlying libraries used in the generator change. Perhaps we are using ajax, but then fetch improves and we can switch to that? (Or other libraries)
Changing that in the generator but having only 2026.8.26 as the version, set to CDA, would mean we would overwrite the other version instead of having 2.4.0 vs 2.5.0.
Hope that answers your question!
Summary
cwmsjspackage setup, including CommonJS, ESM, browser bundles, and package metadatanpm releases
The public
cwmsjspackage is ready for releases. npm trusted publishing has been set up forUSACE/cwms-data-apiusingtagged-release.ymlwithnpm publishpermission and no environment restriction.Scheduled nightly builds and
-dev/-testprereleases continue to build the client but do not publish it to npm. Production tagged releases run an npm dry run before the GitHub release is created, then publish publicly with thelatesttag after the release succeeds. Workflow retries skip an already-published package version.Validation
npm packinspectioncda-gui; Vite production build and browser smoke testactionlintgit diff --check