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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
test:
name: ${{ matrix.os }} / Node ${{ matrix.node }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
node: '22.18.0'
- os: ubuntu-latest
node: '24'
- os: macos-15
node: '24'
- os: windows-latest
node: '24'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- uses: dtolnay/rust-toolchain@1.90.0
with:
components: clippy,rustfmt
- uses: Swatinem/rust-cache@v2
- run: npm ci --ignore-scripts
- run: npm run format:check
- run: npm run lint
- run: npm test
- run: git diff --exit-code -- ts/addon.d.ts

supply-chain:
name: Supply chain and native linkage
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: npm
- uses: dtolnay/rust-toolchain@1.90.0
- uses: taiki-e/install-action@cargo-deny
- run: npm ci --ignore-scripts
- run: cargo deny check
- run: npm audit --audit-level=high
- run: npm run build:native
- name: Reject linked RocksDB symbols
run: |
set -euo pipefail
artifact=fulltext.linux-x64-gnu.node
test -f "$artifact"
if cargo tree --locked --all-features | grep -qi rocksdb; then exit 1; fi
nm -D --defined-only "$artifact" > "$RUNNER_TEMP/fulltext-symbols.txt"
test -s "$RUNNER_TEMP/fulltext-symbols.txt"
grep -q napi_register_module_v1 "$RUNNER_TEMP/fulltext-symbols.txt"
if grep -qi rocksdb "$RUNNER_TEMP/fulltext-symbols.txt"; then exit 1; fi
ldd "$artifact" > "$RUNNER_TEMP/fulltext-linkage.txt"
test -s "$RUNNER_TEMP/fulltext-linkage.txt"
if grep -qi rocksdb "$RUNNER_TEMP/fulltext-linkage.txt"; then exit 1; fi
- name: Verify unwind profile
run: cargo rustc --locked --release --features node-api -- --print cfg | grep 'panic="unwind"'
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
target/
*.node
*.tgz
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Cargo.lock
package-lock.json
dist/
target/
ts/addon.d.ts
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 120,
"singleQuote": true,
"useTabs": true,
"trailingComma": "all"
}
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributing

## Setup

Install Node.js 22.18 or newer and Rust 1.90, then install JavaScript dependencies without running
package lifecycle scripts:

```bash
npm ci --ignore-scripts
```

## Checks

Run the same primary checks used in CI:

```bash
npm run format:check
npm run lint
npm test
```

Rust tests exercise the engine and directory contract without Node.js. Node tests build the addon,
load it through the public `./native` entry point, verify panic containment, and install the output
of `npm pack` into a temporary consumer project.

## Design constraints

- Keep search, indexing, scheduling, and lifecycle behavior shared across storage backends.
- Keep backend choice explicit; do not introduce automatic fallback.
- Do not link RocksDB into this addon. The future Rocks backend must use the versioned lease owned
by rocksdb-js.
- Do not expose generated Node-API declarations as the public TypeScript API.
- Keep CPU and sustained I/O work off the Node.js event loop. The promise-shaped capability call may
synchronously load the addon once; no search, indexing, commit, or storage operation gets that
exception.
- Add a direct test for each source module.

Open an issue before changing a public package entry point, native ABI, persistence contract, or
supported-platform matrix.
Loading
Loading