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
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ permissions:

env:
FORCE_COLOR: 1
PREBUILD_NODE_VERSION: '20'
DEFAULT_NODE_VERSION: '24'
PREBUILD_NODE_VERSION: '22'
DEFAULT_NODE_VERSION: '26'
ALPINE_VARIANT: 'alpine3.20'

jobs:
Expand Down Expand Up @@ -100,62 +100,62 @@ jobs:
host: x64
target: x64
platform: macos-x64
node: 20
node: 22
- os: macos-latest
host: x64
target: x64
platform: macos-x64
node: 24
node: 26
- os: ubuntu-24.04
host: x64
target: x64
platform: linux-x64
node: 20
node: 22
- os: ubuntu-24.04
host: x64
target: x64
platform: linux-x64
node: 24
node: 26
- os: windows-latest
host: x64
target: x64
platform: win32-x64
node: 20
node: 22
- os: windows-latest
host: x64
target: x64
platform: win32-x64
node: 24
node: 26
- os: windows-11-arm
host: arm64
target: arm64
platform: win32-arm64
node: 20
node: 22
- os: windows-11-arm
host: arm64
target: arm64
platform: win32-arm64
node: 24
node: 26
- os: macos-latest
host: arm64
target: arm64
platform: macos-arm64
node: 20
node: 22
- os: macos-latest
host: arm64
target: arm64
platform: macos-arm64
node: 24
node: 26
- os: ubuntu-24.04-arm
host: arm64
target: arm64
platform: linux-arm64
node: 20
node: 22
- os: ubuntu-24.04-arm
host: arm64
target: arm64
platform: linux-arm64
node: 24
node: 26
name: ${{ matrix.os }} (node=${{ matrix.node }}, host=${{ matrix.host }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@v6
Expand All @@ -165,7 +165,7 @@ jobs:
architecture: ${{ matrix.host }}

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
uses: microsoft/setup-msbuild@v3
if: contains(matrix.os, 'windows')
with:
msbuild-architecture: ${{ matrix.target }}
Expand Down Expand Up @@ -241,7 +241,7 @@ jobs:
GH_TOKEN: ${{ github.token }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v6
if: matrix.node == env.DEFAULT_NODE_VERSION && matrix.platform == 'linux-x64'
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -325,7 +325,7 @@ jobs:
run: yarn install --frozen-lockfile --ignore-scripts

- name: Download all prebuilt binary artifacts
uses: actions/download-artifact@v5
uses: actions/download-artifact@v8
with:
path: prebuilds-artifacts
merge-multiple: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ permissions:

env:
FORCE_COLOR: 1
DEFAULT_NODE_VERSION: '24'
DEFAULT_NODE_VERSION: '26'

jobs:
publish:
Expand Down Expand Up @@ -60,4 +60,4 @@ jobs:
- name: Mark release as not pre-release
run: gh release edit ${{ inputs.tag }} --draft=false
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ github.token }}
8 changes: 4 additions & 4 deletions .github/workflows/test-electron-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
node_version:
description: 'Node.js version for npm/setup'
required: false
default: '20'
default: '26'
type: string
workflow_dispatch:
inputs:
Expand All @@ -30,7 +30,7 @@ on:
node_version:
description: 'Node.js version for npm/setup'
required: false
default: '20'
default: '26'
type: string

permissions:
Expand All @@ -56,7 +56,7 @@ jobs:
name: ${{ matrix.platform }} (electron=${{ inputs.electron_version || '35' }})
steps:
- name: Download artifact from specific run
uses: actions/download-artifact@v5
uses: actions/download-artifact@v8
with:
run-id: ${{ inputs.target_run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -66,7 +66,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node_version || '20' }}
node-version: ${{ inputs.node_version || '26' }}

- name: Install xvfb (Linux only)
if: runner.os == 'Linux'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-npm-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
node_version:
description: 'Node.js version to test with'
required: false
default: '20'
default: '26'
type: string
workflow_dispatch:
inputs:
Expand All @@ -20,7 +20,7 @@ on:
node_version:
description: 'Node.js version to test with'
required: false
default: '20'
default: '26'
type: string

permissions:
Expand All @@ -46,7 +46,7 @@ jobs:
name: ${{ matrix.platform }}
steps:
- name: Download artifact from specific run
uses: actions/download-artifact@v5
uses: actions/download-artifact@v8
with:
run-id: ${{ inputs.target_run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -56,7 +56,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node_version || '20' }}
node-version: ${{ inputs.node_version || '26' }}

- name: Install tarball and verify
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ yarn add @homeofthings/sqlite3

### Prebuilt binaries

`@homeofthings/sqlite3` uses [Node-API](https://nodejs.org/api/n-api.html) so prebuilt binaries do not need to be built for specific Node versions. Prebuilt binaries are built as NAPI-version-agnostic (`@homeofthings+sqlite3.*.node`) using the `--napi` flag, and work on any Node.js version that supports the NAPI version used at compile time. Requires Node.js v20.17.0 or later.
`@homeofthings/sqlite3` uses [Node-API](https://nodejs.org/api/n-api.html) so prebuilt binaries do not need to be built for specific Node versions. Prebuilt binaries are built as NAPI-version-agnostic (`@homeofthings+sqlite3.*.node`) using the `--napi` flag, and work on any Node.js version that supports the NAPI version used at compile time. Requires Node.js v22.1.0 or later.

Prebuilt binaries are bundled inside the npm package using [`prebuildify`](https://github.com/prebuild/prebuildify) and loaded at runtime by [`node-gyp-build`](https://github.com/prebuild/node-gyp-build). No separate download step is needed — `npm install` just works. The following targets are currently provided:

Expand Down
30 changes: 15 additions & 15 deletions memory-bank/build-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ The `NAPI_VERSION` define is set via `napi_build_version` variable in binding.gy
**How it works**:
- The `napi_build_version` variable is automatically set by node-gyp based on the target Node.js version
- For local builds, it's stored in `build/config.gypi` (e.g., `"napi_build_version": "9"`)
- For prebuilds, `prebuildify` passes it via the `--napi` flag which builds a single NAPI-version-agnostic binary (named `@homeofthings+sqlite3.<libc>.node`). The actual NAPI version used at compile time is determined by the Node.js version running the build. Since NAPI is forward-compatible, prebuilts must be built on the lowest supported Node version to maximize compatibility — building on Node 20 (NAPI v9) produces prebuilts compatible with all Node.js 20+ versions.
- For prebuilds, `prebuildify` passes it via the `--napi` flag which builds a single NAPI-version-agnostic binary (named `@homeofthings+sqlite3.<libc>.node`). The actual NAPI version used at compile time is determined by the Node.js version running the build. Since NAPI is forward-compatible, prebuilts must be built on the lowest supported Node version to maximize compatibility — building on Node 22 (NAPI v9) produces prebuilts compatible with all Node.js 22+ versions.

### NAPI Versions Configuration

With `prebuildify --napi`, the NAPI version is auto-detected from the build Node.js version — it is not explicitly configured. The CI builds prebuilds on Node 20 (which supports NAPI v9), producing a single `@homeofthings+sqlite3.glibc.node` binary per platform. The `PREBUILD_NODE_VERSION` workflow variable controls which Node version is used for prebuilds.
With `prebuildify --napi`, the NAPI version is auto-detected from the build Node.js version — it is not explicitly configured. The CI builds prebuilds on Node 22 (which supports NAPI v9), producing a single `@homeofthings+sqlite3.glibc.node` binary per platform. The `PREBUILD_NODE_VERSION` workflow variable controls which Node version is used for prebuilds.

**Why multiple versions?**

Expand All @@ -148,7 +148,7 @@ NAPI versions are independent of Node.js versions - they represent API feature t

**Forward Compatibility**:

NAPI is forward-compatible — a binary built with NAPI_VERSION=X requires a Node.js version supporting NAPI vX or higher. Since our prebuilts are built with NAPI v9 on Node 20, they are compatible with all Node.js 20+ versions (which support NAPI v9 or higher).
NAPI is forward-compatible — a binary built with NAPI_VERSION=X requires a Node.js version supporting NAPI vX or higher. Since our prebuilts are built with NAPI v9 on Node 22, they are compatible with all Node.js 22+ versions (which support NAPI v9 or higher).

**Code Conditionals**:

Expand Down Expand Up @@ -225,8 +225,8 @@ The `install` script runs `node-gyp-build` which tests whether the prebuilt bina

## Platform Support

- Node.js >= 20.17.0
- NAPI: version-agnostic (`@homeofthings+sqlite3.*.node`), built with NAPI v9 on Node 20 (PREBUILD_NODE_VERSION)
- Node.js >= 22.1.0
- NAPI: version-agnostic (`@homeofthings+sqlite3.*.node`), built with NAPI v9 on Node 22 (PREBUILD_NODE_VERSION)
- Platforms: Linux (glibc + musl), macOS, Windows (see CI configuration)

## Security Hardening
Expand Down Expand Up @@ -317,8 +317,8 @@ The project uses three GitHub Actions workflows for continuous integration and r

| Variable | Value | Purpose |
|----------|-------|---------|
| `PREBUILD_NODE_VERSION` | `'20'` | Node version for building prebuilts (NAPI v9, compatible with all Node 20+) |
| `DEFAULT_NODE_VERSION` | `'24'` | Node version for lint, Codecov, smoke tests, packaging |
| `PREBUILD_NODE_VERSION` | `'22'` | Node version for building prebuilts (NAPI v9, compatible with all Node 22+) |
| `DEFAULT_NODE_VERSION` | `'26'` | Node version for lint, Codecov, smoke tests, packaging |
Comment thread
coderabbitai[bot] marked this conversation as resolved.
| `ALPINE_VARIANT` | `'alpine3.20'` | Alpine variant for musl Docker builds |

**Jobs**:
Expand All @@ -335,12 +335,12 @@ The project uses three GitHub Actions workflows for continuous integration and r

| OS | Host | Target | Platform | Node Versions |
|----|------|--------|----------|---------------|
| macos-latest | x64 | x64 | macos-x64 | 20, 24 |
| macos-latest | arm64 | arm64 | macos-arm64 | 20, 24 |
| ubuntu-24.04 | x64 | x64 | linux-x64 | 20, 24 |
| ubuntu-24.04-arm | arm64 | arm64 | linux-arm64 | 20, 24 |
| windows-latest | x64 | x64 | win32-x64 | 20, 24 |
| windows-11-arm | arm64 | arm64 | win32-arm64 | 20, 24 |
| macos-latest | x64 | x64 | macos-x64 | 22, 26 |
| macos-latest | arm64 | arm64 | macos-arm64 | 22, 26 |
| ubuntu-24.04 | x64 | x64 | linux-x64 | 22, 26 |
| ubuntu-24.04-arm | arm64 | arm64 | linux-arm64 | 22, 26 |
| windows-latest | x64 | x64 | win32-x64 | 22, 26 |
| windows-11-arm | arm64 | arm64 | win32-arm64 | 22, 26 |

Steps per matrix entry:
- Install dependencies (`yarn install --frozen-lockfile --ignore-scripts`)
Expand Down Expand Up @@ -378,7 +378,7 @@ The project uses three GitHub Actions workflows for continuous integration and r

**Inputs**:
- `target_run_id` (required) — Run ID of upstream CI workflow
- `node_version` (optional, default `20`) — Node.js version for testing
- `node_version` (optional, default `26`) — Node.js version for testing

**Smoke tests** on 4 platforms (linux-x64, linux-arm64, macos-arm64, win32-x64):
1. Install tarball and verify package contents
Expand All @@ -392,7 +392,7 @@ The project uses three GitHub Actions workflows for continuous integration and r

### Build Fails

1. Check Node.js version: `node --version` (must be >= 20.17.0)
1. Check Node.js version: `node --version` (must be >= 22.1.0)
2. Check node-gyp version: `node-gyp --version`
3. Try clean rebuild: `node-gyp clean && node-gyp rebuild`
4. Check Python version (node-gyp requires Python 3)
Expand Down
2 changes: 2 additions & 0 deletions memory-bank/custom-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ These instructions apply to all future sessions working in this project.

- **Wait for results** - When asking the user to check something or run a command, wait for the response before proceeding with next steps.

- **Verify claims** - Only state what you actually verified

- **Answering user questions**
- Try to keep your answer short and do not embellish your answer with assessments based on assumptions.
- Wait for feedback before proceeding with other things or asking questions about other things.
Expand Down
6 changes: 3 additions & 3 deletions memory-bank/decisionLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
- `publish.yml` is a separate manual workflow for npm publishing, using OIDC/trusted publishing for security
- The `verify-version` job ensures tag versions match `package.json` before proceeding with releases
- macOS builds include a debug step for async hook stack integrity (`SQLITE3_DEBUG_ASYNC_HOOKS=1`)
- Code coverage is uploaded to Codecov from the linux-x64/Node-24 matrix entry only
- Code coverage is uploaded to Codecov from the linux-x64/Node-26 matrix entry only

**Key workflow features**:
- 12-target build matrix (macOS x64/arm64, Linux x64/arm64, Windows x64/arm64 x Node 20/24)
- 12-target build matrix (macOS x64/arm64, Linux x64/arm64, Windows x64/arm64 x Node 22/26)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- Docker-based musl builds using `tools/BinaryBuilder.Dockerfile` with Alpine 3.20
- Prebuilt binaries uploaded to GitHub Release on tag events
- npm tarball created via `npm pack` and smoke-tested on 4 platforms
Expand Down Expand Up @@ -307,7 +307,7 @@ if (locked && pending == before_pending) {

### Node.js Version Requirement

**Decision**: Require Node.js >= 20.17.0
**Decision**: Require Node.js >= 22.1.0

**Rationale**:
- Modern NAPI support
Expand Down
8 changes: 4 additions & 4 deletions memory-bank/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Prerequisites

- Node.js >= 20.17.0
- Node.js >= 22.1.0
- Python 3 (for node-gyp)
- C++ compiler (gcc, clang, or MSVC)
- yarn or npm
Expand Down Expand Up @@ -370,8 +370,8 @@ The project uses GitHub Actions for continuous integration and release automatio
On every PR and push to `main`, the CI workflow:

1. **Verifies version** — Tag version must match `package.json` version
2. **Lints** — `yarn lint` on ubuntu-latest with Node 24
3. **Builds & tests** — 12-target matrix across 6 OS/arch combos x 2 Node versions (20, 24)
2. **Lints** — `yarn lint` on ubuntu-latest with Node 26
3. **Builds & tests** — 12-target matrix across 6 OS/arch combos x 2 Node versions (22, 26)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
4. **Builds musl binaries** — Docker-based Alpine builds for Linux musl (tag events only)
5. **Packages** — Merges all prebuilt binaries, creates npm tarball
6. **Smoke-tests** — Tests the npm tarball on 4 platforms with ESM + CJS + Promise API tests
Expand Down Expand Up @@ -434,4 +434,4 @@ yarn rebuild
## Related Files

- [Project Overview](project-overview.md) - Architecture and components
- [Build System](build-system.md) - Build configuration and options
- [Build System](build-system.md) - Build configuration and options
6 changes: 3 additions & 3 deletions memory-bank/project-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

**Package Name**: `@homeofthings/sqlite3`

**Node.js Version**: >= 20.17.0
**Node.js Version**: >= 22.1.0

## Architecture

Expand Down Expand Up @@ -222,7 +222,7 @@ node tools/benchmark-internal/run.js

The project uses three GitHub Actions workflows:

- **CI** (`.github/workflows/ci.yml`) — Build, test, and package across 14 targets (macOS x64/arm64, Linux x64/arm64, Windows x64 x Node 20/22/24) plus musl builds, packaging, and smoke tests
- **CI** (`.github/workflows/ci.yml`) — Build, test, and package across 12 targets (macOS x64/arm64, Linux x64/arm64, Windows x64/arm64 x Node 22/26) plus musl builds, packaging, and smoke tests
- **Publish** (`.github/workflows/publish.yml`) — Manual workflow to publish npm tarball from GitHub Release using OIDC/trusted publishing
- **Test npm Package** (`.github/workflows/test-npm-package.yml`) — Reusable workflow that smoke-tests the npm tarball on 4 platforms with CJS, ESM, and Promise API tests

Expand All @@ -232,4 +232,4 @@ See [Build System](build-system.md) for detailed CI/CD workflow documentation.

- [Build System](build-system.md) - Detailed build configuration and CI/CD workflows
- [Development Workflow](development.md) - Testing, contributing, and CI/CD pipeline
- [Decision Log](decisionLog.md) - Technical decisions including CI/CD pipeline design
- [Decision Log](decisionLog.md) - Technical decisions including CI/CD pipeline design
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"node-gyp": "12.x"
},
"engines": {
"node": ">=20.17.0"
"node": ">=22.1.0"
},
"scripts": {
"install": "node-gyp-build",
Expand Down
2 changes: 1 addition & 1 deletion tools/BinaryBuilder.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NODE_VERSION=20
ARG NODE_VERSION=22
ARG VARIANT=bookworm

FROM node:$NODE_VERSION-$VARIANT
Expand Down
2 changes: 1 addition & 1 deletion tools/benchmark-drivers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Despite lower raw throughput, async drivers provide **Non-Blocking I/O**, by pre

## Requirements

- **Node.js**: v20.17.0 or later (for N-API compatibility)
- **Node.js**: v22.1.0 or later (for N-API compatibility)
- **For `node:sqlite`**: Node.js v22.6.0+ (experimental) or v22.12.0+ (stable)

## Installation
Expand Down
Loading
Loading