Thank you for your interest in contributing to Toast! This guide will help you get started with contributing to the project.
- Development Setup
- Development Workflow
- Testing
- Code Style
- Submitting Changes
- Reporting Issues
- Feature Requests
-
Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/toast.git cd toast -
Install dependencies
mix deps.get
-
Set up the demo application
cd demo mix setup
Toast includes a demo application in the demo/ directory that makes development easier. We've created Mix tasks to streamline the development process:
-
Switch to local development mode
cd demo mix mode.localThis creates a symlink from
demo/deps/toastto your local toast project, allowing you to see changes immediately. -
Check current mode
mix mode
This shows whether you're using the local version or the published Hex package.
-
Switch to published mode
mix mode.published
This uses the published Hex package, useful for testing the actual release.
cd demo
mix phx.serverVisit localhost:4000 to see the demo application with live examples of toast notifications.
# Run tests in the main project
mix test
# Run tests in the demo
cd demo && mix test- Make your changes to the toast library
- Ensure you're in local mode (
mix mode.localin the demo directory) - Test your changes in the demo application
- Write or update tests as needed
- Follow standard Elixir conventions
- Run the formatter before committing:
mix format - Write descriptive commit messages
- The JavaScript hook is in
assets/js/toast.js - Follow existing code patterns and style
- Styles are in
assets/css/toast.css
-
Create a feature branch from
devgit checkout dev git pull origin dev git checkout -b feature/your-feature-name
-
Make your changes
- Write clear, focused commits
- Include tests for new functionality
- Update documentation as needed
-
Ensure all tests pass
mix test mix format --check-formatted -
Push your branch and create a pull request
- IMPORTANT: Target the
devbranch, notmain - Provide a clear description of your changes
- Reference any related issues
- Include screenshots for UI changes
- IMPORTANT: Target the
- Target Branch: All PRs should target the
devbranch - Title: Use a clear, descriptive title
- Description: Explain what changes you made and why
- Testing: Describe how you tested your changes
- Breaking Changes: Clearly note any breaking changes
When reporting issues, please include:
- Elixir/Erlang versions (
elixir --version) - Phoenix version
- LiveView version
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Any error messages or logs
We welcome feature requests! Please:
- Check existing issues to avoid duplicates
- Provide a clear use case
- Explain why the feature would be valuable
- If possible, suggest an implementation approach
When ready to publish a new version:
- Update the version in
mix.exs - Update the CHANGELOG.md
- From the demo directory, run:
This automatically switches the demo to use the published version before publishing.
cd demo mix toast_publish
Feel free to open an issue for any questions about contributing. We're here to help!
Thank you for contributing to Toast! 🍞