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
57 changes: 57 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Repository Guidelines

## Project Structure & Module Organization

- `src/` — TypeScript API and types (`functions.ts`, `Storage.ts`, `types.ts`).
- `cpp/` — C++ JSI core and bundled SQLite sources; runs on iOS/Android.
- `android/` — Kotlin TurboModule + JNI glue (`CMakeLists.txt`, `*.kt`).
- `ios/` — Objective‑C++ TurboModule (`OPSQLite.mm`) and `.xcframework` assets.
- `c_sources/` — optional SQLite tokenizers/extensions compiled into the binary.
- `example/` — React Native demo for local testing (iOS/Android).
- `lib/` — build output (generated by `bob`); do not commit.

## Build, Test, and Development Commands

- Prereqs: Node 20 (`.nvmrc`), Yarn 4 (`yarn.lock`), Ruby for iOS pods.
- Install deps: `yarn install`
- Type check TS: `yarn typecheck`
- Build JS outputs: `yarn prepare` (runs `bob build` → `lib/`)
- Format native C/C++: `yarn clang-format-check`
- Example app:
- Install pods: `yarn pods` (runs in `example/`)
- iOS run: `cd example && yarn ios`
- Android run: `cd example && yarn android` (or `yarn build:android`)

## Coding Style & Naming Conventions

- TypeScript: Prettier enforced via `package.json` (single quotes, 2‑space

Copilot AI Sep 12, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The character used for the dash in '2‑space' appears to be a non-breaking hyphen (U+2011) instead of a regular hyphen. This should be changed to a regular hyphen for consistency: '2-space'.

Suggested change
- TypeScript: Prettier enforced via `package.json` (single quotes, 2space
- TypeScript: Prettier enforced via `package.json` (single quotes, 2-space

Copilot uses AI. Check for mistakes.
indent, trailing commas `es5`). Use camelCase for variables/functions;
PascalCase for types/classes. Keep strict typing; fix unused vars/params.
- C/C++: `.clang-format` (LLVM style, 4‑space indent). Run
`yarn clang-format-check` before pushing.
- Kotlin/Obj‑C(++): Follow platform conventions and keep methods focused and

Copilot AI Sep 12, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The character used for the dash in 'Obj‑C(++)' appears to be a non-breaking hyphen (U+2011) instead of a regular hyphen. This should be changed to a regular hyphen for consistency: 'Obj-C(++)'.

Suggested change
- Kotlin/ObjC(++): Follow platform conventions and keep methods focused and
- Kotlin/Obj-C(++): Follow platform conventions and keep methods focused and

Copilot uses AI. Check for mistakes.
small.

## Testing Guidelines

- No Jest configured. Validate changes with the `example/` app. Add minimal,
reproducible flows under `example/src` when fixing bugs or adding features.
- Verify both platforms build cleanly. Always run `yarn typecheck` and a local
`yarn prepare` before opening a PR.

## Commit & Pull Request Guidelines

- Commits: clear, imperative messages. Conventional prefixes encouraged
(`feat:`, `fix:`, `docs:`, `chore:`) with optional scope (`android`, `ios`,
`cpp`, `ts`).
- PRs: include a summary, motivation, test steps (iOS/Android), linked issues,
and any performance notes/screenshots or logs.
- Hygiene: do not commit `lib/`, `example/ios/Pods/`, or build artifacts. Ensure
`yarn prepare` succeeds locally.

## Architecture Notes

- JSI TurboModule: `src/` exposes the public API; native JSI lives in `cpp/`,
bridged via `android/` (JNI/Kotlin) and `ios/` (Obj‑C++). Feature flags (FTS5,
RTree, SQLCipher, libsql) for the demo are configured in
`example/package.json` under `op-sqlite`.
1 change: 1 addition & 0 deletions CLAUDE.md
Loading