@coldge.com/gitbase-core
v0.1.0
Published
Platform-agnostic core engine for GitBase schema version control.
Downloads
55
Maintainers
Readme
@coldge.com/gitbase-core
Shared platform-agnostic library used by GitBase CLI and extension.
Install
npm install @coldge.com/gitbase-coreWhat This Package Provides
- Schema extraction (
SchemaExtractor) - Tree/path mapping (
buildProjectTree) - Content-addressed object storage (
ObjectStore) - Commit/branch storage (
CommitStore) - Diffing (
diffSchema,diffTrees,diffCommits,diffLiveTree) - Planning and reset orchestration (
buildExecutionPlan,buildResetPreview,applyResetPlan) - Data snapshot/restore helpers
- GitHub sync helpers (
GitHubManagementClient,pushTreeToGitHub, path mapping)
Minimal Usage Example
import { ObjectStore, CommitStore } from "@coldge.com/gitbase-core";
import type { FileSystemAdapter } from "@coldge.com/gitbase-core";
const fsAdapter: FileSystemAdapter = /* provide adapter */ null as never;
const objectStore = new ObjectStore(fsAdapter);
const commitStore = new CommitStore(fsAdapter, objectStore);Adapter Model
The core package is runtime-agnostic and expects adapters:
FileSystemAdapterDatabaseAdapterHttpAdapter
This allows using the same core in Node.js (CLI) and browser environments (extension).
Requirements
- Node.js
>=18
Development
npm run build -w @coldge.com/gitbase-core
npm run typecheck -w @coldge.com/gitbase-core