diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b791f0f..38c57b10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 @@ -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 }} @@ -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 }} @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6e68274b..2937ba2b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ permissions: env: FORCE_COLOR: 1 - DEFAULT_NODE_VERSION: '24' + DEFAULT_NODE_VERSION: '26' jobs: publish: @@ -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 }} \ No newline at end of file + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/test-electron-package.yml b/.github/workflows/test-electron-package.yml index baa7e8b8..76487fee 100644 --- a/.github/workflows/test-electron-package.yml +++ b/.github/workflows/test-electron-package.yml @@ -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: @@ -30,7 +30,7 @@ on: node_version: description: 'Node.js version for npm/setup' required: false - default: '20' + default: '26' type: string permissions: @@ -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 }} @@ -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' diff --git a/.github/workflows/test-npm-package.yml b/.github/workflows/test-npm-package.yml index 5278f86b..6fb27453 100644 --- a/.github/workflows/test-npm-package.yml +++ b/.github/workflows/test-npm-package.yml @@ -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: @@ -20,7 +20,7 @@ on: node_version: description: 'Node.js version to test with' required: false - default: '20' + default: '26' type: string permissions: @@ -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 }} @@ -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 diff --git a/README.md b/README.md index 712bb9e6..5c6b83f2 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/memory-bank/build-system.md b/memory-bank/build-system.md index f0ccd675..c3de58fa 100644 --- a/memory-bank/build-system.md +++ b/memory-bank/build-system.md @@ -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..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..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?** @@ -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**: @@ -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 @@ -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 | | `ALPINE_VARIANT` | `'alpine3.20'` | Alpine variant for musl Docker builds | **Jobs**: @@ -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`) @@ -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 @@ -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) diff --git a/memory-bank/custom-instructions.md b/memory-bank/custom-instructions.md index 3af9acfa..e4789864 100644 --- a/memory-bank/custom-instructions.md +++ b/memory-bank/custom-instructions.md @@ -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. diff --git a/memory-bank/decisionLog.md b/memory-bank/decisionLog.md index c2151f4a..5e71ecca 100644 --- a/memory-bank/decisionLog.md +++ b/memory-bank/decisionLog.md @@ -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) - 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 @@ -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 diff --git a/memory-bank/development.md b/memory-bank/development.md index 1156e93b..be080e1b 100644 --- a/memory-bank/development.md +++ b/memory-bank/development.md @@ -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 @@ -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) 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 @@ -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 \ No newline at end of file +- [Build System](build-system.md) - Build configuration and options diff --git a/memory-bank/project-overview.md b/memory-bank/project-overview.md index 3c7d8bfa..df6f0f88 100644 --- a/memory-bank/project-overview.md +++ b/memory-bank/project-overview.md @@ -8,7 +8,7 @@ **Package Name**: `@homeofthings/sqlite3` -**Node.js Version**: >= 20.17.0 +**Node.js Version**: >= 22.1.0 ## Architecture @@ -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 @@ -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 \ No newline at end of file +- [Decision Log](decisionLog.md) - Technical decisions including CI/CD pipeline design diff --git a/package.json b/package.json index 2df33b6e..ec736bb9 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "node-gyp": "12.x" }, "engines": { - "node": ">=20.17.0" + "node": ">=22.1.0" }, "scripts": { "install": "node-gyp-build", diff --git a/tools/BinaryBuilder.Dockerfile b/tools/BinaryBuilder.Dockerfile index b90b1b55..35d79ee0 100644 --- a/tools/BinaryBuilder.Dockerfile +++ b/tools/BinaryBuilder.Dockerfile @@ -1,4 +1,4 @@ -ARG NODE_VERSION=20 +ARG NODE_VERSION=22 ARG VARIANT=bookworm FROM node:$NODE_VERSION-$VARIANT diff --git a/tools/benchmark-drivers/README.md b/tools/benchmark-drivers/README.md index 7bc88b5f..a0410077 100644 --- a/tools/benchmark-drivers/README.md +++ b/tools/benchmark-drivers/README.md @@ -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 diff --git a/tools/semver-check.js b/tools/semver-check.js index cedc7a71..16298c47 100644 --- a/tools/semver-check.js +++ b/tools/semver-check.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const semver = require('semver'); -const supportedVersions = '20.17.0'; +const supportedVersions = '22.1.0'; function checkEngines(modulePath) { const packageJsonPath = path.join(modulePath, 'package.json');