cibule npm monorepo (@cibule scope)
  • TypeScript 97.1%
  • JavaScript 1.6%
  • Shell 0.7%
  • Dockerfile 0.6%
Find a file
Ladislav Brodecký 721b8ff81c
Some checks failed
CI / ci (push) Has been cancelled
chore: bump all packages to v0.6.5
2026-05-26 01:10:46 +02:00
.claude chore: upgrade kit to latest version 2026-03-26 18:31:32 +01:00
.github/workflows refactor: remove tsup/changesets, rename monokit→cibule, fix dts paths 2026-03-10 16:08:10 +01:00
packages chore: bump all packages to v0.6.5 2026-05-26 01:10:46 +02:00
.gitignore chore: upgrade kit to latest version 2026-03-26 18:31:32 +01:00
.gitlab-ci.yml fix(ci): update lockfile and cache key for bun.lock format 2026-03-11 00:53:48 +01:00
.lefthook.yml feat: add ESLint strict-type-checked, Prettier, and lefthook pre-commit hooks (#2) 2026-03-07 13:15:59 +00:00
.npmrc feat: initialize Nx monorepo workspace with bun and strict TypeScript (#1) 2026-03-07 13:06:00 +00:00
.prettierignore chore: bump all packages to v0.3.0 and update dependency ranges 2026-03-23 02:22:24 +01:00
.prettierrc feat: initialize Nx monorepo workspace with bun and strict TypeScript (#1) 2026-03-07 13:06:00 +00:00
bun.lock chore: bump all packages to v0.6.5 2026-05-26 01:10:46 +02:00
CHANGELOG.md chore: bump all packages to v0.6.5 2026-05-26 01:10:46 +02:00
CLAUDE.md feat(di): add pluggable ContextStorage and @cibule/di-async package 2026-03-28 14:10:10 +01:00
CONTRIBUTING.md refactor: remove tsup/changesets, rename monokit→cibule, fix dts paths 2026-03-10 16:08:10 +01:00
eslint.config.mjs feat(di): add pluggable ContextStorage and @cibule/di-async package 2026-03-28 14:10:10 +01:00
LICENSE docs: add root README, contributing guide, and MIT license (#33) 2026-03-09 23:41:36 +00:00
MEMORY.md chore: record v0.3.0 release in MEMORY.md 2026-03-23 00:53:05 +00:00
nx.json fix: externalize @cibule/* deps in esbuild, audit all package.json 2026-03-27 19:40:20 +01:00
package.json refactor: move heavy native deps to peerDependencies 2026-03-26 18:31:54 +01:00
PLAN.md refactor: remove tsup/changesets, rename monokit→cibule, fix dts paths 2026-03-10 16:08:10 +01:00
PRODUCT.md refactor: remove tsup/changesets, rename monokit→cibule, fix dts paths 2026-03-10 16:08:10 +01:00
README.md docs: add rate-limit README and update root README for project completion 2026-03-22 19:11:11 +00:00
TODO.md feat(db): add offset-based pagination to paginate() 2026-03-26 22:30:52 +01:00
tsconfig.base.json feat(di): add pluggable ContextStorage and @cibule/di-async package 2026-03-28 14:10:10 +01:00
tsconfig.json feat: initialize Nx monorepo workspace with bun and strict TypeScript (#1) 2026-03-07 13:06:00 +00:00
vitest.workspace.ts feat(di): add pluggable ContextStorage and @cibule/di-async package 2026-03-28 14:10:10 +01:00

@cibule

License: MIT npm

General-purpose infrastructure toolkit for TypeScript monorepos. Provides a modular set of npm packages covering dependency injection, database abstraction (D1/SQLite/Mock), storage abstraction (R2/S3/Local), image transformation, rate limiting, seed/migration tooling, and Nx generators for onion architecture scaffolding.

Built for TypeScript developers who use Nx monorepos and deploy to Cloudflare Workers, Node.js, or both.

Packages

Core

Package Description Dependencies
@cibule/di Lightweight, zero-dependency DI container none
@cibule/wiring Server wiring helpers with AsyncLocalStorage @cibule/di

Database

Package Description Dependencies
@cibule/db Driver-agnostic database abstraction (Kysely) kysely, @cibule/di
@cibule/db-sqlite SQLite driver (Node.js) better-sqlite3
@cibule/db-d1 Cloudflare D1 driver kysely-d1
@cibule/db-migrate Migration orchestrator (Prisma + D1 PRAGMA fixes) prisma, wrangler

Storage

Package Description Dependencies
@cibule/storage File storage abstraction + in-memory and local drivers @cibule/di
@cibule/storage-r2 Cloudflare R2 driver @cibule/storage
@cibule/storage-s3 AWS S3 driver @aws-sdk/client-s3

Image

Package Description Dependencies
@cibule/image Image transformation core @cibule/di, @cibule/storage
@cibule/image-sharp Sharp driver (Node.js) sharp
@cibule/image-cf Cloudflare Image Resizing driver CF Workers runtime

Rate Limiting

Package Description Dependencies
@cibule/rate-limit Rate limiting abstraction + in-memory and Cloudflare drivers @cibule/di

Tooling

Package Description Dependencies
@cibule/seed Seed orchestrator for databases and storage @cibule/db, @cibule/storage
@cibule/devkit Nx generators for onion architecture scaffolding @nx/devkit

Installation

Install only the packages you need. Each package is independently publishable.

# bun
bun add @cibule/di @cibule/db @cibule/db-sqlite

# npm
npm install @cibule/di @cibule/db @cibule/db-sqlite

# pnpm
pnpm add @cibule/di @cibule/db @cibule/db-sqlite

Quick Start

import { Injector } from '@cibule/di';
import { DB_ACCESSOR } from '@cibule/db';
import { provideSqliteDb } from '@cibule/db-sqlite';

// Create the injector with SQLite database providers
const injector = Injector.create({
  providers: [provideSqliteDb(':memory:')],
});

// Resolve the database accessor and run queries
const getDb = injector.get(DB_ACCESSOR);
const users = await getDb().selectFrom('users').selectAll().execute();

See individual package READMEs for detailed API documentation and examples.

Architecture

@cibule follows a driver separation principle: core packages define interfaces and include lightweight implementations (mock, in-memory, local filesystem), while platform-specific drivers live in separate packages with their heavy dependencies.

@cibule/di (zero deps)
  |
  +-- @cibule/db (Kysely)
  |     +-- @cibule/db-sqlite (better-sqlite3)
  |     +-- @cibule/db-d1 (kysely-d1)
  |     +-- @cibule/db-migrate (prisma, wrangler)
  |
  +-- @cibule/storage
  |     +-- @cibule/storage-r2 (R2 binding)
  |     +-- @cibule/storage-s3 (@aws-sdk/client-s3)
  |
  +-- @cibule/image
  |     +-- @cibule/image-sharp (sharp)
  |     +-- @cibule/image-cf (CF Image Resizing)
  |
  +-- @cibule/rate-limit (in-memory + CF binding)
  +-- @cibule/seed (db + storage)
  +-- @cibule/wiring (di)
  +-- @cibule/devkit (@nx/devkit)

This means you only pull in the native addons and platform-specific SDKs you actually use.

Development

Requires Node.js >= 20 and bun >= 1.3.

# Install dependencies
bun install

# Build all packages
nx run-many --target=build --all

# Test all packages
nx run-many --target=test --all

# Lint all packages
nx run-many --target=lint --all

# Test a single package
nx test @cibule/di

# Build a single package
nx build @cibule/di

Pre-commit hooks (via lefthook) enforce Prettier formatting and ESLint rules on staged files.

See CONTRIBUTING.md for the full development guide.

License

MIT