Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 13 additions & 13 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
{
"name": "Node.js 20 & Postgres",
"dockerComposeFile": "docker-compose.yml",
"service": "web",
"workspaceFolder": "/workspace",
// Add the IDs of extensions you want installed when the container is created in the array below.
"customizations":{
"vscode": {
"extensions": ["dbaeumer.vscode-eslint"],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
}
}
}
"name": "Node.js 20 & Postgres",
"dockerComposeFile": "docker-compose.yml",
"service": "web",
"workspaceFolder": "/workspace",
// Add the IDs of extensions you want installed when the container is created in the array below.
"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint"],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
}
}
}
}
12 changes: 6 additions & 6 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ services:
# user if not 1000. See https://aka.ms/vscode-remote/containers/non-root for details.
# user: node

build:
build:
context: .
dockerfile: Dockerfile

volumes:
- ..:/workspace:cached

Expand All @@ -24,10 +24,10 @@ services:
PGUSER: user
PGDATABASE: data
PGHOST: db
# set this to true in the development environment until I can get SSL setup on the
# set this to true in the development environment until I can get SSL setup on the
# docker postgres instance
PGTESTNOSSL: 'true'

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

Expand All @@ -40,12 +40,12 @@ services:
db:
image: postgres:14
restart: unless-stopped
ports:
ports:
- 5432:5432
command: postgres -c password_encryption=md5
environment:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_INITDB_ARGS: "--auth-local=md5"
POSTGRES_INITDB_ARGS: '--auth-local=md5'
POSTGRES_PASSWORD: pass
POSTGRES_USER: user
POSTGRES_DB: data
12 changes: 12 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Environment variables consumed by the integration test suite.
# Source manually (`set -a && source .env.test && set +a`) or via dotenv-cli
# before running `pnpm test`.

PGUSER=postgres
PGPASSWORD=postgres
PGHOST=localhost
PGPORT=5432
PGDATABASE=ci_db_test
PGTESTNOSSL=true
SCRAM_TEST_PGUSER=scram_test
SCRAM_TEST_PGPASSWORD=test4scram
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

35 changes: 0 additions & 35 deletions .eslintrc

This file was deleted.

7 changes: 3 additions & 4 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "monthly"
interval: 'monthly'
79 changes: 45 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,46 @@
name: CI

on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
lint:
timeout-minutes: 5
name: Lint & Typecheck
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@v4
- uses: actions/checkout@v5
- run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: 18
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn lint
node-version: '22'
cache: pnpm
- name: 📦 Install
run: pnpm install --frozen-lockfile
- name: 🚀 Build
run: pnpm build
- name: 👀 Lint
run: pnpm lint
- name: 🔍 Typecheck
run: pnpm typecheck

build:
timeout-minutes: 15
name: Test (Node ${{ matrix.node }})
runs-on: ubuntu-latest
timeout-minutes: 20
needs: lint
services:
postgres:
Expand All @@ -37,17 +56,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node:
- '16'
- '18'
- '20'
- '22'
- '24'
- '25'
os:
- ubuntu-latest
name: Node.js ${{ matrix.node }}
runs-on: ubuntu-latest
node: ['22', '24']
env:
PGUSER: postgres
PGPASSWORD: postgres
Expand All @@ -57,20 +66,22 @@ jobs:
SCRAM_TEST_PGUSER: scram_test
SCRAM_TEST_PGPASSWORD: test4scram
steps:
- name: Show OS
run: |
uname -a
- run: |
psql \
-c "SET password_encryption = 'scram-sha-256'" \
-c "CREATE ROLE scram_test LOGIN PASSWORD 'test4scram'"
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@v4
- uses: actions/checkout@v5
- run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn test
cache: pnpm
- name: 📦 Install libpq headers (for pg-native)
run: sudo apt-get update && sudo apt-get install -y libpq-dev
- run: pnpm install --frozen-lockfile
- name: 🔨 Rebuild native modules (pg-native via libpq)
run: pnpm rebuild libpq
- name: 🚀 Build
run: pnpm build
- name: 🧪 Test
run: pnpm -r --workspace-concurrency=1 --filter "./packages/**" run test
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

permissions:
contents: write
id-token: write

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- run: corepack enable

- uses: actions/setup-node@v6
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- name: 📦 Install
run: pnpm install --frozen-lockfile

- name: 🚀 Build
run: pnpm build

- name: 👀 Lint
run: pnpm lint

- name: 🔍 Typecheck
run: pnpm typecheck

- name: 📦 Publish to npm
run: pnpm -r --filter "./packages/**" publish --provenance --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 📝 Generate changelog
run: pnpm dlx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 9 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
*~
build/
.lock-wscript
*.log
node_modules/
package-lock.json
*.swp
node_modules
dist
*.tsbuildinfo
.DS_Store
/.eslintcache
coverage
*.log
.vscode/
manually-test-on-heroku.js
.eslintcache
.idea/
build/
.lock-wscript
*.swp
11 changes: 11 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/oxfmt/configuration_schema.json",
"semi": false,
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"trailingComma": "es5",
"arrowParens": "always",
"bracketSpacing": true,
"ignorePatterns": ["CHANGELOG.md", "**/dist/**", "**/node_modules/**", "docs/**"]
}
6 changes: 6 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://unpkg.com/oxlint/configuration_schema.json",
"plugins": ["unicorn", "typescript", "oxc"],
"rules": {},
"ignorePatterns": ["**/dist/**", "**/node_modules/**", "docs/**", "**/*.d.ts"]
}
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

Loading