pgserve 2.6.6 → 2.6.7

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.
package/CHANGELOG.md CHANGED
@@ -14,6 +14,43 @@ All notable changes to `pgserve` are documented here. The format follows
14
14
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres
15
15
  to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
16
16
 
17
+ ## [2.6.7] - 2026-05-12
18
+
19
+ **Stability-focused follow-up to v2.6.6** — closes the missing
20
+ `autopg --version` handler that was causing every `Build *` platform
21
+ job to fail the real-mode tarball smoke gate at v2.6.4 / v2.6.5 / v2.6.6.
22
+
23
+ ### Fixed
24
+
25
+ - `bin/postgres-server.js` — handle `autopg --version` / `autopg -v` by
26
+ emitting `autopg <VERSION>\n` and exiting 0. The compiled bun binary
27
+ is what `tests/integration/tarball-smoke.sh --real` exec-checks; the
28
+ previous fall-through to `printHelp() + exit 1` surfaced as the
29
+ misleading "binary not executable" smoke failure. Version resolution
30
+ honors (in order): the bun compile-time `--define BUILD_VERSION=...`
31
+ injection from `scripts/build-binary.sh:104`, the
32
+ `AUTOPG_BUILD_VERSION` env override, and the sibling `package.json`
33
+ for dev runs.
34
+
35
+ ### What this unblocks
36
+
37
+ - Real-mode smoke gate now passes → Build Tarballs job uploads
38
+ per-platform artifacts.
39
+ - Sign + Attest workflow (workflow_run after Build Tarballs) actually
40
+ fires with non-empty inputs → cosign sign-blob, SLSA L3 provenance,
41
+ and GitHub Attestations API attestation per tarball succeed.
42
+ - release-publish workflow (workflow_run after Sign + Attest) creates
43
+ the `v2.6.7` GitHub Release with the 12 signed assets (4 platforms
44
+ × tarball + bundle + intoto.jsonl) attached.
45
+
46
+ ### Same payload as v2.6.4 / v2.6.5 / v2.6.6
47
+
48
+ The npm runtime surface is identical across the 2.6.4–2.6.7 cluster.
49
+ Consumers like `@withone/cli` (`pgserve: ^2.2.3`) pick up the latest
50
+ on next install regardless of which version they previously resolved.
51
+ v2.6.7 is the version that ALSO ships the GH Release with signed
52
+ tarballs — that's the only delta visible to operators.
53
+
17
54
  ## [2.6.6] - 2026-05-12
18
55
 
19
56
  **Hot-fix follow-up to v2.6.5.** v2.6.5 published to npm but build-tarballs
@@ -33,7 +33,47 @@ process.on('uncaughtException', (error) => {
33
33
 
34
34
  const args = process.argv.slice(2);
35
35
 
36
- if (args[0] === 'postmaster') {
36
+ // `--version` / `-v` short-circuit — the compiled `autopg` binary
37
+ // (bun --compile of this entry point) is the artifact that
38
+ // `tests/integration/tarball-smoke.sh --real` exec-checks with
39
+ // `autopg --version`. Without this branch the binary falls through to
40
+ // `printHelp() + exit 1` and surfaces as the misleading
41
+ // "binary not executable" smoke failure across every platform build.
42
+ //
43
+ // Version resolution order:
44
+ // 1. BUILD_VERSION compile-time constant (bun --compile --define BUILD_VERSION="'<v>'"
45
+ // from scripts/build-binary.sh:104 — replaces the identifier in the
46
+ // compiled binary with the literal version string)
47
+ // 2. AUTOPG_BUILD_VERSION env (operator override / dev runs)
48
+ // 3. package.json sibling (dev runs from source via `bun bin/postgres-server.js`)
49
+ // 4. literal 'unknown' (defensive)
50
+ if (args[0] === '--version' || args[0] === '-v') {
51
+ let version = 'unknown';
52
+ // The compile-time --define replaces the bare identifier; wrap in
53
+ // typeof check so the source still parses + runs in non-compiled
54
+ // contexts where BUILD_VERSION is genuinely undefined.
55
+
56
+ if (typeof BUILD_VERSION !== 'undefined' && BUILD_VERSION) {
57
+
58
+ version = BUILD_VERSION;
59
+ } else if (typeof process.env.AUTOPG_BUILD_VERSION === 'string' && process.env.AUTOPG_BUILD_VERSION.length > 0) {
60
+ version = process.env.AUTOPG_BUILD_VERSION;
61
+ } else {
62
+ try {
63
+ const { readFileSync } = await import('node:fs');
64
+ const { fileURLToPath } = await import('node:url');
65
+ const { dirname, join } = await import('node:path');
66
+ const here = dirname(fileURLToPath(import.meta.url));
67
+ const pkg = JSON.parse(readFileSync(join(here, '..', 'package.json'), 'utf8'));
68
+ version = pkg.version;
69
+ } catch {
70
+ // fall through to 'unknown'
71
+ }
72
+ }
73
+ // tarball-smoke.sh asserts `autopg ${VERSION}` on stdout line 1.
74
+ process.stdout.write(`autopg ${version}\n`);
75
+ process.exit(0);
76
+ } else if (args[0] === 'postmaster') {
37
77
  await runPostmasterSubcommand(args.slice(1));
38
78
  } else if (args[0] === 'serve') {
39
79
  // Alias `serve` → `postmaster` for symmetry with the v2.3 alias surface.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pgserve",
3
- "version": "2.6.6",
3
+ "version": "2.6.7",
4
4
  "description": "Embedded PostgreSQL server with true concurrent connections - zero config, auto-provision databases",
5
5
  "main": "src/index.js",
6
6
  "type": "module",