docs: update all documentation for node:sqlite, pnpm, proman workflow
- README: bun → pnpm, update API examples, add Node >=22.5.0 requirement - CLAUDE.md: replace 3-phase release process with proman bump/publish - Package READMEs: fix package names, update storage/API descriptions - Cards: update store.md (sqlite), cli.md (db filename, remove --var-db) - docs/sync-readme.md: update to proman workflow
This commit is contained in:
@@ -15,17 +15,17 @@ The store is **auto-created and bootstrapped** on first use, so there is no `ini
|
||||
Published as an npm package with a binary entry:
|
||||
|
||||
```bash
|
||||
bun add -g @ocas/cli
|
||||
pnpm add -g @ocas/cli
|
||||
# or from the monorepo workspace:
|
||||
bun link
|
||||
pnpm link
|
||||
```
|
||||
|
||||
**Binary name:** `ocas` (points to `src/index.ts`, run with Bun).
|
||||
**Binary name:** `ocas` (points to `dist/index.js`, run with Node).
|
||||
|
||||
In development:
|
||||
|
||||
```bash
|
||||
bun packages/cli-ocas/src/index.ts <command> [args]
|
||||
node packages/cli/dist/index.js <command> [args]
|
||||
```
|
||||
|
||||
## CLI Usage
|
||||
|
||||
@@ -6,14 +6,14 @@ Core CAS engine — hashing, schema, store, verify, bootstrap.
|
||||
|
||||
`@ocas/core` is the foundation of the ocas monorepo. It defines content-addressed nodes (`CasNode`), the `Store` interface, XXH64-based hashing with deterministic CBOR, JSON Schema registration and validation (including `cas_ref` links between nodes), bootstrap seeding, and integrity verification.
|
||||
|
||||
Other packages build on this layer: `ocas-fs` provides persistence, and `cli-ocas` exposes store operations on the command line.
|
||||
Other packages build on this layer: `@ocas/fs` provides persistence, and `@ocas/cli` exposes store operations on the command line.
|
||||
|
||||
**Dependencies:** `ajv`, `cborg`, `xxhash-wasm`
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @ocas/core
|
||||
pnpm add @ocas/core
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
+7
-20
@@ -4,7 +4,7 @@ Filesystem-backed CAS store.
|
||||
|
||||
## Overview
|
||||
|
||||
`@ocas/fs` implements a persistent `Store` on disk. Each node is stored as `<hash>.bin` (CBOR-encoded `CasNode`). A `_index/` directory maps type hashes to content hashes for `listByType`. Stores support bootstrap via the same `BOOTSTRAP_STORE` symbol as the in-memory implementation.
|
||||
`@ocas/fs` implements a persistent `Store` backed by `node:sqlite` (`DatabaseSync`). Nodes are stored as CBOR blobs in SQLite tables. Stores support bootstrap via the same `BOOTSTRAP_STORE` symbol as the in-memory implementation.
|
||||
|
||||
Depends on `@ocas/core` for hashing, CBOR encoding, and types.
|
||||
|
||||
@@ -13,7 +13,7 @@ Depends on `@ocas/core` for hashing, CBOR encoding, and types.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @ocas/fs
|
||||
pnpm add @ocas/fs
|
||||
```
|
||||
|
||||
## API
|
||||
@@ -21,19 +21,18 @@ bun add @ocas/fs
|
||||
Exported from `src/index.ts`:
|
||||
|
||||
```typescript
|
||||
function createFsStore(dir: string): BootstrapCapableStore;
|
||||
function openStore(path: string): Promise<Store>;
|
||||
```
|
||||
|
||||
Returns a `BootstrapCapableStore` from `@ocas/core`. The store loads existing `.bin` files on open and migrates or builds the type index on first use.
|
||||
Returns a unified `Store` with `cas`, `var`, and `tag` sub-stores, backed by SQLite. Bootstraps automatically on open.
|
||||
|
||||
### Example
|
||||
|
||||
```typescript
|
||||
import { bootstrap, putSchema } from "@ocas/core";
|
||||
import { createFsStore } from "@ocas/fs";
|
||||
import { putSchema } from "@ocas/core";
|
||||
import { openStore } from "@ocas/fs";
|
||||
|
||||
const store = createFsStore("./my-cas-store");
|
||||
await bootstrap(store);
|
||||
const store = await openStore("./my-cas-store");
|
||||
|
||||
const typeHash = await putSchema(store, {
|
||||
type: "object",
|
||||
@@ -46,18 +45,6 @@ const hash = await store.put(typeHash, { id: "item-1" });
|
||||
console.log(store.has(hash)); // true after restart if same dir
|
||||
```
|
||||
|
||||
### On-disk layout
|
||||
|
||||
```
|
||||
my-cas-store/
|
||||
├── <hash>.bin # CBOR CasNode
|
||||
├── _index/
|
||||
│ └── <typeHash> # newline-separated content hashes
|
||||
└── ...
|
||||
```
|
||||
|
||||
Writes use atomic rename (`<hash>.tmp` → `<hash>.bin`).
|
||||
|
||||
## Internal Structure
|
||||
|
||||
| File | Purpose |
|
||||
|
||||
Reference in New Issue
Block a user