Thank you for considering contributing to the yabase project! This document explains how to contribute. We welcome all forms of contributions, including code contributions, documentation improvements, bug reports, and feature suggestions.
- Gleam 1.15 or later
- Erlang/OTP 26 or later
- just (task runner)
- mise (recommended for managing Gleam and Erlang versions)
git clone https://github.com/nao1215/yabase.git
cd yabasemise install # install Gleam and Erlang
gleam deps downloadjust cimainbranch is the latest stable version- Create new branches from
mainfor new features or bug fixes - Branch naming examples:
feature/add-base85-variant-- New featurefix/issue-123-- Bug fixdocs/update-readme-- Documentation update
This project follows these standards:
- Follow the Gleam language guide
- Keep the public API surface small -- use
pub opaque typewhere appropriate - Pure functions only -- no actors or OTP in this library
- Consistent module interfaces -- encode functions return
Stringfor total encodings,Result(String, CodecError)for constrained ones (Base85 Z85/Rfc1924, Bech32, Base58Check). Decode functions returnResult(BitArray, CodecError)for low-level modules,Result(Decoded, CodecError)foryabase.decode_multibase,Result(Bech32Decoded, CodecError)forbech32.decode, andResult(Base58CheckDecoded, CodecError)forbase58check.decode - Add doc comments to all public functions and types
- No
@externalunless absolutely necessary -- prefer pure Gleam implementations
Tests are organized by encoding module, mirroring the source structure.
- Test fixed vectors from RFCs or reference implementations
- Test roundtrip --
decode(encode(data)) == Ok(data)for a standard corpus - Test error cases -- invalid characters, invalid lengths, invalid padding positions
- Test edge cases -- empty input, single byte, leading zeros, all-zeros, high-bit bytes
just test # run all tests
just lint # run glinter
just check # format check, lint, typecheck, build, testWhen adding a new encoding:
- Create the encoding module in
src/yabase/(or a subdirectory for variants) - Implement
encodeanddecodefunctions with the standard signatures - Add the variant to
Encodingtype insrc/yabase/core/encoding.gleam - Add dispatch entries in
src/yabase/core/dispatcher.gleam(internal module) - Add facade shortcut functions in
src/yabase/facade.gleam - Add a multibase prefix mapping in
src/yabase/core/multibase.gleam(if applicable) - Add comprehensive tests in
test/ - Update the module table in
README.md
We actively encourage the use of AI coding assistants to improve productivity and code quality. Tools like Claude Code, GitHub Copilot, and Cursor are welcome for:
- Writing boilerplate code
- Generating comprehensive test cases
- Improving documentation
- Refactoring existing code
- Review all generated code: Always review and understand AI-generated code before committing
- Maintain consistency: Ensure AI-generated code follows the coding standards described in this document and the project's conventions
- Test thoroughly: AI-generated code must pass
just ci
-
Check or Create Issues
- Check if there are existing issues
- For major changes, discuss the approach in an issue first
-
Write Tests
- Always add tests for new features
- For bug fixes, create tests that reproduce the bug
-
Quality Check
just ci
- Create a Pull Request from your forked repository to the main repository
- PR title should briefly describe the changes
- Include the following in PR description:
- Purpose and content of changes
- Related issue number (if any)
- Test method
GitHub Actions automatically checks the following items:
- Format check:
gleam format --check - Lint:
gleam run -m glinter - Build:
gleam build - Test:
gleam test
Merging is not possible unless all checks pass.
When you find a bug, please create an issue with the following information:
-
Environment Information
- OS and version
- Gleam version
- Erlang/OTP version
- yabase version
-
Reproduction Steps
- Minimal code example to reproduce the bug
-
Expected and Actual Behavior
-
Error Messages or Stack Traces (if any)
The following activities are also greatly welcomed:
- Give a GitHub Star: Show your interest in the project
- Promote the Project: Introduce it in blogs, social media, study groups, etc.
- Become a GitHub Sponsor: Support available at https://github.com/sponsors/nao1215
- Documentation Improvements: Fix typos, improve clarity of explanations
- Feature Suggestions: Share new encoding ideas in issues
Contributions to this project are considered to be released under the project's license (MIT License).
Thank you again for considering contributing! We sincerely look forward to your participation.