pgserve 2.1.3 → 2.2.1

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.
Files changed (235) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/README.md +105 -1
  3. package/bin/autopg-wrapper.cjs +16 -0
  4. package/bin/pgserve-wrapper.cjs +32 -6
  5. package/bin/postgres-server.js +56 -0
  6. package/console/README.md +131 -0
  7. package/console/api.js +173 -0
  8. package/console/app.jsx +483 -0
  9. package/console/colors_and_type.css +227 -0
  10. package/console/components.jsx +167 -0
  11. package/console/console.css +1666 -0
  12. package/console/data.jsx +350 -0
  13. package/console/index.html +31 -0
  14. package/console/screens/databases.jsx +5 -0
  15. package/console/screens/health.jsx +5 -0
  16. package/console/screens/ingress.jsx +5 -0
  17. package/console/screens/optimizer.jsx +5 -0
  18. package/console/screens/rlm-sim.jsx +5 -0
  19. package/console/screens/rlm-trace.jsx +5 -0
  20. package/console/screens/security.jsx +5 -0
  21. package/console/screens/settings.jsx +611 -0
  22. package/console/screens/sql.jsx +5 -0
  23. package/console/screens/sync.jsx +5 -0
  24. package/console/screens/tables.jsx +5 -0
  25. package/console/tweaks-panel.jsx +425 -0
  26. package/package.json +14 -2
  27. package/scripts/postinstall.cjs +60 -0
  28. package/src/cli-config.cjs +310 -0
  29. package/src/cli-install.cjs +112 -11
  30. package/src/cli-restart.cjs +228 -0
  31. package/src/cli-ui.cjs +580 -0
  32. package/src/cluster.js +43 -38
  33. package/src/postgres.js +141 -19
  34. package/src/settings-loader.cjs +235 -0
  35. package/src/settings-migrate.cjs +212 -0
  36. package/src/settings-pg-args.cjs +146 -0
  37. package/src/settings-schema.cjs +422 -0
  38. package/src/settings-validator.cjs +416 -0
  39. package/src/settings-writer.cjs +288 -0
  40. package/src/upgrade/index.js +65 -0
  41. package/src/upgrade/runner.js +23 -0
  42. package/src/upgrade/steps/binary-cache-flush.js +67 -0
  43. package/src/upgrade/steps/consumer-signal.js +40 -0
  44. package/src/upgrade/steps/env-refresh.js +89 -0
  45. package/src/upgrade/steps/health-validate.js +53 -0
  46. package/src/upgrade/steps/plpgsql-resolve.js +66 -0
  47. package/src/upgrade/steps/port-reconcile.js +52 -0
  48. package/.claude/context/windows-debug.md +0 -119
  49. package/.genie/AGENTS.md +0 -15
  50. package/.genie/agents/README.md +0 -110
  51. package/.genie/agents/analyze.md +0 -176
  52. package/.genie/agents/forge.md +0 -290
  53. package/.genie/agents/garbage-cleaner.md +0 -324
  54. package/.genie/agents/garbage-collector.md +0 -596
  55. package/.genie/agents/github-issue-gc.md +0 -618
  56. package/.genie/agents/review.md +0 -380
  57. package/.genie/agents/semantic-analyzer/find-duplicates.md +0 -90
  58. package/.genie/agents/semantic-analyzer/find-orphans.md +0 -99
  59. package/.genie/agents/semantic-analyzer.md +0 -101
  60. package/.genie/agents/update.md +0 -182
  61. package/.genie/agents/wish.md +0 -357
  62. package/.genie/brainstorms/pgserve-v2/DESIGN.md +0 -174
  63. package/.genie/code/AGENTS.md +0 -694
  64. package/.genie/code/agents/audit/risk.md +0 -173
  65. package/.genie/code/agents/audit/security.md +0 -189
  66. package/.genie/code/agents/audit.md +0 -145
  67. package/.genie/code/agents/challenge.md +0 -230
  68. package/.genie/code/agents/change-reviewer.md +0 -295
  69. package/.genie/code/agents/code-garbage-collector.md +0 -425
  70. package/.genie/code/agents/code-quality.md +0 -410
  71. package/.genie/code/agents/commit-suggester.md +0 -255
  72. package/.genie/code/agents/commit.md +0 -124
  73. package/.genie/code/agents/consensus.md +0 -204
  74. package/.genie/code/agents/daily-standup.md +0 -722
  75. package/.genie/code/agents/docgen.md +0 -48
  76. package/.genie/code/agents/explore.md +0 -79
  77. package/.genie/code/agents/fix.md +0 -100
  78. package/.genie/code/agents/git/commit-advisory.md +0 -219
  79. package/.genie/code/agents/git/workflows/issue.md +0 -244
  80. package/.genie/code/agents/git/workflows/pr.md +0 -179
  81. package/.genie/code/agents/git/workflows/release.md +0 -460
  82. package/.genie/code/agents/git/workflows/report.md +0 -342
  83. package/.genie/code/agents/git.md +0 -432
  84. package/.genie/code/agents/implementor.md +0 -161
  85. package/.genie/code/agents/install.md +0 -515
  86. package/.genie/code/agents/issue-creator.md +0 -344
  87. package/.genie/code/agents/polish.md +0 -116
  88. package/.genie/code/agents/qa.md +0 -653
  89. package/.genie/code/agents/refactor.md +0 -294
  90. package/.genie/code/agents/release.md +0 -1129
  91. package/.genie/code/agents/roadmap.md +0 -885
  92. package/.genie/code/agents/tests.md +0 -557
  93. package/.genie/code/agents/tracer.md +0 -50
  94. package/.genie/code/agents/update/upstream-update.md +0 -85
  95. package/.genie/code/agents/update/versions/generic-update.md +0 -305
  96. package/.genie/code/agents/vibe.md +0 -1317
  97. package/.genie/code/spells/agent-configuration.md +0 -58
  98. package/.genie/code/spells/automated-rc-publishing.md +0 -106
  99. package/.genie/code/spells/branch-tracker-guidance.md +0 -28
  100. package/.genie/code/spells/debug.md +0 -320
  101. package/.genie/code/spells/emoji-naming-convention.md +0 -303
  102. package/.genie/code/spells/evidence-storage.md +0 -26
  103. package/.genie/code/spells/file-naming-rules.md +0 -35
  104. package/.genie/code/spells/forge-code-blueprints.md +0 -195
  105. package/.genie/code/spells/genie-integration.md +0 -153
  106. package/.genie/code/spells/publishing-protocol.md +0 -61
  107. package/.genie/code/spells/team-consultation-protocol.md +0 -284
  108. package/.genie/code/spells/tool-requirements.md +0 -20
  109. package/.genie/code/spells/triad-maintenance-protocol.md +0 -154
  110. package/.genie/code/teams/tech-council/council.md +0 -328
  111. package/.genie/code/teams/tech-council/jt.md +0 -352
  112. package/.genie/code/teams/tech-council/nayr.md +0 -305
  113. package/.genie/code/teams/tech-council/oettam.md +0 -375
  114. package/.genie/neurons/README.md +0 -193
  115. package/.genie/neurons/forge.md +0 -106
  116. package/.genie/neurons/genie.md +0 -63
  117. package/.genie/neurons/review.md +0 -106
  118. package/.genie/neurons/wish.md +0 -104
  119. package/.genie/product/README.md +0 -20
  120. package/.genie/product/cli-automation.md +0 -359
  121. package/.genie/product/environment.md +0 -60
  122. package/.genie/product/mission.md +0 -60
  123. package/.genie/product/roadmap.md +0 -44
  124. package/.genie/product/tech-stack.md +0 -34
  125. package/.genie/product/templates/context-template.md +0 -218
  126. package/.genie/product/templates/qa-done-report-template.md +0 -68
  127. package/.genie/product/templates/review-report-template.md +0 -89
  128. package/.genie/product/templates/wish-template.md +0 -120
  129. package/.genie/scripts/helpers/analyze-commit.js +0 -195
  130. package/.genie/scripts/helpers/bullet-counter.js +0 -194
  131. package/.genie/scripts/helpers/bullet-find.js +0 -289
  132. package/.genie/scripts/helpers/bullet-id.js +0 -244
  133. package/.genie/scripts/helpers/check-secrets.js +0 -237
  134. package/.genie/scripts/helpers/count-tokens.js +0 -200
  135. package/.genie/scripts/helpers/create-frontmatter.js +0 -456
  136. package/.genie/scripts/helpers/detect-markers.js +0 -293
  137. package/.genie/scripts/helpers/detect-todos.js +0 -267
  138. package/.genie/scripts/helpers/detect-unlabeled-blocks.js +0 -135
  139. package/.genie/scripts/helpers/embeddings.js +0 -344
  140. package/.genie/scripts/helpers/find-empty-sections.js +0 -158
  141. package/.genie/scripts/helpers/index.js +0 -319
  142. package/.genie/scripts/helpers/validate-frontmatter.js +0 -578
  143. package/.genie/scripts/helpers/validate-links.js +0 -207
  144. package/.genie/scripts/helpers/validate-paths.js +0 -373
  145. package/.genie/spells/README.md +0 -9
  146. package/.genie/spells/ace-protocol.md +0 -118
  147. package/.genie/spells/ask-one-at-a-time.md +0 -175
  148. package/.genie/spells/backup-analyzer.md +0 -542
  149. package/.genie/spells/blocker.md +0 -12
  150. package/.genie/spells/break-things-move-fast.md +0 -56
  151. package/.genie/spells/context-candidates.md +0 -72
  152. package/.genie/spells/context-critic.md +0 -51
  153. package/.genie/spells/defer-to-expertise.md +0 -278
  154. package/.genie/spells/delegate-dont-do.md +0 -292
  155. package/.genie/spells/error-investigation-protocol.md +0 -328
  156. package/.genie/spells/evidence-based-completion.md +0 -273
  157. package/.genie/spells/experiment.md +0 -65
  158. package/.genie/spells/file-creation-protocol.md +0 -229
  159. package/.genie/spells/forge-integration.md +0 -281
  160. package/.genie/spells/forge-orchestration.md +0 -514
  161. package/.genie/spells/gather-context.md +0 -18
  162. package/.genie/spells/global-health-check.md +0 -34
  163. package/.genie/spells/global-noop-roundtrip.md +0 -25
  164. package/.genie/spells/install-genie.md +0 -1232
  165. package/.genie/spells/install.md +0 -82
  166. package/.genie/spells/investigate-before-commit.md +0 -112
  167. package/.genie/spells/know-yourself.md +0 -288
  168. package/.genie/spells/learn.md +0 -828
  169. package/.genie/spells/mcp-diagnostic-protocol.md +0 -246
  170. package/.genie/spells/mcp-first.md +0 -124
  171. package/.genie/spells/multi-step-execution.md +0 -67
  172. package/.genie/spells/orchestration-boundary-protocol.md +0 -256
  173. package/.genie/spells/orchestrator-not-implementor.md +0 -189
  174. package/.genie/spells/prompt.md +0 -746
  175. package/.genie/spells/reflect.md +0 -404
  176. package/.genie/spells/routing-decision-matrix.md +0 -368
  177. package/.genie/spells/run-in-parallel.md +0 -12
  178. package/.genie/spells/session-state-updater-example.md +0 -196
  179. package/.genie/spells/session-state-updater.md +0 -220
  180. package/.genie/spells/track-long-running-tasks.md +0 -133
  181. package/.genie/spells/troubleshoot-infrastructure.md +0 -176
  182. package/.genie/spells/upgrade-genie.md +0 -415
  183. package/.genie/spells/url-presentation-protocol.md +0 -301
  184. package/.genie/spells/wish-initiation.md +0 -158
  185. package/.genie/spells/wish-issue-linkage.md +0 -410
  186. package/.genie/spells/wish-lifecycle.md +0 -100
  187. package/.genie/state/provider-status.json +0 -3
  188. package/.genie/state/version.json +0 -16
  189. package/.genie/wishes/canonical-pgserve-pm2-supervision/WISH.md +0 -290
  190. package/.genie/wishes/pgserve-v2/BRIEF-from-genie-pgserve.md +0 -99
  191. package/.genie/wishes/pgserve-v2/WISH.md +0 -442
  192. package/.genie/wishes/release-system-genie-pattern/WISH.md +0 -268
  193. package/.genie/wishes/release-system-genie-pattern/validation.md +0 -205
  194. package/.gitguardian.yaml +0 -29
  195. package/.gitguardianignore +0 -16
  196. package/.github/workflows/ci.yml +0 -122
  197. package/.github/workflows/release.yml +0 -289
  198. package/.github/workflows/version.yml +0 -228
  199. package/.husky/pre-commit +0 -2
  200. package/AGENTS.md +0 -433
  201. package/CLAUDE.md +0 -1
  202. package/Makefile +0 -285
  203. package/assets/icon.ico +0 -0
  204. package/bun.lock +0 -435
  205. package/bunfig.toml +0 -28
  206. package/ecosystem.config.cjs +0 -23
  207. package/eslint.config.js +0 -63
  208. package/examples/multi-tenant-demo.js +0 -104
  209. package/install.sh +0 -123
  210. package/knip.json +0 -9
  211. package/tests/audit.test.js +0 -189
  212. package/tests/backpressure.test.js +0 -167
  213. package/tests/benchmarks/runner.js +0 -1197
  214. package/tests/benchmarks/vector-generator.js +0 -368
  215. package/tests/cli-install.test.js +0 -322
  216. package/tests/control-db.test.js +0 -285
  217. package/tests/daemon-args.test.js +0 -86
  218. package/tests/daemon-control.test.js +0 -171
  219. package/tests/daemon-fingerprint-integration.test.js +0 -111
  220. package/tests/daemon-pr24-regression.test.js +0 -198
  221. package/tests/fingerprint.test.js +0 -263
  222. package/tests/fixtures/240-orphan-seed.sql +0 -30
  223. package/tests/multi-tenant.test.js +0 -374
  224. package/tests/orphan-cleanup.test.js +0 -390
  225. package/tests/pg-version-regex.test.js +0 -129
  226. package/tests/quick-bench.js +0 -135
  227. package/tests/router-handshake-retry.test.js +0 -119
  228. package/tests/router-handshake-watchdog.test.js +0 -110
  229. package/tests/sdk.test.js +0 -71
  230. package/tests/stale-postmaster-pid.test.js +0 -85
  231. package/tests/stress-test.js +0 -439
  232. package/tests/sync-perf-test.js +0 -150
  233. package/tests/tcp-listen.test.js +0 -368
  234. package/tests/tenancy.test.js +0 -403
  235. package/tests/wrapper-supervision.test.js +0 -107
@@ -1,289 +0,0 @@
1
- name: Release
2
-
3
- # Single-branch release pipeline modeled on khal-os/desktop.
4
- #
5
- # Two trigger paths into the same workflow:
6
- #
7
- # 1. push to main with a hand-bumped package.json (no [skip ci] marker)
8
- # -> auto-detect path: prepare reads package.json, checks if v${version}
9
- # tag exists, builds + publishes + creates GitHub Release if not.
10
- #
11
- # 2. workflow_dispatch with bump=patch|minor|major
12
- # -> bump job runs `npm version`, commits with [skip ci], tags, pushes.
13
- # prepare/build/release continue inline in the same workflow run.
14
- #
15
- # Bot-loop guard: bump commits carry [skip ci]. Push of those commits is
16
- # filtered out by the prepare gate, so the bot's own push does not retrigger.
17
- #
18
- # Auth: npm OIDC Trusted Publishing (configured via build-all-platforms.yml).
19
-
20
- on:
21
- push:
22
- branches: [main]
23
- workflow_dispatch:
24
- inputs:
25
- bump:
26
- description: "Version bump type"
27
- required: true
28
- type: choice
29
- options:
30
- - patch
31
- - minor
32
- - major
33
-
34
- concurrency:
35
- group: release-${{ github.ref }}
36
- cancel-in-progress: false
37
-
38
- permissions:
39
- contents: write
40
- id-token: write # required so the reusable `version.yml` workflow can mint
41
- # the OIDC token for npm Trusted Publishing — without this,
42
- # GH rejects the workflow at parse time (startup_failure)
43
- # because the called job's `id-token: write` permission
44
- # exceeds what the caller has granted.
45
-
46
- jobs:
47
- # ---------------------------------------------------------------------------
48
- # Bump (workflow_dispatch only): npm version, commit [skip ci], tag, push.
49
- # ---------------------------------------------------------------------------
50
- bump:
51
- name: Bump version
52
- if: github.event_name == 'workflow_dispatch'
53
- runs-on: ubuntu-latest
54
- timeout-minutes: 5
55
- outputs:
56
- version: ${{ steps.bump.outputs.version }}
57
- tag: ${{ steps.bump.outputs.tag }}
58
- steps:
59
- - uses: actions/checkout@v4
60
- with:
61
- ref: main
62
- fetch-depth: 0
63
- token: ${{ secrets.GITHUB_TOKEN }}
64
-
65
- - uses: actions/setup-node@v4
66
- with:
67
- node-version: "22"
68
-
69
- - name: Configure git
70
- run: |
71
- git config user.name "github-actions[bot]"
72
- git config user.email "github-actions[bot]@users.noreply.github.com"
73
-
74
- - name: Bump version
75
- id: bump
76
- run: |
77
- npm version "${{ inputs.bump }}" --no-git-tag-version
78
- VERSION=$(node -p "require('./package.json').version")
79
- echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
80
- echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
81
- echo "Bumped to ${VERSION}"
82
-
83
- - name: Commit, tag, push
84
- run: |
85
- VERSION="${{ steps.bump.outputs.version }}"
86
- TAG="${{ steps.bump.outputs.tag }}"
87
- git add package.json
88
- git commit -m "[skip ci] release ${TAG}"
89
- git tag -a "${TAG}" -m "release ${TAG}"
90
- git push origin HEAD --follow-tags
91
-
92
- # ---------------------------------------------------------------------------
93
- # Prepare: resolve version, skip if tag already exists, build changelog.
94
- #
95
- # Gate handles both event types:
96
- # - push: bump is skipped; the !cancelled() && !failure() guard lets
97
- # this job run regardless. The [skip ci] check filters the
98
- # bot's own bump-commit push so it does not retrigger.
99
- # - dispatch: bump succeeded; the workflow_dispatch branch of the OR
100
- # short-circuits the [skip ci] check (the dispatch event
101
- # itself does not carry the bump's commit message).
102
- # ---------------------------------------------------------------------------
103
- prepare:
104
- name: Prepare release
105
- needs: bump
106
- if: |
107
- !cancelled() && !failure() &&
108
- (github.event_name == 'workflow_dispatch' ||
109
- (github.event_name == 'push' &&
110
- !startsWith(github.event.head_commit.message, '[skip ci]')))
111
- runs-on: ubuntu-latest
112
- timeout-minutes: 5
113
- outputs:
114
- version: ${{ steps.ver.outputs.version }}
115
- tag: ${{ steps.ver.outputs.tag }}
116
- skip: ${{ steps.ver.outputs.skip }}
117
- changelog: ${{ steps.changelog.outputs.notes }}
118
- # Surface the resolved checkout-ref so downstream jobs (build, release)
119
- # can use it. They cannot reference `needs.bump.outputs.*` directly
120
- # because they only have `needs: prepare` (or [prepare, build]) — not
121
- # `bump` — in their needs context.
122
- ref: ${{ needs.bump.outputs.tag || github.sha }}
123
- steps:
124
- - uses: actions/checkout@v4
125
- with:
126
- # On dispatch, check out the freshly-pushed tag; on push, the
127
- # triggering SHA already has the bumped package.json.
128
- # (Prepare cannot reference its own `outputs.ref` here — that's
129
- # only available to downstream jobs.)
130
- ref: ${{ needs.bump.outputs.tag || github.sha }}
131
- fetch-depth: 0
132
-
133
- - name: Resolve version
134
- id: ver
135
- env:
136
- GH_TOKEN: ${{ github.token }}
137
- run: |
138
- VERSION=$(node -p "require('./package.json').version")
139
- TAG="v${VERSION}"
140
- echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
141
- echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
142
-
143
- if gh release view "${TAG}" > /dev/null 2>&1; then
144
- echo "Release ${TAG} already exists — skipping"
145
- echo "skip=true" >> "$GITHUB_OUTPUT"
146
- else
147
- echo "skip=false" >> "$GITHUB_OUTPUT"
148
- fi
149
-
150
- - name: Find previous release tag
151
- id: prev
152
- if: steps.ver.outputs.skip == 'false'
153
- env:
154
- GH_TOKEN: ${{ github.token }}
155
- run: |
156
- TAG="${{ steps.ver.outputs.tag }}"
157
- PREV=$(gh release list --limit 50 --json tagName -q '.[].tagName' | grep -v "^${TAG}$" | head -1)
158
- if [ -n "$PREV" ] && git merge-base --is-ancestor "$PREV" HEAD 2>/dev/null; then
159
- echo "tag=${PREV}" >> "$GITHUB_OUTPUT"
160
- echo "Previous tag: ${PREV}"
161
- else
162
- echo "tag=" >> "$GITHUB_OUTPUT"
163
- echo "No previous tag reachable from HEAD"
164
- fi
165
-
166
- - name: Generate changelog
167
- id: changelog
168
- if: steps.ver.outputs.skip == 'false' && steps.prev.outputs.tag != ''
169
- run: |
170
- PREV="${{ steps.prev.outputs.tag }}"
171
- NOTES=$(git log --oneline "${PREV}..HEAD" --pretty="- %s" | head -50)
172
- {
173
- echo "notes<<EOF"
174
- echo "$NOTES"
175
- echo "EOF"
176
- } >> "$GITHUB_OUTPUT"
177
-
178
- # Echo the resolved outputs so downstream skip/no-skip decisions are
179
- # debuggable from the run log without re-running with step debug.
180
- - name: Debug resolved outputs
181
- run: |
182
- echo "version=${{ steps.ver.outputs.version }}"
183
- echo "tag=${{ steps.ver.outputs.tag }}"
184
- echo "skip=${{ steps.ver.outputs.skip }}"
185
- echo "prev=${{ steps.prev.outputs.tag }}"
186
-
187
- # ---------------------------------------------------------------------------
188
- # Build & Publish: matrix build of platform binaries + npm publish via OIDC.
189
- #
190
- # The reusable workflow filename is `version.yml` because npm Trusted
191
- # Publisher is configured against that exact path. Renaming requires
192
- # updating the npmjs.com Trusted Publisher entry first.
193
- #
194
- # The `if:` uses `always() && needs.prepare.result == 'success' &&
195
- # needs.prepare.outputs.skip != 'true'`. This is the bulletproof pattern
196
- # for reusable-workflow callers when any upstream job in the `needs:`
197
- # chain was SKIPPED. With the simpler `needs.prepare.outputs.skip != 'true'`
198
- # alone, GH Actions silently evaluated the gate as false even though the
199
- # debug step in `prepare` proved the output was actually `'false'` — a
200
- # known GH Actions quirk: when a job's transitive `needs:` chain includes
201
- # a skipped job (here, `bump` is skipped on push events), the reusable-
202
- # workflow caller's expression evaluator treats `needs.<job>.outputs.<x>`
203
- # as null/missing regardless of the actual value.
204
- #
205
- # `always()` opts out of the implicit success() filter; the explicit
206
- # `result == 'success'` reinstates it correctly; the outputs check then
207
- # works as intended.
208
- # ---------------------------------------------------------------------------
209
- build:
210
- name: Build & Publish
211
- needs: prepare
212
- if: |
213
- always() &&
214
- needs.prepare.result == 'success' &&
215
- needs.prepare.outputs.skip != 'true'
216
- uses: ./.github/workflows/version.yml
217
- with:
218
- version: ${{ needs.prepare.outputs.version }}
219
- npm_tag: latest
220
- # Use prepare.outputs.ref (which resolves to the bump-job tag on
221
- # dispatch, or `github.sha` on push). Build cannot reference
222
- # `needs.bump.*` directly — only `prepare` is in its `needs:` chain.
223
- # On the push path nobody creates the tag before this runs; the
224
- # SHA-based checkout works because the merge commit already has the
225
- # bumped package.json. The release job creates the tag at the end
226
- # via `gh release create`.
227
- ref: ${{ needs.prepare.outputs.ref }}
228
- secrets: inherit
229
-
230
- # ---------------------------------------------------------------------------
231
- # Release: download artifacts, create GitHub Release with cliff-free notes.
232
- # ---------------------------------------------------------------------------
233
- release:
234
- name: Create GitHub Release
235
- needs: [prepare, build]
236
- if: |
237
- always() &&
238
- needs.prepare.result == 'success' &&
239
- needs.build.result == 'success' &&
240
- needs.prepare.outputs.skip != 'true'
241
- runs-on: ubuntu-latest
242
- timeout-minutes: 10
243
- steps:
244
- - uses: actions/checkout@v4
245
- with:
246
- # Same as the build job: prefer the bump job's tag (dispatch
247
- # path) but fall back to the SHA (push path, no tag exists yet).
248
- ref: ${{ needs.prepare.outputs.ref }}
249
-
250
- - name: Download binaries
251
- uses: actions/download-artifact@v4
252
- with:
253
- path: dist/
254
- pattern: binaries-*
255
- merge-multiple: true
256
-
257
- - name: List artifacts
258
- run: ls -la dist/
259
-
260
- - name: Create release
261
- env:
262
- GH_TOKEN: ${{ github.token }}
263
- RELEASE_NOTES: ${{ needs.prepare.outputs.changelog }}
264
- run: |
265
- TAG="${{ needs.prepare.outputs.tag }}"
266
- VERSION="${{ needs.prepare.outputs.version }}"
267
-
268
- if [ -z "$RELEASE_NOTES" ]; then
269
- RELEASE_NOTES="Release ${TAG}"
270
- fi
271
-
272
- {
273
- echo "$RELEASE_NOTES"
274
- echo ""
275
- echo "## Install"
276
- echo ""
277
- echo '```bash'
278
- echo "npm install pgserve@${VERSION}"
279
- echo "bunx pgserve@${VERSION}"
280
- echo '```'
281
- } > /tmp/release-notes.md
282
-
283
- # The tag already exists (created by bump job on dispatch, or by the
284
- # human commit on push). gh release create resolves --target via the
285
- # tag automatically when omitted.
286
- gh release create "${TAG}" \
287
- --title "${TAG}" \
288
- --notes-file /tmp/release-notes.md \
289
- dist/*
@@ -1,228 +0,0 @@
1
- name: Build All Platforms
2
-
3
- on:
4
- workflow_call:
5
- inputs:
6
- version:
7
- description: 'Version to publish'
8
- required: true
9
- type: string
10
- npm_tag:
11
- description: 'npm dist-tag (next or latest)'
12
- required: false
13
- type: string
14
- default: 'next'
15
- ref:
16
- description: 'Git ref to checkout (tag or commit)'
17
- required: false
18
- type: string
19
- workflow_dispatch:
20
- inputs:
21
- version:
22
- description: 'Version (leave empty for build-only)'
23
- required: false
24
- type: string
25
- npm_tag:
26
- description: 'npm dist-tag'
27
- required: false
28
- type: choice
29
- options:
30
- - next
31
- - latest
32
- default: 'next'
33
-
34
- concurrency:
35
- group: build-all-platforms-${{ github.ref }}
36
- cancel-in-progress: true
37
-
38
- jobs:
39
- build:
40
- name: Build ${{ matrix.platform }}
41
- runs-on: ${{ matrix.os }}
42
- strategy:
43
- fail-fast: false
44
- matrix:
45
- include:
46
- # Linux x64
47
- - platform: linux-x64
48
- output: pgserve-linux-x64
49
- os: ubuntu-latest
50
- # macOS ARM64 (Apple Silicon)
51
- - platform: darwin-arm64
52
- output: pgserve-darwin-arm64
53
- os: macos-latest
54
- # Windows x64 - must build on Windows for --windows-icon
55
- - platform: windows-x64
56
- output: pgserve-windows-x64.exe
57
- os: windows-latest
58
-
59
- steps:
60
- - name: Checkout
61
- uses: actions/checkout@v4
62
- with:
63
- ref: ${{ inputs.ref || github.ref }}
64
-
65
- - name: Setup Bun
66
- uses: oven-sh/setup-bun@v2
67
- with:
68
- bun-version: 1.3.11
69
-
70
- - name: Install dependencies
71
- run: bun install
72
-
73
- # Windows: native build with icon and proper metadata
74
- - name: Build for Windows (with branding)
75
- if: matrix.platform == 'windows-x64'
76
- run: |
77
- New-Item -ItemType Directory -Force -Path dist | Out-Null
78
- $RAW_VERSION = node -p "require('./package.json').version"
79
- # Convert 1.1.3-rc.10 to 1.1.3.10 (Windows requires X.Y.Z.W format)
80
- $WIN_VERSION = $RAW_VERSION -replace '-rc\.', '.'
81
- Write-Host "Raw version: $RAW_VERSION -> Windows version: $WIN_VERSION"
82
- bun build --compile `
83
- --define BUILD_VERSION="'$RAW_VERSION'" `
84
- --windows-icon=assets/icon.ico `
85
- --windows-title="pgserve" `
86
- --windows-publisher="Namastex Labs" `
87
- --windows-description="Embedded PostgreSQL Server - Zero config, auto-provision, unlimited connections" `
88
- --windows-version="$WIN_VERSION" `
89
- --windows-copyright="Copyright (c) 2025 Namastex Labs" `
90
- bin/postgres-server.js --outfile dist/${{ matrix.output }}
91
- Get-ChildItem dist/
92
- shell: pwsh
93
-
94
- # Linux/macOS: native build
95
- - name: Build for ${{ matrix.platform }}
96
- if: matrix.platform != 'windows-x64'
97
- run: |
98
- mkdir -p dist
99
- VERSION=$(node -p "require('./package.json').version")
100
- bun build --compile --define BUILD_VERSION="'$VERSION'" bin/postgres-server.js --outfile dist/${{ matrix.output }}
101
- ls -lh dist/
102
-
103
- - name: Upload artifact
104
- uses: actions/upload-artifact@v4
105
- with:
106
- name: binaries-${{ matrix.platform }}
107
- path: dist/${{ matrix.output }}*
108
- retention-days: 7
109
-
110
- publish:
111
- name: Publish to npm
112
- needs: build
113
- runs-on: ubuntu-latest
114
- if: inputs.version != ''
115
- # Note: `environment: npm-publish` was removed because the npmjs.com
116
- # Trusted Publisher entry for `pgserve` does not declare an environment
117
- # name. With the env gate present here, the OIDC token's environment
118
- # claim did not match the registry's expectation and `npm publish`
119
- # returned 404. Re-add this line if/when the Trusted Publisher entry
120
- # has its Environment Name field set to `npm-publish`.
121
- permissions:
122
- id-token: write
123
- contents: read
124
-
125
- steps:
126
- - name: Checkout
127
- uses: actions/checkout@v4
128
- with:
129
- ref: ${{ inputs.ref || github.ref }}
130
-
131
- # Node 24 ships npm 11.5+ which has built-in OIDC trusted-publisher
132
- # support. Avoids the `npm install -g npm@latest` self-upgrade bug
133
- # (Arborist clobbering its own promise-retry dep mid-install) that
134
- # broke rlmx's OIDC publish on Node 22.
135
- - name: Setup Node.js
136
- uses: actions/setup-node@v4
137
- with:
138
- node-version: '24'
139
- registry-url: 'https://registry.npmjs.org'
140
-
141
- - name: Setup Bun
142
- uses: oven-sh/setup-bun@v2
143
- with:
144
- bun-version: 1.3.11
145
-
146
- - name: Install dependencies
147
- run: bun install
148
-
149
- - name: Verify npm version supports OIDC trusted publishing
150
- run: |
151
- NPM_VERSION=$(npm --version)
152
- echo "npm version: ${NPM_VERSION}"
153
- MAJOR=$(echo "${NPM_VERSION}" | cut -d. -f1)
154
- if [ "${MAJOR}" -lt 11 ]; then
155
- echo "::error::npm ${NPM_VERSION} too old — OIDC requires >= 11.5.1. Bump node-version above."
156
- exit 1
157
- fi
158
-
159
- - name: Download all artifacts
160
- uses: actions/download-artifact@v4
161
- with:
162
- path: dist/
163
- pattern: binaries-*
164
- merge-multiple: true
165
-
166
- - name: Verify binaries
167
- run: |
168
- echo "Downloaded binaries:"
169
- ls -la dist/
170
-
171
- MISSING=""
172
- # Supported platforms: linux-x64, darwin-arm64, windows-x64
173
- for platform in linux-x64 darwin-arm64; do
174
- if [ ! -f "dist/pgserve-$platform" ]; then
175
- MISSING="$MISSING pgserve-$platform"
176
- fi
177
- done
178
- if [ ! -f "dist/pgserve-windows-x64.exe" ]; then
179
- MISSING="$MISSING pgserve-windows-x64.exe"
180
- fi
181
-
182
- if [ -n "$MISSING" ]; then
183
- echo "Missing binaries:$MISSING"
184
- exit 1
185
- fi
186
-
187
- echo "All binaries present!"
188
-
189
- - name: Check if version already published
190
- id: check
191
- run: |
192
- VERSION="${{ inputs.version }}"
193
- if npm view pgserve@$VERSION version >/dev/null 2>&1; then
194
- echo "Version $VERSION already published"
195
- echo "published=true" >> $GITHUB_OUTPUT
196
- else
197
- echo "Version $VERSION not yet published"
198
- echo "published=false" >> $GITHUB_OUTPUT
199
- fi
200
-
201
- - name: Publish to npm via OIDC
202
- if: steps.check.outputs.published == 'false'
203
- env:
204
- HUSKY: "0"
205
- # npm auto-enables provenance in any CI env with `id-token: write`,
206
- # regardless of the --provenance CLI flag. On some runners the
207
- # server-side sigstore check fails with 422; disable explicitly.
208
- # OIDC token exchange still happens.
209
- NPM_CONFIG_PROVENANCE: "false"
210
- run: |
211
- echo "Publishing version ${{ inputs.version }} with tag ${{ inputs.npm_tag }} via OIDC"
212
- npm publish --access public --tag ${{ inputs.npm_tag }}
213
-
214
- - name: Verify publish
215
- if: steps.check.outputs.published == 'false'
216
- run: |
217
- # npm registry can take up to 30s to propagate
218
- for i in 1 2 3 4 5; do
219
- echo "Attempt $i: Checking npm for pgserve@${{ inputs.version }}..."
220
- if npm view pgserve@${{ inputs.version }} version 2>/dev/null; then
221
- echo "Successfully published pgserve@${{ inputs.version }} with tag @${{ inputs.npm_tag }}"
222
- exit 0
223
- fi
224
- echo "Not found yet, waiting 10s..."
225
- sleep 10
226
- done
227
- echo "Warning: Version not found after 50s, but publish command succeeded"
228
- exit 0
package/.husky/pre-commit DELETED
@@ -1,2 +0,0 @@
1
- bunx lint-staged
2
- bun run deadcode