Gitapp
Reference for the public surface of every package in the stack. Generated
from the package source — see the JSDoc pages (docstore , git-fs , gitapp , gitapp-ui ) for the full type-level
view.
Storage-agnostic interface package. No git knowledge — implementations
include @dev-bench/gitapp (git-backed) and future obsidian-store /
fs-store backends.
Export Signature Summary DocStoreinterfaceRead / list / runTransaction / watch / syncIn / drain. Atomic mutations, opaque versionToken CAS.
Export Kind Summary ReadResult / ReadResultSchemaunion found | missing for docStore.read.DocEntry / DocEntrySchematype Listing entry: { path, type, versionToken }. IfMatch / IfMatchSchemaunion Optimistic CAS token: any | absent | version. JsonPatchOp / JsonPatchOpSchemaunion RFC-6902 op for json-patch mutations. FrontmatterBody / FrontmatterBodySchemaunion Body for upsert-frontmatter mutations. IfMissing / IfMissingSchemaenum create-empty | fail policy when target missing.Mutation / MutationSchemaunion put | delete | json-patch | upsert-frontmatter.ConflictPolicy / ConflictPolicySchemaunion fail | retry-after-pull | rebase-mutations.Transaction / TransactionSchematype Input to runTransaction. TransactionResult / TransactionResultSchemaunion ok | conflict | rejected | network.WatchEvent / WatchEventSchemaunion Remote-driven change notification. SyncInResult / SyncInResultSchemaunion Result of syncIn().
Pin to the v1 API explicitly via @dev-bench/docstore/apis/v1.
Cross-platform git filesystem layer with browser / Node / in-memory
adapters and provider-specific REST management.
Export Kind Summary GitFsinterfaceRead / list / commit / push / pull / clone / reset. Every method returns a discriminated union; nothing throws on user-recoverable conditions. RepoManagementinterfaceREST ops: listMyRepos, createRepo, getRepo, currentLogin. Provider-orthogonal.
Import Signature Summary createBrowserGitFs(BrowserGitFsConfig) => GitFsLightningFS (IndexedDB) + isomorphic-git web http. createInMemoryGitFs(InMemoryGitFsConfig?) => GitFsPure-memory fs for tests, sandboxes, fixtures. createInMemoryRemote(id: string) => InMemoryRemotePair with createInMemoryGitFs to simulate push/pull. createNodeGitFs(NodeGitFsConfig) => GitFsNode fs + isomorphic-git node http.
Imports:
import { createBrowserGitFs } from "@dev-bench/git-fs/adapters/browser" ;
import { createInMemoryGitFs, createInMemoryRemote } from "@dev-bench/git-fs/adapters/in-memory" ;
import { createNodeGitFs } from "@dev-bench/git-fs/adapters/node" ;
Import Signature Summary githubManagement(GithubManagementConfig) => RepoManagementGitHub REST. giteaManagement(GiteaManagementConfig) => RepoManagementGitea REST. gitlabManagement(GitlabManagementConfig) => RepoManagementGitLab REST.
Imports:
import { githubManagement } from "@dev-bench/git-fs/mgmt/github" ;
import { giteaManagement } from "@dev-bench/git-fs/mgmt/gitea" ;
import { gitlabManagement } from "@dev-bench/git-fs/mgmt/gitlab" ;
ProviderId, TokenLookup (+ tokenAbsent / tokenPresent helpers),
RepoRef, Author, FileChange, ReadFileResult, TreeEntry,
HeadTreeState, CommitInput, CommitResult, PushResult,
PullResult, ResetHeadResult, CloneResult, plus RepoInfo,
CreateRepoArgs, CreatedRepo, RepoLookupResult,
CurrentLoginResult for management ops. All exported as both *Schema
(Zod) and T (inferred type).
Import Summary @dev-bench/git-fs/polyfills/browserWeb Crypto / SHA fallbacks for older browsers. @dev-bench/git-fs/metro-configMetro resolver tweaks for React Native.
Layer 2: a DocStore implementation that wires @dev-bench/git-fs
storage into the @dev-bench/docstore interface.
Export Signature Summary createGitAppDocStore(GitAppDocStoreConfig) => DocStoreBuild a DocStore from gitFs, mgmt, repoRef, getToken, author. GitAppDocStoreConfiginterfaceConfig shape (see Getting Started ).
These let advanced consumers assemble their own DocStore using the
same building blocks the canonical implementation uses.
Export Signature Summary SerialQueueclassFIFO promise queue; one-at-a-time transaction execution. WatchRegistryclassPrefix-keyed subscriber registry for docStore.watch. runTransaction(RunnerConfig, Transaction) => Promise<TransactionResult>Bare transaction runner — no queue, no watch. runSyncIn(RunnerConfig) => Promise<SyncInResult>Bare pull + watch-emit cycle. RunnerConfigtypeShared deps for runTransaction / runSyncIn.
Layer 3: cross-platform UI primitives + components for any app built on
top of the docstore. One codebase: React Native + react-native-web.
Peer dependencies: react, react-native (or react-native-web),
react-native-svg.
Export Kind Summary ThemeProvider, useThemecomponent / hook Theme injection. defaultLightThemeconst Light theme v1. mergeThemefunction Deep-merge a partial theme into another. Theme, ThemeColors, ThemeFonts, ThemeRadii, ThemeSpacing, ThemeShadow, ThemeShadows, ThemeTypographytypes Token shapes.
Export Kind Summary Resourceconst Idle / loading / ready / error sentinel constructors. Resource<T> (ResourceT)type The 4-state discriminated union every async control branches on. Err, StatusTone, Connectivity, ProviderIdtypes Shared across components.
Component Summary Icon (+ IconName)Themed icon set (RN-svg). SpinnerAnimated busy indicator. ChipTag / pill. DotStatus dot. BannerInline banner (info / warning / error). ButtonThemed pressable. CardSurface container. SkeletonLoading placeholder. ProgressBarDeterminate progress.
Each component takes a *ViewModel / *Model prop the host app
implements. Async actions render the full idle / loading / ready / error
cycle.
Component Summary ConnectionPanelOAuth / PAT connection flow. RepoPickerSheet (+ RepoRow)Pick a repo from the user's accessible list. CreateRepoFormCreate a new repo on the active provider. InitializationSequence (+ InitStepRow)Multi-step init progress (clone, validate, …). SyncStatusBarReference 4-state sync indicator. SyncStatusBadgeCompact always-visible sync state badge. ConflictShell (+ FileTreeRow)Layout shell for the conflict resolver. BranchGraphDivergence visualization. DivergenceExplainerPlain-English explanation of why local and remote diverged. ConflictResolverSheet (+ TextPreview)Per-file conflict resolution. RepoStateRecoveryPanel (+ FindingItem)Diagnose + recover a broken local repo. ValidationFailureBanner (+ FailureRow)Show schema-validation failures from a transaction. RepoStatusRowSingle-line repo status. ResourceButtonButton that renders a Resource<T> lifecycle. DiagnosticsSheet (+ DiagnosticsRow)Live diagnostics log surface. ProviderSelectorGitHub / Gitea / GitLab picker. EditorialBadgeEditorial-state chip (draft / pr-open / merged / …). ForkRepoButton4-state fork action. PullRequestComposerCompose / publish a PR over the docstore. EditorialQueueScreen (+ EditorialQueueRowCard)Top-level kanban/list of content records. RecordReviewSheetPer-record PR review (approve / request-changes / close).
Drop-in renderers for common record types in editorial UIs:
Component Record type PreviewPpaTaskPPA task. PreviewCmsArticleCMS article (frontmatter diff aware). PreviewBookmarkBookmark. PreviewPasswordEntryPassword entry.
Export Kind Summary RepoMode (+ RepoModeSchema, isWritable, describeMode)union + helpers Read-only / writable repo mode. RecordEditorialState (+ schema, describeEditorialState)union Editorial lifecycle of a single record. RepoEditorialMode (+ schema)union Repo-level editorial mode (direct / pr-only / …). PullRequestRef (+ schema)type Reference to a PR. readEditorialConfigfunction Read editorial config from a EditorialConfigSource.