You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Serve require() from src/ and drop the cjs/ build #16
transpile.cjs regex-rewrites src/ and tests/ into cjs/, which the default export condition serves to require(). engines is node >= 24, where require() of an ES module works without a flag, and src/ has no top-level await. So require() can load src/ directly.
Proposal
Add export { Postgres as 'module.exports' } to src/index.js so require('@steadybrew/postgresjs') still returns the function, as cjs/ does today. require('@steadybrew/postgresjs/vercel') already yields { vercelPool } in both forms.
Point default (and main) at src/, then remove transpile.cjs, cjs/ and /cjs/* from files.
Check before switching
Jest in CommonJS mode, ts-node, tsx, and webpack/esbuild bundling a CommonJS app: which handle require() of an ES module.
TypeScript: types/index.d.ts uses export = postgres; confirm module: nodenext and commonjs consumers still type-check.
Whether this is a breaking change for semver, given the tooling above.
Tests
cjs/tests runs the whole suite under the transpiled code, and tests-startup loads cjs/src for --cjs. Replace both with require() smoke tests against src/ (default export, vercel subpath, instanceof across the two entry points).
Done when
require() resolves to src/, cjs/ and transpile.cjs are gone, CI covers the require() path, and the CHANGELOG states it.
Activity