A collection of utilities and custom change source implementations for @rocicorp/zero
- Introduction
- Repository Structure
- Getting Started
- Usage
- Development
- Versioning & Releases
- Contributing
- Roadmap & Future Plans
- License
- Acknowledgments
This monorepo hosts various utilities and custom change source implementations designed to integrate with @rocicorp/zero
. The primary goal is to provide building blocks and ready-to-use change sources for developers looking to extend or customize Zero’s caching and synchronization features.
- Tools: Yarn v4 Workspaces + Turborepo for streamlined development.
- Tech Stack: TypeScript code running on Node.js v22+ (Deno + Bun support pending community interest).
- Framework: NestJS for custom change source implementations in the
apps/
folder. - Deployment: Custom change sources can be containerized via Docker.
Note
This repo is actively maintained and open to community feedback. If you have questions or requests (e.g., example demos), feel free to open an issue or pull request.
Here is an overview of the repository layout. We use Yarn Workspaces to manage multiple packages (both libraries and apps), and Turborepo for caching and running tasks in parallel.
.
├── apps/
│ ├── source-mongoose/ # zero change source for MongoDB/Mongoose
│ └── ... # (TODO) other custom change sources
├── libs/
│ ├── eslint-config/ # shared ESLint config
│ ├── tsconfig/ # shared TSConfig
│ ├── zero/ # re-export of select parts of @rocicorp/zero in CommonJS format
│ └── zero-nest-mongoose/ # utilities to generate zero schemas from @nestjs/mongoose entities
├── LICENSE.md # license file
├── README.md # this README file
└── ... # other files
- Contains custom change source implementations for
@rocicorp/zero
. - Typically built with NestJS unless otherwise noted in the app’s README.
- Meant to be deployable as Docker containers (but may support other deployment strategies in the future).
- Contains library code that can be reused across multiple apps.
- Each library is published as a separate npm package.
- All library code is written in TypeScript.
- Node.js version 22.x (or higher)
- Yarn (v4 or later)
- (Optional) Docker if you intend to build Docker images for the custom change sources.
-
Clone the repo:
git clone https://github.com/cbnsndwch/zero-sources.git cd zero-utilities-monorepo
-
Install dependencies and build the libraries:
yarn && yarn build
This will bootstrap all the workspace packages and install each package’s dependencies.
The following global scripts are available (run from the repo root):
yarn build
: Builds all apps and libraries in the repo.yarn build:libs
": Builds all libraries in the repo.yarn dev
: Runs thedeb
script across all apps and libraries that define one.yarn lint
: Runs eslint across all packages.yarn format
: Runs prettier across all workspaces.
You can also navigate into specific packages and run scripts locally, but using turbo
allows for caching and parallelization.
TDB
Note: Since these libraries are intended to complement
@rocicorp/zero
, check each library’s individualREADME.md
for usage details (e.g., required config or environment variables).
TDB
This section describes how to develop in the monorepo.
TDB
- Root Build: Compiles all TypeScript packages, outputting them into each package’s designated
dist
folder.
yarn && yarn build
- Per Package: You can also build individual packages:
yarn && yarn build --filter apps/...
OR
yarn && yarn build --filter libs/...
TDB
This repository follows Semantic Versioning (SemVer). Each package in this monorepo will use the standard versioning scheme MAJOR.MINOR.PATCH
:
- MAJOR – incompatible API changes.
- MINOR – add functionality in a backward-compatible manner.
- PATCH – backward-compatible bug fixes.
Once we set up an automated release process (e.g., using changesets or a similar tool), we’ll update this section with details on how to bump versions and publish new releases.
Contributions are welcome! I’d love your help in making this project better.
- Fork the repository
- Create a feature or bugfix branch
- Commit your changes with clear commit messages
- Open a Pull Request (PR)
I’ll review your PR as soon as possible. For major changes, please open an issue or ping @cbnsndwch
in the Rocicorp Discord server first to discuss the proposed modifications.
If you’re not sure where to start, feel free to check the open issues or suggest new ideas!
Here are some of our future plans and directions:
- GitHub Actions: Add workflows for CI (build, test, lint) and maybe automated Docker builds.
- Examples & Demos: Provide concrete usage examples or a sample application demonstrating how these libraries integrate with
@rocicorp/zero
. - Docker Support: Improve Docker image building processes (multi-stage builds, smaller images).
- Extended Documentation: Each library and app might get deeper documentation, usage guides, or best practices for integration with Zero.
- Additional Change Source Implementations: Based on community feedback or personal needs.
Don’t see something you need? Open an issue or Join the discussion to suggest improvements.
This project is licensed under the MIT License. See the license file for more details.
- Thanks to @rocicorp/zero for providing the base technology this repo extends. If you're new to Zero, check out Zero's Documentation for a great introduction.
- NestJS – for powering our server-side apps.
- The community – your feedback and contributions help shape this project’s future.
Happy syncing, and welcome to the repo!