@ingitdb/client
v0.1.0
Published
Core types, interfaces, and utilities for inGitDB clients
Readme
@ingitdb/client
Core types, interfaces, and shared utilities for inGitDB clients. This package is a pure abstraction layer — it has no dependency on IndexedDB, browser APIs, or Node.js-specific modules and works in any JavaScript environment.
Packages
| Package | Description |
|---------|-------------|
| @ingitdb/client | Core interfaces and shared utilities (this package) |
| @ingitdb/client-github | Browser client backed by the GitHub REST API (owns IndexedDB) |
| @ingitdb/client-fs | Client for local git repositories (coming soon) |
Installation
npm install @ingitdb/clientWhat's in this package
IngitDbClient— transport-agnostic client interfaceCache/StorageAdapter— caching interfaces +createCache(adapter?)factory- No adapter → memory-only (works in Node.js, browsers, tests)
- Pass a
StorageAdapter(e.g.idbCachefrom@ingitdb/client-github) for persistence
CollectionSchema— schema parsing utilities (parseCollectionSchema,normalizeCollectionSchema)parseYaml/stringifyYaml— YAML helperscreateCommittedChangesStore— in-memoryCommittedChangesStore(Node.js / testing)- Shared types —
DatabaseConfig,RecordRow,RecordData,FKView,RepoMeta,RepoSettings,PendingChange,CommittedChangesStore,PendingChangesStore
What's NOT in this package
IndexedDB and any other browser/platform-specific storage is intentionally absent. The StorageAdapter interface lets you plug in your own:
import { createCache } from '@ingitdb/client'
import { idbCache } from '@ingitdb/client-github' // browser IDB adapter
const cache = createCache(idbCache) // IDB-backed
const memCache = createCache() // memory-onlyDevelopment
pnpm build # compile to dist/
pnpm lint # tsc --noEmit
pnpm test # vitest (watch)
pnpm test:run # vitest (single run)