Skip to content

Commit a8a369c

Browse files
authored
chore: update pg-protocol to version 1.13.2 and improve build process (#35)
- Bump version of @supabase/pg-protocol to 1.13.2. - Replace npm with yarn for package installation in the CI workflow to avoid issues with stale build artifacts. - Add a clean script to remove stale build files before building the package, ensuring a clean rebuild. - Remove obsolete tsconfig.tsbuildinfo file to prevent potential build issues.
1 parent 5ff8c5d commit a8a369c

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/deploy-pg-protocol.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,18 @@ jobs:
4545
# walking up to the workspace root package.json. Without it, npm
4646
# tries to resolve every workspace package's deps and trips on
4747
# the unpublished `@supabase/pg-protocol@^X.Y.Z` alias in pg.
48-
run: npm install --no-package-lock --no-audit --no-fund --workspaces=false --prefix .
48+
# --ignore-scripts skips lifecycle hooks (we run build explicitly
49+
# below) so a stale tsbuildinfo can never produce an empty dist/.
50+
run: yarn install --no-package-lock --no-audit --no-fund --workspaces=false --ignore-scripts --prefix .
4951

50-
- name: Build package
51-
run: npm run build
52+
- name: Build package (clean rebuild)
53+
# `npm run build` triggers `prebuild` which removes any stale
54+
# `dist/` and `tsconfig.tsbuildinfo`. Without the clean step a
55+
# checked-in tsbuildinfo (or one left by a previous run) would
56+
# make `tsc --incremental` exit successfully with zero output —
57+
# producing a broken tarball with no compiled code. See the
58+
# 1.13.1 incident.
59+
run: yarn run build
5260

5361
# Ensure npm 11.5.1 or later is installed for trusted publishing support
5462
- name: Update npm

packages/pg-protocol/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@supabase/pg-protocol",
3-
"version": "1.13.1",
3+
"version": "1.13.2",
44
"description": "The postgres client/server binary protocol, implemented in TypeScript",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -26,6 +26,8 @@
2626
},
2727
"scripts": {
2828
"test": "mocha dist/**/*.test.js",
29+
"clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true});require('fs').rmSync('tsconfig.tsbuildinfo',{force:true})\"",
30+
"prebuild": "npm run clean",
2931
"build": "tsc",
3032
"build:watch": "tsc --watch",
3133
"prepublish": "yarn build",

0 commit comments

Comments
 (0)