Skip to content

Commit c9a8f3f

Browse files
committed
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.
1 parent 8b1dbc9 commit c9a8f3f

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"scripts": {
4848
"build": "tsc -p tsconfig.json",
4949
"clean": "rm -rf dist",
50-
"prepublishOnly": "pnpm run clean && pnpm run build",
50+
"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)",
5151
"test": "pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest",
5252
"test:watch": "pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest --watch"
5353
},

packages/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"build:types": "tsc -p tsconfig.build.json",
4040
"clean": "rm -rf dist",
4141
"dev": "tsc --watch",
42-
"prepublishOnly": "pnpm run clean && pnpm run build",
42+
"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)",
4343
"test": "pnpm --filter @seamless-auth/core build && pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest",
4444
"test:watch": "pnpm --filter @seamless-auth/core build && pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest --watch"
4545
},

packages/fastify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"build:types": "tsc -p tsconfig.build.json",
4040
"clean": "rm -rf dist",
4141
"dev": "tsc --watch",
42-
"prepublishOnly": "pnpm run clean && pnpm run build",
42+
"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)",
4343
"test": "pnpm --filter @seamless-auth/core build && pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest",
4444
"test:watch": "pnpm --filter @seamless-auth/core build && pnpm run build && NODE_OPTIONS=--experimental-vm-modules jest --watch"
4545
},

0 commit comments

Comments
 (0)