@javierfrancoleal/plugin-authoring 1.0.2 → 1.0.4

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.
@@ -230,10 +230,17 @@ async function apply(ctx) {
230
230
  3. New bundles are NOT picked up by HMR on external edits — restart the app.
231
231
  4. `dsh.bundle.patch` + `dsh.client` can coexist (dual-face).
232
232
  5. React / slots / primitives are baseline; don't list them in `dsh.client.inject`.
233
- 6. **Bundle URLs are revisioned**: the real form is
234
- `/plugins/??<id>/client.js&rev=<sha1(mtime:ctime:size)[0:12]>`; the bare
235
- `/plugins/<id>/client.js` **always 404s**. Get the `rev` from the root HTML.
233
+ 6. **Bundle URLs are revisioned**: `/plugins/??<id>/client.js&rev=<rev>`; the bare
234
+ `/plugins/<id>/client.js` **always 404s**. Derive `rev` LOCALLY (no need to
235
+ scrape the HTML, which requires auth): sha1 over
236
+ `"plugin-artifact\0" + "<len>:mtimeMs" + "<len>:ctimeMs" + "<len>:size"`
237
+ (file stats of `lib/client.js`), first 12 hex chars — see the checklist.
238
+ The `/plugins` endpoint needs **no auth**.
236
239
  7. **The app may change port after a restart** — re-read the advertised URL.
240
+ 8. **First publish of a NEW package gets a `0.0.0-stage` placeholder** — that's
241
+ npm's staged publishing (registry feature, GA 2026), not a bug in your scripts
242
+ or in pnpm/npm. The real version lands ~1 min later on its own. Mitigation:
243
+ deprecate the placeholder; `publish.sh` / `sync-all.sh` now do it automatically.
237
244
 
238
245
  ## Validation checklist
239
246
 
@@ -241,8 +248,8 @@ async function apply(ctx) {
241
248
  node --check lib/index.js && node --check lib/client.js
242
249
  node tools/check-client.mjs lib/client.js
243
250
  dsh --profile testprices --dump-config | grep mi-plugin # throwaway profile, not desktop
244
- curl -sS http://127.0.0.1:<puerto>/ | grep -o "mi-plugin/client[^\"']*" # find your rev
245
- curl -sS "http://127.0.0.1:<puerto>/plugins/??@scope/mi-plugin/client.js&rev=<rev>" # 200
251
+ REV=$(node -e 'const fs=require("fs"),crypto=require("crypto");const st=fs.statSync("lib/client.js");const h=crypto.createHash("sha1").update("plugin-artifact").update("\0");for(const p of [String(st.mtimeMs),String(st.ctimeMs),String(st.size)])h.update(String(Buffer.byteLength(p))+":").update(p);console.log(h.digest("hex").slice(0,12))')
252
+ curl -sS "http://127.0.0.1:<puerto>/plugins/??@scope/mi-plugin/client.js&rev=$REV" # 200 (no auth needed)
246
253
  ```
247
254
 
248
255
  Full reference: `docs/PLUGIN-AUTHORING.md`. Template: `templates/dsh-plugin/`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@javierfrancoleal/plugin-authoring",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Plugin-authoring skill for DeepSeek Harness: the distilled anatomy, client-UI recipe, slots, locale, theme tokens, install steps, gotchas, and validation checklist for building and publishing new DSH plugins.",
5
5
  "author": "J.Franco",
6
6
  "license": "MIT",