Thank you for your interest in contributing to esm.do! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Workflow
- Commit Message Format
- Pull Request Process
- Release Process
- Coding Standards
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
- Node.js >= 18.0.0
- pnpm (recommended) or npm
- Git
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/esm.git cd esm - Install dependencies:
pnpm install
- Build the project:
pnpm build
- Run tests to verify setup:
pnpm test
main- Production-ready codefeature/*- New featuresfix/*- Bug fixesdocs/*- Documentation updatesrefactor/*- Code refactoring
git checkout main
git pull origin main
git checkout -b feature/your-feature-name- Make your changes in the feature branch
- Write or update tests as needed
- Ensure all tests pass:
pnpm test - Check types:
pnpm typecheck - Build the project:
pnpm build
We use Conventional Commits for our commit messages. This enables automatic changelog generation and semantic versioning.
<type>(<scope>): <subject>
[optional body]
[optional footer(s)]
| Type | Description | Version Bump |
|---|---|---|
feat |
A new feature | Minor |
fix |
A bug fix | Patch |
docs |
Documentation changes | - |
style |
Code style changes (formatting, semicolons) | - |
refactor |
Code changes that neither fix bugs nor add features | Patch |
perf |
Performance improvements | Patch |
test |
Adding or updating tests | - |
build |
Build system or dependencies | - |
ci |
CI/CD configuration | - |
chore |
Other changes (maintenance, tooling) | - |
revert |
Reverting a previous commit | - |
# Feature
feat(parser): add support for ES2024 syntax
# Bug fix
fix(loader): handle circular dependencies correctly
# Breaking change
feat(api)!: change module resolution algorithm
BREAKING CHANGE: The module resolution now follows Node.js ESM semantics.
# With scope
docs(readme): update installation instructions
# Without scope
chore: update dependenciesFor breaking changes, either:
- Add
!after the type/scope:feat(api)!: description - Include
BREAKING CHANGE:in the footer
feat(core)!: redesign module loading API
BREAKING CHANGE: The `load()` function now returns a Promise instead of
the module directly. Migrate by awaiting the result.- Update documentation - If your changes affect the public API, update the README or relevant docs
- Add tests - All new features should have tests; bug fixes should have regression tests
- Run checks locally:
pnpm test pnpm typecheck pnpm build - Create a changeset (if applicable):
pnpm changeset
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub
-
Fill out the PR template:
- Title: Use conventional commit format (e.g.,
feat(parser): add ES2024 support) - Description: Explain what changes you made and why
- Testing: Describe how to test your changes
- Checklist: Ensure all items are checked
- Title: Use conventional commit format (e.g.,
- At least one maintainer must approve the PR
- All CI checks must pass
- Any requested changes must be addressed
- Once approved, a maintainer will merge the PR
Your changes will be included in the next release. The changelog will be automatically updated based on your commit messages.
We use Changesets for version management and releases.
When you make changes that should be included in a release:
pnpm changesetThis will prompt you to:
- Select the type of change (major, minor, patch)
- Write a summary of your changes
-
Prepare release:
pnpm changeset version
-
Review changes:
- Check CHANGELOG.md updates
- Verify version bumps
-
Create release:
pnpm release
This will:
- Build the project
- Publish to npm
- Create a git tag
- Create a GitHub release
For automated releases via CI, we also support semantic-release. Configuration is in .releaserc.json.
- Use TypeScript for all source files
- Enable strict mode
- Avoid
any- use proper types orunknown - Export types along with implementations
- We use ESLint for linting
- Run
pnpm lintto check code style - Prefer
constoverlet - Use template literals for string interpolation
- Use async/await over raw promises
esm/
core/ # Core library package
src/ # Source files
tests/ # Tests for core
src/ # Main package source
scripts/ # Build and release scripts
tests/ # Integration tests
docs/ # Documentation
- Write unit tests for new functionality
- Place tests in
tests/directory or adjacent to source files - Use descriptive test names:
it('should handle circular imports') - Test edge cases and error conditions
- Add JSDoc comments for public APIs
- Keep README.md up to date
- Include code examples where helpful
If you have questions about contributing, please:
- Check existing issues and discussions
- Open a new issue with the
questionlabel - Reach out on our community channels
Thank you for contributing to esm.do!