Contributing to reflow

July 12, 2026 ยท View on GitHub

Thanks for your interest in contributing! ๐ŸŽ‰

We welcome bug fixes, new features, documentation improvements, and ecosystem integrations. This guide covers the expected workflow for contributing to reflow.

Quick Start

# Clone the repo
git clone https://github.com/valtors/reflow.git
cd reflow

# Install dependencies
npm install

# Run the full verification suite
npm run verify

Development

Scripts

CommandDescription
npm run buildBuild all entry points (ESM + CJS + DTS)
npm testRun tests with Vitest
npm run typecheckTypeScript type checking
npm run lintLint with Biome
npm run verifyFull CI check (typecheck + lint + test + build)
npm run lint:fixAuto-fix Biome lint issues where possible
npm run test:watchRun Vitest in watch mode

Project Structure

src/
โ”œโ”€โ”€ core/        # Framework-agnostic core (breakpoints, media, viewport, etc.)
โ”œโ”€โ”€ react/       # React hooks & components
โ”œโ”€โ”€ vue/         # Vue 3 composables
โ”œโ”€โ”€ svelte/      # Svelte stores
โ”œโ”€โ”€ styles/      # Fluid typography & CSS clamp utilities
โ”œโ”€โ”€ server/      # SSR helpers (Next.js, Express)
โ”œโ”€โ”€ testing/     # Test utilities & viewport mocking
โ””โ”€โ”€ tailwind/    # Tailwind CSS preset generation

Tests live in test/.

Architecture

All framework adapters (react/, vue/, svelte/) wrap the same core/ modules. When adding a feature:

  1. Implement the core logic in src/core/
  2. Add framework bindings in each adapter
  3. Write tests in test/

Code Style

  • We use Biome for linting and formatting
  • Run npx biome check --write src test to auto-fix
  • No ESLint or Prettier โ€” Biome handles both
  • Keep framework-specific code out of src/core/
  • Maintain SSR-safe behavior for public APIs

Testing

  • Framework: Vitest with happy-dom
  • Tests live in test/
  • Run npm test or npx vitest --watch
  • Add or update tests for any functional change

Submitting Changes

  1. Fork the repo and create a feature branch
  2. Make your changes
  3. Run npm run verify to ensure everything passes
  4. If your change affects users, add a changeset with npx changeset
  5. Open a PR with a clear description

Commit Convention

We follow Conventional Commits:

  • feat: โ€” New feature
  • fix: โ€” Bug fix
  • docs: โ€” Documentation
  • test: โ€” Tests
  • chore: โ€” Maintenance

PR Guidelines

  • Keep PRs focused โ€” one feature or fix per PR
  • Include tests for new features
  • Update JSDoc for public API changes
  • Ensure npm run verify passes
  • Link related issues or discussions when relevant

Reporting Issues

  • Use GitHub Issues
  • Include reproduction steps and environment details
  • Check existing issues before opening a new one

Community

License

By contributing, you agree that your contributions will be licensed under the MIT License.

For AI Agents

If you're an AI agent contributing to reflow, here's what you need to know:

  1. Run npm run verify before committing. This runs typecheck, lint, test, and build. It must pass.
  2. Use the existing hooks as templates. Copy the pattern from src/react/useBreakpoint.ts or src/solid/useBreakpoint.ts.
  3. Every hook must be SSR-safe. No window or document access without a guard.
  4. Export new hooks from the framework's index.ts.
  5. Add tests in test/ following the existing naming pattern.
  6. No comments in code unless logic is non-obvious.
  7. Keep zero runtime dependencies in core. Framework adapters may use framework-specific APIs.
  8. Commit messages: lowercase, short, no conventional commits prefix needed.

File Structure

src/
  core/           # Framework-agnostic (breakpoints, media, viewport, store)
  react/          # React hooks + components
  vue/            # Vue composables + plugin
  svelte/         # Svelte stores
  solid/          # Solid hooks
  qwik/           # Qwik adapters
  preact/         # Preact (reuses react/)
  angular/        # Angular wrappers
  lit/            # Lit adapters
  styles/         # CSS utilities (fluidClamp, viewport units)
  testing/        # Test utilities
  server/         # SSR helpers
  tailwind/       # Tailwind preset

Adding a Hook

  1. Create src/<framework>/useNewHook.ts
  2. Follow the pattern from an existing hook in the same framework
  3. Export from src/<framework>/index.ts
  4. Add a test in test/
  5. Run npm run verify
  6. Open a PR