Winnow Contributor Guide
You're contributing to Winnow, a Tailwind CSS class merging library for Clojure.
Quick Reference
sh
just test # Run all tests just lint # Run clj-kondo just docs # Regenerate doc/supported-classes.org
Key Files
| File | Purpose |
|---|---|
src/winnow/config.clj | All Tailwind utilities |
spec/winnow.txt | Conformance tests |
test/winnow/generative_test.clj | Property-based tests |
Adding a New Tailwind Class
- •
Determine the type:
- •Exact match (e.g.,
block,hidden) → add to:exactmap - •Prefix pattern (e.g.,
p-*,bg-*) → add to:prefixesmap
- •Exact match (e.g.,
- •
Edit
src/winnow/config.clj:clojure;; Exact match :exact {"new-class" :group-name} ;; Prefix pattern :prefixes {"new-prefix" {:group :group-name}} - •
Add conflicts if needed (in
:conflictsmap) - •
Add conformance test to
spec/winnow.txt:codeold-class new-class => new-class
- •
Run tests and regenerate docs:
shjust test && just docs
Code Style
- •No comments explaining code
- •No docstrings unless essential
- •Sort keys/values alphabetically
- •Align values in maps
- •Use
;;;section headers
Conformance Test Format
code
# Comment input-class-a input-class-b => expected-output # Multiple inputs with | set1-a set1-b | set2-a set2-b => merged-result
Property-Based Testing
Tests in generative_test.clj verify invariants:
- •Idempotence:
resolve(resolve(x)) = resolve(x) - •Output ⊆ Input
- •Modifier independence
- •Conflict symmetry
Before Submitting
- •
just lintpasses - •
just testpasses - •
just docsregenerated if config changed - •Commits are atomic with clear messages