pi-ele-picker 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +19 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -140,6 +140,25 @@ The same payload is available from the bridge directly:
140
140
  - If pi restarts while a page is open (new random port + token), the next send re-discovers the bridge and retries once automatically — no page refresh needed. The status poll does the same: a stale port flips to `offline` for one cycle, then rediscovers.
141
141
  - The bridge never auto-submits on its own: **写入pi输入框** only fills the editor; **直接发送** is an explicit user action in the page.
142
142
 
143
+ ## Releasing
144
+
145
+ Publishing is token-free: `.github/workflows/release.yml` publishes with **Trusted Publishing (OIDC)**, so `npm publish` authenticates through a short-lived OIDC token minted by GitHub Actions and provenance is attached automatically.
146
+
147
+ One-time setup (needs an interactive 2FA challenge, so it cannot be automated):
148
+
149
+ 1. npmjs.com → **Packages → pi-ele-picker → Settings → Trusted publishing** → *GitHub Actions*.
150
+ 2. Fill in **Organization or user** `Himangguo`, **Repository** `pi-ele-picker`, **Workflow filename** `release.yml` (filename only, must match exactly), leave **Environment name** empty.
151
+ 3. Under **Allowed actions**, enable **`npm publish`** — the default is `npm stage publish` only, and a direct `npm publish` from CI is refused without this.
152
+
153
+ Then, for every release:
154
+
155
+ ```sh
156
+ npm version <x.y.z> # commits package.json + package-lock.json and tags vX.Y.Z
157
+ git push origin main --follow-tags # the tag push triggers the Release workflow
158
+ ```
159
+
160
+ The workflow re-runs `typecheck` and `build` before publishing, and can also be triggered by hand from the **Actions** tab (its `workflow_dispatch` trigger) to re-release an existing tag.
161
+
143
162
  ## License
144
163
 
145
164
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ele-picker",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Pick an element in your running page, describe the change, and send it to a pi session. Ships a Vite dev plugin (browser picker + discovery endpoint) and the matching pi bridge extension.",
5
5
  "type": "module",
6
6
  "license": "MIT",