The code is at https://github.com/neondatabase/serverless.
To ensure code passes format checks and build output is up to date before commit, please copy pre-commit to .git/hooks.
The version overrides in package.json are necessary to support the pinned pg version. As and when we pin to a new pg version these should be re-evaluated.
To run tests:
-
Install Node LTS + npm, Bun and Deno
-
Copy
.env.templateto.env.testand fill in the blanks. -
npm install -
npm test
npm install @neondatabase/serverless@github:neondatabase/serverless#BRANCH_OR_COMMITOn a development branch:
- Bump the version in
package.json npm installso that thepackage-lock.jsonversion agrees- Ensure
CHANGELOG.mdhas a heading for the new version npm run buildso the new version is baked intoindex.js/index.mjs- (Optional)
npm run formatandnpm run testto catch early any issues that will surface in CI - Merge into
mainfollowing review and approval, and wait for CI to complete
Then from a clean main matching origin/main, run npm run tag-release. This checks that the version is not yet published on npm, that the CHANGELOG heading exists, that a fresh npm run build leaves the working tree unchanged, and that the Lint and Test workflows triggered by the push to main succeeded for the current commit. Then it creates and pushes an annotated vX.Y.Z tag.
After the tag exists, trigger the publish workflow for that tag in the separate release repo.