Docs

Contributing

@devioarts/capacitor-sqlite targets four backends — iOS, Android, Web/OPFS, and Electron. Keep changes small, cross-platform where possible, and covered by the shared playground suite when behavior changes.

Local setup

  1. Fork and clone the repository.

  2. Install root dependencies:

    npm ci
    
  3. Install playground dependencies if you'll run Web, Android, or iOS suite tests:

    npm ci --prefix playground
    
  4. On macOS, make sure Xcode command line tools and Swift tooling are available. Android work needs a working Android SDK and an emulator/device visible to adb.

Common commands

Command What it does
npm run build Builds the plugin, regenerates API docs with @capacitor/docgen, compiles TypeScript, bundles the Web plugin, builds Electron entry points
npm run lint Runs ESLint, Prettier, and SwiftLint (SwiftLint should report 0 violations before review)
npm run test:p2 Lightweight regression gate: JS SQL guard tests, iOS XCTest, Android unit tests, Web/Electron builds, migration validation tests

Full suite

The shared behavioral suite currently has 401 tests across 75 groups, plus 12 stress benchmarks and 24 diagnostics. The same test definitions back the playground UI and the CLI runners — see Testing for the full command table:

npm run test:suite:electron
npm run test:suite:web
npm run test:suite:android
npm run test:suite:ios

Append :stress to also run the stress benchmarks, e.g. npm run test:suite:web:stress.

GitHub Actions

  • CI runs automatically on pull requests and pushes to main: lint/format checks, build, JS guard tests, the Electron suite, and the Web/OPFS suite.
  • Release Matrix is manually triggered before a release: Electron, Web/OPFS, Android, and iOS as separate jobs, optionally including stress benchmarks, with platform logs uploaded as workflow artifacts.

Pull requests

Before opening a PR:

  • Run the smallest relevant local test first.
  • Run npm run lint.
  • Update README.md, TESTING.md, or CHANGELOG.md when behavior, commands, or release-visible behavior changes.
  • Include platform notes when a change affects only one backend.
  • Avoid committing generated package tarballs (*.tgz) or local build artifacts.

Publishing

Publishing is done from the package root:

npm run release

The prepublishOnly hook runs npm run build before publishing. The files array in package.json controls what ships in the npm package — verify with:

npm pack --dry-run

Next

Testing covers each CLI runner and the manual-testing scenarios referenced above in more depth.

Last updated on July 17, 2026