Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
id-token: write
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
id-token: write
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 1.2.0 (2026-09-30)
## 1.2.0 (2026-10-01)

- Options to the `neon(...)` HTTP-client creation function, and to the `transaction` and `query` functions, now support individual connection parameters: `user` (or `username`), `password`, `host` (or `hostname`), `port`, `database` and `connectionString`.

Expand Down Expand Up @@ -27,6 +27,8 @@

- A few other minor fixes.

- The package is no longer published to JSR. Please update any `jsr` references to `npm:@neondatabase/serverless`.

## 1.1.0 (2026-04-09)

Type declarations are now fully inlined (some were previously re-exported from `@types/pg` and `@types/node`). The new types greatly reduce the size of the package with dependencies, and should be compatible in normal usage. The code that is actually run remains unchanged.
Expand Down
15 changes: 13 additions & 2 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ To run tests:
npm install @neondatabase/serverless@github:neondatabase/serverless#BRANCH_OR_COMMIT
```

## Publish on npm and JSR
## Publish on npm

Tests must be passing locally, the repo must be clean, and `CHANGELOG.md` must include notes for the new version. Then run `npm version $BUMP --ignore-scripts=false` where `$BUMP` is `patch`, `minor` or `major`.
On a development branch:

1. Bump the version in `package.json`
2. `npm install` so that the `package-lock.json` version agrees
3. Ensure `CHANGELOG.md` has a heading for the new version
4. `npm run build` so the new version is baked into `index.js` / `index.mjs`
5. (Optional) `npm run format` and `npm run test` to catch early any issues that will surface in CI
6. Merge into `main` following 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.
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,22 @@

### Install it

Install it with your preferred JavaScript package manager. It's named `@neondatabase/serverless` on npm and `@neon/serverless` on JSR. So, for example:
Install it with your preferred JavaScript package manager. It's published as `@neondatabase/serverless` on npm. So, for example:

```bash
npm install @neondatabase/serverless
```

or

```bash
bunx jsr add @neon/serverless
```

Using TypeScript? No worries: types are included either way.
Using TypeScript? No worries: types are included.

Note: to install with npm for use by another package that declares a dependency on `pg` (node-postgres), use an alias plus an override, which will look something like this in your `package.json`:

```json
"dependencies": {
"pg": "npm:@neondatabase/serverless@^1.0.0"
"pg": "npm:@neondatabase/serverless@^1.2.0"
},
"overrides": {
"pg": "npm:@neondatabase/serverless@^1.0.0"
"pg": "npm:@neondatabase/serverless@^1.2.0"
}
```

Expand Down
2 changes: 0 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ npx esbuild src/index.ts \
$DEBUG_ARG $MINIFY_ARG

# bundle ESM code to index.mjs
# (--banner:js comment is for JSR's benefit)
npx esbuild src/index.ts \
--format=esm \
--bundle \
Expand All @@ -37,7 +36,6 @@ npx esbuild src/index.ts \
--define:BUNDLE_EXT=\"mjs\" \
--define:PACKAGE_VERSION=\"$PACKAGE_VERSION\" \
--target=es2020 \
--banner:js='/* @ts-self-types="./index.d.mts" */' \
--outfile=index.mjs \
$DEBUG_ARG $MINIFY_ARG

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ let c=e[u];if(typeof c=="function"&&(c=await c()),c===void 0)return;if(typeof c!
rt"&&typeof c=="number")){let f=u==="port"?" or a number":"";throw new q(`Connection parameter "${u}\
" must be a string${f} or a function resolving to one`)}let l=Ia[u]??u;n[l]=c}));let{searchParams:i}=n;
for(let u in t)i.has(u)||i.append(u,t[u]);let s=_a(n),o=pi(s,!0);return{resolvedConnectionString:s,resolvedURL:o}}
a(mi,"resolveConnectionParams");Ke();h();var vt="pkg:npm/%40neondatabase/serverless@1.1.0";var ps=xe(_t()),ys=xe(st());var fs="transaction() expects an array of queries, or a function returning an array of queries";function Wu(r){
a(mi,"resolveConnectionParams");Ke();h();var vt="pkg:npm/%40neondatabase/serverless@1.2.0";var ps=xe(_t()),ys=xe(st());var fs="transaction() expects an array of queries, or a function returning an array of queries";function Wu(r){
return r instanceof p?"\\x"+di(r):r}a(Wu,"encodeBuffersAsBytea");function hs(r){let{query:e,params:t}=r instanceof
Me?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>Wu((0,ys.prepareValue)(n)))}}a(hs,"prep\
areQuery");function mr(r,e={}){typeof r!="string"&&(e=r??{},r=void 0);let{arrayMode:t,fullResults:n,
Expand Down
3 changes: 1 addition & 2 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* @ts-self-types="./index.d.mts" */
var Po=Object.create;var Ie=Object.defineProperty;var Ro=Object.getOwnPropertyDescriptor;var Lo=Object.getOwnPropertyNames;var Bo=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty;var Mo=(r,e,t)=>e in r?Ie(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var a=(r,e)=>Ie(r,"name",{value:e,configurable:!0});var V=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var T=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},se=(r,e)=>{
for(var t in e)Ie(r,t,{get:e[t],enumerable:!0})},Dn=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e==
"function")for(let i of Lo(e))!Fo.call(r,i)&&i!==t&&Ie(r,i,{get:()=>e[i],enumerable:!(n=Ro(e,i))||n.
Expand Down Expand Up @@ -1287,7 +1286,7 @@ let c=e[u];if(typeof c=="function"&&(c=await c()),c===void 0)return;if(typeof c!
rt"&&typeof c=="number")){let f=u==="port"?" or a number":"";throw new N(`Connection parameter "${u}\
" must be a string${f} or a function resolving to one`)}let l=Ta[u]??u;n[l]=c}));let{searchParams:i}=n;
for(let u in t)i.has(u)||i.append(u,t[u]);let s=Ca(n),o=di(s,!0);return{resolvedConnectionString:s,resolvedURL:o}}
a(yi,"resolveConnectionParams");Ge();h();var vt="pkg:npm/%40neondatabase/serverless@1.1.0";var ds=we(_t()),ps=we(rt());var ls="transaction() expects an array of queries, or a function returning an array of queries";function Nu(r){
a(yi,"resolveConnectionParams");Ge();h();var vt="pkg:npm/%40neondatabase/serverless@1.2.0";var ds=we(_t()),ps=we(rt());var ls="transaction() expects an array of queries, or a function returning an array of queries";function Nu(r){
return r instanceof p?"\\x"+fi(r):r}a(Nu,"encodeBuffersAsBytea");function fs(r){let{query:e,params:t}=r instanceof
He?r.toParameterizedQuery():r;return{query:e,params:t.map(n=>Nu((0,ps.prepareValue)(n)))}}a(fs,"prep\
areQuery");function ys(r,e={}){typeof r!="string"&&(e=r??{},r=void 0);let{arrayMode:t,fullResults:n,
Expand Down
16 changes: 0 additions & 16 deletions jsr.json

This file was deleted.

Loading
Loading