@@ -134,14 +134,14 @@ esm.sh). Two entry points are available:
134134| ` …/jsonstat.js ` | ** High-level facade** — ` JSONstat() ` toolkit function with automatic one-time init (recommended) |
135135| ` …/jsonstat_wasm.js ` | ** Low-level glue** — raw ` JSONstat ` class + ` init() ` you call yourself |
136136
137- Always ** pin the version** (here ` 0.1.0 ` , matching ` Cargo.toml ` / ` package.json ` ).
137+ Always ** pin the version** (here ` 0.1.1 ` , matching ` Cargo.toml ` / ` package.json ` ).
138138
139139#### High-level facade (recommended)
140140
141141``` html
142142<script type =" module" >
143143 import { JSONstat }
144- from ' https://cdn.jsdelivr.net/npm/jsonstat-wasm@0.1.0 /jsonstat.js' ;
144+ from ' https://cdn.jsdelivr.net/npm/jsonstat-wasm@0.1.1 /jsonstat.js' ;
145145
146146 // No init() needed — the facade initializes the WASM module exactly once
147147 // on first import and gates every call behind that shared promise.
@@ -158,7 +158,7 @@ at the exact `.js` file the binary is fetched automatically:
158158
159159``` js
160160import init, { JSONstat , init_panic_hook }
161- from ' https://cdn.jsdelivr.net/npm/jsonstat-wasm@0.1.0 /jsonstat_wasm.js' ;
161+ from ' https://cdn.jsdelivr.net/npm/jsonstat-wasm@0.1.1 /jsonstat_wasm.js' ;
162162
163163await init (); // .wasm resolved via import.meta.url ✅
164164init_panic_hook ();
@@ -171,9 +171,9 @@ case pass the binary URL directly to `init()`, which accepts a
171171` string ` / ` URL ` / ` Request ` :
172172
173173``` js
174- import init , { JSONstat } from ' https://esm.sh/jsonstat-wasm@0.1.0 /glue' ;
174+ import init , { JSONstat } from ' https://esm.sh/jsonstat-wasm@0.1.1 /glue' ;
175175
176- await init (' https://esm.sh/jsonstat-wasm@0.1.0 /jsonstat_wasm_bg.wasm' );
176+ await init (' https://esm.sh/jsonstat-wasm@0.1.1 /jsonstat_wasm_bg.wasm' );
177177const ds = new JSONstat (jsonStr);
178178```
179179
@@ -254,3 +254,40 @@ cargo test
254254# Rust unit tests (WASM target)
255255wasm-pack test --node
256256```
257+
258+ ## Releasing & Publishing
259+
260+ Releases are tag-driven and fully automated. Pushing a ` v<version> ` tag triggers
261+ [ ` .github/workflows/release.yml ` ] ( ../.github/workflows/release.yml ) , which
262+ rebuilds the package, verifies the tag matches ` Cargo.toml ` , runs the test and
263+ type-check gates, ** publishes the patched ` pkg/ ` to npm** , and ** creates the
264+ GitHub Release** .
265+
266+ ### One-time setup
267+
268+ Add an npm ** automation** access token as a repository secret so the workflow
269+ can publish:
270+
271+ 1 . Create the token at npm → ** Account → Access Tokens → Generate New Token →
272+ Automation** (it needs publish rights to ` jsonstat-wasm ` ).
273+ 2 . In GitHub: ** Settings → Secrets and variables → Actions → New repository
274+ secret** , name it ` NPM_TOKEN ` , and paste the token.
275+
276+ > The workflow publishes with [ npm provenance] ( https://docs.npmjs.com/generating-provenance-statements )
277+ > (` --provenance ` ), which relies on the ` id-token: write ` permission already
278+ > declared in the workflow. Drop the ` --provenance ` flag if you don't want it.
279+
280+ ### Cutting a release
281+
282+ 1 . Bump the version in [ ` Cargo.toml ` ] ( ../Cargo.toml ) (and update any pinned
283+ ` @<version> ` CDN references), then commit and push to ` main ` .
284+ 2 . Run the release helper from a clean tree on ` main ` :
285+
286+ ``` bash
287+ ./scripts/release.sh # tags v<version> and pushes it
288+ ./scripts/release.sh --dry-run # preview without tagging
289+ ```
290+
291+ The script validates the working tree, builds locally as a sanity check,
292+ then creates and pushes the annotated ` v<version> ` tag. The push is what
293+ triggers the publish workflow above — no manual ` npm publish ` needed.
0 commit comments