From 3079d959365f8d843ba5c2772dd905e7ba879cec Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 25 Sep 2026 14:07:13 +0200 Subject: [PATCH] fix(analytics): npm publish no longer triggers a registry publish `emdash-plugin init` generated a script named `publish`. npm and pnpm run a script with that name after every publish, so the first `npm publish` would also have started `emdash-plugin publish` against the EmDash registry; a dry run did exactly that and stopped at "Not logged in". The registry commands are now `registry:publish` and `registry:login`, and `prepublishOnly` builds first so a stale dist cannot be published. AGENTS.md says why. --- AGENTS.md | 8 +++++++- packages/analytics/package.json | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index bab9cca..43766b3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -49,6 +49,12 @@ pnpm build ## Releases Versions come from changesets: add one with `pnpm changeset` for every -change to a published package, written for someone upgrading. The workspace +change to a published package, written for someone upgrading. + +Never name a package script `publish`, `version` or `prepare`: npm and pnpm +run scripts with those names on their own during a publish or a version +bump. `emdash-plugin init` generates `"publish": "emdash-plugin publish"`, +which would push to the EmDash registry after every `npm publish`; here it +is `registry:publish`, and `prepublishOnly` builds before any publish. The workspace installs with pnpm 11; `allowBuilds` in `pnpm-workspace.yaml` lets esbuild and workerd run their install scripts, which the test host needs. diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 24e58b4..c25afd2 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -44,9 +44,10 @@ "typecheck": "tsc --noEmit", "test": "emdash-plugin validate && vitest run", "bundle": "emdash-plugin bundle", - "login": "emdash-plugin login", - "publish": "emdash-plugin publish", + "registry:login": "emdash-plugin login", + "registry:publish": "emdash-plugin publish", "release:setup": "emdash-plugin release setup", + "prepublishOnly": "pnpm run build", "build:astro": "tsdown" }, "engines": {