Thank you for your interest in contributing to Effect Boxes! This guide covers everything you need to get started with development.
The project includes a flake.nix that provides Bun, Node.js, and all other
tools automatically. Nothing else to install.
git clone https://github.com/lloydrichards/proj_effect-boxes.git
cd proj_effect-boxes
# If you use direnv (recommended alongside nix):
direnv allow
# Otherwise, enter the dev shell manually:
nix develop
# Then install dependencies
bun installInstall these yourself:
- Bun runtime
- Node.js 24+
git clone https://github.com/lloydrichards/proj_effect-boxes.git
cd proj_effect-boxes
bun install# Run tests
bun test
# Run tests in watch mode
bun test --watch
# Type check
bun type-check
# Lint code
bun lint
# Format code
bun format
# Validate documentation
bun docs:check
# Run examples/scratchpad
bun run scratchsrc/
├── Box.ts # Core Box data type and operations
├── Annotation.ts # Text annotation system
├── Ansi.ts # ANSI terminal styling
├── Cmd.ts # Terminal control commands
├── Reactive.ts # Position tracking for interactive UIs
└── Width.ts # Text width calculations
tests/
├── box.test.ts # Core Box tests
├── ansi.test.ts # ANSI integration tests
└── *.test.ts # Additional test suites
scratchpad/ # Development playgroundThe scratchpad/ directory is your playground for experimenting with the
library:
# Create a test file
touch scratchpad/my-experiment.ts
# Run it
bun run scratchpad/my-experiment.ts
# Clean up when done
rm scratchpad/my-experiment.ts# Run a single test file
bun test tests/box.test.ts
# Run tests matching a pattern
bun test --grep "alignment"- Use regular
vitestfor pure functions that don't return Effect types - Use
@effect/vitestfor functions that return Effect types - Focus on testing mathematical properties and edge cases
- See existing tests in
tests/for patterns
This project uses Biome for linting and formatting. Run
bun lint and bun format before committing.
Key conventions:
- Pure functions with immutable data
- Use
pipe()for function composition - Implement Effect interfaces (
Pipeable,Equal,Hash) where appropriate - All public functions need JSDoc with
@exampleblocks
The demo GIF in the README is generated using VHS:
# Install VHS (macOS)
brew install vhs
# Generate the demo GIF
vhs media/demo.tapeThis project uses changesets for versioning and publishing.
When making a noteworthy change, add a changeset:
bun changesetFollow the prompts to:
- Select a semver bump type (patch/minor/major)
- Describe the change
This creates a markdown file in .changeset/.
- Commit the changeset along with your code changes
- Push to
main: CI detects pending changesets and opens a "Version Packages" PR - Merge the release PR: This bumps
package.json, updatesCHANGELOG.md, and removes consumed changeset files - Automatic publish: After merging, CI publishes to npm automatically
- Verify: Check GitHub Actions and npm
- Review inline TSDoc comments in
src/for API documentation - Check the API Reference for module guides
- Review AGENTS.md for detailed coding patterns (useful for AI assistants)
- Open an issue for bugs or feature requests