Skip to content

Commit 5609c42

Browse files
prdaiclaude
andauthored
docs: OSS community docs — Code of Conduct, Contributing, Changelog (#3)
- CODE_OF_CONDUCT.md: Contributor Covenant 2.1, BitByBit (B3) / prdai as community leaders, enforcement contacts. - CONTRIBUTING.md: adapted to our setup — fork from main, bun + Biome + Lefthook + tests, dev workflow and hook behavior. - CHANGELOG.md: Keep a Changelog format with the initial Unreleased set. - README: add Contributing section linking the above. Co-authored-by: prdai <prdai@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 63fe5a0 commit 5609c42

4 files changed

Lines changed: 187 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
- `cloudflareKVCache(kv, options?)` factory and `CloudflareKVCache` class — a
13+
Cloudflare KV-backed implementation of Drizzle ORM's query cache interface.
14+
- `explicit` (default) and `all` caching strategies.
15+
- Per-table reverse index for invalidation on mutation, storing full storage keys.
16+
- Tag-based caching and invalidation: `.$withCache({ tag })` entries are stored
17+
under `{prefix}:t:{tag}` and dropped via `invalidate({ tags })`.
18+
- TTL resolution from `ex` (seconds) and `px` (milliseconds), clamped to KV's
19+
60-second minimum; configurable `defaultTtlSeconds` and key `prefix`.
20+
- Documentation site (Astro + Starlight) deployed to Cloudflare Workers.
21+
22+
[Unreleased]: https://github.com/BitByBit-B3/drizzle-cloudflare-kv-cache-adapter/commits/main

CODE_OF_CONDUCT.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
- Demonstrating empathy and kindness toward other people
14+
- Being respectful of differing opinions, viewpoints, and experiences
15+
- Giving and gracefully accepting constructive feedback
16+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
- Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
- Trolling, insulting or derogatory comments, and personal or political attacks
23+
- Public or private harassment
24+
- Publishing others’ private information, such as a physical or email address, without their explicit permission
25+
- Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
34+
35+
## Enforcement
36+
37+
This project is maintained by the **BitByBit (B3)** organization, with **prdai** as the lead maintainer.
38+
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [bitbybit0123@gmail.com](mailto:bitbybit0123@gmail.com), or directly to the lead maintainer at [go2ranuga@gmail.com](mailto:go2ranuga@gmail.com). All complaints will be reviewed and investigated promptly and fairly.
40+
41+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42+
43+
## Enforcement Guidelines
44+
45+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46+
47+
### 1. Correction
48+
49+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50+
51+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52+
53+
### 2. Warning
54+
55+
**Community Impact**: A violation through a single incident or series of actions.
56+
57+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58+
59+
### 3. Temporary Ban
60+
61+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62+
63+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64+
65+
### 4. Permanent Ban
66+
67+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68+
69+
**Consequence**: A permanent ban from any sort of public interaction within the community.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
74+
75+
For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq.

CONTRIBUTING.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Contributing to drizzle-cloudflare-kv-cache-adapter
2+
3+
Thank you for considering contributing! This project is maintained by the **BitByBit (B3)** organization (lead maintainer: **prdai**), and we welcome contributions from the community.
4+
5+
## How to Contribute
6+
7+
### Reporting Bugs
8+
9+
If you encounter a bug, please [open an issue](https://github.com/BitByBit-B3/drizzle-cloudflare-kv-cache-adapter/issues) with:
10+
11+
- A clear and descriptive title
12+
- A detailed description of the bug
13+
- Steps to reproduce it (ideally a minimal repro)
14+
- Your `drizzle-orm` version and runtime (Workers, Node, etc.)
15+
- Any relevant logs or code snippets
16+
17+
### Suggesting Enhancements
18+
19+
Have an idea to improve the project? Open an issue with:
20+
21+
- A clear and descriptive title
22+
- A detailed description of the enhancement and the problem it solves
23+
- Any relevant examples or API sketches
24+
25+
### Submitting Pull Requests
26+
27+
1. Fork the repository and create your branch from `main`.
28+
2. Make your change. If you add or change behavior, **add tests**.
29+
3. Run the full check suite locally (see below) and make sure it passes.
30+
4. Open a pull request with a clear description and reference any related issues.
31+
32+
## Development Setup
33+
34+
This project uses [Bun](https://bun.sh) as the package manager.
35+
36+
```sh
37+
# install dependencies (also installs the git hooks via lefthook)
38+
bun install
39+
40+
# run the test suite
41+
bun test
42+
43+
# type-check
44+
bun run typecheck
45+
46+
# lint + format check
47+
bun run lint
48+
49+
# auto-fix formatting and safe lint issues
50+
bun run format
51+
52+
# build the library (ESM + types)
53+
bun run build
54+
```
55+
56+
The documentation site lives in [`docs/`](./docs) and is a separate package:
57+
58+
```sh
59+
cd docs
60+
bun install
61+
bun run dev # local preview
62+
bun run build # static build
63+
```
64+
65+
## Git Hooks
66+
67+
[Lefthook](https://lefthook.dev) is installed automatically on `bun install`:
68+
69+
- **pre-commit** — runs [Biome](https://biomejs.dev) on staged files (lint + format, auto-fixing where safe).
70+
- **pre-push** — runs `typecheck`, `test`, and `build`.
71+
72+
If you ever need to bypass a hook in an emergency, use `git commit --no-verify` (please don't make a habit of it).
73+
74+
## Code Style
75+
76+
Code style is enforced by Biome (single quotes, no semicolons, 2-space indent). Run `bun run format` before committing — the pre-commit hook will also handle it. Match the conventions already present in the surrounding code.
77+
78+
## Changelog
79+
80+
User-facing changes should be noted in [`CHANGELOG.md`](./CHANGELOG.md) under the `[Unreleased]` section, following the [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format.
81+
82+
## Code of Conduct
83+
84+
This project adheres to a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold it.
85+
86+
Thank you for contributing! 🙌

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ bun run typecheck
132132
bun run build
133133
```
134134

135+
## Contributing
136+
137+
Contributions are welcome! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for the dev setup and PR workflow, and our [Code of Conduct](./CODE_OF_CONDUCT.md). Notable changes are tracked in [CHANGELOG.md](./CHANGELOG.md).
138+
135139
## License
136140

137141
[MIT](./LICENSE) © BitByBit-B3

0 commit comments

Comments
 (0)