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
{{ message }}
Repository navigation
Commit 122debd
Browse filesBrowse the repository at this point in the historyBrowse files
Report the real package version in the user agent (hscn/<version>) and release 1.5.1 (#65)
* Report the real package version in the user agent
The user agent was hscn/{CARGO_PKG_VERSION}, but napi keeps the Cargo package
version at 0.0.0, so it always sent hscn/0.0.0. build.rs now reads the version
from package.json and injects it as NPM_PKG_VERSION, and the client uses that
(hscn/<package-version>).
build.rs reads package.json directly rather than relying on a build-env var, so
the published artifacts get the correct version: the publish workflow builds each
target with 'yarn build' from a checkout whose package.json holds the release
version. Falls back to CARGO_PKG_VERSION if package.json can't be read.
* Parse package.json with serde_json and fail the build if the version is missing
Addresses review feedback: line-based parsing was brittle, and falling back to
CARGO_PKG_VERSION would silently reintroduce hscn/0.0.0. Resolve package.json via
CARGO_MANIFEST_DIR and emit rerun-if-changed before reading it (required because
napi_build's rerun-if-env-changed directives disable cargo's default rerun).
* Release 1.5.1
Bump package.json, the npm/* platform packages and the version embedded in
index.js, so the release reports hscn/1.5.1.
0 commit comments