From 39150fe6d077c8ab76d5292d02188e997cec96c4 Mon Sep 17 00:00:00 2001 From: Brandon Corbett Date: Thu, 30 Jul 2026 00:48:05 -0400 Subject: [PATCH] fix(release): stop the publish hooks from racing each other changeset publish runs every package concurrently, so each package's prepublishOnly ran rm -rf dist followed by a rebuild at the same time. core deleted its own dist while the fastify adapter was type checking against it, failing build:types with TS2307 and blocking @seamless-auth/fastify from publishing. release:stable already runs pnpm build in topological order before changeset publish, so the per-package rebuild was redundant. Replace it with a check that the dist output exists, which also keeps a publish from silently shipping a tarball with no dist. --- packages/core/package.json | 2 +- packages/express/package.json | 2 +- packages/fastify/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index f86d7da..c82fa15 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "scripts": { "build": "tsc -p tsconfig.json", "clean": "rm -rf dist", - "prepublishOnly": "pnpm run clean && pnpm run build", + "prepublishOnly": "test -f dist/index.js && test -f dist/index.d.ts || (echo 'dist is missing build output; run pnpm build before publishing' >&2 && exit 1)", "test": "pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest", "test:watch": "pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest --watch" }, diff --git a/packages/express/package.json b/packages/express/package.json index ff022b4..8a7df2c 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -39,7 +39,7 @@ "build:types": "tsc -p tsconfig.build.json", "clean": "rm -rf dist", "dev": "tsc --watch", - "prepublishOnly": "pnpm run clean && pnpm run build", + "prepublishOnly": "test -f dist/index.js && test -f dist/index.d.ts || (echo 'dist is missing build output; run pnpm build before publishing' >&2 && exit 1)", "test": "pnpm --filter @seamless-auth/core build && pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest", "test:watch": "pnpm --filter @seamless-auth/core build && pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest --watch" }, diff --git a/packages/fastify/package.json b/packages/fastify/package.json index 86840a6..405f3b3 100644 --- a/packages/fastify/package.json +++ b/packages/fastify/package.json @@ -39,7 +39,7 @@ "build:types": "tsc -p tsconfig.build.json", "clean": "rm -rf dist", "dev": "tsc --watch", - "prepublishOnly": "pnpm run clean && pnpm run build", + "prepublishOnly": "test -f dist/index.js && test -f dist/index.d.ts || (echo 'dist is missing build output; run pnpm build before publishing' >&2 && exit 1)", "test": "pnpm --filter @seamless-auth/core build && pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest", "test:watch": "pnpm --filter @seamless-auth/core build && pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest --watch" },