{"id":48527417,"url":"https://github.com/cleverbrush/framework","last_synced_at":"2026-04-18T15:09:09.009Z","repository":{"id":43879952,"uuid":"465697477","full_name":"cleverbrush/framework","owner":"cleverbrush","description":"A collection of lightweight, strongly-typed TypeScript utility libraries — schema validation with type inference, async helpers, deep object operations, object mapping, job scheduling, and more.","archived":false,"fork":false,"pushed_at":"2026-04-04T23:06:56.000Z","size":3646,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-05T00:34:02.300Z","etag":null,"topics":["async-utility","clickhouse","deep-merge","job-scheduler","knex","monorepo","npm-workspaces","object-mapping","schema-validation","typescript","utility-library","vitest"],"latest_commit_sha":null,"homepage":"https://docs.cleverbrush.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cleverbrush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-03T11:49:09.000Z","updated_at":"2026-04-03T13:21:49.000Z","dependencies_parsed_at":"2024-04-21T03:21:43.541Z","dependency_job_id":"2f9174f9-3aeb-470b-9794-97ab5a31193b","html_url":"https://github.com/cleverbrush/framework","commit_stats":{"total_commits":124,"total_committers":2,"mean_commits":62.0,"dds":0.06451612903225812,"last_synced_commit":"b2007d25c03e236033990c041cf1cdacd6d375e3"},"previous_names":["cleverbrush/libs"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/cleverbrush/framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverbrush%2Fframework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverbrush%2Fframework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverbrush%2Fframework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverbrush%2Fframework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cleverbrush","download_url":"https://codeload.github.com/cleverbrush/framework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleverbrush%2Fframework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31532336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-utility","clickhouse","deep-merge","job-scheduler","knex","monorepo","npm-workspaces","object-mapping","schema-validation","typescript","utility-library","vitest"],"created_at":"2026-04-07T23:00:19.462Z","updated_at":"2026-04-07T23:00:37.367Z","avatar_url":"https://github.com/cleverbrush.png","language":"TypeScript","readme":"# Cleverbrush Framework\n\n[![CI](https://github.com/cleverbrush/framework/actions/workflows/ci.yml/badge.svg)](https://github.com/cleverbrush/framework/actions/workflows/ci.yml)\n[![License: BSD-3-Clause](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](./LICENSE)\n[![Standard Schema v1](https://img.shields.io/badge/Standard%20Schema-v1-blue)](https://standardschema.dev/)\n\u003c!-- coverage-badge-start --\u003e\n![Coverage](https://img.shields.io/badge/coverage-97.9%25-brightgreen)\n\u003c!-- coverage-badge-end --\u003e\n\nA monorepo of production-quality TypeScript libraries. Written with zero runtime dependencies, strict types, and a strong focus on correctness — every package ships with unit tests, full TypeScript type coverage, and automated CI on every pull request.\n\nThe flagship package is **`@cleverbrush/schema`** — a schema validation library that is faster than Zod in 14 out of 15 benchmarks (up to 204× faster on invalid input), 3× smaller than Zod v4 in bundle size, and compatible with 50+ ecosystem tools via [Standard Schema v1](https://standardschema.dev/).\n\n---\n\n## Packages\n\n| Package | Description |\n| --- | --- |\n| [`@cleverbrush/schema`](./libs/schema) | Schema definition, type inference, and runtime validation. [Standard Schema v1](https://standardschema.dev/) compatible — works with tRPC, TanStack Form, React Hook Form, T3 Env, Hono, and 50+ other tools. Wraps external schemas (Zod, Valibot, ArkType) via `extern()` |\n| [`@cleverbrush/mapper`](./libs/mapper) | Schema-driven object mapping with compile-time completeness checking and type-safe property selectors |\n| [`@cleverbrush/react-form`](./libs/react-form) | Headless, schema-driven form system for React — type-safe field binding, auto-field rendering, UI-agnostic |\n| [`@cleverbrush/schema-json`](./libs/schema-json) | Bidirectional JSON Schema conversion: `toJsonSchema()` + `fromJsonSchema()` with full type inference |\n| [`@cleverbrush/async`](./libs/async) | Async utilities: `Collector`, `debounce`, `throttle`, `retry` |\n| [`@cleverbrush/deep`](./libs/deep) | Deep operations on objects: deep equality, deep merge, flattening, hashing |\n| [`@cleverbrush/scheduler`](./libs/scheduler) | Cron-like job scheduler for Node.js using worker threads |\n| [`@cleverbrush/knex-clickhouse`](./libs/knex-clickhouse) | Knex query builder dialect for ClickHouse |\n\n---\n\n## Why @cleverbrush/schema?\n\nIf you have used Zod, Yup, or Joi, the fluent API will feel immediately familiar — with several important differences.\n\n### One schema, four capabilities\n\n```\n@cleverbrush/schema\n        │\n        ├── TypeScript inference     (InferType\u003ctypeof schema\u003e)\n        ├── Runtime validation       (.validate() / .validateAsync())\n        ├── @cleverbrush/mapper      (type-safe object mapping)\n        ├── @cleverbrush/react-form  (auto-generated, schema-driven forms)\n        └── @cleverbrush/schema-json (bidirectional JSON Schema)\n```\n\nDefine a schema once and get all four capabilities for free — no duplication between types, validators, mappers, and form configs.\n\n### Quick example\n\n```ts\nimport { object, string, number, InferType } from '@cleverbrush/schema';\n\nconst UserSchema = object({\n  name:  string().nonempty().minLength(2),\n  email: string().email(),\n  age:   number().min(18).optional(),\n});\n\n// TypeScript type — inferred automatically, no duplication\ntype User = InferType\u003ctypeof UserSchema\u003e;\n\n// Runtime validation\nconst result = UserSchema.validate({ name: 'Alice', email: 'alice@example.com' });\nif (result.valid) {\n  console.log(result.object); // typed as User\n} else {\n  const nameErrors = result.getErrorsFor((p) =\u003e p.name);\n  console.log(nameErrors.errors); // ['Name must be at least 2 characters']\n}\n\n// Standard Schema interop — pass directly to tRPC, TanStack Form, T3 Env, …\nconst validator = UserSchema['~standard'];\n```\n\n### Performance vs Zod\n\nBenchmarked with [Vitest bench](https://vitest.dev/guide/features.html#benchmarking) against Zod v4 on the same machine:\n\n| Benchmark | @cleverbrush/schema | Zod | Ratio |\n| --- | --- | --- | --- |\n| Array 100 objects — valid | 35,228 ops/s | 13,277 ops/s | **2.65× faster** |\n| Array 100 objects — invalid | 899,329 ops/s | 4,396 ops/s | **204× faster** |\n| Complex order — valid | 198,988 ops/s | 136,090 ops/s | **1.46× faster** |\n| Complex order — invalid | 884,706 ops/s | 26,106 ops/s | **33.9× faster** |\n| Flat object — valid | 1,001,194 ops/s | 840,725 ops/s | **1.19× faster** |\n| Flat object — invalid | 2,653,630 ops/s | 176,222 ops/s | **15.1× faster** |\n| Nested object — valid | 690,556 ops/s | 368,893 ops/s | **1.87× faster** |\n| Nested object — invalid | 2,739,319 ops/s | 87,245 ops/s | **31.4× faster** |\n| String — valid | 5,348,564 ops/s | 3,533,945 ops/s | **1.51× faster** |\n| String — invalid | 5,749,087 ops/s | 482,961 ops/s | **11.9× faster** |\n| Number — valid | 7,911,266 ops/s | 4,806,511 ops/s | **1.65× faster** |\n| Number — invalid | 5,387,475 ops/s | 637,513 ops/s | **8.45× faster** |\n| Union first branch | 1,925,508 ops/s | 1,529,547 ops/s | **1.26× faster** |\n| Union last branch | 676,107 ops/s | 732,682 ops/s | 0.92× |\n| Union no match — invalid | 5,873,118 ops/s | 385,453 ops/s | **15.2× faster** |\n\n**14 out of 15 benchmarks.** The early-exit optimization on invalid data produces especially large gains — up to 204× — because type errors are caught at the first failing field without evaluating the rest.\n\nRun the benchmarks yourself:\n```bash\nnpm run bench\n```\n\n### Bundle size vs competitors\n\n| Bundle | Gzipped | Notes |\n| --- | --- | --- |\n| `@cleverbrush/schema` (full) | **14 KB** | All builders + built-in extensions |\n| `@cleverbrush/schema/string` | **3.8 KB** | Sub-path import, one builder only |\n| `@cleverbrush/schema/object` | **5.8 KB** | Sub-path import, one builder only |\n| Zod v3 (full) | 14.4 KB | For reference |\n| Zod v4 (full) | **41 KB** | **3× larger than @cleverbrush/schema** |\n\nSub-path exports (`@cleverbrush/schema/string`, `/number`, `/object`, `/array`, `/core`) enable fine-grained tree-shaking for bundle-critical applications.\n\n### Competitive feature comparison\n\n| | @cleverbrush/schema | Zod | Yup | Joi |\n| --- | --- | --- | --- | --- |\n| TypeScript type inference | ✓ | ✓ | ~ | ✗ |\n| [Standard Schema v1](https://standardschema.dev/) | ✓ | ✓ | ✗ | ✗ |\n| **PropertyDescriptors** (runtime introspection) | ✓ | ✗ | ✗ | ✗ |\n| **Type-safe extension system** | ✓ | ✗ | ✗ | ✗ |\n| **Built-in object mapper** | ✓ | ✗ | ✗ | ✗ |\n| **Built-in form generation** | ✓ | ✗ | ✗ | ✗ |\n| Bidirectional JSON Schema | ✓ | ~ (output only) | ✗ | ✗ |\n| **External schema interop** (`extern()`) | ✓ | ✗ | ✗ | ✗ |\n| JSDoc comment preservation | ✓ | ✗ | ✗ | ✗ |\n| Immutable fluent API | ✓ | ✓ | ✗ | ✗ |\n| Zero runtime dependencies | ✓ | ✓ | ✗ | ✗ |\n| Bundle size (full, gzipped) | **14 KB** | 41 KB (v4) | ~19 KB | ~26 KB |\n\n**PropertyDescriptors** are the architectural differentiator. Every schema emits a structured descriptor tree at runtime — not just a black-box validator function. This is what enables the mapper to provide type-safe property selectors, react-form to auto-generate fields, and schema-json to produce accurate JSON Schema output. No other popular validation library exposes this level of runtime metadata.\n\n---\n\n## Code Quality\n\nEvery pull request must pass all of the following gates before merging — enforced by the CI pipeline:\n\n| Gate | Tool | What it checks |\n| --- | --- | --- |\n| **Linting** | [Biome](https://biomejs.dev/) | Code style, formatting, and static analysis across all packages and the website |\n| **Type checking** | TypeScript (strict mode) | Strict null-checks, no implicit `any`, full type coverage |\n| **Unit tests** | [Vitest](https://vitest.dev/) | Runtime behaviour + type-level tests (`expectTypeOf`) — coverage spans all builders, extensions, edge cases, and error paths |\n| **Build** | [tsup](https://tsup.egoist.dev/) + [Turbo](https://turbo.build/) | ESM output compiles cleanly with no TypeScript errors |\n| **Benchmarks** | Vitest bench | Performance regressions are visible before merge |\n\nRun everything locally before opening a PR:\n\n```bash\nnpm run lint        # Biome static analysis\nnpm run build       # compile all packages\nnpm test            # unit tests + type checks\nnpm run bench       # performance benchmarks\n```\n\n---\n\n## Development\n\nThis project uses [npm workspaces](https://docs.npmjs.com/cli/using-npm/workspaces) and [Turborepo](https://turbo.build/) for incremental builds. All library source is under `libs/`.\n\n### Setup\n\n```bash\nnpm install\n```\n\n### Build\n\n```bash\nnpm run build\n```\n\n### Test\n\n```bash\nnpm test\n```\n\n### Documentation\n\nAPI docs are generated by [TypeDoc](https://typedoc.org/) and published at https://docs.cleverbrush.com/.\n\n```bash\nnpm run docs\n```\n\nEach library has its own `README.md` with usage examples and full API reference.\n\n---\n\n## Release\n\nThis project uses [Changesets](https://github.com/changesets/changesets) for versioning and publishing. All packages are versioned together.\n\n1. **Add a changeset** after making changes:\n\n   ```bash\n   npm run changeset\n   ```\n\n   Follow the prompts to describe the change. A changeset file is created in `.changeset/`.\n\n2. **Version packages** when ready to release:\n\n   ```bash\n   npm run version\n   ```\n\n   This bumps `package.json` versions and updates `CHANGELOG.md` files.\n\n3. **Publish** to npm:\n\n   ```bash\n   npm run release\n   ```\n\n   For a beta release:\n\n   ```bash\n   npm run publish:beta\n   ```\n\n---\n\n## Contributing\n\nContributions are welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) for full guidelines.\n\nThe short version: make sure your changes include tests, pass linting (`npm run lint`), and don't break existing tests (`npm test`). If you add or change behaviour, update the relevant JSDoc comments — that's all the documentation update that's usually needed.\n\nExtensions are the easiest place to start contributing — each one is a self-contained file with tests. Look for issues labelled **good first issue**.\n\n---\n\n## License\n\n[BSD-3-Clause](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleverbrush%2Fframework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleverbrush%2Fframework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleverbrush%2Fframework/lists"}