Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0706307e85 | |||
| d57a454b78 | |||
| 34847cae59 |
@@ -0,0 +1,74 @@
|
||||
# CLAUDE.md — json-cas
|
||||
|
||||
Self-describing content-addressable storage with JSON Schema typed nodes.
|
||||
|
||||
## Project Structure
|
||||
|
||||
Monorepo with 4 packages under `packages/`:
|
||||
|
||||
| Package | Description |
|
||||
|---------|-------------|
|
||||
| `json-cas` | Core CAS engine — hashing, schema, store, verify, bootstrap |
|
||||
| `json-cas-fs` | Filesystem-backed CAS store |
|
||||
| `json-cas-workflow` | Workflow integration layer (schemas + types) |
|
||||
| `cli-json-cas` | CLI tool |
|
||||
|
||||
## Tech Stack
|
||||
|
||||
- **Runtime:** Bun
|
||||
- **Language:** TypeScript (strict mode, `exactOptionalPropertyTypes`, `noUncheckedIndexedAccess`)
|
||||
- **Build:** `tsc --build` (composite project references)
|
||||
- **Test:** `bun test`
|
||||
- **Lint/Format:** Biome (`biome check .` / `biome format --write .`)
|
||||
- **Publish:** Changesets → npmjs (`@uncaged/*`)
|
||||
|
||||
## Commands
|
||||
|
||||
```bash
|
||||
bun test # Run all tests
|
||||
bun run build # Build all packages
|
||||
bun run check # Biome lint
|
||||
bun run format # Biome format (auto-fix)
|
||||
```
|
||||
|
||||
## Code Conventions
|
||||
|
||||
### TypeScript
|
||||
|
||||
- **Strict mode** — no `any`, no unchecked index access, no implicit overrides
|
||||
- **`verbatimModuleSyntax`** — use `import type` for type-only imports
|
||||
- **Import paths** — use `.js` extension in imports (ESM convention with bundler resolution)
|
||||
- **Export style** — named exports only, re-export from `index.ts`
|
||||
|
||||
### Biome Rules
|
||||
|
||||
- `noConsole: "error"` globally (except `cli-json-cas`)
|
||||
- Recommended ruleset enabled
|
||||
- Auto-organize imports via `assist.actions.source.organizeImports`
|
||||
- Indent: 2 spaces
|
||||
|
||||
### Naming
|
||||
|
||||
- Types: `PascalCase` (`CasNode`, `Hash`, `Store`)
|
||||
- Functions: `camelCase` (`computeHash`, `createMemoryStore`)
|
||||
- Constants: `UPPER_SNAKE_CASE` (`BOOTSTRAP_STORE`)
|
||||
- Files: `kebab-case.ts`
|
||||
- Test files: co-located as `*.test.ts`
|
||||
|
||||
### Key Types
|
||||
|
||||
- `Hash` — 13-character uppercase Crockford Base32 string (XXH64)
|
||||
- `CasNode` — content-addressed node with schema
|
||||
- `Store` — abstract storage interface (get/put)
|
||||
|
||||
## Git
|
||||
|
||||
- Commit format: `type: description` (conventional commits)
|
||||
- Reference issues: `Fixes #N` / `Closes #N`
|
||||
- Author: `小橘 <xiaoju@shazhou.work>`
|
||||
|
||||
## Before Submitting
|
||||
|
||||
1. `bun test` — all tests pass
|
||||
2. `bun run check` — no lint errors
|
||||
3. `bun run build` — builds cleanly
|
||||
@@ -14,18 +14,18 @@
|
||||
},
|
||||
"packages/cli-json-cas": {
|
||||
"name": "@uncaged/cli-json-cas",
|
||||
"version": "0.3.0",
|
||||
"version": "0.5.0",
|
||||
"bin": {
|
||||
"json-cas": "./src/index.ts",
|
||||
},
|
||||
"dependencies": {
|
||||
"@uncaged/json-cas": "^0.3.0",
|
||||
"@uncaged/json-cas-fs": "^0.3.0",
|
||||
"@uncaged/json-cas": "workspace:^",
|
||||
"@uncaged/json-cas-fs": "workspace:^",
|
||||
},
|
||||
},
|
||||
"packages/json-cas": {
|
||||
"name": "@uncaged/json-cas",
|
||||
"version": "1.0.0",
|
||||
"version": "0.5.0",
|
||||
"dependencies": {
|
||||
"ajv": "^8.20.0",
|
||||
"cborg": "^4.2.3",
|
||||
@@ -34,17 +34,17 @@
|
||||
},
|
||||
"packages/json-cas-fs": {
|
||||
"name": "@uncaged/json-cas-fs",
|
||||
"version": "0.4.1",
|
||||
"version": "0.5.0",
|
||||
"dependencies": {
|
||||
"@uncaged/json-cas": "^0.4.0",
|
||||
"@uncaged/json-cas": "workspace:^",
|
||||
"cborg": "^4.2.3",
|
||||
},
|
||||
},
|
||||
"packages/json-cas-workflow": {
|
||||
"name": "@uncaged/json-cas-workflow",
|
||||
"version": "0.4.1",
|
||||
"version": "0.5.0",
|
||||
"dependencies": {
|
||||
"@uncaged/json-cas": "^0.4.0",
|
||||
"@uncaged/json-cas": "workspace:^",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -311,14 +311,6 @@
|
||||
|
||||
"@manypkg/get-packages/fs-extra": ["fs-extra@8.1.0", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } }, "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g=="],
|
||||
|
||||
"@uncaged/cli-json-cas/@uncaged/json-cas": ["@uncaged/json-cas@0.3.0", "", { "dependencies": { "ajv": "^8.20.0", "cborg": "^4.2.3", "xxhash-wasm": "^1.1.0" } }, "sha512-LR8Uow7cBdvH+6y9mh9Fd7zDs8fWhfhpVZVsexfdK1KKnGaR7WvukuhBj6r0FbOZ78j7jhjeEfzsUXR2cHELwQ=="],
|
||||
|
||||
"@uncaged/cli-json-cas/@uncaged/json-cas-fs": ["@uncaged/json-cas-fs@0.3.0", "", { "dependencies": { "@uncaged/json-cas": "^0.3.0", "cborg": "^4.2.3" } }, "sha512-shelE7PXtBAsJtJ2Axo5yBScErV/kgi2OUiIUXnEP8BL6L760BRz9W6PDb6jHVKrWOh1HIdYUYODYaHRWY0UxA=="],
|
||||
|
||||
"@uncaged/json-cas-fs/@uncaged/json-cas": ["@uncaged/json-cas@0.4.0", "", { "dependencies": { "ajv": "^8.20.0", "cborg": "^4.2.3", "xxhash-wasm": "^1.1.0" } }, "sha512-DQ65BiMwPeitxEmMYEyQoVO99GQeOBMv0Lgc/ZZkUCKFpTkxZ0tngDD1NsF7suLkIOLxnuBgUKon7t7Yc8eWgw=="],
|
||||
|
||||
"@uncaged/json-cas-workflow/@uncaged/json-cas": ["@uncaged/json-cas@0.4.0", "", { "dependencies": { "ajv": "^8.20.0", "cborg": "^4.2.3", "xxhash-wasm": "^1.1.0" } }, "sha512-DQ65BiMwPeitxEmMYEyQoVO99GQeOBMv0Lgc/ZZkUCKFpTkxZ0tngDD1NsF7suLkIOLxnuBgUKon7t7Yc8eWgw=="],
|
||||
|
||||
"read-yaml-file/js-yaml": ["js-yaml@3.14.2", "", { "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg=="],
|
||||
|
||||
"read-yaml-file/js-yaml/argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@uncaged/cli-json-cas",
|
||||
"version": "0.3.0",
|
||||
"version": "0.5.0",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"json-cas": "./src/index.ts"
|
||||
@@ -9,7 +9,7 @@
|
||||
"test": "bun test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uncaged/json-cas": "^0.3.0",
|
||||
"@uncaged/json-cas-fs": "^0.3.0"
|
||||
"@uncaged/json-cas": "workspace:^",
|
||||
"@uncaged/json-cas-fs": "workspace:^"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@uncaged/json-cas-fs",
|
||||
"version": "0.4.1",
|
||||
"version": "0.5.0",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -15,7 +15,7 @@
|
||||
"test": "bun test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uncaged/json-cas": "^0.4.0",
|
||||
"@uncaged/json-cas": "workspace:^",
|
||||
"cborg": "^4.2.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@uncaged/json-cas-workflow",
|
||||
"version": "0.4.1",
|
||||
"version": "0.5.0",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@@ -15,6 +15,6 @@
|
||||
"test": "bun test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uncaged/json-cas": "^0.4.0"
|
||||
"@uncaged/json-cas": "workspace:^"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@uncaged/json-cas",
|
||||
"version": "1.0.0",
|
||||
"version": "0.5.0",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
|
||||
Reference in New Issue
Block a user